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.ActivityThread; 32 import android.app.AppOpsManager; 33 import android.app.Application; 34 import android.app.AutomaticZenRule; 35 import android.app.NotificationChannel; 36 import android.app.NotificationManager; 37 import android.app.SearchManager; 38 import android.app.WallpaperManager; 39 import android.compat.annotation.UnsupportedAppUsage; 40 import android.content.ComponentName; 41 import android.content.ContentResolver; 42 import android.content.ContentValues; 43 import android.content.Context; 44 import android.content.IContentProvider; 45 import android.content.Intent; 46 import android.content.pm.ActivityInfo; 47 import android.content.pm.ApplicationInfo; 48 import android.content.pm.PackageManager; 49 import android.content.pm.ResolveInfo; 50 import android.content.res.Configuration; 51 import android.content.res.Resources; 52 import android.database.Cursor; 53 import android.database.SQLException; 54 import android.location.ILocationManager; 55 import android.location.LocationManager; 56 import android.net.ConnectivityManager; 57 import android.net.NetworkScoreManager; 58 import android.net.Uri; 59 import android.net.wifi.SoftApConfiguration; 60 import android.net.wifi.WifiManager; 61 import android.net.wifi.p2p.WifiP2pManager; 62 import android.os.BatteryManager; 63 import android.os.Binder; 64 import android.os.Build; 65 import android.os.Build.VERSION_CODES; 66 import android.os.Bundle; 67 import android.os.DropBoxManager; 68 import android.os.IBinder; 69 import android.os.LocaleList; 70 import android.os.PowerManager; 71 import android.os.PowerManager.AutoPowerSaveModeTriggers; 72 import android.os.Process; 73 import android.os.RemoteCallback; 74 import android.os.RemoteException; 75 import android.os.ResultReceiver; 76 import android.os.ServiceManager; 77 import android.os.UserHandle; 78 import android.speech.tts.TextToSpeech; 79 import android.text.TextUtils; 80 import android.util.AndroidException; 81 import android.util.ArrayMap; 82 import android.util.ArraySet; 83 import android.util.Log; 84 import android.util.MemoryIntArray; 85 import android.view.Display; 86 import android.view.Window; 87 import android.view.WindowManager.LayoutParams; 88 89 import com.android.internal.annotations.GuardedBy; 90 import com.android.internal.util.Preconditions; 91 import com.android.internal.widget.ILockSettings; 92 93 import java.io.IOException; 94 import java.lang.annotation.ElementType; 95 import java.lang.annotation.Retention; 96 import java.lang.annotation.RetentionPolicy; 97 import java.lang.annotation.Target; 98 import java.lang.reflect.Field; 99 import java.net.URISyntaxException; 100 import java.util.ArrayList; 101 import java.util.HashMap; 102 import java.util.HashSet; 103 import java.util.List; 104 import java.util.Map; 105 import java.util.Objects; 106 import java.util.Set; 107 /** 108 * The Settings provider contains global system-level device preferences. 109 */ 110 public final class Settings { 111 /** @hide */ 112 public static final boolean DEFAULT_OVERRIDEABLE_BY_RESTORE = false; 113 114 // Intent actions for Settings 115 116 /** 117 * Activity Action: Show system settings. 118 * <p> 119 * Input: Nothing. 120 * <p> 121 * Output: Nothing. 122 */ 123 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 124 public static final String ACTION_SETTINGS = "android.settings.SETTINGS"; 125 126 /** 127 * Activity Action: Show settings to allow configuration of APNs. 128 * <p> 129 * Input: Nothing. 130 * <p> 131 * Output: Nothing. 132 * 133 * <p class="note"> 134 * In some cases, a matching Activity may not exist, so ensure you 135 * safeguard against this. 136 */ 137 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 138 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS"; 139 140 /** 141 * Activity Action: Show settings to allow configuration of current location 142 * sources. 143 * <p> 144 * In some cases, a matching Activity may not exist, so ensure you 145 * safeguard against this. 146 * <p> 147 * Input: Nothing. 148 * <p> 149 * Output: Nothing. 150 */ 151 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 152 public static final String ACTION_LOCATION_SOURCE_SETTINGS = 153 "android.settings.LOCATION_SOURCE_SETTINGS"; 154 155 /** 156 * Activity Action: Show settings to allow configuration of location controller extra package. 157 * <p> 158 * In some cases, a matching Activity may not exist, so ensure you 159 * safeguard against this. 160 * <p> 161 * Input: Nothing. 162 * <p> 163 * Output: Nothing. 164 * 165 * @hide 166 */ 167 @SystemApi 168 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 169 public static final String ACTION_LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS = 170 "android.settings.LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS"; 171 172 /** 173 * Activity Action: Show scanning settings to allow configuration of Wi-Fi 174 * and Bluetooth scanning settings. 175 * <p> 176 * In some cases, a matching Activity may not exist, so ensure you 177 * safeguard against this. 178 * <p> 179 * Input: Nothing. 180 * <p> 181 * Output: Nothing. 182 * @hide 183 */ 184 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 185 public static final String ACTION_LOCATION_SCANNING_SETTINGS = 186 "android.settings.LOCATION_SCANNING_SETTINGS"; 187 188 /** 189 * Activity Action: Show settings to allow configuration of users. 190 * <p> 191 * In some cases, a matching Activity may not exist, so ensure you 192 * safeguard against this. 193 * <p> 194 * Input: Nothing. 195 * <p> 196 * Output: Nothing. 197 * @hide 198 */ 199 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 200 public static final String ACTION_USER_SETTINGS = 201 "android.settings.USER_SETTINGS"; 202 203 /** 204 * Activity Action: Show settings to allow configuration of wireless controls 205 * such as Wi-Fi, Bluetooth and Mobile networks. 206 * <p> 207 * In some cases, a matching Activity may not exist, so ensure you 208 * safeguard against this. 209 * <p> 210 * Input: Nothing. 211 * <p> 212 * Output: Nothing. 213 */ 214 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 215 public static final String ACTION_WIRELESS_SETTINGS = 216 "android.settings.WIRELESS_SETTINGS"; 217 218 /** 219 * Activity Action: Show tether provisioning activity. 220 * 221 * <p> 222 * In some cases, a matching Activity may not exist, so ensure you 223 * safeguard against this. 224 * <p> 225 * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type 226 * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should 227 * contain a {@link ResultReceiver} which will be called back with a tether result code. 228 * <p> 229 * Output: The result of the provisioning check. 230 * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful, 231 * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure. 232 * 233 * @hide 234 */ 235 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 236 @SystemApi 237 public static final String ACTION_TETHER_PROVISIONING_UI = 238 "android.settings.TETHER_PROVISIONING_UI"; 239 240 /** 241 * Activity Action: Show settings to allow entering/exiting airplane mode. 242 * <p> 243 * In some cases, a matching Activity may not exist, so ensure you 244 * safeguard against this. 245 * <p> 246 * Input: Nothing. 247 * <p> 248 * Output: Nothing. 249 */ 250 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 251 public static final String ACTION_AIRPLANE_MODE_SETTINGS = 252 "android.settings.AIRPLANE_MODE_SETTINGS"; 253 254 /** 255 * Activity Action: Show mobile data usage list. 256 * <p> 257 * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify 258 * how and what mobile data statistics should be collected. 259 * <p> 260 * Output: Nothing 261 * @hide 262 */ 263 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 264 public static final String ACTION_MOBILE_DATA_USAGE = 265 "android.settings.MOBILE_DATA_USAGE"; 266 267 /** @hide */ 268 public static final String EXTRA_NETWORK_TEMPLATE = "network_template"; 269 270 /** 271 * The return values for {@link Settings.Config#set} 272 * @hide 273 */ 274 @IntDef(prefix = "SET_ALL_RESULT_", 275 value = { SET_ALL_RESULT_FAILURE, SET_ALL_RESULT_SUCCESS, SET_ALL_RESULT_DISABLED }) 276 @Retention(RetentionPolicy.SOURCE) 277 @Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE}) 278 public @interface SetAllResult {} 279 280 /** 281 * A return value for {@link #KEY_CONFIG_SET_ALL_RETURN}, indicates failure. 282 * @hide 283 */ 284 public static final int SET_ALL_RESULT_FAILURE = 0; 285 286 /** 287 * A return value for {@link #KEY_CONFIG_SET_ALL_RETURN}, indicates success. 288 * @hide 289 */ 290 public static final int SET_ALL_RESULT_SUCCESS = 1; 291 292 /** 293 * A return value for {@link #KEY_CONFIG_SET_ALL_RETURN}, indicates a set all is disabled. 294 * @hide 295 */ 296 public static final int SET_ALL_RESULT_DISABLED = 2; 297 298 /** @hide */ 299 public static final String KEY_CONFIG_SET_ALL_RETURN = "config_set_all_return"; 300 301 /** @hide */ 302 public static final String KEY_CONFIG_IS_SYNC_DISABLED_RETURN = 303 "config_is_sync_disabled_return"; 304 305 /** 306 * An int extra specifying a subscription ID. 307 * 308 * @see android.telephony.SubscriptionInfo#getSubscriptionId 309 */ 310 public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID"; 311 312 /** 313 * Activity Action: Modify Airplane mode settings using a voice command. 314 * <p> 315 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 316 * <p> 317 * This intent MUST be started using 318 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity 319 * startVoiceActivity}. 320 * <p> 321 * Note: The activity implementing this intent MUST verify that 322 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before 323 * modifying the setting. 324 * <p> 325 * Input: To tell which state airplane mode should be set to, add the 326 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified. 327 * If the extra is not included, no changes will be made. 328 * <p> 329 * Output: Nothing. 330 */ 331 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 332 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE = 333 "android.settings.VOICE_CONTROL_AIRPLANE_MODE"; 334 335 /** 336 * Activity Action: Show settings for accessibility modules. 337 * <p> 338 * In some cases, a matching Activity may not exist, so ensure you 339 * safeguard against this. 340 * <p> 341 * Input: Nothing. 342 * <p> 343 * Output: Nothing. 344 */ 345 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 346 public static final String ACTION_ACCESSIBILITY_SETTINGS = 347 "android.settings.ACCESSIBILITY_SETTINGS"; 348 349 /** 350 * Activity Action: Show detail settings of a particular accessibility service. 351 * <p> 352 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 353 * <p> 354 * Input: {@link Intent#EXTRA_COMPONENT_NAME} must specify the accessibility service component 355 * name to be shown. 356 * <p> 357 * Output: Nothing. 358 * @hide 359 **/ 360 @SystemApi 361 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 362 public static final String ACTION_ACCESSIBILITY_DETAILS_SETTINGS = 363 "android.settings.ACCESSIBILITY_DETAILS_SETTINGS"; 364 365 /** 366 * Activity Action: Show settings to allow configuration of Reduce Bright Colors. 367 * <p> 368 * In some cases, a matching Activity may not exist, so ensure you 369 * safeguard against this. 370 * <p> 371 * Input: Nothing. 372 * <p> 373 * Output: Nothing. 374 * @hide 375 */ 376 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 377 public static final String ACTION_REDUCE_BRIGHT_COLORS_SETTINGS = 378 "android.settings.REDUCE_BRIGHT_COLORS_SETTINGS"; 379 380 /** 381 * Activity Action: Show settings to control access to usage information. 382 * <p> 383 * In some cases, a matching Activity may not exist, so ensure you 384 * safeguard against this. 385 * <p> 386 * Input: Nothing. 387 * <p> 388 * Output: Nothing. 389 */ 390 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 391 public static final String ACTION_USAGE_ACCESS_SETTINGS = 392 "android.settings.USAGE_ACCESS_SETTINGS"; 393 394 /** 395 * Activity Category: Show application settings related to usage access. 396 * <p> 397 * An activity that provides a user interface for adjusting usage access related 398 * preferences for its containing application. Optional but recommended for apps that 399 * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}. 400 * <p> 401 * The activity may define meta-data to describe what usage access is 402 * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which 403 * will be displayed in Settings. 404 * <p> 405 * Input: Nothing. 406 * <p> 407 * Output: Nothing. 408 */ 409 @SdkConstant(SdkConstantType.INTENT_CATEGORY) 410 public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG = 411 "android.intent.category.USAGE_ACCESS_CONFIG"; 412 413 /** 414 * Metadata key: Reason for needing usage access. 415 * <p> 416 * A key for metadata attached to an activity that receives action 417 * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the 418 * user as description of how the app uses usage access. 419 * <p> 420 */ 421 public static final String METADATA_USAGE_ACCESS_REASON = 422 "android.settings.metadata.USAGE_ACCESS_REASON"; 423 424 /** 425 * Activity Action: Show settings to allow configuration of security and 426 * location privacy. 427 * <p> 428 * In some cases, a matching Activity may not exist, so ensure you 429 * safeguard against this. 430 * <p> 431 * Input: Nothing. 432 * <p> 433 * Output: Nothing. 434 */ 435 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 436 public static final String ACTION_SECURITY_SETTINGS = 437 "android.settings.SECURITY_SETTINGS"; 438 439 /** 440 * Activity Action: Show settings to allow configuration of trusted external sources 441 * 442 * Input: Optionally, the Intent's data URI can specify the application package name to 443 * directly invoke the management GUI specific to the package name. For example 444 * "package:com.my.app". 445 * <p> 446 * Output: Nothing. 447 */ 448 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 449 public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES = 450 "android.settings.MANAGE_UNKNOWN_APP_SOURCES"; 451 452 /** 453 * Activity Action: Show settings to allow configuration of 454 * {@link Manifest.permission#SCHEDULE_EXACT_ALARM} permission 455 * 456 * Input: Optionally, the Intent's data URI can specify the application package name to 457 * directly invoke the management GUI specific to the package name. For example 458 * "package:com.my.app". 459 * <p> 460 * Output: When a package data uri is passed as input, the activity result is set to 461 * {@link android.app.Activity#RESULT_OK} if the permission was granted to the app. Otherwise, 462 * the result is set to {@link android.app.Activity#RESULT_CANCELED}. 463 */ 464 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 465 public static final String ACTION_REQUEST_SCHEDULE_EXACT_ALARM = 466 "android.settings.REQUEST_SCHEDULE_EXACT_ALARM"; 467 468 /** 469 * Activity Action: Show settings to allow configuration of 470 * {@link Manifest.permission#MANAGE_MEDIA} 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: Nothing. 477 */ 478 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 479 public static final String ACTION_REQUEST_MANAGE_MEDIA = 480 "android.settings.REQUEST_MANAGE_MEDIA"; 481 482 /** 483 * Activity Action: Show settings to allow configuration of cross-profile access for apps 484 * 485 * Input: Optionally, the Intent's data URI can specify the application package name to 486 * directly invoke the management GUI specific to the package name. For example 487 * "package:com.my.app". 488 * <p> 489 * Output: Nothing. 490 * 491 * @hide 492 */ 493 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 494 public static final String ACTION_MANAGE_CROSS_PROFILE_ACCESS = 495 "android.settings.MANAGE_CROSS_PROFILE_ACCESS"; 496 497 /** 498 * Activity Action: Show the "Open by Default" page in a particular application's details page. 499 * <p> 500 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 501 * <p> 502 * Input: The Intent's data URI specifies the application package name 503 * to be shown, with the "package" scheme. That is "package:com.my.app". 504 * <p> 505 * Output: Nothing. 506 */ 507 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 508 public static final String ACTION_APP_OPEN_BY_DEFAULT_SETTINGS = 509 "android.settings.APP_OPEN_BY_DEFAULT_SETTINGS"; 510 511 /** 512 * Activity Action: Show trusted credentials settings, opening to the user tab, 513 * to allow management of installed credentials. 514 * <p> 515 * In some cases, a matching Activity may not exist, so ensure you 516 * safeguard against this. 517 * <p> 518 * Input: Nothing. 519 * <p> 520 * Output: Nothing. 521 * @hide 522 */ 523 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 524 @UnsupportedAppUsage 525 public static final String ACTION_TRUSTED_CREDENTIALS_USER = 526 "com.android.settings.TRUSTED_CREDENTIALS_USER"; 527 528 /** 529 * Activity Action: Show dialog explaining that an installed CA cert may enable 530 * monitoring of encrypted network traffic. 531 * <p> 532 * In some cases, a matching Activity may not exist, so ensure you 533 * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the 534 * number of certificates. 535 * <p> 536 * Input: Nothing. 537 * <p> 538 * Output: Nothing. 539 * @hide 540 */ 541 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 542 public static final String ACTION_MONITORING_CERT_INFO = 543 "com.android.settings.MONITORING_CERT_INFO"; 544 545 /** 546 * Activity Action: Show settings to allow configuration of privacy options. 547 * <p> 548 * In some cases, a matching Activity may not exist, so ensure you 549 * safeguard against this. 550 * <p> 551 * Input: Nothing. 552 * <p> 553 * Output: Nothing. 554 */ 555 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 556 public static final String ACTION_PRIVACY_SETTINGS = 557 "android.settings.PRIVACY_SETTINGS"; 558 559 /** 560 * Activity Action: Show settings to allow configuration of VPN. 561 * <p> 562 * In some cases, a matching Activity may not exist, so ensure you 563 * safeguard against this. 564 * <p> 565 * Input: Nothing. 566 * <p> 567 * Output: Nothing. 568 */ 569 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 570 public static final String ACTION_VPN_SETTINGS = 571 "android.settings.VPN_SETTINGS"; 572 573 /** 574 * Activity Action: Show settings to allow configuration of Wi-Fi. 575 * <p> 576 * In some cases, a matching Activity may not exist, so ensure you 577 * safeguard against this. 578 * <p> 579 * Input: Nothing. 580 * <p> 581 * Output: Nothing. 582 */ 583 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 584 public static final String ACTION_WIFI_SETTINGS = 585 "android.settings.WIFI_SETTINGS"; 586 587 /** 588 * Activity Action: Show settings to allow configuration of a static IP 589 * address for Wi-Fi. 590 * <p> 591 * In some cases, a matching Activity may not exist, so ensure you safeguard 592 * against this. 593 * <p> 594 * Input: Nothing. 595 * <p> 596 * Output: Nothing. 597 */ 598 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 599 public static final String ACTION_WIFI_IP_SETTINGS = 600 "android.settings.WIFI_IP_SETTINGS"; 601 602 /** 603 * Activity Action: Show setting page to process a Wi-Fi Easy Connect (aka DPP) URI and start 604 * configuration. This intent should be used when you want to use this device to take on the 605 * configurator role for an IoT/other device. When provided with a valid DPP URI 606 * string, Settings will open a Wi-Fi selection screen for the user to indicate which network 607 * they would like to configure the device specified in the DPP URI string and 608 * carry them through the rest of the flow for provisioning the device. 609 * <p> 610 * In some cases, a matching Activity may not exist, so ensure to safeguard against this by 611 * checking {@link WifiManager#isEasyConnectSupported()}. 612 * <p> 613 * Input: The Intent's data URI specifies bootstrapping information for authenticating and 614 * provisioning the peer, and uses a "DPP" scheme. The URI should be attached to the intent 615 * using {@link Intent#setData(Uri)}. The calling app can obtain a DPP URI in any 616 * way, e.g. by scanning a QR code or other out-of-band methods. The calling app may also 617 * attach the {@link #EXTRA_EASY_CONNECT_BAND_LIST} extra to provide information 618 * about the bands supported by the enrollee device. 619 * <p> 620 * Output: After calling {@link android.app.Activity#startActivityForResult}, the callback 621 * {@code onActivityResult} will have resultCode {@link android.app.Activity#RESULT_OK} if 622 * the Wi-Fi Easy Connect configuration succeeded and the user tapped the 'Done' button, or 623 * {@link android.app.Activity#RESULT_CANCELED} if the operation failed and user tapped the 624 * 'Cancel' button. In case the operation has failed, a status code from 625 * {@link android.net.wifi.EasyConnectStatusCallback} {@code EASY_CONNECT_EVENT_FAILURE_*} will 626 * be returned as an Extra {@link #EXTRA_EASY_CONNECT_ERROR_CODE}. Easy Connect R2 627 * Enrollees report additional details about the error they encountered, which will be 628 * provided in the {@link #EXTRA_EASY_CONNECT_ATTEMPTED_SSID}, 629 * {@link #EXTRA_EASY_CONNECT_CHANNEL_LIST}, and {@link #EXTRA_EASY_CONNECT_BAND_LIST}. 630 */ 631 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 632 public static final String ACTION_PROCESS_WIFI_EASY_CONNECT_URI = 633 "android.settings.PROCESS_WIFI_EASY_CONNECT_URI"; 634 635 /** 636 * Activity Extra: The Easy Connect operation error code 637 * <p> 638 * An extra returned on the result intent received when using the 639 * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. 640 * This extra contains the integer error code of the operation - one of 641 * {@link android.net.wifi.EasyConnectStatusCallback} {@code EASY_CONNECT_EVENT_FAILURE_*}. If 642 * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, 643 * then this extra is not attached to the result intent. 644 * <p> 645 * Use the {@link Intent#hasExtra(String)} to determine whether the extra is attached and 646 * {@link Intent#getIntExtra(String, int)} to obtain the error code data. 647 */ 648 public static final String EXTRA_EASY_CONNECT_ERROR_CODE = 649 "android.provider.extra.EASY_CONNECT_ERROR_CODE"; 650 651 /** 652 * Activity Extra: The SSID that the Enrollee tried to connect to. 653 * <p> 654 * An extra returned on the result intent received when using the {@link 655 * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This 656 * extra contains the SSID of the Access Point that the remote Enrollee tried to connect to. 657 * This value is populated only by remote R2 devices, and only for the following error codes: 658 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK} 659 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION}. 660 * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. If 661 * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, then 662 * this extra is not attached to the result intent. 663 * <p> 664 * Use the {@link Intent#getStringExtra(String)} to obtain the SSID. 665 */ 666 public static final String EXTRA_EASY_CONNECT_ATTEMPTED_SSID = 667 "android.provider.extra.EASY_CONNECT_ATTEMPTED_SSID"; 668 669 /** 670 * Activity Extra: The Channel List that the Enrollee used to scan a network. 671 * <p> 672 * An extra returned on the result intent received when using the {@link 673 * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This 674 * extra contains the channel list that the Enrollee scanned for a network. This value is 675 * populated only by remote R2 devices, and only for the following error code: {@link 676 * android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK}. 677 * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. If 678 * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, then 679 * this extra is not attached to the result intent. The list is JSON formatted, as an array 680 * (Wi-Fi global operating classes) of arrays (Wi-Fi channels). 681 * <p> 682 * Use the {@link Intent#getStringExtra(String)} to obtain the list. 683 */ 684 public static final String EXTRA_EASY_CONNECT_CHANNEL_LIST = 685 "android.provider.extra.EASY_CONNECT_CHANNEL_LIST"; 686 687 /** 688 * Activity Extra: The Band List that the Enrollee supports. 689 * <p> 690 * This extra contains the bands the Enrollee supports, expressed as the Global Operating 691 * Class, see Table E-4 in IEEE Std 802.11-2016 Global operating classes. It is used both as 692 * input, to configure the Easy Connect operation and as output of the operation. 693 * <p> 694 * As input: an optional extra to be attached to the 695 * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI}. If attached, it indicates the bands which 696 * the remote device (enrollee, device-to-be-configured) supports. The Settings operation 697 * may take this into account when presenting the user with list of networks configurations 698 * to be used. The calling app may obtain this information in any out-of-band method. The 699 * information should be attached as an array of raw integers - using the 700 * {@link Intent#putExtra(String, int[])}. 701 * <p> 702 * As output: an extra returned on the result intent received when using the 703 * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation 704 * . This value is populated only by remote R2 devices, and only for the following error 705 * codes: 706 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK}, 707 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION}, 708 * or 709 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_REJECTED_CONFIGURATION}. 710 * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. 711 * If there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK} 712 * , then this extra is not attached to the result intent. 713 * <p> 714 * Use the {@link Intent#getIntArrayExtra(String)} to obtain the list. 715 */ 716 public static final String EXTRA_EASY_CONNECT_BAND_LIST = 717 "android.provider.extra.EASY_CONNECT_BAND_LIST"; 718 719 /** 720 * Activity Action: Show settings to allow configuration of data and view data usage. 721 * <p> 722 * In some cases, a matching Activity may not exist, so ensure you 723 * safeguard against this. 724 * <p> 725 * Input: Nothing. 726 * <p> 727 * Output: Nothing. 728 */ 729 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 730 public static final String ACTION_DATA_USAGE_SETTINGS = 731 "android.settings.DATA_USAGE_SETTINGS"; 732 733 /** 734 * Activity Action: Show settings to allow configuration of Bluetooth. 735 * <p> 736 * In some cases, a matching Activity may not exist, so ensure you 737 * safeguard against this. 738 * <p> 739 * Input: Nothing. 740 * <p> 741 * Output: Nothing. 742 */ 743 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 744 public static final String ACTION_BLUETOOTH_SETTINGS = 745 "android.settings.BLUETOOTH_SETTINGS"; 746 747 /** 748 * Activity action: Show Settings app search UI when this action is available for device. 749 * <p> 750 * Input: Nothing. 751 * <p> 752 * Output: Nothing. 753 */ 754 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 755 public static final String ACTION_APP_SEARCH_SETTINGS = "android.settings.APP_SEARCH_SETTINGS"; 756 757 /** 758 * Activity Action: Show settings to allow configuration of Assist Gesture. 759 * <p> 760 * In some cases, a matching Activity may not exist, so ensure you 761 * safeguard against this. 762 * <p> 763 * Input: Nothing. 764 * <p> 765 * Output: Nothing. 766 * @hide 767 */ 768 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 769 public static final String ACTION_ASSIST_GESTURE_SETTINGS = 770 "android.settings.ASSIST_GESTURE_SETTINGS"; 771 772 /** 773 * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if 774 * necessary. 775 * @deprecated See {@link #ACTION_BIOMETRIC_ENROLL}. 776 * <p> 777 * Input: Nothing. 778 * <p> 779 * Output: Nothing. 780 */ 781 @Deprecated 782 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 783 public static final String ACTION_FINGERPRINT_ENROLL = 784 "android.settings.FINGERPRINT_ENROLL"; 785 786 /** 787 * Activity Action: Show settings to enroll biometrics, and setup PIN/Pattern/Pass if 788 * necessary. By default, this prompts the user to enroll biometrics with strength 789 * Weak or above, as defined by the CDD. Only biometrics that meet or exceed Strong, as defined 790 * in the CDD are allowed to participate in Keystore operations. 791 * <p> 792 * Input: extras {@link #EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED} as an integer, with 793 * constants defined in {@link android.hardware.biometrics.BiometricManager.Authenticators}, 794 * e.g. {@link android.hardware.biometrics.BiometricManager.Authenticators#BIOMETRIC_STRONG}. 795 * If not specified, the default behavior is 796 * {@link android.hardware.biometrics.BiometricManager.Authenticators#BIOMETRIC_WEAK}. 797 * <p> 798 * Output: Nothing. Note that callers should still check 799 * {@link android.hardware.biometrics.BiometricManager#canAuthenticate(int)} 800 * afterwards to ensure that the user actually completed enrollment. 801 */ 802 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 803 public static final String ACTION_BIOMETRIC_ENROLL = 804 "android.settings.BIOMETRIC_ENROLL"; 805 806 /** 807 * Activity Extra: The minimum strength to request enrollment for. 808 * <p> 809 * This can be passed as an extra field to the {@link #ACTION_BIOMETRIC_ENROLL} intent to 810 * indicate that only enrollment for sensors that meet these requirements should be shown. The 811 * value should be a combination of the constants defined in 812 * {@link android.hardware.biometrics.BiometricManager.Authenticators}. 813 */ 814 public static final String EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED = 815 "android.provider.extra.BIOMETRIC_AUTHENTICATORS_ALLOWED"; 816 817 /** 818 * Activity Action: Show settings to allow configuration of cast endpoints. 819 * <p> 820 * In some cases, a matching Activity may not exist, so ensure you 821 * safeguard against this. 822 * <p> 823 * Input: Nothing. 824 * <p> 825 * Output: Nothing. 826 */ 827 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 828 public static final String ACTION_CAST_SETTINGS = 829 "android.settings.CAST_SETTINGS"; 830 831 /** 832 * Activity Action: Show settings to allow configuration of date and time. 833 * <p> 834 * In some cases, a matching Activity may not exist, so ensure you 835 * safeguard against this. 836 * <p> 837 * Input: Nothing. 838 * <p> 839 * Output: Nothing. 840 */ 841 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 842 public static final String ACTION_DATE_SETTINGS = 843 "android.settings.DATE_SETTINGS"; 844 845 /** 846 * Activity Action: Show settings to allow configuration of sound and volume. 847 * <p> 848 * In some cases, a matching Activity may not exist, so ensure you 849 * safeguard against this. 850 * <p> 851 * Input: Nothing. 852 * <p> 853 * Output: Nothing. 854 */ 855 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 856 public static final String ACTION_SOUND_SETTINGS = 857 "android.settings.SOUND_SETTINGS"; 858 859 /** 860 * Activity Action: Show settings to allow configuration of display. 861 * <p> 862 * In some cases, a matching Activity may not exist, so ensure you 863 * safeguard against this. 864 * <p> 865 * Input: Nothing. 866 * <p> 867 * Output: Nothing. 868 */ 869 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 870 public static final String ACTION_DISPLAY_SETTINGS = 871 "android.settings.DISPLAY_SETTINGS"; 872 873 /** 874 * Activity Action: Show Auto Rotate configuration settings. 875 */ 876 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 877 public static final String ACTION_AUTO_ROTATE_SETTINGS = 878 "android.settings.AUTO_ROTATE_SETTINGS"; 879 880 /** 881 * Activity Action: Show settings to allow configuration of Night display. 882 * <p> 883 * In some cases, a matching Activity may not exist, so ensure you 884 * safeguard against this. 885 * <p> 886 * Input: Nothing. 887 * <p> 888 * Output: Nothing. 889 */ 890 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 891 public static final String ACTION_NIGHT_DISPLAY_SETTINGS = 892 "android.settings.NIGHT_DISPLAY_SETTINGS"; 893 894 /** 895 * Activity Action: Show settings to allow configuration of Dark theme. 896 * <p> 897 * In some cases, a matching Activity may not exist, so ensure you 898 * safeguard against this. 899 * <p> 900 * Input: Nothing. 901 * <p> 902 * Output: Nothing. 903 * 904 * @hide 905 */ 906 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 907 public static final String ACTION_DARK_THEME_SETTINGS = 908 "android.settings.DARK_THEME_SETTINGS"; 909 910 /** 911 * Activity Action: Show settings to allow configuration of locale. 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 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 921 public static final String ACTION_LOCALE_SETTINGS = 922 "android.settings.LOCALE_SETTINGS"; 923 924 /** 925 * Activity Action: Show settings to allow configuration of lockscreen. 926 * <p> 927 * In some cases, a matching Activity may not exist, so ensure you 928 * safeguard against this. 929 * <p> 930 * Input: Nothing. 931 * <p> 932 * Output: Nothing. 933 * 934 * @hide 935 */ 936 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 937 public static final String ACTION_LOCKSCREEN_SETTINGS = "android.settings.LOCK_SCREEN_SETTINGS"; 938 939 /** 940 * Activity Action: Show settings to configure input methods, in particular 941 * allowing the user to enable input methods. 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 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 951 public static final String ACTION_VOICE_INPUT_SETTINGS = 952 "android.settings.VOICE_INPUT_SETTINGS"; 953 954 /** 955 * Activity Action: Show settings to configure input methods, in particular 956 * allowing the user to enable input methods. 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 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 966 public static final String ACTION_INPUT_METHOD_SETTINGS = 967 "android.settings.INPUT_METHOD_SETTINGS"; 968 969 /** 970 * Activity Action: Show settings to enable/disable input method subtypes. 971 * <p> 972 * In some cases, a matching Activity may not exist, so ensure you 973 * safeguard against this. 974 * <p> 975 * To tell which input method's subtypes are displayed in the settings, add 976 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id. 977 * If there is no extra in this Intent, subtypes from all installed input methods 978 * will be displayed in the settings. 979 * 980 * @see android.view.inputmethod.InputMethodInfo#getId 981 * <p> 982 * Input: Nothing. 983 * <p> 984 * Output: Nothing. 985 */ 986 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 987 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS = 988 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS"; 989 990 /** 991 * Activity Action: Show settings to manage the user input dictionary. 992 * <p> 993 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT}, 994 * it is guaranteed there will always be an appropriate implementation for this Intent action. 995 * In prior releases of the platform this was optional, so ensure you safeguard against it. 996 * <p> 997 * Input: Nothing. 998 * <p> 999 * Output: Nothing. 1000 */ 1001 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1002 public static final String ACTION_USER_DICTIONARY_SETTINGS = 1003 "android.settings.USER_DICTIONARY_SETTINGS"; 1004 1005 /** 1006 * Activity Action: Show settings to configure the hardware keyboard. 1007 * <p> 1008 * In some cases, a matching Activity may not exist, so ensure you 1009 * safeguard against this. 1010 * <p> 1011 * Input: Nothing. 1012 * <p> 1013 * Output: Nothing. 1014 */ 1015 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1016 public static final String ACTION_HARD_KEYBOARD_SETTINGS = 1017 "android.settings.HARD_KEYBOARD_SETTINGS"; 1018 1019 /** 1020 * Activity Action: Adds a word to the user dictionary. 1021 * <p> 1022 * In some cases, a matching Activity may not exist, so ensure you 1023 * safeguard against this. 1024 * <p> 1025 * Input: An extra with key <code>word</code> that contains the word 1026 * that should be added to the dictionary. 1027 * <p> 1028 * Output: Nothing. 1029 * 1030 * @hide 1031 */ 1032 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1033 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 1034 public static final String ACTION_USER_DICTIONARY_INSERT = 1035 "com.android.settings.USER_DICTIONARY_INSERT"; 1036 1037 /** 1038 * Activity Action: Show settings to allow configuration of application-related settings. 1039 * <p> 1040 * In some cases, a matching Activity may not exist, so ensure you 1041 * safeguard against this. 1042 * <p> 1043 * Input: Nothing. 1044 * <p> 1045 * Output: Nothing. 1046 */ 1047 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1048 public static final String ACTION_APPLICATION_SETTINGS = 1049 "android.settings.APPLICATION_SETTINGS"; 1050 1051 /** 1052 * Activity Action: Show settings to allow configuration of application 1053 * development-related settings. As of 1054 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is 1055 * a required part of the platform. 1056 * <p> 1057 * Input: Nothing. 1058 * <p> 1059 * Output: Nothing. 1060 */ 1061 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1062 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS = 1063 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS"; 1064 1065 /** 1066 * Activity Action: Show settings to allow configuration of quick launch shortcuts. 1067 * <p> 1068 * In some cases, a matching Activity may not exist, so ensure you 1069 * safeguard against this. 1070 * <p> 1071 * Input: Nothing. 1072 * <p> 1073 * Output: Nothing. 1074 */ 1075 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1076 public static final String ACTION_QUICK_LAUNCH_SETTINGS = 1077 "android.settings.QUICK_LAUNCH_SETTINGS"; 1078 1079 /** 1080 * Activity Action: Show settings to manage installed applications. 1081 * <p> 1082 * In some cases, a matching Activity may not exist, so ensure you 1083 * safeguard against this. 1084 * <p> 1085 * Input: Nothing. 1086 * <p> 1087 * Output: Nothing. 1088 */ 1089 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1090 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS = 1091 "android.settings.MANAGE_APPLICATIONS_SETTINGS"; 1092 1093 /** 1094 * Activity Action: Show settings to manage all applications. 1095 * <p> 1096 * In some cases, a matching Activity may not exist, so ensure you 1097 * safeguard against this. 1098 * <p> 1099 * Input: Nothing. 1100 * <p> 1101 * Output: Nothing. 1102 */ 1103 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1104 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = 1105 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS"; 1106 1107 /** 1108 * Activity Action: Show settings to manage all SIM profiles. 1109 * <p> 1110 * In some cases, a matching Activity may not exist, so ensure you 1111 * safeguard against this. 1112 * <p> 1113 * Input: Nothing. 1114 * <p> 1115 * Output: Nothing. 1116 */ 1117 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1118 public static final String ACTION_MANAGE_ALL_SIM_PROFILES_SETTINGS = 1119 "android.settings.MANAGE_ALL_SIM_PROFILES_SETTINGS"; 1120 1121 /** 1122 * Activity Action: Show screen for controlling which apps can draw on top of other apps. 1123 * <p> 1124 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1125 * <p> 1126 * Input: Optionally, in versions of Android prior to {@link android.os.Build.VERSION_CODES#R}, 1127 * the Intent's data URI can specify the application package name to directly invoke the 1128 * management GUI specific to the package name. 1129 * For example "package:com.my.app". 1130 * <p> 1131 * Output: Nothing. 1132 */ 1133 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1134 public static final String ACTION_MANAGE_OVERLAY_PERMISSION = 1135 "android.settings.action.MANAGE_OVERLAY_PERMISSION"; 1136 1137 /** 1138 * Activity Action: Show screen for controlling if the app specified in the data URI of the 1139 * intent can draw on top of other apps. 1140 * <p> 1141 * Unlike {@link #ACTION_MANAGE_OVERLAY_PERMISSION}, which in Android {@link 1142 * android.os.Build.VERSION_CODES#R} can't be used to show a GUI for a specific package, 1143 * permission {@code android.permission.INTERNAL_SYSTEM_WINDOW} is needed to start an activity 1144 * with this intent. 1145 * <p> 1146 * In some cases, a matching Activity may not exist, so ensure you 1147 * safeguard against this. 1148 * <p> 1149 * Input: The Intent's data URI MUST specify the application package name whose ability of 1150 * drawing on top of other apps you want to control. 1151 * For example "package:com.my.app". 1152 * <p> 1153 * Output: Nothing. 1154 * 1155 * @hide 1156 */ 1157 @SystemApi 1158 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1159 public static final String ACTION_MANAGE_APP_OVERLAY_PERMISSION = 1160 "android.settings.MANAGE_APP_OVERLAY_PERMISSION"; 1161 1162 /** 1163 * Activity Action: Show screen for controlling which apps are allowed to write/modify 1164 * system settings. 1165 * <p> 1166 * In some cases, a matching Activity may not exist, so ensure you 1167 * safeguard against this. 1168 * <p> 1169 * Input: Optionally, the Intent's data URI can specify the application package name to 1170 * directly invoke the management GUI specific to the package name. For example 1171 * "package:com.my.app". 1172 * <p> 1173 * Output: Nothing. 1174 */ 1175 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1176 public static final String ACTION_MANAGE_WRITE_SETTINGS = 1177 "android.settings.action.MANAGE_WRITE_SETTINGS"; 1178 1179 /** 1180 * Activity Action: Show screen for controlling app usage properties for an app. 1181 * Input: Intent's extra {@link android.content.Intent#EXTRA_PACKAGE_NAME} must specify the 1182 * application package name. 1183 * Output: Nothing. 1184 */ 1185 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1186 public static final String ACTION_APP_USAGE_SETTINGS = 1187 "android.settings.action.APP_USAGE_SETTINGS"; 1188 1189 /** 1190 * Activity Action: Show screen of details about a particular application. 1191 * <p> 1192 * In some cases, a matching Activity may not exist, so ensure you 1193 * safeguard against this. 1194 * <p> 1195 * Input: The Intent's data URI specifies the application package name 1196 * to be shown, with the "package" scheme. That is "package:com.my.app". 1197 * <p> 1198 * Output: Nothing. 1199 */ 1200 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1201 public static final String ACTION_APPLICATION_DETAILS_SETTINGS = 1202 "android.settings.APPLICATION_DETAILS_SETTINGS"; 1203 1204 /** 1205 * Activity Action: Show list of applications that have been running 1206 * foreground services (to the user "running in the background"). 1207 * <p> 1208 * Input: Extras "packages" is a string array of package names. 1209 * <p> 1210 * Output: Nothing. 1211 * @hide 1212 */ 1213 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1214 public static final String ACTION_FOREGROUND_SERVICES_SETTINGS = 1215 "android.settings.FOREGROUND_SERVICES_SETTINGS"; 1216 1217 /** 1218 * Activity Action: Show screen for controlling which apps can ignore battery optimizations. 1219 * <p> 1220 * Input: Nothing. 1221 * <p> 1222 * Output: Nothing. 1223 * <p> 1224 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations 1225 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is 1226 * already ignoring optimizations. You can use 1227 * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you 1228 * on this list. 1229 */ 1230 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1231 public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS = 1232 "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS"; 1233 1234 /** 1235 * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is, 1236 * put them on the whitelist of apps shown by 1237 * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also 1238 * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} 1239 * permission. 1240 * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities 1241 * provided by the platform for applications to operate correctly in the various power 1242 * saving modes. This is only for unusual applications that need to deeply control their own 1243 * execution, at the potential expense of the user's battery life. Note that these applications 1244 * greatly run the risk of showing to the user as high power consumers on their device.</p> 1245 * <p> 1246 * Input: The Intent's data URI must specify the application package name 1247 * to be shown, with the "package" scheme. That is "package:com.my.app". 1248 * <p> 1249 * Output: Nothing. 1250 * <p> 1251 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations 1252 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is 1253 * already ignoring optimizations. 1254 */ 1255 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1256 public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = 1257 "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"; 1258 1259 /** 1260 * Activity Action: Open the advanced power usage details page of an associated app. 1261 * <p> 1262 * Input: Intent's data URI set with an application name, using the 1263 * "package" schema (like "package:com.my.app") 1264 * <p> 1265 * Output: Nothing. 1266 * 1267 * @hide 1268 */ 1269 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1270 public static final String ACTION_VIEW_ADVANCED_POWER_USAGE_DETAIL = 1271 "android.settings.VIEW_ADVANCED_POWER_USAGE_DETAIL"; 1272 1273 /** 1274 * Activity Action: Show screen for controlling background data 1275 * restrictions for a particular application. 1276 * <p> 1277 * Input: Intent's data URI set with an application name, using the 1278 * "package" schema (like "package:com.my.app"). 1279 * 1280 * <p> 1281 * Output: Nothing. 1282 * <p> 1283 * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus 1284 * ConnectivityManager#getRestrictBackgroundStatus()} to determine the 1285 * status of the background data restrictions for them. 1286 * 1287 * <p class="note"> 1288 * In some cases, a matching Activity may not exist, so ensure you 1289 * safeguard against this. 1290 */ 1291 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1292 public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS = 1293 "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS"; 1294 1295 /** 1296 * @hide 1297 * Activity Action: Show the "app ops" settings screen. 1298 * <p> 1299 * Input: Nothing. 1300 * <p> 1301 * Output: Nothing. 1302 */ 1303 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1304 public static final String ACTION_APP_OPS_SETTINGS = 1305 "android.settings.APP_OPS_SETTINGS"; 1306 1307 /** 1308 * Activity Action: Show settings for system update functionality. 1309 * <p> 1310 * In some cases, a matching Activity may not exist, so ensure you 1311 * safeguard against this. 1312 * <p> 1313 * Input: Nothing. 1314 * <p> 1315 * Output: Nothing. 1316 * 1317 * @hide 1318 */ 1319 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1320 public static final String ACTION_SYSTEM_UPDATE_SETTINGS = 1321 "android.settings.SYSTEM_UPDATE_SETTINGS"; 1322 1323 /** 1324 * Activity Action: Show settings for managed profile settings. 1325 * <p> 1326 * In some cases, a matching Activity may not exist, so ensure you 1327 * safeguard against this. 1328 * <p> 1329 * Input: Nothing. 1330 * <p> 1331 * Output: Nothing. 1332 * 1333 * @hide 1334 */ 1335 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1336 public static final String ACTION_MANAGED_PROFILE_SETTINGS = 1337 "android.settings.MANAGED_PROFILE_SETTINGS"; 1338 1339 /** 1340 * Activity Action: Show settings to allow configuration of sync settings. 1341 * <p> 1342 * In some cases, a matching Activity may not exist, so ensure you 1343 * safeguard against this. 1344 * <p> 1345 * The account types available to add via the add account button may be restricted by adding an 1346 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's 1347 * authorities. Only account types which can sync with that content provider will be offered to 1348 * the user. 1349 * <p> 1350 * Input: Nothing. 1351 * <p> 1352 * Output: Nothing. 1353 */ 1354 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1355 public static final String ACTION_SYNC_SETTINGS = 1356 "android.settings.SYNC_SETTINGS"; 1357 1358 /** 1359 * Activity Action: Show add account screen for creating a new account. 1360 * <p> 1361 * In some cases, a matching Activity may not exist, so ensure you 1362 * safeguard against this. 1363 * <p> 1364 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES} 1365 * extra to the Intent with one or more syncable content provider's authorities. Only account 1366 * types which can sync with that content provider will be offered to the user. 1367 * <p> 1368 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the 1369 * Intent with one or more account types. 1370 * <p> 1371 * Input: Nothing. 1372 * <p> 1373 * Output: Nothing. 1374 */ 1375 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1376 public static final String ACTION_ADD_ACCOUNT = 1377 "android.settings.ADD_ACCOUNT_SETTINGS"; 1378 1379 /** 1380 * Activity Action: Show settings for enabling or disabling data saver 1381 * <p></p> 1382 * In some cases, a matching Activity may not exist, so ensure you 1383 * safeguard against this. 1384 * <p> 1385 * Input: Nothing. 1386 * <p> 1387 * Output: Nothing. 1388 * 1389 * @hide 1390 */ 1391 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1392 public static final String ACTION_DATA_SAVER_SETTINGS = 1393 "android.settings.DATA_SAVER_SETTINGS"; 1394 1395 /** 1396 * Activity Action: Show settings for selecting the network operator. 1397 * <p> 1398 * In some cases, a matching Activity may not exist, so ensure you 1399 * safeguard against this. 1400 * <p> 1401 * The subscription ID of the subscription for which available network operators should be 1402 * displayed may be optionally specified with {@link #EXTRA_SUB_ID}. 1403 * <p> 1404 * Input: Nothing. 1405 * <p> 1406 * Output: Nothing. 1407 */ 1408 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1409 public static final String ACTION_NETWORK_OPERATOR_SETTINGS = 1410 "android.settings.NETWORK_OPERATOR_SETTINGS"; 1411 1412 /** 1413 * Activity Action: Show settings for selection of 2G/3G. 1414 * <p> 1415 * In some cases, a matching Activity may not exist, so ensure you 1416 * safeguard against this. 1417 * <p> 1418 * Input: Nothing. 1419 * <p> 1420 * Output: Nothing. 1421 */ 1422 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1423 public static final String ACTION_DATA_ROAMING_SETTINGS = 1424 "android.settings.DATA_ROAMING_SETTINGS"; 1425 1426 /** 1427 * Activity Action: Show settings for internal storage. 1428 * <p> 1429 * In some cases, a matching Activity may not exist, so ensure you 1430 * safeguard against this. 1431 * <p> 1432 * Input: Nothing. 1433 * <p> 1434 * Output: Nothing. 1435 */ 1436 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1437 public static final String ACTION_INTERNAL_STORAGE_SETTINGS = 1438 "android.settings.INTERNAL_STORAGE_SETTINGS"; 1439 /** 1440 * Activity Action: Show settings for memory card storage. 1441 * <p> 1442 * In some cases, a matching Activity may not exist, so ensure you 1443 * safeguard against this. 1444 * <p> 1445 * Input: Nothing. 1446 * <p> 1447 * Output: Nothing. 1448 */ 1449 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1450 public static final String ACTION_MEMORY_CARD_SETTINGS = 1451 "android.settings.MEMORY_CARD_SETTINGS"; 1452 1453 /** 1454 * Activity Action: Show settings for global search. 1455 * <p> 1456 * In some cases, a matching Activity may not exist, so ensure you 1457 * safeguard against this. 1458 * <p> 1459 * Input: Nothing. 1460 * <p> 1461 * Output: Nothing 1462 */ 1463 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1464 public static final String ACTION_SEARCH_SETTINGS = 1465 "android.search.action.SEARCH_SETTINGS"; 1466 1467 /** 1468 * Activity Action: Show general device information settings (serial 1469 * number, software version, phone number, etc.). 1470 * <p> 1471 * In some cases, a matching Activity may not exist, so ensure you 1472 * safeguard against this. 1473 * <p> 1474 * Input: Nothing. 1475 * <p> 1476 * Output: Nothing 1477 */ 1478 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1479 public static final String ACTION_DEVICE_INFO_SETTINGS = 1480 "android.settings.DEVICE_INFO_SETTINGS"; 1481 1482 /** 1483 * Activity Action: Show NFC settings. 1484 * <p> 1485 * This shows UI that allows NFC to be turned on or off. 1486 * <p> 1487 * In some cases, a matching Activity may not exist, so ensure you 1488 * safeguard against this. 1489 * <p> 1490 * Input: Nothing. 1491 * <p> 1492 * Output: Nothing 1493 * @see android.nfc.NfcAdapter#isEnabled() 1494 */ 1495 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1496 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS"; 1497 1498 /** 1499 * Activity Action: Show NFC Sharing settings. 1500 * <p> 1501 * This shows UI that allows NDEF Push (Android Beam) to be turned on or 1502 * off. 1503 * <p> 1504 * In some cases, a matching Activity may not exist, so ensure you 1505 * safeguard against this. 1506 * <p> 1507 * Input: Nothing. 1508 * <p> 1509 * Output: Nothing 1510 * @see android.nfc.NfcAdapter#isNdefPushEnabled() 1511 */ 1512 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1513 public static final String ACTION_NFCSHARING_SETTINGS = 1514 "android.settings.NFCSHARING_SETTINGS"; 1515 1516 /** 1517 * Activity Action: Show NFC Tap & Pay settings 1518 * <p> 1519 * This shows UI that allows the user to configure Tap&Pay 1520 * settings. 1521 * <p> 1522 * In some cases, a matching Activity may not exist, so ensure you 1523 * safeguard against this. 1524 * <p> 1525 * Input: Nothing. 1526 * <p> 1527 * Output: Nothing 1528 */ 1529 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1530 public static final String ACTION_NFC_PAYMENT_SETTINGS = 1531 "android.settings.NFC_PAYMENT_SETTINGS"; 1532 1533 /** 1534 * Activity Action: Show Daydream settings. 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.service.dreams.DreamService 1543 */ 1544 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1545 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS"; 1546 1547 /** 1548 * Activity Action: Show Notification assistant settings. 1549 * <p> 1550 * In some cases, a matching Activity may not exist, so ensure you 1551 * safeguard against this. 1552 * <p> 1553 * Input: Nothing. 1554 * <p> 1555 * Output: Nothing. 1556 * @see android.service.notification.NotificationAssistantService 1557 */ 1558 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1559 public static final String ACTION_NOTIFICATION_ASSISTANT_SETTINGS = 1560 "android.settings.NOTIFICATION_ASSISTANT_SETTINGS"; 1561 1562 /** 1563 * Activity Action: Show Notification listener settings. 1564 * <p> 1565 * In some cases, a matching Activity may not exist, so ensure you 1566 * safeguard against this. 1567 * <p> 1568 * Input: Nothing. 1569 * <p> 1570 * Output: Nothing. 1571 * @see android.service.notification.NotificationListenerService 1572 */ 1573 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1574 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS 1575 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"; 1576 1577 /** 1578 * Activity Action: Show notification listener permission settings page for app. 1579 * <p> 1580 * Users can grant and deny access to notifications for a {@link ComponentName} from here. 1581 * See 1582 * {@link android.app.NotificationManager#isNotificationListenerAccessGranted(ComponentName)} 1583 * for more details. 1584 * <p> 1585 * Input: The extra {@link #EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME} containing the name 1586 * of the component to grant or revoke notification listener access to. 1587 * <p> 1588 * Output: Nothing. 1589 */ 1590 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1591 public static final String ACTION_NOTIFICATION_LISTENER_DETAIL_SETTINGS = 1592 "android.settings.NOTIFICATION_LISTENER_DETAIL_SETTINGS"; 1593 1594 /** 1595 * Activity Extra: What component name to show the notification listener permission 1596 * page for. 1597 * <p> 1598 * A string extra containing a {@link ComponentName}. This must be passed as an extra field to 1599 * {@link #ACTION_NOTIFICATION_LISTENER_DETAIL_SETTINGS}. 1600 */ 1601 public static final String EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME = 1602 "android.provider.extra.NOTIFICATION_LISTENER_COMPONENT_NAME"; 1603 1604 /** 1605 * Activity Action: Show Do Not Disturb access settings. 1606 * <p> 1607 * Users can grant and deny access to Do Not Disturb configuration from here. Managed 1608 * profiles cannot grant Do Not Disturb access. 1609 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more 1610 * details. 1611 * <p> 1612 * Input: Nothing. 1613 * <p> 1614 * Output: Nothing. 1615 * 1616 * <p class="note"> 1617 * In some cases, a matching Activity may not exist, so ensure you 1618 * safeguard against this. 1619 */ 1620 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1621 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS 1622 = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS"; 1623 1624 /** 1625 * Activity Action: Show do not disturb setting page for app. 1626 * <p> 1627 * Users can grant and deny access to Do Not Disturb configuration for an app from here. 1628 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more 1629 * details. 1630 * <p> 1631 * Input: Intent's data URI set with an application name, using the 1632 * "package" schema (like "package:com.my.app"). 1633 * <p> 1634 * Output: Nothing. 1635 * 1636 * @hide 1637 */ 1638 @SystemApi 1639 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1640 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS = 1641 "android.settings.NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS"; 1642 1643 /** 1644 * Activity Action: Show the automatic do not disturb rule listing page 1645 * <p> 1646 * Users can add, enable, disable, and remove automatic do not disturb rules from this 1647 * screen. See {@link NotificationManager#addAutomaticZenRule(AutomaticZenRule)} for more 1648 * details. 1649 * </p> 1650 * <p> 1651 * Input: Nothing 1652 * Output: Nothing 1653 * </p> 1654 * 1655 */ 1656 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1657 public static final String ACTION_CONDITION_PROVIDER_SETTINGS 1658 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS"; 1659 1660 /** 1661 * Activity Action: Show settings for video captioning. 1662 * <p> 1663 * In some cases, a matching Activity may not exist, so ensure you safeguard 1664 * against this. 1665 * <p> 1666 * Input: Nothing. 1667 * <p> 1668 * Output: Nothing. 1669 */ 1670 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1671 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS"; 1672 1673 /** 1674 * Activity Action: Show the top level print settings. 1675 * <p> 1676 * In some cases, a matching Activity may not exist, so ensure you 1677 * safeguard against this. 1678 * <p> 1679 * Input: Nothing. 1680 * <p> 1681 * Output: Nothing. 1682 */ 1683 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1684 public static final String ACTION_PRINT_SETTINGS = 1685 "android.settings.ACTION_PRINT_SETTINGS"; 1686 1687 /** 1688 * Activity Action: Show Zen Mode configuration settings. 1689 * 1690 * @hide 1691 */ 1692 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1693 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS"; 1694 1695 /** 1696 * Activity Action: Show Zen Mode visual effects configuration settings. 1697 * 1698 * @hide 1699 */ 1700 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1701 public static final String ZEN_MODE_BLOCKED_EFFECTS_SETTINGS = 1702 "android.settings.ZEN_MODE_BLOCKED_EFFECTS_SETTINGS"; 1703 1704 /** 1705 * Activity Action: Show Zen Mode onboarding activity. 1706 * 1707 * @hide 1708 */ 1709 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1710 public static final String ZEN_MODE_ONBOARDING = "android.settings.ZEN_MODE_ONBOARDING"; 1711 1712 /** 1713 * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings. 1714 */ 1715 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1716 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS 1717 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS"; 1718 1719 /** 1720 * Activity Action: Show Zen Mode automation configuration settings. 1721 * 1722 * @hide 1723 */ 1724 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1725 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS 1726 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS"; 1727 1728 /** 1729 * Activity Action: Modify do not disturb mode settings. 1730 * <p> 1731 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1732 * <p> 1733 * This intent MUST be started using 1734 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity 1735 * startVoiceActivity}. 1736 * <p> 1737 * Note: The Activity implementing this intent MUST verify that 1738 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}. 1739 * returns true before modifying the setting. 1740 * <p> 1741 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate 1742 * how long the user wishes to avoid interruptions for. The optional 1743 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is 1744 * enabling or disabling do not disturb mode. If either extra is not included, the 1745 * user maybe asked to provide the value. 1746 * <p> 1747 * Output: Nothing. 1748 */ 1749 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1750 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE = 1751 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE"; 1752 1753 /** 1754 * Activity Action: Show Zen Mode schedule rule configuration settings. 1755 * 1756 * @hide 1757 */ 1758 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1759 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS 1760 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS"; 1761 1762 /** 1763 * Activity Action: Show Zen Mode event rule configuration settings. 1764 * 1765 * @hide 1766 */ 1767 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1768 public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS 1769 = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS"; 1770 1771 /** 1772 * Activity Action: Show Zen Mode external rule configuration settings. 1773 * 1774 * @hide 1775 */ 1776 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1777 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS 1778 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS"; 1779 1780 /** 1781 * Activity Action: Show the regulatory information screen for the device. 1782 * <p> 1783 * In some cases, a matching Activity may not exist, so ensure you safeguard 1784 * against this. 1785 * <p> 1786 * Input: Nothing. 1787 * <p> 1788 * Output: Nothing. 1789 */ 1790 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1791 public static final String 1792 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO"; 1793 1794 /** 1795 * Activity Action: Show Device Name Settings. 1796 * <p> 1797 * In some cases, a matching Activity may not exist, so ensure you safeguard 1798 * against this. 1799 * 1800 * @hide 1801 */ 1802 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1803 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME"; 1804 1805 /** 1806 * Activity Action: Show pairing settings. 1807 * <p> 1808 * In some cases, a matching Activity may not exist, so ensure you safeguard 1809 * against this. 1810 * 1811 * @hide 1812 */ 1813 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1814 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS"; 1815 1816 /** 1817 * Activity Action: Show battery saver settings. 1818 * <p> 1819 * In some cases, a matching Activity may not exist, so ensure you safeguard 1820 * against this. 1821 */ 1822 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1823 public static final String ACTION_BATTERY_SAVER_SETTINGS 1824 = "android.settings.BATTERY_SAVER_SETTINGS"; 1825 1826 /** 1827 * Activity Action: Modify Battery Saver mode setting using a voice command. 1828 * <p> 1829 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1830 * <p> 1831 * This intent MUST be started using 1832 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity 1833 * startVoiceActivity}. 1834 * <p> 1835 * Note: The activity implementing this intent MUST verify that 1836 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before 1837 * modifying the setting. 1838 * <p> 1839 * Input: To tell which state batter saver mode should be set to, add the 1840 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified. 1841 * If the extra is not included, no changes will be made. 1842 * <p> 1843 * Output: Nothing. 1844 */ 1845 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1846 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE = 1847 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE"; 1848 1849 /** 1850 * Activity Action: Show Home selection settings. If there are multiple activities 1851 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you 1852 * to pick your preferred activity. 1853 */ 1854 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1855 public static final String ACTION_HOME_SETTINGS 1856 = "android.settings.HOME_SETTINGS"; 1857 1858 /** 1859 * Activity Action: Show Default apps settings. 1860 * <p> 1861 * In some cases, a matching Activity may not exist, so ensure you 1862 * safeguard against this. 1863 * <p> 1864 * Input: Nothing. 1865 * <p> 1866 * Output: Nothing. 1867 */ 1868 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1869 public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS 1870 = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS"; 1871 1872 /** 1873 * Activity Action: Show More default apps settings. 1874 * <p> 1875 * If a Settings activity handles this intent action, a "More defaults" entry will be shown in 1876 * the Default apps settings, and clicking it will launch that activity. 1877 * <p> 1878 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1879 * <p> 1880 * Input: Nothing. 1881 * <p> 1882 * Output: Nothing. 1883 * 1884 * @hide 1885 */ 1886 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1887 @SystemApi 1888 public static final String ACTION_MANAGE_MORE_DEFAULT_APPS_SETTINGS = 1889 "android.settings.MANAGE_MORE_DEFAULT_APPS_SETTINGS"; 1890 1891 /** 1892 * Activity Action: Show notification settings. 1893 * 1894 * @hide 1895 */ 1896 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1897 public static final String ACTION_NOTIFICATION_SETTINGS 1898 = "android.settings.NOTIFICATION_SETTINGS"; 1899 1900 /** 1901 * Activity Action: Show conversation settings. 1902 * 1903 * @hide 1904 */ 1905 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1906 public static final String ACTION_CONVERSATION_SETTINGS 1907 = "android.settings.CONVERSATION_SETTINGS"; 1908 1909 /** 1910 * Activity Action: Show notification history screen. 1911 * 1912 * @hide 1913 */ 1914 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1915 public static final String ACTION_NOTIFICATION_HISTORY 1916 = "android.settings.NOTIFICATION_HISTORY"; 1917 1918 /** 1919 * Activity Action: Show app listing settings, filtered by those that send notifications. 1920 * 1921 * @hide 1922 */ 1923 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1924 public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS = 1925 "android.settings.ALL_APPS_NOTIFICATION_SETTINGS"; 1926 1927 /** 1928 * Activity Action: Show notification settings for a single app. 1929 * <p> 1930 * Input: {@link #EXTRA_APP_PACKAGE}, the package to display. 1931 * <p> 1932 * Output: Nothing. 1933 */ 1934 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1935 public static final String ACTION_APP_NOTIFICATION_SETTINGS 1936 = "android.settings.APP_NOTIFICATION_SETTINGS"; 1937 1938 /** 1939 * Activity Action: Show notification settings for a single {@link NotificationChannel}. 1940 * <p> 1941 * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display. 1942 * Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display. 1943 * <p> 1944 * Output: Nothing. 1945 */ 1946 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1947 public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS 1948 = "android.settings.CHANNEL_NOTIFICATION_SETTINGS"; 1949 1950 /** 1951 * Activity Action: Show notification bubble settings for a single app. 1952 * See {@link NotificationManager#getBubblePreference()}. 1953 * <p> 1954 * Input: {@link #EXTRA_APP_PACKAGE}, the package to display. 1955 * <p> 1956 * Output: Nothing. 1957 */ 1958 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1959 public static final String ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS 1960 = "android.settings.APP_NOTIFICATION_BUBBLE_SETTINGS"; 1961 1962 /** 1963 * Activity Extra: The package owner of the notification channel settings to display. 1964 * <p> 1965 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. 1966 */ 1967 public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE"; 1968 1969 /** 1970 * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings 1971 * to display. 1972 * <p> 1973 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. 1974 */ 1975 public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID"; 1976 1977 /** 1978 * Activity Extra: The {@link NotificationChannel#getConversationId()} of the notification 1979 * conversation settings to display. 1980 * <p> 1981 * This is an optional extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. If 1982 * included the system will first look up notification settings by channel and conversation id, 1983 * and will fall back to channel id if a specialized channel for this conversation doesn't 1984 * exist, similar to {@link NotificationManager#getNotificationChannel(String, String)}. 1985 */ 1986 public static final String EXTRA_CONVERSATION_ID = "android.provider.extra.CONVERSATION_ID"; 1987 1988 /** 1989 * Activity Extra: An {@code Arraylist<String>} of {@link NotificationChannel} field names to 1990 * show on the Settings UI. 1991 * 1992 * <p> 1993 * This is an optional extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. If 1994 * included the system will filter out any Settings that doesn't appear in this list that 1995 * otherwise would display. 1996 */ 1997 public static final String EXTRA_CHANNEL_FILTER_LIST 1998 = "android.provider.extra.CHANNEL_FILTER_LIST"; 1999 2000 /** 2001 * Activity Action: Show notification redaction settings. 2002 * 2003 * @hide 2004 */ 2005 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2006 public static final String ACTION_APP_NOTIFICATION_REDACTION 2007 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION"; 2008 2009 /** @hide */ 2010 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 2011 public static final String EXTRA_APP_UID = "app_uid"; 2012 2013 /** 2014 * Activity Action: Show power menu settings. 2015 * 2016 * @hide 2017 */ 2018 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2019 public static final String ACTION_POWER_MENU_SETTINGS = 2020 "android.settings.ACTION_POWER_MENU_SETTINGS"; 2021 2022 /** 2023 * Activity Action: Show controls settings. 2024 * 2025 * @hide 2026 */ 2027 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2028 public static final String ACTION_DEVICE_CONTROLS_SETTINGS = 2029 "android.settings.ACTION_DEVICE_CONTROLS_SETTINGS"; 2030 2031 /** 2032 * Activity Action: Show media control settings 2033 * 2034 * @hide 2035 */ 2036 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2037 public static final String ACTION_MEDIA_CONTROLS_SETTINGS = 2038 "android.settings.ACTION_MEDIA_CONTROLS_SETTINGS"; 2039 2040 /** 2041 * Activity Action: Show a dialog with disabled by policy message. 2042 * <p> If an user action is disabled by policy, this dialog can be triggered to let 2043 * the user know about this. 2044 * <p> 2045 * Input: {@link Intent#EXTRA_USER}: The user of the admin. 2046 * <p> 2047 * Output: Nothing. 2048 * 2049 * @hide 2050 */ 2051 // Intent#EXTRA_USER_ID can also be used 2052 @SystemApi 2053 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2054 public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS 2055 = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS"; 2056 2057 /** 2058 * Activity Action: Show a dialog for remote bugreport flow. 2059 * <p> 2060 * Input: Nothing. 2061 * <p> 2062 * Output: Nothing. 2063 * 2064 * @hide 2065 */ 2066 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2067 public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG 2068 = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG"; 2069 2070 /** 2071 * Activity Action: Show VR listener settings. 2072 * <p> 2073 * Input: Nothing. 2074 * <p> 2075 * Output: Nothing. 2076 * 2077 * @see android.service.vr.VrListenerService 2078 */ 2079 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2080 public static final String ACTION_VR_LISTENER_SETTINGS 2081 = "android.settings.VR_LISTENER_SETTINGS"; 2082 2083 /** 2084 * Activity Action: Show Picture-in-picture settings. 2085 * <p> 2086 * Input: Nothing. 2087 * <p> 2088 * Output: Nothing. 2089 * 2090 * @hide 2091 */ 2092 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2093 public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS 2094 = "android.settings.PICTURE_IN_PICTURE_SETTINGS"; 2095 2096 /** 2097 * Activity Action: Show Storage Manager settings. 2098 * <p> 2099 * Input: Nothing. 2100 * <p> 2101 * Output: Nothing. 2102 * 2103 * @hide 2104 */ 2105 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2106 public static final String ACTION_STORAGE_MANAGER_SETTINGS 2107 = "android.settings.STORAGE_MANAGER_SETTINGS"; 2108 2109 /** 2110 * Activity Action: Allows user to select current webview implementation. 2111 * <p> 2112 * Input: Nothing. 2113 * <p> 2114 * Output: Nothing. 2115 * <p class="note"> 2116 * In some cases, a matching Activity may not exist, so ensure you 2117 * safeguard against this. 2118 2119 */ 2120 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2121 public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS"; 2122 2123 /** 2124 * Activity Action: Show enterprise privacy section. 2125 * <p> 2126 * Input: Nothing. 2127 * <p> 2128 * Output: Nothing. 2129 * @hide 2130 */ 2131 @SystemApi 2132 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2133 public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS 2134 = "android.settings.ENTERPRISE_PRIVACY_SETTINGS"; 2135 2136 /** 2137 * Activity Action: Show Work Policy info. 2138 * DPC apps can implement an activity that handles this intent in order to show device policies 2139 * associated with the work profile or managed device. 2140 * <p> 2141 * Input: Nothing. 2142 * <p> 2143 * Output: Nothing. 2144 * 2145 */ 2146 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2147 public static final String ACTION_SHOW_WORK_POLICY_INFO = 2148 "android.settings.SHOW_WORK_POLICY_INFO"; 2149 2150 /** 2151 * Activity Action: Show screen that let user select its Autofill Service. 2152 * <p> 2153 * Input: Intent's data URI set with an application name, using the 2154 * "package" schema (like "package:com.my.app"). 2155 * 2156 * <p> 2157 * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging 2158 * to the caller package. 2159 * 2160 * <p> 2161 * <b>NOTE: </b> Applications should call 2162 * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and 2163 * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action 2164 * to start an activity if they return {@code false} and {@code true} respectively. 2165 */ 2166 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2167 public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE = 2168 "android.settings.REQUEST_SET_AUTOFILL_SERVICE"; 2169 2170 /** 2171 * Activity Action: Show screen for controlling the Quick Access Wallet. 2172 * <p> 2173 * In some cases, a matching Activity may not exist, so ensure you 2174 * safeguard against this. 2175 * <p> 2176 * Input: Nothing. 2177 * <p> 2178 * Output: Nothing. 2179 */ 2180 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2181 public static final String ACTION_QUICK_ACCESS_WALLET_SETTINGS = 2182 "android.settings.QUICK_ACCESS_WALLET_SETTINGS"; 2183 2184 /** 2185 * Activity Action: Show screen for controlling which apps have access on volume directories. 2186 * <p> 2187 * Input: Nothing. 2188 * <p> 2189 * Output: Nothing. 2190 * <p> 2191 * Applications typically use this action to ask the user to revert the "Do not ask again" 2192 * status of directory access requests made by 2193 * {@link android.os.storage.StorageVolume#createAccessIntent(String)}. 2194 * @deprecated use {@link #ACTION_APPLICATION_DETAILS_SETTINGS} to manage storage permissions 2195 * for a specific application 2196 */ 2197 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2198 @Deprecated 2199 public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS = 2200 "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS"; 2201 2202 2203 /** 2204 * Activity Action: Show screen that let user select enable (or disable) Content Capture. 2205 * <p> 2206 * Input: Nothing. 2207 * 2208 * <p> 2209 * Output: Nothing 2210 * 2211 * @hide 2212 */ 2213 @SystemApi 2214 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2215 public static final String ACTION_REQUEST_ENABLE_CONTENT_CAPTURE = 2216 "android.settings.REQUEST_ENABLE_CONTENT_CAPTURE"; 2217 2218 /** 2219 * Activity Action: Show screen that let user manage how Android handles URL resolution. 2220 * <p> 2221 * Input: Nothing. 2222 * <p> 2223 * Output: Nothing 2224 * 2225 * @hide 2226 */ 2227 @SystemApi 2228 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2229 public static final String ACTION_MANAGE_DOMAIN_URLS = "android.settings.MANAGE_DOMAIN_URLS"; 2230 2231 /** 2232 * Activity Action: Show screen that let user select enable (or disable) tethering. 2233 * <p> 2234 * Input: Nothing. 2235 * <p> 2236 * Output: Nothing 2237 * 2238 * @hide 2239 */ 2240 @SystemApi 2241 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2242 public static final String ACTION_TETHER_SETTINGS = "android.settings.TETHER_SETTINGS"; 2243 2244 /** 2245 * Broadcast to trigger notification of asking user to enable MMS. 2246 * Need to specify {@link #EXTRA_ENABLE_MMS_DATA_REQUEST_REASON} and {@link #EXTRA_SUB_ID}. 2247 * 2248 * @hide 2249 */ 2250 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 2251 public static final String ACTION_ENABLE_MMS_DATA_REQUEST = 2252 "android.settings.ENABLE_MMS_DATA_REQUEST"; 2253 2254 /** 2255 * Integer value that specifies the reason triggering enable MMS data notification. 2256 * This must be passed as an extra field to the {@link #ACTION_ENABLE_MMS_DATA_REQUEST}. 2257 * Extra with value of EnableMmsDataReason interface. 2258 * @hide 2259 */ 2260 public static final String EXTRA_ENABLE_MMS_DATA_REQUEST_REASON = 2261 "android.settings.extra.ENABLE_MMS_DATA_REQUEST_REASON"; 2262 2263 /** @hide */ 2264 @Retention(RetentionPolicy.SOURCE) 2265 @IntDef(prefix = { "ENABLE_MMS_DATA_REQUEST_REASON_" }, value = { 2266 ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS, 2267 ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS, 2268 }) 2269 public @interface EnableMmsDataReason{} 2270 2271 /** 2272 * Requesting to enable MMS data because there's an incoming MMS. 2273 * @hide 2274 */ 2275 public static final int ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS = 0; 2276 2277 /** 2278 * Requesting to enable MMS data because user is sending MMS. 2279 * @hide 2280 */ 2281 public static final int ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS = 1; 2282 2283 /** 2284 * Activity Action: Show screen of a cellular subscription and highlight the 2285 * "enable MMS" toggle. 2286 * <p> 2287 * Input: {@link #EXTRA_SUB_ID}: Sub ID of the subscription. 2288 * <p> 2289 * Output: Nothing 2290 * 2291 * @hide 2292 */ 2293 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2294 public static final String ACTION_MMS_MESSAGE_SETTING = "android.settings.MMS_MESSAGE_SETTING"; 2295 2296 // End of Intent actions for Settings 2297 2298 /** 2299 * @hide - Private call() method on SettingsProvider to read from 'system' table. 2300 */ 2301 public static final String CALL_METHOD_GET_SYSTEM = "GET_system"; 2302 2303 /** 2304 * @hide - Private call() method on SettingsProvider to read from 'secure' table. 2305 */ 2306 public static final String CALL_METHOD_GET_SECURE = "GET_secure"; 2307 2308 /** 2309 * @hide - Private call() method on SettingsProvider to read from 'global' table. 2310 */ 2311 public static final String CALL_METHOD_GET_GLOBAL = "GET_global"; 2312 2313 /** 2314 * @hide - Private call() method on SettingsProvider to read from 'config' table. 2315 */ 2316 public static final String CALL_METHOD_GET_CONFIG = "GET_config"; 2317 2318 /** 2319 * @hide - Specifies that the caller of the fast-path call()-based flow tracks 2320 * the settings generation in order to cache values locally. If this key is 2321 * mapped to a <code>null</code> string extra in the request bundle, the response 2322 * bundle will contain the same key mapped to a parcelable extra which would be 2323 * an {@link android.util.MemoryIntArray}. The response will also contain an 2324 * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the 2325 * index in the array clients should use to lookup the generation. For efficiency 2326 * the caller should request the generation tracking memory array only if it 2327 * doesn't already have it. 2328 * 2329 * @see #CALL_METHOD_GENERATION_INDEX_KEY 2330 */ 2331 public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation"; 2332 2333 /** 2334 * @hide Key with the location in the {@link android.util.MemoryIntArray} where 2335 * to look up the generation id of the backing table. The value is an integer. 2336 * 2337 * @see #CALL_METHOD_TRACK_GENERATION_KEY 2338 */ 2339 public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index"; 2340 2341 /** 2342 * @hide Key with the settings table generation. The value is an integer. 2343 * 2344 * @see #CALL_METHOD_TRACK_GENERATION_KEY 2345 */ 2346 public static final String CALL_METHOD_GENERATION_KEY = "_generation"; 2347 2348 /** 2349 * @hide - User handle argument extra to the fast-path call()-based requests 2350 */ 2351 public static final String CALL_METHOD_USER_KEY = "_user"; 2352 2353 /** 2354 * @hide - Boolean argument extra to the fast-path call()-based requests 2355 */ 2356 public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default"; 2357 2358 /** 2359 * @hide - User handle argument extra to the fast-path call()-based requests 2360 */ 2361 public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode"; 2362 2363 /** 2364 * @hide - String argument extra to the fast-path call()-based requests 2365 */ 2366 public static final String CALL_METHOD_TAG_KEY = "_tag"; 2367 2368 /** 2369 * @hide - String argument extra to the fast-path call()-based requests 2370 */ 2371 public static final String CALL_METHOD_PREFIX_KEY = "_prefix"; 2372 2373 /** 2374 * @hide - String argument extra to the fast-path call()-based requests 2375 */ 2376 public static final String CALL_METHOD_SYNC_DISABLED_MODE_KEY = "_disabled_mode"; 2377 2378 /** 2379 * @hide - RemoteCallback monitor callback argument extra to the fast-path call()-based requests 2380 */ 2381 public static final String CALL_METHOD_MONITOR_CALLBACK_KEY = "_monitor_callback_key"; 2382 2383 /** 2384 * @hide - String argument extra to the fast-path call()-based requests 2385 */ 2386 public static final String CALL_METHOD_FLAGS_KEY = "_flags"; 2387 2388 /** 2389 * @hide - String argument extra to the fast-path call()-based requests 2390 */ 2391 public static final String CALL_METHOD_OVERRIDEABLE_BY_RESTORE_KEY = "_overrideable_by_restore"; 2392 2393 /** @hide - Private call() method to write to 'system' table */ 2394 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system"; 2395 2396 /** @hide - Private call() method to write to 'secure' table */ 2397 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure"; 2398 2399 /** @hide - Private call() method to write to 'global' table */ 2400 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global"; 2401 2402 /** @hide - Private call() method to write to 'configuration' table */ 2403 public static final String CALL_METHOD_PUT_CONFIG = "PUT_config"; 2404 2405 /** @hide - Private call() method to write to and delete from the 'configuration' table */ 2406 public static final String CALL_METHOD_SET_ALL_CONFIG = "SET_ALL_config"; 2407 2408 /** @hide - Private call() method to delete from the 'system' table */ 2409 public static final String CALL_METHOD_DELETE_SYSTEM = "DELETE_system"; 2410 2411 /** @hide - Private call() method to delete from the 'secure' table */ 2412 public static final String CALL_METHOD_DELETE_SECURE = "DELETE_secure"; 2413 2414 /** @hide - Private call() method to delete from the 'global' table */ 2415 public static final String CALL_METHOD_DELETE_GLOBAL = "DELETE_global"; 2416 2417 /** @hide - Private call() method to reset to defaults the 'configuration' table */ 2418 public static final String CALL_METHOD_DELETE_CONFIG = "DELETE_config"; 2419 2420 /** @hide - Private call() method to reset to defaults the 'secure' table */ 2421 public static final String CALL_METHOD_RESET_SECURE = "RESET_secure"; 2422 2423 /** @hide - Private call() method to reset to defaults the 'global' table */ 2424 public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global"; 2425 2426 /** @hide - Private call() method to reset to defaults the 'configuration' table */ 2427 public static final String CALL_METHOD_RESET_CONFIG = "RESET_config"; 2428 2429 /** @hide - Private call() method to query the 'system' table */ 2430 public static final String CALL_METHOD_LIST_SYSTEM = "LIST_system"; 2431 2432 /** @hide - Private call() method to query the 'secure' table */ 2433 public static final String CALL_METHOD_LIST_SECURE = "LIST_secure"; 2434 2435 /** @hide - Private call() method to query the 'global' table */ 2436 public static final String CALL_METHOD_LIST_GLOBAL = "LIST_global"; 2437 2438 /** @hide - Private call() method to reset to defaults the 'configuration' table */ 2439 public static final String CALL_METHOD_LIST_CONFIG = "LIST_config"; 2440 2441 /** @hide - Private call() method to disable / re-enable syncs to the 'configuration' table */ 2442 public static final String CALL_METHOD_SET_SYNC_DISABLED_CONFIG = "SET_SYNC_DISABLED_config"; 2443 2444 /** 2445 * @hide - Private call() method to return whether syncs are disabled for the 'configuration' 2446 * table 2447 */ 2448 public static final String CALL_METHOD_IS_SYNC_DISABLED_CONFIG = "IS_SYNC_DISABLED_config"; 2449 2450 /** @hide - Private call() method to register monitor callback for 'configuration' table */ 2451 public static final String CALL_METHOD_REGISTER_MONITOR_CALLBACK_CONFIG = 2452 "REGISTER_MONITOR_CALLBACK_config"; 2453 2454 /** @hide - String argument extra to the config monitor callback */ 2455 public static final String EXTRA_MONITOR_CALLBACK_TYPE = "monitor_callback_type"; 2456 2457 /** @hide - String argument extra to the config monitor callback */ 2458 public static final String EXTRA_ACCESS_CALLBACK = "access_callback"; 2459 2460 /** @hide - String argument extra to the config monitor callback */ 2461 public static final String EXTRA_NAMESPACE_UPDATED_CALLBACK = 2462 "namespace_updated_callback"; 2463 2464 /** @hide - String argument extra to the config monitor callback */ 2465 public static final String EXTRA_NAMESPACE = "namespace"; 2466 2467 /** @hide - String argument extra to the config monitor callback */ 2468 public static final String EXTRA_CALLING_PACKAGE = "calling_package"; 2469 2470 /** 2471 * Activity Extra: Limit available options in launched activity based on the given authority. 2472 * <p> 2473 * This can be passed as an extra field in an Activity Intent with one or more syncable content 2474 * provider's authorities as a String[]. This field is used by some intents to alter the 2475 * behavior of the called activity. 2476 * <p> 2477 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based 2478 * on the authority given. 2479 */ 2480 public static final String EXTRA_AUTHORITIES = "authorities"; 2481 2482 /** 2483 * Activity Extra: Limit available options in launched activity based on the given account 2484 * types. 2485 * <p> 2486 * This can be passed as an extra field in an Activity Intent with one or more account types 2487 * as a String[]. This field is used by some intents to alter the behavior of the called 2488 * activity. 2489 * <p> 2490 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified 2491 * list. 2492 */ 2493 public static final String EXTRA_ACCOUNT_TYPES = "account_types"; 2494 2495 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id"; 2496 2497 /** 2498 * Activity Extra: The device identifier to act upon. 2499 * <p> 2500 * This can be passed as an extra field in an Activity Intent with a single 2501 * InputDeviceIdentifier. This field is used by some activities to jump straight into the 2502 * settings for the given device. 2503 * <p> 2504 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout 2505 * dialog for the given device. 2506 * @hide 2507 */ 2508 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier"; 2509 2510 /** 2511 * Activity Extra: Enable or disable Airplane Mode. 2512 * <p> 2513 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE} 2514 * intent as a boolean to indicate if it should be enabled. 2515 */ 2516 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled"; 2517 2518 /** 2519 * Activity Extra: Enable or disable Battery saver mode. 2520 * <p> 2521 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE} 2522 * intent as a boolean to indicate if it should be enabled. 2523 */ 2524 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED = 2525 "android.settings.extra.battery_saver_mode_enabled"; 2526 2527 /** 2528 * Activity Extra: Enable or disable Do Not Disturb mode. 2529 * <p> 2530 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} 2531 * intent as a boolean to indicate if it should be enabled. 2532 */ 2533 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED = 2534 "android.settings.extra.do_not_disturb_mode_enabled"; 2535 2536 /** 2537 * Activity Extra: How many minutes to enable do not disturb mode for. 2538 * <p> 2539 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} 2540 * intent to indicate how long do not disturb mode should be enabled for. 2541 */ 2542 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES = 2543 "android.settings.extra.do_not_disturb_mode_minutes"; 2544 2545 /** 2546 * Reset mode: reset to defaults only settings changed by the 2547 * calling package. If there is a default set the setting 2548 * will be set to it, otherwise the setting will be deleted. 2549 * This is the only type of reset available to non-system clients. 2550 * @hide 2551 */ 2552 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 2553 @TestApi 2554 public static final int RESET_MODE_PACKAGE_DEFAULTS = 1; 2555 2556 /** 2557 * Reset mode: reset all settings set by untrusted packages, which is 2558 * packages that aren't a part of the system, to the current defaults. 2559 * If there is a default set the setting will be set to it, otherwise 2560 * the setting will be deleted. This mode is only available to the system. 2561 * @hide 2562 */ 2563 public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2; 2564 2565 /** 2566 * Reset mode: delete all settings set by untrusted packages, which is 2567 * packages that aren't a part of the system. If a setting is set by an 2568 * untrusted package it will be deleted if its default is not provided 2569 * by the system, otherwise the setting will be set to its default. 2570 * This mode is only available to the system. 2571 * @hide 2572 */ 2573 public static final int RESET_MODE_UNTRUSTED_CHANGES = 3; 2574 2575 /** 2576 * Reset mode: reset all settings to defaults specified by trusted 2577 * packages, which is packages that are a part of the system, and 2578 * delete all settings set by untrusted packages. If a setting has 2579 * a default set by a system package it will be set to the default, 2580 * otherwise the setting will be deleted. This mode is only available 2581 * to the system. 2582 * @hide 2583 */ 2584 public static final int RESET_MODE_TRUSTED_DEFAULTS = 4; 2585 2586 /** @hide */ 2587 @Retention(RetentionPolicy.SOURCE) 2588 @IntDef(prefix = { "RESET_MODE_" }, value = { 2589 RESET_MODE_PACKAGE_DEFAULTS, 2590 RESET_MODE_UNTRUSTED_DEFAULTS, 2591 RESET_MODE_UNTRUSTED_CHANGES, 2592 RESET_MODE_TRUSTED_DEFAULTS 2593 }) 2594 public @interface ResetMode{} 2595 2596 /** 2597 * Activity Extra: Number of certificates 2598 * <p> 2599 * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO} 2600 * intent to indicate the number of certificates 2601 * @hide 2602 */ 2603 public static final String EXTRA_NUMBER_OF_CERTIFICATES = 2604 "android.settings.extra.number_of_certificates"; 2605 2606 private static final String SYSTEM_PACKAGE_NAME = "android"; 2607 2608 public static final String AUTHORITY = "settings"; 2609 2610 private static final String TAG = "Settings"; 2611 private static final boolean LOCAL_LOGV = false; 2612 2613 // Used in system server calling uid workaround in call() 2614 private static boolean sInSystemServer = false; 2615 private static final Object sInSystemServerLock = new Object(); 2616 2617 /** @hide */ setInSystemServer()2618 public static void setInSystemServer() { 2619 synchronized (sInSystemServerLock) { 2620 sInSystemServer = true; 2621 } 2622 } 2623 2624 /** @hide */ isInSystemServer()2625 public static boolean isInSystemServer() { 2626 synchronized (sInSystemServerLock) { 2627 return sInSystemServer; 2628 } 2629 } 2630 2631 public static class SettingNotFoundException extends AndroidException { SettingNotFoundException(String msg)2632 public SettingNotFoundException(String msg) { 2633 super(msg); 2634 } 2635 } 2636 2637 /** 2638 * Common base for tables of name/value settings. 2639 */ 2640 public static class NameValueTable implements BaseColumns { 2641 public static final String NAME = "name"; 2642 public static final String VALUE = "value"; 2643 // A flag indicating whether the current value of a setting should be preserved during 2644 // restore. 2645 /** @hide */ 2646 public static final String IS_PRESERVED_IN_RESTORE = "is_preserved_in_restore"; 2647 putString(ContentResolver resolver, Uri uri, String name, String value)2648 protected static boolean putString(ContentResolver resolver, Uri uri, 2649 String name, String value) { 2650 // The database will take care of replacing duplicates. 2651 try { 2652 ContentValues values = new ContentValues(); 2653 values.put(NAME, name); 2654 values.put(VALUE, value); 2655 resolver.insert(uri, values); 2656 return true; 2657 } catch (SQLException e) { 2658 Log.w(TAG, "Can't set key " + name + " in " + uri, e); 2659 return false; 2660 } 2661 } 2662 getUriFor(Uri uri, String name)2663 public static Uri getUriFor(Uri uri, String name) { 2664 return Uri.withAppendedPath(uri, name); 2665 } 2666 } 2667 2668 private static final class GenerationTracker { 2669 private final MemoryIntArray mArray; 2670 private final Runnable mErrorHandler; 2671 private final int mIndex; 2672 private int mCurrentGeneration; 2673 GenerationTracker(@onNull MemoryIntArray array, int index, int generation, Runnable errorHandler)2674 public GenerationTracker(@NonNull MemoryIntArray array, int index, 2675 int generation, Runnable errorHandler) { 2676 mArray = array; 2677 mIndex = index; 2678 mErrorHandler = errorHandler; 2679 mCurrentGeneration = generation; 2680 } 2681 isGenerationChanged()2682 public boolean isGenerationChanged() { 2683 final int currentGeneration = readCurrentGeneration(); 2684 if (currentGeneration >= 0) { 2685 if (currentGeneration == mCurrentGeneration) { 2686 return false; 2687 } 2688 mCurrentGeneration = currentGeneration; 2689 } 2690 return true; 2691 } 2692 getCurrentGeneration()2693 public int getCurrentGeneration() { 2694 return mCurrentGeneration; 2695 } 2696 readCurrentGeneration()2697 private int readCurrentGeneration() { 2698 try { 2699 return mArray.get(mIndex); 2700 } catch (IOException e) { 2701 Log.e(TAG, "Error getting current generation", e); 2702 if (mErrorHandler != null) { 2703 mErrorHandler.run(); 2704 } 2705 } 2706 return -1; 2707 } 2708 destroy()2709 public void destroy() { 2710 try { 2711 mArray.close(); 2712 } catch (IOException e) { 2713 Log.e(TAG, "Error closing backing array", e); 2714 if (mErrorHandler != null) { 2715 mErrorHandler.run(); 2716 } 2717 } 2718 } 2719 } 2720 2721 private static final class ContentProviderHolder { 2722 private final Object mLock = new Object(); 2723 2724 private final Uri mUri; 2725 @GuardedBy("mLock") 2726 @UnsupportedAppUsage 2727 private IContentProvider mContentProvider; 2728 ContentProviderHolder(Uri uri)2729 public ContentProviderHolder(Uri uri) { 2730 mUri = uri; 2731 } 2732 getProvider(ContentResolver contentResolver)2733 public IContentProvider getProvider(ContentResolver contentResolver) { 2734 synchronized (mLock) { 2735 if (mContentProvider == null) { 2736 mContentProvider = contentResolver 2737 .acquireProvider(mUri.getAuthority()); 2738 } 2739 return mContentProvider; 2740 } 2741 } 2742 clearProviderForTest()2743 public void clearProviderForTest() { 2744 synchronized (mLock) { 2745 mContentProvider = null; 2746 } 2747 } 2748 } 2749 2750 // Thread-safe. 2751 private static class NameValueCache { 2752 private static final boolean DEBUG = false; 2753 2754 private static final String[] SELECT_VALUE_PROJECTION = new String[] { 2755 Settings.NameValueTable.VALUE 2756 }; 2757 2758 private static final String NAME_EQ_PLACEHOLDER = "name=?"; 2759 2760 // Must synchronize on 'this' to access mValues and mValuesVersion. 2761 private final ArrayMap<String, String> mValues = new ArrayMap<>(); 2762 2763 private final Uri mUri; 2764 @UnsupportedAppUsage 2765 private final ContentProviderHolder mProviderHolder; 2766 2767 // The method we'll call (or null, to not use) on the provider 2768 // for the fast path of retrieving settings. 2769 private final String mCallGetCommand; 2770 private final String mCallSetCommand; 2771 private final String mCallListCommand; 2772 private final String mCallSetAllCommand; 2773 2774 private final ArraySet<String> mReadableFields; 2775 private final ArraySet<String> mAllFields; 2776 private final ArrayMap<String, Integer> mReadableFieldsWithMaxTargetSdk; 2777 2778 @GuardedBy("this") 2779 private GenerationTracker mGenerationTracker; 2780 NameValueCache(Uri uri, String getCommand, String setCommand, ContentProviderHolder providerHolder, Class<T> callerClass)2781 <T extends NameValueTable> NameValueCache(Uri uri, String getCommand, 2782 String setCommand, ContentProviderHolder providerHolder, Class<T> callerClass) { 2783 this(uri, getCommand, setCommand, null, null, providerHolder, 2784 callerClass); 2785 } 2786 NameValueCache(Uri uri, String getCommand, String setCommand, String listCommand, String setAllCommand, ContentProviderHolder providerHolder, Class<T> callerClass)2787 private <T extends NameValueTable> NameValueCache(Uri uri, String getCommand, 2788 String setCommand, String listCommand, String setAllCommand, 2789 ContentProviderHolder providerHolder, Class<T> callerClass) { 2790 mUri = uri; 2791 mCallGetCommand = getCommand; 2792 mCallSetCommand = setCommand; 2793 mCallListCommand = listCommand; 2794 mCallSetAllCommand = setAllCommand; 2795 mProviderHolder = providerHolder; 2796 mReadableFields = new ArraySet<>(); 2797 mAllFields = new ArraySet<>(); 2798 mReadableFieldsWithMaxTargetSdk = new ArrayMap<>(); 2799 getPublicSettingsForClass(callerClass, mAllFields, mReadableFields, 2800 mReadableFieldsWithMaxTargetSdk); 2801 } 2802 putStringForUser(ContentResolver cr, String name, String value, String tag, boolean makeDefault, final int userHandle, boolean overrideableByRestore)2803 public boolean putStringForUser(ContentResolver cr, String name, String value, 2804 String tag, boolean makeDefault, final int userHandle, 2805 boolean overrideableByRestore) { 2806 try { 2807 Bundle arg = new Bundle(); 2808 arg.putString(Settings.NameValueTable.VALUE, value); 2809 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 2810 if (tag != null) { 2811 arg.putString(CALL_METHOD_TAG_KEY, tag); 2812 } 2813 if (makeDefault) { 2814 arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true); 2815 } 2816 if (overrideableByRestore) { 2817 arg.putBoolean(CALL_METHOD_OVERRIDEABLE_BY_RESTORE_KEY, true); 2818 } 2819 IContentProvider cp = mProviderHolder.getProvider(cr); 2820 cp.call(cr.getAttributionSource(), 2821 mProviderHolder.mUri.getAuthority(), mCallSetCommand, name, arg); 2822 } catch (RemoteException e) { 2823 Log.w(TAG, "Can't set key " + name + " in " + mUri, e); 2824 return false; 2825 } 2826 return true; 2827 } 2828 setStringsForPrefix(ContentResolver cr, String prefix, HashMap<String, String> keyValues)2829 public @SetAllResult int setStringsForPrefix(ContentResolver cr, String prefix, 2830 HashMap<String, String> keyValues) { 2831 if (mCallSetAllCommand == null) { 2832 // This NameValueCache does not support atomically setting multiple flags 2833 return SET_ALL_RESULT_FAILURE; 2834 } 2835 try { 2836 Bundle args = new Bundle(); 2837 args.putString(CALL_METHOD_PREFIX_KEY, prefix); 2838 args.putSerializable(CALL_METHOD_FLAGS_KEY, keyValues); 2839 IContentProvider cp = mProviderHolder.getProvider(cr); 2840 Bundle bundle = cp.call(cr.getAttributionSource(), 2841 mProviderHolder.mUri.getAuthority(), 2842 mCallSetAllCommand, null, args); 2843 return bundle.getInt(KEY_CONFIG_SET_ALL_RETURN); 2844 } catch (RemoteException e) { 2845 // Not supported by the remote side 2846 return SET_ALL_RESULT_FAILURE; 2847 } 2848 } 2849 2850 @UnsupportedAppUsage getStringForUser(ContentResolver cr, String name, final int userHandle)2851 public String getStringForUser(ContentResolver cr, String name, final int userHandle) { 2852 // Check if the target settings key is readable. Reject if the caller is not system and 2853 // is trying to access a settings key defined in the Settings.Secure, Settings.System or 2854 // Settings.Global and is not annotated as @Readable. 2855 // Notice that a key string that is not defined in any of the Settings.* classes will 2856 // still be regarded as readable. 2857 if (!isCallerExemptFromReadableRestriction() && mAllFields.contains(name)) { 2858 if (!mReadableFields.contains(name)) { 2859 throw new SecurityException( 2860 "Settings key: <" + name + "> is not readable. From S+, settings keys " 2861 + "annotated with @hide are restricted to system_server and " 2862 + "system apps only, unless they are annotated with @Readable." 2863 ); 2864 } else { 2865 // When the target settings key has @Readable annotation, if the caller app's 2866 // target sdk is higher than the maxTargetSdk of the annotation, reject access. 2867 if (mReadableFieldsWithMaxTargetSdk.containsKey(name)) { 2868 final int maxTargetSdk = mReadableFieldsWithMaxTargetSdk.get(name); 2869 final Application application = ActivityThread.currentApplication(); 2870 final boolean targetSdkCheckOk = application != null 2871 && application.getApplicationInfo() != null 2872 && application.getApplicationInfo().targetSdkVersion 2873 <= maxTargetSdk; 2874 if (!targetSdkCheckOk) { 2875 throw new SecurityException( 2876 "Settings key: <" + name + "> is only readable to apps with " 2877 + "targetSdkVersion lower than or equal to: " 2878 + maxTargetSdk 2879 ); 2880 } 2881 } 2882 } 2883 } 2884 2885 final boolean isSelf = (userHandle == UserHandle.myUserId()); 2886 int currentGeneration = -1; 2887 if (isSelf) { 2888 synchronized (NameValueCache.this) { 2889 if (mGenerationTracker != null) { 2890 if (mGenerationTracker.isGenerationChanged()) { 2891 if (DEBUG) { 2892 Log.i(TAG, "Generation changed for type:" 2893 + mUri.getPath() + " in package:" 2894 + cr.getPackageName() +" and user:" + userHandle); 2895 } 2896 mValues.clear(); 2897 } else if (mValues.containsKey(name)) { 2898 return mValues.get(name); 2899 } 2900 if (mGenerationTracker != null) { 2901 currentGeneration = mGenerationTracker.getCurrentGeneration(); 2902 } 2903 } 2904 } 2905 } else { 2906 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle 2907 + " by user " + UserHandle.myUserId() + " so skipping cache"); 2908 } 2909 2910 IContentProvider cp = mProviderHolder.getProvider(cr); 2911 2912 // Try the fast path first, not using query(). If this 2913 // fails (alternate Settings provider that doesn't support 2914 // this interface?) then we fall back to the query/table 2915 // interface. 2916 if (mCallGetCommand != null) { 2917 try { 2918 Bundle args = null; 2919 if (!isSelf) { 2920 args = new Bundle(); 2921 args.putInt(CALL_METHOD_USER_KEY, userHandle); 2922 } 2923 boolean needsGenerationTracker = false; 2924 synchronized (NameValueCache.this) { 2925 if (isSelf && mGenerationTracker == null) { 2926 needsGenerationTracker = true; 2927 if (args == null) { 2928 args = new Bundle(); 2929 } 2930 args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null); 2931 if (DEBUG) { 2932 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath() 2933 + " in package:" + cr.getPackageName() +" and user:" 2934 + userHandle); 2935 } 2936 } 2937 } 2938 Bundle b; 2939 // If we're in system server and in a binder transaction we need to clear the 2940 // calling uid. This works around code in system server that did not call 2941 // clearCallingIdentity, previously this wasn't needed because reading settings 2942 // did not do permission checking but thats no longer the case. 2943 // Long term this should be removed and callers should properly call 2944 // clearCallingIdentity or use a ContentResolver from the caller as needed. 2945 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { 2946 final long token = Binder.clearCallingIdentity(); 2947 try { 2948 b = cp.call(cr.getAttributionSource(), 2949 mProviderHolder.mUri.getAuthority(), mCallGetCommand, name, 2950 args); 2951 } finally { 2952 Binder.restoreCallingIdentity(token); 2953 } 2954 } else { 2955 b = cp.call(cr.getAttributionSource(), 2956 mProviderHolder.mUri.getAuthority(), mCallGetCommand, name, args); 2957 } 2958 if (b != null) { 2959 String value = b.getString(Settings.NameValueTable.VALUE); 2960 // Don't update our cache for reads of other users' data 2961 if (isSelf) { 2962 synchronized (NameValueCache.this) { 2963 if (needsGenerationTracker) { 2964 MemoryIntArray array = b.getParcelable( 2965 CALL_METHOD_TRACK_GENERATION_KEY); 2966 final int index = b.getInt( 2967 CALL_METHOD_GENERATION_INDEX_KEY, -1); 2968 if (array != null && index >= 0) { 2969 final int generation = b.getInt( 2970 CALL_METHOD_GENERATION_KEY, 0); 2971 if (DEBUG) { 2972 Log.i(TAG, "Received generation tracker for type:" 2973 + mUri.getPath() + " in package:" 2974 + cr.getPackageName() + " and user:" 2975 + userHandle + " with index:" + index); 2976 } 2977 if (mGenerationTracker != null) { 2978 mGenerationTracker.destroy(); 2979 } 2980 mGenerationTracker = new GenerationTracker(array, index, 2981 generation, () -> { 2982 synchronized (NameValueCache.this) { 2983 Log.e(TAG, "Error accessing generation" 2984 + " tracker - removing"); 2985 if (mGenerationTracker != null) { 2986 GenerationTracker generationTracker = 2987 mGenerationTracker; 2988 mGenerationTracker = null; 2989 generationTracker.destroy(); 2990 mValues.clear(); 2991 } 2992 } 2993 }); 2994 currentGeneration = generation; 2995 } 2996 } 2997 if (mGenerationTracker != null && currentGeneration == 2998 mGenerationTracker.getCurrentGeneration()) { 2999 mValues.put(name, value); 3000 } 3001 } 3002 } else { 3003 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle 3004 + " by " + UserHandle.myUserId() 3005 + " so not updating cache"); 3006 } 3007 return value; 3008 } 3009 // If the response Bundle is null, we fall through 3010 // to the query interface below. 3011 } catch (RemoteException e) { 3012 // Not supported by the remote side? Fall through 3013 // to query(). 3014 } 3015 } 3016 3017 Cursor c = null; 3018 try { 3019 Bundle queryArgs = ContentResolver.createSqlQueryBundle( 3020 NAME_EQ_PLACEHOLDER, new String[]{name}, null); 3021 // Same workaround as above. 3022 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { 3023 final long token = Binder.clearCallingIdentity(); 3024 try { 3025 c = cp.query(cr.getAttributionSource(), mUri, 3026 SELECT_VALUE_PROJECTION, queryArgs, null); 3027 } finally { 3028 Binder.restoreCallingIdentity(token); 3029 } 3030 } else { 3031 c = cp.query(cr.getAttributionSource(), mUri, 3032 SELECT_VALUE_PROJECTION, queryArgs, null); 3033 } 3034 if (c == null) { 3035 Log.w(TAG, "Can't get key " + name + " from " + mUri); 3036 return null; 3037 } 3038 3039 String value = c.moveToNext() ? c.getString(0) : null; 3040 synchronized (NameValueCache.this) { 3041 if (mGenerationTracker != null 3042 && currentGeneration == mGenerationTracker.getCurrentGeneration()) { 3043 mValues.put(name, value); 3044 } 3045 } 3046 if (LOCAL_LOGV) { 3047 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " + 3048 name + " = " + (value == null ? "(null)" : value)); 3049 } 3050 return value; 3051 } catch (RemoteException e) { 3052 Log.w(TAG, "Can't get key " + name + " from " + mUri, e); 3053 return null; // Return null, but don't cache it. 3054 } finally { 3055 if (c != null) c.close(); 3056 } 3057 } 3058 isCallerExemptFromReadableRestriction()3059 private static boolean isCallerExemptFromReadableRestriction() { 3060 if (Settings.isInSystemServer()) { 3061 return true; 3062 } 3063 if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) { 3064 return true; 3065 } 3066 final Application application = ActivityThread.currentApplication(); 3067 if (application == null || application.getApplicationInfo() == null) { 3068 return false; 3069 } 3070 final ApplicationInfo applicationInfo = application.getApplicationInfo(); 3071 final boolean isTestOnly = 3072 (applicationInfo.flags & ApplicationInfo.FLAG_TEST_ONLY) != 0; 3073 return isTestOnly || applicationInfo.isSystemApp() || applicationInfo.isPrivilegedApp() 3074 || applicationInfo.isSignedWithPlatformKey(); 3075 } 3076 getStringsForPrefix(ContentResolver cr, String prefix, List<String> names)3077 public ArrayMap<String, String> getStringsForPrefix(ContentResolver cr, String prefix, 3078 List<String> names) { 3079 String namespace = prefix.substring(0, prefix.length() - 1); 3080 DeviceConfig.enforceReadPermission(ActivityThread.currentApplication(), namespace); 3081 ArrayMap<String, String> keyValues = new ArrayMap<>(); 3082 int currentGeneration = -1; 3083 3084 synchronized (NameValueCache.this) { 3085 if (mGenerationTracker != null) { 3086 if (mGenerationTracker.isGenerationChanged()) { 3087 if (DEBUG) { 3088 Log.i(TAG, "Generation changed for type:" + mUri.getPath() 3089 + " in package:" + cr.getPackageName()); 3090 } 3091 mValues.clear(); 3092 } else { 3093 boolean prefixCached = mValues.containsKey(prefix); 3094 if (prefixCached) { 3095 if (!names.isEmpty()) { 3096 for (String name : names) { 3097 if (mValues.containsKey(name)) { 3098 keyValues.put(name, mValues.get(name)); 3099 } 3100 } 3101 } else { 3102 for (int i = 0; i < mValues.size(); ++i) { 3103 String key = mValues.keyAt(i); 3104 // Explicitly exclude the prefix as it is only there to 3105 // signal that the prefix has been cached. 3106 if (key.startsWith(prefix) && !key.equals(prefix)) { 3107 keyValues.put(key, mValues.get(key)); 3108 } 3109 } 3110 } 3111 return keyValues; 3112 } 3113 } 3114 if (mGenerationTracker != null) { 3115 currentGeneration = mGenerationTracker.getCurrentGeneration(); 3116 } 3117 } 3118 } 3119 3120 if (mCallListCommand == null) { 3121 // No list command specified, return empty map 3122 return keyValues; 3123 } 3124 IContentProvider cp = mProviderHolder.getProvider(cr); 3125 3126 try { 3127 Bundle args = new Bundle(); 3128 args.putString(Settings.CALL_METHOD_PREFIX_KEY, prefix); 3129 boolean needsGenerationTracker = false; 3130 synchronized (NameValueCache.this) { 3131 if (mGenerationTracker == null) { 3132 needsGenerationTracker = true; 3133 args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null); 3134 if (DEBUG) { 3135 Log.i(TAG, "Requested generation tracker for type: " 3136 + mUri.getPath() + " in package:" + cr.getPackageName()); 3137 } 3138 } 3139 } 3140 3141 // Fetch all flags for the namespace at once for caching purposes 3142 Bundle b = cp.call(cr.getAttributionSource(), 3143 mProviderHolder.mUri.getAuthority(), mCallListCommand, null, args); 3144 if (b == null) { 3145 // Invalid response, return an empty map 3146 return keyValues; 3147 } 3148 3149 // All flags for the namespace 3150 Map<String, String> flagsToValues = 3151 (HashMap) b.getSerializable(Settings.NameValueTable.VALUE); 3152 // Only the flags requested by the caller 3153 if (!names.isEmpty()) { 3154 for (Map.Entry<String, String> flag : flagsToValues.entrySet()) { 3155 if (names.contains(flag.getKey())) { 3156 keyValues.put(flag.getKey(), flag.getValue()); 3157 } 3158 } 3159 } else { 3160 keyValues.putAll(flagsToValues); 3161 } 3162 3163 synchronized (NameValueCache.this) { 3164 if (needsGenerationTracker) { 3165 MemoryIntArray array = b.getParcelable( 3166 CALL_METHOD_TRACK_GENERATION_KEY); 3167 final int index = b.getInt( 3168 CALL_METHOD_GENERATION_INDEX_KEY, -1); 3169 if (array != null && index >= 0) { 3170 final int generation = b.getInt( 3171 CALL_METHOD_GENERATION_KEY, 0); 3172 if (DEBUG) { 3173 Log.i(TAG, "Received generation tracker for type:" 3174 + mUri.getPath() + " in package:" 3175 + cr.getPackageName() + " with index:" + index); 3176 } 3177 if (mGenerationTracker != null) { 3178 mGenerationTracker.destroy(); 3179 } 3180 mGenerationTracker = new GenerationTracker(array, index, 3181 generation, () -> { 3182 synchronized (NameValueCache.this) { 3183 Log.e(TAG, "Error accessing generation tracker" 3184 + " - removing"); 3185 if (mGenerationTracker != null) { 3186 GenerationTracker generationTracker = 3187 mGenerationTracker; 3188 mGenerationTracker = null; 3189 generationTracker.destroy(); 3190 mValues.clear(); 3191 } 3192 } 3193 }); 3194 currentGeneration = generation; 3195 } 3196 } 3197 if (mGenerationTracker != null && currentGeneration 3198 == mGenerationTracker.getCurrentGeneration()) { 3199 // cache the complete list of flags for the namespace 3200 mValues.putAll(flagsToValues); 3201 // Adding the prefix as a signal that the prefix is cached. 3202 mValues.put(prefix, null); 3203 } 3204 } 3205 return keyValues; 3206 } catch (RemoteException e) { 3207 // Not supported by the remote side, return an empty map 3208 return keyValues; 3209 } 3210 } 3211 clearGenerationTrackerForTest()3212 public void clearGenerationTrackerForTest() { 3213 synchronized (NameValueCache.this) { 3214 if (mGenerationTracker != null) { 3215 mGenerationTracker.destroy(); 3216 } 3217 mValues.clear(); 3218 mGenerationTracker = null; 3219 } 3220 } 3221 } 3222 3223 /** 3224 * Checks if the specified context can draw on top of other apps. As of API 3225 * level 23, an app cannot draw on top of other apps unless it declares the 3226 * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its 3227 * manifest, <em>and</em> the user specifically grants the app this 3228 * capability. To prompt the user to grant this approval, the app must send an 3229 * intent with the action 3230 * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which 3231 * causes the system to display a permission management screen. 3232 * 3233 * @param context App context. 3234 * @return true if the specified context can draw on top of other apps, false otherwise 3235 */ canDrawOverlays(Context context)3236 public static boolean canDrawOverlays(Context context) { 3237 return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(), 3238 context.getOpPackageName(), false) || context.checkSelfPermission( 3239 Manifest.permission.SYSTEM_APPLICATION_OVERLAY) 3240 == PackageManager.PERMISSION_GRANTED; 3241 } 3242 3243 /** 3244 * This annotation indicates that the value of a setting is allowed to be read 3245 * with the get* methods. The following settings should be readable: 3246 * 1) all the public settings 3247 * 2) all the hidden settings added before S 3248 */ 3249 @Target({ ElementType.FIELD }) 3250 @Retention(RetentionPolicy.RUNTIME) 3251 private @interface Readable { maxTargetSdk()3252 int maxTargetSdk() default 0; 3253 } 3254 getPublicSettingsForClass( Class<T> callerClass, Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> keysWithMaxTargetSdk)3255 private static <T extends NameValueTable> void getPublicSettingsForClass( 3256 Class<T> callerClass, Set<String> allKeys, Set<String> readableKeys, 3257 ArrayMap<String, Integer> keysWithMaxTargetSdk) { 3258 final Field[] allFields = callerClass.getDeclaredFields(); 3259 try { 3260 for (int i = 0; i < allFields.length; i++) { 3261 final Field field = allFields[i]; 3262 if (!field.getType().equals(String.class)) { 3263 continue; 3264 } 3265 final Object value = field.get(callerClass); 3266 if (!value.getClass().equals(String.class)) { 3267 continue; 3268 } 3269 allKeys.add((String) value); 3270 final Readable annotation = field.getAnnotation(Readable.class); 3271 3272 if (annotation != null) { 3273 final String key = (String) value; 3274 final int maxTargetSdk = annotation.maxTargetSdk(); 3275 readableKeys.add(key); 3276 if (maxTargetSdk != 0) { 3277 keysWithMaxTargetSdk.put(key, maxTargetSdk); 3278 } 3279 } 3280 } 3281 } catch (IllegalAccessException ignored) { 3282 } 3283 } 3284 3285 /** 3286 * System settings, containing miscellaneous system preferences. This 3287 * table holds simple name/value pairs. There are convenience 3288 * functions for accessing individual settings entries. 3289 */ 3290 public static final class System extends NameValueTable { 3291 // NOTE: If you add new settings here, be sure to add them to 3292 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked. 3293 3294 private static final float DEFAULT_FONT_SCALE = 1.0f; 3295 private static final int DEFAULT_FONT_WEIGHT = 0; 3296 3297 /** 3298 * The content:// style URL for this table 3299 */ 3300 public static final Uri CONTENT_URI = 3301 Uri.parse("content://" + AUTHORITY + "/system"); 3302 3303 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 3304 private static final ContentProviderHolder sProviderHolder = 3305 new ContentProviderHolder(CONTENT_URI); 3306 3307 @UnsupportedAppUsage 3308 private static final NameValueCache sNameValueCache = new NameValueCache( 3309 CONTENT_URI, 3310 CALL_METHOD_GET_SYSTEM, 3311 CALL_METHOD_PUT_SYSTEM, 3312 sProviderHolder, 3313 System.class); 3314 3315 @UnsupportedAppUsage 3316 private static final HashSet<String> MOVED_TO_SECURE; 3317 static { 3318 MOVED_TO_SECURE = new HashSet<>(30); 3319 MOVED_TO_SECURE.add(Secure.ADAPTIVE_SLEEP); 3320 MOVED_TO_SECURE.add(Secure.ANDROID_ID); 3321 MOVED_TO_SECURE.add(Secure.HTTP_PROXY); 3322 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED); 3323 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS); 3324 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED); 3325 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE); 3326 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); 3327 MOVED_TO_SECURE.add(Secure.LOGGING_ID); 3328 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED); 3329 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE); 3330 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL); 3331 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME); 3332 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL); 3333 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); 3334 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); 3335 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT); 3336 MOVED_TO_SECURE.add(Secure.WIFI_ON); 3337 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE); 3338 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT); 3339 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS); 3340 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED); 3341 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS); 3342 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT); 3343 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS); 3344 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON); 3345 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT); 3346 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS); 3347 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS); 3348 3349 // At one time in System, then Global, but now back in Secure 3350 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS); 3351 } 3352 3353 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 3354 private static final HashSet<String> MOVED_TO_GLOBAL; 3355 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 3356 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL; 3357 static { 3358 MOVED_TO_GLOBAL = new HashSet<>(); 3359 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>(); 3360 3361 // these were originally in system but migrated to secure in the past, 3362 // so are duplicated in the Secure.* namespace 3363 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED); 3364 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON); 3365 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING); 3366 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED); 3367 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY); 3368 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.NETWORK_PREFERENCE); 3369 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED); 3370 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS); 3371 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.WIFI_MAX_DHCP_RETRY_COUNT); 3372 3373 // these are moving directly from system to global 3374 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON); 3375 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS); 3376 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS); 3377 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME); 3378 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE); 3379 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND); 3380 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND); 3381 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND); 3382 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND); 3383 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED); 3384 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND); 3385 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND); 3386 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND); 3387 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED); 3388 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN); 3389 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY); 3390 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER); 3391 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE); 3392 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE); 3393 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE); 3394 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS); 3395 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE); 3396 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE); 3397 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY); 3398 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP); 3399 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER); 3400 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES); 3401 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL); 3402 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL); 3403 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL); 3404 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL); 3405 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL); 3406 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL); 3407 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL); 3408 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL); 3409 MOVED_TO_GLOBAL.add(Settings.Global.RADIO_NFC); 3410 MOVED_TO_GLOBAL.add(Settings.Global.RADIO_CELL); 3411 MOVED_TO_GLOBAL.add(Settings.Global.RADIO_WIFI); 3412 MOVED_TO_GLOBAL.add(Settings.Global.RADIO_BLUETOOTH); 3413 MOVED_TO_GLOBAL.add(Settings.Global.RADIO_WIMAX); 3414 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES); 3415 } 3416 3417 /** @hide */ getMovedToGlobalSettings(Set<String> outKeySet)3418 public static void getMovedToGlobalSettings(Set<String> outKeySet) { 3419 outKeySet.addAll(MOVED_TO_GLOBAL); 3420 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL); 3421 } 3422 3423 /** @hide */ getMovedToSecureSettings(Set<String> outKeySet)3424 public static void getMovedToSecureSettings(Set<String> outKeySet) { 3425 outKeySet.addAll(MOVED_TO_SECURE); 3426 } 3427 3428 /** @hide */ getNonLegacyMovedKeys(HashSet<String> outKeySet)3429 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) { 3430 outKeySet.addAll(MOVED_TO_GLOBAL); 3431 } 3432 3433 /** @hide */ clearProviderForTest()3434 public static void clearProviderForTest() { 3435 sProviderHolder.clearProviderForTest(); 3436 sNameValueCache.clearGenerationTrackerForTest(); 3437 } 3438 3439 /** @hide */ getPublicSettings(Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> readableKeysWithMaxTargetSdk)3440 public static void getPublicSettings(Set<String> allKeys, Set<String> readableKeys, 3441 ArrayMap<String, Integer> readableKeysWithMaxTargetSdk) { 3442 getPublicSettingsForClass(System.class, allKeys, readableKeys, 3443 readableKeysWithMaxTargetSdk); 3444 } 3445 3446 /** 3447 * Look up a name in the database. 3448 * @param resolver to access the database with 3449 * @param name to look up in the table 3450 * @return the corresponding value, or null if not present 3451 */ getString(ContentResolver resolver, String name)3452 public static String getString(ContentResolver resolver, String name) { 3453 return getStringForUser(resolver, name, resolver.getUserId()); 3454 } 3455 3456 /** @hide */ 3457 @UnsupportedAppUsage getStringForUser(ContentResolver resolver, String name, int userHandle)3458 public static String getStringForUser(ContentResolver resolver, String name, 3459 int userHandle) { 3460 if (MOVED_TO_SECURE.contains(name)) { 3461 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3462 + " to android.provider.Settings.Secure, returning read-only value."); 3463 return Secure.getStringForUser(resolver, name, userHandle); 3464 } 3465 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 3466 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3467 + " to android.provider.Settings.Global, returning read-only value."); 3468 return Global.getStringForUser(resolver, name, userHandle); 3469 } 3470 3471 return sNameValueCache.getStringForUser(resolver, name, userHandle); 3472 } 3473 3474 /** 3475 * Store a name/value pair into the database. 3476 * @param resolver to access the database with 3477 * @param name to store 3478 * @param value to associate with the name 3479 * @return true if the value was set, false on database errors 3480 */ putString(ContentResolver resolver, String name, String value)3481 public static boolean putString(ContentResolver resolver, String name, String value) { 3482 return putStringForUser(resolver, name, value, resolver.getUserId()); 3483 } 3484 3485 /** 3486 * Store a name/value pair into the database. Values written by this method will be 3487 * overridden if a restore happens in the future. 3488 * 3489 * @param resolver to access the database with 3490 * @param name to store 3491 * @param value to associate with the name 3492 * 3493 * @return true if the value was set, false on database errors 3494 * 3495 * @hide 3496 */ 3497 @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE) 3498 @SystemApi putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, boolean overrideableByRestore)3499 public static boolean putString(@NonNull ContentResolver resolver, 3500 @NonNull String name, @Nullable String value, boolean overrideableByRestore) { 3501 return putStringForUser(resolver, name, value, resolver.getUserId(), 3502 overrideableByRestore); 3503 } 3504 3505 /** @hide */ 3506 @UnsupportedAppUsage putStringForUser(ContentResolver resolver, String name, String value, int userHandle)3507 public static boolean putStringForUser(ContentResolver resolver, String name, String value, 3508 int userHandle) { 3509 return putStringForUser(resolver, name, value, userHandle, 3510 DEFAULT_OVERRIDEABLE_BY_RESTORE); 3511 } 3512 putStringForUser(ContentResolver resolver, String name, String value, int userHandle, boolean overrideableByRestore)3513 private static boolean putStringForUser(ContentResolver resolver, String name, String value, 3514 int userHandle, boolean overrideableByRestore) { 3515 if (MOVED_TO_SECURE.contains(name)) { 3516 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3517 + " to android.provider.Settings.Secure, value is unchanged."); 3518 return false; 3519 } 3520 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 3521 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3522 + " to android.provider.Settings.Global, value is unchanged."); 3523 return false; 3524 } 3525 return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle, 3526 overrideableByRestore); 3527 } 3528 3529 /** 3530 * Construct the content URI for a particular name/value pair, 3531 * useful for monitoring changes with a ContentObserver. 3532 * @param name to look up in the table 3533 * @return the corresponding content URI, or null if not present 3534 */ getUriFor(String name)3535 public static Uri getUriFor(String name) { 3536 if (MOVED_TO_SECURE.contains(name)) { 3537 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3538 + " to android.provider.Settings.Secure, returning Secure URI."); 3539 return Secure.getUriFor(Secure.CONTENT_URI, name); 3540 } 3541 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 3542 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3543 + " to android.provider.Settings.Global, returning read-only global URI."); 3544 return Global.getUriFor(Global.CONTENT_URI, name); 3545 } 3546 return getUriFor(CONTENT_URI, name); 3547 } 3548 3549 /** 3550 * Convenience function for retrieving a single system settings value 3551 * as an integer. Note that internally setting values are always 3552 * stored as strings; this function converts the string to an integer 3553 * for you. The default value will be returned if the setting is 3554 * not defined or not an integer. 3555 * 3556 * @param cr The ContentResolver to access. 3557 * @param name The name of the setting to retrieve. 3558 * @param def Value to return if the setting is not defined. 3559 * 3560 * @return The setting's current value, or 'def' if it is not defined 3561 * or not a valid integer. 3562 */ getInt(ContentResolver cr, String name, int def)3563 public static int getInt(ContentResolver cr, String name, int def) { 3564 return getIntForUser(cr, name, def, cr.getUserId()); 3565 } 3566 3567 /** @hide */ 3568 @UnsupportedAppUsage getIntForUser(ContentResolver cr, String name, int def, int userHandle)3569 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { 3570 String v = getStringForUser(cr, name, userHandle); 3571 try { 3572 return v != null ? Integer.parseInt(v) : def; 3573 } catch (NumberFormatException e) { 3574 return def; 3575 } 3576 } 3577 3578 /** 3579 * Convenience function for retrieving a single system settings value 3580 * as an integer. Note that internally setting values are always 3581 * stored as strings; this function converts the string to an integer 3582 * for you. 3583 * <p> 3584 * This version does not take a default value. If the setting has not 3585 * been set, or the string value is not a number, 3586 * it throws {@link SettingNotFoundException}. 3587 * 3588 * @param cr The ContentResolver to access. 3589 * @param name The name of the setting to retrieve. 3590 * 3591 * @throws SettingNotFoundException Thrown if a setting by the given 3592 * name can't be found or the setting value is not an integer. 3593 * 3594 * @return The setting's current value. 3595 */ getInt(ContentResolver cr, String name)3596 public static int getInt(ContentResolver cr, String name) 3597 throws SettingNotFoundException { 3598 return getIntForUser(cr, name, cr.getUserId()); 3599 } 3600 3601 /** @hide */ 3602 @UnsupportedAppUsage getIntForUser(ContentResolver cr, String name, int userHandle)3603 public static int getIntForUser(ContentResolver cr, String name, int userHandle) 3604 throws SettingNotFoundException { 3605 String v = getStringForUser(cr, name, userHandle); 3606 try { 3607 return Integer.parseInt(v); 3608 } catch (NumberFormatException e) { 3609 throw new SettingNotFoundException(name); 3610 } 3611 } 3612 3613 /** 3614 * Convenience function for updating a single settings value as an 3615 * integer. This will either create a new entry in the table if the 3616 * given name does not exist, or modify the value of the existing row 3617 * with that name. Note that internally setting values are always 3618 * stored as strings, so this function converts the given value to a 3619 * string before storing it. 3620 * 3621 * @param cr The ContentResolver to access. 3622 * @param name The name of the setting to modify. 3623 * @param value The new value for the setting. 3624 * @return true if the value was set, false on database errors 3625 */ putInt(ContentResolver cr, String name, int value)3626 public static boolean putInt(ContentResolver cr, String name, int value) { 3627 return putIntForUser(cr, name, value, cr.getUserId()); 3628 } 3629 3630 /** @hide */ 3631 @UnsupportedAppUsage putIntForUser(ContentResolver cr, String name, int value, int userHandle)3632 public static boolean putIntForUser(ContentResolver cr, String name, int value, 3633 int userHandle) { 3634 return putStringForUser(cr, name, Integer.toString(value), userHandle); 3635 } 3636 3637 /** 3638 * Convenience function for retrieving a single system settings value 3639 * as a {@code long}. Note that internally setting values are always 3640 * stored as strings; this function converts the string to a {@code long} 3641 * for you. The default value will be returned if the setting is 3642 * not defined or not a {@code long}. 3643 * 3644 * @param cr The ContentResolver to access. 3645 * @param name The name of the setting to retrieve. 3646 * @param def Value to return if the setting is not defined. 3647 * 3648 * @return The setting's current value, or 'def' if it is not defined 3649 * or not a valid {@code long}. 3650 */ getLong(ContentResolver cr, String name, long def)3651 public static long getLong(ContentResolver cr, String name, long def) { 3652 return getLongForUser(cr, name, def, cr.getUserId()); 3653 } 3654 3655 /** @hide */ getLongForUser(ContentResolver cr, String name, long def, int userHandle)3656 public static long getLongForUser(ContentResolver cr, String name, long def, 3657 int userHandle) { 3658 String valString = getStringForUser(cr, name, userHandle); 3659 long value; 3660 try { 3661 value = valString != null ? Long.parseLong(valString) : def; 3662 } catch (NumberFormatException e) { 3663 value = def; 3664 } 3665 return value; 3666 } 3667 3668 /** 3669 * Convenience function for retrieving a single system settings value 3670 * as a {@code long}. Note that internally setting values are always 3671 * stored as strings; this function converts the string to a {@code long} 3672 * for you. 3673 * <p> 3674 * This version does not take a default value. If the setting has not 3675 * been set, or the string value is not a number, 3676 * it throws {@link SettingNotFoundException}. 3677 * 3678 * @param cr The ContentResolver to access. 3679 * @param name The name of the setting to retrieve. 3680 * 3681 * @return The setting's current value. 3682 * @throws SettingNotFoundException Thrown if a setting by the given 3683 * name can't be found or the setting value is not an integer. 3684 */ getLong(ContentResolver cr, String name)3685 public static long getLong(ContentResolver cr, String name) 3686 throws SettingNotFoundException { 3687 return getLongForUser(cr, name, cr.getUserId()); 3688 } 3689 3690 /** @hide */ getLongForUser(ContentResolver cr, String name, int userHandle)3691 public static long getLongForUser(ContentResolver cr, String name, int userHandle) 3692 throws SettingNotFoundException { 3693 String valString = getStringForUser(cr, name, userHandle); 3694 try { 3695 return Long.parseLong(valString); 3696 } catch (NumberFormatException e) { 3697 throw new SettingNotFoundException(name); 3698 } 3699 } 3700 3701 /** 3702 * Convenience function for updating a single settings value as a long 3703 * integer. This will either create a new entry in the table if the 3704 * given name does not exist, or modify the value of the existing row 3705 * with that name. Note that internally setting values are always 3706 * stored as strings, so this function converts the given value to a 3707 * string before storing it. 3708 * 3709 * @param cr The ContentResolver to access. 3710 * @param name The name of the setting to modify. 3711 * @param value The new value for the setting. 3712 * @return true if the value was set, false on database errors 3713 */ putLong(ContentResolver cr, String name, long value)3714 public static boolean putLong(ContentResolver cr, String name, long value) { 3715 return putLongForUser(cr, name, value, cr.getUserId()); 3716 } 3717 3718 /** @hide */ putLongForUser(ContentResolver cr, String name, long value, int userHandle)3719 public static boolean putLongForUser(ContentResolver cr, String name, long value, 3720 int userHandle) { 3721 return putStringForUser(cr, name, Long.toString(value), userHandle); 3722 } 3723 3724 /** 3725 * Convenience function for retrieving a single system settings value 3726 * as a floating point number. Note that internally setting values are 3727 * always stored as strings; this function converts the string to an 3728 * float for you. The default value will be returned if the setting 3729 * is not defined or not a valid float. 3730 * 3731 * @param cr The ContentResolver to access. 3732 * @param name The name of the setting to retrieve. 3733 * @param def Value to return if the setting is not defined. 3734 * 3735 * @return The setting's current value, or 'def' if it is not defined 3736 * or not a valid float. 3737 */ getFloat(ContentResolver cr, String name, float def)3738 public static float getFloat(ContentResolver cr, String name, float def) { 3739 return getFloatForUser(cr, name, def, cr.getUserId()); 3740 } 3741 3742 /** @hide */ getFloatForUser(ContentResolver cr, String name, float def, int userHandle)3743 public static float getFloatForUser(ContentResolver cr, String name, float def, 3744 int userHandle) { 3745 String v = getStringForUser(cr, name, userHandle); 3746 try { 3747 return v != null ? Float.parseFloat(v) : def; 3748 } catch (NumberFormatException e) { 3749 return def; 3750 } 3751 } 3752 3753 /** 3754 * Convenience function for retrieving a single system settings value 3755 * as a float. Note that internally setting values are always 3756 * stored as strings; this function converts the string to a float 3757 * for you. 3758 * <p> 3759 * This version does not take a default value. If the setting has not 3760 * been set, or the string value is not a number, 3761 * it throws {@link SettingNotFoundException}. 3762 * 3763 * @param cr The ContentResolver to access. 3764 * @param name The name of the setting to retrieve. 3765 * 3766 * @throws SettingNotFoundException Thrown if a setting by the given 3767 * name can't be found or the setting value is not a float. 3768 * 3769 * @return The setting's current value. 3770 */ getFloat(ContentResolver cr, String name)3771 public static float getFloat(ContentResolver cr, String name) 3772 throws SettingNotFoundException { 3773 return getFloatForUser(cr, name, cr.getUserId()); 3774 } 3775 3776 /** @hide */ getFloatForUser(ContentResolver cr, String name, int userHandle)3777 public static float getFloatForUser(ContentResolver cr, String name, int userHandle) 3778 throws SettingNotFoundException { 3779 String v = getStringForUser(cr, name, userHandle); 3780 if (v == null) { 3781 throw new SettingNotFoundException(name); 3782 } 3783 try { 3784 return Float.parseFloat(v); 3785 } catch (NumberFormatException e) { 3786 throw new SettingNotFoundException(name); 3787 } 3788 } 3789 3790 /** 3791 * Convenience function for updating a single settings value as a 3792 * floating point number. This will either create a new entry in the 3793 * table if the given name does not exist, or modify the value of the 3794 * existing row with that name. Note that internally setting values 3795 * are always stored as strings, so this function converts the given 3796 * value to a string before storing it. 3797 * 3798 * @param cr The ContentResolver to access. 3799 * @param name The name of the setting to modify. 3800 * @param value The new value for the setting. 3801 * @return true if the value was set, false on database errors 3802 */ putFloat(ContentResolver cr, String name, float value)3803 public static boolean putFloat(ContentResolver cr, String name, float value) { 3804 return putFloatForUser(cr, name, value, cr.getUserId()); 3805 } 3806 3807 /** @hide */ putFloatForUser(ContentResolver cr, String name, float value, int userHandle)3808 public static boolean putFloatForUser(ContentResolver cr, String name, float value, 3809 int userHandle) { 3810 return putStringForUser(cr, name, Float.toString(value), userHandle); 3811 } 3812 3813 /** 3814 * Convenience function to read all of the current 3815 * configuration-related settings into a 3816 * {@link Configuration} object. 3817 * 3818 * @param cr The ContentResolver to access. 3819 * @param outConfig Where to place the configuration settings. 3820 */ getConfiguration(ContentResolver cr, Configuration outConfig)3821 public static void getConfiguration(ContentResolver cr, Configuration outConfig) { 3822 adjustConfigurationForUser(cr, outConfig, cr.getUserId(), 3823 false /* updateSettingsIfEmpty */); 3824 } 3825 3826 /** @hide */ adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, int userHandle, boolean updateSettingsIfEmpty)3827 public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, 3828 int userHandle, boolean updateSettingsIfEmpty) { 3829 outConfig.fontScale = Settings.System.getFloatForUser( 3830 cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle); 3831 if (outConfig.fontScale < 0) { 3832 outConfig.fontScale = DEFAULT_FONT_SCALE; 3833 } 3834 outConfig.fontWeightAdjustment = Settings.Secure.getIntForUser( 3835 cr, Settings.Secure.FONT_WEIGHT_ADJUSTMENT, DEFAULT_FONT_WEIGHT, userHandle); 3836 3837 final String localeValue = 3838 Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle); 3839 if (localeValue != null) { 3840 outConfig.setLocales(LocaleList.forLanguageTags(localeValue)); 3841 } else { 3842 // Do not update configuration with emtpy settings since we need to take over the 3843 // locale list of previous user if the settings value is empty. This happens when a 3844 // new user is created. 3845 3846 if (updateSettingsIfEmpty) { 3847 // Make current configuration persistent. This is necessary the first time a 3848 // user log in. At the first login, the configuration settings are empty, so we 3849 // need to store the adjusted configuration as the initial settings. 3850 Settings.System.putStringForUser( 3851 cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(), 3852 userHandle, DEFAULT_OVERRIDEABLE_BY_RESTORE); 3853 } 3854 } 3855 } 3856 3857 /** 3858 * @hide Erase the fields in the Configuration that should be applied 3859 * by the settings. 3860 */ clearConfiguration(Configuration inoutConfig)3861 public static void clearConfiguration(Configuration inoutConfig) { 3862 inoutConfig.fontScale = 0; 3863 if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) { 3864 inoutConfig.clearLocales(); 3865 } 3866 inoutConfig.fontWeightAdjustment = Configuration.FONT_WEIGHT_ADJUSTMENT_UNDEFINED; 3867 } 3868 3869 /** 3870 * Convenience function to write a batch of configuration-related 3871 * settings from a {@link Configuration} object. 3872 * 3873 * @param cr The ContentResolver to access. 3874 * @param config The settings to write. 3875 * @return true if the values were set, false on database errors 3876 */ putConfiguration(ContentResolver cr, Configuration config)3877 public static boolean putConfiguration(ContentResolver cr, Configuration config) { 3878 return putConfigurationForUser(cr, config, cr.getUserId()); 3879 } 3880 3881 /** @hide */ putConfigurationForUser(ContentResolver cr, Configuration config, int userHandle)3882 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config, 3883 int userHandle) { 3884 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) && 3885 Settings.System.putStringForUser( 3886 cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle, 3887 DEFAULT_OVERRIDEABLE_BY_RESTORE); 3888 } 3889 3890 /** 3891 * Convenience function for checking if settings should be overwritten with config changes. 3892 * @see #putConfigurationForUser(ContentResolver, Configuration, int) 3893 * @hide 3894 */ hasInterestingConfigurationChanges(int changes)3895 public static boolean hasInterestingConfigurationChanges(int changes) { 3896 return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 || 3897 (changes & ActivityInfo.CONFIG_LOCALE) != 0; 3898 } 3899 3900 /** @deprecated - Do not use */ 3901 @Deprecated getShowGTalkServiceStatus(ContentResolver cr)3902 public static boolean getShowGTalkServiceStatus(ContentResolver cr) { 3903 return getShowGTalkServiceStatusForUser(cr, cr.getUserId()); 3904 } 3905 3906 /** 3907 * @hide 3908 * @deprecated - Do not use 3909 */ 3910 @Deprecated getShowGTalkServiceStatusForUser(ContentResolver cr, int userHandle)3911 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr, 3912 int userHandle) { 3913 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0; 3914 } 3915 3916 /** @deprecated - Do not use */ 3917 @Deprecated setShowGTalkServiceStatus(ContentResolver cr, boolean flag)3918 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) { 3919 setShowGTalkServiceStatusForUser(cr, flag, cr.getUserId()); 3920 } 3921 3922 /** 3923 * @hide 3924 * @deprecated - Do not use 3925 */ 3926 @Deprecated setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, int userHandle)3927 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, 3928 int userHandle) { 3929 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle); 3930 } 3931 3932 /** 3933 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead 3934 */ 3935 @Deprecated 3936 public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN; 3937 3938 /** 3939 * What happens when the user presses the end call button if they're not 3940 * on a call.<br/> 3941 * <b>Values:</b><br/> 3942 * 0 - The end button does nothing.<br/> 3943 * 1 - The end button goes to the home screen.<br/> 3944 * 2 - The end button puts the device to sleep and locks the keyguard.<br/> 3945 * 3 - The end button goes to the home screen. If the user is already on the 3946 * home screen, it puts the device to sleep. 3947 */ 3948 @Readable 3949 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior"; 3950 3951 /** 3952 * END_BUTTON_BEHAVIOR value for "go home". 3953 * @hide 3954 */ 3955 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1; 3956 3957 /** 3958 * END_BUTTON_BEHAVIOR value for "go to sleep". 3959 * @hide 3960 */ 3961 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2; 3962 3963 /** 3964 * END_BUTTON_BEHAVIOR default value. 3965 * @hide 3966 */ 3967 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP; 3968 3969 /** 3970 * Is advanced settings mode turned on. 0 == no, 1 == yes 3971 * @hide 3972 */ 3973 @Readable 3974 public static final String ADVANCED_SETTINGS = "advanced_settings"; 3975 3976 /** 3977 * ADVANCED_SETTINGS default value. 3978 * @hide 3979 */ 3980 public static final int ADVANCED_SETTINGS_DEFAULT = 0; 3981 3982 /** 3983 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead 3984 */ 3985 @Deprecated 3986 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON; 3987 3988 /** 3989 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead 3990 */ 3991 @Deprecated 3992 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH; 3993 3994 /** 3995 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead 3996 */ 3997 @Deprecated 3998 public static final String RADIO_WIFI = Global.RADIO_WIFI; 3999 4000 /** 4001 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead 4002 * {@hide} 4003 */ 4004 @Deprecated 4005 public static final String RADIO_WIMAX = Global.RADIO_WIMAX; 4006 4007 /** 4008 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead 4009 */ 4010 @Deprecated 4011 public static final String RADIO_CELL = Global.RADIO_CELL; 4012 4013 /** 4014 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead 4015 */ 4016 @Deprecated 4017 public static final String RADIO_NFC = Global.RADIO_NFC; 4018 4019 /** 4020 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead 4021 */ 4022 @Deprecated 4023 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS; 4024 4025 /** 4026 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead 4027 * 4028 * {@hide} 4029 */ 4030 @Deprecated 4031 @UnsupportedAppUsage 4032 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = 4033 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS; 4034 4035 /** 4036 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead 4037 */ 4038 @Deprecated 4039 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY; 4040 4041 /** 4042 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead 4043 */ 4044 @Deprecated 4045 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT; 4046 4047 /** 4048 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead 4049 */ 4050 @Deprecated 4051 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 4052 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED; 4053 4054 /** 4055 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead 4056 */ 4057 @Deprecated 4058 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER; 4059 4060 /** 4061 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead 4062 */ 4063 @Deprecated 4064 public static final String MODE_RINGER = Global.MODE_RINGER; 4065 4066 /** 4067 * Whether to use static IP and other static network attributes. 4068 * <p> 4069 * Set to 1 for true and 0 for false. 4070 * 4071 * @deprecated Use {@link WifiManager} instead 4072 */ 4073 @Deprecated 4074 @Readable 4075 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip"; 4076 4077 /** 4078 * The static IP address. 4079 * <p> 4080 * Example: "192.168.1.51" 4081 * 4082 * @deprecated Use {@link WifiManager} instead 4083 */ 4084 @Deprecated 4085 @Readable 4086 public static final String WIFI_STATIC_IP = "wifi_static_ip"; 4087 4088 /** 4089 * If using static IP, the gateway's IP address. 4090 * <p> 4091 * Example: "192.168.1.1" 4092 * 4093 * @deprecated Use {@link WifiManager} instead 4094 */ 4095 @Deprecated 4096 @Readable 4097 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway"; 4098 4099 /** 4100 * If using static IP, the net mask. 4101 * <p> 4102 * Example: "255.255.255.0" 4103 * 4104 * @deprecated Use {@link WifiManager} instead 4105 */ 4106 @Deprecated 4107 @Readable 4108 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask"; 4109 4110 /** 4111 * If using static IP, the primary DNS's IP address. 4112 * <p> 4113 * Example: "192.168.1.1" 4114 * 4115 * @deprecated Use {@link WifiManager} instead 4116 */ 4117 @Deprecated 4118 @Readable 4119 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1"; 4120 4121 /** 4122 * If using static IP, the secondary DNS's IP address. 4123 * <p> 4124 * Example: "192.168.1.2" 4125 * 4126 * @deprecated Use {@link WifiManager} instead 4127 */ 4128 @Deprecated 4129 @Readable 4130 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2"; 4131 4132 /** 4133 * Determines whether remote devices may discover and/or connect to 4134 * this device. 4135 * <P>Type: INT</P> 4136 * 2 -- discoverable and connectable 4137 * 1 -- connectable but not discoverable 4138 * 0 -- neither connectable nor discoverable 4139 */ 4140 @Readable 4141 public static final String BLUETOOTH_DISCOVERABILITY = 4142 "bluetooth_discoverability"; 4143 4144 /** 4145 * Bluetooth discoverability timeout. If this value is nonzero, then 4146 * Bluetooth becomes discoverable for a certain number of seconds, 4147 * after which is becomes simply connectable. The value is in seconds. 4148 */ 4149 @Readable 4150 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT = 4151 "bluetooth_discoverability_timeout"; 4152 4153 /** 4154 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED} 4155 * instead 4156 */ 4157 @Deprecated 4158 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED; 4159 4160 /** 4161 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE} 4162 * instead 4163 */ 4164 @Deprecated 4165 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; 4166 4167 /** 4168 * @deprecated Use 4169 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED} 4170 * instead 4171 */ 4172 @Deprecated 4173 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = 4174 "lock_pattern_tactile_feedback_enabled"; 4175 4176 /** 4177 * A formatted string of the next alarm that is set, or the empty string 4178 * if there is no alarm set. 4179 * 4180 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}. 4181 */ 4182 @Deprecated 4183 @Readable 4184 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted"; 4185 4186 /** 4187 * Scaling factor for fonts, float. 4188 */ 4189 @Readable 4190 public static final String FONT_SCALE = "font_scale"; 4191 4192 /** 4193 * The serialized system locale value. 4194 * 4195 * Do not use this value directory. 4196 * To get system locale, use {@link LocaleList#getDefault} instead. 4197 * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales} 4198 * instead. 4199 * @hide 4200 */ 4201 @Readable 4202 public static final String SYSTEM_LOCALES = "system_locales"; 4203 4204 4205 /** 4206 * Name of an application package to be debugged. 4207 * 4208 * @deprecated Use {@link Global#DEBUG_APP} instead 4209 */ 4210 @Deprecated 4211 public static final String DEBUG_APP = Global.DEBUG_APP; 4212 4213 /** 4214 * If 1, when launching DEBUG_APP it will wait for the debugger before 4215 * starting user code. If 0, it will run normally. 4216 * 4217 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead 4218 */ 4219 @Deprecated 4220 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER; 4221 4222 /** 4223 * Whether or not to dim the screen. 0=no 1=yes 4224 * @deprecated This setting is no longer used. 4225 */ 4226 @Deprecated 4227 @Readable 4228 public static final String DIM_SCREEN = "dim_screen"; 4229 4230 /** 4231 * The display color mode. 4232 * @hide 4233 */ 4234 @Readable 4235 public static final String DISPLAY_COLOR_MODE = "display_color_mode"; 4236 4237 /** 4238 * Hint to decide whether restored vendor color modes are compatible with the new device. If 4239 * unset or a match is not made, only the standard color modes will be restored. 4240 * @hide 4241 */ 4242 public static final String DISPLAY_COLOR_MODE_VENDOR_HINT = 4243 "display_color_mode_vendor_hint"; 4244 4245 /** 4246 * The user selected min refresh rate in frames per second. 4247 * 4248 * If this isn't set, 0 will be used. 4249 * @hide 4250 */ 4251 @Readable 4252 public static final String MIN_REFRESH_RATE = "min_refresh_rate"; 4253 4254 /** 4255 * The user selected peak refresh rate in frames per second. 4256 * 4257 * If this isn't set, the system falls back to a device specific default. 4258 * @hide 4259 */ 4260 @Readable 4261 public static final String PEAK_REFRESH_RATE = "peak_refresh_rate"; 4262 4263 /** 4264 * The amount of time in milliseconds before the device goes to sleep or begins 4265 * to dream after a period of inactivity. This value is also known as the 4266 * user activity timeout period since the screen isn't necessarily turned off 4267 * when it expires. 4268 * 4269 * <p> 4270 * This value is bounded by maximum timeout set by 4271 * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}. 4272 */ 4273 @Readable 4274 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout"; 4275 4276 /** 4277 * The screen backlight brightness between 0 and 255. 4278 */ 4279 @Readable 4280 public static final String SCREEN_BRIGHTNESS = "screen_brightness"; 4281 4282 /** 4283 * The screen backlight brightness between 0 and 255. 4284 * @hide 4285 */ 4286 @Readable 4287 public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr"; 4288 4289 /** 4290 * The screen backlight brightness between 0.0f and 1.0f. 4291 * @hide 4292 */ 4293 @Readable 4294 public static final String SCREEN_BRIGHTNESS_FOR_VR_FLOAT = 4295 "screen_brightness_for_vr_float"; 4296 4297 /** 4298 * The screen backlight brightness between 0.0f and 1.0f. 4299 * @hide 4300 */ 4301 @Readable 4302 public static final String SCREEN_BRIGHTNESS_FLOAT = "screen_brightness_float"; 4303 4304 /** 4305 * Control whether to enable automatic brightness mode. 4306 */ 4307 @Readable 4308 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode"; 4309 4310 /** 4311 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0) 4312 * or less (<0.0 >-1.0) bright. 4313 * @hide 4314 */ 4315 @UnsupportedAppUsage 4316 @Readable 4317 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj"; 4318 4319 /** 4320 * SCREEN_BRIGHTNESS_MODE value for manual mode. 4321 */ 4322 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0; 4323 4324 /** 4325 * SCREEN_BRIGHTNESS_MODE value for automatic mode. 4326 */ 4327 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1; 4328 4329 /** 4330 * Control whether to enable adaptive sleep mode. 4331 * @deprecated Use {@link android.provider.Settings.Secure#ADAPTIVE_SLEEP} instead. 4332 * @hide 4333 */ 4334 @Deprecated 4335 @Readable 4336 public static final String ADAPTIVE_SLEEP = "adaptive_sleep"; 4337 4338 /** 4339 * Control whether the process CPU usage meter should be shown. 4340 * 4341 * @deprecated This functionality is no longer available as of 4342 * {@link android.os.Build.VERSION_CODES#N_MR1}. 4343 */ 4344 @Deprecated 4345 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES; 4346 4347 /** 4348 * If 1, the activity manager will aggressively finish activities and 4349 * processes as soon as they are no longer needed. If 0, the normal 4350 * extended lifetime is used. 4351 * 4352 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead 4353 */ 4354 @Deprecated 4355 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES; 4356 4357 /** 4358 * Determines which streams are affected by ringer and zen mode changes. The 4359 * stream type's bit should be set to 1 if it should be muted when going 4360 * into an inaudible ringer mode. 4361 */ 4362 @Readable 4363 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected"; 4364 4365 /** 4366 * Determines which streams are affected by mute. The 4367 * stream type's bit should be set to 1 if it should be muted when a mute request 4368 * is received. 4369 */ 4370 @Readable 4371 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected"; 4372 4373 /** 4374 * Whether vibrate is on for different events. This is used internally, 4375 * changing this value will not change the vibrate. See AudioManager. 4376 */ 4377 @Readable 4378 public static final String VIBRATE_ON = "vibrate_on"; 4379 4380 /** 4381 * If 1, redirects the system vibrator to all currently attached input devices 4382 * that support vibration. If there are no such input devices, then the system 4383 * vibrator is used instead. 4384 * If 0, does not register the system vibrator. 4385 * 4386 * This setting is mainly intended to provide a compatibility mechanism for 4387 * applications that only know about the system vibrator and do not use the 4388 * input device vibrator API. 4389 * 4390 * @hide 4391 */ 4392 @Readable 4393 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices"; 4394 4395 /** 4396 * The intensity of notification vibrations, if configurable. 4397 * 4398 * Not all devices are capable of changing their vibration intensity; on these devices 4399 * there will likely be no difference between the various vibration intensities except for 4400 * intensity 0 (off) and the rest. 4401 * 4402 * <b>Values:</b><br/> 4403 * 0 - Vibration is disabled<br/> 4404 * 1 - Weak vibrations<br/> 4405 * 2 - Medium vibrations<br/> 4406 * 3 - Strong vibrations 4407 * @hide 4408 */ 4409 @Readable 4410 public static final String NOTIFICATION_VIBRATION_INTENSITY = 4411 "notification_vibration_intensity"; 4412 /** 4413 * The intensity of ringtone vibrations, if configurable. 4414 * 4415 * Not all devices are capable of changing their vibration intensity; on these devices 4416 * there will likely be no difference between the various vibration intensities except for 4417 * intensity 0 (off) and the rest. 4418 * 4419 * <b>Values:</b><br/> 4420 * 0 - Vibration is disabled<br/> 4421 * 1 - Weak vibrations<br/> 4422 * 2 - Medium vibrations<br/> 4423 * 3 - Strong vibrations 4424 * @hide 4425 */ 4426 @Readable 4427 public static final String RING_VIBRATION_INTENSITY = 4428 "ring_vibration_intensity"; 4429 4430 /** 4431 * The intensity of haptic feedback vibrations, if configurable. 4432 * 4433 * Not all devices are capable of changing their feedback intensity; on these devices 4434 * there will likely be no difference between the various vibration intensities except for 4435 * intensity 0 (off) and the rest. 4436 * 4437 * <b>Values:</b><br/> 4438 * 0 - Vibration is disabled<br/> 4439 * 1 - Weak vibrations<br/> 4440 * 2 - Medium vibrations<br/> 4441 * 3 - Strong vibrations 4442 * @hide 4443 */ 4444 @Readable 4445 public static final String HAPTIC_FEEDBACK_INTENSITY = 4446 "haptic_feedback_intensity"; 4447 4448 /** 4449 * Ringer volume. This is used internally, changing this value will not 4450 * change the volume. See AudioManager. 4451 * 4452 * @removed Not used by anything since API 2. 4453 */ 4454 @Readable 4455 public static final String VOLUME_RING = "volume_ring"; 4456 4457 /** 4458 * System/notifications volume. This is used internally, changing this 4459 * value will not change the volume. See AudioManager. 4460 * 4461 * @removed Not used by anything since API 2. 4462 */ 4463 @Readable 4464 public static final String VOLUME_SYSTEM = "volume_system"; 4465 4466 /** 4467 * Voice call volume. This is used internally, changing this value will 4468 * not change the volume. See AudioManager. 4469 * 4470 * @removed Not used by anything since API 2. 4471 */ 4472 @Readable 4473 public static final String VOLUME_VOICE = "volume_voice"; 4474 4475 /** 4476 * Music/media/gaming volume. This is used internally, changing this 4477 * value will not change the volume. See AudioManager. 4478 * 4479 * @removed Not used by anything since API 2. 4480 */ 4481 @Readable 4482 public static final String VOLUME_MUSIC = "volume_music"; 4483 4484 /** 4485 * Alarm volume. This is used internally, changing this 4486 * value will not change the volume. See AudioManager. 4487 * 4488 * @removed Not used by anything since API 2. 4489 */ 4490 @Readable 4491 public static final String VOLUME_ALARM = "volume_alarm"; 4492 4493 /** 4494 * Notification volume. This is used internally, changing this 4495 * value will not change the volume. See AudioManager. 4496 * 4497 * @removed Not used by anything since API 2. 4498 */ 4499 @Readable 4500 public static final String VOLUME_NOTIFICATION = "volume_notification"; 4501 4502 /** 4503 * Bluetooth Headset volume. This is used internally, changing this value will 4504 * not change the volume. See AudioManager. 4505 * 4506 * @removed Not used by anything since API 2. 4507 */ 4508 @Readable 4509 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco"; 4510 4511 /** 4512 * @hide 4513 * Acessibility volume. This is used internally, changing this 4514 * value will not change the volume. 4515 */ 4516 @Readable 4517 public static final String VOLUME_ACCESSIBILITY = "volume_a11y"; 4518 4519 /** 4520 * @hide 4521 * Volume index for virtual assistant. 4522 */ 4523 @Readable 4524 public static final String VOLUME_ASSISTANT = "volume_assistant"; 4525 4526 /** 4527 * Master volume (float in the range 0.0f to 1.0f). 4528 * 4529 * @hide 4530 */ 4531 @Readable 4532 public static final String VOLUME_MASTER = "volume_master"; 4533 4534 /** 4535 * Master mono (int 1 = mono, 0 = normal). 4536 * 4537 * @hide 4538 */ 4539 @UnsupportedAppUsage 4540 @Readable 4541 public static final String MASTER_MONO = "master_mono"; 4542 4543 /** 4544 * Master balance (float -1.f = 100% left, 0.f = dead center, 1.f = 100% right). 4545 * 4546 * @hide 4547 */ 4548 @Readable 4549 public static final String MASTER_BALANCE = "master_balance"; 4550 4551 /** 4552 * Whether the notifications should use the ring volume (value of 1) or 4553 * a separate notification volume (value of 0). In most cases, users 4554 * will have this enabled so the notification and ringer volumes will be 4555 * the same. However, power users can disable this and use the separate 4556 * notification volume control. 4557 * <p> 4558 * Note: This is a one-off setting that will be removed in the future 4559 * when there is profile support. For this reason, it is kept hidden 4560 * from the public APIs. 4561 * 4562 * @hide 4563 * @deprecated 4564 */ 4565 @Deprecated 4566 @Readable 4567 public static final String NOTIFICATIONS_USE_RING_VOLUME = 4568 "notifications_use_ring_volume"; 4569 4570 /** 4571 * Whether silent mode should allow vibration feedback. This is used 4572 * internally in AudioService and the Sound settings activity to 4573 * coordinate decoupling of vibrate and silent modes. This setting 4574 * will likely be removed in a future release with support for 4575 * audio/vibe feedback profiles. 4576 * 4577 * Not used anymore. On devices with vibrator, the user explicitly selects 4578 * silent or vibrate mode. 4579 * Kept for use by legacy database upgrade code in DatabaseHelper. 4580 * @hide 4581 */ 4582 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 4583 @Readable 4584 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent"; 4585 4586 /** 4587 * The mapping of stream type (integer) to its setting. 4588 * 4589 * @removed Not used by anything since API 2. 4590 */ 4591 public static final String[] VOLUME_SETTINGS = { 4592 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, 4593 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO 4594 }; 4595 4596 /** 4597 * @hide 4598 * The mapping of stream type (integer) to its setting. 4599 * Unlike the VOLUME_SETTINGS array, this one contains as many entries as 4600 * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes 4601 * are never persisted. 4602 */ 4603 public static final String[] VOLUME_SETTINGS_INT = { 4604 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, 4605 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO, 4606 "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/, 4607 "" /*STREAM_DTMF, no setting for this stream*/, 4608 "" /*STREAM_TTS, no setting for this stream*/, 4609 VOLUME_ACCESSIBILITY, VOLUME_ASSISTANT 4610 }; 4611 4612 /** 4613 * Appended to various volume related settings to record the previous 4614 * values before they the settings were affected by a silent/vibrate 4615 * ringer mode change. 4616 * 4617 * @removed Not used by anything since API 2. 4618 */ 4619 @Readable 4620 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible"; 4621 4622 /** 4623 * Persistent store for the system-wide default ringtone URI. 4624 * <p> 4625 * If you need to play the default ringtone at any given time, it is recommended 4626 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve 4627 * to the set default ringtone at the time of playing. 4628 * 4629 * @see #DEFAULT_RINGTONE_URI 4630 */ 4631 @Readable 4632 public static final String RINGTONE = "ringtone"; 4633 4634 /** 4635 * A {@link Uri} that will point to the current default ringtone at any 4636 * given time. 4637 * <p> 4638 * If the current default ringtone is in the DRM provider and the caller 4639 * does not have permission, the exception will be a 4640 * FileNotFoundException. 4641 */ 4642 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE); 4643 4644 /** {@hide} */ 4645 @Readable 4646 public static final String RINGTONE_CACHE = "ringtone_cache"; 4647 /** {@hide} */ 4648 public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE); 4649 4650 /** 4651 * Persistent store for the system-wide default notification sound. 4652 * 4653 * @see #RINGTONE 4654 * @see #DEFAULT_NOTIFICATION_URI 4655 */ 4656 @Readable 4657 public static final String NOTIFICATION_SOUND = "notification_sound"; 4658 4659 /** 4660 * A {@link Uri} that will point to the current default notification 4661 * sound at any given time. 4662 * 4663 * @see #DEFAULT_RINGTONE_URI 4664 */ 4665 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND); 4666 4667 /** {@hide} */ 4668 @Readable 4669 public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache"; 4670 /** {@hide} */ 4671 public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE); 4672 4673 /** 4674 * Persistent store for the system-wide default alarm alert. 4675 * 4676 * @see #RINGTONE 4677 * @see #DEFAULT_ALARM_ALERT_URI 4678 */ 4679 @Readable 4680 public static final String ALARM_ALERT = "alarm_alert"; 4681 4682 /** 4683 * A {@link Uri} that will point to the current default alarm alert at 4684 * any given time. 4685 * 4686 * @see #DEFAULT_ALARM_ALERT_URI 4687 */ 4688 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT); 4689 4690 /** {@hide} */ 4691 @Readable 4692 public static final String ALARM_ALERT_CACHE = "alarm_alert_cache"; 4693 /** {@hide} */ 4694 public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE); 4695 4696 /** 4697 * Persistent store for the system default media button event receiver. 4698 * 4699 * @hide 4700 */ 4701 @Readable 4702 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver"; 4703 4704 /** 4705 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off 4706 */ 4707 @Readable 4708 public static final String TEXT_AUTO_REPLACE = "auto_replace"; 4709 4710 /** 4711 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off 4712 */ 4713 @Readable 4714 public static final String TEXT_AUTO_CAPS = "auto_caps"; 4715 4716 /** 4717 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This 4718 * feature converts two spaces to a "." and space. 4719 */ 4720 @Readable 4721 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate"; 4722 4723 /** 4724 * Setting to showing password characters in text editors. 1 = On, 0 = Off 4725 */ 4726 @Readable 4727 public static final String TEXT_SHOW_PASSWORD = "show_password"; 4728 4729 @Readable 4730 public static final String SHOW_GTALK_SERVICE_STATUS = 4731 "SHOW_GTALK_SERVICE_STATUS"; 4732 4733 /** 4734 * Name of activity to use for wallpaper on the home screen. 4735 * 4736 * @deprecated Use {@link WallpaperManager} instead. 4737 */ 4738 @Deprecated 4739 @Readable 4740 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity"; 4741 4742 /** 4743 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME} 4744 * instead 4745 */ 4746 @Deprecated 4747 public static final String AUTO_TIME = Global.AUTO_TIME; 4748 4749 /** 4750 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE} 4751 * instead 4752 */ 4753 @Deprecated 4754 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE; 4755 4756 /** 4757 * Display the user's times, e.g. in the status bar, as 12 or 24 hours. 4758 * <ul> 4759 * <li>24 = 24 hour</li> 4760 * <li>12 = 12 hour</li> 4761 * <li>[unset] = use the device locale's default</li> 4762 * </ul> 4763 */ 4764 @Readable 4765 public static final String TIME_12_24 = "time_12_24"; 4766 4767 /** 4768 * @deprecated No longer used. Use {@link #TIME_12_24} instead. 4769 */ 4770 @Deprecated 4771 @Readable 4772 public static final String DATE_FORMAT = "date_format"; 4773 4774 /** 4775 * Whether the setup wizard has been run before (on first boot), or if 4776 * it still needs to be run. 4777 * 4778 * nonzero = it has been run in the past 4779 * 0 = it has not been run in the past 4780 */ 4781 @Readable 4782 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run"; 4783 4784 /** 4785 * Scaling factor for normal window animations. Setting to 0 will disable window 4786 * animations. 4787 * 4788 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead 4789 */ 4790 @Deprecated 4791 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE; 4792 4793 /** 4794 * Scaling factor for activity transition animations. Setting to 0 will disable window 4795 * animations. 4796 * 4797 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead 4798 */ 4799 @Deprecated 4800 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE; 4801 4802 /** 4803 * Scaling factor for Animator-based animations. This affects both the start delay and 4804 * duration of all such animations. Setting to 0 will cause animations to end immediately. 4805 * The default value is 1. 4806 * 4807 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead 4808 */ 4809 @Deprecated 4810 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE; 4811 4812 /** 4813 * Control whether the accelerometer will be used to change screen 4814 * orientation. If 0, it will not be used unless explicitly requested 4815 * by the application; if 1, it will be used by default unless explicitly 4816 * disabled by the application. 4817 */ 4818 @Readable 4819 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation"; 4820 4821 /** 4822 * Default screen rotation when no other policy applies. 4823 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a 4824 * preference, this rotation value will be used. Must be one of the 4825 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}. 4826 * 4827 * @see Display#getRotation 4828 */ 4829 @Readable 4830 public static final String USER_ROTATION = "user_rotation"; 4831 4832 /** 4833 * Control whether the rotation lock toggle in the System UI should be hidden. 4834 * Typically this is done for accessibility purposes to make it harder for 4835 * the user to accidentally toggle the rotation lock while the display rotation 4836 * has been locked for accessibility. 4837 * 4838 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be 4839 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden. 4840 * 4841 * @hide 4842 */ 4843 @UnsupportedAppUsage 4844 @Readable 4845 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY = 4846 "hide_rotation_lock_toggle_for_accessibility"; 4847 4848 /** 4849 * Whether the phone vibrates when it is ringing due to an incoming call. This will 4850 * be used by Phone and Setting apps; it shouldn't affect other apps. 4851 * The value is boolean (1 or 0). 4852 * 4853 * Note: this is not same as "vibrate on ring", which had been available until ICS. 4854 * It was about AudioManager's setting and thus affected all the applications which 4855 * relied on the setting, while this is purely about the vibration setting for incoming 4856 * calls. 4857 */ 4858 @Readable 4859 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing"; 4860 4861 /** 4862 * When {@code 1}, Telecom enhanced call blocking functionality is enabled. When 4863 * {@code 0}, enhanced call blocking functionality is disabled. 4864 * @hide 4865 */ 4866 @Readable 4867 public static final String DEBUG_ENABLE_ENHANCED_CALL_BLOCKING = 4868 "debug.enable_enhanced_calling"; 4869 4870 /** 4871 * Whether the audible DTMF tones are played by the dialer when dialing. The value is 4872 * boolean (1 or 0). 4873 */ 4874 @Readable 4875 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone"; 4876 4877 /** 4878 * CDMA only settings 4879 * DTMF tone type played by the dialer when dialing. 4880 * 0 = Normal 4881 * 1 = Long 4882 */ 4883 @Readable 4884 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type"; 4885 4886 /** 4887 * Whether the hearing aid is enabled. The value is 4888 * boolean (1 or 0). 4889 * @hide 4890 */ 4891 @UnsupportedAppUsage 4892 @Readable 4893 public static final String HEARING_AID = "hearing_aid"; 4894 4895 /** 4896 * CDMA only settings 4897 * TTY Mode 4898 * 0 = OFF 4899 * 1 = FULL 4900 * 2 = VCO 4901 * 3 = HCO 4902 * @hide 4903 */ 4904 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 4905 @Readable 4906 public static final String TTY_MODE = "tty_mode"; 4907 4908 /** 4909 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is 4910 * boolean (1 or 0). 4911 */ 4912 @Readable 4913 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled"; 4914 4915 /** 4916 * Whether haptic feedback (Vibrate on tap) is enabled. The value is 4917 * boolean (1 or 0). 4918 */ 4919 @Readable 4920 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled"; 4921 4922 /** 4923 * @deprecated Each application that shows web suggestions should have its own 4924 * setting for this. 4925 */ 4926 @Deprecated 4927 @Readable 4928 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions"; 4929 4930 /** 4931 * Whether the notification LED should repeatedly flash when a notification is 4932 * pending. The value is boolean (1 or 0). 4933 * @hide 4934 */ 4935 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 4936 @Readable 4937 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse"; 4938 4939 /** 4940 * Show pointer location on screen? 4941 * 0 = no 4942 * 1 = yes 4943 * @hide 4944 */ 4945 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 4946 @Readable 4947 public static final String POINTER_LOCATION = "pointer_location"; 4948 4949 /** 4950 * Show touch positions on screen? 4951 * 0 = no 4952 * 1 = yes 4953 * @hide 4954 */ 4955 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 4956 @Readable 4957 public static final String SHOW_TOUCHES = "show_touches"; 4958 4959 /** 4960 * Log raw orientation data from 4961 * {@link com.android.server.policy.WindowOrientationListener} for use with the 4962 * orientationplot.py tool. 4963 * 0 = no 4964 * 1 = yes 4965 * @hide 4966 */ 4967 @Readable 4968 public static final String WINDOW_ORIENTATION_LISTENER_LOG = 4969 "window_orientation_listener_log"; 4970 4971 /** 4972 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED} 4973 * instead 4974 * @hide 4975 */ 4976 @Deprecated 4977 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED; 4978 4979 /** 4980 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED} 4981 * instead 4982 * @hide 4983 */ 4984 @Deprecated 4985 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 4986 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED; 4987 4988 /** 4989 * Whether to play sounds when the keyguard is shown and dismissed. 4990 * @hide 4991 */ 4992 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 4993 @Readable 4994 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled"; 4995 4996 /** 4997 * Whether the lockscreen should be completely disabled. 4998 * @hide 4999 */ 5000 @Readable 5001 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled"; 5002 5003 /** 5004 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND} 5005 * instead 5006 * @hide 5007 */ 5008 @Deprecated 5009 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND; 5010 5011 /** 5012 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND} 5013 * instead 5014 * @hide 5015 */ 5016 @Deprecated 5017 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5018 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND; 5019 5020 /** 5021 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND} 5022 * instead 5023 * @hide 5024 */ 5025 @Deprecated 5026 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5027 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND; 5028 5029 /** 5030 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND} 5031 * instead 5032 * @hide 5033 */ 5034 @Deprecated 5035 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5036 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND; 5037 5038 /** 5039 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND} 5040 * instead 5041 * @hide 5042 */ 5043 @Deprecated 5044 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5045 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND; 5046 5047 /** 5048 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND} 5049 * instead 5050 * @hide 5051 */ 5052 @Deprecated 5053 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5054 public static final String LOCK_SOUND = Global.LOCK_SOUND; 5055 5056 /** 5057 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND} 5058 * instead 5059 * @hide 5060 */ 5061 @Deprecated 5062 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5063 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND; 5064 5065 /** 5066 * Receive incoming SIP calls? 5067 * 0 = no 5068 * 1 = yes 5069 * @hide 5070 */ 5071 @Readable 5072 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls"; 5073 5074 /** 5075 * Call Preference String. 5076 * "SIP_ALWAYS" : Always use SIP with network access 5077 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address 5078 * @hide 5079 */ 5080 @Readable 5081 public static final String SIP_CALL_OPTIONS = "sip_call_options"; 5082 5083 /** 5084 * One of the sip call options: Always use SIP with network access. 5085 * @hide 5086 */ 5087 @Readable 5088 public static final String SIP_ALWAYS = "SIP_ALWAYS"; 5089 5090 /** 5091 * One of the sip call options: Only if destination is a SIP address. 5092 * @hide 5093 */ 5094 @Readable 5095 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY"; 5096 5097 /** 5098 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that 5099 * the user should be prompted each time a call is made whether it should be placed using 5100 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with 5101 * SIP_ADDRESS_ONLY. 5102 * @hide 5103 */ 5104 @Deprecated 5105 @Readable 5106 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME"; 5107 5108 /** 5109 * Pointer speed setting. 5110 * This is an integer value in a range between -7 and +7, so there are 15 possible values. 5111 * -7 = slowest 5112 * 0 = default speed 5113 * +7 = fastest 5114 * @hide 5115 */ 5116 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5117 @Readable 5118 public static final String POINTER_SPEED = "pointer_speed"; 5119 5120 /** 5121 * Whether lock-to-app will be triggered by long-press on recents. 5122 * @hide 5123 */ 5124 @Readable 5125 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled"; 5126 5127 /** 5128 * I am the lolrus. 5129 * <p> 5130 * Nonzero values indicate that the user has a bukkit. 5131 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>. 5132 * @hide 5133 */ 5134 @Readable 5135 public static final String EGG_MODE = "egg_mode"; 5136 5137 /** 5138 * Setting to determine whether or not to show the battery percentage in the status bar. 5139 * 0 - Don't show percentage 5140 * 1 - Show percentage 5141 * @hide 5142 */ 5143 @Readable 5144 public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent"; 5145 5146 /** 5147 * Whether or not to enable multiple audio focus. 5148 * When enabled, requires more management by user over application playback activity, 5149 * for instance pausing media apps when another starts. 5150 * @hide 5151 */ 5152 @Readable 5153 public static final String MULTI_AUDIO_FOCUS_ENABLED = "multi_audio_focus_enabled"; 5154 5155 /** 5156 * IMPORTANT: If you add a new public settings you also have to add it to 5157 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add 5158 * it to PRIVATE_SETTINGS below. Also add a validator that can validate 5159 * the setting value. See an example above. 5160 */ 5161 5162 /** 5163 * Keys we no longer back up under the current schema, but want to continue to 5164 * process when restoring historical backup datasets. 5165 * 5166 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, 5167 * otherwise they won't be restored. 5168 * 5169 * @hide 5170 */ 5171 public static final String[] LEGACY_RESTORE_SETTINGS = { 5172 }; 5173 5174 /** 5175 * These are all public system settings 5176 * 5177 * @hide 5178 */ 5179 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5180 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>(); 5181 static { 5182 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR); 5183 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP); 5184 PUBLIC_SETTINGS.add(WIFI_STATIC_IP); 5185 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY); 5186 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK); 5187 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1); 5188 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2); 5189 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY); 5190 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT); 5191 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED); 5192 PUBLIC_SETTINGS.add(FONT_SCALE); 5193 PUBLIC_SETTINGS.add(SYSTEM_LOCALES); 5194 PUBLIC_SETTINGS.add(DIM_SCREEN); 5195 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT); 5196 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS); 5197 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FLOAT); 5198 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR); 5199 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR_FLOAT); 5200 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE); 5201 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED); 5202 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED); 5203 PUBLIC_SETTINGS.add(VIBRATE_ON); 5204 PUBLIC_SETTINGS.add(VOLUME_RING); 5205 PUBLIC_SETTINGS.add(VOLUME_SYSTEM); 5206 PUBLIC_SETTINGS.add(VOLUME_VOICE); 5207 PUBLIC_SETTINGS.add(VOLUME_MUSIC); 5208 PUBLIC_SETTINGS.add(VOLUME_ALARM); 5209 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION); 5210 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO); 5211 PUBLIC_SETTINGS.add(VOLUME_ASSISTANT); 5212 PUBLIC_SETTINGS.add(RINGTONE); 5213 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND); 5214 PUBLIC_SETTINGS.add(ALARM_ALERT); 5215 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE); 5216 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS); 5217 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE); 5218 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD); 5219 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS); 5220 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY); 5221 PUBLIC_SETTINGS.add(TIME_12_24); 5222 PUBLIC_SETTINGS.add(DATE_FORMAT); 5223 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN); 5224 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION); 5225 PUBLIC_SETTINGS.add(USER_ROTATION); 5226 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING); 5227 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED); 5228 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); 5229 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS); 5230 PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING); 5231 } 5232 5233 /** 5234 * These are all hidden system settings. 5235 * 5236 * @hide 5237 */ 5238 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5239 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>(); 5240 static { 5241 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP); 5242 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR); 5243 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS); 5244 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ); 5245 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES); 5246 PRIVATE_SETTINGS.add(VOLUME_MASTER); 5247 PRIVATE_SETTINGS.add(MASTER_MONO); 5248 PRIVATE_SETTINGS.add(MASTER_BALANCE); 5249 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME); 5250 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT); 5251 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER); 5252 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY); 5253 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING); 5254 PRIVATE_SETTINGS.add(HEARING_AID); 5255 PRIVATE_SETTINGS.add(TTY_MODE); 5256 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE); 5257 PRIVATE_SETTINGS.add(POINTER_LOCATION); 5258 PRIVATE_SETTINGS.add(SHOW_TOUCHES); 5259 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG); 5260 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED); 5261 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED); 5262 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED); 5263 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED); 5264 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND); 5265 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND); 5266 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND); 5267 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND); 5268 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND); 5269 PRIVATE_SETTINGS.add(LOCK_SOUND); 5270 PRIVATE_SETTINGS.add(UNLOCK_SOUND); 5271 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS); 5272 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS); 5273 PRIVATE_SETTINGS.add(SIP_ALWAYS); 5274 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY); 5275 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME); 5276 PRIVATE_SETTINGS.add(POINTER_SPEED); 5277 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED); 5278 PRIVATE_SETTINGS.add(EGG_MODE); 5279 PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT); 5280 PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE); 5281 PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE_VENDOR_HINT); 5282 } 5283 5284 /** 5285 * These entries are considered common between the personal and the managed profile, 5286 * since the managed profile doesn't get to change them. 5287 */ 5288 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5289 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); 5290 static { 5291 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT); 5292 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED); 5293 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED); 5294 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD); 5295 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24); 5296 } 5297 5298 /** @hide */ getCloneToManagedProfileSettings(Set<String> outKeySet)5299 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { 5300 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); 5301 } 5302 5303 /** 5304 * These entries should be cloned from this profile's parent only if the dependency's 5305 * value is true ("1") 5306 * 5307 * Note: the dependencies must be Secure settings 5308 * 5309 * @hide 5310 */ 5311 public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>(); 5312 static { CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS)5313 CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS); CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS)5314 CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS); CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS)5315 CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS); 5316 } 5317 5318 /** @hide */ getCloneFromParentOnValueSettings(Map<String, String> outMap)5319 public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) { 5320 outMap.putAll(CLONE_FROM_PARENT_ON_VALUE); 5321 } 5322 5323 /** 5324 * System settings which can be accessed by instant apps. 5325 * @hide 5326 */ 5327 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); 5328 static { 5329 INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE); 5330 INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS); 5331 INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE); 5332 INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD); 5333 INSTANT_APP_SETTINGS.add(DATE_FORMAT); 5334 INSTANT_APP_SETTINGS.add(FONT_SCALE); 5335 INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); 5336 INSTANT_APP_SETTINGS.add(TIME_12_24); 5337 INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED); 5338 INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION); 5339 } 5340 5341 /** 5342 * When to use Wi-Fi calling 5343 * 5344 * @see android.telephony.TelephonyManager.WifiCallingChoices 5345 * @hide 5346 */ 5347 @Readable 5348 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls"; 5349 5350 // Settings moved to Settings.Secure 5351 5352 /** 5353 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} 5354 * instead 5355 */ 5356 @Deprecated 5357 public static final String ADB_ENABLED = Global.ADB_ENABLED; 5358 5359 /** 5360 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead 5361 */ 5362 @Deprecated 5363 public static final String ANDROID_ID = Secure.ANDROID_ID; 5364 5365 /** 5366 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead 5367 */ 5368 @Deprecated 5369 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; 5370 5371 /** 5372 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead 5373 */ 5374 @Deprecated 5375 public static final String DATA_ROAMING = Global.DATA_ROAMING; 5376 5377 /** 5378 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead 5379 */ 5380 @Deprecated 5381 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; 5382 5383 /** 5384 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead 5385 */ 5386 @Deprecated 5387 public static final String HTTP_PROXY = Global.HTTP_PROXY; 5388 5389 /** 5390 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead 5391 */ 5392 @Deprecated 5393 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; 5394 5395 /** 5396 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED} 5397 * instead 5398 */ 5399 @Deprecated 5400 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED; 5401 5402 /** 5403 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead 5404 */ 5405 @Deprecated 5406 public static final String LOGGING_ID = Secure.LOGGING_ID; 5407 5408 /** 5409 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead 5410 */ 5411 @Deprecated 5412 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; 5413 5414 /** 5415 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED} 5416 * instead 5417 */ 5418 @Deprecated 5419 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED; 5420 5421 /** 5422 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE} 5423 * instead 5424 */ 5425 @Deprecated 5426 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE; 5427 5428 /** 5429 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL} 5430 * instead 5431 */ 5432 @Deprecated 5433 public static final String PARENTAL_CONTROL_REDIRECT_URL = 5434 Secure.PARENTAL_CONTROL_REDIRECT_URL; 5435 5436 /** 5437 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead 5438 */ 5439 @Deprecated 5440 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME; 5441 5442 /** 5443 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead 5444 */ 5445 @Deprecated 5446 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED; 5447 5448 /** 5449 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead 5450 */ 5451 @Deprecated 5452 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; 5453 5454 /** 5455 * @deprecated Use 5456 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead 5457 */ 5458 @Deprecated 5459 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT; 5460 5461 /** 5462 * @deprecated Use 5463 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead 5464 */ 5465 @Deprecated 5466 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 5467 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; 5468 5469 /** 5470 * @deprecated Use 5471 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead 5472 */ 5473 @Deprecated 5474 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 5475 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; 5476 5477 /** 5478 * @deprecated Use 5479 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead 5480 */ 5481 @Deprecated 5482 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 5483 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; 5484 5485 /** 5486 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} 5487 * instead 5488 */ 5489 @Deprecated 5490 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT; 5491 5492 /** 5493 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead 5494 */ 5495 @Deprecated 5496 public static final String WIFI_ON = Global.WIFI_ON; 5497 5498 /** 5499 * @deprecated Use 5500 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE} 5501 * instead 5502 */ 5503 @Deprecated 5504 @Readable 5505 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = 5506 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE; 5507 5508 /** 5509 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead 5510 */ 5511 @Deprecated 5512 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT; 5513 5514 /** 5515 * @deprecated Use 5516 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead 5517 */ 5518 @Deprecated 5519 @Readable 5520 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = 5521 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS; 5522 5523 /** 5524 * @deprecated Use 5525 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead 5526 */ 5527 @Deprecated 5528 @Readable 5529 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = 5530 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED; 5531 5532 /** 5533 * @deprecated Use 5534 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS} 5535 * instead 5536 */ 5537 @Deprecated 5538 @Readable 5539 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = 5540 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS; 5541 5542 /** 5543 * @deprecated Use 5544 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead 5545 */ 5546 @Deprecated 5547 @Readable 5548 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = 5549 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT; 5550 5551 /** 5552 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS} 5553 * instead 5554 */ 5555 @Deprecated 5556 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS; 5557 5558 /** 5559 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead 5560 */ 5561 @Deprecated 5562 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON; 5563 5564 /** 5565 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead 5566 */ 5567 @Deprecated 5568 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT; 5569 5570 /** 5571 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS} 5572 * instead 5573 */ 5574 @Deprecated 5575 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS; 5576 5577 /** 5578 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS} 5579 * instead 5580 */ 5581 @Deprecated 5582 @Readable 5583 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = 5584 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS; 5585 5586 /** 5587 * Checks if the specified app can modify system settings. As of API 5588 * level 23, an app cannot modify system settings unless it declares the 5589 * {@link android.Manifest.permission#WRITE_SETTINGS} 5590 * permission in its manifest, <em>and</em> the user specifically grants 5591 * the app this capability. To prompt the user to grant this approval, 5592 * the app must send an intent with the action {@link 5593 * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes 5594 * the system to display a permission management screen. 5595 * 5596 * @param context App context. 5597 * @return true if the calling app can write to system settings, false otherwise 5598 */ canWrite(Context context)5599 public static boolean canWrite(Context context) { 5600 return isCallingPackageAllowedToWriteSettings(context, Process.myUid(), 5601 context.getOpPackageName(), false); 5602 } 5603 } 5604 5605 /** 5606 * Secure system settings, containing system preferences that applications 5607 * can read but are not allowed to write. These are for preferences that 5608 * the user must explicitly modify through the UI of a system app. Normal 5609 * applications cannot modify the secure settings database, either directly 5610 * or by calling the "put" methods that this class contains. 5611 */ 5612 public static final class Secure extends NameValueTable { 5613 // NOTE: If you add new settings here, be sure to add them to 5614 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked. 5615 5616 /** 5617 * The content:// style URL for this table 5618 */ 5619 public static final Uri CONTENT_URI = 5620 Uri.parse("content://" + AUTHORITY + "/secure"); 5621 5622 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5623 private static final ContentProviderHolder sProviderHolder = 5624 new ContentProviderHolder(CONTENT_URI); 5625 5626 // Populated lazily, guarded by class object: 5627 @UnsupportedAppUsage 5628 private static final NameValueCache sNameValueCache = new NameValueCache( 5629 CONTENT_URI, 5630 CALL_METHOD_GET_SECURE, 5631 CALL_METHOD_PUT_SECURE, 5632 sProviderHolder, 5633 Secure.class); 5634 5635 private static ILockSettings sLockSettings = null; 5636 5637 private static boolean sIsSystemProcess; 5638 @UnsupportedAppUsage 5639 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS; 5640 @UnsupportedAppUsage 5641 private static final HashSet<String> MOVED_TO_GLOBAL; 5642 static { 5643 MOVED_TO_LOCK_SETTINGS = new HashSet<>(3); 5644 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED); 5645 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE); 5646 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); 5647 5648 MOVED_TO_GLOBAL = new HashSet<>(); 5649 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED); 5650 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED); 5651 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON); 5652 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU); 5653 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS); 5654 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE); 5655 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE); 5656 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE); 5657 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI); 5658 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING); 5659 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED); 5660 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED); 5661 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED); 5662 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE); 5663 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE); 5664 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA); 5665 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION); 5666 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE); 5667 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES); 5668 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE); 5669 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED); 5670 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES); 5671 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL); 5672 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED); 5673 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE); 5674 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION); 5675 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE); 5676 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES); 5677 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE); 5678 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION); 5679 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE); 5680 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES); 5681 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE); 5682 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE); 5683 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF); 5684 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING); 5685 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER); 5686 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT); 5687 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT); 5688 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS); 5689 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT); 5690 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS); 5691 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT); 5692 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL); 5693 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST); 5694 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL); 5695 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN); 5696 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED); 5697 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED); 5698 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED); 5699 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL); 5700 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE); 5701 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS); 5702 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND); 5703 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS); 5704 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT); 5705 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS); 5706 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); 5707 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); 5708 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT); 5709 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON); 5710 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME); 5711 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS); 5712 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED); 5713 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN); 5714 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI); 5715 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON); 5716 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED); 5717 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_PENDING_FACTORY_RESET); 5718 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON); 5719 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT); 5720 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE); 5721 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS); 5722 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS); 5723 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS); 5724 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL); 5725 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD); 5726 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD); 5727 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR); 5728 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS); 5729 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES); 5730 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB); 5731 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT); 5732 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT); 5733 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX); 5734 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX); 5735 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL); 5736 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD); 5737 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE); 5738 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES); 5739 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES); 5740 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS); 5741 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY); 5742 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED); 5743 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER); 5744 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON); 5745 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION); 5746 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION); 5747 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY); 5748 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY); 5749 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT); 5750 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY); 5751 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST); 5752 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT); 5753 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST); 5754 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY); 5755 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER); 5756 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE); 5757 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY); 5758 } 5759 5760 /** @hide */ getMovedToGlobalSettings(Set<String> outKeySet)5761 public static void getMovedToGlobalSettings(Set<String> outKeySet) { 5762 outKeySet.addAll(MOVED_TO_GLOBAL); 5763 } 5764 5765 /** @hide */ clearProviderForTest()5766 public static void clearProviderForTest() { 5767 sProviderHolder.clearProviderForTest(); 5768 sNameValueCache.clearGenerationTrackerForTest(); 5769 } 5770 5771 /** @hide */ getPublicSettings(Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> readableKeysWithMaxTargetSdk)5772 public static void getPublicSettings(Set<String> allKeys, Set<String> readableKeys, 5773 ArrayMap<String, Integer> readableKeysWithMaxTargetSdk) { 5774 getPublicSettingsForClass(Secure.class, allKeys, readableKeys, 5775 readableKeysWithMaxTargetSdk); 5776 } 5777 5778 /** 5779 * Look up a name in the database. 5780 * @param resolver to access the database with 5781 * @param name to look up in the table 5782 * @return the corresponding value, or null if not present 5783 */ getString(ContentResolver resolver, String name)5784 public static String getString(ContentResolver resolver, String name) { 5785 return getStringForUser(resolver, name, resolver.getUserId()); 5786 } 5787 5788 /** @hide */ 5789 @UnsupportedAppUsage getStringForUser(ContentResolver resolver, String name, int userHandle)5790 public static String getStringForUser(ContentResolver resolver, String name, 5791 int userHandle) { 5792 if (MOVED_TO_GLOBAL.contains(name)) { 5793 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 5794 + " to android.provider.Settings.Global."); 5795 return Global.getStringForUser(resolver, name, userHandle); 5796 } 5797 5798 if (MOVED_TO_LOCK_SETTINGS.contains(name)) { 5799 synchronized (Secure.class) { 5800 if (sLockSettings == null) { 5801 sLockSettings = ILockSettings.Stub.asInterface( 5802 (IBinder) ServiceManager.getService("lock_settings")); 5803 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID; 5804 } 5805 } 5806 if (sLockSettings != null && !sIsSystemProcess) { 5807 // No context; use the ActivityThread's context as an approximation for 5808 // determining the target API level. 5809 Application application = ActivityThread.currentApplication(); 5810 5811 boolean isPreMnc = application != null 5812 && application.getApplicationInfo() != null 5813 && application.getApplicationInfo().targetSdkVersion 5814 <= VERSION_CODES.LOLLIPOP_MR1; 5815 if (isPreMnc) { 5816 try { 5817 return sLockSettings.getString(name, "0", userHandle); 5818 } catch (RemoteException re) { 5819 // Fall through 5820 } 5821 } else { 5822 throw new SecurityException("Settings.Secure." + name 5823 + " is deprecated and no longer accessible." 5824 + " See API documentation for potential replacements."); 5825 } 5826 } 5827 } 5828 5829 return sNameValueCache.getStringForUser(resolver, name, userHandle); 5830 } 5831 5832 /** 5833 * Store a name/value pair into the database. Values written by this method will be 5834 * overridden if a restore happens in the future. 5835 * 5836 * @param resolver to access the database with 5837 * @param name to store 5838 * @param value to associate with the name 5839 * @return true if the value was set, false on database errors 5840 * 5841 * @hide 5842 */ 5843 @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE) putString(ContentResolver resolver, String name, String value, boolean overrideableByRestore)5844 public static boolean putString(ContentResolver resolver, String name, 5845 String value, boolean overrideableByRestore) { 5846 return putStringForUser(resolver, name, value, /* tag */ null, /* makeDefault */ false, 5847 resolver.getUserId(), overrideableByRestore); 5848 } 5849 5850 /** 5851 * Store a name/value pair into the database. 5852 * @param resolver to access the database with 5853 * @param name to store 5854 * @param value to associate with the name 5855 * @return true if the value was set, false on database errors 5856 */ putString(ContentResolver resolver, String name, String value)5857 public static boolean putString(ContentResolver resolver, String name, String value) { 5858 return putStringForUser(resolver, name, value, resolver.getUserId()); 5859 } 5860 5861 /** @hide */ 5862 @UnsupportedAppUsage putStringForUser(ContentResolver resolver, String name, String value, int userHandle)5863 public static boolean putStringForUser(ContentResolver resolver, String name, String value, 5864 int userHandle) { 5865 return putStringForUser(resolver, name, value, null, false, userHandle, 5866 DEFAULT_OVERRIDEABLE_BY_RESTORE); 5867 } 5868 5869 /** @hide */ 5870 @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)5871 public static boolean putStringForUser(@NonNull ContentResolver resolver, 5872 @NonNull String name, @Nullable String value, @Nullable String tag, 5873 boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore) { 5874 if (MOVED_TO_GLOBAL.contains(name)) { 5875 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 5876 + " to android.provider.Settings.Global"); 5877 return Global.putStringForUser(resolver, name, value, 5878 tag, makeDefault, userHandle, DEFAULT_OVERRIDEABLE_BY_RESTORE); 5879 } 5880 return sNameValueCache.putStringForUser(resolver, name, value, tag, 5881 makeDefault, userHandle, overrideableByRestore); 5882 } 5883 5884 /** 5885 * Store a name/value pair into the database. 5886 * <p> 5887 * The method takes an optional tag to associate with the setting 5888 * which can be used to clear only settings made by your package and 5889 * associated with this tag by passing the tag to {@link 5890 * #resetToDefaults(ContentResolver, String)}. Anyone can override 5891 * the current tag. Also if another package changes the setting 5892 * then the tag will be set to the one specified in the set call 5893 * which can be null. Also any of the settings setters that do not 5894 * take a tag as an argument effectively clears the tag. 5895 * </p><p> 5896 * For example, if you set settings A and B with tags T1 and T2 and 5897 * another app changes setting A (potentially to the same value), it 5898 * can assign to it a tag T3 (note that now the package that changed 5899 * the setting is not yours). Now if you reset your changes for T1 and 5900 * T2 only setting B will be reset and A not (as it was changed by 5901 * another package) but since A did not change you are in the desired 5902 * initial state. Now if the other app changes the value of A (assuming 5903 * you registered an observer in the beginning) you would detect that 5904 * the setting was changed by another app and handle this appropriately 5905 * (ignore, set back to some value, etc). 5906 * </p><p> 5907 * Also the method takes an argument whether to make the value the 5908 * default for this setting. If the system already specified a default 5909 * value, then the one passed in here will <strong>not</strong> 5910 * be set as the default. 5911 * </p> 5912 * 5913 * @param resolver to access the database with. 5914 * @param name to store. 5915 * @param value to associate with the name. 5916 * @param tag to associate with the setting. 5917 * @param makeDefault whether to make the value the default one. 5918 * @return true if the value was set, false on database errors. 5919 * 5920 * @see #resetToDefaults(ContentResolver, String) 5921 * 5922 * @hide 5923 */ 5924 @SystemApi 5925 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)5926 public static boolean putString(@NonNull ContentResolver resolver, 5927 @NonNull String name, @Nullable String value, @Nullable String tag, 5928 boolean makeDefault) { 5929 return putStringForUser(resolver, name, value, tag, makeDefault, 5930 resolver.getUserId(), DEFAULT_OVERRIDEABLE_BY_RESTORE); 5931 } 5932 5933 /** 5934 * Reset the settings to their defaults. This would reset <strong>only</strong> 5935 * settings set by the caller's package. Think of it of a way to undo your own 5936 * changes to the global settings. Passing in the optional tag will reset only 5937 * settings changed by your package and associated with this tag. 5938 * 5939 * @param resolver Handle to the content resolver. 5940 * @param tag Optional tag which should be associated with the settings to reset. 5941 * 5942 * @see #putString(ContentResolver, String, String, String, boolean) 5943 * 5944 * @hide 5945 */ 5946 @SystemApi 5947 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)5948 public static void resetToDefaults(@NonNull ContentResolver resolver, 5949 @Nullable String tag) { 5950 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, 5951 resolver.getUserId()); 5952 } 5953 5954 /** 5955 * 5956 * Reset the settings to their defaults for a given user with a specific mode. The 5957 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} 5958 * allowing resetting the settings made by a package and associated with the tag. 5959 * 5960 * @param resolver Handle to the content resolver. 5961 * @param tag Optional tag which should be associated with the settings to reset. 5962 * @param mode The reset mode. 5963 * @param userHandle The user for which to reset to defaults. 5964 * 5965 * @see #RESET_MODE_PACKAGE_DEFAULTS 5966 * @see #RESET_MODE_UNTRUSTED_DEFAULTS 5967 * @see #RESET_MODE_UNTRUSTED_CHANGES 5968 * @see #RESET_MODE_TRUSTED_DEFAULTS 5969 * 5970 * @hide 5971 */ resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)5972 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, 5973 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { 5974 try { 5975 Bundle arg = new Bundle(); 5976 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 5977 if (tag != null) { 5978 arg.putString(CALL_METHOD_TAG_KEY, tag); 5979 } 5980 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); 5981 IContentProvider cp = sProviderHolder.getProvider(resolver); 5982 cp.call(resolver.getAttributionSource(), 5983 sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_SECURE, null, arg); 5984 } catch (RemoteException e) { 5985 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); 5986 } 5987 } 5988 5989 /** 5990 * Construct the content URI for a particular name/value pair, 5991 * useful for monitoring changes with a ContentObserver. 5992 * @param name to look up in the table 5993 * @return the corresponding content URI, or null if not present 5994 */ getUriFor(String name)5995 public static Uri getUriFor(String name) { 5996 if (MOVED_TO_GLOBAL.contains(name)) { 5997 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 5998 + " to android.provider.Settings.Global, returning global URI."); 5999 return Global.getUriFor(Global.CONTENT_URI, name); 6000 } 6001 return getUriFor(CONTENT_URI, name); 6002 } 6003 6004 /** 6005 * Convenience function for retrieving a single secure settings value 6006 * as an integer. Note that internally setting values are always 6007 * stored as strings; this function converts the string to an integer 6008 * for you. The default value will be returned if the setting is 6009 * not defined or not an integer. 6010 * 6011 * @param cr The ContentResolver to access. 6012 * @param name The name of the setting to retrieve. 6013 * @param def Value to return if the setting is not defined. 6014 * 6015 * @return The setting's current value, or 'def' if it is not defined 6016 * or not a valid integer. 6017 */ getInt(ContentResolver cr, String name, int def)6018 public static int getInt(ContentResolver cr, String name, int def) { 6019 return getIntForUser(cr, name, def, cr.getUserId()); 6020 } 6021 6022 /** @hide */ 6023 @UnsupportedAppUsage getIntForUser(ContentResolver cr, String name, int def, int userHandle)6024 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { 6025 String v = getStringForUser(cr, name, userHandle); 6026 try { 6027 return v != null ? Integer.parseInt(v) : def; 6028 } catch (NumberFormatException e) { 6029 return def; 6030 } 6031 } 6032 6033 /** 6034 * Convenience function for retrieving a single secure settings value 6035 * as an integer. Note that internally setting values are always 6036 * stored as strings; this function converts the string to an integer 6037 * for you. 6038 * <p> 6039 * This version does not take a default value. If the setting has not 6040 * been set, or the string value is not a number, 6041 * it throws {@link SettingNotFoundException}. 6042 * 6043 * @param cr The ContentResolver to access. 6044 * @param name The name of the setting to retrieve. 6045 * 6046 * @throws SettingNotFoundException Thrown if a setting by the given 6047 * name can't be found or the setting value is not an integer. 6048 * 6049 * @return The setting's current value. 6050 */ getInt(ContentResolver cr, String name)6051 public static int getInt(ContentResolver cr, String name) 6052 throws SettingNotFoundException { 6053 return getIntForUser(cr, name, cr.getUserId()); 6054 } 6055 6056 /** @hide */ getIntForUser(ContentResolver cr, String name, int userHandle)6057 public static int getIntForUser(ContentResolver cr, String name, int userHandle) 6058 throws SettingNotFoundException { 6059 String v = getStringForUser(cr, name, userHandle); 6060 try { 6061 return Integer.parseInt(v); 6062 } catch (NumberFormatException e) { 6063 throw new SettingNotFoundException(name); 6064 } 6065 } 6066 6067 /** 6068 * Convenience function for updating a single settings value as an 6069 * integer. This will either create a new entry in the table if the 6070 * given name does not exist, or modify the value of the existing row 6071 * with that name. Note that internally setting values are always 6072 * stored as strings, so this function converts the given value to a 6073 * string before storing it. 6074 * 6075 * @param cr The ContentResolver to access. 6076 * @param name The name of the setting to modify. 6077 * @param value The new value for the setting. 6078 * @return true if the value was set, false on database errors 6079 */ putInt(ContentResolver cr, String name, int value)6080 public static boolean putInt(ContentResolver cr, String name, int value) { 6081 return putIntForUser(cr, name, value, cr.getUserId()); 6082 } 6083 6084 /** @hide */ 6085 @UnsupportedAppUsage putIntForUser(ContentResolver cr, String name, int value, int userHandle)6086 public static boolean putIntForUser(ContentResolver cr, String name, int value, 6087 int userHandle) { 6088 return putStringForUser(cr, name, Integer.toString(value), userHandle); 6089 } 6090 6091 /** 6092 * Convenience function for retrieving a single secure settings value 6093 * as a {@code long}. Note that internally setting values are always 6094 * stored as strings; this function converts the string to a {@code long} 6095 * for you. The default value will be returned if the setting is 6096 * not defined or not a {@code long}. 6097 * 6098 * @param cr The ContentResolver to access. 6099 * @param name The name of the setting to retrieve. 6100 * @param def Value to return if the setting is not defined. 6101 * 6102 * @return The setting's current value, or 'def' if it is not defined 6103 * or not a valid {@code long}. 6104 */ getLong(ContentResolver cr, String name, long def)6105 public static long getLong(ContentResolver cr, String name, long def) { 6106 return getLongForUser(cr, name, def, cr.getUserId()); 6107 } 6108 6109 /** @hide */ 6110 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) getLongForUser(ContentResolver cr, String name, long def, int userHandle)6111 public static long getLongForUser(ContentResolver cr, String name, long def, 6112 int userHandle) { 6113 String valString = getStringForUser(cr, name, userHandle); 6114 long value; 6115 try { 6116 value = valString != null ? Long.parseLong(valString) : def; 6117 } catch (NumberFormatException e) { 6118 value = def; 6119 } 6120 return value; 6121 } 6122 6123 /** 6124 * Convenience function for retrieving a single secure settings value 6125 * as a {@code long}. Note that internally setting values are always 6126 * stored as strings; this function converts the string to a {@code long} 6127 * for you. 6128 * <p> 6129 * This version does not take a default value. If the setting has not 6130 * been set, or the string value is not a number, 6131 * it throws {@link SettingNotFoundException}. 6132 * 6133 * @param cr The ContentResolver to access. 6134 * @param name The name of the setting to retrieve. 6135 * 6136 * @return The setting's current value. 6137 * @throws SettingNotFoundException Thrown if a setting by the given 6138 * name can't be found or the setting value is not an integer. 6139 */ getLong(ContentResolver cr, String name)6140 public static long getLong(ContentResolver cr, String name) 6141 throws SettingNotFoundException { 6142 return getLongForUser(cr, name, cr.getUserId()); 6143 } 6144 6145 /** @hide */ getLongForUser(ContentResolver cr, String name, int userHandle)6146 public static long getLongForUser(ContentResolver cr, String name, int userHandle) 6147 throws SettingNotFoundException { 6148 String valString = getStringForUser(cr, name, userHandle); 6149 try { 6150 return Long.parseLong(valString); 6151 } catch (NumberFormatException e) { 6152 throw new SettingNotFoundException(name); 6153 } 6154 } 6155 6156 /** 6157 * Convenience function for updating a secure settings value as a long 6158 * integer. This will either create a new entry in the table if the 6159 * given name does not exist, or modify the value of the existing row 6160 * with that name. Note that internally setting values are always 6161 * stored as strings, so this function converts the given value to a 6162 * string before storing it. 6163 * 6164 * @param cr The ContentResolver to access. 6165 * @param name The name of the setting to modify. 6166 * @param value The new value for the setting. 6167 * @return true if the value was set, false on database errors 6168 */ putLong(ContentResolver cr, String name, long value)6169 public static boolean putLong(ContentResolver cr, String name, long value) { 6170 return putLongForUser(cr, name, value, cr.getUserId()); 6171 } 6172 6173 /** @hide */ 6174 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) putLongForUser(ContentResolver cr, String name, long value, int userHandle)6175 public static boolean putLongForUser(ContentResolver cr, String name, long value, 6176 int userHandle) { 6177 return putStringForUser(cr, name, Long.toString(value), userHandle); 6178 } 6179 6180 /** 6181 * Convenience function for retrieving a single secure settings value 6182 * as a floating point number. Note that internally setting values are 6183 * always stored as strings; this function converts the string to an 6184 * float for you. The default value will be returned if the setting 6185 * is not defined or not a valid float. 6186 * 6187 * @param cr The ContentResolver to access. 6188 * @param name The name of the setting to retrieve. 6189 * @param def Value to return if the setting is not defined. 6190 * 6191 * @return The setting's current value, or 'def' if it is not defined 6192 * or not a valid float. 6193 */ getFloat(ContentResolver cr, String name, float def)6194 public static float getFloat(ContentResolver cr, String name, float def) { 6195 return getFloatForUser(cr, name, def, cr.getUserId()); 6196 } 6197 6198 /** @hide */ getFloatForUser(ContentResolver cr, String name, float def, int userHandle)6199 public static float getFloatForUser(ContentResolver cr, String name, float def, 6200 int userHandle) { 6201 String v = getStringForUser(cr, name, userHandle); 6202 try { 6203 return v != null ? Float.parseFloat(v) : def; 6204 } catch (NumberFormatException e) { 6205 return def; 6206 } 6207 } 6208 6209 /** 6210 * Convenience function for retrieving a single secure settings value 6211 * as a float. Note that internally setting values are always 6212 * stored as strings; this function converts the string to a float 6213 * for you. 6214 * <p> 6215 * This version does not take a default value. If the setting has not 6216 * been set, or the string value is not a number, 6217 * it throws {@link SettingNotFoundException}. 6218 * 6219 * @param cr The ContentResolver to access. 6220 * @param name The name of the setting to retrieve. 6221 * 6222 * @throws SettingNotFoundException Thrown if a setting by the given 6223 * name can't be found or the setting value is not a float. 6224 * 6225 * @return The setting's current value. 6226 */ getFloat(ContentResolver cr, String name)6227 public static float getFloat(ContentResolver cr, String name) 6228 throws SettingNotFoundException { 6229 return getFloatForUser(cr, name, cr.getUserId()); 6230 } 6231 6232 /** @hide */ getFloatForUser(ContentResolver cr, String name, int userHandle)6233 public static float getFloatForUser(ContentResolver cr, String name, int userHandle) 6234 throws SettingNotFoundException { 6235 String v = getStringForUser(cr, name, userHandle); 6236 if (v == null) { 6237 throw new SettingNotFoundException(name); 6238 } 6239 try { 6240 return Float.parseFloat(v); 6241 } catch (NumberFormatException e) { 6242 throw new SettingNotFoundException(name); 6243 } 6244 } 6245 6246 /** 6247 * Convenience function for updating a single settings value as a 6248 * floating point number. This will either create a new entry in the 6249 * table if the given name does not exist, or modify the value of the 6250 * existing row with that name. Note that internally setting values 6251 * are always stored as strings, so this function converts the given 6252 * value to a string before storing it. 6253 * 6254 * @param cr The ContentResolver to access. 6255 * @param name The name of the setting to modify. 6256 * @param value The new value for the setting. 6257 * @return true if the value was set, false on database errors 6258 */ putFloat(ContentResolver cr, String name, float value)6259 public static boolean putFloat(ContentResolver cr, String name, float value) { 6260 return putFloatForUser(cr, name, value, cr.getUserId()); 6261 } 6262 6263 /** @hide */ putFloatForUser(ContentResolver cr, String name, float value, int userHandle)6264 public static boolean putFloatForUser(ContentResolver cr, String name, float value, 6265 int userHandle) { 6266 return putStringForUser(cr, name, Float.toString(value), userHandle); 6267 } 6268 6269 /** 6270 * Control whether to enable adaptive sleep mode. 6271 * @hide 6272 */ 6273 @Readable 6274 public static final String ADAPTIVE_SLEEP = "adaptive_sleep"; 6275 6276 /** 6277 * Setting key to indicate whether camera-based autorotate is enabled. 6278 * 6279 * @hide 6280 */ 6281 public static final String CAMERA_AUTOROTATE = "camera_autorotate"; 6282 6283 /** 6284 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED} 6285 * instead 6286 */ 6287 @Deprecated 6288 public static final String DEVELOPMENT_SETTINGS_ENABLED = 6289 Global.DEVELOPMENT_SETTINGS_ENABLED; 6290 6291 /** 6292 * When the user has enable the option to have a "bug report" command 6293 * in the power menu. 6294 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead 6295 * @hide 6296 */ 6297 @Deprecated 6298 @Readable 6299 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; 6300 6301 /** 6302 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead 6303 */ 6304 @Deprecated 6305 public static final String ADB_ENABLED = Global.ADB_ENABLED; 6306 6307 /** 6308 * Setting to allow mock locations and location provider status to be injected into the 6309 * LocationManager service for testing purposes during application development. These 6310 * locations and status values override actual location and status information generated 6311 * by network, gps, or other location providers. 6312 * 6313 * @deprecated This settings is not used anymore. 6314 */ 6315 @Deprecated 6316 @Readable 6317 public static final String ALLOW_MOCK_LOCATION = "mock_location"; 6318 6319 /** 6320 * Setting to indicate that on device captions are enabled. 6321 * 6322 * @hide 6323 */ 6324 @SystemApi 6325 @Readable 6326 public static final String ODI_CAPTIONS_ENABLED = "odi_captions_enabled"; 6327 6328 /** 6329 * On Android 8.0 (API level 26) and higher versions of the platform, 6330 * a 64-bit number (expressed as a hexadecimal string), unique to 6331 * each combination of app-signing key, user, and device. 6332 * Values of {@code ANDROID_ID} are scoped by signing key and user. 6333 * The value may change if a factory reset is performed on the 6334 * device or if an APK signing key changes. 6335 * 6336 * For more information about how the platform handles {@code ANDROID_ID} 6337 * in Android 8.0 (API level 26) and higher, see <a 6338 * href="{@docRoot}about/versions/oreo/android-8.0-changes.html#privacy-all"> 6339 * Android 8.0 Behavior Changes</a>. 6340 * 6341 * <p class="note"><strong>Note:</strong> For apps that were installed 6342 * prior to updating the device to a version of Android 8.0 6343 * (API level 26) or higher, the value of {@code ANDROID_ID} changes 6344 * if the app is uninstalled and then reinstalled after the OTA. 6345 * To preserve values across uninstalls after an OTA to Android 8.0 6346 * or higher, developers can use 6347 * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html"> 6348 * Key/Value Backup</a>.</p> 6349 * 6350 * <p>In versions of the platform lower than Android 8.0 (API level 26), 6351 * a 64-bit number (expressed as a hexadecimal string) that is randomly 6352 * generated when the user first sets up the device and should remain 6353 * constant for the lifetime of the user's device. 6354 * 6355 * On devices that have 6356 * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers"> 6357 * multiple users</a>, each user appears as a 6358 * completely separate device, so the {@code ANDROID_ID} value is 6359 * unique to each user.</p> 6360 * 6361 * <p class="note"><strong>Note:</strong> If the caller is an Instant App the ID is scoped 6362 * to the Instant App, it is generated when the Instant App is first installed and reset if 6363 * the user clears the Instant App. 6364 */ 6365 @Readable 6366 public static final String ANDROID_ID = "android_id"; 6367 6368 /** 6369 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead 6370 */ 6371 @Deprecated 6372 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; 6373 6374 /** 6375 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead 6376 */ 6377 @Deprecated 6378 public static final String DATA_ROAMING = Global.DATA_ROAMING; 6379 6380 /** 6381 * Setting to record the input method used by default, holding the ID 6382 * of the desired method. 6383 */ 6384 @Readable 6385 public static final String DEFAULT_INPUT_METHOD = "default_input_method"; 6386 6387 /** 6388 * Setting to record the input method subtype used by default, holding the ID 6389 * of the desired method. 6390 */ 6391 @Readable 6392 public static final String SELECTED_INPUT_METHOD_SUBTYPE = 6393 "selected_input_method_subtype"; 6394 6395 /** 6396 * The {@link android.view.inputmethod.InputMethodInfo.InputMethodInfo#getId() ID} of the 6397 * default voice input method. 6398 * <p> 6399 * This stores the last known default voice IME. If the related system config value changes, 6400 * this is reset by InputMethodManagerService. 6401 * <p> 6402 * This IME is not necessarily in the enabled IME list. That state is still stored in 6403 * {@link #ENABLED_INPUT_METHODS}. 6404 * 6405 * @hide 6406 */ 6407 public static final String DEFAULT_VOICE_INPUT_METHOD = "default_voice_input_method"; 6408 6409 /** 6410 * Setting to record the history of input method subtype, holding the pair of ID of IME 6411 * and its last used subtype. 6412 * @hide 6413 */ 6414 @Readable 6415 public static final String INPUT_METHODS_SUBTYPE_HISTORY = 6416 "input_methods_subtype_history"; 6417 6418 /** 6419 * Setting to record the visibility of input method selector 6420 */ 6421 @Readable 6422 public static final String INPUT_METHOD_SELECTOR_VISIBILITY = 6423 "input_method_selector_visibility"; 6424 6425 /** 6426 * The currently selected voice interaction service flattened ComponentName. 6427 * @hide 6428 */ 6429 @TestApi 6430 @Readable 6431 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service"; 6432 6433 /** 6434 * The currently selected autofill service flattened ComponentName. 6435 * @hide 6436 */ 6437 @TestApi 6438 @Readable 6439 public static final String AUTOFILL_SERVICE = "autofill_service"; 6440 6441 /** 6442 * Boolean indicating if Autofill supports field classification. 6443 * 6444 * @see android.service.autofill.AutofillService 6445 * 6446 * @hide 6447 */ 6448 @SystemApi 6449 @Readable 6450 public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION = 6451 "autofill_field_classification"; 6452 6453 /** 6454 * Boolean indicating if the dark mode dialog shown on first toggle has been seen. 6455 * 6456 * @hide 6457 */ 6458 @Readable 6459 public static final String DARK_MODE_DIALOG_SEEN = 6460 "dark_mode_dialog_seen"; 6461 6462 /** 6463 * Custom time when Dark theme is scheduled to activate. 6464 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm). 6465 * @hide 6466 */ 6467 @Readable 6468 public static final String DARK_THEME_CUSTOM_START_TIME = 6469 "dark_theme_custom_start_time"; 6470 6471 /** 6472 * Custom time when Dark theme is scheduled to deactivate. 6473 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm). 6474 * @hide 6475 */ 6476 @Readable 6477 public static final String DARK_THEME_CUSTOM_END_TIME = 6478 "dark_theme_custom_end_time"; 6479 6480 /** 6481 * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}. 6482 * 6483 * @hide 6484 */ 6485 @SystemApi 6486 @Readable 6487 public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE = 6488 "autofill_user_data_max_user_data_size"; 6489 6490 /** 6491 * Defines value returned by 6492 * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}. 6493 * 6494 * @hide 6495 */ 6496 @SystemApi 6497 @Readable 6498 public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE = 6499 "autofill_user_data_max_field_classification_size"; 6500 6501 /** 6502 * Defines value returned by 6503 * {@link android.service.autofill.UserData#getMaxCategoryCount()}. 6504 * 6505 * @hide 6506 */ 6507 @SystemApi 6508 @Readable 6509 public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT = 6510 "autofill_user_data_max_category_count"; 6511 6512 /** 6513 * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}. 6514 * 6515 * @hide 6516 */ 6517 @SystemApi 6518 @Readable 6519 public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH = 6520 "autofill_user_data_max_value_length"; 6521 6522 /** 6523 * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}. 6524 * 6525 * @hide 6526 */ 6527 @SystemApi 6528 @Readable 6529 public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH = 6530 "autofill_user_data_min_value_length"; 6531 6532 /** 6533 * Defines whether Content Capture is enabled for the user. 6534 * 6535 * <p>Type: {@code int} ({@code 0} for disabled, {@code 1} for enabled). 6536 * <p>Default: enabled 6537 * 6538 * @hide 6539 */ 6540 @TestApi 6541 @Readable 6542 public static final String CONTENT_CAPTURE_ENABLED = "content_capture_enabled"; 6543 6544 /** 6545 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead 6546 */ 6547 @Deprecated 6548 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; 6549 6550 /** 6551 * Indicates whether a DPC has been downloaded during provisioning. 6552 * 6553 * <p>Type: int (0 for false, 1 for true) 6554 * 6555 * <p>If this is true, then any attempts to begin setup again should result in factory reset 6556 * 6557 * @hide 6558 */ 6559 @Readable 6560 public static final String MANAGED_PROVISIONING_DPC_DOWNLOADED = 6561 "managed_provisioning_dpc_downloaded"; 6562 6563 /** 6564 * Indicates whether the device is under restricted secure FRP mode. 6565 * Secure FRP mode is enabled when the device is under FRP. On solving of FRP challenge, 6566 * device is removed from this mode. 6567 * <p> 6568 * Type: int (0 for false, 1 for true) 6569 */ 6570 @Readable 6571 public static final String SECURE_FRP_MODE = "secure_frp_mode"; 6572 6573 /** 6574 * Indicates whether the current user has completed setup via the setup wizard. 6575 * <p> 6576 * Type: int (0 for false, 1 for true) 6577 * 6578 * @hide 6579 */ 6580 @SystemApi 6581 @Readable 6582 public static final String USER_SETUP_COMPLETE = "user_setup_complete"; 6583 6584 /** 6585 * Indicates that the user has not started setup personalization. 6586 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}. 6587 * 6588 * @hide 6589 */ 6590 @SystemApi 6591 public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0; 6592 6593 /** 6594 * Indicates that the user has not yet completed setup personalization. 6595 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}. 6596 * 6597 * @hide 6598 */ 6599 @SystemApi 6600 public static final int USER_SETUP_PERSONALIZATION_STARTED = 1; 6601 6602 /** 6603 * Indicates that the user has snoozed personalization and will complete it later. 6604 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}. 6605 * 6606 * @hide 6607 */ 6608 @SystemApi 6609 public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2; 6610 6611 /** 6612 * Indicates that the user has completed setup personalization. 6613 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}. 6614 * 6615 * @hide 6616 */ 6617 @SystemApi 6618 public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10; 6619 6620 /** @hide */ 6621 @Retention(RetentionPolicy.SOURCE) 6622 @IntDef({ 6623 USER_SETUP_PERSONALIZATION_NOT_STARTED, 6624 USER_SETUP_PERSONALIZATION_STARTED, 6625 USER_SETUP_PERSONALIZATION_PAUSED, 6626 USER_SETUP_PERSONALIZATION_COMPLETE 6627 }) 6628 public @interface UserSetupPersonalization {} 6629 6630 /** 6631 * Defines the user's current state of device personalization. 6632 * The possible states are defined in {@link UserSetupPersonalization}. 6633 * 6634 * @hide 6635 */ 6636 @SystemApi 6637 @Readable 6638 public static final String USER_SETUP_PERSONALIZATION_STATE = 6639 "user_setup_personalization_state"; 6640 6641 /** 6642 * Whether the current user has been set up via setup wizard (0 = false, 1 = true) 6643 * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0 6644 * in case SetupWizard has been re-enabled on TV devices. 6645 * 6646 * @hide 6647 */ 6648 @Readable 6649 public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete"; 6650 6651 /** 6652 * The prefix for a category name that indicates whether a suggested action from that 6653 * category was marked as completed. 6654 * <p> 6655 * Type: int (0 for false, 1 for true) 6656 * 6657 * @hide 6658 */ 6659 @SystemApi 6660 @Readable 6661 public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category."; 6662 6663 /** 6664 * Whether or not compress blocks should be released on install. 6665 * <p>The setting only determines if the platform will attempt to release 6666 * compress blocks; it does not guarantee that the files will have their 6667 * compress blocks released. Compression is currently only supported on 6668 * some f2fs filesystems. 6669 * <p> 6670 * Type: int (0 for false, 1 for true) 6671 * 6672 * @hide 6673 */ 6674 public static final String RELEASE_COMPRESS_BLOCKS_ON_INSTALL = 6675 "release_compress_blocks_on_install"; 6676 6677 /** 6678 * List of input methods that are currently enabled. This is a string 6679 * containing the IDs of all enabled input methods, each ID separated 6680 * by ':'. 6681 * 6682 * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0" 6683 * where imeId is ComponentName and subtype is int32. 6684 */ 6685 @Readable 6686 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods"; 6687 6688 /** 6689 * List of system input methods that are currently disabled. This is a string 6690 * containing the IDs of all disabled input methods, each ID separated 6691 * by ':'. 6692 * @hide 6693 */ 6694 @Readable 6695 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods"; 6696 6697 /** 6698 * Whether to show the IME when a hard keyboard is connected. This is a boolean that 6699 * determines if the IME should be shown when a hard keyboard is attached. 6700 * @hide 6701 */ 6702 @TestApi 6703 @Readable 6704 @SuppressLint("NoSettingsProvider") 6705 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard"; 6706 6707 /** 6708 * Host name and port for global http proxy. Uses ':' seperator for 6709 * between host and port. 6710 * 6711 * @deprecated Use {@link Global#HTTP_PROXY} 6712 */ 6713 @Deprecated 6714 public static final String HTTP_PROXY = Global.HTTP_PROXY; 6715 6716 /** 6717 * Package designated as always-on VPN provider. 6718 * 6719 * @hide 6720 */ 6721 public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app"; 6722 6723 /** 6724 * Whether to block networking outside of VPN connections while always-on is set. 6725 * @see #ALWAYS_ON_VPN_APP 6726 * 6727 * @hide 6728 */ 6729 @Readable 6730 public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown"; 6731 6732 /** 6733 * Comma separated list of packages that are allowed to access the network when VPN is in 6734 * lockdown mode but not running. 6735 * @see #ALWAYS_ON_VPN_LOCKDOWN 6736 * 6737 * @hide 6738 */ 6739 @Readable 6740 public static final String ALWAYS_ON_VPN_LOCKDOWN_WHITELIST = 6741 "always_on_vpn_lockdown_whitelist"; 6742 6743 /** 6744 * Whether applications can be installed for this user via the system's 6745 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism. 6746 * 6747 * <p>1 = permit app installation via the system package installer intent 6748 * <p>0 = do not allow use of the package installer 6749 * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use 6750 * {@link PackageManager#canRequestPackageInstalls()} 6751 * @see PackageManager#canRequestPackageInstalls() 6752 */ 6753 @Deprecated 6754 @Readable 6755 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; 6756 6757 /** 6758 * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that 6759 * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it 6760 * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES} 6761 * on behalf of the profile owner if needed to make the change transparent for profile 6762 * owners. 6763 * 6764 * @hide 6765 */ 6766 @Readable 6767 public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED = 6768 "unknown_sources_default_reversed"; 6769 6770 /** 6771 * Comma-separated list of location providers that are enabled. Do not rely on this value 6772 * being present or correct, or on ContentObserver notifications on the corresponding Uri. 6773 * 6774 * @deprecated This setting no longer exists from Android S onwards as it no longer is 6775 * capable of realistically reflecting location settings. Use {@link 6776 * LocationManager#isProviderEnabled(String)} or {@link LocationManager#isLocationEnabled()} 6777 * instead. 6778 */ 6779 @Deprecated 6780 @Readable 6781 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"; 6782 6783 /** 6784 * The current location mode of the device. Do not rely on this value being present or on 6785 * ContentObserver notifications on the corresponding Uri. 6786 * 6787 * @deprecated The preferred methods for checking location mode and listening for changes 6788 * are via {@link LocationManager#isLocationEnabled()} and 6789 * {@link LocationManager#MODE_CHANGED_ACTION}. 6790 */ 6791 @Deprecated 6792 @Readable 6793 public static final String LOCATION_MODE = "location_mode"; 6794 6795 /** 6796 * The App or module that changes the location mode. 6797 * @hide 6798 */ 6799 @Readable 6800 public static final String LOCATION_CHANGER = "location_changer"; 6801 6802 /** 6803 * The location changer is unknown or unable to detect. 6804 * @hide 6805 */ 6806 public static final int LOCATION_CHANGER_UNKNOWN = 0; 6807 6808 /** 6809 * Location settings in system settings. 6810 * @hide 6811 */ 6812 public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1; 6813 6814 /** 6815 * The location icon in drop down notification drawer. 6816 * @hide 6817 */ 6818 public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2; 6819 6820 /** 6821 * Location mode is off. 6822 */ 6823 public static final int LOCATION_MODE_OFF = 0; 6824 6825 /** 6826 * This mode no longer has any distinct meaning, but is interpreted as the location mode is 6827 * on. 6828 * 6829 * @deprecated See {@link #LOCATION_MODE}. 6830 */ 6831 @Deprecated 6832 public static final int LOCATION_MODE_SENSORS_ONLY = 1; 6833 6834 /** 6835 * This mode no longer has any distinct meaning, but is interpreted as the location mode is 6836 * on. 6837 * 6838 * @deprecated See {@link #LOCATION_MODE}. 6839 */ 6840 @Deprecated 6841 public static final int LOCATION_MODE_BATTERY_SAVING = 2; 6842 6843 /** 6844 * This mode no longer has any distinct meaning, but is interpreted as the location mode is 6845 * on. 6846 * 6847 * @deprecated See {@link #LOCATION_MODE}. 6848 */ 6849 @Deprecated 6850 public static final int LOCATION_MODE_HIGH_ACCURACY = 3; 6851 6852 /** 6853 * Location mode is on. 6854 * 6855 * @hide 6856 */ 6857 @SystemApi 6858 public static final int LOCATION_MODE_ON = LOCATION_MODE_HIGH_ACCURACY; 6859 6860 /** 6861 * The current location time zone detection enabled state for the user. 6862 * 6863 * See {@link android.app.time.TimeManager#getTimeZoneCapabilitiesAndConfig} for access. 6864 * See {@link android.app.time.TimeManager#updateTimeZoneConfiguration} to update. 6865 * @hide 6866 */ 6867 public static final String LOCATION_TIME_ZONE_DETECTION_ENABLED = 6868 "location_time_zone_detection_enabled"; 6869 6870 /** 6871 * The accuracy in meters used for coarsening location for clients with only the coarse 6872 * location permission. 6873 * 6874 * @hide 6875 */ 6876 @Readable 6877 public static final String LOCATION_COARSE_ACCURACY_M = "locationCoarseAccuracy"; 6878 6879 /** 6880 * A flag containing settings used for biometric weak 6881 * @hide 6882 */ 6883 @Deprecated 6884 @Readable 6885 public static final String LOCK_BIOMETRIC_WEAK_FLAGS = 6886 "lock_biometric_weak_flags"; 6887 6888 /** 6889 * Whether lock-to-app will lock the keyguard when exiting. 6890 * @hide 6891 */ 6892 @Readable 6893 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked"; 6894 6895 /** 6896 * Whether autolock is enabled (0 = false, 1 = true) 6897 * 6898 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security 6899 * level of the keyguard. Accessing this setting from an app that is targeting 6900 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. 6901 */ 6902 @Deprecated 6903 @Readable 6904 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock"; 6905 6906 /** 6907 * Whether lock pattern is visible as user enters (0 = false, 1 = true) 6908 * 6909 * @deprecated Accessing this setting from an app that is targeting 6910 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. 6911 */ 6912 @Deprecated 6913 @Readable 6914 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; 6915 6916 /** 6917 * Whether lock pattern will vibrate as user enters (0 = false, 1 = 6918 * true) 6919 * 6920 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the 6921 * lockscreen uses 6922 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}. 6923 * Accessing this setting from an app that is targeting 6924 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. 6925 */ 6926 @Deprecated 6927 @Readable 6928 public static final String 6929 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled"; 6930 6931 /** 6932 * This preference allows the device to be locked given time after screen goes off, 6933 * subject to current DeviceAdmin policy limits. 6934 * @hide 6935 */ 6936 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 6937 @Readable 6938 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout"; 6939 6940 6941 /** 6942 * This preference contains the string that shows for owner info on LockScreen. 6943 * @hide 6944 * @deprecated 6945 */ 6946 @Deprecated 6947 @Readable 6948 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info"; 6949 6950 /** 6951 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited). 6952 * @hide 6953 */ 6954 @Deprecated 6955 @Readable 6956 public static final String LOCK_SCREEN_APPWIDGET_IDS = 6957 "lock_screen_appwidget_ids"; 6958 6959 /** 6960 * Id of the appwidget shown on the lock screen when appwidgets are disabled. 6961 * @hide 6962 */ 6963 @Deprecated 6964 @Readable 6965 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID = 6966 "lock_screen_fallback_appwidget_id"; 6967 6968 /** 6969 * Index of the lockscreen appwidget to restore, -1 if none. 6970 * @hide 6971 */ 6972 @Deprecated 6973 @Readable 6974 public static final String LOCK_SCREEN_STICKY_APPWIDGET = 6975 "lock_screen_sticky_appwidget"; 6976 6977 /** 6978 * This preference enables showing the owner info on LockScreen. 6979 * @hide 6980 * @deprecated 6981 */ 6982 @Deprecated 6983 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 6984 @Readable 6985 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED = 6986 "lock_screen_owner_info_enabled"; 6987 6988 /** 6989 * Indicates whether the user has allowed notifications to be shown atop a securely locked 6990 * screen in their full "private" form (same as when the device is unlocked). 6991 * <p> 6992 * Type: int (0 for false, 1 for true) 6993 * 6994 * @hide 6995 */ 6996 @SystemApi 6997 @Readable 6998 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = 6999 "lock_screen_allow_private_notifications"; 7000 7001 /** 7002 * When set by a user, allows notification remote input atop a securely locked screen 7003 * without having to unlock 7004 * @hide 7005 */ 7006 @Readable 7007 public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT = 7008 "lock_screen_allow_remote_input"; 7009 7010 /** 7011 * Indicates which clock face to show on lock screen and AOD formatted as a serialized 7012 * {@link org.json.JSONObject} with the format: 7013 * {"clock": id, "_applied_timestamp": timestamp} 7014 * @hide 7015 */ 7016 @Readable 7017 public static final String LOCK_SCREEN_CUSTOM_CLOCK_FACE = "lock_screen_custom_clock_face"; 7018 7019 /** 7020 * Indicates which clock face to show on lock screen and AOD while docked. 7021 * @hide 7022 */ 7023 @Readable 7024 public static final String DOCKED_CLOCK_FACE = "docked_clock_face"; 7025 7026 /** 7027 * Set by the system to track if the user needs to see the call to action for 7028 * the lockscreen notification policy. 7029 * @hide 7030 */ 7031 @Readable 7032 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING = 7033 "show_note_about_notification_hiding"; 7034 7035 /** 7036 * Set to 1 by the system after trust agents have been initialized. 7037 * @hide 7038 */ 7039 @Readable 7040 public static final String TRUST_AGENTS_INITIALIZED = 7041 "trust_agents_initialized"; 7042 7043 /** 7044 * The Logging ID (a unique 64-bit value) as a hex string. 7045 * Used as a pseudonymous identifier for logging. 7046 * @deprecated This identifier is poorly initialized and has 7047 * many collisions. It should not be used. 7048 */ 7049 @Deprecated 7050 @Readable 7051 public static final String LOGGING_ID = "logging_id"; 7052 7053 /** 7054 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead 7055 */ 7056 @Deprecated 7057 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; 7058 7059 /** 7060 * No longer supported. 7061 */ 7062 @Readable 7063 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled"; 7064 7065 /** 7066 * No longer supported. 7067 */ 7068 @Readable 7069 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update"; 7070 7071 /** 7072 * No longer supported. 7073 */ 7074 @Readable 7075 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url"; 7076 7077 /** 7078 * Settings classname to launch when Settings is clicked from All 7079 * Applications. Needed because of user testing between the old 7080 * and new Settings apps. 7081 */ 7082 // TODO: 881807 7083 @Readable 7084 public static final String SETTINGS_CLASSNAME = "settings_classname"; 7085 7086 /** 7087 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead 7088 */ 7089 @Deprecated 7090 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED; 7091 7092 /** 7093 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead 7094 */ 7095 @Deprecated 7096 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; 7097 7098 /** 7099 * If accessibility is enabled. 7100 */ 7101 @Readable 7102 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled"; 7103 7104 /** 7105 * Setting specifying if the accessibility shortcut is enabled. 7106 * @hide 7107 */ 7108 @Readable 7109 public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN = 7110 "accessibility_shortcut_on_lock_screen"; 7111 7112 /** 7113 * Setting specifying if the accessibility shortcut dialog has been shown to this user. 7114 * @hide 7115 */ 7116 @Readable 7117 public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN = 7118 "accessibility_shortcut_dialog_shown"; 7119 7120 /** 7121 * Setting specifying the accessibility services, accessibility shortcut targets, 7122 * or features to be toggled via the accessibility shortcut. 7123 * 7124 * <p> This is a colon-separated string list which contains the flattened 7125 * {@link ComponentName} and the class name of a system class implementing a supported 7126 * accessibility feature. 7127 * @hide 7128 */ 7129 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 7130 @TestApi 7131 @Readable 7132 public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE = 7133 "accessibility_shortcut_target_service"; 7134 7135 /** 7136 * Setting specifying the accessibility service or feature to be toggled via the 7137 * accessibility button in the navigation bar. This is either a flattened 7138 * {@link ComponentName} or the class name of a system class implementing a supported 7139 * accessibility feature. 7140 * @hide 7141 */ 7142 @Readable 7143 public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT = 7144 "accessibility_button_target_component"; 7145 7146 /** 7147 * Setting specifying the accessibility services, accessibility shortcut targets, 7148 * or features to be toggled via the accessibility button in the navigation bar. 7149 * 7150 * <p> This is a colon-separated string list which contains the flattened 7151 * {@link ComponentName} and the class name of a system class implementing a supported 7152 * accessibility feature. 7153 * @hide 7154 */ 7155 @Readable 7156 public static final String ACCESSIBILITY_BUTTON_TARGETS = "accessibility_button_targets"; 7157 7158 /** 7159 * The system class name of magnification controller which is a target to be toggled via 7160 * accessibility shortcut or accessibility button. 7161 * 7162 * @hide 7163 */ 7164 @Readable 7165 public static final String ACCESSIBILITY_SHORTCUT_TARGET_MAGNIFICATION_CONTROLLER = 7166 "com.android.server.accessibility.MagnificationController"; 7167 7168 /** 7169 * If touch exploration is enabled. 7170 */ 7171 @Readable 7172 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled"; 7173 7174 /** 7175 * List of the enabled accessibility providers. 7176 */ 7177 @Readable 7178 public static final String ENABLED_ACCESSIBILITY_SERVICES = 7179 "enabled_accessibility_services"; 7180 7181 /** 7182 * List of the notified non-accessibility category accessibility services. 7183 * 7184 * @hide 7185 */ 7186 @Readable 7187 public static final String NOTIFIED_NON_ACCESSIBILITY_CATEGORY_SERVICES = 7188 "notified_non_accessibility_category_services"; 7189 7190 /** 7191 * List of the accessibility services to which the user has granted 7192 * permission to put the device into touch exploration mode. 7193 * 7194 * @hide 7195 */ 7196 @Readable 7197 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES = 7198 "touch_exploration_granted_accessibility_services"; 7199 7200 /** 7201 * Whether the Global Actions Panel is enabled. 7202 * @hide 7203 */ 7204 @Readable 7205 public static final String GLOBAL_ACTIONS_PANEL_ENABLED = "global_actions_panel_enabled"; 7206 7207 /** 7208 * Whether the Global Actions Panel can be toggled on or off in Settings. 7209 * @hide 7210 */ 7211 @Readable 7212 public static final String GLOBAL_ACTIONS_PANEL_AVAILABLE = 7213 "global_actions_panel_available"; 7214 7215 /** 7216 * Enables debug mode for the Global Actions Panel. 7217 * @hide 7218 */ 7219 @Readable 7220 public static final String GLOBAL_ACTIONS_PANEL_DEBUG_ENABLED = 7221 "global_actions_panel_debug_enabled"; 7222 7223 /** 7224 * Whether the hush gesture has ever been used 7225 * @hide 7226 */ 7227 @SystemApi 7228 @Readable 7229 public static final String HUSH_GESTURE_USED = "hush_gesture_used"; 7230 7231 /** 7232 * Number of times the user has manually clicked the ringer toggle 7233 * @hide 7234 */ 7235 @Readable 7236 public static final String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count"; 7237 7238 /** 7239 * Whether to play a sound for charging events. 7240 * @hide 7241 */ 7242 @Readable 7243 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled"; 7244 7245 /** 7246 * Whether to vibrate for charging events. 7247 * @hide 7248 */ 7249 @Readable 7250 public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled"; 7251 7252 /** 7253 * If 0, turning on dnd manually will last indefinitely. 7254 * Else if non-negative, turning on dnd manually will last for this many minutes. 7255 * Else (if negative), turning on dnd manually will surface a dialog that prompts 7256 * user to specify a duration. 7257 * @hide 7258 */ 7259 @Readable 7260 public static final String ZEN_DURATION = "zen_duration"; 7261 7262 /** @hide */ public static final int ZEN_DURATION_PROMPT = -1; 7263 /** @hide */ public static final int ZEN_DURATION_FOREVER = 0; 7264 7265 /** 7266 * If nonzero, will show the zen upgrade notification when the user toggles DND on/off. 7267 * @hide 7268 */ 7269 @Readable 7270 public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification"; 7271 7272 /** 7273 * If nonzero, will show the zen update settings suggestion. 7274 * @hide 7275 */ 7276 @Readable 7277 public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion"; 7278 7279 /** 7280 * If nonzero, zen has not been updated to reflect new changes. 7281 * @hide 7282 */ 7283 @Readable 7284 public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated"; 7285 7286 /** 7287 * If nonzero, zen setting suggestion has been viewed by user 7288 * @hide 7289 */ 7290 @Readable 7291 public static final String ZEN_SETTINGS_SUGGESTION_VIEWED = 7292 "zen_settings_suggestion_viewed"; 7293 7294 /** 7295 * Whether the in call notification is enabled to play sound during calls. The value is 7296 * boolean (1 or 0). 7297 * @hide 7298 */ 7299 @Readable 7300 public static final String IN_CALL_NOTIFICATION_ENABLED = "in_call_notification_enabled"; 7301 7302 /** 7303 * Uri of the slice that's presented on the keyguard. 7304 * Defaults to a slice with the date and next alarm. 7305 * 7306 * @hide 7307 */ 7308 @Readable 7309 public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri"; 7310 7311 /** 7312 * The adjustment in font weight. This is used to draw text in bold. 7313 * 7314 * <p> This value can be negative. To display bolded text, the adjustment used is 300, 7315 * which is the difference between 7316 * {@link android.graphics.fonts.FontStyle#FONT_WEIGHT_NORMAL} and 7317 * {@link android.graphics.fonts.FontStyle#FONT_WEIGHT_BOLD}. 7318 * 7319 * @hide 7320 */ 7321 @Readable 7322 public static final String FONT_WEIGHT_ADJUSTMENT = "font_weight_adjustment"; 7323 7324 /** 7325 * Whether to speak passwords while in accessibility mode. 7326 * 7327 * @deprecated The speaking of passwords is controlled by individual accessibility services. 7328 * Apps should ignore this setting and provide complete information to accessibility 7329 * at all times, which was the behavior when this value was {@code true}. 7330 */ 7331 @Deprecated 7332 @Readable 7333 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password"; 7334 7335 /** 7336 * Whether to draw text with high contrast while in accessibility mode. 7337 * 7338 * @hide 7339 */ 7340 @Readable 7341 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED = 7342 "high_text_contrast_enabled"; 7343 7344 /** 7345 * Setting that specifies whether the display magnification is enabled via a system-wide 7346 * triple tap gesture. Display magnifications allows the user to zoom in the display content 7347 * and is targeted to low vision users. The current magnification scale is controlled by 7348 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. 7349 * 7350 * @hide 7351 */ 7352 @UnsupportedAppUsage 7353 @TestApi 7354 @Readable 7355 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED = 7356 "accessibility_display_magnification_enabled"; 7357 7358 /** 7359 * Setting that specifies whether the display magnification is enabled via a shortcut 7360 * affordance within the system's navigation area. Display magnifications allows the user to 7361 * zoom in the display content and is targeted to low vision users. The current 7362 * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. 7363 * 7364 * @deprecated Use {@link #ACCESSIBILITY_BUTTON_TARGETS} instead. 7365 * {@link #ACCESSIBILITY_BUTTON_TARGETS} holds the magnification system class name 7366 * when navigation bar magnification is enabled. 7367 * @hide 7368 */ 7369 @SystemApi 7370 @Readable 7371 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED = 7372 "accessibility_display_magnification_navbar_enabled"; 7373 7374 /** 7375 * Setting that specifies what the display magnification scale is. 7376 * Display magnifications allows the user to zoom in the display 7377 * content and is targeted to low vision users. Whether a display 7378 * magnification is performed is controlled by 7379 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and 7380 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED} 7381 * 7382 * @hide 7383 */ 7384 @Readable 7385 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE = 7386 "accessibility_display_magnification_scale"; 7387 7388 /** 7389 * Unused mangnification setting 7390 * 7391 * @hide 7392 * @deprecated 7393 */ 7394 @Deprecated 7395 @Readable 7396 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE = 7397 "accessibility_display_magnification_auto_update"; 7398 7399 /** 7400 * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be 7401 * modified from an AccessibilityService using the SoftKeyboardController. 7402 * 7403 * @hide 7404 */ 7405 @Readable 7406 public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE = 7407 "accessibility_soft_keyboard_mode"; 7408 7409 /** 7410 * Default soft keyboard behavior. 7411 * 7412 * @hide 7413 */ 7414 public static final int SHOW_MODE_AUTO = 0; 7415 7416 /** 7417 * Soft keyboard is never shown. 7418 * 7419 * @hide 7420 */ 7421 public static final int SHOW_MODE_HIDDEN = 1; 7422 7423 /** 7424 * Setting that specifies whether timed text (captions) should be 7425 * displayed in video content. Text display properties are controlled by 7426 * the following settings: 7427 * <ul> 7428 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE} 7429 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR} 7430 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR} 7431 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR} 7432 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE} 7433 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE} 7434 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE} 7435 * </ul> 7436 * 7437 * @hide 7438 */ 7439 @Readable 7440 public static final String ACCESSIBILITY_CAPTIONING_ENABLED = 7441 "accessibility_captioning_enabled"; 7442 7443 /** 7444 * Setting that specifies the language for captions as a locale string, 7445 * e.g. en_US. 7446 * 7447 * @see java.util.Locale#toString 7448 * @hide 7449 */ 7450 @Readable 7451 public static final String ACCESSIBILITY_CAPTIONING_LOCALE = 7452 "accessibility_captioning_locale"; 7453 7454 /** 7455 * Integer property that specifies the preset style for captions, one 7456 * of: 7457 * <ul> 7458 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM} 7459 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS} 7460 * </ul> 7461 * 7462 * @see java.util.Locale#toString 7463 * @hide 7464 */ 7465 @Readable 7466 public static final String ACCESSIBILITY_CAPTIONING_PRESET = 7467 "accessibility_captioning_preset"; 7468 7469 /** 7470 * Integer property that specifes the background color for captions as a 7471 * packed 32-bit color. 7472 * 7473 * @see android.graphics.Color#argb 7474 * @hide 7475 */ 7476 @Readable 7477 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR = 7478 "accessibility_captioning_background_color"; 7479 7480 /** 7481 * Integer property that specifes the foreground color for captions as a 7482 * packed 32-bit color. 7483 * 7484 * @see android.graphics.Color#argb 7485 * @hide 7486 */ 7487 @Readable 7488 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR = 7489 "accessibility_captioning_foreground_color"; 7490 7491 /** 7492 * Integer property that specifes the edge type for captions, one of: 7493 * <ul> 7494 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE} 7495 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE} 7496 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW} 7497 * </ul> 7498 * 7499 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR 7500 * @hide 7501 */ 7502 @Readable 7503 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE = 7504 "accessibility_captioning_edge_type"; 7505 7506 /** 7507 * Integer property that specifes the edge color for captions as a 7508 * packed 32-bit color. 7509 * 7510 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE 7511 * @see android.graphics.Color#argb 7512 * @hide 7513 */ 7514 @Readable 7515 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR = 7516 "accessibility_captioning_edge_color"; 7517 7518 /** 7519 * Integer property that specifes the window color for captions as a 7520 * packed 32-bit color. 7521 * 7522 * @see android.graphics.Color#argb 7523 * @hide 7524 */ 7525 @Readable 7526 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR = 7527 "accessibility_captioning_window_color"; 7528 7529 /** 7530 * String property that specifies the typeface for captions, one of: 7531 * <ul> 7532 * <li>DEFAULT 7533 * <li>MONOSPACE 7534 * <li>SANS_SERIF 7535 * <li>SERIF 7536 * </ul> 7537 * 7538 * @see android.graphics.Typeface 7539 * @hide 7540 */ 7541 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 7542 @Readable 7543 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE = 7544 "accessibility_captioning_typeface"; 7545 7546 /** 7547 * Floating point property that specifies font scaling for captions. 7548 * 7549 * @hide 7550 */ 7551 @Readable 7552 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE = 7553 "accessibility_captioning_font_scale"; 7554 7555 /** 7556 * Setting that specifies whether display color inversion is enabled. 7557 */ 7558 @Readable 7559 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED = 7560 "accessibility_display_inversion_enabled"; 7561 7562 /** 7563 * Setting that specifies whether display color space adjustment is 7564 * enabled. 7565 * 7566 * @hide 7567 */ 7568 @UnsupportedAppUsage 7569 @Readable 7570 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED = 7571 "accessibility_display_daltonizer_enabled"; 7572 7573 /** 7574 * Integer property that specifies the type of color space adjustment to 7575 * perform. Valid values are defined in AccessibilityManager and Settings arrays.xml: 7576 * - AccessibilityManager.DALTONIZER_DISABLED = -1 7577 * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0 7578 * - <item>@string/daltonizer_mode_protanomaly</item> = 11 7579 * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY and 7580 * <item>@string/daltonizer_mode_deuteranomaly</item> = 12 7581 * - <item>@string/daltonizer_mode_tritanomaly</item> = 13 7582 * 7583 * @hide 7584 */ 7585 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 7586 @Readable 7587 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER = 7588 "accessibility_display_daltonizer"; 7589 7590 /** 7591 * Setting that specifies whether automatic click when the mouse pointer stops moving is 7592 * enabled. 7593 * 7594 * @hide 7595 */ 7596 @UnsupportedAppUsage 7597 @Readable 7598 public static final String ACCESSIBILITY_AUTOCLICK_ENABLED = 7599 "accessibility_autoclick_enabled"; 7600 7601 /** 7602 * Integer setting specifying amount of time in ms the mouse pointer has to stay still 7603 * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set. 7604 * 7605 * @see #ACCESSIBILITY_AUTOCLICK_ENABLED 7606 * @hide 7607 */ 7608 @Readable 7609 public static final String ACCESSIBILITY_AUTOCLICK_DELAY = 7610 "accessibility_autoclick_delay"; 7611 7612 /** 7613 * Whether or not larger size icons are used for the pointer of mouse/trackpad for 7614 * accessibility. 7615 * (0 = false, 1 = true) 7616 * @hide 7617 */ 7618 @UnsupportedAppUsage 7619 @Readable 7620 public static final String ACCESSIBILITY_LARGE_POINTER_ICON = 7621 "accessibility_large_pointer_icon"; 7622 7623 /** 7624 * The timeout for considering a press to be a long press in milliseconds. 7625 * @hide 7626 */ 7627 @UnsupportedAppUsage 7628 @Readable 7629 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout"; 7630 7631 /** 7632 * The duration in milliseconds between the first tap's up event and the second tap's 7633 * down event for an interaction to be considered part of the same multi-press. 7634 * @hide 7635 */ 7636 @Readable 7637 public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout"; 7638 7639 /** 7640 * Setting that specifies recommended timeout in milliseconds for controls 7641 * which don't need user's interactions. 7642 * 7643 * @hide 7644 */ 7645 @Readable 7646 public static final String ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS = 7647 "accessibility_non_interactive_ui_timeout_ms"; 7648 7649 /** 7650 * Setting that specifies recommended timeout in milliseconds for controls 7651 * which need user's interactions. 7652 * 7653 * @hide 7654 */ 7655 @Readable 7656 public static final String ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS = 7657 "accessibility_interactive_ui_timeout_ms"; 7658 7659 7660 /** 7661 * Setting that specifies whether Reduce Bright Colors, or brightness dimming by color 7662 * adjustment, is enabled. 7663 * 7664 * @hide 7665 */ 7666 public static final String REDUCE_BRIGHT_COLORS_ACTIVATED = 7667 "reduce_bright_colors_activated"; 7668 7669 /** 7670 * Setting that specifies the level of Reduce Bright Colors in intensity. The range is 7671 * [0, 100]. 7672 * 7673 * @hide 7674 */ 7675 public static final String REDUCE_BRIGHT_COLORS_LEVEL = 7676 "reduce_bright_colors_level"; 7677 7678 /** 7679 * Setting that specifies whether Reduce Bright Colors should persist across reboots. 7680 * 7681 * @hide 7682 */ 7683 public static final String REDUCE_BRIGHT_COLORS_PERSIST_ACROSS_REBOOTS = 7684 "reduce_bright_colors_persist_across_reboots"; 7685 7686 /** 7687 * List of the enabled print services. 7688 * 7689 * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade 7690 * from pre-N. 7691 * 7692 * @hide 7693 */ 7694 @UnsupportedAppUsage 7695 @Readable 7696 public static final String ENABLED_PRINT_SERVICES = 7697 "enabled_print_services"; 7698 7699 /** 7700 * List of the disabled print services. 7701 * 7702 * @hide 7703 */ 7704 @TestApi 7705 @Readable 7706 public static final String DISABLED_PRINT_SERVICES = 7707 "disabled_print_services"; 7708 7709 /** 7710 * The saved value for WindowManagerService.setForcedDisplayDensity() 7711 * formatted as a single integer representing DPI. If unset, then use 7712 * the real display density. 7713 * 7714 * @hide 7715 */ 7716 @Readable 7717 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced"; 7718 7719 /** 7720 * Setting to always use the default text-to-speech settings regardless 7721 * of the application settings. 7722 * 1 = override application settings, 7723 * 0 = use application settings (if specified). 7724 * 7725 * @deprecated The value of this setting is no longer respected by 7726 * the framework text to speech APIs as of the Ice Cream Sandwich release. 7727 */ 7728 @Deprecated 7729 @Readable 7730 public static final String TTS_USE_DEFAULTS = "tts_use_defaults"; 7731 7732 /** 7733 * Default text-to-speech engine speech rate. 100 = 1x 7734 */ 7735 @Readable 7736 public static final String TTS_DEFAULT_RATE = "tts_default_rate"; 7737 7738 /** 7739 * Default text-to-speech engine pitch. 100 = 1x 7740 */ 7741 @Readable 7742 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch"; 7743 7744 /** 7745 * Default text-to-speech engine. 7746 */ 7747 @Readable 7748 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth"; 7749 7750 /** 7751 * Default text-to-speech language. 7752 * 7753 * @deprecated this setting is no longer in use, as of the Ice Cream 7754 * Sandwich release. Apps should never need to read this setting directly, 7755 * instead can query the TextToSpeech framework classes for the default 7756 * locale. {@link TextToSpeech#getLanguage()}. 7757 */ 7758 @Deprecated 7759 @Readable 7760 public static final String TTS_DEFAULT_LANG = "tts_default_lang"; 7761 7762 /** 7763 * Default text-to-speech country. 7764 * 7765 * @deprecated this setting is no longer in use, as of the Ice Cream 7766 * Sandwich release. Apps should never need to read this setting directly, 7767 * instead can query the TextToSpeech framework classes for the default 7768 * locale. {@link TextToSpeech#getLanguage()}. 7769 */ 7770 @Deprecated 7771 @Readable 7772 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country"; 7773 7774 /** 7775 * Default text-to-speech locale variant. 7776 * 7777 * @deprecated this setting is no longer in use, as of the Ice Cream 7778 * Sandwich release. Apps should never need to read this setting directly, 7779 * instead can query the TextToSpeech framework classes for the 7780 * locale that is in use {@link TextToSpeech#getLanguage()}. 7781 */ 7782 @Deprecated 7783 @Readable 7784 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant"; 7785 7786 /** 7787 * Stores the default tts locales on a per engine basis. Stored as 7788 * a comma seperated list of values, each value being of the form 7789 * {@code engine_name:locale} for example, 7790 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This 7791 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and 7792 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this 7793 * setting directly, and can query the TextToSpeech framework classes 7794 * for the locale that is in use. 7795 * 7796 * @hide 7797 */ 7798 @Readable 7799 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale"; 7800 7801 /** 7802 * Space delimited list of plugin packages that are enabled. 7803 */ 7804 @Readable 7805 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins"; 7806 7807 /** 7808 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} 7809 * instead. 7810 */ 7811 @Deprecated 7812 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 7813 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; 7814 7815 /** 7816 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} 7817 * instead. 7818 */ 7819 @Deprecated 7820 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 7821 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; 7822 7823 /** 7824 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} 7825 * instead. 7826 */ 7827 @Deprecated 7828 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = 7829 Global.WIFI_NUM_OPEN_NETWORKS_KEPT; 7830 7831 /** 7832 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} 7833 * instead. 7834 */ 7835 @Deprecated 7836 public static final String WIFI_ON = Global.WIFI_ON; 7837 7838 /** 7839 * The acceptable packet loss percentage (range 0 - 100) before trying 7840 * another AP on the same network. 7841 * @deprecated This setting is not used. 7842 */ 7843 @Deprecated 7844 @Readable 7845 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = 7846 "wifi_watchdog_acceptable_packet_loss_percentage"; 7847 7848 /** 7849 * The number of access points required for a network in order for the 7850 * watchdog to monitor it. 7851 * @deprecated This setting is not used. 7852 */ 7853 @Deprecated 7854 @Readable 7855 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count"; 7856 7857 /** 7858 * The delay between background checks. 7859 * @deprecated This setting is not used. 7860 */ 7861 @Deprecated 7862 @Readable 7863 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = 7864 "wifi_watchdog_background_check_delay_ms"; 7865 7866 /** 7867 * Whether the Wi-Fi watchdog is enabled for background checking even 7868 * after it thinks the user has connected to a good access point. 7869 * @deprecated This setting is not used. 7870 */ 7871 @Deprecated 7872 @Readable 7873 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = 7874 "wifi_watchdog_background_check_enabled"; 7875 7876 /** 7877 * The timeout for a background ping 7878 * @deprecated This setting is not used. 7879 */ 7880 @Deprecated 7881 @Readable 7882 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = 7883 "wifi_watchdog_background_check_timeout_ms"; 7884 7885 /** 7886 * The number of initial pings to perform that *may* be ignored if they 7887 * fail. Again, if these fail, they will *not* be used in packet loss 7888 * calculation. For example, one network always seemed to time out for 7889 * the first couple pings, so this is set to 3 by default. 7890 * @deprecated This setting is not used. 7891 */ 7892 @Deprecated 7893 @Readable 7894 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = 7895 "wifi_watchdog_initial_ignored_ping_count"; 7896 7897 /** 7898 * The maximum number of access points (per network) to attempt to test. 7899 * If this number is reached, the watchdog will no longer monitor the 7900 * initial connection state for the network. This is a safeguard for 7901 * networks containing multiple APs whose DNS does not respond to pings. 7902 * @deprecated This setting is not used. 7903 */ 7904 @Deprecated 7905 @Readable 7906 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks"; 7907 7908 /** 7909 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead 7910 */ 7911 @Deprecated 7912 @Readable 7913 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; 7914 7915 /** 7916 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled. 7917 * @deprecated This setting is not used. 7918 */ 7919 @Deprecated 7920 @Readable 7921 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list"; 7922 7923 /** 7924 * The number of pings to test if an access point is a good connection. 7925 * @deprecated This setting is not used. 7926 */ 7927 @Deprecated 7928 @Readable 7929 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count"; 7930 7931 /** 7932 * The delay between pings. 7933 * @deprecated This setting is not used. 7934 */ 7935 @Deprecated 7936 @Readable 7937 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms"; 7938 7939 /** 7940 * The timeout per ping. 7941 * @deprecated This setting is not used. 7942 */ 7943 @Deprecated 7944 @Readable 7945 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms"; 7946 7947 /** 7948 * @deprecated Use 7949 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead 7950 */ 7951 @Deprecated 7952 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT; 7953 7954 /** 7955 * @deprecated Use 7956 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead 7957 */ 7958 @Deprecated 7959 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 7960 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; 7961 7962 /** 7963 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives 7964 * the receivers of the PendingIntent an opportunity to make a new network request before 7965 * the Network satisfying the request is potentially removed. 7966 * 7967 * @hide 7968 */ 7969 @Readable 7970 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS = 7971 "connectivity_release_pending_intent_delay_ms"; 7972 7973 /** 7974 * Whether background data usage is allowed. 7975 * 7976 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH}, 7977 * availability of background data depends on several 7978 * combined factors. When background data is unavailable, 7979 * {@link ConnectivityManager#getActiveNetworkInfo()} will 7980 * now appear disconnected. 7981 */ 7982 @Deprecated 7983 @Readable 7984 public static final String BACKGROUND_DATA = "background_data"; 7985 7986 /** 7987 * Origins for which browsers should allow geolocation by default. 7988 * The value is a space-separated list of origins. 7989 */ 7990 @Readable 7991 public static final String ALLOWED_GEOLOCATION_ORIGINS 7992 = "allowed_geolocation_origins"; 7993 7994 /** 7995 * The preferred TTY mode 0 = TTy Off, CDMA default 7996 * 1 = TTY Full 7997 * 2 = TTY HCO 7998 * 3 = TTY VCO 7999 * @hide 8000 */ 8001 @Readable 8002 public static final String PREFERRED_TTY_MODE = 8003 "preferred_tty_mode"; 8004 8005 /** 8006 * Whether the enhanced voice privacy mode is enabled. 8007 * 0 = normal voice privacy 8008 * 1 = enhanced voice privacy 8009 * @hide 8010 */ 8011 @Readable 8012 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled"; 8013 8014 /** 8015 * Whether the TTY mode mode is enabled. 8016 * 0 = disabled 8017 * 1 = enabled 8018 * @hide 8019 */ 8020 @Readable 8021 public static final String TTY_MODE_ENABLED = "tty_mode_enabled"; 8022 8023 /** 8024 * User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT 8025 * calls when supported by the device and carrier. Boolean value. 8026 * 0 = OFF 8027 * 1 = ON 8028 */ 8029 @Readable 8030 public static final String RTT_CALLING_MODE = "rtt_calling_mode"; 8031 8032 /** 8033 /** 8034 * Controls whether settings backup is enabled. 8035 * Type: int ( 0 = disabled, 1 = enabled ) 8036 * @hide 8037 */ 8038 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8039 @Readable 8040 public static final String BACKUP_ENABLED = "backup_enabled"; 8041 8042 /** 8043 * Controls whether application data is automatically restored from backup 8044 * at install time. 8045 * Type: int ( 0 = disabled, 1 = enabled ) 8046 * @hide 8047 */ 8048 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8049 @Readable 8050 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore"; 8051 8052 /** 8053 * Indicates whether settings backup has been fully provisioned. 8054 * Type: int ( 0 = unprovisioned, 1 = fully provisioned ) 8055 * @hide 8056 */ 8057 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8058 @Readable 8059 public static final String BACKUP_PROVISIONED = "backup_provisioned"; 8060 8061 /** 8062 * Component of the transport to use for backup/restore. 8063 * @hide 8064 */ 8065 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8066 @Readable 8067 public static final String BACKUP_TRANSPORT = "backup_transport"; 8068 8069 /** 8070 * Indicates the version for which the setup wizard was last shown. The version gets 8071 * bumped for each release when there is new setup information to show. 8072 * 8073 * @hide 8074 */ 8075 @SystemApi 8076 @Readable 8077 public static final String LAST_SETUP_SHOWN = "last_setup_shown"; 8078 8079 /** 8080 * The interval in milliseconds after which Wi-Fi is considered idle. 8081 * When idle, it is possible for the device to be switched from Wi-Fi to 8082 * the mobile data network. 8083 * @hide 8084 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS} 8085 * instead. 8086 */ 8087 @Deprecated 8088 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS; 8089 8090 /** 8091 * The global search provider chosen by the user (if multiple global 8092 * search providers are installed). This will be the provider returned 8093 * by {@link SearchManager#getGlobalSearchActivity()} if it's still 8094 * installed. This setting is stored as a flattened component name as 8095 * per {@link ComponentName#flattenToString()}. 8096 * 8097 * @hide 8098 */ 8099 @Readable 8100 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY = 8101 "search_global_search_activity"; 8102 8103 /** 8104 * The number of promoted sources in GlobalSearch. 8105 * @hide 8106 */ 8107 @Readable 8108 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources"; 8109 /** 8110 * The maximum number of suggestions returned by GlobalSearch. 8111 * @hide 8112 */ 8113 @Readable 8114 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display"; 8115 /** 8116 * The number of suggestions GlobalSearch will ask each non-web search source for. 8117 * @hide 8118 */ 8119 @Readable 8120 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source"; 8121 /** 8122 * The number of suggestions the GlobalSearch will ask the web search source for. 8123 * @hide 8124 */ 8125 @Readable 8126 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT = 8127 "search_web_results_override_limit"; 8128 /** 8129 * The number of milliseconds that GlobalSearch will wait for suggestions from 8130 * promoted sources before continuing with all other sources. 8131 * @hide 8132 */ 8133 @Readable 8134 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS = 8135 "search_promoted_source_deadline_millis"; 8136 /** 8137 * The number of milliseconds before GlobalSearch aborts search suggesiton queries. 8138 * @hide 8139 */ 8140 @Readable 8141 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis"; 8142 /** 8143 * The maximum number of milliseconds that GlobalSearch shows the previous results 8144 * after receiving a new query. 8145 * @hide 8146 */ 8147 @Readable 8148 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis"; 8149 /** 8150 * The maximum age of log data used for shortcuts in GlobalSearch. 8151 * @hide 8152 */ 8153 @Readable 8154 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis"; 8155 /** 8156 * The maximum age of log data used for source ranking in GlobalSearch. 8157 * @hide 8158 */ 8159 @Readable 8160 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS = 8161 "search_max_source_event_age_millis"; 8162 /** 8163 * The minimum number of impressions needed to rank a source in GlobalSearch. 8164 * @hide 8165 */ 8166 @Readable 8167 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING = 8168 "search_min_impressions_for_source_ranking"; 8169 /** 8170 * The minimum number of clicks needed to rank a source in GlobalSearch. 8171 * @hide 8172 */ 8173 @Readable 8174 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING = 8175 "search_min_clicks_for_source_ranking"; 8176 /** 8177 * The maximum number of shortcuts shown by GlobalSearch. 8178 * @hide 8179 */ 8180 @Readable 8181 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned"; 8182 /** 8183 * The size of the core thread pool for suggestion queries in GlobalSearch. 8184 * @hide 8185 */ 8186 @Readable 8187 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE = 8188 "search_query_thread_core_pool_size"; 8189 /** 8190 * The maximum size of the thread pool for suggestion queries in GlobalSearch. 8191 * @hide 8192 */ 8193 @Readable 8194 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE = 8195 "search_query_thread_max_pool_size"; 8196 /** 8197 * The size of the core thread pool for shortcut refreshing in GlobalSearch. 8198 * @hide 8199 */ 8200 @Readable 8201 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE = 8202 "search_shortcut_refresh_core_pool_size"; 8203 /** 8204 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch. 8205 * @hide 8206 */ 8207 @Readable 8208 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE = 8209 "search_shortcut_refresh_max_pool_size"; 8210 /** 8211 * The maximun time that excess threads in the GlobalSeach thread pools will 8212 * wait before terminating. 8213 * @hide 8214 */ 8215 @Readable 8216 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS = 8217 "search_thread_keepalive_seconds"; 8218 /** 8219 * The maximum number of concurrent suggestion queries to each source. 8220 * @hide 8221 */ 8222 @Readable 8223 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT = 8224 "search_per_source_concurrent_query_limit"; 8225 8226 /** 8227 * Whether or not alert sounds are played on StorageManagerService events. 8228 * (0 = false, 1 = true) 8229 * @hide 8230 */ 8231 @Readable 8232 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd"; 8233 8234 /** 8235 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true) 8236 * @hide 8237 */ 8238 @Readable 8239 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart"; 8240 8241 /** 8242 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true) 8243 * @hide 8244 */ 8245 @Readable 8246 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt"; 8247 8248 /** 8249 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true) 8250 * @hide 8251 */ 8252 @Readable 8253 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled"; 8254 8255 /** 8256 * If nonzero, ANRs in invisible background processes bring up a dialog. 8257 * Otherwise, the process will be silently killed. 8258 * 8259 * Also prevents ANRs and crash dialogs from being suppressed. 8260 * @hide 8261 */ 8262 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8263 @TestApi 8264 @Readable 8265 @SuppressLint("NoSettingsProvider") 8266 public static final String ANR_SHOW_BACKGROUND = "anr_show_background"; 8267 8268 /** 8269 * If nonzero, crashes in foreground processes will bring up a dialog. 8270 * Otherwise, the process will be silently killed. 8271 * @hide 8272 */ 8273 @TestApi 8274 @Readable 8275 @SuppressLint("NoSettingsProvider") 8276 public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION = 8277 "show_first_crash_dialog_dev_option"; 8278 8279 /** 8280 * The {@link ComponentName} string of the service to be used as the voice recognition 8281 * service. 8282 * 8283 * @hide 8284 */ 8285 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8286 @Readable 8287 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service"; 8288 8289 /** 8290 * The {@link ComponentName} string of the selected spell checker service which is 8291 * one of the services managed by the text service manager. 8292 * 8293 * @hide 8294 */ 8295 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8296 @TestApi 8297 @Readable 8298 @SuppressLint("NoSettingsProvider") 8299 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker"; 8300 8301 /** 8302 * {@link android.view.textservice.SpellCheckerSubtype#hashCode()} of the selected subtype 8303 * of the selected spell checker service which is one of the services managed by the text 8304 * service manager. 8305 * 8306 * @hide 8307 */ 8308 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8309 @TestApi 8310 @Readable 8311 @SuppressLint("NoSettingsProvider") 8312 public static final String SELECTED_SPELL_CHECKER_SUBTYPE = 8313 "selected_spell_checker_subtype"; 8314 8315 /** 8316 * Whether spell checker is enabled or not. 8317 * 8318 * @hide 8319 */ 8320 @Readable 8321 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled"; 8322 8323 /** 8324 * What happens when the user presses the Power button while in-call 8325 * and the screen is on.<br/> 8326 * <b>Values:</b><br/> 8327 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/> 8328 * 2 - The Power button hangs up the current call.<br/> 8329 * 8330 * @hide 8331 */ 8332 @UnsupportedAppUsage 8333 @Readable 8334 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior"; 8335 8336 /** 8337 * Whether the user allows minimal post processing or not. 8338 * 8339 * <p>Values: 8340 * 0 - Not allowed. Any preferences set through the Window.setPreferMinimalPostProcessing 8341 * API will be ignored. 8342 * 1 - Allowed. Any preferences set through the Window.setPreferMinimalPostProcessing API 8343 * will be respected and the appropriate signals will be sent to display. 8344 * (Default behaviour) 8345 * 8346 * @hide 8347 */ 8348 @Readable 8349 public static final String MINIMAL_POST_PROCESSING_ALLOWED = 8350 "minimal_post_processing_allowed"; 8351 8352 /** 8353 * No mode switching will happen. 8354 * 8355 * @see #MATCH_CONTENT_FRAME_RATE 8356 * @hide 8357 */ 8358 public static final int MATCH_CONTENT_FRAMERATE_NEVER = 0; 8359 8360 /** 8361 * Allow only refresh rate switching between modes in the same configuration group. 8362 * This way only switches without visual interruptions for the user will be allowed. 8363 * 8364 * @see #MATCH_CONTENT_FRAME_RATE 8365 * @hide 8366 */ 8367 public static final int MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY = 1; 8368 8369 /** 8370 * Allow refresh rate switching between all refresh rates even if the switch will have 8371 * visual interruptions for the user. 8372 * 8373 * @see #MATCH_CONTENT_FRAME_RATE 8374 * @hide 8375 */ 8376 public static final int MATCH_CONTENT_FRAMERATE_ALWAYS = 2; 8377 8378 /** 8379 * User's preference for refresh rate switching. 8380 * 8381 * <p>Values: 8382 * 0 - Never switch refresh rates. 8383 * 1 - Switch refresh rates only when it can be done seamlessly. (Default behaviour) 8384 * 2 - Always prefer refresh rate switching even if it's going to have visual interruptions 8385 * for the user. 8386 * 8387 * @see android.view.Surface#setFrameRate 8388 * @see #MATCH_CONTENT_FRAMERATE_NEVER 8389 * @see #MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY 8390 * @see #MATCH_CONTENT_FRAMERATE_ALWAYS 8391 * @hide 8392 */ 8393 public static final String MATCH_CONTENT_FRAME_RATE = 8394 "match_content_frame_rate"; 8395 8396 /** 8397 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen". 8398 * @hide 8399 */ 8400 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1; 8401 8402 /** 8403 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up". 8404 * @hide 8405 */ 8406 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2; 8407 8408 /** 8409 * INCALL_POWER_BUTTON_BEHAVIOR default value. 8410 * @hide 8411 */ 8412 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = 8413 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; 8414 8415 /** 8416 * What happens when the user presses the Back button while in-call 8417 * and the screen is on.<br/> 8418 * <b>Values:</b><br/> 8419 * 0 - The Back buttons does nothing different.<br/> 8420 * 1 - The Back button hangs up the current call.<br/> 8421 * 8422 * @hide 8423 */ 8424 @Readable 8425 public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior"; 8426 8427 /** 8428 * INCALL_BACK_BUTTON_BEHAVIOR value for no action. 8429 * @hide 8430 */ 8431 public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0; 8432 8433 /** 8434 * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up". 8435 * @hide 8436 */ 8437 public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1; 8438 8439 /** 8440 * INCALL_POWER_BUTTON_BEHAVIOR default value. 8441 * @hide 8442 */ 8443 public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT = 8444 INCALL_BACK_BUTTON_BEHAVIOR_NONE; 8445 8446 /** 8447 * Whether the device should wake when the wake gesture sensor detects motion. 8448 * @hide 8449 */ 8450 @Readable 8451 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled"; 8452 8453 /** 8454 * Whether the device should doze if configured. 8455 * @hide 8456 */ 8457 @UnsupportedAppUsage 8458 @Readable 8459 public static final String DOZE_ENABLED = "doze_enabled"; 8460 8461 /** 8462 * Indicates whether doze should be always on. 8463 * <p> 8464 * Type: int (0 for false, 1 for true) 8465 * 8466 * @hide 8467 */ 8468 @SystemApi 8469 @Readable 8470 public static final String DOZE_ALWAYS_ON = "doze_always_on"; 8471 8472 /** 8473 * Whether the device should pulse on pick up gesture. 8474 * @hide 8475 */ 8476 @Readable 8477 public static final String DOZE_PICK_UP_GESTURE = "doze_pulse_on_pick_up"; 8478 8479 /** 8480 * Whether the device should pulse on long press gesture. 8481 * @hide 8482 */ 8483 @Readable 8484 public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press"; 8485 8486 /** 8487 * Whether the device should pulse on double tap gesture. 8488 * @hide 8489 */ 8490 @Readable 8491 public static final String DOZE_DOUBLE_TAP_GESTURE = "doze_pulse_on_double_tap"; 8492 8493 /** 8494 * Whether the device should respond to the SLPI tap gesture. 8495 * @hide 8496 */ 8497 @Readable 8498 public static final String DOZE_TAP_SCREEN_GESTURE = "doze_tap_gesture"; 8499 8500 /** 8501 * Gesture that wakes up the display, showing some version of the lock screen. 8502 * @hide 8503 */ 8504 @Readable 8505 public static final String DOZE_WAKE_LOCK_SCREEN_GESTURE = "doze_wake_screen_gesture"; 8506 8507 /** 8508 * Gesture that wakes up the display, toggling between {@link Display.STATE_OFF} and 8509 * {@link Display.STATE_DOZE}. 8510 * @hide 8511 */ 8512 @Readable 8513 public static final String DOZE_WAKE_DISPLAY_GESTURE = "doze_wake_display_gesture"; 8514 8515 /** 8516 * Gesture that wakes up the display on quick pickup, toggling between 8517 * {@link Display.STATE_OFF} and {@link Display.STATE_DOZE}. 8518 * @hide 8519 */ 8520 public static final String DOZE_QUICK_PICKUP_GESTURE = "doze_quick_pickup_gesture"; 8521 8522 /** 8523 * Whether the device should suppress the current doze configuration and disable dozing. 8524 * @hide 8525 */ 8526 @Readable 8527 public static final String SUPPRESS_DOZE = "suppress_doze"; 8528 8529 /** 8530 * Gesture that skips media. 8531 * @hide 8532 */ 8533 @Readable 8534 public static final String SKIP_GESTURE = "skip_gesture"; 8535 8536 /** 8537 * Count of successful gestures. 8538 * @hide 8539 */ 8540 @Readable 8541 public static final String SKIP_GESTURE_COUNT = "skip_gesture_count"; 8542 8543 /** 8544 * Count of non-gesture interaction. 8545 * @hide 8546 */ 8547 @Readable 8548 public static final String SKIP_TOUCH_COUNT = "skip_touch_count"; 8549 8550 /** 8551 * Direction to advance media for skip gesture 8552 * @hide 8553 */ 8554 @Readable 8555 public static final String SKIP_DIRECTION = "skip_gesture_direction"; 8556 8557 /** 8558 * Gesture that silences sound (alarms, notification, calls). 8559 * @hide 8560 */ 8561 @Readable 8562 public static final String SILENCE_GESTURE = "silence_gesture"; 8563 8564 /** 8565 * Count of successful silence alarms gestures. 8566 * @hide 8567 */ 8568 @Readable 8569 public static final String SILENCE_ALARMS_GESTURE_COUNT = "silence_alarms_gesture_count"; 8570 8571 /** 8572 * Count of successful silence timer gestures. 8573 * @hide 8574 */ 8575 @Readable 8576 public static final String SILENCE_TIMER_GESTURE_COUNT = "silence_timer_gesture_count"; 8577 8578 /** 8579 * Count of successful silence call gestures. 8580 * @hide 8581 */ 8582 @Readable 8583 public static final String SILENCE_CALL_GESTURE_COUNT = "silence_call_gesture_count"; 8584 8585 /** 8586 * Count of non-gesture interaction. 8587 * @hide 8588 */ 8589 @Readable 8590 public static final String SILENCE_ALARMS_TOUCH_COUNT = "silence_alarms_touch_count"; 8591 8592 /** 8593 * Count of non-gesture interaction. 8594 * @hide 8595 */ 8596 @Readable 8597 public static final String SILENCE_TIMER_TOUCH_COUNT = "silence_timer_touch_count"; 8598 8599 /** 8600 * Count of non-gesture interaction. 8601 * @hide 8602 */ 8603 @Readable 8604 public static final String SILENCE_CALL_TOUCH_COUNT = "silence_call_touch_count"; 8605 8606 /** 8607 * Number of successful "Motion Sense" tap gestures to pause media. 8608 * @hide 8609 */ 8610 @Readable 8611 public static final String AWARE_TAP_PAUSE_GESTURE_COUNT = "aware_tap_pause_gesture_count"; 8612 8613 /** 8614 * Number of touch interactions to pause media when a "Motion Sense" gesture could 8615 * have been used. 8616 * @hide 8617 */ 8618 @Readable 8619 public static final String AWARE_TAP_PAUSE_TOUCH_COUNT = "aware_tap_pause_touch_count"; 8620 8621 /** 8622 * For user preference if swipe bottom to expand notification gesture enabled. 8623 * @hide 8624 */ 8625 public static final String SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED = 8626 "swipe_bottom_to_notification_enabled"; 8627 8628 /** 8629 * Controls whether One-Handed mode is currently activated. 8630 * @hide 8631 */ 8632 public static final String ONE_HANDED_MODE_ACTIVATED = "one_handed_mode_activated"; 8633 8634 /** 8635 * For user preference if One-Handed Mode enabled. 8636 * @hide 8637 */ 8638 public static final String ONE_HANDED_MODE_ENABLED = "one_handed_mode_enabled"; 8639 8640 /** 8641 * For user preference if One-Handed Mode timeout. 8642 * @hide 8643 */ 8644 public static final String ONE_HANDED_MODE_TIMEOUT = "one_handed_mode_timeout"; 8645 8646 /** 8647 * For user taps app to exit One-Handed Mode. 8648 * @hide 8649 */ 8650 public static final String TAPS_APP_TO_EXIT = "taps_app_to_exit"; 8651 8652 /** 8653 * Internal use, one handed mode tutorial showed times. 8654 * @hide 8655 */ 8656 public static final String ONE_HANDED_TUTORIAL_SHOW_COUNT = 8657 "one_handed_tutorial_show_count"; 8658 8659 /** 8660 * Toggle to enable/disable for the apps to use the Ui translation for Views. The value 8661 * indicates whether the Ui translation is enabled by the user. 8662 * <p> 8663 * Type: {@code int} ({@code 0} for disabled, {@code 1} for enabled) 8664 * 8665 * @hide 8666 */ 8667 @SystemApi 8668 @Readable 8669 @SuppressLint("NoSettingsProvider") 8670 public static final String UI_TRANSLATION_ENABLED = "ui_translation_enabled"; 8671 8672 /** 8673 * The current night mode that has been selected by the user. Owned 8674 * and controlled by UiModeManagerService. Constants are as per 8675 * UiModeManager. 8676 * @hide 8677 */ 8678 @Readable 8679 public static final String UI_NIGHT_MODE = "ui_night_mode"; 8680 8681 /** 8682 * The current night mode that has been overridden to turn on by the system. Owned 8683 * and controlled by UiModeManagerService. Constants are as per 8684 * UiModeManager. 8685 * @hide 8686 */ 8687 @Readable 8688 public static final String UI_NIGHT_MODE_OVERRIDE_ON = "ui_night_mode_override_on"; 8689 8690 /** 8691 * The last computed night mode bool the last time the phone was on 8692 * @hide 8693 */ 8694 public static final String UI_NIGHT_MODE_LAST_COMPUTED = "ui_night_mode_last_computed"; 8695 8696 /** 8697 * The current night mode that has been overridden to turn off by the system. Owned 8698 * and controlled by UiModeManagerService. Constants are as per 8699 * UiModeManager. 8700 * @hide 8701 */ 8702 @Readable 8703 public static final String UI_NIGHT_MODE_OVERRIDE_OFF = "ui_night_mode_override_off"; 8704 8705 /** 8706 * Whether screensavers are enabled. 8707 * @hide 8708 */ 8709 @Readable 8710 public static final String SCREENSAVER_ENABLED = "screensaver_enabled"; 8711 8712 /** 8713 * The user's chosen screensaver components. 8714 * 8715 * These will be launched by the PhoneWindowManager after a timeout when not on 8716 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1). 8717 * @hide 8718 */ 8719 @Readable 8720 public static final String SCREENSAVER_COMPONENTS = "screensaver_components"; 8721 8722 /** 8723 * If screensavers are enabled, whether the screensaver should be automatically launched 8724 * when the device is inserted into a (desk) dock. 8725 * @hide 8726 */ 8727 @Readable 8728 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock"; 8729 8730 /** 8731 * If screensavers are enabled, whether the screensaver should be automatically launched 8732 * when the screen times out when not on battery. 8733 * @hide 8734 */ 8735 @Readable 8736 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep"; 8737 8738 /** 8739 * If screensavers are enabled, the default screensaver component. 8740 * @hide 8741 */ 8742 @Readable 8743 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component"; 8744 8745 /** 8746 * The default NFC payment component 8747 * @hide 8748 */ 8749 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8750 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component"; 8751 8752 /** 8753 * Whether NFC payment is handled by the foreground application or a default. 8754 * @hide 8755 */ 8756 @Readable 8757 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground"; 8758 8759 /** 8760 * Specifies the package name currently configured to be the primary sms application 8761 * @hide 8762 */ 8763 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8764 @Readable 8765 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application"; 8766 8767 /** 8768 * Specifies the package name currently configured to be the default dialer application 8769 * @hide 8770 */ 8771 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8772 @Readable 8773 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application"; 8774 8775 /** 8776 * Specifies the component name currently configured to be the default call screening 8777 * application 8778 * @hide 8779 */ 8780 @Readable 8781 public static final String CALL_SCREENING_DEFAULT_COMPONENT = 8782 "call_screening_default_component"; 8783 8784 /** 8785 * Specifies the package name currently configured to be the emergency assistance application 8786 * 8787 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE 8788 * 8789 * @hide 8790 */ 8791 @Readable 8792 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application"; 8793 8794 /** 8795 * Specifies whether the current app context on scren (assist data) will be sent to the 8796 * assist application (active voice interaction service). 8797 * 8798 * @hide 8799 */ 8800 @Readable 8801 public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled"; 8802 8803 /** 8804 * Specifies whether a screenshot of the screen contents will be sent to the assist 8805 * application (active voice interaction service). 8806 * 8807 * @hide 8808 */ 8809 @Readable 8810 public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled"; 8811 8812 /** 8813 * Specifies whether the screen will show an animation if screen contents are sent to the 8814 * assist application (active voice interaction service). 8815 * 8816 * Note that the disclosure will be forced for third-party assistants or if the device 8817 * does not support disabling it. 8818 * 8819 * @hide 8820 */ 8821 @Readable 8822 public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled"; 8823 8824 /** 8825 * Control if rotation suggestions are sent to System UI when in rotation locked mode. 8826 * Done to enable screen rotation while the the screen rotation is locked. Enabling will 8827 * poll the accelerometer in rotation locked mode. 8828 * 8829 * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent. 8830 * 8831 * @hide 8832 */ 8833 @Readable 8834 public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions"; 8835 8836 /** 8837 * The disabled state of SHOW_ROTATION_SUGGESTIONS. 8838 * @hide 8839 */ 8840 public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0; 8841 8842 /** 8843 * The enabled state of SHOW_ROTATION_SUGGESTIONS. 8844 * @hide 8845 */ 8846 public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1; 8847 8848 /** 8849 * The default state of SHOW_ROTATION_SUGGESTIONS. 8850 * @hide 8851 */ 8852 public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT = 8853 SHOW_ROTATION_SUGGESTIONS_ENABLED; 8854 8855 /** 8856 * The number of accepted rotation suggestions. Used to determine if the user has been 8857 * introduced to rotation suggestions. 8858 * @hide 8859 */ 8860 @Readable 8861 public static final String NUM_ROTATION_SUGGESTIONS_ACCEPTED = 8862 "num_rotation_suggestions_accepted"; 8863 8864 /** 8865 * Read only list of the service components that the current user has explicitly allowed to 8866 * see and assist with all of the user's notifications. 8867 * 8868 * @deprecated Use 8869 * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}. 8870 * @hide 8871 */ 8872 @Deprecated 8873 @Readable 8874 public static final String ENABLED_NOTIFICATION_ASSISTANT = 8875 "enabled_notification_assistant"; 8876 8877 /** 8878 * Read only list of the service components that the current user has explicitly allowed to 8879 * see all of the user's notifications, separated by ':'. 8880 * 8881 * @hide 8882 * @deprecated Use 8883 * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}. 8884 */ 8885 @Deprecated 8886 @UnsupportedAppUsage 8887 @Readable 8888 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners"; 8889 8890 /** 8891 * Read only list of the packages that the current user has explicitly allowed to 8892 * manage do not disturb, separated by ':'. 8893 * 8894 * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}. 8895 * @hide 8896 */ 8897 @Deprecated 8898 @TestApi 8899 @Readable 8900 public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES = 8901 "enabled_notification_policy_access_packages"; 8902 8903 /** 8904 * Defines whether managed profile ringtones should be synced from it's parent profile 8905 * <p> 8906 * 0 = ringtones are not synced 8907 * 1 = ringtones are synced from the profile's parent (default) 8908 * <p> 8909 * This value is only used for managed profiles. 8910 * @hide 8911 */ 8912 @TestApi 8913 @Readable 8914 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) 8915 public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds"; 8916 8917 /** 8918 * @hide 8919 */ 8920 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8921 @TestApi 8922 @Readable 8923 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations"; 8924 8925 /** 8926 * This is the query URI for finding a print service to install. 8927 * 8928 * @hide 8929 */ 8930 @Readable 8931 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri"; 8932 8933 /** 8934 * This is the query URI for finding a NFC payment service to install. 8935 * 8936 * @hide 8937 */ 8938 @Readable 8939 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri"; 8940 8941 /** 8942 * This is the query URI for finding a auto fill service to install. 8943 * 8944 * @hide 8945 */ 8946 @Readable 8947 public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri"; 8948 8949 /** 8950 * If enabled, apps should try to skip any introductory hints on first launch. This might 8951 * apply to users that are already familiar with the environment or temporary users. 8952 * <p> 8953 * Type : int (0 to show hints, 1 to skip showing hints) 8954 */ 8955 @Readable 8956 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints"; 8957 8958 /** 8959 * Persisted playback time after a user confirmation of an unsafe volume level. 8960 * 8961 * @hide 8962 */ 8963 @Readable 8964 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms"; 8965 8966 /** 8967 * Indicates whether notification display on the lock screen is enabled. 8968 * <p> 8969 * Type: int (0 for false, 1 for true) 8970 * 8971 * @hide 8972 */ 8973 @SystemApi 8974 @Readable 8975 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS = 8976 "lock_screen_show_notifications"; 8977 8978 /** 8979 * Indicates whether the lock screen should display silent notifications. 8980 * <p> 8981 * Type: int (0 for false, 1 for true) 8982 * 8983 * @hide 8984 */ 8985 @Readable 8986 public static final String LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS = 8987 "lock_screen_show_silent_notifications"; 8988 8989 /** 8990 * Indicates whether snooze options should be shown on notifications 8991 * <p> 8992 * Type: int (0 for false, 1 for true) 8993 * 8994 * @hide 8995 */ 8996 @Readable 8997 public static final String SHOW_NOTIFICATION_SNOOZE = "show_notification_snooze"; 8998 8999 /** 9000 * List of TV inputs that are currently hidden. This is a string 9001 * containing the IDs of all hidden TV inputs. Each ID is encoded by 9002 * {@link android.net.Uri#encode(String)} and separated by ':'. 9003 * @hide 9004 */ 9005 @Readable 9006 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs"; 9007 9008 /** 9009 * List of custom TV input labels. This is a string containing <TV input id, custom name> 9010 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)} 9011 * and separated by ','. Each pair is separated by ':'. 9012 * @hide 9013 */ 9014 @Readable 9015 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels"; 9016 9017 /** 9018 * Whether TV app uses non-system inputs. 9019 * 9020 * <p> 9021 * The value is boolean (1 or 0), where 1 means non-system TV inputs are allowed, 9022 * and 0 means non-system TV inputs are not allowed. 9023 * 9024 * <p> 9025 * Devices such as sound bars may have changed the system property allow_third_party_inputs 9026 * to false so the TV Application only uses HDMI and other built in inputs. This setting 9027 * allows user to override the default and have the TV Application use third party TV inputs 9028 * available on play store. 9029 * 9030 * @hide 9031 */ 9032 @Readable 9033 public static final String TV_APP_USES_NON_SYSTEM_INPUTS = "tv_app_uses_non_system_inputs"; 9034 9035 /** 9036 * Whether automatic routing of system audio to USB audio peripheral is disabled. 9037 * The value is boolean (1 or 0), where 1 means automatic routing is disabled, 9038 * and 0 means automatic routing is enabled. 9039 * 9040 * @hide 9041 */ 9042 @Readable 9043 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED = 9044 "usb_audio_automatic_routing_disabled"; 9045 9046 /** 9047 * The timeout in milliseconds before the device fully goes to sleep after 9048 * a period of inactivity. This value sets an upper bound on how long the device 9049 * will stay awake or dreaming without user activity. It should generally 9050 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device 9051 * will sleep before it ever has a chance to dream. 9052 * <p> 9053 * Use -1 to disable this timeout. 9054 * </p> 9055 * 9056 * @hide 9057 */ 9058 @Readable 9059 public static final String SLEEP_TIMEOUT = "sleep_timeout"; 9060 9061 /** 9062 * The timeout in milliseconds before the device goes to sleep due to user inattentiveness, 9063 * even if the system is holding wakelocks. It should generally be longer than {@code 9064 * config_attentiveWarningDuration}, as otherwise the device will show the attentive 9065 * warning constantly. Small timeouts are discouraged, as they will cause the device to 9066 * go to sleep quickly after waking up. 9067 * <p> 9068 * Use -1 to disable this timeout. 9069 * </p> 9070 * 9071 * @hide 9072 */ 9073 @Readable 9074 public static final String ATTENTIVE_TIMEOUT = "attentive_timeout"; 9075 9076 /** 9077 * Controls whether double tap to wake is enabled. 9078 * @hide 9079 */ 9080 @Readable 9081 public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake"; 9082 9083 /** 9084 * The current assistant component. It could be a voice interaction service, 9085 * or an activity that handles ACTION_ASSIST, or empty which means using the default 9086 * handling. 9087 * 9088 * <p>This should be set indirectly by setting the {@link 9089 * android.app.role.RoleManager#ROLE_ASSISTANT assistant role}. 9090 * 9091 * @hide 9092 */ 9093 @UnsupportedAppUsage 9094 @Readable 9095 public static final String ASSISTANT = "assistant"; 9096 9097 /** 9098 * Whether the camera launch gesture should be disabled. 9099 * 9100 * @hide 9101 */ 9102 @Readable 9103 public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled"; 9104 9105 /** 9106 * Whether the emergency gesture should be enabled. 9107 * 9108 * @hide 9109 */ 9110 public static final String EMERGENCY_GESTURE_ENABLED = "emergency_gesture_enabled"; 9111 9112 /** 9113 * Whether the emergency gesture sound should be enabled. 9114 * 9115 * @hide 9116 */ 9117 public static final String EMERGENCY_GESTURE_SOUND_ENABLED = 9118 "emergency_gesture_sound_enabled"; 9119 9120 /** 9121 * Whether the camera launch gesture to double tap the power button when the screen is off 9122 * should be disabled. 9123 * 9124 * @hide 9125 */ 9126 @Readable 9127 public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED = 9128 "camera_double_tap_power_gesture_disabled"; 9129 9130 /** 9131 * Whether the camera double twist gesture to flip between front and back mode should be 9132 * enabled. 9133 * 9134 * @hide 9135 */ 9136 @Readable 9137 public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED = 9138 "camera_double_twist_to_flip_enabled"; 9139 9140 /** 9141 * Whether or not the smart camera lift trigger that launches the camera when the user moves 9142 * the phone into a position for taking photos should be enabled. 9143 * 9144 * @hide 9145 */ 9146 @Readable 9147 public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled"; 9148 9149 /** 9150 * The default enable state of the camera lift trigger. 9151 * 9152 * @hide 9153 */ 9154 public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1; 9155 9156 /** 9157 * Whether or not the flashlight (camera torch mode) is available required to turn 9158 * on flashlight. 9159 * 9160 * @hide 9161 */ 9162 @Readable 9163 public static final String FLASHLIGHT_AVAILABLE = "flashlight_available"; 9164 9165 /** 9166 * Whether or not flashlight is enabled. 9167 * 9168 * @hide 9169 */ 9170 @Readable 9171 public static final String FLASHLIGHT_ENABLED = "flashlight_enabled"; 9172 9173 /** 9174 * Whether or not face unlock is allowed on Keyguard. 9175 * @hide 9176 */ 9177 @Readable 9178 public static final String FACE_UNLOCK_KEYGUARD_ENABLED = "face_unlock_keyguard_enabled"; 9179 9180 /** 9181 * Whether or not face unlock dismisses the keyguard. 9182 * @hide 9183 */ 9184 @Readable 9185 public static final String FACE_UNLOCK_DISMISSES_KEYGUARD = 9186 "face_unlock_dismisses_keyguard"; 9187 9188 /** 9189 * Whether or not media is shown automatically when bypassing as a heads up. 9190 * @hide 9191 */ 9192 @Readable 9193 public static final String SHOW_MEDIA_WHEN_BYPASSING = 9194 "show_media_when_bypassing"; 9195 9196 /** 9197 * Whether or not face unlock requires attention. This is a cached value, the source of 9198 * truth is obtained through the HAL. 9199 * @hide 9200 */ 9201 @Readable 9202 public static final String FACE_UNLOCK_ATTENTION_REQUIRED = 9203 "face_unlock_attention_required"; 9204 9205 /** 9206 * Whether or not face unlock requires a diverse set of poses during enrollment. This is a 9207 * cached value, the source of truth is obtained through the HAL. 9208 * @hide 9209 */ 9210 @Readable 9211 public static final String FACE_UNLOCK_DIVERSITY_REQUIRED = 9212 "face_unlock_diversity_required"; 9213 9214 9215 /** 9216 * Whether or not face unlock is allowed for apps (through BiometricPrompt). 9217 * @hide 9218 */ 9219 @Readable 9220 public static final String FACE_UNLOCK_APP_ENABLED = "face_unlock_app_enabled"; 9221 9222 /** 9223 * Whether or not face unlock always requires user confirmation, meaning {@link 9224 * android.hardware.biometrics.BiometricPrompt.Builder#setConfirmationRequired(boolean)} 9225 * is always 'true'. This overrides the behavior that apps choose in the 9226 * setConfirmationRequired API. 9227 * @hide 9228 */ 9229 @Readable 9230 public static final String FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION = 9231 "face_unlock_always_require_confirmation"; 9232 9233 /** 9234 * Whether or not a user should re enroll their face. 9235 * 9236 * Face unlock re enroll. 9237 * 0 = No re enrollment. 9238 * 1 = Re enrollment is suggested. 9239 * 2 = Re enrollment is required after a set time period. 9240 * 3 = Re enrollment is required immediately. 9241 * 9242 * @hide 9243 */ 9244 @Readable 9245 public static final String FACE_UNLOCK_RE_ENROLL = "face_unlock_re_enroll"; 9246 9247 /** 9248 * Whether or not debugging is enabled. 9249 * @hide 9250 */ 9251 @Readable 9252 public static final String BIOMETRIC_DEBUG_ENABLED = 9253 "biometric_debug_enabled"; 9254 9255 /** 9256 * Whether or not biometric is allowed on Keyguard. 9257 * @hide 9258 */ 9259 @Readable 9260 public static final String BIOMETRIC_KEYGUARD_ENABLED = "biometric_keyguard_enabled"; 9261 9262 /** 9263 * Whether or not biometric is allowed for apps (through BiometricPrompt). 9264 * @hide 9265 */ 9266 @Readable 9267 public static final String BIOMETRIC_APP_ENABLED = "biometric_app_enabled"; 9268 9269 /** 9270 * Whether the assist gesture should be enabled. 9271 * 9272 * @hide 9273 */ 9274 @Readable 9275 public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled"; 9276 9277 /** 9278 * Sensitivity control for the assist gesture. 9279 * 9280 * @hide 9281 */ 9282 @Readable 9283 public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity"; 9284 9285 /** 9286 * Whether the assist gesture should silence alerts. 9287 * 9288 * @hide 9289 */ 9290 @Readable 9291 public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED = 9292 "assist_gesture_silence_alerts_enabled"; 9293 9294 /** 9295 * Whether the assist gesture should wake the phone. 9296 * 9297 * @hide 9298 */ 9299 @Readable 9300 public static final String ASSIST_GESTURE_WAKE_ENABLED = 9301 "assist_gesture_wake_enabled"; 9302 9303 /** 9304 * Indicates whether the Assist Gesture Deferred Setup has been completed. 9305 * <p> 9306 * Type: int (0 for false, 1 for true) 9307 * 9308 * @hide 9309 */ 9310 @SystemApi 9311 @Readable 9312 public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete"; 9313 9314 /** 9315 * Whether the assistant can be triggered by a touch gesture. 9316 * 9317 * @hide 9318 */ 9319 public static final String ASSIST_TOUCH_GESTURE_ENABLED = 9320 "assist_touch_gesture_enabled"; 9321 9322 /** 9323 * Whether the assistant can be triggered by long-pressing the home button 9324 * 9325 * @hide 9326 */ 9327 public static final String ASSIST_LONG_PRESS_HOME_ENABLED = 9328 "assist_long_press_home_enabled"; 9329 9330 /** 9331 * Control whether Trust Agents are in active unlock or extend unlock mode. 9332 * @hide 9333 */ 9334 @Readable 9335 public static final String TRUST_AGENTS_EXTEND_UNLOCK = "trust_agents_extend_unlock"; 9336 9337 /** 9338 * Control whether the screen locks when trust is lost. 9339 * @hide 9340 */ 9341 @Readable 9342 public static final String LOCK_SCREEN_WHEN_TRUST_LOST = "lock_screen_when_trust_lost"; 9343 9344 /** 9345 * Control whether Night display is currently activated. 9346 * @hide 9347 */ 9348 @Readable 9349 public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated"; 9350 9351 /** 9352 * Control whether Night display will automatically activate/deactivate. 9353 * @hide 9354 */ 9355 @Readable 9356 public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode"; 9357 9358 /** 9359 * Control the color temperature of Night Display, represented in Kelvin. 9360 * @hide 9361 */ 9362 @Readable 9363 public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE = 9364 "night_display_color_temperature"; 9365 9366 /** 9367 * Custom time when Night display is scheduled to activate. 9368 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm). 9369 * @hide 9370 */ 9371 @Readable 9372 public static final String NIGHT_DISPLAY_CUSTOM_START_TIME = 9373 "night_display_custom_start_time"; 9374 9375 /** 9376 * Custom time when Night display is scheduled to deactivate. 9377 * Represented as milliseconds from midnight (e.g. 21600000 == 6am). 9378 * @hide 9379 */ 9380 @Readable 9381 public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time"; 9382 9383 /** 9384 * A String representing the LocalDateTime when Night display was last activated. Use to 9385 * decide whether to apply the current activated state after a reboot or user change. In 9386 * legacy cases, this is represented by the time in milliseconds (since epoch). 9387 * @hide 9388 */ 9389 @Readable 9390 public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME = 9391 "night_display_last_activated_time"; 9392 9393 /** 9394 * Control whether display white balance is currently enabled. 9395 * @hide 9396 */ 9397 @Readable 9398 public static final String DISPLAY_WHITE_BALANCE_ENABLED = "display_white_balance_enabled"; 9399 9400 /** 9401 * Names of the service components that the current user has explicitly allowed to 9402 * be a VR mode listener, separated by ':'. 9403 * 9404 * @hide 9405 */ 9406 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 9407 @TestApi 9408 @Readable 9409 public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners"; 9410 9411 /** 9412 * Behavior of the display while in VR mode. 9413 * 9414 * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}. 9415 * 9416 * @hide 9417 */ 9418 @Readable 9419 public static final String VR_DISPLAY_MODE = "vr_display_mode"; 9420 9421 /** 9422 * Lower the display persistence while the system is in VR mode. 9423 * 9424 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE 9425 * 9426 * @hide. 9427 */ 9428 public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0; 9429 9430 /** 9431 * Do not alter the display persistence while the system is in VR mode. 9432 * 9433 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE 9434 * 9435 * @hide. 9436 */ 9437 public static final int VR_DISPLAY_MODE_OFF = 1; 9438 9439 /** 9440 * The latest SDK version that CarrierAppUtils#disableCarrierAppsUntilPrivileged has been 9441 * executed for. 9442 * 9443 * <p>This is used to ensure that we only take one pass which will disable apps that are not 9444 * privileged (if any). From then on, we only want to enable apps (when a matching SIM is 9445 * inserted), to avoid disabling an app that the user might actively be using. 9446 * 9447 * <p>Will be set to {@link android.os.Build.VERSION#SDK_INT} once executed. Note that older 9448 * SDK versions prior to R set 1 for this value. 9449 * 9450 * @hide 9451 */ 9452 @Readable 9453 public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled"; 9454 9455 /** 9456 * Whether parent user can access remote contact in managed profile. 9457 * 9458 * @hide 9459 */ 9460 @Readable 9461 public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH = 9462 "managed_profile_contact_remote_search"; 9463 9464 /** 9465 * Whether parent profile can access remote calendar data in managed profile. 9466 * 9467 * @hide 9468 */ 9469 @Readable 9470 public static final String CROSS_PROFILE_CALENDAR_ENABLED = 9471 "cross_profile_calendar_enabled"; 9472 9473 /** 9474 * Whether or not the automatic storage manager is enabled and should run on the device. 9475 * 9476 * @hide 9477 */ 9478 @Readable 9479 public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED = 9480 "automatic_storage_manager_enabled"; 9481 9482 /** 9483 * How many days of information for the automatic storage manager to retain on the device. 9484 * 9485 * @hide 9486 */ 9487 @Readable 9488 public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN = 9489 "automatic_storage_manager_days_to_retain"; 9490 9491 /** 9492 * Default number of days of information for the automatic storage manager to retain. 9493 * 9494 * @hide 9495 */ 9496 public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90; 9497 9498 /** 9499 * How many bytes the automatic storage manager has cleared out. 9500 * 9501 * @hide 9502 */ 9503 @Readable 9504 public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED = 9505 "automatic_storage_manager_bytes_cleared"; 9506 9507 /** 9508 * Last run time for the automatic storage manager. 9509 * 9510 * @hide 9511 */ 9512 @Readable 9513 public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN = 9514 "automatic_storage_manager_last_run"; 9515 /** 9516 * If the automatic storage manager has been disabled by policy. Note that this doesn't 9517 * mean that the automatic storage manager is prevented from being re-enabled -- this only 9518 * means that it was turned off by policy at least once. 9519 * 9520 * @hide 9521 */ 9522 @Readable 9523 public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY = 9524 "automatic_storage_manager_turned_off_by_policy"; 9525 9526 /** 9527 * Whether SystemUI navigation keys is enabled. 9528 * @hide 9529 */ 9530 @Readable 9531 public static final String SYSTEM_NAVIGATION_KEYS_ENABLED = 9532 "system_navigation_keys_enabled"; 9533 9534 /** 9535 * Holds comma separated list of ordering of QS tiles. 9536 * 9537 * @hide 9538 */ 9539 @Readable 9540 public static final String QS_TILES = "sysui_qs_tiles"; 9541 9542 /** 9543 * Whether this user has enabled Quick controls. 9544 * 9545 * 0 indicates disabled and 1 indicates enabled. A non existent value should be treated as 9546 * enabled. 9547 * 9548 * @deprecated Controls are migrated to Quick Settings, rendering this unnecessary and will 9549 * be removed in a future release. 9550 * @hide 9551 */ 9552 @Readable 9553 @Deprecated 9554 public static final String CONTROLS_ENABLED = "controls_enabled"; 9555 9556 /** 9557 * Whether power menu content (cards, passes, controls) will be shown when device is locked. 9558 * 9559 * 0 indicates hide and 1 indicates show. A non existent value will be treated as hide. 9560 * @hide 9561 */ 9562 @TestApi 9563 @Readable 9564 public static final String POWER_MENU_LOCKED_SHOW_CONTENT = 9565 "power_menu_locked_show_content"; 9566 9567 /** 9568 * Whether home controls should be accessible from the lockscreen 9569 * 9570 * @hide 9571 */ 9572 public static final String LOCKSCREEN_SHOW_CONTROLS = "lockscreen_show_controls"; 9573 9574 /** 9575 * Whether wallet should be accessible from the lockscreen 9576 * 9577 * @hide 9578 */ 9579 public static final String LOCKSCREEN_SHOW_WALLET = "lockscreen_show_wallet"; 9580 9581 /** 9582 * Specifies whether the web action API is enabled. 9583 * 9584 * @hide 9585 */ 9586 @SystemApi 9587 @Readable 9588 public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled"; 9589 9590 /** 9591 * Has this pairable device been paired or upgraded from a previously paired system. 9592 * @hide 9593 */ 9594 @Readable 9595 public static final String DEVICE_PAIRED = "device_paired"; 9596 9597 /** 9598 * Specifies additional package name for broadcasting the CMAS messages. 9599 * @hide 9600 */ 9601 @Readable 9602 public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg"; 9603 9604 /** 9605 * Whether the launcher should show any notification badges. 9606 * The value is boolean (1 or 0). 9607 * @hide 9608 */ 9609 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 9610 @TestApi 9611 @Readable 9612 public static final String NOTIFICATION_BADGING = "notification_badging"; 9613 9614 /** 9615 * When enabled the system will maintain a rolling history of received notifications. When 9616 * disabled the history will be disabled and deleted. 9617 * 9618 * The value 1 - enable, 0 - disable 9619 * @hide 9620 */ 9621 @Readable 9622 public static final String NOTIFICATION_HISTORY_ENABLED = "notification_history_enabled"; 9623 9624 /** 9625 * When enabled conversations marked as favorites will be set to bubble. 9626 * 9627 * The value 1 - enable, 0 - disable 9628 * @hide 9629 */ 9630 @Readable 9631 public static final String BUBBLE_IMPORTANT_CONVERSATIONS 9632 = "bubble_important_conversations"; 9633 9634 /** 9635 * When enabled, notifications able to bubble will display an affordance allowing the user 9636 * to bubble them. 9637 * The value is boolean (1 to enable or 0 to disable). 9638 * 9639 * @hide 9640 */ 9641 @TestApi 9642 @SuppressLint("NoSettingsProvider") 9643 @Readable 9644 public static final String NOTIFICATION_BUBBLES = "notification_bubbles"; 9645 9646 /** 9647 * Whether notifications are dismissed by a right-to-left swipe (instead of a left-to-right 9648 * swipe). 9649 * 9650 * @hide 9651 */ 9652 @Readable 9653 public static final String NOTIFICATION_DISMISS_RTL = "notification_dismiss_rtl"; 9654 9655 /** 9656 * Comma separated list of QS tiles that have been auto-added already. 9657 * @hide 9658 */ 9659 @Readable 9660 public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles"; 9661 9662 /** 9663 * Backup manager behavioral parameters. 9664 * This is encoded as a key=value list, separated by commas. Ex: 9665 * 9666 * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true" 9667 * 9668 * The following keys are supported: 9669 * 9670 * <pre> 9671 * key_value_backup_interval_milliseconds (long) 9672 * key_value_backup_fuzz_milliseconds (long) 9673 * key_value_backup_require_charging (boolean) 9674 * key_value_backup_required_network_type (int) 9675 * full_backup_interval_milliseconds (long) 9676 * full_backup_require_charging (boolean) 9677 * full_backup_required_network_type (int) 9678 * backup_finished_notification_receivers (String[]) 9679 * </pre> 9680 * 9681 * backup_finished_notification_receivers uses ":" as delimeter for values. 9682 * 9683 * <p> 9684 * Type: string 9685 * @hide 9686 */ 9687 @Readable 9688 public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants"; 9689 9690 9691 /** 9692 * Local transport parameters so we can configure it for tests. 9693 * This is encoded as a key=value list, separated by commas. 9694 * 9695 * The following keys are supported: 9696 * 9697 * <pre> 9698 * fake_encryption_flag (boolean) 9699 * </pre> 9700 * 9701 * <p> 9702 * Type: string 9703 * @hide 9704 */ 9705 @Readable 9706 public static final String BACKUP_LOCAL_TRANSPORT_PARAMETERS = 9707 "backup_local_transport_parameters"; 9708 9709 /** 9710 * Flag to set if the system should predictively attempt to re-enable Bluetooth while 9711 * the user is driving. 9712 * @hide 9713 */ 9714 @Readable 9715 public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving"; 9716 9717 /** 9718 * What behavior should be invoked when the volume hush gesture is triggered 9719 * One of VOLUME_HUSH_OFF, VOLUME_HUSH_VIBRATE, VOLUME_HUSH_MUTE. 9720 * 9721 * @hide 9722 */ 9723 @SystemApi 9724 @Readable 9725 public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture"; 9726 9727 /** @hide */ 9728 @SystemApi 9729 public static final int VOLUME_HUSH_OFF = 0; 9730 /** @hide */ 9731 @SystemApi 9732 public static final int VOLUME_HUSH_VIBRATE = 1; 9733 /** @hide */ 9734 @SystemApi 9735 public static final int VOLUME_HUSH_MUTE = 2; 9736 9737 /** 9738 * The number of times (integer) the user has manually enabled battery saver. 9739 * @hide 9740 */ 9741 @Readable 9742 public static final String LOW_POWER_MANUAL_ACTIVATION_COUNT = 9743 "low_power_manual_activation_count"; 9744 9745 /** 9746 * Whether the "first time battery saver warning" dialog needs to be shown (0: default) 9747 * or not (1). 9748 * 9749 * @hide 9750 */ 9751 @Readable 9752 public static final String LOW_POWER_WARNING_ACKNOWLEDGED = 9753 "low_power_warning_acknowledged"; 9754 9755 /** 9756 * 0 (default) Auto battery saver suggestion has not been suppressed. 1) it has been 9757 * suppressed. 9758 * @hide 9759 */ 9760 @Readable 9761 public static final String SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION = 9762 "suppress_auto_battery_saver_suggestion"; 9763 9764 /** 9765 * List of packages, which data need to be unconditionally cleared before full restore. 9766 * Type: string 9767 * @hide 9768 */ 9769 @Readable 9770 public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE = 9771 "packages_to_clear_data_before_full_restore"; 9772 9773 /** 9774 * How often to check for location access. 9775 * @hide 9776 */ 9777 @SystemApi 9778 @Readable 9779 public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS = 9780 "location_access_check_interval_millis"; 9781 9782 /** 9783 * Delay between granting location access and checking it. 9784 * @hide 9785 */ 9786 @SystemApi 9787 @Readable 9788 public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS = 9789 "location_access_check_delay_millis"; 9790 9791 /** 9792 * @deprecated This setting does not have any effect anymore 9793 * @hide 9794 */ 9795 @SystemApi 9796 @Deprecated 9797 @Readable 9798 public static final String LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE = 9799 "location_permissions_upgrade_to_q_mode"; 9800 9801 /** 9802 * Whether or not the system Auto Revoke feature is disabled. 9803 * @hide 9804 */ 9805 @SystemApi 9806 @Readable 9807 public static final String AUTO_REVOKE_DISABLED = "auto_revoke_disabled"; 9808 9809 /** 9810 * Map of android.theme.customization.* categories to the enabled overlay package for that 9811 * category, formatted as a serialized {@link org.json.JSONObject}. If there is no 9812 * corresponding package included for a category, then all overlay packages in that 9813 * category must be disabled. 9814 * @hide 9815 */ 9816 @SystemApi 9817 @Readable 9818 public static final String THEME_CUSTOMIZATION_OVERLAY_PACKAGES = 9819 "theme_customization_overlay_packages"; 9820 9821 /** 9822 * Navigation bar mode. 9823 * 0 = 3 button 9824 * 1 = 2 button 9825 * 2 = fully gestural 9826 * @hide 9827 */ 9828 @Readable 9829 public static final String NAVIGATION_MODE = 9830 "navigation_mode"; 9831 9832 /** 9833 * Scale factor for the back gesture inset size on the left side of the screen. 9834 * @hide 9835 */ 9836 @Readable 9837 public static final String BACK_GESTURE_INSET_SCALE_LEFT = 9838 "back_gesture_inset_scale_left"; 9839 9840 /** 9841 * Scale factor for the back gesture inset size on the right side of the screen. 9842 * @hide 9843 */ 9844 @Readable 9845 public static final String BACK_GESTURE_INSET_SCALE_RIGHT = 9846 "back_gesture_inset_scale_right"; 9847 9848 /** 9849 * Current provider of proximity-based sharing services. 9850 * Default value in @string/config_defaultNearbySharingComponent. 9851 * No VALIDATOR as this setting will not be backed up. 9852 * @hide 9853 */ 9854 @Readable 9855 public static final String NEARBY_SHARING_COMPONENT = "nearby_sharing_component"; 9856 9857 /** 9858 * Controls whether aware is enabled. 9859 * @hide 9860 */ 9861 @Readable 9862 public static final String AWARE_ENABLED = "aware_enabled"; 9863 9864 /** 9865 * Controls whether aware_lock is enabled. 9866 * @hide 9867 */ 9868 @Readable 9869 public static final String AWARE_LOCK_ENABLED = "aware_lock_enabled"; 9870 9871 /** 9872 * Controls whether tap gesture is enabled. 9873 * @hide 9874 */ 9875 @Readable 9876 public static final String TAP_GESTURE = "tap_gesture"; 9877 9878 /** 9879 * Controls whether the people strip is enabled. 9880 * @hide 9881 */ 9882 @Readable 9883 public static final String PEOPLE_STRIP = "people_strip"; 9884 9885 /** 9886 * Whether or not to enable media resumption 9887 * When enabled, media controls in quick settings will populate on boot and persist if 9888 * resumable via a MediaBrowserService. 9889 * @see Settings.Global#SHOW_MEDIA_ON_QUICK_SETTINGS 9890 * @hide 9891 */ 9892 @Readable 9893 public static final String MEDIA_CONTROLS_RESUME = "qs_media_resumption"; 9894 9895 /** 9896 * Controls whether contextual suggestions can be shown in the media controls. 9897 * @hide 9898 */ 9899 public static final String MEDIA_CONTROLS_RECOMMENDATION = "qs_media_recommend"; 9900 9901 /** 9902 * Controls magnification mode when magnification is enabled via a system-wide triple tap 9903 * gesture or the accessibility shortcut. 9904 * 9905 * @see #ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN 9906 * @see #ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW 9907 * @hide 9908 */ 9909 @TestApi 9910 @Readable 9911 public static final String ACCESSIBILITY_MAGNIFICATION_MODE = 9912 "accessibility_magnification_mode"; 9913 9914 /** 9915 * Magnification mode value that is a default value for the magnification logging feature. 9916 * @hide 9917 */ 9918 public static final int ACCESSIBILITY_MAGNIFICATION_MODE_NONE = 0x0; 9919 9920 /** 9921 * Magnification mode value that magnifies whole display. 9922 * @hide 9923 */ 9924 @TestApi 9925 public static final int ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN = 0x1; 9926 9927 /** 9928 * Magnification mode value that magnifies magnify particular region in a window 9929 * @hide 9930 */ 9931 @TestApi 9932 public static final int ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW = 0x2; 9933 9934 /** 9935 * Magnification mode value that is capable of magnifying whole display and particular 9936 * region in a window. 9937 * @hide 9938 */ 9939 @TestApi 9940 public static final int ACCESSIBILITY_MAGNIFICATION_MODE_ALL = 0x3; 9941 9942 /** 9943 * Controls magnification capability. Accessibility magnification is capable of at least one 9944 * of the magnification modes. 9945 * 9946 * @see #ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN 9947 * @see #ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW 9948 * @see #ACCESSIBILITY_MAGNIFICATION_MODE_ALL 9949 * @hide 9950 */ 9951 @TestApi 9952 @Readable 9953 public static final String ACCESSIBILITY_MAGNIFICATION_CAPABILITY = 9954 "accessibility_magnification_capability"; 9955 9956 /** 9957 * Whether to show the window magnification prompt dialog when the user uses full-screen 9958 * magnification first time after database is upgraded. 9959 * 9960 * @hide 9961 */ 9962 public static final String ACCESSIBILITY_SHOW_WINDOW_MAGNIFICATION_PROMPT = 9963 "accessibility_show_window_magnification_prompt"; 9964 9965 /** 9966 * Controls the accessibility button mode. System will force-set the value to {@link 9967 * #ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU} if {@link #NAVIGATION_MODE} is fully 9968 * gestural. 9969 * <ul> 9970 * <li> 0 = button in navigation bar </li> 9971 * <li> 1 = button floating on the display </li> 9972 * </ul> 9973 * 9974 * @see #ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR 9975 * @see #ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU 9976 * @hide 9977 */ 9978 public static final String ACCESSIBILITY_BUTTON_MODE = 9979 "accessibility_button_mode"; 9980 9981 /** 9982 * Accessibility button mode value that specifying the accessibility service or feature to 9983 * be toggled via the button in the navigation bar. 9984 * 9985 * @hide 9986 */ 9987 public static final int ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR = 0x0; 9988 9989 /** 9990 * Accessibility button mode value that specifying the accessibility service or feature to 9991 * be toggled via the button floating on the display. 9992 * 9993 * @hide 9994 */ 9995 public static final int ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU = 0x1; 9996 9997 /** 9998 * The size of the accessibility floating menu. 9999 * <ul> 10000 * <li> 0 = small size 10001 * <li> 1 = large size 10002 * </ul> 10003 * 10004 * @hide 10005 */ 10006 public static final String ACCESSIBILITY_FLOATING_MENU_SIZE = 10007 "accessibility_floating_menu_size"; 10008 10009 /** 10010 * The icon type of the accessibility floating menu. 10011 * <ul> 10012 * <li> 0 = full circle type 10013 * <li> 1 = half circle type 10014 * </ul> 10015 * 10016 * @hide 10017 */ 10018 public static final String ACCESSIBILITY_FLOATING_MENU_ICON_TYPE = 10019 "accessibility_floating_menu_icon_type"; 10020 10021 /** 10022 * Whether the fade effect for the accessibility floating menu is enabled. 10023 * 10024 * @hide 10025 */ 10026 public static final String ACCESSIBILITY_FLOATING_MENU_FADE_ENABLED = 10027 "accessibility_floating_menu_fade_enabled"; 10028 10029 /** 10030 * The opacity value for the accessibility floating menu fade out effect, from 0.0 10031 * (transparent) to 1.0 (opaque). 10032 * 10033 * @hide 10034 */ 10035 public static final String ACCESSIBILITY_FLOATING_MENU_OPACITY = 10036 "accessibility_floating_menu_opacity"; 10037 10038 /** 10039 * Prompts the user to the Accessibility button is replaced with the floating menu. 10040 * <ul> 10041 * <li> 0 = disabled </li> 10042 * <li> 1 = enabled </li> 10043 * </ul> 10044 * 10045 * @hide 10046 */ 10047 public static final String ACCESSIBILITY_FLOATING_MENU_MIGRATION_TOOLTIP_PROMPT = 10048 "accessibility_floating_menu_migration_tooltip_prompt"; 10049 10050 /** 10051 * Whether the Adaptive connectivity option is enabled. 10052 * 10053 * @hide 10054 */ 10055 public static final String ADAPTIVE_CONNECTIVITY_ENABLED = "adaptive_connectivity_enabled"; 10056 10057 /** 10058 * Keys we no longer back up under the current schema, but want to continue to 10059 * process when restoring historical backup datasets. 10060 * 10061 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, 10062 * otherwise they won't be restored. 10063 * 10064 * @hide 10065 */ 10066 @Readable 10067 public static final String[] LEGACY_RESTORE_SETTINGS = { 10068 ENABLED_NOTIFICATION_LISTENERS, 10069 ENABLED_NOTIFICATION_ASSISTANT, 10070 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES 10071 }; 10072 10073 /** 10074 * How long Assistant handles have enabled in milliseconds. 10075 * 10076 * @hide 10077 */ 10078 public static final String ASSIST_HANDLES_LEARNING_TIME_ELAPSED_MILLIS = 10079 "reminder_exp_learning_time_elapsed"; 10080 10081 /** 10082 * How many times the Assistant has been triggered using the touch gesture. 10083 * 10084 * @hide 10085 */ 10086 public static final String ASSIST_HANDLES_LEARNING_EVENT_COUNT = 10087 "reminder_exp_learning_event_count"; 10088 10089 /** 10090 * Whether to show clipboard access notifications. 10091 * 10092 * @hide 10093 */ 10094 public static final String CLIPBOARD_SHOW_ACCESS_NOTIFICATIONS = 10095 "clipboard_show_access_notifications"; 10096 10097 /** 10098 * If nonzero, nas has not been updated to reflect new changes. 10099 * @hide 10100 */ 10101 @Readable 10102 public static final String NAS_SETTINGS_UPDATED = "nas_settings_updated"; 10103 10104 /** 10105 * Control whether Game Dashboard shortcut is always on for all games. 10106 * @hide 10107 */ 10108 @Readable 10109 public static final String GAME_DASHBOARD_ALWAYS_ON = "game_dashboard_always_on"; 10110 10111 /** 10112 * These entries are considered common between the personal and the managed profile, 10113 * since the managed profile doesn't get to change them. 10114 */ 10115 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); 10116 10117 static { 10118 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED); 10119 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION); 10120 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS); 10121 CLONE_TO_MANAGED_PROFILE.add(CONTENT_CAPTURE_ENABLED); 10122 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES); 10123 CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER); 10124 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE); 10125 CLONE_TO_MANAGED_PROFILE.add(SHOW_IME_WITH_HARD_KEYBOARD); 10126 CLONE_TO_MANAGED_PROFILE.add(NOTIFICATION_BUBBLES); 10127 } 10128 10129 /** @hide */ getCloneToManagedProfileSettings(Set<String> outKeySet)10130 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { 10131 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); 10132 } 10133 10134 /** 10135 * Secure settings which can be accessed by instant apps. 10136 * @hide 10137 */ 10138 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); 10139 static { 10140 INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES); 10141 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD); 10142 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED); 10143 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED); 10144 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET); 10145 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE); 10146 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR); 10147 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE); 10148 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR); 10149 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR); 10150 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE); 10151 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE); 10152 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR); 10153 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED); 10154 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER); 10155 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY); 10156 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED); 10157 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON); 10158 10159 INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD); 10160 INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS); 10161 10162 INSTANT_APP_SETTINGS.add(ANDROID_ID); 10163 10164 INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION); 10165 } 10166 10167 /** 10168 * Helper method for determining if a location provider is enabled. 10169 * 10170 * @param cr the content resolver to use 10171 * @param provider the location provider to query 10172 * @return true if the provider is enabled 10173 * 10174 * @deprecated use {@link LocationManager#isProviderEnabled(String)} 10175 */ 10176 @Deprecated isLocationProviderEnabled(ContentResolver cr, String provider)10177 public static boolean isLocationProviderEnabled(ContentResolver cr, String provider) { 10178 IBinder binder = ServiceManager.getService(Context.LOCATION_SERVICE); 10179 ILocationManager lm = Objects.requireNonNull(ILocationManager.Stub.asInterface(binder)); 10180 try { 10181 return lm.isProviderEnabledForUser(provider, cr.getUserId()); 10182 } catch (RemoteException e) { 10183 throw e.rethrowFromSystemServer(); 10184 } 10185 } 10186 10187 /** 10188 * Thread-safe method for enabling or disabling a single location provider. This will have 10189 * no effect on Android Q and above. 10190 * @param cr the content resolver to use 10191 * @param provider the location provider to enable or disable 10192 * @param enabled true if the provider should be enabled 10193 * @deprecated This API is deprecated 10194 */ 10195 @Deprecated setLocationProviderEnabled(ContentResolver cr, String provider, boolean enabled)10196 public static void setLocationProviderEnabled(ContentResolver cr, 10197 String provider, boolean enabled) { 10198 } 10199 } 10200 10201 /** 10202 * Global system settings, containing preferences that always apply identically 10203 * to all defined users. Applications can read these but are not allowed to write; 10204 * like the "Secure" settings, these are for preferences that the user must 10205 * explicitly modify through the system UI or specialized APIs for those values. 10206 */ 10207 public static final class Global extends NameValueTable { 10208 // NOTE: If you add new settings here, be sure to add them to 10209 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked. 10210 10211 /** 10212 * The content:// style URL for global secure settings items. Not public. 10213 */ 10214 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global"); 10215 10216 /** 10217 * Whether the notification bubbles are globally enabled 10218 * The value is boolean (1 or 0). 10219 * @hide 10220 * @deprecated moved to secure settings. 10221 */ 10222 @Deprecated 10223 @TestApi 10224 @Readable 10225 public static final String NOTIFICATION_BUBBLES = "notification_bubbles"; 10226 10227 /** 10228 * Whether users are allowed to add more users or guest from lockscreen. 10229 * <p> 10230 * Type: int 10231 * @hide 10232 */ 10233 @Readable 10234 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked"; 10235 10236 /** 10237 * Whether applying ramping ringer on incoming phone call ringtone. 10238 * <p>1 = apply ramping ringer 10239 * <p>0 = do not apply ramping ringer 10240 */ 10241 @Readable 10242 public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer"; 10243 10244 /** 10245 * Setting whether the global gesture for enabling accessibility is enabled. 10246 * If this gesture is enabled the user will be able to perfrom it to enable 10247 * the accessibility state without visiting the settings app. 10248 * 10249 * @hide 10250 * No longer used. Should be removed once all dependencies have been updated. 10251 */ 10252 @UnsupportedAppUsage 10253 @Readable 10254 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED = 10255 "enable_accessibility_global_gesture_enabled"; 10256 10257 /** 10258 * Whether Airplane Mode is on. 10259 */ 10260 @Readable 10261 public static final String AIRPLANE_MODE_ON = "airplane_mode_on"; 10262 10263 /** 10264 * Whether Theater Mode is on. 10265 * {@hide} 10266 */ 10267 @SystemApi 10268 @Readable 10269 public static final String THEATER_MODE_ON = "theater_mode_on"; 10270 10271 /** 10272 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio. 10273 */ 10274 @Readable 10275 public static final String RADIO_BLUETOOTH = "bluetooth"; 10276 10277 /** 10278 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio. 10279 */ 10280 @Readable 10281 public static final String RADIO_WIFI = "wifi"; 10282 10283 /** 10284 * {@hide} 10285 */ 10286 @Readable 10287 public static final String RADIO_WIMAX = "wimax"; 10288 /** 10289 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio. 10290 */ 10291 @Readable 10292 public static final String RADIO_CELL = "cell"; 10293 10294 /** 10295 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio. 10296 */ 10297 @Readable 10298 public static final String RADIO_NFC = "nfc"; 10299 10300 /** 10301 * A comma separated list of radios that need to be disabled when airplane mode 10302 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are 10303 * included in the comma separated list. 10304 */ 10305 @Readable 10306 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios"; 10307 10308 /** 10309 * A comma separated list of radios that should to be disabled when airplane mode 10310 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is 10311 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi 10312 * will be turned off when entering airplane mode, but the user will be able to reenable 10313 * Wifi in the Settings app. 10314 * @hide 10315 */ 10316 @SystemApi 10317 @Readable 10318 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios"; 10319 10320 /** 10321 * An integer representing the Bluetooth Class of Device (CoD). 10322 * 10323 * @hide 10324 */ 10325 @Readable 10326 public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device"; 10327 10328 /** 10329 * A Long representing a bitmap of profiles that should be disabled when bluetooth starts. 10330 * See {@link android.bluetooth.BluetoothProfile}. 10331 * {@hide} 10332 */ 10333 @Readable 10334 public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles"; 10335 10336 /** 10337 * A semi-colon separated list of Bluetooth interoperability workarounds. 10338 * Each entry is a partial Bluetooth device address string and an integer representing 10339 * the feature to be disabled, separated by a comma. The integer must correspond 10340 * to a interoperability feature as defined in "interop.h" in /system/bt. 10341 * <p> 10342 * Example: <br/> 10343 * "00:11:22,0;01:02:03:04,2" 10344 * @hide 10345 */ 10346 @Readable 10347 public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list"; 10348 10349 /** 10350 * The policy for deciding when Wi-Fi should go to sleep (which will in 10351 * turn switch to using the mobile data as an Internet connection). 10352 * <p> 10353 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT}, 10354 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or 10355 * {@link #WIFI_SLEEP_POLICY_NEVER}. 10356 * @deprecated This is no longer used or set by the platform. 10357 */ 10358 @Deprecated 10359 @Readable 10360 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy"; 10361 10362 /** 10363 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep 10364 * policy, which is to sleep shortly after the turning off 10365 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting. 10366 * @deprecated This is no longer used by the platform. 10367 */ 10368 @Deprecated 10369 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0; 10370 10371 /** 10372 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when 10373 * the device is on battery, and never go to sleep when the device is 10374 * plugged in. 10375 * @deprecated This is no longer used by the platform. 10376 */ 10377 @Deprecated 10378 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; 10379 10380 /** 10381 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep. 10382 * @deprecated This is no longer used by the platform. 10383 */ 10384 @Deprecated 10385 public static final int WIFI_SLEEP_POLICY_NEVER = 2; 10386 10387 /** 10388 * Value to specify if the device's UTC system clock should be set automatically, e.g. using 10389 * telephony signals like NITZ, or other sources like GNSS or NTP. 1=yes, 0=no (manual) 10390 */ 10391 @Readable 10392 public static final String AUTO_TIME = "auto_time"; 10393 10394 /** 10395 * Value to specify if the device's time zone system property should be set automatically, 10396 * e.g. using telephony signals like MCC and NITZ, or other mechanisms like the location. 10397 * 1=yes, 0=no (manual). 10398 */ 10399 @Readable 10400 public static final String AUTO_TIME_ZONE = "auto_time_zone"; 10401 10402 /** 10403 * URI for the car dock "in" event sound. 10404 * @hide 10405 */ 10406 @Readable 10407 public static final String CAR_DOCK_SOUND = "car_dock_sound"; 10408 10409 /** 10410 * URI for the car dock "out" event sound. 10411 * @hide 10412 */ 10413 @Readable 10414 public static final String CAR_UNDOCK_SOUND = "car_undock_sound"; 10415 10416 /** 10417 * URI for the desk dock "in" event sound. 10418 * @hide 10419 */ 10420 @Readable 10421 public static final String DESK_DOCK_SOUND = "desk_dock_sound"; 10422 10423 /** 10424 * URI for the desk dock "out" event sound. 10425 * @hide 10426 */ 10427 @Readable 10428 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound"; 10429 10430 /** 10431 * Whether to play a sound for dock events. 10432 * @hide 10433 */ 10434 @Readable 10435 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled"; 10436 10437 /** 10438 * Whether to play a sound for dock events, only when an accessibility service is on. 10439 * @hide 10440 */ 10441 @Readable 10442 public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility"; 10443 10444 /** 10445 * URI for the "device locked" (keyguard shown) sound. 10446 * @hide 10447 */ 10448 @Readable 10449 public static final String LOCK_SOUND = "lock_sound"; 10450 10451 /** 10452 * URI for the "device unlocked" sound. 10453 * @hide 10454 */ 10455 @Readable 10456 public static final String UNLOCK_SOUND = "unlock_sound"; 10457 10458 /** 10459 * URI for the "device is trusted" sound, which is played when the device enters the trusted 10460 * state without unlocking. 10461 * @hide 10462 */ 10463 @Readable 10464 public static final String TRUSTED_SOUND = "trusted_sound"; 10465 10466 /** 10467 * URI for the low battery sound file. 10468 * @hide 10469 */ 10470 @Readable 10471 public static final String LOW_BATTERY_SOUND = "low_battery_sound"; 10472 10473 /** 10474 * Whether to play a sound for low-battery alerts. 10475 * @hide 10476 */ 10477 @Readable 10478 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled"; 10479 10480 /** 10481 * URI for the "wireless charging started" sound. 10482 * @hide 10483 */ 10484 @Readable 10485 public static final String WIRELESS_CHARGING_STARTED_SOUND = 10486 "wireless_charging_started_sound"; 10487 10488 /** 10489 * URI for "wired charging started" sound. 10490 * @hide 10491 */ 10492 @Readable 10493 public static final String CHARGING_STARTED_SOUND = "charging_started_sound"; 10494 10495 /** 10496 * Whether to play a sound for charging events. 10497 * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_SOUNDS_ENABLED} instead 10498 * @hide 10499 */ 10500 @Deprecated 10501 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled"; 10502 10503 /** 10504 * Whether to vibrate for wireless charging events. 10505 * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_VIBRATION_ENABLED} 10506 * @hide 10507 */ 10508 @Deprecated 10509 public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled"; 10510 10511 /** 10512 * Whether we keep the device on while the device is plugged in. 10513 * Supported values are: 10514 * <ul> 10515 * <li>{@code 0} to never stay on while plugged in</li> 10516 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li> 10517 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li> 10518 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li> 10519 * </ul> 10520 * These values can be OR-ed together. 10521 */ 10522 @Readable 10523 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in"; 10524 10525 /** 10526 * When the user has enable the option to have a "bug report" command 10527 * in the power menu. 10528 * @hide 10529 */ 10530 @Readable 10531 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; 10532 10533 /** 10534 * The package name for the custom bugreport handler app. This app must be whitelisted. 10535 * This is currently used only by Power Menu short press. 10536 * 10537 * @hide 10538 */ 10539 @Readable 10540 public static final String CUSTOM_BUGREPORT_HANDLER_APP = "custom_bugreport_handler_app"; 10541 10542 /** 10543 * The user id for the custom bugreport handler app. This is currently used only by Power 10544 * Menu short press. 10545 * 10546 * @hide 10547 */ 10548 @Readable 10549 public static final String CUSTOM_BUGREPORT_HANDLER_USER = "custom_bugreport_handler_user"; 10550 10551 /** 10552 * Whether ADB over USB is enabled. 10553 */ 10554 @Readable 10555 public static final String ADB_ENABLED = "adb_enabled"; 10556 10557 /** 10558 * Whether ADB over Wifi is enabled. 10559 * @hide 10560 */ 10561 @Readable 10562 public static final String ADB_WIFI_ENABLED = "adb_wifi_enabled"; 10563 10564 /** 10565 * Whether Views are allowed to save their attribute data. 10566 * @hide 10567 */ 10568 @Readable 10569 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes"; 10570 10571 /** 10572 * Which application package is allowed to save View attribute data. 10573 * @hide 10574 */ 10575 @Readable 10576 public static final String DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE = 10577 "debug_view_attributes_application_package"; 10578 10579 /** 10580 * Whether assisted GPS should be enabled or not. 10581 * @hide 10582 */ 10583 @Readable 10584 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled"; 10585 10586 /** 10587 * Whether bluetooth is enabled/disabled 10588 * 0=disabled. 1=enabled. 10589 */ 10590 @Readable 10591 public static final String BLUETOOTH_ON = "bluetooth_on"; 10592 10593 /** 10594 * CDMA Cell Broadcast SMS 10595 * 0 = CDMA Cell Broadcast SMS disabled 10596 * 1 = CDMA Cell Broadcast SMS enabled 10597 * @hide 10598 */ 10599 @Readable 10600 public static final String CDMA_CELL_BROADCAST_SMS = 10601 "cdma_cell_broadcast_sms"; 10602 10603 /** 10604 * The CDMA roaming mode 0 = Home Networks, CDMA default 10605 * 1 = Roaming on Affiliated networks 10606 * 2 = Roaming on any networks 10607 * @hide 10608 */ 10609 @Readable 10610 public static final String CDMA_ROAMING_MODE = "roaming_settings"; 10611 10612 /** 10613 * The CDMA subscription mode 0 = RUIM/SIM (default) 10614 * 1 = NV 10615 * @hide 10616 */ 10617 @Readable 10618 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode"; 10619 10620 /** 10621 * The default value for whether background data is enabled or not. 10622 * 10623 * Used by {@code NetworkPolicyManagerService}. 10624 * 10625 * @hide 10626 */ 10627 @Readable 10628 public static final String DEFAULT_RESTRICT_BACKGROUND_DATA = 10629 "default_restrict_background_data"; 10630 10631 /** Inactivity timeout to track mobile data activity. 10632 * 10633 * If set to a positive integer, it indicates the inactivity timeout value in seconds to 10634 * infer the data activity of mobile network. After a period of no activity on mobile 10635 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE} 10636 * intent is fired to indicate a transition of network status from "active" to "idle". Any 10637 * subsequent activity on mobile networks triggers the firing of {@code 10638 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active". 10639 * 10640 * Network activity refers to transmitting or receiving data on the network interfaces. 10641 * 10642 * Tracking is disabled if set to zero or negative value. 10643 * 10644 * @hide 10645 */ 10646 @Readable 10647 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile"; 10648 10649 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE} 10650 * but for Wifi network. 10651 * @hide 10652 */ 10653 @Readable 10654 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi"; 10655 10656 /** 10657 * Whether or not data roaming is enabled. (0 = false, 1 = true) 10658 */ 10659 @Readable 10660 public static final String DATA_ROAMING = "data_roaming"; 10661 10662 /** 10663 * The value passed to a Mobile DataConnection via bringUp which defines the 10664 * number of retries to perform when setting up the initial connection. The default 10665 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1. 10666 * @hide 10667 */ 10668 @Readable 10669 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry"; 10670 10671 /** 10672 * Whether any package can be on external storage. When this is true, any 10673 * package, regardless of manifest values, is a candidate for installing 10674 * or moving onto external storage. (0 = false, 1 = true) 10675 * @hide 10676 */ 10677 @Readable 10678 public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external"; 10679 10680 /** 10681 * The default SM-DP+ configured for this device. 10682 * 10683 * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to 10684 * download profiles. If this value is set, the LPA will query this server for any profiles 10685 * available to this device. If any are available, they may be downloaded during device 10686 * provisioning or in settings without needing the user to enter an activation code. 10687 * 10688 * @see android.service.euicc.EuiccService 10689 * @hide 10690 */ 10691 @SystemApi 10692 @Readable 10693 public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus"; 10694 10695 /** 10696 * Whether any profile has ever been downloaded onto a eUICC on the device. 10697 * 10698 * <p>Used to hide eUICC UI from users who have never made use of it and would only be 10699 * confused by seeing references to it in settings. 10700 * (0 = false, 1 = true) 10701 * @hide 10702 */ 10703 @SystemApi 10704 @Readable 10705 public static final String EUICC_PROVISIONED = "euicc_provisioned"; 10706 10707 /** 10708 * List of ISO country codes in which eUICC UI is shown. Country codes should be separated 10709 * by comma. 10710 * 10711 * Note: if {@link #EUICC_SUPPORTED_COUNTRIES} is empty, then {@link 10712 * #EUICC_UNSUPPORTED_COUNTRIES} is used. 10713 * 10714 * <p>Used to hide eUICC UI from users who are currently in countries where no carriers 10715 * support eUICC. 10716 * 10717 * @hide 10718 */ 10719 @SystemApi 10720 @Readable 10721 public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries"; 10722 10723 /** 10724 * List of ISO country codes in which eUICC UI is not shown. Country codes should be 10725 * separated by comma. 10726 * 10727 * Note: if {@link #EUICC_SUPPORTED_COUNTRIES} is empty, then {@link 10728 * #EUICC_UNSUPPORTED_COUNTRIES} is used. 10729 * 10730 * <p>Used to hide eUICC UI from users who are currently in countries where no carriers 10731 * support eUICC. 10732 * 10733 * @hide 10734 */ 10735 @SystemApi 10736 @Readable 10737 public static final String EUICC_UNSUPPORTED_COUNTRIES = "euicc_unsupported_countries"; 10738 10739 /** 10740 * Whether any activity can be resized. When this is true, any 10741 * activity, regardless of manifest values, can be resized for multi-window. 10742 * (0 = false, 1 = true) 10743 * @hide 10744 */ 10745 @Readable 10746 public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES 10747 = "force_resizable_activities"; 10748 10749 /** 10750 * Whether to enable experimental freeform support for windows. 10751 * @hide 10752 */ 10753 @Readable 10754 public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT 10755 = "enable_freeform_support"; 10756 10757 /** 10758 * Whether to enable experimental desktop mode on secondary displays. 10759 * @hide 10760 */ 10761 @Readable 10762 public static final String DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS = 10763 "force_desktop_mode_on_external_displays"; 10764 10765 /** 10766 * Whether to allow non-resizable apps to be shown in multi-window. The app will be 10767 * letterboxed if the request orientation is not met, and will be shown in size-compat 10768 * mode if the container size has changed. 10769 * @hide 10770 */ 10771 @TestApi 10772 @Readable 10773 @SuppressLint("NoSettingsProvider") 10774 public static final String DEVELOPMENT_ENABLE_NON_RESIZABLE_MULTI_WINDOW = 10775 "enable_non_resizable_multi_window"; 10776 10777 /** 10778 * If true, shadows drawn around the window will be rendered by the system compositor. If 10779 * false, shadows will be drawn by the client by setting an elevation on the root view and 10780 * the contents will be inset by the surface insets. 10781 * (0 = false, 1 = true) 10782 * @hide 10783 */ 10784 @Readable 10785 public static final String DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR = 10786 "render_shadows_in_compositor"; 10787 10788 /** 10789 * If true, submit buffers using blast in ViewRootImpl. 10790 * (0 = false, 1 = true) 10791 * @hide 10792 */ 10793 @Readable 10794 public static final String DEVELOPMENT_USE_BLAST_ADAPTER_VR = 10795 "use_blast_adapter_vr"; 10796 10797 /** 10798 * If true, submit buffers using blast in SurfaceView. 10799 * (0 = false, 1 = true) 10800 * @hide 10801 */ 10802 @Readable 10803 public static final String DEVELOPMENT_USE_BLAST_ADAPTER_SV = 10804 "use_blast_adapter_sv"; 10805 10806 /** 10807 * Path to the WindowManager display settings file. If unset, the default file path will 10808 * be used. 10809 * 10810 * @hide 10811 */ 10812 public static final String DEVELOPMENT_WM_DISPLAY_SETTINGS_PATH = 10813 "wm_display_settings_path"; 10814 10815 /** 10816 * Whether user has enabled development settings. 10817 */ 10818 @Readable 10819 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled"; 10820 10821 /** 10822 * Whether the device has been provisioned (0 = false, 1 = true). 10823 * <p>On a multiuser device with a separate system user, the screen may be locked 10824 * as soon as this is set to true and further activities cannot be launched on the 10825 * system user unless they are marked to show over keyguard. 10826 */ 10827 @Readable 10828 public static final String DEVICE_PROVISIONED = "device_provisioned"; 10829 10830 /** 10831 * Indicates whether mobile data should be allowed while the device is being provisioned. 10832 * This allows the provisioning process to turn off mobile data before the user 10833 * has an opportunity to set things up, preventing other processes from burning 10834 * precious bytes before wifi is setup. 10835 * <p> 10836 * Type: int (0 for false, 1 for true) 10837 * 10838 * @hide 10839 */ 10840 @SystemApi 10841 @Readable 10842 public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED = 10843 "device_provisioning_mobile_data"; 10844 10845 /** 10846 * The saved value for WindowManagerService.setForcedDisplaySize(). 10847 * Two integers separated by a comma. If unset, then use the real display size. 10848 * @hide 10849 */ 10850 @Readable 10851 public static final String DISPLAY_SIZE_FORCED = "display_size_forced"; 10852 10853 /** 10854 * The saved value for WindowManagerService.setForcedDisplayScalingMode(). 10855 * 0 or unset if scaling is automatic, 1 if scaling is disabled. 10856 * @hide 10857 */ 10858 @Readable 10859 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force"; 10860 10861 /** 10862 * The maximum size, in bytes, of a download that the download manager will transfer over 10863 * a non-wifi connection. 10864 * @hide 10865 */ 10866 @Readable 10867 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE = 10868 "download_manager_max_bytes_over_mobile"; 10869 10870 /** 10871 * The recommended maximum size, in bytes, of a download that the download manager should 10872 * transfer over a non-wifi connection. Over this size, the use will be warned, but will 10873 * have the option to start the download over the mobile connection anyway. 10874 * @hide 10875 */ 10876 @Readable 10877 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE = 10878 "download_manager_recommended_max_bytes_over_mobile"; 10879 10880 /** 10881 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead 10882 */ 10883 @Deprecated 10884 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; 10885 10886 /** 10887 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be 10888 * sent or processed. (0 = false, 1 = true) 10889 * @hide 10890 */ 10891 @Readable 10892 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled"; 10893 10894 /** 10895 * Controls whether volume control commands via HDMI CEC are enabled. (0 = false, 1 = 10896 * true). 10897 * 10898 * <p>Effects on different device types: 10899 * <table> 10900 * <tr><th>HDMI CEC device type</th><th>0: disabled</th><th>1: enabled</th></tr> 10901 * <tr> 10902 * <td>TV (type: 0)</td> 10903 * <td>Per CEC specification.</td> 10904 * <td>TV changes system volume. TV no longer reacts to incoming volume changes 10905 * via {@code <User Control Pressed>}. TV no longer handles {@code <Report Audio 10906 * Status>}.</td> 10907 * </tr> 10908 * <tr> 10909 * <td>Playback device (type: 4)</td> 10910 * <td>Device sends volume commands to TV/Audio system via {@code <User Control 10911 * Pressed>}</td> 10912 * <td>Device does not send volume commands via {@code <User Control Pressed>}.</td> 10913 * </tr> 10914 * <tr> 10915 * <td>Audio device (type: 5)</td> 10916 * <td>Full "System Audio Control" capabilities.</td> 10917 * <td>Audio device no longer reacts to incoming {@code <User Control Pressed>} 10918 * volume commands. Audio device no longer reports volume changes via {@code 10919 * <Report Audio Status>}.</td> 10920 * </tr> 10921 * </table> 10922 * 10923 * <p> Due to the resulting behavior, usage on TV and Audio devices is discouraged. 10924 * 10925 * @hide 10926 * @see android.hardware.hdmi.HdmiControlManager#setHdmiCecVolumeControlEnabled(boolean) 10927 */ 10928 @Readable 10929 public static final String HDMI_CONTROL_VOLUME_CONTROL_ENABLED = 10930 "hdmi_control_volume_control_enabled"; 10931 10932 /** 10933 * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on 10934 * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will 10935 * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be 10936 * activated. 10937 * @hide 10938 */ 10939 @Readable 10940 public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED = 10941 "hdmi_system_audio_control_enabled"; 10942 10943 /** 10944 * Whether HDMI Routing Control feature is enabled. If enabled, the switch device will 10945 * route to the correct input source on receiving Routing Control related messages. If 10946 * disabled, you can only switch the input via controls on this device. 10947 * @hide 10948 */ 10949 @Readable 10950 public static final String HDMI_CEC_SWITCH_ENABLED = 10951 "hdmi_cec_switch_enabled"; 10952 10953 /** 10954 * Whether TV will automatically turn on upon reception of the CEC command 10955 * <Text View On> or <Image View On>. (0 = false, 1 = true) 10956 * 10957 * @hide 10958 */ 10959 @Readable 10960 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED = 10961 "hdmi_control_auto_wakeup_enabled"; 10962 10963 /** 10964 * Whether TV will also turn off other CEC devices when it goes to standby mode. 10965 * (0 = false, 1 = true) 10966 * 10967 * @hide 10968 */ 10969 @Readable 10970 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED = 10971 "hdmi_control_auto_device_off_enabled"; 10972 10973 /** 10974 * Property to decide which devices the playback device can send a <Standby> message to 10975 * upon going to sleep. It additionally controls whether a playback device attempts to turn 10976 * on the connected Audio system when waking up. Supported values are: 10977 * <ul> 10978 * <li>{@link HdmiControlManager#POWER_CONTROL_MODE_TV} Upon going to sleep, device 10979 * sends {@code <Standby>} to TV only. Upon waking up, device does not turn on the Audio 10980 * system via {@code <System Audio Mode Request>}.</li> 10981 * <li>{@link HdmiControlManager#POWER_CONTROL_MODE_BROADCAST} Upon going to sleep, 10982 * device sends {@code <Standby>} to all devices in the network. Upon waking up, device 10983 * attempts to turn on the Audio system via {@code <System Audio Mode Request>}.</li> 10984 * <li>{@link HdmiControlManager#POWER_CONTROL_MODE_NONE} Upon going to sleep, device 10985 * does not send any {@code <Standby>} message. Upon waking up, device does not turn on the 10986 * Audio system via {@code <System Audio Mode Request>}.</li> 10987 * </ul> 10988 * 10989 * @hide 10990 */ 10991 public static final String HDMI_CONTROL_SEND_STANDBY_ON_SLEEP = 10992 "hdmi_control_send_standby_on_sleep"; 10993 10994 /** 10995 * Whether or not media is shown automatically when bypassing as a heads up. 10996 * @hide 10997 */ 10998 @Readable 10999 public static final String SHOW_MEDIA_ON_QUICK_SETTINGS = 11000 "qs_media_controls"; 11001 11002 /** 11003 * The interval in milliseconds at which location requests will be throttled when they are 11004 * coming from the background. 11005 * 11006 * @hide 11007 */ 11008 @Readable 11009 public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS = 11010 "location_background_throttle_interval_ms"; 11011 11012 /** 11013 * Most frequent location update interval in milliseconds that proximity alert is allowed 11014 * to request. 11015 * @hide 11016 */ 11017 @Readable 11018 public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS = 11019 "location_background_throttle_proximity_alert_interval_ms"; 11020 11021 /** 11022 * Packages that are whitelisted for background throttling (throttling will not be applied). 11023 * @hide 11024 */ 11025 @Readable 11026 public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST = 11027 "location_background_throttle_package_whitelist"; 11028 11029 /** 11030 * Packages that are whitelisted for ignoring location settings (may retrieve location even 11031 * when user location settings are off), for emergency purposes. 11032 * @deprecated No longer used from Android 12+ 11033 * @hide 11034 */ 11035 @TestApi 11036 @Readable 11037 @Deprecated 11038 public static final String LOCATION_IGNORE_SETTINGS_PACKAGE_WHITELIST = 11039 "location_ignore_settings_package_whitelist"; 11040 11041 /** 11042 * Whether to throttle location when the device is in doze and still. 11043 * @hide 11044 */ 11045 public static final String LOCATION_ENABLE_STATIONARY_THROTTLE = 11046 "location_enable_stationary_throttle"; 11047 11048 /** 11049 * Whether TV will switch to MHL port when a mobile device is plugged in. 11050 * (0 = false, 1 = true) 11051 * @hide 11052 */ 11053 @Readable 11054 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled"; 11055 11056 /** 11057 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true) 11058 * @hide 11059 */ 11060 @Readable 11061 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled"; 11062 11063 /** 11064 * Whether mobile data connections are allowed by the user. See 11065 * ConnectivityManager for more info. 11066 * @hide 11067 */ 11068 @UnsupportedAppUsage 11069 @Readable 11070 public static final String MOBILE_DATA = "mobile_data"; 11071 11072 /** 11073 * Whether the mobile data connection should remain active even when higher 11074 * priority networks like WiFi are active, to help make network switching faster. 11075 * 11076 * See ConnectivityService for more info. 11077 * 11078 * (0 = disabled, 1 = enabled) 11079 * @hide 11080 */ 11081 @Readable 11082 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on"; 11083 11084 /** 11085 * Whether the wifi data connection should remain active even when higher 11086 * priority networks like Ethernet are active, to keep both networks. 11087 * In the case where higher priority networks are connected, wifi will be 11088 * unused unless an application explicitly requests to use it. 11089 * 11090 * See ConnectivityService for more info. 11091 * 11092 * (0 = disabled, 1 = enabled) 11093 * @hide 11094 */ 11095 @Readable 11096 public static final String WIFI_ALWAYS_REQUESTED = "wifi_always_requested"; 11097 11098 /** 11099 * Size of the event buffer for IP connectivity metrics. 11100 * @hide 11101 */ 11102 @Readable 11103 public static final String CONNECTIVITY_METRICS_BUFFER_SIZE = 11104 "connectivity_metrics_buffer_size"; 11105 11106 /** {@hide} */ 11107 @Readable 11108 public static final String NETSTATS_ENABLED = "netstats_enabled"; 11109 /** {@hide} */ 11110 @Readable 11111 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval"; 11112 /** 11113 * @deprecated 11114 * {@hide} 11115 */ 11116 @Deprecated 11117 @Readable 11118 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age"; 11119 /** {@hide} */ 11120 @Readable 11121 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes"; 11122 /** {@hide} */ 11123 @Readable 11124 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled"; 11125 /** {@hide} */ 11126 @Readable 11127 public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled"; 11128 /** {@hide} */ 11129 @Readable 11130 public static final String NETSTATS_COMBINE_SUBTYPE_ENABLED = 11131 "netstats_combine_subtype_enabled"; 11132 11133 /** {@hide} */ 11134 @Readable 11135 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration"; 11136 /** {@hide} */ 11137 @Readable 11138 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes"; 11139 /** {@hide} */ 11140 @Readable 11141 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age"; 11142 /** {@hide} */ 11143 @Readable 11144 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age"; 11145 11146 /** {@hide} */ 11147 @Readable 11148 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration"; 11149 /** {@hide} */ 11150 @Readable 11151 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes"; 11152 /** {@hide} */ 11153 @Readable 11154 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age"; 11155 /** {@hide} */ 11156 @Readable 11157 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age"; 11158 11159 /** {@hide} */ 11160 @Readable 11161 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = 11162 "netstats_uid_tag_bucket_duration"; 11163 /** {@hide} */ 11164 @Readable 11165 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = 11166 "netstats_uid_tag_persist_bytes"; 11167 /** {@hide} */ 11168 @Readable 11169 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age"; 11170 /** {@hide} */ 11171 @Readable 11172 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age"; 11173 11174 /** {@hide} */ 11175 @Readable 11176 public static final String NETPOLICY_QUOTA_ENABLED = "netpolicy_quota_enabled"; 11177 /** {@hide} */ 11178 @Readable 11179 public static final String NETPOLICY_QUOTA_UNLIMITED = "netpolicy_quota_unlimited"; 11180 /** {@hide} */ 11181 @Readable 11182 public static final String NETPOLICY_QUOTA_LIMITED = "netpolicy_quota_limited"; 11183 /** {@hide} */ 11184 @Readable 11185 public static final String NETPOLICY_QUOTA_FRAC_JOBS = "netpolicy_quota_frac_jobs"; 11186 /** {@hide} */ 11187 @Readable 11188 public static final String NETPOLICY_QUOTA_FRAC_MULTIPATH = 11189 "netpolicy_quota_frac_multipath"; 11190 11191 /** {@hide} */ 11192 @Readable 11193 public static final String NETPOLICY_OVERRIDE_ENABLED = "netpolicy_override_enabled"; 11194 11195 /** 11196 * User preference for which network(s) should be used. Only the 11197 * connectivity service should touch this. 11198 */ 11199 @Readable 11200 public static final String NETWORK_PREFERENCE = "network_preference"; 11201 11202 /** 11203 * Which package name to use for network scoring. If null, or if the package is not a valid 11204 * scorer app, external network scores will neither be requested nor accepted. 11205 * @hide 11206 */ 11207 @Readable 11208 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 11209 public static final String NETWORK_SCORER_APP = "network_scorer_app"; 11210 11211 /** 11212 * Whether night display forced auto mode is available. 11213 * 0 = unavailable, 1 = available. 11214 * @hide 11215 */ 11216 @Readable 11217 public static final String NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE = 11218 "night_display_forced_auto_mode_available"; 11219 11220 /** 11221 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment 11222 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been 11223 * exceeded. 11224 * @hide 11225 */ 11226 @Readable 11227 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff"; 11228 11229 /** 11230 * The length of time in milli-seconds that automatic small adjustments to 11231 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded. 11232 * @hide 11233 */ 11234 @Readable 11235 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing"; 11236 11237 /** Preferred NTP server. {@hide} */ 11238 @Readable 11239 public static final String NTP_SERVER = "ntp_server"; 11240 /** Timeout in milliseconds to wait for NTP server. {@hide} */ 11241 @Readable 11242 public static final String NTP_TIMEOUT = "ntp_timeout"; 11243 11244 /** {@hide} */ 11245 @Readable 11246 public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval"; 11247 11248 /** 11249 * Whether or not Settings should enable psd API. 11250 * {@hide} 11251 */ 11252 @Readable 11253 public static final String SETTINGS_USE_PSD_API = "settings_use_psd_api"; 11254 11255 /** 11256 * Whether or not Settings should enable external provider API. 11257 * {@hide} 11258 */ 11259 @Readable 11260 public static final String SETTINGS_USE_EXTERNAL_PROVIDER_API = 11261 "settings_use_external_provider_api"; 11262 11263 /** 11264 * Sample validity in seconds to configure for the system DNS resolver. 11265 * {@hide} 11266 */ 11267 @Readable 11268 public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS = 11269 "dns_resolver_sample_validity_seconds"; 11270 11271 /** 11272 * Success threshold in percent for use with the system DNS resolver. 11273 * {@hide} 11274 */ 11275 @Readable 11276 public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT = 11277 "dns_resolver_success_threshold_percent"; 11278 11279 /** 11280 * Minimum number of samples needed for statistics to be considered meaningful in the 11281 * system DNS resolver. 11282 * {@hide} 11283 */ 11284 @Readable 11285 public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples"; 11286 11287 /** 11288 * Maximum number taken into account for statistics purposes in the system DNS resolver. 11289 * {@hide} 11290 */ 11291 @Readable 11292 public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples"; 11293 11294 /** 11295 * Whether to disable the automatic scheduling of system updates. 11296 * 1 = system updates won't be automatically scheduled (will always 11297 * present notification instead). 11298 * 0 = system updates will be automatically scheduled. (default) 11299 * @hide 11300 */ 11301 @SystemApi 11302 @Readable 11303 public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update"; 11304 11305 /** Timeout for package verification. 11306 * @hide */ 11307 @Readable 11308 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout"; 11309 11310 /** Timeout for app integrity verification. 11311 * @hide */ 11312 @Readable 11313 public static final String APP_INTEGRITY_VERIFICATION_TIMEOUT = 11314 "app_integrity_verification_timeout"; 11315 11316 /** Default response code for package verification. 11317 * @hide */ 11318 @Readable 11319 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response"; 11320 11321 /** 11322 * Show package verification setting in the Settings app. 11323 * 1 = show (default) 11324 * 0 = hide 11325 * @hide 11326 */ 11327 @Readable 11328 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible"; 11329 11330 /** 11331 * Run package verification on apps installed through ADB/ADT/USB 11332 * 1 = perform package verification on ADB installs (default) 11333 * 0 = bypass package verification on ADB installs 11334 * @hide 11335 */ 11336 @Readable 11337 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs"; 11338 11339 /** 11340 * Run integrity checks for integrity rule providers. 11341 * 0 = bypass integrity verification on installs from rule providers (default) 11342 * 1 = perform integrity verification on installs from rule providers 11343 * @hide 11344 */ 11345 @Readable 11346 public static final String INTEGRITY_CHECK_INCLUDES_RULE_PROVIDER = 11347 "verify_integrity_for_rule_provider"; 11348 11349 /** 11350 * Time since last fstrim (milliseconds) after which we force one to happen 11351 * during device startup. If unset, the default is 3 days. 11352 * @hide 11353 */ 11354 @Readable 11355 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval"; 11356 11357 /** 11358 * The interval in milliseconds at which to check packet counts on the 11359 * mobile data interface when screen is on, to detect possible data 11360 * connection problems. 11361 * @hide 11362 */ 11363 @Readable 11364 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS = 11365 "pdp_watchdog_poll_interval_ms"; 11366 11367 /** 11368 * The interval in milliseconds at which to check packet counts on the 11369 * mobile data interface when screen is off, to detect possible data 11370 * connection problems. 11371 * @hide 11372 */ 11373 @Readable 11374 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS = 11375 "pdp_watchdog_long_poll_interval_ms"; 11376 11377 /** 11378 * The interval in milliseconds at which to check packet counts on the 11379 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} 11380 * outgoing packets has been reached without incoming packets. 11381 * @hide 11382 */ 11383 @Readable 11384 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS = 11385 "pdp_watchdog_error_poll_interval_ms"; 11386 11387 /** 11388 * The number of outgoing packets sent without seeing an incoming packet 11389 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT} 11390 * device is logged to the event log 11391 * @hide 11392 */ 11393 @Readable 11394 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT = 11395 "pdp_watchdog_trigger_packet_count"; 11396 11397 /** 11398 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS}) 11399 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before 11400 * attempting data connection recovery. 11401 * @hide 11402 */ 11403 @Readable 11404 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT = 11405 "pdp_watchdog_error_poll_count"; 11406 11407 /** 11408 * The number of failed PDP reset attempts before moving to something more 11409 * drastic: re-registering to the network. 11410 * @hide 11411 */ 11412 @Readable 11413 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT = 11414 "pdp_watchdog_max_pdp_reset_fail_count"; 11415 11416 /** 11417 * URL to open browser on to allow user to manage a prepay account 11418 * @hide 11419 */ 11420 @Readable 11421 public static final String SETUP_PREPAID_DATA_SERVICE_URL = 11422 "setup_prepaid_data_service_url"; 11423 11424 /** 11425 * URL to attempt a GET on to see if this is a prepay device 11426 * @hide 11427 */ 11428 @Readable 11429 public static final String SETUP_PREPAID_DETECTION_TARGET_URL = 11430 "setup_prepaid_detection_target_url"; 11431 11432 /** 11433 * Host to check for a redirect to after an attempt to GET 11434 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there, 11435 * this is a prepaid device with zero balance.) 11436 * @hide 11437 */ 11438 @Readable 11439 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST = 11440 "setup_prepaid_detection_redir_host"; 11441 11442 /** 11443 * The interval in milliseconds at which to check the number of SMS sent out without asking 11444 * for use permit, to limit the un-authorized SMS usage. 11445 * 11446 * @hide 11447 */ 11448 @Readable 11449 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS = 11450 "sms_outgoing_check_interval_ms"; 11451 11452 /** 11453 * The number of outgoing SMS sent without asking for user permit (of {@link 11454 * #SMS_OUTGOING_CHECK_INTERVAL_MS} 11455 * 11456 * @hide 11457 */ 11458 @Readable 11459 public static final String SMS_OUTGOING_CHECK_MAX_COUNT = 11460 "sms_outgoing_check_max_count"; 11461 11462 /** 11463 * Used to disable SMS short code confirmation - defaults to true. 11464 * True indcates we will do the check, etc. Set to false to disable. 11465 * @see com.android.internal.telephony.SmsUsageMonitor 11466 * @hide 11467 */ 11468 @Readable 11469 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation"; 11470 11471 /** 11472 * Used to select which country we use to determine premium sms codes. 11473 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM, 11474 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK, 11475 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH. 11476 * @hide 11477 */ 11478 @Readable 11479 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule"; 11480 11481 /** 11482 * Used to select TCP's default initial receiver window size in segments - defaults to a 11483 * build config value. 11484 * @hide 11485 */ 11486 @Readable 11487 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd"; 11488 11489 /** 11490 * Used to disable Tethering on a device - defaults to true. 11491 * @hide 11492 */ 11493 @SystemApi 11494 @Readable 11495 public static final String TETHER_SUPPORTED = "tether_supported"; 11496 11497 /** 11498 * Used to require DUN APN on the device or not - defaults to a build config value 11499 * which defaults to false. 11500 * @hide 11501 */ 11502 @Readable 11503 public static final String TETHER_DUN_REQUIRED = "tether_dun_required"; 11504 11505 /** 11506 * Used to hold a gservices-provisioned apn value for DUN. If set, or the 11507 * corresponding build config values are set it will override the APN DB 11508 * values. 11509 * Consists of a comma separated list of strings: 11510 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type" 11511 * note that empty fields can be omitted: "name,apn,,,,,,,,,310,260,,DUN" 11512 * @hide 11513 */ 11514 @Readable 11515 public static final String TETHER_DUN_APN = "tether_dun_apn"; 11516 11517 /** 11518 * Used to disable trying to talk to any available tethering offload HAL. 11519 * 11520 * Integer values are interpreted as boolean, and the absence of an explicit setting 11521 * is interpreted as |false|. 11522 * @hide 11523 */ 11524 @SystemApi 11525 @Readable 11526 public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled"; 11527 11528 /** 11529 * Use the old dnsmasq DHCP server for tethering instead of the framework implementation. 11530 * 11531 * Integer values are interpreted as boolean, and the absence of an explicit setting 11532 * is interpreted as |false|. 11533 * @hide 11534 */ 11535 @Readable 11536 public static final String TETHER_ENABLE_LEGACY_DHCP_SERVER = 11537 "tether_enable_legacy_dhcp_server"; 11538 11539 /** 11540 * List of certificate (hex string representation of the application's certificate - SHA-1 11541 * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for 11542 * install when a sim card with matching UICC carrier privilege rules is inserted. The 11543 * certificate is used as a key, so the certificate encoding here must be the same as the 11544 * certificate encoding used on the SIM. 11545 * 11546 * The value is "cert1:package1;cert2:package2;..." 11547 * @hide 11548 */ 11549 @SystemApi 11550 @Readable 11551 public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist"; 11552 11553 /** 11554 * Map of package name to application names. The application names cannot and will not be 11555 * localized. App names may not contain colons or semicolons. 11556 * 11557 * The value is "packageName1:appName1;packageName2:appName2;..." 11558 * @hide 11559 */ 11560 @SystemApi 11561 @Readable 11562 public static final String CARRIER_APP_NAMES = "carrier_app_names"; 11563 11564 /** 11565 * USB Mass Storage Enabled 11566 */ 11567 @Readable 11568 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled"; 11569 11570 /** 11571 * If this setting is set (to anything), then all references 11572 * to Gmail on the device must change to Google Mail. 11573 */ 11574 @Readable 11575 public static final String USE_GOOGLE_MAIL = "use_google_mail"; 11576 11577 /** 11578 * Whether or not switching/creating users is enabled by user. 11579 * @hide 11580 */ 11581 @Readable 11582 public static final String USER_SWITCHER_ENABLED = "user_switcher_enabled"; 11583 11584 /** 11585 * Webview Data reduction proxy key. 11586 * @hide 11587 */ 11588 @Readable 11589 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY = 11590 "webview_data_reduction_proxy_key"; 11591 11592 /** 11593 * Name of the package used as WebView provider (if unset the provider is instead determined 11594 * by the system). 11595 * @hide 11596 */ 11597 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 11598 @Readable 11599 public static final String WEBVIEW_PROVIDER = "webview_provider"; 11600 11601 /** 11602 * Developer setting to enable WebView multiprocess rendering. 11603 * @hide 11604 */ 11605 @SystemApi 11606 @Readable 11607 public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess"; 11608 11609 /** 11610 * The maximum number of notifications shown in 24 hours when switching networks. 11611 * @hide 11612 */ 11613 @Readable 11614 public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT = 11615 "network_switch_notification_daily_limit"; 11616 11617 /** 11618 * The minimum time in milliseconds between notifications when switching networks. 11619 * @hide 11620 */ 11621 @Readable 11622 public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS = 11623 "network_switch_notification_rate_limit_millis"; 11624 11625 /** 11626 * Whether to automatically switch away from wifi networks that lose Internet access. 11627 * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always 11628 * avoids such networks. Valid values are: 11629 * 11630 * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013. 11631 * null: Ask the user whether to switch away from bad wifi. 11632 * 1: Avoid bad wifi. 11633 * 11634 * @hide 11635 */ 11636 @Readable 11637 public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi"; 11638 11639 /** 11640 * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be 11641 * overridden by the system based on device or application state. If null, the value 11642 * specified by config_networkMeteredMultipathPreference is used. 11643 * 11644 * @hide 11645 */ 11646 @Readable 11647 public static final String NETWORK_METERED_MULTIPATH_PREFERENCE = 11648 "network_metered_multipath_preference"; 11649 11650 /** 11651 * Default daily multipath budget used by ConnectivityManager.getMultipathPreference() 11652 * on metered networks. This default quota is only used if quota could not be determined 11653 * from data plan or data limit/warning set by the user. 11654 * @hide 11655 */ 11656 @Readable 11657 public static final String NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES = 11658 "network_default_daily_multipath_quota_bytes"; 11659 11660 /** 11661 * Network watchlist last report time. 11662 * @hide 11663 */ 11664 @Readable 11665 public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME = 11666 "network_watchlist_last_report_time"; 11667 11668 /** 11669 * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of 11670 * colon-delimited key-value pairs. The key is the badging enum value defined in 11671 * android.net.ScoredNetwork and the value is the minimum sustained network throughput in 11672 * kbps required for the badge. For example: "10:3000,20:5000,30:25000" 11673 * 11674 * @hide 11675 */ 11676 @SystemApi 11677 @Readable 11678 public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds"; 11679 11680 /** 11681 * Whether Wifi display is enabled/disabled 11682 * 0=disabled. 1=enabled. 11683 * @hide 11684 */ 11685 @Readable 11686 public static final String WIFI_DISPLAY_ON = "wifi_display_on"; 11687 11688 /** 11689 * Whether Wifi display certification mode is enabled/disabled 11690 * 0=disabled. 1=enabled. 11691 * @hide 11692 */ 11693 @Readable 11694 public static final String WIFI_DISPLAY_CERTIFICATION_ON = 11695 "wifi_display_certification_on"; 11696 11697 /** 11698 * WPS Configuration method used by Wifi display, this setting only 11699 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled). 11700 * 11701 * Possible values are: 11702 * 11703 * WpsInfo.INVALID: use default WPS method chosen by framework 11704 * WpsInfo.PBC : use Push button 11705 * WpsInfo.KEYPAD : use Keypad 11706 * WpsInfo.DISPLAY: use Display 11707 * @hide 11708 */ 11709 @Readable 11710 public static final String WIFI_DISPLAY_WPS_CONFIG = 11711 "wifi_display_wps_config"; 11712 11713 /** 11714 * Whether to notify the user of open networks. 11715 * <p> 11716 * If not connected and the scan results have an open network, we will 11717 * put this notification up. If we attempt to connect to a network or 11718 * the open network(s) disappear, we remove the notification. When we 11719 * show the notification, we will not show it again for 11720 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. 11721 * 11722 * @deprecated This feature is no longer controlled by this setting in 11723 * {@link android.os.Build.VERSION_CODES#O}. 11724 */ 11725 @Deprecated 11726 @Readable 11727 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 11728 "wifi_networks_available_notification_on"; 11729 11730 /** 11731 * {@hide} 11732 */ 11733 @Readable 11734 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON = 11735 "wimax_networks_available_notification_on"; 11736 11737 /** 11738 * Delay (in seconds) before repeating the Wi-Fi networks available notification. 11739 * Connecting to a network will reset the timer. 11740 * @deprecated This is no longer used or set by the platform. 11741 */ 11742 @Deprecated 11743 @Readable 11744 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 11745 "wifi_networks_available_repeat_delay"; 11746 11747 /** 11748 * 802.11 country code in ISO 3166 format 11749 * @hide 11750 */ 11751 @Readable 11752 public static final String WIFI_COUNTRY_CODE = "wifi_country_code"; 11753 11754 /** 11755 * The interval in milliseconds to issue wake up scans when wifi needs 11756 * to connect. This is necessary to connect to an access point when 11757 * device is on the move and the screen is off. 11758 * @hide 11759 */ 11760 @Readable 11761 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS = 11762 "wifi_framework_scan_interval_ms"; 11763 11764 /** 11765 * The interval in milliseconds after which Wi-Fi is considered idle. 11766 * When idle, it is possible for the device to be switched from Wi-Fi to 11767 * the mobile data network. 11768 * @hide 11769 */ 11770 @Readable 11771 public static final String WIFI_IDLE_MS = "wifi_idle_ms"; 11772 11773 /** 11774 * When the number of open networks exceeds this number, the 11775 * least-recently-used excess networks will be removed. 11776 * @deprecated This is no longer used or set by the platform. 11777 */ 11778 @Deprecated 11779 @Readable 11780 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept"; 11781 11782 /** 11783 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this. 11784 */ 11785 @Readable 11786 public static final String WIFI_ON = "wifi_on"; 11787 11788 /** 11789 * Setting to allow scans to be enabled even wifi is turned off for connectivity. 11790 * @hide 11791 * @deprecated To be removed. Use {@link WifiManager#setScanAlwaysAvailable(boolean)} for 11792 * setting the value and {@link WifiManager#isScanAlwaysAvailable()} for query. 11793 */ 11794 @Deprecated 11795 @Readable 11796 public static final String WIFI_SCAN_ALWAYS_AVAILABLE = 11797 "wifi_scan_always_enabled"; 11798 11799 /** 11800 * Indicate whether factory reset request is pending. 11801 * 11802 * Type: int (0 for false, 1 for true) 11803 * @hide 11804 * @deprecated To be removed. 11805 */ 11806 @Deprecated 11807 @Readable 11808 public static final String WIFI_P2P_PENDING_FACTORY_RESET = 11809 "wifi_p2p_pending_factory_reset"; 11810 11811 /** 11812 * Whether soft AP will shut down after a timeout period when no devices are connected. 11813 * 11814 * Type: int (0 for false, 1 for true) 11815 * @hide 11816 * @deprecated To be removed. Use {@link SoftApConfiguration.Builder# 11817 * setAutoShutdownEnabled(boolean)} for setting the value and {@link SoftApConfiguration# 11818 * isAutoShutdownEnabled()} for query. 11819 */ 11820 @Deprecated 11821 @Readable 11822 public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled"; 11823 11824 /** 11825 * Value to specify if Wi-Fi Wakeup feature is enabled. 11826 * 11827 * Type: int (0 for false, 1 for true) 11828 * @hide 11829 * @deprecated Use {@link WifiManager#setAutoWakeupEnabled(boolean)} for setting the value 11830 * and {@link WifiManager#isAutoWakeupEnabled()} for query. 11831 */ 11832 @Deprecated 11833 @SystemApi 11834 @Readable 11835 public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled"; 11836 11837 /** 11838 * Value to specify if wifi settings migration is complete or not. 11839 * Note: This should only be used from within {@link android.net.wifi.WifiMigration} class. 11840 * 11841 * Type: int (0 for false, 1 for true) 11842 * @hide 11843 */ 11844 @Readable 11845 public static final String WIFI_MIGRATION_COMPLETED = "wifi_migration_completed"; 11846 11847 /** 11848 * Value to specify whether network quality scores and badging should be shown in the UI. 11849 * 11850 * Type: int (0 for false, 1 for true) 11851 * @hide 11852 */ 11853 @Readable 11854 public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled"; 11855 11856 /** 11857 * Value to specify how long in milliseconds to retain seen score cache curves to be used 11858 * when generating SSID only bases score curves. 11859 * 11860 * Type: long 11861 * @hide 11862 */ 11863 @Readable 11864 public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS = 11865 "speed_label_cache_eviction_age_millis"; 11866 11867 /** 11868 * Value to specify if network recommendations from 11869 * {@link com.android.server.NetworkScoreService} are enabled. 11870 * 11871 * Type: int 11872 * Valid values: 11873 * -1 = Forced off 11874 * 0 = Disabled 11875 * 1 = Enabled 11876 * 11877 * Most readers of this setting should simply check if value == 1 to determine the 11878 * enabled state. 11879 * @hide 11880 * @deprecated To be removed. 11881 */ 11882 @Deprecated 11883 @Readable 11884 public static final String NETWORK_RECOMMENDATIONS_ENABLED = 11885 "network_recommendations_enabled"; 11886 11887 /** 11888 * Which package name to use for network recommendations. If null, network recommendations 11889 * will neither be requested nor accepted. 11890 * 11891 * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and 11892 * {@link NetworkScoreManager#setActiveScorer(String)} to write it. 11893 * 11894 * Type: string - package name 11895 * @hide 11896 */ 11897 @Readable 11898 public static final String NETWORK_RECOMMENDATIONS_PACKAGE = 11899 "network_recommendations_package"; 11900 11901 /** 11902 * The package name of the application that connect and secures high quality open wifi 11903 * networks automatically. 11904 * 11905 * Type: string package name or null if the feature is either not provided or disabled. 11906 * @hide 11907 */ 11908 @TestApi 11909 @Readable 11910 public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package"; 11911 11912 /** 11913 * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in 11914 * {@link com.android.server.wifi.RecommendedNetworkEvaluator}. 11915 * 11916 * Type: long 11917 * @hide 11918 */ 11919 @Readable 11920 public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS = 11921 "recommended_network_evaluator_cache_expiry_ms"; 11922 11923 /** 11924 * Whether wifi scan throttle is enabled or not. 11925 * 11926 * Type: int (0 for false, 1 for true) 11927 * @hide 11928 * @deprecated Use {@link WifiManager#setScanThrottleEnabled(boolean)} for setting the value 11929 * and {@link WifiManager#isScanThrottleEnabled()} for query. 11930 */ 11931 @Deprecated 11932 @Readable 11933 public static final String WIFI_SCAN_THROTTLE_ENABLED = "wifi_scan_throttle_enabled"; 11934 11935 /** 11936 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for 11937 * connectivity. 11938 * @hide 11939 */ 11940 @Readable 11941 public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled"; 11942 11943 /** 11944 * The length in milliseconds of a BLE scan window in a low-power scan mode. 11945 * @hide 11946 */ 11947 @Readable 11948 public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms"; 11949 11950 /** 11951 * The length in milliseconds of a BLE scan window in a balanced scan mode. 11952 * @hide 11953 */ 11954 @Readable 11955 public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms"; 11956 11957 /** 11958 * The length in milliseconds of a BLE scan window in a low-latency scan mode. 11959 * @hide 11960 */ 11961 @Readable 11962 public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS = 11963 "ble_scan_low_latency_window_ms"; 11964 11965 /** 11966 * The length in milliseconds of a BLE scan interval in a low-power scan mode. 11967 * @hide 11968 */ 11969 @Readable 11970 public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS = 11971 "ble_scan_low_power_interval_ms"; 11972 11973 /** 11974 * The length in milliseconds of a BLE scan interval in a balanced scan mode. 11975 * @hide 11976 */ 11977 @Readable 11978 public static final String BLE_SCAN_BALANCED_INTERVAL_MS = 11979 "ble_scan_balanced_interval_ms"; 11980 11981 /** 11982 * The length in milliseconds of a BLE scan interval in a low-latency scan mode. 11983 * @hide 11984 */ 11985 @Readable 11986 public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS = 11987 "ble_scan_low_latency_interval_ms"; 11988 11989 /** 11990 * The mode that BLE scanning clients will be moved to when in the background. 11991 * @hide 11992 */ 11993 @Readable 11994 public static final String BLE_SCAN_BACKGROUND_MODE = "ble_scan_background_mode"; 11995 11996 /** 11997 * The interval in milliseconds to scan as used by the wifi supplicant 11998 * @hide 11999 */ 12000 @Readable 12001 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS = 12002 "wifi_supplicant_scan_interval_ms"; 12003 12004 /** 12005 * whether frameworks handles wifi auto-join 12006 * @hide 12007 */ 12008 @Readable 12009 public static final String WIFI_ENHANCED_AUTO_JOIN = 12010 "wifi_enhanced_auto_join"; 12011 12012 /** 12013 * whether settings show RSSI 12014 * @hide 12015 */ 12016 @Readable 12017 public static final String WIFI_NETWORK_SHOW_RSSI = 12018 "wifi_network_show_rssi"; 12019 12020 /** 12021 * The interval in milliseconds to scan at supplicant when p2p is connected 12022 * @hide 12023 */ 12024 @Readable 12025 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS = 12026 "wifi_scan_interval_p2p_connected_ms"; 12027 12028 /** 12029 * Whether the Wi-Fi watchdog is enabled. 12030 */ 12031 @Readable 12032 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; 12033 12034 /** 12035 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and 12036 * the setting needs to be set to 0 to disable it. 12037 * @hide 12038 */ 12039 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 12040 @Readable 12041 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED = 12042 "wifi_watchdog_poor_network_test_enabled"; 12043 12044 /** 12045 * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1 12046 * will enable it. In the future, additional values may be supported. 12047 * @hide 12048 * @deprecated Use {@link WifiManager#setVerboseLoggingEnabled(boolean)} for setting the 12049 * value and {@link WifiManager#isVerboseLoggingEnabled()} for query. 12050 */ 12051 @Deprecated 12052 @Readable 12053 public static final String WIFI_VERBOSE_LOGGING_ENABLED = 12054 "wifi_verbose_logging_enabled"; 12055 12056 /** 12057 * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and 12058 * setting to 1 will enable it. In the future, additional values may be supported. 12059 * @deprecated MAC randomization is now a per-network setting 12060 * @hide 12061 */ 12062 @Deprecated 12063 @Readable 12064 public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED = 12065 "wifi_connected_mac_randomization_enabled"; 12066 12067 /** 12068 * Parameters to adjust the performance of framework wifi scoring methods. 12069 * <p> 12070 * Encoded as a comma-separated key=value list, for example: 12071 * "rssi5=-80:-77:-70:-57,rssi2=-83:-80:-73:-60,horizon=15" 12072 * This is intended for experimenting with new parameter values, 12073 * and is normally unset or empty. The example does not include all 12074 * parameters that may be honored. 12075 * Default values are provided by code or device configurations. 12076 * Errors in the parameters will cause the entire setting to be ignored. 12077 * @hide 12078 * @deprecated This is no longer used or set by the platform. 12079 */ 12080 @Deprecated 12081 @Readable 12082 public static final String WIFI_SCORE_PARAMS = 12083 "wifi_score_params"; 12084 12085 /** 12086 * The maximum number of times we will retry a connection to an access 12087 * point for which we have failed in acquiring an IP address from DHCP. 12088 * A value of N means that we will make N+1 connection attempts in all. 12089 */ 12090 @Readable 12091 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count"; 12092 12093 /** 12094 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile 12095 * data connectivity to be established after a disconnect from Wi-Fi. 12096 */ 12097 @Readable 12098 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 12099 "wifi_mobile_data_transition_wakelock_timeout_ms"; 12100 12101 /** 12102 * This setting controls whether WiFi configurations created by a Device Owner app 12103 * should be locked down (that is, be editable or removable only by the Device Owner App, 12104 * not even by Settings app). 12105 * This setting takes integer values. Non-zero values mean DO created configurations 12106 * are locked down. Value of zero means they are not. Default value in the absence of 12107 * actual value to this setting is 0. 12108 */ 12109 @Readable 12110 public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN = 12111 "wifi_device_owner_configs_lockdown"; 12112 12113 /** 12114 * The operational wifi frequency band 12115 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO}, 12116 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or 12117 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ} 12118 * 12119 * @hide 12120 */ 12121 @Readable 12122 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band"; 12123 12124 /** 12125 * The Wi-Fi peer-to-peer device name 12126 * @hide 12127 * @deprecated Use {@link WifiP2pManager#setDeviceName(WifiP2pManager.Channel, String, 12128 * WifiP2pManager.ActionListener)} for setting the value and 12129 * {@link android.net.wifi.p2p.WifiP2pDevice#deviceName} for query. 12130 */ 12131 @Deprecated 12132 @Readable 12133 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name"; 12134 12135 /** 12136 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect 12137 * from an ephemeral network if there is no BSSID for that network with a non-null score that 12138 * has been seen in this time period. 12139 * 12140 * If this is less than or equal to zero, we use a more conservative behavior and only check 12141 * for a non-null score from the currently connected or target BSSID. 12142 * @hide 12143 */ 12144 @Readable 12145 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS = 12146 "wifi_ephemeral_out_of_range_timeout_ms"; 12147 12148 /** 12149 * The number of milliseconds to delay when checking for data stalls during 12150 * non-aggressive detection. (screen is turned off.) 12151 * @hide 12152 */ 12153 @Readable 12154 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS = 12155 "data_stall_alarm_non_aggressive_delay_in_ms"; 12156 12157 /** 12158 * The number of milliseconds to delay when checking for data stalls during 12159 * aggressive detection. (screen on or suspected data stall) 12160 * @hide 12161 */ 12162 @Readable 12163 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS = 12164 "data_stall_alarm_aggressive_delay_in_ms"; 12165 12166 /** 12167 * The number of milliseconds to allow the provisioning apn to remain active 12168 * @hide 12169 */ 12170 @Readable 12171 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS = 12172 "provisioning_apn_alarm_delay_in_ms"; 12173 12174 /** 12175 * The interval in milliseconds at which to check gprs registration 12176 * after the first registration mismatch of gprs and voice service, 12177 * to detect possible data network registration problems. 12178 * 12179 * @hide 12180 */ 12181 @Readable 12182 public static final String GPRS_REGISTER_CHECK_PERIOD_MS = 12183 "gprs_register_check_period_ms"; 12184 12185 /** 12186 * Nonzero causes Log.wtf() to crash. 12187 * @hide 12188 */ 12189 @Readable 12190 public static final String WTF_IS_FATAL = "wtf_is_fatal"; 12191 12192 /** 12193 * Ringer mode. This is used internally, changing this value will not 12194 * change the ringer mode. See AudioManager. 12195 */ 12196 @Readable 12197 public static final String MODE_RINGER = "mode_ringer"; 12198 12199 /** 12200 * Overlay display devices setting. 12201 * The associated value is a specially formatted string that describes the 12202 * size and density of simulated secondary display devices. 12203 * <p> 12204 * Format: 12205 * <pre> 12206 * [display1];[display2];... 12207 * </pre> 12208 * with each display specified as: 12209 * <pre> 12210 * [mode1]|[mode2]|...,[flag1],[flag2],... 12211 * </pre> 12212 * with each mode specified as: 12213 * <pre> 12214 * [width]x[height]/[densityDpi] 12215 * </pre> 12216 * Supported flags: 12217 * <ul> 12218 * <li><pre>secure</pre>: creates a secure display</li> 12219 * <li><pre>own_content_only</pre>: only shows this display's own content</li> 12220 * <li><pre>should_show_system_decorations</pre>: supports system decorations</li> 12221 * </ul> 12222 * </p><p> 12223 * Example: 12224 * <ul> 12225 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li> 12226 * <li><code>1920x1080/320,secure;1280x720/213</code>: make two overlays, the first at 12227 * 1080p and secure; the second at 720p.</li> 12228 * <li><code>1920x1080/320|3840x2160/640</code>: make one overlay that is 1920x1080 at 12229 * 213dpi by default, but can also be upscaled to 3840x2160 at 640dpi by the system if the 12230 * display device allows.</li> 12231 * <li>If the value is empty, then no overlay display devices are created.</li> 12232 * </ul></p> 12233 * 12234 * @hide 12235 */ 12236 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 12237 @TestApi 12238 @Readable 12239 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices"; 12240 12241 /** 12242 * Threshold values for the duration and level of a discharge cycle, 12243 * under which we log discharge cycle info. 12244 * 12245 * @hide 12246 */ 12247 @Readable 12248 public static final String 12249 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold"; 12250 12251 /** @hide */ 12252 @Readable 12253 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold"; 12254 12255 /** 12256 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR 12257 * intents on application crashes and ANRs. If this is disabled, the 12258 * crash/ANR dialog will never display the "Report" button. 12259 * <p> 12260 * Type: int (0 = disallow, 1 = allow) 12261 * 12262 * @hide 12263 */ 12264 @Readable 12265 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error"; 12266 12267 /** 12268 * Maximum age of entries kept by {@link DropBoxManager}. 12269 * 12270 * @hide 12271 */ 12272 @Readable 12273 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds"; 12274 12275 /** 12276 * Maximum number of entry files which {@link DropBoxManager} will keep 12277 * around. 12278 * 12279 * @hide 12280 */ 12281 @Readable 12282 public static final String DROPBOX_MAX_FILES = "dropbox_max_files"; 12283 12284 /** 12285 * Maximum amount of disk space used by {@link DropBoxManager} no matter 12286 * what. 12287 * 12288 * @hide 12289 */ 12290 @Readable 12291 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb"; 12292 12293 /** 12294 * Percent of free disk (excluding reserve) which {@link DropBoxManager} 12295 * will use. 12296 * 12297 * @hide 12298 */ 12299 @Readable 12300 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent"; 12301 12302 /** 12303 * Percent of total disk which {@link DropBoxManager} will never dip 12304 * into. 12305 * 12306 * @hide 12307 */ 12308 @Readable 12309 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent"; 12310 12311 /** 12312 * Prefix for per-tag dropbox disable/enable settings. 12313 * 12314 * @hide 12315 */ 12316 @Readable 12317 public static final String DROPBOX_TAG_PREFIX = "dropbox:"; 12318 12319 /** 12320 * Lines of logcat to include with system crash/ANR/etc. reports, as a 12321 * prefix of the dropbox tag of the report type. For example, 12322 * "logcat_for_system_server_anr" controls the lines of logcat captured 12323 * with system server ANR reports. 0 to disable. 12324 * 12325 * @hide 12326 */ 12327 @Readable 12328 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_"; 12329 12330 /** 12331 * Maximum number of bytes of a system crash/ANR/etc. report that 12332 * ActivityManagerService should send to DropBox, as a prefix of the 12333 * dropbox tag of the report type. For example, 12334 * "max_error_bytes_for_system_server_anr" controls the maximum 12335 * number of bytes captured with system server ANR reports. 12336 * <p> 12337 * Type: int (max size in bytes) 12338 * 12339 * @hide 12340 */ 12341 @Readable 12342 public static final String MAX_ERROR_BYTES_PREFIX = "max_error_bytes_for_"; 12343 12344 /** 12345 * The interval in minutes after which the amount of free storage left 12346 * on the device is logged to the event log 12347 * 12348 * @hide 12349 */ 12350 @Readable 12351 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval"; 12352 12353 /** 12354 * Threshold for the amount of change in disk free space required to 12355 * report the amount of free space. Used to prevent spamming the logs 12356 * when the disk free space isn't changing frequently. 12357 * 12358 * @hide 12359 */ 12360 @Readable 12361 public static final String 12362 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold"; 12363 12364 /** 12365 * Minimum percentage of free storage on the device that is used to 12366 * determine if the device is running low on storage. The default is 10. 12367 * <p> 12368 * Say this value is set to 10, the device is considered running low on 12369 * storage if 90% or more of the device storage is filled up. 12370 * 12371 * @hide 12372 */ 12373 @Readable 12374 public static final String 12375 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage"; 12376 12377 /** 12378 * Maximum byte size of the low storage threshold. This is to ensure 12379 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an 12380 * overly large threshold for large storage devices. Currently this must 12381 * be less than 2GB. This default is 500MB. 12382 * 12383 * @hide 12384 */ 12385 @Readable 12386 public static final String 12387 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes"; 12388 12389 /** 12390 * Minimum bytes of free storage on the device before the data partition 12391 * is considered full. By default, 1 MB is reserved to avoid system-wide 12392 * SQLite disk full exceptions. 12393 * 12394 * @hide 12395 */ 12396 @Readable 12397 public static final String 12398 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes"; 12399 12400 /** 12401 * Minimum percentage of storage on the device that is reserved for 12402 * cached data. 12403 * 12404 * @hide 12405 */ 12406 @Readable 12407 public static final String 12408 SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage"; 12409 12410 /** 12411 * Maximum bytes of storage on the device that is reserved for cached 12412 * data. 12413 * 12414 * @hide 12415 */ 12416 @Readable 12417 public static final String 12418 SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes"; 12419 12420 /** 12421 * The maximum reconnect delay for short network outages or when the 12422 * network is suspended due to phone use. 12423 * 12424 * @hide 12425 */ 12426 @Readable 12427 public static final String 12428 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds"; 12429 12430 /** 12431 * The number of milliseconds to delay before sending out 12432 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored. 12433 * 12434 * @hide 12435 */ 12436 @Readable 12437 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay"; 12438 12439 12440 /** 12441 * Network sampling interval, in seconds. We'll generate link information 12442 * about bytes/packets sent and error rates based on data sampled in this interval 12443 * 12444 * @hide 12445 */ 12446 @Readable 12447 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS = 12448 "connectivity_sampling_interval_in_seconds"; 12449 12450 /** 12451 * The series of successively longer delays used in retrying to download PAC file. 12452 * Last delay is used between successful PAC downloads. 12453 * 12454 * @hide 12455 */ 12456 @Readable 12457 public static final String PAC_CHANGE_DELAY = "pac_change_delay"; 12458 12459 /** 12460 * Don't attempt to detect captive portals. 12461 * 12462 * @hide 12463 */ 12464 public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; 12465 12466 /** 12467 * When detecting a captive portal, display a notification that 12468 * prompts the user to sign in. 12469 * 12470 * @hide 12471 */ 12472 public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; 12473 12474 /** 12475 * When detecting a captive portal, immediately disconnect from the 12476 * network and do not reconnect to that network in the future. 12477 * 12478 * @hide 12479 */ 12480 public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; 12481 12482 /** 12483 * What to do when connecting a network that presents a captive portal. 12484 * Must be one of the CAPTIVE_PORTAL_MODE_* constants above. 12485 * 12486 * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT. 12487 * @hide 12488 */ 12489 @Readable 12490 public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode"; 12491 12492 /** 12493 * Setting to turn off captive portal detection. Feature is enabled by 12494 * default and the setting needs to be set to 0 to disable it. 12495 * 12496 * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection 12497 * @hide 12498 */ 12499 @Deprecated 12500 @Readable 12501 public static final String 12502 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled"; 12503 12504 /** 12505 * The server used for captive portal detection upon a new conection. A 12506 * 204 response code from the server is used for validation. 12507 * TODO: remove this deprecated symbol. 12508 * 12509 * @hide 12510 */ 12511 @Readable 12512 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server"; 12513 12514 /** 12515 * The URL used for HTTPS captive portal detection upon a new connection. 12516 * A 204 response code from the server is used for validation. 12517 * 12518 * @hide 12519 */ 12520 @Readable 12521 public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url"; 12522 12523 /** 12524 * The URL used for HTTP captive portal detection upon a new connection. 12525 * A 204 response code from the server is used for validation. 12526 * 12527 * @hide 12528 */ 12529 @Readable 12530 public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url"; 12531 12532 /** 12533 * The URL used for fallback HTTP captive portal detection when previous HTTP 12534 * and HTTPS captive portal detection attemps did not return a conclusive answer. 12535 * 12536 * @hide 12537 */ 12538 @Readable 12539 public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url"; 12540 12541 /** 12542 * A comma separated list of URLs used for captive portal detection in addition to the 12543 * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings. 12544 * 12545 * @hide 12546 */ 12547 @Readable 12548 public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS = 12549 "captive_portal_other_fallback_urls"; 12550 12551 /** 12552 * A list of captive portal detection specifications used in addition to the fallback URLs. 12553 * Each spec has the format url@@/@@statusCodeRegex@@/@@contentRegex. Specs are separated 12554 * by "@@,@@". 12555 * @hide 12556 */ 12557 @Readable 12558 public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS = 12559 "captive_portal_fallback_probe_specs"; 12560 12561 /** 12562 * Whether to use HTTPS for network validation. This is enabled by default and the setting 12563 * needs to be set to 0 to disable it. This setting is a misnomer because captive portals 12564 * don't actually use HTTPS, but it's consistent with the other settings. 12565 * 12566 * @hide 12567 */ 12568 @Readable 12569 public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https"; 12570 12571 /** 12572 * Which User-Agent string to use in the header of the captive portal detection probes. 12573 * The User-Agent field is unset when this setting has no value (HttpUrlConnection default). 12574 * 12575 * @hide 12576 */ 12577 @Readable 12578 public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent"; 12579 12580 /** 12581 * Whether to try cellular data recovery when a bad network is reported. 12582 * 12583 * @hide 12584 */ 12585 @Readable 12586 public static final String DATA_STALL_RECOVERY_ON_BAD_NETWORK = 12587 "data_stall_recovery_on_bad_network"; 12588 12589 /** 12590 * Minumim duration in millisecodns between cellular data recovery attempts 12591 * 12592 * @hide 12593 */ 12594 @Readable 12595 public static final String MIN_DURATION_BETWEEN_RECOVERY_STEPS_IN_MS = 12596 "min_duration_between_recovery_steps"; 12597 /** 12598 * Whether network service discovery is enabled. 12599 * 12600 * @hide 12601 */ 12602 @Readable 12603 public static final String NSD_ON = "nsd_on"; 12604 12605 /** 12606 * Let user pick default install location. 12607 * 12608 * @hide 12609 */ 12610 @Readable 12611 public static final String SET_INSTALL_LOCATION = "set_install_location"; 12612 12613 /** 12614 * Default install location value. 12615 * 0 = auto, let system decide 12616 * 1 = internal 12617 * 2 = sdcard 12618 * @hide 12619 */ 12620 @Readable 12621 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location"; 12622 12623 /** 12624 * ms during which to consume extra events related to Inet connection 12625 * condition after a transtion to fully-connected 12626 * 12627 * @hide 12628 */ 12629 @Readable 12630 public static final String 12631 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay"; 12632 12633 /** 12634 * ms during which to consume extra events related to Inet connection 12635 * condtion after a transtion to partly-connected 12636 * 12637 * @hide 12638 */ 12639 @Readable 12640 public static final String 12641 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay"; 12642 12643 /** {@hide} */ 12644 @Readable 12645 public static final String 12646 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default"; 12647 12648 /** 12649 * Host name and port for global http proxy. Uses ':' seperator for 12650 * between host and port. 12651 */ 12652 @Readable 12653 public static final String HTTP_PROXY = "http_proxy"; 12654 12655 /** 12656 * Host name for global http proxy. Set via ConnectivityManager. 12657 * 12658 * @hide 12659 */ 12660 @Readable 12661 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host"; 12662 12663 /** 12664 * Integer host port for global http proxy. Set via ConnectivityManager. 12665 * 12666 * @hide 12667 */ 12668 @Readable 12669 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port"; 12670 12671 /** 12672 * Exclusion list for global proxy. This string contains a list of 12673 * comma-separated domains where the global proxy does not apply. 12674 * Domains should be listed in a comma- separated list. Example of 12675 * acceptable formats: ".domain1.com,my.domain2.com" Use 12676 * ConnectivityManager to set/get. 12677 * 12678 * @hide 12679 */ 12680 @Readable 12681 public static final String 12682 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list"; 12683 12684 /** 12685 * The location PAC File for the proxy. 12686 * @hide 12687 */ 12688 @Readable 12689 public static final String 12690 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url"; 12691 12692 /** 12693 * Enables the UI setting to allow the user to specify the global HTTP 12694 * proxy and associated exclusion list. 12695 * 12696 * @hide 12697 */ 12698 @Readable 12699 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy"; 12700 12701 /** 12702 * Setting for default DNS in case nobody suggests one 12703 * 12704 * @hide 12705 */ 12706 @Readable 12707 public static final String DEFAULT_DNS_SERVER = "default_dns_server"; 12708 12709 /** 12710 * The requested Private DNS mode (string), and an accompanying specifier (string). 12711 * 12712 * Currently, the specifier holds the chosen provider name when the mode requests 12713 * a specific provider. It may be used to store the provider name even when the 12714 * mode changes so that temporarily disabling and re-enabling the specific 12715 * provider mode does not necessitate retyping the provider hostname. 12716 * 12717 * @hide 12718 */ 12719 @Readable 12720 public static final String PRIVATE_DNS_MODE = "private_dns_mode"; 12721 12722 /** 12723 * @hide 12724 */ 12725 @Readable 12726 public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier"; 12727 12728 /** 12729 * Forced override of the default mode (hardcoded as "automatic", nee "opportunistic"). 12730 * This allows changing the default mode without effectively disabling other modes, 12731 * all of which require explicit user action to enable/configure. See also b/79719289. 12732 * 12733 * Value is a string, suitable for assignment to PRIVATE_DNS_MODE above. 12734 * 12735 * {@hide} 12736 */ 12737 @Readable 12738 public static final String PRIVATE_DNS_DEFAULT_MODE = "private_dns_default_mode"; 12739 12740 12741 /** {@hide} */ 12742 @Readable 12743 public static final String 12744 BLUETOOTH_BTSNOOP_DEFAULT_MODE = "bluetooth_btsnoop_default_mode"; 12745 /** {@hide} */ 12746 @Readable 12747 public static final String 12748 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_"; 12749 /** {@hide} */ 12750 @Readable 12751 public static final String 12752 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_"; 12753 /** {@hide} */ 12754 @Readable 12755 public static final String 12756 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_"; 12757 /** {@hide} */ 12758 @Readable 12759 public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX = 12760 "bluetooth_a2dp_supports_optional_codecs_"; 12761 /** {@hide} */ 12762 @Readable 12763 public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX = 12764 "bluetooth_a2dp_optional_codecs_enabled_"; 12765 /** {@hide} */ 12766 @Readable 12767 public static final String 12768 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_"; 12769 /** {@hide} */ 12770 @Readable 12771 public static final String 12772 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_"; 12773 /** {@hide} */ 12774 @Readable 12775 public static final String 12776 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_"; 12777 /** {@hide} */ 12778 @Readable 12779 public static final String 12780 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_"; 12781 /** {@hide} */ 12782 @Readable 12783 public static final String 12784 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_"; 12785 /** {@hide} */ 12786 @Readable 12787 public static final String 12788 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_"; 12789 /** {@hide} */ 12790 @Readable 12791 public static final String 12792 BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_"; 12793 12794 /** 12795 * Enable/disable radio bug detection 12796 * 12797 * {@hide} 12798 */ 12799 @Readable 12800 public static final String 12801 ENABLE_RADIO_BUG_DETECTION = "enable_radio_bug_detection"; 12802 12803 /** 12804 * Count threshold of RIL wakelock timeout for radio bug detection 12805 * 12806 * {@hide} 12807 */ 12808 @Readable 12809 public static final String 12810 RADIO_BUG_WAKELOCK_TIMEOUT_COUNT_THRESHOLD = 12811 "radio_bug_wakelock_timeout_count_threshold"; 12812 12813 /** 12814 * Count threshold of RIL system error for radio bug detection 12815 * 12816 * {@hide} 12817 */ 12818 @Readable 12819 public static final String 12820 RADIO_BUG_SYSTEM_ERROR_COUNT_THRESHOLD = 12821 "radio_bug_system_error_count_threshold"; 12822 12823 /** 12824 * Activity manager specific settings. 12825 * This is encoded as a key=value list, separated by commas. Ex: 12826 * 12827 * "gc_timeout=5000,max_cached_processes=24" 12828 * 12829 * The following keys are supported: 12830 * 12831 * <pre> 12832 * max_cached_processes (int) 12833 * background_settle_time (long) 12834 * fgservice_min_shown_time (long) 12835 * fgservice_min_report_time (long) 12836 * fgservice_screen_on_before_time (long) 12837 * fgservice_screen_on_after_time (long) 12838 * content_provider_retain_time (long) 12839 * gc_timeout (long) 12840 * gc_min_interval (long) 12841 * full_pss_min_interval (long) 12842 * full_pss_lowered_interval (long) 12843 * power_check_interval (long) 12844 * power_check_max_cpu_1 (int) 12845 * power_check_max_cpu_2 (int) 12846 * power_check_max_cpu_3 (int) 12847 * power_check_max_cpu_4 (int) 12848 * service_usage_interaction_time (long) 12849 * usage_stats_interaction_interval (long) 12850 * service_restart_duration (long) 12851 * service_reset_run_duration (long) 12852 * service_restart_duration_factor (int) 12853 * service_min_restart_time_between (long) 12854 * service_max_inactivity (long) 12855 * service_bg_start_timeout (long) 12856 * service_bg_activity_start_timeout (long) 12857 * process_start_async (boolean) 12858 * </pre> 12859 * 12860 * <p> 12861 * Type: string 12862 * @hide 12863 * @see com.android.server.am.ActivityManagerConstants 12864 */ 12865 @Readable 12866 public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants"; 12867 12868 /** 12869 * Feature flag to enable or disable the activity starts logging feature. 12870 * Type: int (0 for false, 1 for true) 12871 * Default: 1 12872 * @hide 12873 */ 12874 @Readable 12875 public static final String ACTIVITY_STARTS_LOGGING_ENABLED 12876 = "activity_starts_logging_enabled"; 12877 12878 /** 12879 * Feature flag to enable or disable the foreground service starts logging feature. 12880 * Type: int (0 for false, 1 for true) 12881 * Default: 1 12882 * @hide 12883 */ 12884 @Readable 12885 public static final String FOREGROUND_SERVICE_STARTS_LOGGING_ENABLED = 12886 "foreground_service_starts_logging_enabled"; 12887 12888 /** 12889 * @hide 12890 * @see com.android.server.appbinding.AppBindingConstants 12891 */ 12892 @Readable 12893 public static final String APP_BINDING_CONSTANTS = "app_binding_constants"; 12894 12895 /** 12896 * App ops specific settings. 12897 * This is encoded as a key=value list, separated by commas. Ex: 12898 * 12899 * "state_settle_time=10000" 12900 * 12901 * The following keys are supported: 12902 * 12903 * <pre> 12904 * top_state_settle_time (long) 12905 * fg_service_state_settle_time (long) 12906 * bg_state_settle_time (long) 12907 * </pre> 12908 * 12909 * <p> 12910 * Type: string 12911 * @hide 12912 * @see com.android.server.AppOpsService.Constants 12913 */ 12914 @TestApi 12915 @Readable 12916 public static final String APP_OPS_CONSTANTS = "app_ops_constants"; 12917 12918 /** 12919 * Battery Saver specific settings 12920 * This is encoded as a key=value list, separated by commas. Ex: 12921 * 12922 * "vibration_disabled=true,adjust_brightness_factor=0.5" 12923 * 12924 * The following keys are supported: 12925 * 12926 * <pre> 12927 * advertise_is_enabled (boolean) 12928 * datasaver_disabled (boolean) 12929 * enable_night_mode (boolean) 12930 * launch_boost_disabled (boolean) 12931 * vibration_disabled (boolean) 12932 * animation_disabled (boolean) 12933 * soundtrigger_disabled (boolean) 12934 * fullbackup_deferred (boolean) 12935 * keyvaluebackup_deferred (boolean) 12936 * firewall_disabled (boolean) 12937 * gps_mode (int) 12938 * adjust_brightness_disabled (boolean) 12939 * adjust_brightness_factor (float) 12940 * force_all_apps_standby (boolean) 12941 * force_background_check (boolean) 12942 * optional_sensors_disabled (boolean) 12943 * aod_disabled (boolean) 12944 * quick_doze_enabled (boolean) 12945 * </pre> 12946 * @hide 12947 * @see com.android.server.power.batterysaver.BatterySaverPolicy 12948 */ 12949 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 12950 @TestApi 12951 @Readable 12952 public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants"; 12953 12954 /** 12955 * Battery Saver device specific settings 12956 * This is encoded as a key=value list, separated by commas. 12957 * 12958 * The following keys are supported: 12959 * 12960 * <pre> 12961 * cpufreq-i (list of "core-number:frequency" pairs concatenated with /) 12962 * cpufreq-n (list of "core-number:frequency" pairs concatenated with /) 12963 * </pre> 12964 * 12965 * See {@link com.android.server.power.batterysaver.BatterySaverPolicy} for the details. 12966 * 12967 * @hide 12968 */ 12969 @Readable 12970 public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS = 12971 "battery_saver_device_specific_constants"; 12972 12973 /** 12974 * Battery tip specific settings 12975 * This is encoded as a key=value list, separated by commas. Ex: 12976 * 12977 * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true," 12978 * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50," 12979 * "high_usage_battery_draining=25,high_usage_period_ms=3000" 12980 * 12981 * The following keys are supported: 12982 * 12983 * <pre> 12984 * battery_tip_enabled (boolean) 12985 * summary_enabled (boolean) 12986 * battery_saver_tip_enabled (boolean) 12987 * high_usage_enabled (boolean) 12988 * high_usage_app_count (int) 12989 * high_usage_period_ms (long) 12990 * high_usage_battery_draining (int) 12991 * app_restriction_enabled (boolean) 12992 * reduced_battery_enabled (boolean) 12993 * reduced_battery_percent (int) 12994 * low_battery_enabled (boolean) 12995 * low_battery_hour (int) 12996 * </pre> 12997 * @hide 12998 */ 12999 @Readable 13000 public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants"; 13001 13002 /** 13003 * Battery anomaly detection specific settings 13004 * This is encoded as a key=value list, separated by commas. 13005 * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via 13006 * {@link Uri#encode(String)}, separated by colons. Ex: 13007 * 13008 * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true," 13009 * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon" 13010 * 13011 * The following keys are supported: 13012 * 13013 * <pre> 13014 * anomaly_detection_enabled (boolean) 13015 * wakelock_enabled (boolean) 13016 * wakelock_threshold (long) 13017 * wakeup_alarm_enabled (boolean) 13018 * wakeup_alarm_threshold (long) 13019 * wakeup_blacklisted_tags (string) 13020 * bluetooth_scan_enabled (boolean) 13021 * bluetooth_scan_threshold (long) 13022 * </pre> 13023 * @hide 13024 */ 13025 @Readable 13026 public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants"; 13027 13028 /** 13029 * An integer to show the version of the anomaly config. Ex: 1, which means 13030 * current version is 1. 13031 * @hide 13032 */ 13033 @Readable 13034 public static final String ANOMALY_CONFIG_VERSION = "anomaly_config_version"; 13035 13036 /** 13037 * A base64-encoded string represents anomaly stats config, used for 13038 * {@link android.app.StatsManager}. 13039 * @hide 13040 */ 13041 @Readable 13042 public static final String ANOMALY_CONFIG = "anomaly_config"; 13043 13044 /** 13045 * Always on display(AOD) specific settings 13046 * This is encoded as a key=value list, separated by commas. Ex: 13047 * 13048 * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4" 13049 * 13050 * The following keys are supported: 13051 * 13052 * <pre> 13053 * screen_brightness_array (int[]) 13054 * dimming_scrim_array (int[]) 13055 * prox_screen_off_delay (long) 13056 * prox_cooldown_trigger (long) 13057 * prox_cooldown_period (long) 13058 * </pre> 13059 * @hide 13060 */ 13061 @Readable 13062 public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants"; 13063 13064 /** 13065 * UidCpuPower global setting. This links the sys.uidcpupower system property. 13066 * The following values are supported: 13067 * 0 -> /proc/uid_cpupower/* are disabled 13068 * 1 -> /proc/uid_cpupower/* are enabled 13069 * Any other value defaults to enabled. 13070 * @hide 13071 */ 13072 @Readable 13073 public static final String SYS_UIDCPUPOWER = "sys_uidcpupower"; 13074 13075 /** 13076 * traced global setting. This controls weather the deamons: traced and 13077 * traced_probes run. This links the sys.traced system property. 13078 * The following values are supported: 13079 * 0 -> traced and traced_probes are disabled 13080 * 1 -> traced and traced_probes are enabled 13081 * Any other value defaults to disabled. 13082 * @hide 13083 */ 13084 @Readable 13085 public static final String SYS_TRACED = "sys_traced"; 13086 13087 /** 13088 * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the 13089 * device for this setting to take full effect. 13090 * 13091 * @hide 13092 */ 13093 @Readable 13094 public static final String FPS_DEVISOR = "fps_divisor"; 13095 13096 /** 13097 * Flag to enable or disable display panel low power mode (lpm) 13098 * false -> Display panel power saving mode is disabled. 13099 * true -> Display panel power saving mode is enabled. 13100 * 13101 * @hide 13102 */ 13103 @Readable 13104 public static final String DISPLAY_PANEL_LPM = "display_panel_lpm"; 13105 13106 /** 13107 * App time limit usage source setting. 13108 * This controls which app in a task will be considered the source of usage when 13109 * calculating app usage time limits. 13110 * 13111 * 1 -> task root app 13112 * 2 -> current app 13113 * Any other value defaults to task root app. 13114 * 13115 * Need to reboot the device for this setting to take effect. 13116 * @hide 13117 */ 13118 @Readable 13119 public static final String APP_TIME_LIMIT_USAGE_SOURCE = "app_time_limit_usage_source"; 13120 13121 /** 13122 * Enable ART bytecode verification verifications for debuggable apps. 13123 * 0 = disable, 1 = enable. 13124 * @hide 13125 */ 13126 @Readable 13127 public static final String ART_VERIFIER_VERIFY_DEBUGGABLE = 13128 "art_verifier_verify_debuggable"; 13129 13130 /** 13131 * Power manager specific settings. 13132 * This is encoded as a key=value list, separated by commas. Ex: 13133 * 13134 * "no_cached_wake_locks=1" 13135 * 13136 * The following keys are supported: 13137 * 13138 * <pre> 13139 * no_cached_wake_locks (boolean) 13140 * </pre> 13141 * 13142 * <p> 13143 * Type: string 13144 * @hide 13145 * @see com.android.server.power.PowerManagerConstants 13146 */ 13147 @Readable 13148 public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants"; 13149 13150 /** 13151 * ShortcutManager specific settings. 13152 * This is encoded as a key=value list, separated by commas. Ex: 13153 * 13154 * "reset_interval_sec=86400,max_updates_per_interval=1" 13155 * 13156 * The following keys are supported: 13157 * 13158 * <pre> 13159 * reset_interval_sec (long) 13160 * max_updates_per_interval (int) 13161 * max_icon_dimension_dp (int, DP) 13162 * max_icon_dimension_dp_lowram (int, DP) 13163 * max_shortcuts (int) 13164 * icon_quality (int, 0-100) 13165 * icon_format (String) 13166 * </pre> 13167 * 13168 * <p> 13169 * Type: string 13170 * @hide 13171 * @see com.android.server.pm.ShortcutService.ConfigConstants 13172 */ 13173 @Readable 13174 public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants"; 13175 13176 /** 13177 * DevicePolicyManager specific settings. 13178 * This is encoded as a key=value list, separated by commas. Ex: 13179 * 13180 * <pre> 13181 * das_died_service_reconnect_backoff_sec (long) 13182 * das_died_service_reconnect_backoff_increase (float) 13183 * das_died_service_reconnect_max_backoff_sec (long) 13184 * </pre> 13185 * 13186 * <p> 13187 * Type: string 13188 * @hide 13189 * see also com.android.server.devicepolicy.DevicePolicyConstants 13190 */ 13191 @Readable 13192 public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants"; 13193 13194 /** 13195 * TextClassifier specific settings. 13196 * This is encoded as a key=value list, separated by commas. String[] types like 13197 * entity_list_default use ":" as delimiter for values. Ex: 13198 * 13199 * <pre> 13200 * classify_text_max_range_length (int) 13201 * detect_language_from_text_enabled (boolean) 13202 * entity_list_default (String[]) 13203 * entity_list_editable (String[]) 13204 * entity_list_not_editable (String[]) 13205 * generate_links_log_sample_rate (int) 13206 * generate_links_max_text_length (int) 13207 * in_app_conversation_action_types_default (String[]) 13208 * lang_id_context_settings (float[]) 13209 * lang_id_threshold_override (float) 13210 * local_textclassifier_enabled (boolean) 13211 * model_dark_launch_enabled (boolean) 13212 * notification_conversation_action_types_default (String[]) 13213 * smart_linkify_enabled (boolean) 13214 * smart_select_animation_enabled (boolean) 13215 * smart_selection_enabled (boolean) 13216 * smart_text_share_enabled (boolean) 13217 * suggest_selection_max_range_length (int) 13218 * system_textclassifier_enabled (boolean) 13219 * template_intent_factory_enabled (boolean) 13220 * translate_in_classification_enabled (boolean) 13221 * </pre> 13222 * 13223 * <p> 13224 * Type: string 13225 * @hide 13226 * see also android.view.textclassifier.TextClassificationConstants 13227 */ 13228 @Readable 13229 public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants"; 13230 13231 /** 13232 * BatteryStats specific settings. 13233 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" 13234 * 13235 * The following keys are supported: 13236 * <pre> 13237 * track_cpu_times_by_proc_state (boolean) 13238 * track_cpu_active_cluster_time (boolean) 13239 * read_binary_cpu_time (boolean) 13240 * proc_state_cpu_times_read_delay_ms (long) 13241 * external_stats_collection_rate_limit_ms (long) 13242 * battery_level_collection_delay_ms (long) 13243 * max_history_files (int) 13244 * max_history_buffer_kb (int) 13245 * battery_charged_delay_ms (int) 13246 * </pre> 13247 * 13248 * <p> 13249 * Type: string 13250 * @hide 13251 * see also com.android.internal.os.BatteryStatsImpl.Constants 13252 */ 13253 @Readable 13254 public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants"; 13255 13256 /** 13257 * SyncManager specific settings. 13258 * 13259 * <p> 13260 * Type: string 13261 * @hide 13262 * @see com.android.server.content.SyncManagerConstants 13263 */ 13264 @Readable 13265 public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants"; 13266 13267 /** 13268 * Broadcast dispatch tuning parameters specific to foreground broadcasts. 13269 * 13270 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" 13271 * 13272 * The following keys are supported: 13273 * <pre> 13274 * bcast_timeout (long) 13275 * bcast_slow_time (long) 13276 * bcast_deferral (long) 13277 * bcast_deferral_decay_factor (float) 13278 * bcast_deferral_floor (long) 13279 * bcast_allow_bg_activity_start_timeout (long) 13280 * </pre> 13281 * 13282 * @hide 13283 */ 13284 @Readable 13285 public static final String BROADCAST_FG_CONSTANTS = "bcast_fg_constants"; 13286 13287 /** 13288 * Broadcast dispatch tuning parameters specific to background broadcasts. 13289 * 13290 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true". 13291 * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys. 13292 * 13293 * @hide 13294 */ 13295 @Readable 13296 public static final String BROADCAST_BG_CONSTANTS = "bcast_bg_constants"; 13297 13298 /** 13299 * Broadcast dispatch tuning parameters specific to specific "offline" broadcasts. 13300 * 13301 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true". 13302 * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys. 13303 * 13304 * @hide 13305 */ 13306 @Readable 13307 public static final String BROADCAST_OFFLOAD_CONSTANTS = "bcast_offload_constants"; 13308 13309 /** 13310 * Whether or not App Standby feature is enabled by system. This controls throttling of apps 13311 * based on usage patterns and predictions. Platform will turn on this feature if both this 13312 * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on. 13313 * Type: int (0 for false, 1 for true) 13314 * Default: 1 13315 * @hide 13316 * @see #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED 13317 */ 13318 @SystemApi 13319 @Readable 13320 public static final String APP_STANDBY_ENABLED = "app_standby_enabled"; 13321 13322 /** 13323 * Whether or not adaptive battery feature is enabled by user. Platform will turn on this 13324 * feature if both this flag and {@link #APP_STANDBY_ENABLED} is on. 13325 * Type: int (0 for false, 1 for true) 13326 * Default: 1 13327 * @hide 13328 * @see #APP_STANDBY_ENABLED 13329 */ 13330 @Readable 13331 public static final String ADAPTIVE_BATTERY_MANAGEMENT_ENABLED = 13332 "adaptive_battery_management_enabled"; 13333 13334 /** 13335 * Whether or not apps are allowed into the 13336 * {@link android.app.usage.UsageStatsManager#STANDBY_BUCKET_RESTRICTED} bucket. 13337 * Type: int (0 for false, 1 for true) 13338 * Default: {@value #DEFAULT_ENABLE_RESTRICTED_BUCKET} 13339 * 13340 * @hide 13341 */ 13342 @Readable 13343 public static final String ENABLE_RESTRICTED_BUCKET = "enable_restricted_bucket"; 13344 13345 /** 13346 * @see #ENABLE_RESTRICTED_BUCKET 13347 * @hide 13348 */ 13349 public static final int DEFAULT_ENABLE_RESTRICTED_BUCKET = 1; 13350 13351 /** 13352 * Whether or not app auto restriction is enabled. When it is enabled, settings app will 13353 * auto restrict the app if it has bad behavior (e.g. hold wakelock for long time). 13354 * 13355 * Type: boolean (0 for false, 1 for true) 13356 * Default: 1 13357 * 13358 * @hide 13359 */ 13360 @Readable 13361 public static final String APP_AUTO_RESTRICTION_ENABLED = 13362 "app_auto_restriction_enabled"; 13363 13364 /** 13365 * Feature flag to enable or disable the Forced App Standby feature. 13366 * Type: int (0 for false, 1 for true) 13367 * Default: 1 13368 * @hide 13369 */ 13370 @Readable 13371 public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled"; 13372 13373 /** 13374 * Whether or not to enable Forced App Standby on small battery devices. 13375 * Type: int (0 for false, 1 for true) 13376 * Default: 0 13377 * @hide 13378 */ 13379 @Readable 13380 public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED 13381 = "forced_app_standby_for_small_battery_enabled"; 13382 13383 /** 13384 * Whether or not to enable the User Absent, Radios Off feature on small battery devices. 13385 * Type: int (0 for false, 1 for true) 13386 * Default: 0 13387 * @hide 13388 */ 13389 @Readable 13390 public static final String USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED 13391 = "user_absent_radios_off_for_small_battery_enabled"; 13392 13393 /** 13394 * Whether or not to enable the User Absent, Touch Off feature on small battery devices. 13395 * Type: int (0 for false, 1 for true) 13396 * Default: 0 13397 * @hide 13398 */ 13399 @Readable 13400 public static final String USER_ABSENT_TOUCH_OFF_FOR_SMALL_BATTERY_ENABLED 13401 = "user_absent_touch_off_for_small_battery_enabled"; 13402 13403 /** 13404 * Whether or not to turn on Wifi when proxy is disconnected. 13405 * Type: int (0 for false, 1 for true) 13406 * Default: 1 13407 * @hide 13408 */ 13409 @Readable 13410 public static final String WIFI_ON_WHEN_PROXY_DISCONNECTED 13411 = "wifi_on_when_proxy_disconnected"; 13412 13413 /** 13414 * Time Only Mode specific settings. 13415 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" 13416 * 13417 * The following keys are supported: 13418 * 13419 * <pre> 13420 * enabled (boolean) 13421 * disable_home (boolean) 13422 * disable_tilt_to_wake (boolean) 13423 * disable_touch_to_wake (boolean) 13424 * </pre> 13425 * Type: string 13426 * @hide 13427 */ 13428 @Readable 13429 public static final String TIME_ONLY_MODE_CONSTANTS 13430 = "time_only_mode_constants"; 13431 13432 /** 13433 * Whether of not to send keycode sleep for ungaze when Home is the foreground activity on 13434 * watch type devices. 13435 * Type: int (0 for false, 1 for true) 13436 * Default: 0 13437 * @hide 13438 */ 13439 @Readable 13440 public static final String UNGAZE_SLEEP_ENABLED = "ungaze_sleep_enabled"; 13441 13442 /** 13443 * Whether or not Network Watchlist feature is enabled. 13444 * Type: int (0 for false, 1 for true) 13445 * Default: 0 13446 * @hide 13447 */ 13448 @Readable 13449 public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled"; 13450 13451 /** 13452 * Whether or not show hidden launcher icon apps feature is enabled. 13453 * Type: int (0 for false, 1 for true) 13454 * Default: 1 13455 * @hide 13456 */ 13457 @Readable 13458 public static final String SHOW_HIDDEN_LAUNCHER_ICON_APPS_ENABLED = 13459 "show_hidden_icon_apps_enabled"; 13460 13461 /** 13462 * Whether or not show new app installed notification is enabled. 13463 * Type: int (0 for false, 1 for true) 13464 * Default: 0 13465 * @hide 13466 */ 13467 @Readable 13468 public static final String SHOW_NEW_APP_INSTALLED_NOTIFICATION_ENABLED = 13469 "show_new_app_installed_notification_enabled"; 13470 13471 /** 13472 * Flag to keep background restricted profiles running after exiting. If disabled, 13473 * the restricted profile can be put into stopped state as soon as the user leaves it. 13474 * Type: int (0 for false, 1 for true) 13475 * 13476 * Overridden by the system based on device information. If null, the value specified 13477 * by {@code config_keepRestrictedProfilesInBackground} is used. 13478 * 13479 * @hide 13480 */ 13481 @Readable 13482 public static final String KEEP_PROFILE_IN_BACKGROUND = "keep_profile_in_background"; 13483 13484 /** 13485 * The default time in ms within which a subsequent connection from an always allowed system 13486 * is allowed to reconnect without user interaction. 13487 * 13488 * @hide 13489 */ 13490 public static final long DEFAULT_ADB_ALLOWED_CONNECTION_TIME = 604800000; 13491 13492 /** 13493 * When the user first connects their device to a system a prompt is displayed to allow 13494 * the adb connection with an option to 'Always allow' connections from this system. If the 13495 * user selects this always allow option then the connection time is stored for the system. 13496 * This setting is the time in ms within which a subsequent connection from an always 13497 * allowed system is allowed to reconnect without user interaction. 13498 * 13499 * Type: long 13500 * 13501 * @hide 13502 */ 13503 @Readable 13504 public static final String ADB_ALLOWED_CONNECTION_TIME = 13505 "adb_allowed_connection_time"; 13506 13507 /** 13508 * Scaling factor for normal window animations. 13509 * 13510 * The value is a float. Setting to 0.0f will disable window animations. 13511 */ 13512 @Readable 13513 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale"; 13514 13515 /** 13516 * Setting to disable cross-window blurs. This includes window blur behind, (see 13517 * {@link LayoutParams#setBlurBehindRadius}) and window background blur (see 13518 * {@link Window#setBackgroundBlurRadius}). 13519 * 13520 * The value is a boolean (1 or 0). 13521 * @hide 13522 */ 13523 @TestApi 13524 @Readable 13525 @SuppressLint("NoSettingsProvider") 13526 public static final String DISABLE_WINDOW_BLURS = "disable_window_blurs"; 13527 13528 /** 13529 * Scaling factor for activity transition animations. 13530 * 13531 * The value is a float. Setting to 0.0f will disable window animations. 13532 */ 13533 @Readable 13534 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale"; 13535 13536 /** 13537 * Scaling factor for Animator-based animations. This affects both the 13538 * start delay and duration of all such animations. 13539 * 13540 * The value is a float. Setting to 0.0f will cause animations to end immediately. 13541 * The default value is 1.0f. 13542 */ 13543 @Readable 13544 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale"; 13545 13546 /** 13547 * Scaling factor for normal window animations. Setting to 0 will 13548 * disable window animations. 13549 * 13550 * @hide 13551 */ 13552 @Readable 13553 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations"; 13554 13555 /** 13556 * If 0, the compatibility mode is off for all applications. 13557 * If 1, older applications run under compatibility mode. 13558 * TODO: remove this settings before code freeze (bug/1907571) 13559 * @hide 13560 */ 13561 @Readable 13562 public static final String COMPATIBILITY_MODE = "compatibility_mode"; 13563 13564 /** 13565 * CDMA only settings 13566 * Emergency Tone 0 = Off 13567 * 1 = Alert 13568 * 2 = Vibrate 13569 * @hide 13570 */ 13571 @Readable 13572 public static final String EMERGENCY_TONE = "emergency_tone"; 13573 13574 /** 13575 * CDMA only settings 13576 * Whether the auto retry is enabled. The value is 13577 * boolean (1 or 0). 13578 * @hide 13579 */ 13580 @Readable 13581 public static final String CALL_AUTO_RETRY = "call_auto_retry"; 13582 13583 /** 13584 * A setting that can be read whether the emergency affordance is currently needed. 13585 * The value is a boolean (1 or 0). 13586 * @hide 13587 */ 13588 @Readable 13589 public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed"; 13590 13591 /** 13592 * Whether to enable automatic system server heap dumps. This only works on userdebug or 13593 * eng builds, not on user builds. This is set by the user and overrides the config value. 13594 * 1 means enable, 0 means disable. 13595 * 13596 * @hide 13597 */ 13598 @Readable 13599 public static final String ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS = 13600 "enable_automatic_system_server_heap_dumps"; 13601 13602 /** 13603 * See RIL_PreferredNetworkType in ril.h 13604 * @hide 13605 */ 13606 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 13607 @Readable 13608 public static final String PREFERRED_NETWORK_MODE = 13609 "preferred_network_mode"; 13610 13611 /** 13612 * Name of an application package to be debugged. 13613 */ 13614 @Readable 13615 public static final String DEBUG_APP = "debug_app"; 13616 13617 /** 13618 * If 1, when launching DEBUG_APP it will wait for the debugger before 13619 * starting user code. If 0, it will run normally. 13620 */ 13621 @Readable 13622 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger"; 13623 13624 /** 13625 * Allow GPU debug layers? 13626 * 0 = no 13627 * 1 = yes 13628 * @hide 13629 */ 13630 @Readable 13631 public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers"; 13632 13633 /** 13634 * App allowed to load GPU debug layers 13635 * @hide 13636 */ 13637 @Readable 13638 public static final String GPU_DEBUG_APP = "gpu_debug_app"; 13639 13640 /** 13641 * Package containing ANGLE libraries other than system, which are only available 13642 * to dumpable apps that opt-in. 13643 * @hide 13644 */ 13645 @Readable 13646 public static final String ANGLE_DEBUG_PACKAGE = "angle_debug_package"; 13647 13648 /** 13649 * Force all PKGs to use ANGLE, regardless of any other settings 13650 * The value is a boolean (1 or 0). 13651 * @hide 13652 */ 13653 @Readable 13654 public static final String ANGLE_GL_DRIVER_ALL_ANGLE = "angle_gl_driver_all_angle"; 13655 13656 /** 13657 * List of PKGs that have an OpenGL driver selected 13658 * @hide 13659 */ 13660 @Readable 13661 public static final String ANGLE_GL_DRIVER_SELECTION_PKGS = 13662 "angle_gl_driver_selection_pkgs"; 13663 13664 /** 13665 * List of selected OpenGL drivers, corresponding to the PKGs in GLOBAL_SETTINGS_DRIVER_PKGS 13666 * @hide 13667 */ 13668 @Readable 13669 public static final String ANGLE_GL_DRIVER_SELECTION_VALUES = 13670 "angle_gl_driver_selection_values"; 13671 13672 /** 13673 * List of package names that should check ANGLE rules 13674 * @hide 13675 */ 13676 @Readable 13677 public static final String ANGLE_ALLOWLIST = "angle_allowlist"; 13678 13679 /** 13680 * Lists of ANGLE EGL features for debugging. 13681 * Each list of features is separated by a comma, each feature in each list is separated by 13682 * a colon. 13683 * e.g. feature1:feature2:feature3,feature1:feature3:feature5 13684 * @hide 13685 */ 13686 @Readable 13687 public static final String ANGLE_EGL_FEATURES = "angle_egl_features"; 13688 13689 /** 13690 * Show the "ANGLE In Use" dialog box to the user when ANGLE is the OpenGL driver. 13691 * The value is a boolean (1 or 0). 13692 * @hide 13693 */ 13694 @Readable 13695 public static final String SHOW_ANGLE_IN_USE_DIALOG_BOX = "show_angle_in_use_dialog_box"; 13696 13697 /** 13698 * Updatable driver global preference for all Apps. 13699 * 0 = Default 13700 * 1 = All Apps use updatable production driver 13701 * 2 = All apps use updatable prerelease driver 13702 * 3 = All Apps use system graphics driver 13703 * @hide 13704 */ 13705 @Readable 13706 public static final String UPDATABLE_DRIVER_ALL_APPS = "updatable_driver_all_apps"; 13707 13708 /** 13709 * List of Apps selected to use updatable production driver. 13710 * i.e. <pkg1>,<pkg2>,...,<pkgN> 13711 * @hide 13712 */ 13713 @Readable 13714 public static final String UPDATABLE_DRIVER_PRODUCTION_OPT_IN_APPS = 13715 "updatable_driver_production_opt_in_apps"; 13716 13717 /** 13718 * List of Apps selected to use updatable prerelease driver. 13719 * i.e. <pkg1>,<pkg2>,...,<pkgN> 13720 * @hide 13721 */ 13722 @Readable 13723 public static final String UPDATABLE_DRIVER_PRERELEASE_OPT_IN_APPS = 13724 "updatable_driver_prerelease_opt_in_apps"; 13725 13726 /** 13727 * List of Apps selected not to use updatable production driver. 13728 * i.e. <pkg1>,<pkg2>,...,<pkgN> 13729 * @hide 13730 */ 13731 @Readable 13732 public static final String UPDATABLE_DRIVER_PRODUCTION_OPT_OUT_APPS = 13733 "updatable_driver_production_opt_out_apps"; 13734 13735 /** 13736 * Apps on the denylist that are forbidden to use updatable production driver. 13737 * @hide 13738 */ 13739 @Readable 13740 public static final String UPDATABLE_DRIVER_PRODUCTION_DENYLIST = 13741 "updatable_driver_production_denylist"; 13742 13743 /** 13744 * List of denylists, each denylist is a denylist for a specific version of 13745 * updatable production driver. 13746 * @hide 13747 */ 13748 @Readable 13749 public static final String UPDATABLE_DRIVER_PRODUCTION_DENYLISTS = 13750 "updatable_driver_production_denylists"; 13751 13752 /** 13753 * Apps on the allowlist that are allowed to use updatable production driver. 13754 * The string is a list of application package names, seperated by comma. 13755 * i.e. <apk1>,<apk2>,...,<apkN> 13756 * @hide 13757 */ 13758 @Readable 13759 public static final String UPDATABLE_DRIVER_PRODUCTION_ALLOWLIST = 13760 "updatable_driver_production_allowlist"; 13761 13762 /** 13763 * List of libraries in sphal accessible by updatable driver 13764 * The string is a list of library names, separated by colon. 13765 * i.e. <lib1>:<lib2>:...:<libN> 13766 * @hide 13767 */ 13768 @Readable 13769 public static final String UPDATABLE_DRIVER_SPHAL_LIBRARIES = 13770 "updatable_driver_sphal_libraries"; 13771 13772 /** 13773 * Ordered GPU debug layer list for Vulkan 13774 * i.e. <layer1>:<layer2>:...:<layerN> 13775 * @hide 13776 */ 13777 @Readable 13778 public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers"; 13779 13780 /** 13781 * Ordered GPU debug layer list for GLES 13782 * i.e. <layer1>:<layer2>:...:<layerN> 13783 * @hide 13784 */ 13785 @Readable 13786 public static final String GPU_DEBUG_LAYERS_GLES = "gpu_debug_layers_gles"; 13787 13788 /** 13789 * Addition app for GPU layer discovery 13790 * @hide 13791 */ 13792 @Readable 13793 public static final String GPU_DEBUG_LAYER_APP = "gpu_debug_layer_app"; 13794 13795 /** 13796 * Control whether the process CPU usage meter should be shown. 13797 * 13798 * @deprecated This functionality is no longer available as of 13799 * {@link android.os.Build.VERSION_CODES#N_MR1}. 13800 */ 13801 @Deprecated 13802 @Readable 13803 public static final String SHOW_PROCESSES = "show_processes"; 13804 13805 /** 13806 * If 1 low power mode (aka battery saver) is enabled. 13807 * @hide 13808 */ 13809 @TestApi 13810 @Readable 13811 public static final String LOW_POWER_MODE = "low_power"; 13812 13813 /** 13814 * If 1, battery saver ({@link #LOW_POWER_MODE}) will be re-activated after the device 13815 * is unplugged from a charger or rebooted. 13816 * @hide 13817 */ 13818 @TestApi 13819 @Readable 13820 public static final String LOW_POWER_MODE_STICKY = "low_power_sticky"; 13821 13822 /** 13823 * When a device is unplugged from a changer (or is rebooted), do not re-activate battery 13824 * saver even if {@link #LOW_POWER_MODE_STICKY} is 1, if the battery level is equal to or 13825 * above this threshold. 13826 * 13827 * @hide 13828 */ 13829 @Readable 13830 public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL = 13831 "low_power_sticky_auto_disable_level"; 13832 13833 /** 13834 * Whether sticky battery saver should be deactivated once the battery level has reached the 13835 * threshold specified by {@link #LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL}. 13836 * 13837 * @hide 13838 */ 13839 @Readable 13840 public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED = 13841 "low_power_sticky_auto_disable_enabled"; 13842 13843 /** 13844 * Battery level [1-100] at which low power mode automatically turns on. 13845 * If 0, it will not automatically turn on. For Q and newer, it will only automatically 13846 * turn on if the value is greater than 0 and the {@link #AUTOMATIC_POWER_SAVE_MODE} 13847 * setting is also set to 13848 * {@link android.os.PowerManager.AutoPowerSaveMode#POWER_SAVE_MODE_TRIGGER_PERCENTAGE}. 13849 * @see #AUTOMATIC_POWER_SAVE_MODE 13850 * @see android.os.PowerManager#getPowerSaveModeTrigger() 13851 * @hide 13852 */ 13853 @Readable 13854 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level"; 13855 13856 /** 13857 * Whether battery saver is currently set to trigger based on percentage, dynamic power 13858 * savings trigger, or none. See {@link AutoPowerSaveModeTriggers} for 13859 * accepted values. 13860 * 13861 * @hide 13862 */ 13863 @TestApi 13864 @Readable 13865 public static final String AUTOMATIC_POWER_SAVE_MODE = "automatic_power_save_mode"; 13866 13867 /** 13868 * The setting that backs the disable threshold for the setPowerSavingsWarning api in 13869 * PowerManager 13870 * 13871 * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int) 13872 * @hide 13873 */ 13874 @TestApi 13875 @Readable 13876 public static final String DYNAMIC_POWER_SAVINGS_DISABLE_THRESHOLD = 13877 "dynamic_power_savings_disable_threshold"; 13878 13879 /** 13880 * The setting which backs the setDynamicPowerSaveHint api in PowerManager. 13881 * 13882 * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int) 13883 * @hide 13884 */ 13885 @TestApi 13886 @Readable 13887 public static final String DYNAMIC_POWER_SAVINGS_ENABLED = "dynamic_power_savings_enabled"; 13888 13889 /** 13890 * A long value indicating how much longer the system battery is estimated to last in 13891 * millis. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value 13892 * was updated. 13893 * 13894 * @deprecated Use {@link PowerManager#getBatteryDischargePrediction()} instead. 13895 * @hide 13896 */ 13897 @Deprecated 13898 @Readable 13899 public static final String TIME_REMAINING_ESTIMATE_MILLIS = 13900 "time_remaining_estimate_millis"; 13901 13902 /** 13903 * A boolean indicating whether {@link #TIME_REMAINING_ESTIMATE_MILLIS} is customized 13904 * to the device's usage or using global models. See 13905 * {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value was updated. 13906 * 13907 * @deprecated Use {@link PowerManager#isBatteryDischargePredictionPersonalized()} instead. 13908 * 13909 * @hide 13910 */ 13911 @Deprecated 13912 @Readable 13913 public static final String TIME_REMAINING_ESTIMATE_BASED_ON_USAGE = 13914 "time_remaining_estimate_based_on_usage"; 13915 13916 /** 13917 * A long value indicating how long the system battery takes to deplete from 100% to 0% on 13918 * average based on historical drain rates. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} 13919 * for the last time this value was updated. 13920 * 13921 * @deprecated Use {@link PowerManager#getHistoricalDischargeTime()} instead. 13922 * @hide 13923 */ 13924 @Deprecated 13925 @Readable 13926 public static final String AVERAGE_TIME_TO_DISCHARGE = "average_time_to_discharge"; 13927 13928 /** 13929 * A long indicating the epoch time in milliseconds when 13930 * {@link #TIME_REMAINING_ESTIMATE_MILLIS}, {@link #TIME_REMAINING_ESTIMATE_BASED_ON_USAGE}, 13931 * and {@link #AVERAGE_TIME_TO_DISCHARGE} were last updated. 13932 * 13933 * @hide 13934 * @deprecated No longer needed due to {@link PowerManager#getBatteryDischargePrediction}. 13935 */ 13936 @Deprecated 13937 @Readable 13938 public static final String BATTERY_ESTIMATES_LAST_UPDATE_TIME = 13939 "battery_estimates_last_update_time"; 13940 13941 /** 13942 * The max value for {@link #LOW_POWER_MODE_TRIGGER_LEVEL}. If this setting is not set 13943 * or the value is 0, the default max will be used. 13944 * 13945 * @hide 13946 */ 13947 @Readable 13948 public static final String LOW_POWER_MODE_TRIGGER_LEVEL_MAX = "low_power_trigger_level_max"; 13949 13950 /** 13951 * See com.android.settingslib.fuelgauge.BatterySaverUtils. 13952 * @hide 13953 */ 13954 @Readable 13955 public static final String LOW_POWER_MODE_SUGGESTION_PARAMS = 13956 "low_power_mode_suggestion_params"; 13957 13958 /** 13959 * If not 0, the activity manager will aggressively finish activities and 13960 * processes as soon as they are no longer needed. If 0, the normal 13961 * extended lifetime is used. 13962 */ 13963 @Readable 13964 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities"; 13965 13966 /** 13967 * If nonzero, all system error dialogs will be hidden. For example, the 13968 * crash and ANR dialogs will not be shown, and the system will just proceed 13969 * as if they had been accepted by the user. 13970 * @hide 13971 */ 13972 @TestApi 13973 @Readable 13974 public static final String HIDE_ERROR_DIALOGS = "hide_error_dialogs"; 13975 13976 /** 13977 * Use Dock audio output for media: 13978 * 0 = disabled 13979 * 1 = enabled 13980 * @hide 13981 */ 13982 @Readable 13983 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled"; 13984 13985 /** 13986 * The surround sound formats AC3, DTS or IEC61937 are 13987 * available for use if they are detected. 13988 * This is the default mode. 13989 * 13990 * Note that AUTO is equivalent to ALWAYS for Android TVs and other 13991 * devices that have an S/PDIF output. This is because S/PDIF 13992 * is unidirectional and the TV cannot know if a decoder is 13993 * connected. So it assumes they are always available. 13994 * @hide 13995 */ 13996 public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0; 13997 13998 /** 13999 * AC3, DTS or IEC61937 are NEVER available, even if they 14000 * are detected by the hardware. Those formats will not be 14001 * reported. 14002 * 14003 * An example use case would be an AVR reports that it is capable of 14004 * surround sound decoding but is broken. If NEVER is chosen 14005 * then apps must use PCM output instead of encoded output. 14006 * @hide 14007 */ 14008 public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1; 14009 14010 /** 14011 * AC3, DTS or IEC61937 are ALWAYS available, even if they 14012 * are not detected by the hardware. Those formats will be 14013 * reported as part of the HDMI output capability. Applications 14014 * are then free to use either PCM or encoded output. 14015 * 14016 * An example use case would be a when TV was connected over 14017 * TOS-link to an AVR. But the TV could not see it because TOS-link 14018 * is unidirectional. 14019 * @hide 14020 */ 14021 public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2; 14022 14023 /** 14024 * Surround sound formats are available according to the choice 14025 * of user, even if they are not detected by the hardware. Those 14026 * formats will be reported as part of the HDMI output capability. 14027 * Applications are then free to use either PCM or encoded output. 14028 * 14029 * An example use case would be an AVR that doesn't report a surround 14030 * format while the user knows the AVR does support it. 14031 * @hide 14032 */ 14033 public static final int ENCODED_SURROUND_OUTPUT_MANUAL = 3; 14034 14035 /** 14036 * The maximum value for surround sound output mode in Android S. 14037 * @hide 14038 */ 14039 public static final int ENCODED_SURROUND_SC_MAX = ENCODED_SURROUND_OUTPUT_MANUAL; 14040 14041 /** 14042 * Set to ENCODED_SURROUND_OUTPUT_AUTO, 14043 * ENCODED_SURROUND_OUTPUT_NEVER, 14044 * ENCODED_SURROUND_OUTPUT_ALWAYS or 14045 * ENCODED_SURROUND_OUTPUT_MANUAL 14046 * @hide 14047 */ 14048 @Readable 14049 public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output"; 14050 14051 /** 14052 * Surround sounds formats that are enabled when ENCODED_SURROUND_OUTPUT is set to 14053 * ENCODED_SURROUND_OUTPUT_MANUAL. Encoded as comma separated list. Allowed values 14054 * are the format constants defined in AudioFormat.java. Ex: 14055 * 14056 * "5,6" 14057 * 14058 * @hide 14059 */ 14060 @Readable 14061 public static final String ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS = 14062 "encoded_surround_output_enabled_formats"; 14063 14064 /** 14065 * Persisted safe headphone volume management state by AudioService 14066 * @hide 14067 */ 14068 @Readable 14069 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state"; 14070 14071 /** 14072 * URL for tzinfo (time zone) updates 14073 * @hide 14074 */ 14075 @Readable 14076 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url"; 14077 14078 /** 14079 * URL for tzinfo (time zone) update metadata 14080 * @hide 14081 */ 14082 @Readable 14083 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url"; 14084 14085 /** 14086 * URL for selinux (mandatory access control) updates 14087 * @hide 14088 */ 14089 @Readable 14090 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url"; 14091 14092 /** 14093 * URL for selinux (mandatory access control) update metadata 14094 * @hide 14095 */ 14096 @Readable 14097 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url"; 14098 14099 /** 14100 * URL for sms short code updates 14101 * @hide 14102 */ 14103 @Readable 14104 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL = 14105 "sms_short_codes_content_url"; 14106 14107 /** 14108 * URL for sms short code update metadata 14109 * @hide 14110 */ 14111 @Readable 14112 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL = 14113 "sms_short_codes_metadata_url"; 14114 14115 /** 14116 * URL for apn_db updates 14117 * @hide 14118 */ 14119 @Readable 14120 public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url"; 14121 14122 /** 14123 * URL for apn_db update metadata 14124 * @hide 14125 */ 14126 @Readable 14127 public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url"; 14128 14129 /** 14130 * URL for cert pinlist updates 14131 * @hide 14132 */ 14133 @Readable 14134 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url"; 14135 14136 /** 14137 * URL for cert pinlist updates 14138 * @hide 14139 */ 14140 @Readable 14141 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url"; 14142 14143 /** 14144 * URL for intent firewall updates 14145 * @hide 14146 */ 14147 @Readable 14148 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL = 14149 "intent_firewall_content_url"; 14150 14151 /** 14152 * URL for intent firewall update metadata 14153 * @hide 14154 */ 14155 @Readable 14156 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL = 14157 "intent_firewall_metadata_url"; 14158 14159 /** 14160 * URL for lang id model updates 14161 * @hide 14162 */ 14163 @Readable 14164 public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url"; 14165 14166 /** 14167 * URL for lang id model update metadata 14168 * @hide 14169 */ 14170 @Readable 14171 public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url"; 14172 14173 /** 14174 * URL for smart selection model updates 14175 * @hide 14176 */ 14177 @Readable 14178 public static final String SMART_SELECTION_UPDATE_CONTENT_URL = 14179 "smart_selection_content_url"; 14180 14181 /** 14182 * URL for smart selection model update metadata 14183 * @hide 14184 */ 14185 @Readable 14186 public static final String SMART_SELECTION_UPDATE_METADATA_URL = 14187 "smart_selection_metadata_url"; 14188 14189 /** 14190 * URL for conversation actions model updates 14191 * @hide 14192 */ 14193 @Readable 14194 public static final String CONVERSATION_ACTIONS_UPDATE_CONTENT_URL = 14195 "conversation_actions_content_url"; 14196 14197 /** 14198 * URL for conversation actions model update metadata 14199 * @hide 14200 */ 14201 @Readable 14202 public static final String CONVERSATION_ACTIONS_UPDATE_METADATA_URL = 14203 "conversation_actions_metadata_url"; 14204 14205 /** 14206 * SELinux enforcement status. If 0, permissive; if 1, enforcing. 14207 * @hide 14208 */ 14209 @Readable 14210 public static final String SELINUX_STATUS = "selinux_status"; 14211 14212 /** 14213 * Developer setting to force RTL layout. 14214 * @hide 14215 */ 14216 @Readable 14217 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl"; 14218 14219 /** 14220 * Milliseconds after screen-off after which low battery sounds will be silenced. 14221 * 14222 * If zero, battery sounds will always play. 14223 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider. 14224 * 14225 * @hide 14226 */ 14227 @Readable 14228 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout"; 14229 14230 /** 14231 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after 14232 * the caller is done with this, they should call {@link ContentResolver#delete} to 14233 * clean up any value that they may have written. 14234 * 14235 * @hide 14236 */ 14237 @Readable 14238 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms"; 14239 14240 /** 14241 * Defines global runtime overrides to window policy. 14242 * 14243 * See {@link com.android.server.wm.PolicyControl} for value format. 14244 * 14245 * @hide 14246 */ 14247 @Readable 14248 public static final String POLICY_CONTROL = "policy_control"; 14249 14250 /** 14251 * {@link android.view.DisplayCutout DisplayCutout} emulation mode. 14252 * 14253 * @hide 14254 */ 14255 @Readable 14256 public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout"; 14257 14258 /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0; 14259 /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1; 14260 14261 /** 14262 * A colon separated list of keys for Settings Slices. 14263 * 14264 * @hide 14265 */ 14266 @Readable 14267 public static final String BLOCKED_SLICES = "blocked_slices"; 14268 14269 /** 14270 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS, 14271 * or ZEN_MODE_NO_INTERRUPTIONS. 14272 * 14273 * @hide 14274 */ 14275 @UnsupportedAppUsage 14276 @Readable 14277 public static final String ZEN_MODE = "zen_mode"; 14278 14279 /** @hide */ 14280 @UnsupportedAppUsage 14281 public static final int ZEN_MODE_OFF = 0; 14282 /** @hide */ 14283 @UnsupportedAppUsage 14284 public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1; 14285 /** @hide */ 14286 @UnsupportedAppUsage 14287 public static final int ZEN_MODE_NO_INTERRUPTIONS = 2; 14288 /** @hide */ 14289 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 14290 public static final int ZEN_MODE_ALARMS = 3; 14291 14292 /** 14293 * A comma-separated list of HDR formats that have been disabled by the user. 14294 * <p> 14295 * If present, these formats will not be reported to apps, even if the display supports 14296 * them. This list is treated as empty if the ARE_USER_DISABLED_HDR_FORMATS_ALLOWED setting 14297 * is '1'. 14298 * </p> 14299 * @hide 14300 */ 14301 @TestApi 14302 @Readable 14303 @SuppressLint("NoSettingsProvider") 14304 public static final String USER_DISABLED_HDR_FORMATS = "user_disabled_hdr_formats"; 14305 14306 /** 14307 * Whether or not user-disabled HDR formats are allowed. 14308 * <p> 14309 * The value is boolean (1 or 0). The value '1' means the user preference for disabling a 14310 * format is ignored, and the disabled formats are still reported to apps (if supported 14311 * by the display). The value '0' means the user-disabled formats are not reported to 14312 * apps, even if the display supports them. 14313 * </p><p> 14314 * The list of formats disabled by the user are contained in the 14315 * USER_DISABLED_HDR_FORMATS setting. This list is treated as empty when the value of 14316 * this setting is '1'. 14317 * </p> 14318 * @hide 14319 */ 14320 @TestApi 14321 @Readable 14322 @SuppressLint("NoSettingsProvider") 14323 public static final String ARE_USER_DISABLED_HDR_FORMATS_ALLOWED = 14324 "are_user_disabled_hdr_formats_allowed"; 14325 14326 /** 14327 * Whether or not syncs (bulk set operations) for {@link DeviceConfig} are disabled 14328 * currently. The value is boolean (1 or 0). The value '1' means that {@link 14329 * DeviceConfig#setProperties(DeviceConfig.Properties)} will return {@code false}. 14330 * 14331 * @hide 14332 */ 14333 public static final String DEVICE_CONFIG_SYNC_DISABLED = "device_config_sync_disabled"; 14334 zenModeToString(int mode)14335 /** @hide */ public static String zenModeToString(int mode) { 14336 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS"; 14337 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS"; 14338 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS"; 14339 return "ZEN_MODE_OFF"; 14340 } 14341 isValidZenMode(int value)14342 /** @hide */ public static boolean isValidZenMode(int value) { 14343 switch (value) { 14344 case Global.ZEN_MODE_OFF: 14345 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS: 14346 case Global.ZEN_MODE_ALARMS: 14347 case Global.ZEN_MODE_NO_INTERRUPTIONS: 14348 return true; 14349 default: 14350 return false; 14351 } 14352 } 14353 14354 /** 14355 * Value of the ringer before entering zen mode. 14356 * 14357 * @hide 14358 */ 14359 @Readable 14360 public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level"; 14361 14362 /** 14363 * Opaque value, changes when persisted zen mode configuration changes. 14364 * 14365 * @hide 14366 */ 14367 @UnsupportedAppUsage 14368 @Readable 14369 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag"; 14370 14371 /** 14372 * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION} instead 14373 * @hide 14374 */ 14375 @Deprecated 14376 public static final String ZEN_DURATION = "zen_duration"; 14377 14378 /** 14379 * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_PROMPT} instead 14380 * @hide 14381 */ 14382 @Deprecated 14383 public static final int ZEN_DURATION_PROMPT = -1; 14384 14385 /** 14386 * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_FOREVER} instead 14387 * @hide 14388 */ 14389 @Deprecated 14390 public static final int ZEN_DURATION_FOREVER = 0; 14391 14392 /** 14393 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON. 14394 * 14395 * @hide 14396 */ 14397 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 14398 @Readable 14399 public static final String HEADS_UP_NOTIFICATIONS_ENABLED = 14400 "heads_up_notifications_enabled"; 14401 14402 /** @hide */ 14403 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 14404 public static final int HEADS_UP_OFF = 0; 14405 /** @hide */ 14406 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 14407 public static final int HEADS_UP_ON = 1; 14408 14409 /** 14410 * The name of the device 14411 */ 14412 @Readable 14413 public static final String DEVICE_NAME = "device_name"; 14414 14415 /** 14416 * Whether the NetworkScoringService has been first initialized. 14417 * <p> 14418 * Type: int (0 for false, 1 for true) 14419 * @hide 14420 */ 14421 @Readable 14422 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned"; 14423 14424 /** 14425 * Indicates whether the user wants to be prompted for password to decrypt the device on 14426 * boot. This only matters if the storage is encrypted. 14427 * <p> 14428 * Type: int (0 for false, 1 for true) 14429 * 14430 * @hide 14431 */ 14432 @SystemApi 14433 @Readable 14434 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt"; 14435 14436 /** 14437 * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config 14438 * value 14439 * {@link android.telephony.CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL}. 14440 * <p> 14441 * Type: int (0 for false, 1 for true) 14442 * @hide 14443 * @deprecated Use 14444 * {@link android.provider.Telephony.SimInfo#COLUMN_ENHANCED_4G_MODE_ENABLED} instead. 14445 */ 14446 @Deprecated 14447 @Readable 14448 public static final String ENHANCED_4G_MODE_ENABLED = 14449 Telephony.SimInfo.COLUMN_ENHANCED_4G_MODE_ENABLED; 14450 14451 /** 14452 * Whether VT (Video Telephony over IMS) is enabled 14453 * <p> 14454 * Type: int (0 for false, 1 for true) 14455 * 14456 * @hide 14457 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_VT_IMS_ENABLED} instead. 14458 */ 14459 @Deprecated 14460 @Readable 14461 public static final String VT_IMS_ENABLED = Telephony.SimInfo.COLUMN_VT_IMS_ENABLED; 14462 14463 /** 14464 * Whether WFC is enabled 14465 * <p> 14466 * Type: int (0 for false, 1 for true) 14467 * 14468 * @hide 14469 * @deprecated Use 14470 * {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ENABLED} instead. 14471 */ 14472 @Deprecated 14473 @Readable 14474 public static final String WFC_IMS_ENABLED = Telephony.SimInfo.COLUMN_WFC_IMS_ENABLED; 14475 14476 /** 14477 * WFC mode on home/non-roaming network. 14478 * <p> 14479 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only 14480 * 14481 * @hide 14482 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_MODE} instead. 14483 */ 14484 @Deprecated 14485 @Readable 14486 public static final String WFC_IMS_MODE = Telephony.SimInfo.COLUMN_WFC_IMS_MODE; 14487 14488 /** 14489 * WFC mode on roaming network. 14490 * <p> 14491 * Type: int - see {@link #WFC_IMS_MODE} for values 14492 * 14493 * @hide 14494 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ROAMING_MODE} 14495 * instead. 14496 */ 14497 @Deprecated 14498 @Readable 14499 public static final String WFC_IMS_ROAMING_MODE = 14500 Telephony.SimInfo.COLUMN_WFC_IMS_ROAMING_MODE; 14501 14502 /** 14503 * Whether WFC roaming is enabled 14504 * <p> 14505 * Type: int (0 for false, 1 for true) 14506 * 14507 * @hide 14508 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ROAMING_ENABLED} 14509 * instead 14510 */ 14511 @Deprecated 14512 @Readable 14513 public static final String WFC_IMS_ROAMING_ENABLED = 14514 Telephony.SimInfo.COLUMN_WFC_IMS_ROAMING_ENABLED; 14515 14516 /** 14517 * Whether user can enable/disable LTE as a preferred network. A carrier might control 14518 * this via gservices, OMA-DM, carrier app, etc. 14519 * <p> 14520 * Type: int (0 for false, 1 for true) 14521 * @hide 14522 */ 14523 @Readable 14524 public static final String LTE_SERVICE_FORCED = "lte_service_forced"; 14525 14526 14527 /** 14528 * Specifies the behaviour the lid triggers when closed 14529 * <p> 14530 * See WindowManagerPolicy.WindowManagerFuncs 14531 * @hide 14532 */ 14533 @Readable 14534 public static final String LID_BEHAVIOR = "lid_behavior"; 14535 14536 /** 14537 * Ephemeral app cookie max size in bytes. 14538 * <p> 14539 * Type: int 14540 * @hide 14541 */ 14542 @Readable 14543 public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES = 14544 "ephemeral_cookie_max_size_bytes"; 14545 14546 /** 14547 * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is 14548 * enabled. Set to zero to disable. 14549 * <p> 14550 * Type: int (0 for false, 1 for true) 14551 * 14552 * @hide 14553 */ 14554 @Readable 14555 public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature"; 14556 14557 /** 14558 * Toggle to enable/disable dexopt for instant applications. The default is for dexopt 14559 * to be disabled. 14560 * <p> 14561 * Type: int (0 to disable, 1 to enable) 14562 * 14563 * @hide 14564 */ 14565 @Readable 14566 public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled"; 14567 14568 /** 14569 * The min period for caching installed instant apps in milliseconds. 14570 * <p> 14571 * Type: long 14572 * @hide 14573 */ 14574 @Readable 14575 public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = 14576 "installed_instant_app_min_cache_period"; 14577 14578 /** 14579 * The max period for caching installed instant apps in milliseconds. 14580 * <p> 14581 * Type: long 14582 * @hide 14583 */ 14584 @Readable 14585 public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = 14586 "installed_instant_app_max_cache_period"; 14587 14588 /** 14589 * The min period for caching uninstalled instant apps in milliseconds. 14590 * <p> 14591 * Type: long 14592 * @hide 14593 */ 14594 @Readable 14595 public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = 14596 "uninstalled_instant_app_min_cache_period"; 14597 14598 /** 14599 * The max period for caching uninstalled instant apps in milliseconds. 14600 * <p> 14601 * Type: long 14602 * @hide 14603 */ 14604 @Readable 14605 public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = 14606 "uninstalled_instant_app_max_cache_period"; 14607 14608 /** 14609 * The min period for caching unused static shared libs in milliseconds. 14610 * <p> 14611 * Type: long 14612 * @hide 14613 */ 14614 @Readable 14615 public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD = 14616 "unused_static_shared_lib_min_cache_period"; 14617 14618 /** 14619 * Allows switching users when system user is locked. 14620 * <p> 14621 * Type: int 14622 * @hide 14623 */ 14624 @Readable 14625 public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED = 14626 "allow_user_switching_when_system_user_locked"; 14627 14628 /** 14629 * Boot count since the device starts running API level 24. 14630 * <p> 14631 * Type: int 14632 */ 14633 @Readable 14634 public static final String BOOT_COUNT = "boot_count"; 14635 14636 /** 14637 * Whether the safe boot is disallowed. 14638 * 14639 * <p>This setting should have the identical value as the corresponding user restriction. 14640 * The purpose of the setting is to make the restriction available in early boot stages 14641 * before the user restrictions are loaded. 14642 * @hide 14643 */ 14644 @Readable 14645 public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed"; 14646 14647 /** 14648 * Indicates whether this device is currently in retail demo mode. If true, the device 14649 * usage is severely limited. 14650 * <p> 14651 * Type: int (0 for false, 1 for true) 14652 * 14653 * @hide 14654 */ 14655 @SystemApi 14656 @Readable 14657 public static final String DEVICE_DEMO_MODE = "device_demo_mode"; 14658 14659 /** 14660 * Indicates the maximum time that an app is blocked for the network rules to get updated. 14661 * 14662 * Type: long 14663 * 14664 * @hide 14665 */ 14666 @Readable 14667 public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms"; 14668 14669 /** 14670 * The reason for the settings database being downgraded. This is only for 14671 * troubleshooting purposes and its value should not be interpreted in any way. 14672 * 14673 * Type: string 14674 * 14675 * @hide 14676 */ 14677 @Readable 14678 public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason"; 14679 14680 /** 14681 * The build id of when the settings database was first created (or re-created due it 14682 * being missing). 14683 * 14684 * Type: string 14685 * 14686 * @hide 14687 */ 14688 @Readable 14689 public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid"; 14690 14691 /** 14692 * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by 14693 * default. Set to 0 to disable. 14694 * 14695 * @hide 14696 */ 14697 @Readable 14698 public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled"; 14699 14700 /** 14701 * Flag to enable the link to location permissions in location setting. Set to 0 to disable. 14702 * 14703 * @hide 14704 */ 14705 @Readable 14706 public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED = 14707 "location_settings_link_to_permissions_enabled"; 14708 14709 /** 14710 * Flag to set the waiting time for removing invisible euicc profiles inside System > 14711 * Settings. 14712 * Type: long 14713 * 14714 * @hide 14715 */ 14716 @Readable 14717 public static final String EUICC_REMOVING_INVISIBLE_PROFILES_TIMEOUT_MILLIS = 14718 "euicc_removing_invisible_profiles_timeout_millis"; 14719 14720 /** 14721 * Flag to set the waiting time for euicc factory reset inside System > Settings 14722 * Type: long 14723 * 14724 * @hide 14725 */ 14726 @Readable 14727 public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS = 14728 "euicc_factory_reset_timeout_millis"; 14729 14730 /** 14731 * Flag to set the waiting time for euicc slot switch. 14732 * Type: long 14733 * 14734 * @hide 14735 */ 14736 public static final String EUICC_SWITCH_SLOT_TIMEOUT_MILLIS = 14737 "euicc_switch_slot_timeout_millis"; 14738 14739 /** 14740 * Flag to set the waiting time for enabling multi SIM slot. 14741 * Type: long 14742 * 14743 * @hide 14744 */ 14745 public static final String ENABLE_MULTI_SLOT_TIMEOUT_MILLIS = 14746 "enable_multi_slot_timeout_millis"; 14747 14748 /** 14749 * Flag to set the timeout for when to refresh the storage settings cached data. 14750 * Type: long 14751 * 14752 * @hide 14753 */ 14754 @Readable 14755 public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD = 14756 "storage_settings_clobber_threshold"; 14757 14758 /** 14759 * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored 14760 * and restoring to lower version of platform API will be skipped. 14761 * 14762 * @hide 14763 */ 14764 @Readable 14765 public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION = 14766 "override_settings_provider_restore_any_version"; 14767 /** 14768 * Flag to toggle whether system services report attribution chains when they attribute 14769 * battery use via a {@code WorkSource}. 14770 * 14771 * Type: int (0 to disable, 1 to enable) 14772 * 14773 * @hide 14774 */ 14775 @Readable 14776 public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED = 14777 "chained_battery_attribution_enabled"; 14778 14779 /** 14780 * Toggle to enable/disable the incremental ADB installation by default. 14781 * If not set, default adb installations are incremental; set to zero to use full ones. 14782 * Note: only ADB uses it, no usages in the Framework code. 14783 * <p> 14784 * Type: int (0 to disable, 1 to enable) 14785 * 14786 * @hide 14787 */ 14788 @Readable 14789 public static final String ENABLE_ADB_INCREMENTAL_INSTALL_DEFAULT = 14790 "enable_adb_incremental_install_default"; 14791 14792 /** 14793 * The packages whitelisted to be run in autofill compatibility mode. The list 14794 * of packages is {@code ":"} colon delimited, and each entry has the name of the 14795 * package and an optional list of url bar resource ids (the list is delimited by 14796 * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited). 14797 * 14798 * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where 14799 * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 } 14800 * have 2 ids {@code url_foo} and {@code url_bas}) would be 14801 * {@code p1[url_bar]:p2:p3[url_foo,url_bas]} 14802 * 14803 * @hide 14804 */ 14805 @SystemApi 14806 @Readable 14807 public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES = 14808 "autofill_compat_mode_allowed_packages"; 14809 14810 /** 14811 * Level of autofill logging. 14812 * 14813 * <p>Valid values are 14814 * {@link android.view.autofill.AutofillManager#NO_LOGGING}, 14815 * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_DEBUG}, or 14816 * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_VERBOSE}. 14817 * 14818 * @hide 14819 */ 14820 @Readable 14821 public static final String AUTOFILL_LOGGING_LEVEL = "autofill_logging_level"; 14822 14823 /** 14824 * Maximum number of partitions that can be allowed in an autofill session. 14825 * 14826 * @hide 14827 */ 14828 @Readable 14829 public static final String AUTOFILL_MAX_PARTITIONS_SIZE = "autofill_max_partitions_size"; 14830 14831 /** 14832 * Maximum number of visible datasets in the Autofill dataset picker UI, or {@code 0} to use 14833 * the default value from resources. 14834 * 14835 * @hide 14836 */ 14837 @Readable 14838 public static final String AUTOFILL_MAX_VISIBLE_DATASETS = "autofill_max_visible_datasets"; 14839 14840 /** 14841 * Exemptions to the hidden API blacklist. 14842 * 14843 * @hide 14844 */ 14845 @TestApi 14846 @Readable 14847 public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS = 14848 "hidden_api_blacklist_exemptions"; 14849 14850 /** 14851 * Hidden API enforcement policy for apps. 14852 * 14853 * Values correspond to @{@link 14854 * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy} 14855 * 14856 * @hide 14857 */ 14858 @TestApi 14859 @Readable 14860 public static final String HIDDEN_API_POLICY = "hidden_api_policy"; 14861 14862 /** 14863 * Flag for forcing {@link com.android.server.compat.OverrideValidatorImpl} 14864 * to consider this a non-debuggable build. 14865 * 14866 * @hide 14867 */ 14868 public static final String FORCE_NON_DEBUGGABLE_FINAL_BUILD_FOR_COMPAT = 14869 "force_non_debuggable_final_build_for_compat"; 14870 14871 14872 /** 14873 * Current version of signed configuration applied. 14874 * 14875 * @hide 14876 */ 14877 @Readable 14878 public static final String SIGNED_CONFIG_VERSION = "signed_config_version"; 14879 14880 /** 14881 * Timeout for a single {@link android.media.soundtrigger.SoundTriggerDetectionService} 14882 * operation (in ms). 14883 * 14884 * @hide 14885 */ 14886 @Readable 14887 public static final String SOUND_TRIGGER_DETECTION_SERVICE_OP_TIMEOUT = 14888 "sound_trigger_detection_service_op_timeout"; 14889 14890 /** 14891 * Maximum number of {@link android.media.soundtrigger.SoundTriggerDetectionService} 14892 * operations per day. 14893 * 14894 * @hide 14895 */ 14896 @Readable 14897 public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY = 14898 "max_sound_trigger_detection_service_ops_per_day"; 14899 14900 /** 14901 * Indicates whether aware is available in the current location. 14902 * @hide 14903 */ 14904 @Readable 14905 public static final String AWARE_ALLOWED = "aware_allowed"; 14906 14907 /** 14908 * Overrides internal R.integer.config_longPressOnPowerBehavior. 14909 * Allowable values detailed in frameworks/base/core/res/res/values/config.xml. 14910 * Used by PhoneWindowManager. 14911 * @hide 14912 */ 14913 @Readable 14914 public static final String POWER_BUTTON_LONG_PRESS = 14915 "power_button_long_press"; 14916 14917 /** 14918 * Overrides internal R.integer.config_veryLongPressOnPowerBehavior. 14919 * Allowable values detailed in frameworks/base/core/res/res/values/config.xml. 14920 * Used by PhoneWindowManager. 14921 * @hide 14922 */ 14923 @Readable 14924 public static final String POWER_BUTTON_VERY_LONG_PRESS = 14925 "power_button_very_long_press"; 14926 14927 /** 14928 * Overrides internal R.integer.config_keyChordPowerVolumeUp. 14929 * Allowable values detailed in frameworks/base/core/res/res/values/config.xml. 14930 * Used by PhoneWindowManager. 14931 * @hide 14932 */ 14933 @Readable 14934 public static final String KEY_CHORD_POWER_VOLUME_UP = 14935 "key_chord_power_volume_up"; 14936 14937 /** 14938 * Keyguard should be on the left hand side of the screen, for wide screen layouts. 14939 * 14940 * @hide 14941 */ 14942 public static final int ONE_HANDED_KEYGUARD_SIDE_LEFT = 0; 14943 14944 /** 14945 * Keyguard should be on the right hand side of the screen, for wide screen layouts. 14946 * 14947 * @hide 14948 */ 14949 public static final int ONE_HANDED_KEYGUARD_SIDE_RIGHT = 1; 14950 /** 14951 * In one handed mode, which side the keyguard should be on. Allowable values are one of 14952 * the ONE_HANDED_KEYGUARD_SIDE_* constants. 14953 * 14954 * @hide 14955 */ 14956 public static final String ONE_HANDED_KEYGUARD_SIDE = "one_handed_keyguard_side"; 14957 14958 /** 14959 * Keys we no longer back up under the current schema, but want to continue to 14960 * process when restoring historical backup datasets. 14961 * 14962 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, 14963 * otherwise they won't be restored. 14964 * 14965 * @hide 14966 */ 14967 public static final String[] LEGACY_RESTORE_SETTINGS = { 14968 }; 14969 14970 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 14971 private static final ContentProviderHolder sProviderHolder = 14972 new ContentProviderHolder(CONTENT_URI); 14973 14974 // Populated lazily, guarded by class object: 14975 @UnsupportedAppUsage 14976 private static final NameValueCache sNameValueCache = new NameValueCache( 14977 CONTENT_URI, 14978 CALL_METHOD_GET_GLOBAL, 14979 CALL_METHOD_PUT_GLOBAL, 14980 sProviderHolder, 14981 Global.class); 14982 14983 // Certain settings have been moved from global to the per-user secure namespace 14984 @UnsupportedAppUsage 14985 private static final HashSet<String> MOVED_TO_SECURE; 14986 static { 14987 MOVED_TO_SECURE = new HashSet<>(8); 14988 MOVED_TO_SECURE.add(Global.INSTALL_NON_MARKET_APPS); 14989 MOVED_TO_SECURE.add(Global.ZEN_DURATION); 14990 MOVED_TO_SECURE.add(Global.SHOW_ZEN_UPGRADE_NOTIFICATION); 14991 MOVED_TO_SECURE.add(Global.SHOW_ZEN_SETTINGS_SUGGESTION); 14992 MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_UPDATED); 14993 MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_SUGGESTION_VIEWED); 14994 MOVED_TO_SECURE.add(Global.CHARGING_SOUNDS_ENABLED); 14995 MOVED_TO_SECURE.add(Global.CHARGING_VIBRATION_ENABLED); 14996 MOVED_TO_SECURE.add(Global.NOTIFICATION_BUBBLES); 14997 } 14998 14999 /** @hide */ getMovedToSecureSettings(Set<String> outKeySet)15000 public static void getMovedToSecureSettings(Set<String> outKeySet) { 15001 outKeySet.addAll(MOVED_TO_SECURE); 15002 } 15003 15004 /** @hide */ clearProviderForTest()15005 public static void clearProviderForTest() { 15006 sProviderHolder.clearProviderForTest(); 15007 sNameValueCache.clearGenerationTrackerForTest(); 15008 } 15009 15010 /** @hide */ getPublicSettings(Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> readableKeysWithMaxTargetSdk)15011 public static void getPublicSettings(Set<String> allKeys, Set<String> readableKeys, 15012 ArrayMap<String, Integer> readableKeysWithMaxTargetSdk) { 15013 getPublicSettingsForClass(Global.class, allKeys, readableKeys, 15014 readableKeysWithMaxTargetSdk); 15015 } 15016 15017 /** 15018 * Look up a name in the database. 15019 * @param resolver to access the database with 15020 * @param name to look up in the table 15021 * @return the corresponding value, or null if not present 15022 */ getString(ContentResolver resolver, String name)15023 public static String getString(ContentResolver resolver, String name) { 15024 return getStringForUser(resolver, name, resolver.getUserId()); 15025 } 15026 15027 /** @hide */ 15028 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) getStringForUser(ContentResolver resolver, String name, int userHandle)15029 public static String getStringForUser(ContentResolver resolver, String name, 15030 int userHandle) { 15031 if (MOVED_TO_SECURE.contains(name)) { 15032 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" 15033 + " to android.provider.Settings.Secure, returning read-only value."); 15034 return Secure.getStringForUser(resolver, name, userHandle); 15035 } 15036 return sNameValueCache.getStringForUser(resolver, name, userHandle); 15037 } 15038 15039 /** 15040 * Store a name/value pair into the database. 15041 * @param resolver to access the database with 15042 * @param name to store 15043 * @param value to associate with the name 15044 * @return true if the value was set, false on database errors 15045 */ putString(ContentResolver resolver, String name, String value)15046 public static boolean putString(ContentResolver resolver, 15047 String name, String value) { 15048 return putStringForUser(resolver, name, value, null, false, resolver.getUserId(), 15049 DEFAULT_OVERRIDEABLE_BY_RESTORE); 15050 } 15051 15052 /** 15053 * Store a name/value pair into the database. 15054 * 15055 * @param resolver to access the database with 15056 * @param name to store 15057 * @param value to associate with the name 15058 * @param tag to associated with the setting. 15059 * @param makeDefault whether to make the value the default one. 15060 * @param overrideableByRestore whether restore can override this value 15061 * @return true if the value was set, false on database errors 15062 * 15063 * @hide 15064 */ 15065 @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)15066 public static boolean putString(@NonNull ContentResolver resolver, 15067 @NonNull String name, @Nullable String value, @Nullable String tag, 15068 boolean makeDefault, boolean overrideableByRestore) { 15069 return putStringForUser(resolver, name, value, tag, makeDefault, 15070 resolver.getUserId(), overrideableByRestore); 15071 } 15072 15073 /** 15074 * Store a name/value pair into the database. 15075 * <p> 15076 * The method takes an optional tag to associate with the setting 15077 * which can be used to clear only settings made by your package and 15078 * associated with this tag by passing the tag to {@link 15079 * #resetToDefaults(ContentResolver, String)}. Anyone can override 15080 * the current tag. Also if another package changes the setting 15081 * then the tag will be set to the one specified in the set call 15082 * which can be null. Also any of the settings setters that do not 15083 * take a tag as an argument effectively clears the tag. 15084 * </p><p> 15085 * For example, if you set settings A and B with tags T1 and T2 and 15086 * another app changes setting A (potentially to the same value), it 15087 * can assign to it a tag T3 (note that now the package that changed 15088 * the setting is not yours). Now if you reset your changes for T1 and 15089 * T2 only setting B will be reset and A not (as it was changed by 15090 * another package) but since A did not change you are in the desired 15091 * initial state. Now if the other app changes the value of A (assuming 15092 * you registered an observer in the beginning) you would detect that 15093 * the setting was changed by another app and handle this appropriately 15094 * (ignore, set back to some value, etc). 15095 * </p><p> 15096 * Also the method takes an argument whether to make the value the 15097 * default for this setting. If the system already specified a default 15098 * value, then the one passed in here will <strong>not</strong> 15099 * be set as the default. 15100 * </p> 15101 * 15102 * @param resolver to access the database with. 15103 * @param name to store. 15104 * @param value to associate with the name. 15105 * @param tag to associated with the setting. 15106 * @param makeDefault whether to make the value the default one. 15107 * @return true if the value was set, false on database errors. 15108 * 15109 * @see #resetToDefaults(ContentResolver, String) 15110 * 15111 * @hide 15112 */ 15113 @SystemApi 15114 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)15115 public static boolean putString(@NonNull ContentResolver resolver, 15116 @NonNull String name, @Nullable String value, @Nullable String tag, 15117 boolean makeDefault) { 15118 return putStringForUser(resolver, name, value, tag, makeDefault, 15119 resolver.getUserId(), DEFAULT_OVERRIDEABLE_BY_RESTORE); 15120 } 15121 15122 /** 15123 * Reset the settings to their defaults. This would reset <strong>only</strong> 15124 * settings set by the caller's package. Think of it of a way to undo your own 15125 * changes to the secure settings. Passing in the optional tag will reset only 15126 * settings changed by your package and associated with this tag. 15127 * 15128 * @param resolver Handle to the content resolver. 15129 * @param tag Optional tag which should be associated with the settings to reset. 15130 * 15131 * @see #putString(ContentResolver, String, String, String, boolean) 15132 * 15133 * @hide 15134 */ 15135 @SystemApi 15136 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)15137 public static void resetToDefaults(@NonNull ContentResolver resolver, 15138 @Nullable String tag) { 15139 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, 15140 resolver.getUserId()); 15141 } 15142 15143 /** 15144 * Reset the settings to their defaults for a given user with a specific mode. The 15145 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} 15146 * allowing resetting the settings made by a package and associated with the tag. 15147 * 15148 * @param resolver Handle to the content resolver. 15149 * @param tag Optional tag which should be associated with the settings to reset. 15150 * @param mode The reset mode. 15151 * @param userHandle The user for which to reset to defaults. 15152 * 15153 * @see #RESET_MODE_PACKAGE_DEFAULTS 15154 * @see #RESET_MODE_UNTRUSTED_DEFAULTS 15155 * @see #RESET_MODE_UNTRUSTED_CHANGES 15156 * @see #RESET_MODE_TRUSTED_DEFAULTS 15157 * 15158 * @hide 15159 */ resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)15160 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, 15161 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { 15162 try { 15163 Bundle arg = new Bundle(); 15164 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 15165 if (tag != null) { 15166 arg.putString(CALL_METHOD_TAG_KEY, tag); 15167 } 15168 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); 15169 IContentProvider cp = sProviderHolder.getProvider(resolver); 15170 cp.call(resolver.getAttributionSource(), 15171 sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_GLOBAL, null, arg); 15172 } catch (RemoteException e) { 15173 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); 15174 } 15175 } 15176 15177 /** @hide */ 15178 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) putStringForUser(ContentResolver resolver, String name, String value, int userHandle)15179 public static boolean putStringForUser(ContentResolver resolver, 15180 String name, String value, int userHandle) { 15181 return putStringForUser(resolver, name, value, null, false, userHandle, 15182 DEFAULT_OVERRIDEABLE_BY_RESTORE); 15183 } 15184 15185 /** @hide */ putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore)15186 public static boolean putStringForUser(@NonNull ContentResolver resolver, 15187 @NonNull String name, @Nullable String value, @Nullable String tag, 15188 boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore) { 15189 if (LOCAL_LOGV) { 15190 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value 15191 + " for " + userHandle); 15192 } 15193 // Global and Secure have the same access policy so we can forward writes 15194 if (MOVED_TO_SECURE.contains(name)) { 15195 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" 15196 + " to android.provider.Settings.Secure, value is unchanged."); 15197 return Secure.putStringForUser(resolver, name, value, tag, 15198 makeDefault, userHandle, overrideableByRestore); 15199 } 15200 return sNameValueCache.putStringForUser(resolver, name, value, tag, 15201 makeDefault, userHandle, overrideableByRestore); 15202 } 15203 15204 /** 15205 * Construct the content URI for a particular name/value pair, 15206 * useful for monitoring changes with a ContentObserver. 15207 * @param name to look up in the table 15208 * @return the corresponding content URI, or null if not present 15209 */ getUriFor(String name)15210 public static Uri getUriFor(String name) { 15211 return getUriFor(CONTENT_URI, name); 15212 } 15213 15214 /** 15215 * Convenience function for retrieving a single secure settings value 15216 * as an integer. Note that internally setting values are always 15217 * stored as strings; this function converts the string to an integer 15218 * for you. The default value will be returned if the setting is 15219 * not defined or not an integer. 15220 * 15221 * @param cr The ContentResolver to access. 15222 * @param name The name of the setting to retrieve. 15223 * @param def Value to return if the setting is not defined. 15224 * 15225 * @return The setting's current value, or 'def' if it is not defined 15226 * or not a valid integer. 15227 */ getInt(ContentResolver cr, String name, int def)15228 public static int getInt(ContentResolver cr, String name, int def) { 15229 String v = getString(cr, name); 15230 try { 15231 return v != null ? Integer.parseInt(v) : def; 15232 } catch (NumberFormatException e) { 15233 return def; 15234 } 15235 } 15236 15237 /** 15238 * Convenience function for retrieving a single secure settings value 15239 * as an integer. Note that internally setting values are always 15240 * stored as strings; this function converts the string to an integer 15241 * for you. 15242 * <p> 15243 * This version does not take a default value. If the setting has not 15244 * been set, or the string value is not a number, 15245 * it throws {@link SettingNotFoundException}. 15246 * 15247 * @param cr The ContentResolver to access. 15248 * @param name The name of the setting to retrieve. 15249 * 15250 * @throws SettingNotFoundException Thrown if a setting by the given 15251 * name can't be found or the setting value is not an integer. 15252 * 15253 * @return The setting's current value. 15254 */ getInt(ContentResolver cr, String name)15255 public static int getInt(ContentResolver cr, String name) 15256 throws SettingNotFoundException { 15257 String v = getString(cr, name); 15258 try { 15259 return Integer.parseInt(v); 15260 } catch (NumberFormatException e) { 15261 throw new SettingNotFoundException(name); 15262 } 15263 } 15264 15265 /** 15266 * Convenience function for updating a single settings value as an 15267 * integer. This will either create a new entry in the table if the 15268 * given name does not exist, or modify the value of the existing row 15269 * with that name. Note that internally setting values are always 15270 * stored as strings, so this function converts the given value to a 15271 * string before storing it. 15272 * 15273 * @param cr The ContentResolver to access. 15274 * @param name The name of the setting to modify. 15275 * @param value The new value for the setting. 15276 * @return true if the value was set, false on database errors 15277 */ putInt(ContentResolver cr, String name, int value)15278 public static boolean putInt(ContentResolver cr, String name, int value) { 15279 return putString(cr, name, Integer.toString(value)); 15280 } 15281 15282 /** 15283 * Convenience function for retrieving a single secure settings value 15284 * as a {@code long}. Note that internally setting values are always 15285 * stored as strings; this function converts the string to a {@code long} 15286 * for you. The default value will be returned if the setting is 15287 * not defined or not a {@code long}. 15288 * 15289 * @param cr The ContentResolver to access. 15290 * @param name The name of the setting to retrieve. 15291 * @param def Value to return if the setting is not defined. 15292 * 15293 * @return The setting's current value, or 'def' if it is not defined 15294 * or not a valid {@code long}. 15295 */ getLong(ContentResolver cr, String name, long def)15296 public static long getLong(ContentResolver cr, String name, long def) { 15297 String valString = getString(cr, name); 15298 long value; 15299 try { 15300 value = valString != null ? Long.parseLong(valString) : def; 15301 } catch (NumberFormatException e) { 15302 value = def; 15303 } 15304 return value; 15305 } 15306 15307 /** 15308 * Convenience function for retrieving a single secure settings value 15309 * as a {@code long}. Note that internally setting values are always 15310 * stored as strings; this function converts the string to a {@code long} 15311 * for you. 15312 * <p> 15313 * This version does not take a default value. If the setting has not 15314 * been set, or the string value is not a number, 15315 * it throws {@link SettingNotFoundException}. 15316 * 15317 * @param cr The ContentResolver to access. 15318 * @param name The name of the setting to retrieve. 15319 * 15320 * @return The setting's current value. 15321 * @throws SettingNotFoundException Thrown if a setting by the given 15322 * name can't be found or the setting value is not an integer. 15323 */ getLong(ContentResolver cr, String name)15324 public static long getLong(ContentResolver cr, String name) 15325 throws SettingNotFoundException { 15326 String valString = getString(cr, name); 15327 try { 15328 return Long.parseLong(valString); 15329 } catch (NumberFormatException e) { 15330 throw new SettingNotFoundException(name); 15331 } 15332 } 15333 15334 /** 15335 * Convenience function for updating a secure settings value as a long 15336 * integer. This will either create a new entry in the table if the 15337 * given name does not exist, or modify the value of the existing row 15338 * with that name. Note that internally setting values are always 15339 * stored as strings, so this function converts the given value to a 15340 * string before storing it. 15341 * 15342 * @param cr The ContentResolver to access. 15343 * @param name The name of the setting to modify. 15344 * @param value The new value for the setting. 15345 * @return true if the value was set, false on database errors 15346 */ putLong(ContentResolver cr, String name, long value)15347 public static boolean putLong(ContentResolver cr, String name, long value) { 15348 return putString(cr, name, Long.toString(value)); 15349 } 15350 15351 /** 15352 * Convenience function for retrieving a single secure settings value 15353 * as a floating point number. Note that internally setting values are 15354 * always stored as strings; this function converts the string to an 15355 * float for you. The default value will be returned if the setting 15356 * is not defined or not a valid float. 15357 * 15358 * @param cr The ContentResolver to access. 15359 * @param name The name of the setting to retrieve. 15360 * @param def Value to return if the setting is not defined. 15361 * 15362 * @return The setting's current value, or 'def' if it is not defined 15363 * or not a valid float. 15364 */ getFloat(ContentResolver cr, String name, float def)15365 public static float getFloat(ContentResolver cr, String name, float def) { 15366 String v = getString(cr, name); 15367 try { 15368 return v != null ? Float.parseFloat(v) : def; 15369 } catch (NumberFormatException e) { 15370 return def; 15371 } 15372 } 15373 15374 /** 15375 * Convenience function for retrieving a single secure settings value 15376 * as a float. Note that internally setting values are always 15377 * stored as strings; this function converts the string to a float 15378 * for you. 15379 * <p> 15380 * This version does not take a default value. If the setting has not 15381 * been set, or the string value is not a number, 15382 * it throws {@link SettingNotFoundException}. 15383 * 15384 * @param cr The ContentResolver to access. 15385 * @param name The name of the setting to retrieve. 15386 * 15387 * @throws SettingNotFoundException Thrown if a setting by the given 15388 * name can't be found or the setting value is not a float. 15389 * 15390 * @return The setting's current value. 15391 */ getFloat(ContentResolver cr, String name)15392 public static float getFloat(ContentResolver cr, String name) 15393 throws SettingNotFoundException { 15394 String v = getString(cr, name); 15395 if (v == null) { 15396 throw new SettingNotFoundException(name); 15397 } 15398 try { 15399 return Float.parseFloat(v); 15400 } catch (NumberFormatException e) { 15401 throw new SettingNotFoundException(name); 15402 } 15403 } 15404 15405 /** 15406 * Convenience function for updating a single settings value as a 15407 * floating point number. This will either create a new entry in the 15408 * table if the given name does not exist, or modify the value of the 15409 * existing row with that name. Note that internally setting values 15410 * are always stored as strings, so this function converts the given 15411 * value to a string before storing it. 15412 * 15413 * @param cr The ContentResolver to access. 15414 * @param name The name of the setting to modify. 15415 * @param value The new value for the setting. 15416 * @return true if the value was set, false on database errors 15417 */ putFloat(ContentResolver cr, String name, float value)15418 public static boolean putFloat(ContentResolver cr, String name, float value) { 15419 return putString(cr, name, Float.toString(value)); 15420 } 15421 15422 /** 15423 * Subscription Id to be used for voice call on a multi sim device. 15424 * @hide 15425 */ 15426 @Readable 15427 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call"; 15428 15429 /** 15430 * Used to provide option to user to select subscription during dial. 15431 * The supported values are 0 = disable or 1 = enable prompt. 15432 * @hide 15433 */ 15434 @UnsupportedAppUsage 15435 @Readable 15436 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt"; 15437 15438 /** 15439 * Subscription Id to be used for data call on a multi sim device. 15440 * @hide 15441 */ 15442 @Readable 15443 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call"; 15444 15445 /** 15446 * Subscription Id to be used for SMS on a multi sim device. 15447 * @hide 15448 */ 15449 @Readable 15450 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms"; 15451 15452 /** 15453 * Used to provide option to user to select subscription during send SMS. 15454 * The value 1 - enable, 0 - disable 15455 * @hide 15456 */ 15457 @Readable 15458 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt"; 15459 15460 /** User preferred subscriptions setting. 15461 * This holds the details of the user selected subscription from the card and 15462 * the activation status. Each settings string have the comma separated values 15463 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index 15464 * @hide 15465 */ 15466 @UnsupportedAppUsage 15467 @Readable 15468 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1", 15469 "user_preferred_sub2","user_preferred_sub3"}; 15470 15471 /** 15472 * Which subscription is enabled for a physical slot. 15473 * @hide 15474 */ 15475 @Readable 15476 public static final String ENABLED_SUBSCRIPTION_FOR_SLOT = "enabled_subscription_for_slot"; 15477 15478 /** 15479 * Whether corresponding logical modem is enabled for a physical slot. 15480 * The value 1 - enable, 0 - disable 15481 * @hide 15482 */ 15483 @Readable 15484 public static final String MODEM_STACK_ENABLED_FOR_SLOT = "modem_stack_enabled_for_slot"; 15485 15486 /** 15487 * Whether to enable new contacts aggregator or not. 15488 * The value 1 - enable, 0 - disable 15489 * @hide 15490 */ 15491 @Readable 15492 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator"; 15493 15494 /** 15495 * Whether to enable contacts metadata syncing or not 15496 * The value 1 - enable, 0 - disable 15497 * 15498 * @removed 15499 */ 15500 @Deprecated 15501 @Readable 15502 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync"; 15503 15504 /** 15505 * Whether to enable contacts metadata syncing or not 15506 * The value 1 - enable, 0 - disable 15507 */ 15508 @Readable 15509 public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled"; 15510 15511 /** 15512 * Whether to enable cellular on boot. 15513 * The value 1 - enable, 0 - disable 15514 * @hide 15515 */ 15516 @Readable 15517 public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot"; 15518 15519 /** 15520 * The maximum allowed notification enqueue rate in Hertz. 15521 * 15522 * Should be a float, and includes updates only. 15523 * @hide 15524 */ 15525 @Readable 15526 public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate"; 15527 15528 /** 15529 * Displays toasts when an app posts a notification that does not specify a valid channel. 15530 * 15531 * The value 1 - enable, 0 - disable 15532 * @hide 15533 */ 15534 @Readable 15535 public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS = 15536 "show_notification_channel_warnings"; 15537 15538 /** 15539 * Whether cell is enabled/disabled 15540 * @hide 15541 */ 15542 @Readable 15543 public static final String CELL_ON = "cell_on"; 15544 15545 /** 15546 * Global settings which can be accessed by instant apps. 15547 * @hide 15548 */ 15549 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); 15550 static { 15551 INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER); 15552 INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED); 15553 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES); 15554 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL); 15555 INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES); 15556 INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON); 15557 INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE); 15558 INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE); 15559 INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE); 15560 INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES); 15561 INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE); 15562 INSTANT_APP_SETTINGS.add(WTF_IS_FATAL); 15563 INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR); 15564 INSTANT_APP_SETTINGS.add(ZEN_MODE); 15565 } 15566 15567 /** 15568 * Whether to show the high temperature warning notification. 15569 * @hide 15570 */ 15571 @Readable 15572 public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning"; 15573 15574 /** 15575 * Whether to show the usb high temperature alarm notification. 15576 * @hide 15577 */ 15578 @Readable 15579 public static final String SHOW_USB_TEMPERATURE_ALARM = "show_usb_temperature_alarm"; 15580 15581 /** 15582 * Temperature at which the high temperature warning notification should be shown. 15583 * @hide 15584 */ 15585 @Readable 15586 public static final String WARNING_TEMPERATURE = "warning_temperature"; 15587 15588 /** 15589 * Whether the diskstats logging task is enabled/disabled. 15590 * @hide 15591 */ 15592 @Readable 15593 public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging"; 15594 15595 /** 15596 * Whether the cache quota calculation task is enabled/disabled. 15597 * @hide 15598 */ 15599 @Readable 15600 public static final String ENABLE_CACHE_QUOTA_CALCULATION = 15601 "enable_cache_quota_calculation"; 15602 15603 /** 15604 * Whether the Deletion Helper no threshold toggle is available. 15605 * @hide 15606 */ 15607 @Readable 15608 public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE = 15609 "enable_deletion_helper_no_threshold_toggle"; 15610 15611 /** 15612 * The list of snooze options for notifications 15613 * This is encoded as a key=value list, separated by commas. Ex: 15614 * 15615 * "default=60,options_array=15:30:60:120" 15616 * 15617 * The following keys are supported: 15618 * 15619 * <pre> 15620 * default (int) 15621 * options_array (int[]) 15622 * </pre> 15623 * 15624 * All delays in integer minutes. Array order is respected. 15625 * Options will be used in order up to the maximum allowed by the UI. 15626 * @hide 15627 */ 15628 @Readable 15629 public static final String NOTIFICATION_SNOOZE_OPTIONS = 15630 "notification_snooze_options"; 15631 15632 /** 15633 * When enabled, notifications the notification assistant service has modified will show an 15634 * indicator. When tapped, this indicator will describe the adjustment made and solicit 15635 * feedback. This flag will also add a "automatic" option to the long press menu. 15636 * 15637 * The value 1 - enable, 0 - disable 15638 * @hide 15639 */ 15640 public static final String NOTIFICATION_FEEDBACK_ENABLED = "notification_feedback_enabled"; 15641 15642 /** 15643 * Settings key for the ratio of notification dismissals to notification views - one of the 15644 * criteria for showing the notification blocking helper. 15645 * 15646 * <p>The value is a float ranging from 0.0 to 1.0 (the closer to 0.0, the more intrusive 15647 * the blocking helper will be). 15648 * 15649 * @hide 15650 */ 15651 @Readable 15652 public static final String BLOCKING_HELPER_DISMISS_TO_VIEW_RATIO_LIMIT = 15653 "blocking_helper_dismiss_to_view_ratio"; 15654 15655 /** 15656 * Settings key for the longest streak of dismissals - one of the criteria for showing the 15657 * notification blocking helper. 15658 * 15659 * <p>The value is an integer greater than 0. 15660 * 15661 * @hide 15662 */ 15663 @Readable 15664 public static final String BLOCKING_HELPER_STREAK_LIMIT = "blocking_helper_streak_limit"; 15665 15666 /** 15667 * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated 15668 * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF 15669 * 15670 * Supported keys:<br/> 15671 * <li> 15672 * <ul> {@code legacy_compatibility_wal_enabled} : A {code boolean} flag that determines 15673 * whether or not "compatibility WAL" mode is enabled by default. This is a legacy flag 15674 * and is honoured on Android Q and higher. This flag will be removed in a future release. 15675 * </ul> 15676 * <ul> {@code wal_syncmode} : A {@code String} representing the synchronization mode to use 15677 * when WAL is enabled, either via {@code legacy_compatibility_wal_enabled} or using the 15678 * obsolete {@code compatibility_wal_supported} flag. 15679 * </ul> 15680 * <ul> {@code truncate_size} : A {@code int} flag that specifies the truncate size of the 15681 * WAL journal. 15682 * </ul> 15683 * <ul> {@code compatibility_wal_supported} : A {code boolean} flag that specifies whether 15684 * the legacy "compatibility WAL" mode is enabled by default. This flag is obsolete and is 15685 * only supported on Android Pie. 15686 * </ul> 15687 * </li> 15688 * 15689 * @hide 15690 */ 15691 @Readable 15692 public static final String SQLITE_COMPATIBILITY_WAL_FLAGS = 15693 "sqlite_compatibility_wal_flags"; 15694 15695 /** 15696 * Enable GNSS Raw Measurements Full Tracking? 15697 * 0 = no 15698 * 1 = yes 15699 * @hide 15700 */ 15701 @Readable 15702 public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING = 15703 "enable_gnss_raw_meas_full_tracking"; 15704 15705 /** 15706 * Whether the notification should be ongoing (persistent) when a carrier app install is 15707 * required. 15708 * 15709 * The value is a boolean (1 or 0). 15710 * @hide 15711 */ 15712 @SystemApi 15713 @Readable 15714 public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT = 15715 "install_carrier_app_notification_persistent"; 15716 15717 /** 15718 * The amount of time (ms) to hide the install carrier app notification after the user has 15719 * ignored it. After this time passes, the notification will be shown again 15720 * 15721 * The value is a long 15722 * @hide 15723 */ 15724 @SystemApi 15725 @Readable 15726 public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS = 15727 "install_carrier_app_notification_sleep_millis"; 15728 15729 /** 15730 * Whether we've enabled zram on this device. Takes effect on 15731 * reboot. The value "1" enables zram; "0" disables it, and 15732 * everything else is unspecified. 15733 * @hide 15734 */ 15735 @Readable 15736 public static final String ZRAM_ENABLED = 15737 "zram_enabled"; 15738 15739 /** 15740 * Whether the app freezer is enabled on this device. 15741 * The value of "enabled" enables the app freezer, "disabled" disables it and 15742 * "device_default" will let the system decide whether to enable the freezer or not 15743 * @hide 15744 */ 15745 @Readable 15746 public static final String CACHED_APPS_FREEZER_ENABLED = "cached_apps_freezer"; 15747 15748 /** 15749 * Configuration flags for smart replies in notifications. 15750 * This is encoded as a key=value list, separated by commas. Ex: 15751 * 15752 * "enabled=1,max_squeeze_remeasure_count=3" 15753 * 15754 * The following keys are supported: 15755 * 15756 * <pre> 15757 * enabled (boolean) 15758 * requires_targeting_p (boolean) 15759 * max_squeeze_remeasure_attempts (int) 15760 * edit_choices_before_sending (boolean) 15761 * show_in_heads_up (boolean) 15762 * min_num_system_generated_replies (int) 15763 * max_num_actions (int) 15764 * </pre> 15765 * @see com.android.systemui.statusbar.policy.SmartReplyConstants 15766 * @hide 15767 */ 15768 @Readable 15769 public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS = 15770 "smart_replies_in_notifications_flags"; 15771 15772 /** 15773 * Configuration flags for the automatic generation of smart replies and smart actions in 15774 * notifications. This is encoded as a key=value list, separated by commas. Ex: 15775 * "generate_replies=false,generate_actions=true". 15776 * 15777 * The following keys are supported: 15778 * 15779 * <pre> 15780 * generate_replies (boolean) 15781 * generate_actions (boolean) 15782 * </pre> 15783 * @hide 15784 */ 15785 @Readable 15786 public static final String SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS = 15787 "smart_suggestions_in_notifications_flags"; 15788 15789 /** 15790 * If nonzero, crashes in foreground processes will bring up a dialog. 15791 * Otherwise, the process will be silently killed. 15792 * @hide 15793 */ 15794 @TestApi 15795 @Readable 15796 @SuppressLint("NoSettingsProvider") 15797 public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog"; 15798 15799 /** 15800 * If nonzero, crash dialogs will show an option to restart the app. 15801 * @hide 15802 */ 15803 @Readable 15804 public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog"; 15805 15806 /** 15807 * If nonzero, crash dialogs will show an option to mute all future crash dialogs for 15808 * this app. 15809 * @hide 15810 */ 15811 @Readable 15812 public static final String SHOW_MUTE_IN_CRASH_DIALOG = "show_mute_in_crash_dialog"; 15813 15814 15815 /** 15816 * If nonzero, will show the zen upgrade notification when the user toggles DND on/off. 15817 * @hide 15818 * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_UPGRADE_NOTIFICATION} 15819 */ 15820 @Deprecated 15821 public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification"; 15822 15823 /** 15824 * If nonzero, will show the zen update settings suggestion. 15825 * @hide 15826 * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_SETTINGS_SUGGESTION} 15827 */ 15828 @Deprecated 15829 public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion"; 15830 15831 /** 15832 * If nonzero, zen has not been updated to reflect new changes. 15833 * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_UPDATED} 15834 * @hide 15835 */ 15836 @Deprecated 15837 public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated"; 15838 15839 /** 15840 * If nonzero, zen setting suggestion has been viewed by user 15841 * @hide 15842 * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_SUGGESTION_VIEWED} 15843 */ 15844 @Deprecated 15845 public static final String ZEN_SETTINGS_SUGGESTION_VIEWED = 15846 "zen_settings_suggestion_viewed"; 15847 15848 /** 15849 * Backup and restore agent timeout parameters. 15850 * These parameters are represented by a comma-delimited key-value list. 15851 * 15852 * The following strings are supported as keys: 15853 * <pre> 15854 * kv_backup_agent_timeout_millis (long) 15855 * full_backup_agent_timeout_millis (long) 15856 * shared_backup_agent_timeout_millis (long) 15857 * restore_agent_timeout_millis (long) 15858 * restore_agent_finished_timeout_millis (long) 15859 * </pre> 15860 * 15861 * They map to milliseconds represented as longs. 15862 * 15863 * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000" 15864 * 15865 * @hide 15866 */ 15867 @Readable 15868 public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS = 15869 "backup_agent_timeout_parameters"; 15870 15871 /** 15872 * Blocklist of GNSS satellites. 15873 * 15874 * This is a list of integers separated by commas to represent pairs of (constellation, 15875 * svid). Thus, the number of integers should be even. 15876 * 15877 * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are 15878 * blocklisted. Note that svid=0 denotes all svids in the constellation are blocklisted. 15879 * 15880 * @hide 15881 */ 15882 public static final String GNSS_SATELLITE_BLOCKLIST = "gnss_satellite_blocklist"; 15883 15884 /** 15885 * Duration of updates in millisecond for GNSS location request from HAL to framework. 15886 * 15887 * If zero, the GNSS location request feature is disabled. 15888 * 15889 * The value is a non-negative long. 15890 * 15891 * @hide 15892 */ 15893 @Readable 15894 public static final String GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS = 15895 "gnss_hal_location_request_duration_millis"; 15896 15897 /** 15898 * Binder call stats settings. 15899 * 15900 * The following strings are supported as keys: 15901 * <pre> 15902 * enabled (boolean) 15903 * detailed_tracking (boolean) 15904 * upload_data (boolean) 15905 * sampling_interval (int) 15906 * </pre> 15907 * 15908 * @hide 15909 */ 15910 @Readable 15911 public static final String BINDER_CALLS_STATS = "binder_calls_stats"; 15912 15913 /** 15914 * Looper stats settings. 15915 * 15916 * The following strings are supported as keys: 15917 * <pre> 15918 * enabled (boolean) 15919 * sampling_interval (int) 15920 * </pre> 15921 * 15922 * @hide 15923 */ 15924 @Readable 15925 public static final String LOOPER_STATS = "looper_stats"; 15926 15927 /** 15928 * Settings for collecting statistics on CPU usage per thread 15929 * 15930 * The following strings are supported as keys: 15931 * <pre> 15932 * num_buckets (int) 15933 * collected_uids (string) 15934 * minimum_total_cpu_usage_millis (int) 15935 * </pre> 15936 * 15937 * @hide 15938 */ 15939 @Readable 15940 public static final String KERNEL_CPU_THREAD_READER = "kernel_cpu_thread_reader"; 15941 15942 /** 15943 * Whether we've enabled native flags health check on this device. Takes effect on 15944 * reboot. The value "1" enables native flags health check; otherwise it's disabled. 15945 * @hide 15946 */ 15947 @Readable 15948 public static final String NATIVE_FLAGS_HEALTH_CHECK_ENABLED = 15949 "native_flags_health_check_enabled"; 15950 15951 /** 15952 * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the mode 15953 * in which the historical registry operates. 15954 * 15955 * @hide 15956 */ 15957 @Readable 15958 public static final String APPOP_HISTORY_MODE = "mode"; 15959 15960 /** 15961 * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls how long 15962 * is the interval between snapshots in the base case i.e. the most recent 15963 * part of the history. 15964 * 15965 * @hide 15966 */ 15967 @Readable 15968 public static final String APPOP_HISTORY_BASE_INTERVAL_MILLIS = "baseIntervalMillis"; 15969 15970 /** 15971 * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the base 15972 * for the logarithmic step when building app op history. 15973 * 15974 * @hide 15975 */ 15976 @Readable 15977 public static final String APPOP_HISTORY_INTERVAL_MULTIPLIER = "intervalMultiplier"; 15978 15979 /** 15980 * Appop history parameters. These parameters are represented by 15981 * a comma-delimited key-value list. 15982 * 15983 * The following strings are supported as keys: 15984 * <pre> 15985 * mode (int) 15986 * baseIntervalMillis (long) 15987 * intervalMultiplier (int) 15988 * </pre> 15989 * 15990 * Ex: "mode=HISTORICAL_MODE_ENABLED_ACTIVE,baseIntervalMillis=1000,intervalMultiplier=10" 15991 * 15992 * @see #APPOP_HISTORY_MODE 15993 * @see #APPOP_HISTORY_BASE_INTERVAL_MILLIS 15994 * @see #APPOP_HISTORY_INTERVAL_MULTIPLIER 15995 * 15996 * @hide 15997 */ 15998 @Readable 15999 public static final String APPOP_HISTORY_PARAMETERS = 16000 "appop_history_parameters"; 16001 16002 /** 16003 * Auto revoke parameters. These parameters are represented by 16004 * a comma-delimited key-value list. 16005 * 16006 * <pre> 16007 * enabledForPreRApps (bolean) 16008 * unusedThresholdMs (long) 16009 * checkFrequencyMs (long) 16010 * </pre> 16011 * 16012 * Ex: "enabledForPreRApps=false,unusedThresholdMs=7776000000,checkFrequencyMs=1296000000" 16013 * 16014 * @hide 16015 */ 16016 @Readable 16017 public static final String AUTO_REVOKE_PARAMETERS = 16018 "auto_revoke_parameters"; 16019 16020 /** 16021 * Delay for sending ACTION_CHARGING after device is plugged in. 16022 * This is used as an override for constants defined in BatteryStatsImpl for 16023 * ease of experimentation. 16024 * 16025 * @see com.android.internal.os.BatteryStatsImpl.Constants.KEY_BATTERY_CHARGED_DELAY_MS 16026 * @hide 16027 */ 16028 @Readable 16029 public static final String BATTERY_CHARGING_STATE_UPDATE_DELAY = 16030 "battery_charging_state_update_delay"; 16031 16032 /** 16033 * A serialized string of params that will be loaded into a text classifier action model. 16034 * 16035 * @hide 16036 */ 16037 @Readable 16038 public static final String TEXT_CLASSIFIER_ACTION_MODEL_PARAMS = 16039 "text_classifier_action_model_params"; 16040 16041 /** 16042 * The amount of time to suppress "power-off" from the power button after the device has 16043 * woken due to a gesture (lifting the phone). Since users have learned to hit the power 16044 * button immediately when lifting their device, it can cause the device to turn off if a 16045 * gesture has just woken the device. This value tells us the milliseconds to wait after 16046 * a gesture before "power-off" via power-button is functional again. A value of 0 is no 16047 * delay, and reverts to the old behavior. 16048 * 16049 * @hide 16050 */ 16051 @Readable 16052 public static final String POWER_BUTTON_SUPPRESSION_DELAY_AFTER_GESTURE_WAKE = 16053 "power_button_suppression_delay_after_gesture_wake"; 16054 16055 /** 16056 * The usage amount of advanced battery. The value is 0~100. 16057 * 16058 * @hide 16059 */ 16060 @Readable 16061 public static final String ADVANCED_BATTERY_USAGE_AMOUNT = "advanced_battery_usage_amount"; 16062 16063 /** 16064 * For 5G NSA capable devices, determines whether NR tracking indications are on 16065 * when the screen is off. 16066 * 16067 * Values are: 16068 * 0: off - All 5G NSA tracking indications are off when the screen is off. 16069 * 1: extended - All 5G NSA tracking indications are on when the screen is off as long as 16070 * the device is camped on 5G NSA (5G icon is showing in status bar). 16071 * If the device is not camped on 5G NSA, tracking indications are off. 16072 * 2: always on - All 5G NSA tracking indications are on whether the screen is on or off. 16073 * @hide 16074 */ 16075 @Readable 16076 public static final String NR_NSA_TRACKING_SCREEN_OFF_MODE = 16077 "nr_nsa_tracking_screen_off_mode"; 16078 16079 /** 16080 * Whether to show People Space. 16081 * Values are: 16082 * 0: Disabled (default) 16083 * 1: Enabled 16084 * @hide 16085 */ 16086 public static final String SHOW_PEOPLE_SPACE = "show_people_space"; 16087 16088 /** 16089 * Which types of conversation(s) to show in People Space. 16090 * Values are: 16091 * 0: Single user-selected conversation (default) 16092 * 1: Priority conversations only 16093 * 2: All conversations 16094 * @hide 16095 */ 16096 public static final String PEOPLE_SPACE_CONVERSATION_TYPE = 16097 "people_space_conversation_type"; 16098 16099 /** 16100 * Whether to show new notification dismissal. 16101 * Values are: 16102 * 0: Disabled 16103 * 1: Enabled 16104 * @hide 16105 */ 16106 public static final String SHOW_NEW_NOTIF_DISMISS = "show_new_notif_dismiss"; 16107 16108 /** 16109 * Block untrusted touches mode. 16110 * 16111 * Can be one of: 16112 * <ul> 16113 * <li>0 = {@link BlockUntrustedTouchesMode#DISABLED}: Feature is off. 16114 * <li>1 = {@link BlockUntrustedTouchesMode#PERMISSIVE}: Untrusted touches are flagged 16115 * but not blocked 16116 * <li>2 = {@link BlockUntrustedTouchesMode#BLOCK}: Untrusted touches are blocked 16117 * </ul> 16118 * 16119 * @hide 16120 */ 16121 @Readable 16122 public static final String BLOCK_UNTRUSTED_TOUCHES_MODE = "block_untrusted_touches"; 16123 16124 /** 16125 * The maximum allowed obscuring opacity by UID to propagate touches. 16126 * 16127 * For certain window types (eg. SAWs), the decision of honoring {@link LayoutParams 16128 * #FLAG_NOT_TOUCHABLE} or not depends on the combined obscuring opacity of the windows 16129 * above the touch-consuming window. 16130 * 16131 * For a certain UID: 16132 * <ul> 16133 * <li>If it's the same as the UID of the touch-consuming window, allow it to propagate 16134 * the touch. 16135 * <li>Otherwise take all its windows of eligible window types above the touch-consuming 16136 * window, compute their combined obscuring opacity considering that {@code 16137 * opacity(A, B) = 1 - (1 - opacity(A))*(1 - opacity(B))}. If the computed value is 16138 * lesser than or equal to this setting and there are no other windows preventing the 16139 * touch, allow the UID to propagate the touch. 16140 * </ul> 16141 * 16142 * @see android.hardware.input.InputManager#getMaximumObscuringOpacityForTouch() 16143 * @see android.hardware.input.InputManager#setMaximumObscuringOpacityForTouch(float) 16144 * 16145 * @hide 16146 */ 16147 @Readable 16148 public static final String MAXIMUM_OBSCURING_OPACITY_FOR_TOUCH = 16149 "maximum_obscuring_opacity_for_touch"; 16150 16151 /** 16152 * Used to enable / disable the Restricted Networking Mode in which network access is 16153 * restricted to apps holding the CONNECTIVITY_USE_RESTRICTED_NETWORKS permission. 16154 * 16155 * Values are: 16156 * 0: disabled 16157 * 1: enabled 16158 * @hide 16159 */ 16160 public static final String RESTRICTED_NETWORKING_MODE = "restricted_networking_mode"; 16161 } 16162 16163 /** 16164 * Configuration system settings, containing settings which are applied identically for all 16165 * defined users. Only Android can read these and only a specific configuration service can 16166 * write these. 16167 * 16168 * @hide 16169 */ 16170 public static final class Config extends NameValueTable { 16171 16172 /** 16173 * The modes that can be used when disabling syncs to the 'config' settings. 16174 * @hide 16175 */ 16176 @IntDef(prefix = "DISABLE_SYNC_MODE_", 16177 value = { SYNC_DISABLED_MODE_NONE, SYNC_DISABLED_MODE_PERSISTENT, 16178 SYNC_DISABLED_MODE_UNTIL_REBOOT }) 16179 @Retention(RetentionPolicy.SOURCE) 16180 @Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE}) 16181 public @interface SyncDisabledMode {} 16182 16183 /** 16184 * Sync is not not disabled. 16185 * 16186 * @hide 16187 */ 16188 public static final int SYNC_DISABLED_MODE_NONE = 0; 16189 16190 /** 16191 * Disabling of Config bulk update / syncing is persistent, i.e. it survives a device 16192 * reboot. 16193 * @hide 16194 */ 16195 public static final int SYNC_DISABLED_MODE_PERSISTENT = 1; 16196 16197 /** 16198 * Disabling of Config bulk update / syncing is not persistent, i.e. it will not survive a 16199 * device reboot. 16200 * @hide 16201 */ 16202 public static final int SYNC_DISABLED_MODE_UNTIL_REBOOT = 2; 16203 16204 private static final ContentProviderHolder sProviderHolder = 16205 new ContentProviderHolder(DeviceConfig.CONTENT_URI); 16206 16207 // Populated lazily, guarded by class object: 16208 private static final NameValueCache sNameValueCache = new NameValueCache( 16209 DeviceConfig.CONTENT_URI, 16210 CALL_METHOD_GET_CONFIG, 16211 CALL_METHOD_PUT_CONFIG, 16212 CALL_METHOD_LIST_CONFIG, 16213 CALL_METHOD_SET_ALL_CONFIG, 16214 sProviderHolder, 16215 Config.class); 16216 16217 /** 16218 * Look up a name in the database. 16219 * @param resolver to access the database with 16220 * @param name to look up in the table 16221 * @return the corresponding value, or null if not present 16222 * 16223 * @hide 16224 */ 16225 @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG) getString(ContentResolver resolver, String name)16226 static String getString(ContentResolver resolver, String name) { 16227 return sNameValueCache.getStringForUser(resolver, name, resolver.getUserId()); 16228 } 16229 16230 /** 16231 * Look up a list of names in the database, within the specified namespace. 16232 * 16233 * @param resolver to access the database with 16234 * @param namespace to which the names belong 16235 * @param names to look up in the table 16236 * @return a non null, but possibly empty, map from name to value for any of the names that 16237 * were found during lookup. 16238 * 16239 * @hide 16240 */ 16241 @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG) getStrings(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull List<String> names)16242 public static Map<String, String> getStrings(@NonNull ContentResolver resolver, 16243 @NonNull String namespace, @NonNull List<String> names) { 16244 List<String> compositeNames = new ArrayList<>(names.size()); 16245 for (String name : names) { 16246 compositeNames.add(createCompositeName(namespace, name)); 16247 } 16248 16249 String prefix = createPrefix(namespace); 16250 ArrayMap<String, String> rawKeyValues = sNameValueCache.getStringsForPrefix( 16251 resolver, prefix, compositeNames); 16252 int size = rawKeyValues.size(); 16253 int substringLength = prefix.length(); 16254 ArrayMap<String, String> keyValues = new ArrayMap<>(size); 16255 for (int i = 0; i < size; ++i) { 16256 keyValues.put(rawKeyValues.keyAt(i).substring(substringLength), 16257 rawKeyValues.valueAt(i)); 16258 } 16259 return keyValues; 16260 } 16261 16262 /** 16263 * Store a name/value pair into the database within the specified namespace. 16264 * <p> 16265 * Also the method takes an argument whether to make the value the default for this setting. 16266 * If the system already specified a default value, then the one passed in here will 16267 * <strong>not</strong> be set as the default. 16268 * </p> 16269 * 16270 * @param resolver to access the database with. 16271 * @param namespace to store the name/value pair in. 16272 * @param name to store. 16273 * @param value to associate with the name. 16274 * @param makeDefault whether to make the value the default one. 16275 * @return true if the value was set, false on database errors. 16276 * 16277 * @see #resetToDefaults(ContentResolver, int, String) 16278 * 16279 * @hide 16280 */ 16281 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG) putString(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull String name, @Nullable String value, boolean makeDefault)16282 static boolean putString(@NonNull ContentResolver resolver, @NonNull String namespace, 16283 @NonNull String name, @Nullable String value, boolean makeDefault) { 16284 return sNameValueCache.putStringForUser(resolver, createCompositeName(namespace, name), 16285 value, null, makeDefault, resolver.getUserId(), 16286 DEFAULT_OVERRIDEABLE_BY_RESTORE); 16287 } 16288 16289 /** 16290 * Clear all name/value pairs for the provided namespace and save new name/value pairs in 16291 * their place. 16292 * 16293 * @param resolver to access the database with. 16294 * @param namespace to which the names should be set. 16295 * @param keyValues map of key names (without the prefix) to values. 16296 * @return true if the name/value pairs were set, false if setting was blocked 16297 * 16298 * @hide 16299 */ 16300 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG) setStrings(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull Map<String, String> keyValues)16301 public static boolean setStrings(@NonNull ContentResolver resolver, 16302 @NonNull String namespace, @NonNull Map<String, String> keyValues) 16303 throws DeviceConfig.BadConfigException { 16304 HashMap<String, String> compositeKeyValueMap = new HashMap<>(keyValues.keySet().size()); 16305 for (Map.Entry<String, String> entry : keyValues.entrySet()) { 16306 compositeKeyValueMap.put( 16307 createCompositeName(namespace, entry.getKey()), entry.getValue()); 16308 } 16309 int result = sNameValueCache.setStringsForPrefix( 16310 resolver, createPrefix(namespace), compositeKeyValueMap); 16311 if (result == SET_ALL_RESULT_SUCCESS) { 16312 return true; 16313 } else if (result == SET_ALL_RESULT_DISABLED) { 16314 return false; 16315 } 16316 // If can't set given configuration that means it's bad 16317 throw new DeviceConfig.BadConfigException(); 16318 } 16319 16320 /** 16321 * Reset the values to their defaults. 16322 * <p> 16323 * The method accepts an optional prefix parameter. If provided, only pairs with a name that 16324 * starts with the exact prefix will be reset. Otherwise all will be reset. 16325 * 16326 * @param resolver Handle to the content resolver. 16327 * @param resetMode The reset mode to use. 16328 * @param namespace Optionally, to limit which which namespace is reset. 16329 * 16330 * @see #putString(ContentResolver, String, String, String, boolean) 16331 * 16332 * @hide 16333 */ 16334 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG) resetToDefaults(@onNull ContentResolver resolver, @ResetMode int resetMode, @Nullable String namespace)16335 static void resetToDefaults(@NonNull ContentResolver resolver, @ResetMode int resetMode, 16336 @Nullable String namespace) { 16337 try { 16338 Bundle arg = new Bundle(); 16339 arg.putInt(CALL_METHOD_USER_KEY, resolver.getUserId()); 16340 arg.putInt(CALL_METHOD_RESET_MODE_KEY, resetMode); 16341 if (namespace != null) { 16342 arg.putString(Settings.CALL_METHOD_PREFIX_KEY, createPrefix(namespace)); 16343 } 16344 IContentProvider cp = sProviderHolder.getProvider(resolver); 16345 cp.call(resolver.getAttributionSource(), 16346 sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_CONFIG, null, arg); 16347 } catch (RemoteException e) { 16348 Log.w(TAG, "Can't reset to defaults for " + DeviceConfig.CONTENT_URI, e); 16349 } 16350 } 16351 16352 /** 16353 * Bridge method between {@link DeviceConfig#setSyncDisabled(int)} and the 16354 * {@link com.android.providers.settings.SettingsProvider} implementation. 16355 * 16356 * @hide 16357 */ 16358 @SuppressLint("AndroidFrameworkRequiresPermission") 16359 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG) setSyncDisabled( @onNull ContentResolver resolver, @SyncDisabledMode int disableSyncMode)16360 static void setSyncDisabled( 16361 @NonNull ContentResolver resolver, @SyncDisabledMode int disableSyncMode) { 16362 try { 16363 Bundle args = new Bundle(); 16364 args.putInt(CALL_METHOD_SYNC_DISABLED_MODE_KEY, disableSyncMode); 16365 IContentProvider cp = sProviderHolder.getProvider(resolver); 16366 cp.call(resolver.getAttributionSource(), 16367 sProviderHolder.mUri.getAuthority(), CALL_METHOD_SET_SYNC_DISABLED_CONFIG, 16368 null, args); 16369 } catch (RemoteException e) { 16370 Log.w(TAG, "Can't set sync disabled " + DeviceConfig.CONTENT_URI, e); 16371 } 16372 } 16373 16374 /** 16375 * Bridge method between {@link DeviceConfig#isSyncDisabled()} and the 16376 * {@link com.android.providers.settings.SettingsProvider} implementation. 16377 * 16378 * @hide 16379 */ 16380 @SuppressLint("AndroidFrameworkRequiresPermission") 16381 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG) isSyncDisabled(@onNull ContentResolver resolver)16382 static boolean isSyncDisabled(@NonNull ContentResolver resolver) { 16383 try { 16384 Bundle args = Bundle.EMPTY; 16385 IContentProvider cp = sProviderHolder.getProvider(resolver); 16386 Bundle bundle = cp.call(resolver.getAttributionSource(), 16387 sProviderHolder.mUri.getAuthority(), CALL_METHOD_IS_SYNC_DISABLED_CONFIG, 16388 null, args); 16389 return bundle.getBoolean(KEY_CONFIG_IS_SYNC_DISABLED_RETURN); 16390 } catch (RemoteException e) { 16391 Log.w(TAG, "Can't query sync disabled " + DeviceConfig.CONTENT_URI, e); 16392 } 16393 return false; 16394 } 16395 16396 /** 16397 * Register callback for monitoring Config table. 16398 * 16399 * @param resolver Handle to the content resolver. 16400 * @param callback callback to register 16401 * 16402 * @hide 16403 */ 16404 @RequiresPermission(Manifest.permission.MONITOR_DEVICE_CONFIG_ACCESS) registerMonitorCallback(@onNull ContentResolver resolver, @NonNull RemoteCallback callback)16405 public static void registerMonitorCallback(@NonNull ContentResolver resolver, 16406 @NonNull RemoteCallback callback) { 16407 registerMonitorCallbackAsUser(resolver, resolver.getUserId(), callback); 16408 } 16409 registerMonitorCallbackAsUser( @onNull ContentResolver resolver, @UserIdInt int userHandle, @NonNull RemoteCallback callback)16410 private static void registerMonitorCallbackAsUser( 16411 @NonNull ContentResolver resolver, @UserIdInt int userHandle, 16412 @NonNull RemoteCallback callback) { 16413 try { 16414 Bundle arg = new Bundle(); 16415 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 16416 arg.putParcelable(CALL_METHOD_MONITOR_CALLBACK_KEY, callback); 16417 IContentProvider cp = sProviderHolder.getProvider(resolver); 16418 cp.call(resolver.getAttributionSource(), 16419 sProviderHolder.mUri.getAuthority(), 16420 CALL_METHOD_REGISTER_MONITOR_CALLBACK_CONFIG, null, arg); 16421 } catch (RemoteException e) { 16422 Log.w(TAG, "Can't register config monitor callback", e); 16423 } 16424 } 16425 16426 /** @hide */ clearProviderForTest()16427 public static void clearProviderForTest() { 16428 sProviderHolder.clearProviderForTest(); 16429 sNameValueCache.clearGenerationTrackerForTest(); 16430 } 16431 createCompositeName(@onNull String namespace, @NonNull String name)16432 private static String createCompositeName(@NonNull String namespace, @NonNull String name) { 16433 Preconditions.checkNotNull(namespace); 16434 Preconditions.checkNotNull(name); 16435 return createPrefix(namespace) + name; 16436 } 16437 createPrefix(@onNull String namespace)16438 private static String createPrefix(@NonNull String namespace) { 16439 Preconditions.checkNotNull(namespace); 16440 return namespace + "/"; 16441 } 16442 } 16443 16444 /** 16445 * User-defined bookmarks and shortcuts. The target of each bookmark is an 16446 * Intent URL, allowing it to be either a web page or a particular 16447 * application activity. 16448 * 16449 * @hide 16450 */ 16451 public static final class Bookmarks implements BaseColumns 16452 { 16453 private static final String TAG = "Bookmarks"; 16454 16455 /** 16456 * The content:// style URL for this table 16457 */ 16458 @UnsupportedAppUsage 16459 public static final Uri CONTENT_URI = 16460 Uri.parse("content://" + AUTHORITY + "/bookmarks"); 16461 16462 /** 16463 * The row ID. 16464 * <p>Type: INTEGER</p> 16465 */ 16466 public static final String ID = "_id"; 16467 16468 /** 16469 * Descriptive name of the bookmark that can be displayed to the user. 16470 * If this is empty, the title should be resolved at display time (use 16471 * {@link #getTitle(Context, Cursor)} any time you want to display the 16472 * title of a bookmark.) 16473 * <P> 16474 * Type: TEXT 16475 * </P> 16476 */ 16477 public static final String TITLE = "title"; 16478 16479 /** 16480 * Arbitrary string (displayed to the user) that allows bookmarks to be 16481 * organized into categories. There are some special names for 16482 * standard folders, which all start with '@'. The label displayed for 16483 * the folder changes with the locale (via {@link #getLabelForFolder}) but 16484 * the folder name does not change so you can consistently query for 16485 * the folder regardless of the current locale. 16486 * 16487 * <P>Type: TEXT</P> 16488 * 16489 */ 16490 public static final String FOLDER = "folder"; 16491 16492 /** 16493 * The Intent URL of the bookmark, describing what it points to. This 16494 * value is given to {@link android.content.Intent#getIntent} to create 16495 * an Intent that can be launched. 16496 * <P>Type: TEXT</P> 16497 */ 16498 public static final String INTENT = "intent"; 16499 16500 /** 16501 * Optional shortcut character associated with this bookmark. 16502 * <P>Type: INTEGER</P> 16503 */ 16504 public static final String SHORTCUT = "shortcut"; 16505 16506 /** 16507 * The order in which the bookmark should be displayed 16508 * <P>Type: INTEGER</P> 16509 */ 16510 public static final String ORDERING = "ordering"; 16511 16512 private static final String[] sIntentProjection = { INTENT }; 16513 private static final String[] sShortcutProjection = { ID, SHORTCUT }; 16514 private static final String sShortcutSelection = SHORTCUT + "=?"; 16515 16516 /** 16517 * Convenience function to retrieve the bookmarked Intent for a 16518 * particular shortcut key. 16519 * 16520 * @param cr The ContentResolver to query. 16521 * @param shortcut The shortcut key. 16522 * 16523 * @return Intent The bookmarked URL, or null if there is no bookmark 16524 * matching the given shortcut. 16525 */ getIntentForShortcut(ContentResolver cr, char shortcut)16526 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut) 16527 { 16528 Intent intent = null; 16529 16530 Cursor c = cr.query(CONTENT_URI, 16531 sIntentProjection, sShortcutSelection, 16532 new String[] { String.valueOf((int) shortcut) }, ORDERING); 16533 // Keep trying until we find a valid shortcut 16534 try { 16535 while (intent == null && c.moveToNext()) { 16536 try { 16537 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT)); 16538 intent = Intent.parseUri(intentURI, 0); 16539 } catch (java.net.URISyntaxException e) { 16540 // The stored URL is bad... ignore it. 16541 } catch (IllegalArgumentException e) { 16542 // Column not found 16543 Log.w(TAG, "Intent column not found", e); 16544 } 16545 } 16546 } finally { 16547 if (c != null) c.close(); 16548 } 16549 16550 return intent; 16551 } 16552 16553 /** 16554 * Add a new bookmark to the system. 16555 * 16556 * @param cr The ContentResolver to query. 16557 * @param intent The desired target of the bookmark. 16558 * @param title Bookmark title that is shown to the user; null if none 16559 * or it should be resolved to the intent's title. 16560 * @param folder Folder in which to place the bookmark; null if none. 16561 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If 16562 * this is non-zero and there is an existing bookmark entry 16563 * with this same shortcut, then that existing shortcut is 16564 * cleared (the bookmark is not removed). 16565 * @return The unique content URL for the new bookmark entry. 16566 */ 16567 @UnsupportedAppUsage add(ContentResolver cr, Intent intent, String title, String folder, char shortcut, int ordering)16568 public static Uri add(ContentResolver cr, 16569 Intent intent, 16570 String title, 16571 String folder, 16572 char shortcut, 16573 int ordering) 16574 { 16575 // If a shortcut is supplied, and it is already defined for 16576 // another bookmark, then remove the old definition. 16577 if (shortcut != 0) { 16578 cr.delete(CONTENT_URI, sShortcutSelection, 16579 new String[] { String.valueOf((int) shortcut) }); 16580 } 16581 16582 ContentValues values = new ContentValues(); 16583 if (title != null) values.put(TITLE, title); 16584 if (folder != null) values.put(FOLDER, folder); 16585 values.put(INTENT, intent.toUri(0)); 16586 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut); 16587 values.put(ORDERING, ordering); 16588 return cr.insert(CONTENT_URI, values); 16589 } 16590 16591 /** 16592 * Return the folder name as it should be displayed to the user. This 16593 * takes care of localizing special folders. 16594 * 16595 * @param r Resources object for current locale; only need access to 16596 * system resources. 16597 * @param folder The value found in the {@link #FOLDER} column. 16598 * 16599 * @return CharSequence The label for this folder that should be shown 16600 * to the user. 16601 */ getLabelForFolder(Resources r, String folder)16602 public static CharSequence getLabelForFolder(Resources r, String folder) { 16603 return folder; 16604 } 16605 16606 /** 16607 * Return the title as it should be displayed to the user. This takes 16608 * care of localizing bookmarks that point to activities. 16609 * 16610 * @param context A context. 16611 * @param cursor A cursor pointing to the row whose title should be 16612 * returned. The cursor must contain at least the {@link #TITLE} 16613 * and {@link #INTENT} columns. 16614 * @return A title that is localized and can be displayed to the user, 16615 * or the empty string if one could not be found. 16616 */ getTitle(Context context, Cursor cursor)16617 public static CharSequence getTitle(Context context, Cursor cursor) { 16618 int titleColumn = cursor.getColumnIndex(TITLE); 16619 int intentColumn = cursor.getColumnIndex(INTENT); 16620 if (titleColumn == -1 || intentColumn == -1) { 16621 throw new IllegalArgumentException( 16622 "The cursor must contain the TITLE and INTENT columns."); 16623 } 16624 16625 String title = cursor.getString(titleColumn); 16626 if (!TextUtils.isEmpty(title)) { 16627 return title; 16628 } 16629 16630 String intentUri = cursor.getString(intentColumn); 16631 if (TextUtils.isEmpty(intentUri)) { 16632 return ""; 16633 } 16634 16635 Intent intent; 16636 try { 16637 intent = Intent.parseUri(intentUri, 0); 16638 } catch (URISyntaxException e) { 16639 return ""; 16640 } 16641 16642 PackageManager packageManager = context.getPackageManager(); 16643 ResolveInfo info = packageManager.resolveActivity(intent, 0); 16644 return info != null ? info.loadLabel(packageManager) : ""; 16645 } 16646 } 16647 16648 /** 16649 * <p> 16650 * A Settings panel is floating UI that contains a fixed subset of settings to address a 16651 * particular user problem. For example, the 16652 * {@link #ACTION_INTERNET_CONNECTIVITY Internet Panel} surfaces settings related to 16653 * connecting to the internet. 16654 * <p> 16655 * Settings panels appear above the calling app to address the problem without 16656 * the user needing to open Settings and thus leave their current screen. 16657 */ 16658 public static final class Panel { Panel()16659 private Panel() { 16660 } 16661 16662 /** 16663 * Activity Action: Show a settings dialog containing settings to enable internet 16664 * connection. 16665 * <p> 16666 * Input: Nothing. 16667 * <p> 16668 * Output: Nothing. 16669 */ 16670 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION) 16671 public static final String ACTION_INTERNET_CONNECTIVITY = 16672 "android.settings.panel.action.INTERNET_CONNECTIVITY"; 16673 16674 /** 16675 * Activity Action: Show a settings dialog containing NFC-related settings. 16676 * <p> 16677 * Input: Nothing. 16678 * <p> 16679 * Output: Nothing. 16680 */ 16681 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION) 16682 public static final String ACTION_NFC = 16683 "android.settings.panel.action.NFC"; 16684 16685 /** 16686 * Activity Action: Show a settings dialog containing controls for Wifi. 16687 * <p> 16688 * Input: Nothing. 16689 * <p> 16690 * Output: Nothing. 16691 */ 16692 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION) 16693 public static final String ACTION_WIFI = 16694 "android.settings.panel.action.WIFI"; 16695 16696 /** 16697 * Activity Action: Show a settings dialog containing all volume streams. 16698 * <p> 16699 * Input: Nothing. 16700 * <p> 16701 * Output: Nothing. 16702 */ 16703 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION) 16704 public static final String ACTION_VOLUME = 16705 "android.settings.panel.action.VOLUME"; 16706 } 16707 16708 /** 16709 * Activity Action: Show setting page to process the addition of Wi-Fi networks to the user's 16710 * saved network list. The app should send a new intent with an extra that holds a maximum 16711 * of five {@link android.net.wifi.WifiNetworkSuggestion} that specify credentials for the 16712 * networks to be added to the user's database. The Intent should be sent via the 16713 * {@link android.app.Activity#startActivityForResult(Intent, int)} API. 16714 * <p> 16715 * Note: The app sending the Intent to add the credentials doesn't get any ownership over the 16716 * newly added network(s). For the Wi-Fi stack, these networks will look like the user 16717 * manually added them from the Settings UI. 16718 * <p> 16719 * Input: The app should put parcelable array list of 16720 * {@link android.net.wifi.WifiNetworkSuggestion} into the {@link #EXTRA_WIFI_NETWORK_LIST} 16721 * extra. 16722 * <p> 16723 * Output: After {@link android.app.Activity#startActivityForResult(Intent, int)}, the 16724 * callback {@link android.app.Activity#onActivityResult(int, int, Intent)} will have a 16725 * result code {@link android.app.Activity#RESULT_OK} to indicate user pressed the save 16726 * button to save the networks or {@link android.app.Activity#RESULT_CANCELED} to indicate 16727 * that the user rejected the request. Additionally, an integer array list, stored in 16728 * {@link #EXTRA_WIFI_NETWORK_RESULT_LIST}, will indicate the process result of each network. 16729 */ 16730 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 16731 public static final String ACTION_WIFI_ADD_NETWORKS = 16732 "android.settings.WIFI_ADD_NETWORKS"; 16733 16734 /** 16735 * A bundle extra of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that indicates the list 16736 * of the {@link android.net.wifi.WifiNetworkSuggestion} elements. The maximum count of the 16737 * {@link android.net.wifi.WifiNetworkSuggestion} elements in the list will be five. 16738 * <p> 16739 * For example: 16740 * To provide credentials for one open and one WPA2 networks: 16741 * 16742 * <pre>{@code 16743 * final WifiNetworkSuggestion suggestion1 = 16744 * new WifiNetworkSuggestion.Builder() 16745 * .setSsid("test111111") 16746 * .build(); 16747 * final WifiNetworkSuggestion suggestion2 = 16748 * new WifiNetworkSuggestion.Builder() 16749 * .setSsid("test222222") 16750 * .setWpa2Passphrase("test123456") 16751 * .build(); 16752 * final List<WifiNetworkSuggestion> suggestionsList = new ArrayList<>; 16753 * suggestionsList.add(suggestion1); 16754 * suggestionsList.add(suggestion2); 16755 * Bundle bundle = new Bundle(); 16756 * bundle.putParcelableArrayList(Settings.EXTRA_WIFI_NETWORK_LIST,(ArrayList<? extends 16757 * Parcelable>) suggestionsList); 16758 * final Intent intent = new Intent(Settings.ACTION_WIFI_ADD_NETWORKS); 16759 * intent.putExtras(bundle); 16760 * startActivityForResult(intent, 0); 16761 * }</pre> 16762 */ 16763 public static final String EXTRA_WIFI_NETWORK_LIST = 16764 "android.provider.extra.WIFI_NETWORK_LIST"; 16765 16766 /** 16767 * A bundle extra of the result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that 16768 * indicates the action result of the saved {@link android.net.wifi.WifiNetworkSuggestion}. 16769 * Its value is a list of integers, and all the elements will be 1:1 mapping to the elements 16770 * in {@link #EXTRA_WIFI_NETWORK_LIST}, if user press cancel to cancel the add networks 16771 * request, then its value will be null. 16772 * <p> 16773 * Note: The integer value will be one of the {@link #ADD_WIFI_RESULT_SUCCESS}, 16774 * {@link #ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED}, or {@link #ADD_WIFI_RESULT_ALREADY_EXISTS}}. 16775 */ 16776 public static final String EXTRA_WIFI_NETWORK_RESULT_LIST = 16777 "android.provider.extra.WIFI_NETWORK_RESULT_LIST"; 16778 16779 /** @hide */ 16780 @Retention(RetentionPolicy.SOURCE) 16781 @IntDef(prefix = {"ADD_WIFI_RESULT_"}, value = { 16782 ADD_WIFI_RESULT_SUCCESS, 16783 ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED, 16784 ADD_WIFI_RESULT_ALREADY_EXISTS 16785 }) 16786 public @interface AddWifiResult { 16787 } 16788 16789 /** 16790 * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that saving or updating the 16791 * corresponding Wi-Fi network was successful. 16792 */ 16793 public static final int ADD_WIFI_RESULT_SUCCESS = 0; 16794 16795 /** 16796 * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that saving the corresponding 16797 * Wi-Fi network failed. 16798 */ 16799 public static final int ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED = 1; 16800 16801 /** 16802 * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that indicates the Wi-Fi network 16803 * already exists. 16804 */ 16805 public static final int ADD_WIFI_RESULT_ALREADY_EXISTS = 2; 16806 16807 /** 16808 * Activity Action: Allows user to select current bug report handler. 16809 * <p> 16810 * Input: Nothing. 16811 * <p> 16812 * Output: Nothing. 16813 * 16814 * @hide 16815 */ 16816 @SystemApi 16817 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 16818 public static final String ACTION_BUGREPORT_HANDLER_SETTINGS = 16819 "android.settings.BUGREPORT_HANDLER_SETTINGS"; 16820 16821 private static final String[] PM_WRITE_SETTINGS = { 16822 android.Manifest.permission.WRITE_SETTINGS 16823 }; 16824 private static final String[] PM_CHANGE_NETWORK_STATE = { 16825 android.Manifest.permission.CHANGE_NETWORK_STATE, 16826 android.Manifest.permission.WRITE_SETTINGS 16827 }; 16828 private static final String[] PM_SYSTEM_ALERT_WINDOW = { 16829 android.Manifest.permission.SYSTEM_ALERT_WINDOW 16830 }; 16831 16832 /** 16833 * Activity Action: Show screen for controlling which apps have access to manage external 16834 * storage. 16835 * <p> 16836 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 16837 * <p> 16838 * If you want to control a specific app's access to manage external storage, use 16839 * {@link #ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION} instead. 16840 * <p> 16841 * Output: Nothing. 16842 * @see #ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION 16843 */ 16844 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 16845 public static final String ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION = 16846 "android.settings.MANAGE_ALL_FILES_ACCESS_PERMISSION"; 16847 16848 /** 16849 * Activity Action: Show screen for controlling if the app specified in the data URI of the 16850 * intent can manage external storage. 16851 * <p> 16852 * Launching the corresponding activity requires the permission 16853 * {@link Manifest.permission#MANAGE_EXTERNAL_STORAGE}. 16854 * <p> 16855 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 16856 * <p> 16857 * Input: The Intent's data URI MUST specify the application package name whose ability of 16858 * managing external storage you want to control. 16859 * For example "package:com.my.app". 16860 * <p> 16861 * Output: Nothing. 16862 * @see #ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION 16863 */ 16864 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 16865 public static final String ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION = 16866 "android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION"; 16867 16868 /** 16869 * Performs a strict and comprehensive check of whether a calling package is allowed to 16870 * write/modify system settings, as the condition differs for pre-M, M+, and 16871 * privileged/preinstalled apps. If the provided uid does not match the 16872 * callingPackage, a negative result will be returned. 16873 * @hide 16874 */ 16875 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) isCallingPackageAllowedToWriteSettings(Context context, int uid, String callingPackage, boolean throwException)16876 public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid, 16877 String callingPackage, boolean throwException) { 16878 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 16879 callingPackage, null /*attribution not needed when not making note */, 16880 throwException, AppOpsManager.OP_WRITE_SETTINGS, PM_WRITE_SETTINGS, 16881 false); 16882 } 16883 16884 /** 16885 * @deprecated Use {@link #checkAndNoteWriteSettingsOperation(Context, int, String, String, 16886 * boolean)} instead. 16887 * 16888 * @hide 16889 */ 16890 @Deprecated 16891 @SystemApi checkAndNoteWriteSettingsOperation(@onNull Context context, int uid, @NonNull String callingPackage, boolean throwException)16892 public static boolean checkAndNoteWriteSettingsOperation(@NonNull Context context, int uid, 16893 @NonNull String callingPackage, boolean throwException) { 16894 return checkAndNoteWriteSettingsOperation(context, uid, callingPackage, null, 16895 throwException); 16896 } 16897 16898 /** 16899 * Performs a strict and comprehensive check of whether a calling package is allowed to 16900 * write/modify system settings, as the condition differs for pre-M, M+, and 16901 * privileged/preinstalled apps. If the provided uid does not match the 16902 * callingPackage, a negative result will be returned. The caller is expected to have 16903 * the WRITE_SETTINGS permission declared. 16904 * 16905 * Note: if the check is successful, the operation of this app will be updated to the 16906 * current time. 16907 * @hide 16908 */ 16909 @SystemApi checkAndNoteWriteSettingsOperation(@onNull Context context, int uid, @NonNull String callingPackage, @Nullable String callingAttributionTag, boolean throwException)16910 public static boolean checkAndNoteWriteSettingsOperation(@NonNull Context context, int uid, 16911 @NonNull String callingPackage, @Nullable String callingAttributionTag, 16912 boolean throwException) { 16913 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 16914 callingPackage, callingAttributionTag, throwException, 16915 AppOpsManager.OP_WRITE_SETTINGS, PM_WRITE_SETTINGS, true); 16916 } 16917 16918 /** 16919 * Performs a strict and comprehensive check of whether a calling package is allowed to 16920 * draw on top of other apps, as the conditions differs for pre-M, M+, and 16921 * privileged/preinstalled apps. If the provided uid does not match the callingPackage, 16922 * a negative result will be returned. 16923 * @hide 16924 */ 16925 @UnsupportedAppUsage isCallingPackageAllowedToDrawOverlays(Context context, int uid, String callingPackage, boolean throwException)16926 public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid, 16927 String callingPackage, boolean throwException) { 16928 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 16929 callingPackage, null /*attribution not needed when not making note */, 16930 throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, PM_SYSTEM_ALERT_WINDOW, 16931 false); 16932 } 16933 16934 /** 16935 * Performs a strict and comprehensive check of whether a calling package is allowed to 16936 * draw on top of other apps, as the conditions differs for pre-M, M+, and 16937 * privileged/preinstalled apps. If the provided uid does not match the callingPackage, 16938 * a negative result will be returned. 16939 * 16940 * Note: if the check is successful, the operation of this app will be updated to the 16941 * current time. 16942 * @hide 16943 */ checkAndNoteDrawOverlaysOperation(Context context, int uid, String callingPackage, String callingAttributionTag, boolean throwException)16944 public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, 16945 String callingPackage, String callingAttributionTag, boolean throwException) { 16946 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 16947 callingPackage, callingAttributionTag, throwException, 16948 AppOpsManager.OP_SYSTEM_ALERT_WINDOW, PM_SYSTEM_ALERT_WINDOW, true); 16949 } 16950 16951 /** 16952 * @deprecated Use {@link #isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context, 16953 * int, String, String, boolean, int, String[], boolean)} instead. 16954 * 16955 * @hide 16956 */ 16957 @Deprecated 16958 @UnsupportedAppUsage isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] permissions, boolean makeNote)16959 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, 16960 int uid, String callingPackage, boolean throwException, int appOpsOpCode, 16961 String[] permissions, boolean makeNote) { 16962 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 16963 callingPackage, null, throwException, appOpsOpCode, permissions, makeNote); 16964 } 16965 16966 /** 16967 * Helper method to perform a general and comprehensive check of whether an operation that is 16968 * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and 16969 * OP_WRITE_SETTINGS 16970 * @hide 16971 */ isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, int uid, String callingPackage, String callingAttributionTag, boolean throwException, int appOpsOpCode, String[] permissions, boolean makeNote)16972 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, 16973 int uid, String callingPackage, String callingAttributionTag, boolean throwException, 16974 int appOpsOpCode, String[] permissions, boolean makeNote) { 16975 if (callingPackage == null) { 16976 return false; 16977 } 16978 16979 AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE); 16980 int mode = AppOpsManager.MODE_DEFAULT; 16981 if (makeNote) { 16982 mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage, callingAttributionTag, 16983 null); 16984 } else { 16985 mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage); 16986 } 16987 16988 switch (mode) { 16989 case AppOpsManager.MODE_ALLOWED: 16990 return true; 16991 16992 case AppOpsManager.MODE_DEFAULT: 16993 // this is the default operating mode after an app's installation 16994 // In this case we will check all associated static permission to see 16995 // if it is granted during install time. 16996 for (String permission : permissions) { 16997 if (context.checkCallingOrSelfPermission(permission) == PackageManager 16998 .PERMISSION_GRANTED) { 16999 // if either of the permissions are granted, we will allow it 17000 return true; 17001 } 17002 } 17003 17004 default: 17005 // this is for all other cases trickled down here... 17006 if (!throwException) { 17007 return false; 17008 } 17009 } 17010 17011 // prepare string to throw SecurityException 17012 StringBuilder exceptionMessage = new StringBuilder(); 17013 exceptionMessage.append(callingPackage); 17014 exceptionMessage.append(" was not granted "); 17015 if (permissions.length > 1) { 17016 exceptionMessage.append(" either of these permissions: "); 17017 } else { 17018 exceptionMessage.append(" this permission: "); 17019 } 17020 for (int i = 0; i < permissions.length; i++) { 17021 exceptionMessage.append(permissions[i]); 17022 exceptionMessage.append((i == permissions.length - 1) ? "." : ", "); 17023 } 17024 17025 throw new SecurityException(exceptionMessage.toString()); 17026 } 17027 17028 /** 17029 * Retrieves a correponding package name for a given uid. It will query all 17030 * packages that are associated with the given uid, but it will return only 17031 * the zeroth result. 17032 * Note: If package could not be found, a null is returned. 17033 * @hide 17034 */ getPackageNameForUid(Context context, int uid)17035 public static String getPackageNameForUid(Context context, int uid) { 17036 String[] packages = context.getPackageManager().getPackagesForUid(uid); 17037 if (packages == null) { 17038 return null; 17039 } 17040 return packages[0]; 17041 } 17042 } 17043