Debian Codegraph @

core/java/android/provider/Settings.java

raw symbols SCIP
1 /*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package android.provider;
18
19 import android.Manifest;
20 import android.annotation.IntDef;
21 import android.annotation.IntRange;
22 import android.annotation.NonNull;
23 import android.annotation.Nullable;
24 import android.annotation.RequiresPermission;
25 import android.annotation.SdkConstant;
26 import android.annotation.SdkConstant.SdkConstantType;
27 import android.annotation.SuppressLint;
28 import android.annotation.SystemApi;
29 import android.annotation.TestApi;
30 import android.annotation.UserIdInt;
31 import android.app.Activity;
32 import android.app.ActivityThread;
33 import android.app.AppOpsManager;
34 import android.app.Application;
35 import android.app.AutomaticZenRule;
36 import android.app.NotificationChannel;
37 import android.app.NotificationManager;
38 import android.app.SearchManager;
39 import android.app.WallpaperManager;
40 import android.compat.annotation.UnsupportedAppUsage;
41 import android.content.ComponentName;
42 import android.content.ContentResolver;
43 import android.content.ContentValues;
44 import android.content.Context;
45 import android.content.IContentProvider;
46 import android.content.Intent;
47 import android.content.pm.ActivityInfo;
48 import android.content.pm.ApplicationInfo;
49 import android.content.pm.PackageManager;
50 import android.content.pm.ResolveInfo;
51 import android.content.res.Configuration;
52 import android.content.res.Resources;
53 import android.database.Cursor;
54 import android.database.SQLException;
55 import android.location.ILocationManager;
56 import android.location.LocationManager;
57 import android.media.AudioManager;
58 import android.net.ConnectivityManager;
59 import android.net.NetworkScoreManager;
60 import android.net.Uri;
61 import android.net.wifi.SoftApConfiguration;
62 import android.net.wifi.WifiManager;
63 import android.net.wifi.p2p.WifiP2pManager;
64 import android.os.BatteryManager;
65 import android.os.Binder;
66 import android.os.Build;
67 import android.os.Build.VERSION_CODES;
68 import android.os.Bundle;
69 import android.os.DropBoxManager;
70 import android.os.IBinder;
71 import android.os.LocaleList;
72 import android.os.PowerManager;
73 import android.os.PowerManager.AutoPowerSaveModeTriggers;
74 import android.os.Process;
75 import android.os.RemoteCallback;
76 import android.os.RemoteException;
77 import android.os.ResultReceiver;
78 import android.os.ServiceManager;
79 import android.os.UserHandle;
80 import android.speech.tts.TextToSpeech;
81 import android.telephony.TelephonyManager;
82 import android.text.TextUtils;
83 import android.util.AndroidException;
84 import android.util.ArrayMap;
85 import android.util.ArraySet;
86 import android.util.Log;
87 import android.util.MemoryIntArray;
88 import android.view.Display;
89 import android.view.MotionEvent;
90 import android.view.ViewConfiguration;
91 import android.view.Window;
92 import android.view.WindowManager.LayoutParams;
93 import android.widget.Editor;
94
95 import com.android.internal.annotations.GuardedBy;
96 import com.android.internal.util.Preconditions;
97 import com.android.internal.widget.ILockSettings;
98
99 import java.io.IOException;
100 import java.lang.annotation.ElementType;
101 import java.lang.annotation.Retention;
102 import java.lang.annotation.RetentionPolicy;
103 import java.lang.annotation.Target;
104 import java.lang.reflect.Field;
105 import java.net.URISyntaxException;
106 import java.util.ArrayList;
107 import java.util.HashMap;
108 import java.util.HashSet;
109 import java.util.List;
110 import java.util.Map;
111 import java.util.Objects;
112 import java.util.Set;
113 /**
114 * The Settings provider contains global system-level device preferences.
115 */
116 public final class Settings {
117 /** @hide */
118 public static final boolean DEFAULT_OVERRIDEABLE_BY_RESTORE = false;
119
120 // Intent actions for Settings
121
122 /**
123 * Activity Action: Show system settings.
124 * <p>
125 * Input: Nothing.
126 * <p>
127 * Output: Nothing.
128 */
129 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
130 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
131
132 /**
133 * Activity Action: Show settings to allow configuration of APNs.
134 * <p>
135 * Input: Nothing.
136 * <p>
137 * Output: Nothing.
138 *
139 * <p class="note">
140 * In some cases, a matching Activity may not exist, so ensure you
141 * safeguard against this.
142 */
143 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
144 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
145
146 /**
147 * Activity Action: Show settings to allow configuration of current location
148 * sources.
149 * <p>
150 * In some cases, a matching Activity may not exist, so ensure you
151 * safeguard against this.
152 * <p>
153 * Input: Nothing.
154 * <p>
155 * Output: Nothing.
156 */
157 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
158 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
159 "android.settings.LOCATION_SOURCE_SETTINGS";
160
161 /**
162 * Activity Action: Show settings to allow configuration of location controller extra package.
163 * <p>
164 * In some cases, a matching Activity may not exist, so ensure you
165 * safeguard against this.
166 * <p>
167 * Input: Nothing.
168 * <p>
169 * Output: Nothing.
170 *
171 * @hide
172 */
173 @SystemApi
174 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
175 public static final String ACTION_LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS =
176 "android.settings.LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS";
177
178 /**
179 * Activity Action: Show scanning settings to allow configuration of Wi-Fi
180 * and Bluetooth scanning settings.
181 * <p>
182 * In some cases, a matching Activity may not exist, so ensure you
183 * safeguard against this.
184 * <p>
185 * Input: Nothing.
186 * <p>
187 * Output: Nothing.
188 * @hide
189 */
190 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
191 public static final String ACTION_LOCATION_SCANNING_SETTINGS =
192 "android.settings.LOCATION_SCANNING_SETTINGS";
193
194 /**
195 * Activity Action: Show settings to allow configuration of users.
196 * <p>
197 * In some cases, a matching Activity may not exist, so ensure you
198 * safeguard against this.
199 * <p>
200 * Input: Nothing.
201 * <p>
202 * Output: Nothing.
203 * @hide
204 */
205 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
206 public static final String ACTION_USER_SETTINGS =
207 "android.settings.USER_SETTINGS";
208
209 /**
210 * Activity Action: Show settings to allow configuration of wireless controls
211 * such as Wi-Fi, Bluetooth and Mobile networks.
212 * <p>
213 * In some cases, a matching Activity may not exist, so ensure you
214 * safeguard against this.
215 * <p>
216 * Input: Nothing.
217 * <p>
218 * Output: Nothing.
219 */
220 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
221 public static final String ACTION_WIRELESS_SETTINGS =
222 "android.settings.WIRELESS_SETTINGS";
223
224 /**
225 * Activity Action: Show tether provisioning activity.
226 *
227 * <p>
228 * In some cases, a matching Activity may not exist, so ensure you
229 * safeguard against this.
230 * <p>
231 * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type
232 * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should
233 * contain a {@link ResultReceiver} which will be called back with a tether result code.
234 * <p>
235 * Output: The result of the provisioning check.
236 * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful,
237 * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure.
238 *
239 * @hide
240 */
241 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
242 @SystemApi
243 public static final String ACTION_TETHER_PROVISIONING_UI =
244 "android.settings.TETHER_PROVISIONING_UI";
245
246 /**
247 * Activity Action: Show a dialog activity to notify tethering is NOT supported by carrier.
248 *
249 * When {@link android.telephony.CarrierConfigManager#KEY_CARRIER_SUPPORTS_TETHERING_BOOL}
250 * is false, and tethering is started by Settings, this dialog activity will be started to
251 * tell the user that tethering is not supported by carrier.
252 *
253 * @hide
254 */
255 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
256 @SystemApi
257 public static final String ACTION_TETHER_UNSUPPORTED_CARRIER_UI =
258 "android.settings.TETHER_UNSUPPORTED_CARRIER_UI";
259
260 /**
261 * Activity Action: Show settings to allow entering/exiting airplane mode.
262 * <p>
263 * In some cases, a matching Activity may not exist, so ensure you
264 * safeguard against this.
265 * <p>
266 * Input: Nothing.
267 * <p>
268 * Output: Nothing.
269 */
270 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
271 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
272 "android.settings.AIRPLANE_MODE_SETTINGS";
273
274 /**
275 * Activity Action: Show mobile data usage list.
276 * <p>
277 * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify
278 * how and what mobile data statistics should be collected.
279 * <p>
280 * Output: Nothing
281 * @hide
282 */
283 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
284 public static final String ACTION_MOBILE_DATA_USAGE =
285 "android.settings.MOBILE_DATA_USAGE";
286
287 /** @hide */
288 public static final String EXTRA_NETWORK_TEMPLATE = "network_template";
289
290 /**
291 * Activity Action: Show One-handed mode Settings page.
292 * <p>
293 * Input: Nothing
294 * <p>
295 * Output: Nothing
296 * @hide
297 */
298 public static final String ACTION_ONE_HANDED_SETTINGS =
299 "android.settings.action.ONE_HANDED_SETTINGS";
300 /**
301 * The return values for {@link Settings.Config#set}
302 * @hide
303 */
304 @IntDef(prefix = "SET_ALL_RESULT_",
305 value = { SET_ALL_RESULT_FAILURE, SET_ALL_RESULT_SUCCESS, SET_ALL_RESULT_DISABLED })
306 @Retention(RetentionPolicy.SOURCE)
307 @Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE})
308 public @interface SetAllResult {}
309
310 /**
311 * A return value for {@link #KEY_CONFIG_SET_ALL_RETURN}, indicates failure.
312 * @hide
313 */
314 public static final int SET_ALL_RESULT_FAILURE = 0;
315
316 /**
317 * A return value for {@link #KEY_CONFIG_SET_ALL_RETURN}, indicates success.
318 * @hide
319 */
320 public static final int SET_ALL_RESULT_SUCCESS = 1;
321
322 /**
323 * A return value for {@link #KEY_CONFIG_SET_ALL_RETURN}, indicates a set all is disabled.
324 * @hide
325 */
326 public static final int SET_ALL_RESULT_DISABLED = 2;
327
328 /** @hide */
329 public static final String KEY_CONFIG_SET_ALL_RETURN = "config_set_all_return";
330
331 /** @hide */
332 public static final String KEY_CONFIG_GET_SYNC_DISABLED_MODE_RETURN =
333 "config_get_sync_disabled_mode_return";
334
335 /**
336 * An int extra specifying a subscription ID.
337 *
338 * @see android.telephony.SubscriptionInfo#getSubscriptionId
339 */
340 public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID";
341
342 /**
343 * Activity Action: Modify Airplane mode settings using a voice command.
344 * <p>
345 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
346 * <p>
347 * This intent MUST be started using
348 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
349 * startVoiceActivity}.
350 * <p>
351 * Note: The activity implementing this intent MUST verify that
352 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
353 * modifying the setting.
354 * <p>
355 * Input: To tell which state airplane mode should be set to, add the
356 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
357 * If the extra is not included, no changes will be made.
358 * <p>
359 * Output: Nothing.
360 */
361 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
362 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
363 "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
364
365 /**
366 * Activity Action: Show settings for accessibility modules.
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 */
375 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
376 public static final String ACTION_ACCESSIBILITY_SETTINGS =
377 "android.settings.ACCESSIBILITY_SETTINGS";
378
379 /**
380 * Activity Action: Show detail settings of a particular accessibility service.
381 * <p>
382 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
383 * <p>
384 * Input: {@link Intent#EXTRA_COMPONENT_NAME} must specify the accessibility service component
385 * name to be shown.
386 * <p>
387 * Output: Nothing.
388 * @hide
389 **/
390 @SystemApi
391 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
392 public static final String ACTION_ACCESSIBILITY_DETAILS_SETTINGS =
393 "android.settings.ACCESSIBILITY_DETAILS_SETTINGS";
394
395 /**
396 * Activity Action: Show settings to allow configuration of Reduce Bright Colors.
397 * <p>
398 * In some cases, a matching Activity may not exist, so ensure you
399 * safeguard against this.
400 * <p>
401 * Input: Nothing.
402 * <p>
403 * Output: Nothing.
404 * @hide
405 */
406 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
407 public static final String ACTION_REDUCE_BRIGHT_COLORS_SETTINGS =
408 "android.settings.REDUCE_BRIGHT_COLORS_SETTINGS";
409
410 /**
411 * Activity Action: Show settings to allow configuration of Color correction.
412 * <p>
413 * In some cases, a matching Activity may not exist, so ensure you
414 * safeguard against this.
415 * <p>
416 * Input: Nothing.
417 * <p>
418 * Output: Nothing.
419 * @hide
420 */
421 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
422 public static final String ACTION_COLOR_CORRECTION_SETTINGS =
423 "com.android.settings.ACCESSIBILITY_COLOR_SPACE_SETTINGS";
424
425 /**
426 * Activity Action: Show settings to allow configuration of Color inversion.
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 * @hide
435 */
436 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
437 public static final String ACTION_COLOR_INVERSION_SETTINGS =
438 "android.settings.COLOR_INVERSION_SETTINGS";
439
440 /**
441 * Activity Action: Show settings to control access to usage information.
442 * <p>
443 * In some cases, a matching Activity may not exist, so ensure you
444 * safeguard against this.
445 * <p>
446 * Input: Nothing.
447 * <p>
448 * Output: Nothing.
449 */
450 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
451 public static final String ACTION_USAGE_ACCESS_SETTINGS =
452 "android.settings.USAGE_ACCESS_SETTINGS";
453
454 /**
455 * Activity Category: Show application settings related to usage access.
456 * <p>
457 * An activity that provides a user interface for adjusting usage access related
458 * preferences for its containing application. Optional but recommended for apps that
459 * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}.
460 * <p>
461 * The activity may define meta-data to describe what usage access is
462 * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which
463 * will be displayed in Settings.
464 * <p>
465 * Input: Nothing.
466 * <p>
467 * Output: Nothing.
468 */
469 @SdkConstant(SdkConstantType.INTENT_CATEGORY)
470 public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG =
471 "android.intent.category.USAGE_ACCESS_CONFIG";
472
473 /**
474 * Metadata key: Reason for needing usage access.
475 * <p>
476 * A key for metadata attached to an activity that receives action
477 * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the
478 * user as description of how the app uses usage access.
479 * <p>
480 */
481 public static final String METADATA_USAGE_ACCESS_REASON =
482 "android.settings.metadata.USAGE_ACCESS_REASON";
483
484 /**
485 * Activity Action: Show settings to allow configuration of security and
486 * location privacy.
487 * <p>
488 * In some cases, a matching Activity may not exist, so ensure you
489 * safeguard against this.
490 * <p>
491 * Input: Nothing.
492 * <p>
493 * Output: Nothing.
494 */
495 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
496 public static final String ACTION_SECURITY_SETTINGS =
497 "android.settings.SECURITY_SETTINGS";
498
499 /**
500 * Activity Action: Show settings to allow configuration of trusted external sources
501 *
502 * Input: Optionally, the Intent's data URI can specify the application package name to
503 * directly invoke the management GUI specific to the package name. For example
504 * "package:com.my.app".
505 * <p>
506 * Output: Nothing.
507 */
508 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
509 public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES =
510 "android.settings.MANAGE_UNKNOWN_APP_SOURCES";
511
512 /**
513 * Activity Action: Show settings to allow configuration of
514 * {@link Manifest.permission#SCHEDULE_EXACT_ALARM} permission
515 *
516 * Input: Optionally, the Intent's data URI can specify the application package name to
517 * directly invoke the management GUI specific to the package name. For example
518 * "package:com.my.app".
519 * <p>
520 * Output: When a package data uri is passed as input, the activity result is set to
521 * {@link android.app.Activity#RESULT_OK} if the permission was granted to the app. Otherwise,
522 * the result is set to {@link android.app.Activity#RESULT_CANCELED}.
523 */
524 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
525 public static final String ACTION_REQUEST_SCHEDULE_EXACT_ALARM =
526 "android.settings.REQUEST_SCHEDULE_EXACT_ALARM";
527
528 /**
529 * Activity Action: Show settings to allow configuration of
530 * {@link Manifest.permission#MANAGE_MEDIA} permission
531 *
532 * Input: Optionally, the Intent's data URI can specify the application package name to
533 * directly invoke the management GUI specific to the package name. For example
534 * "package:com.my.app".
535 * <p>
536 * Output: Nothing.
537 */
538 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
539 public static final String ACTION_REQUEST_MANAGE_MEDIA =
540 "android.settings.REQUEST_MANAGE_MEDIA";
541
542 /**
543 * Activity Action: Show settings to allow configuration of cross-profile access for apps
544 *
545 * Input: Optionally, the Intent's data URI can specify the application package name to
546 * directly invoke the management GUI specific to the package name. For example
547 * "package:com.my.app".
548 * <p>
549 * Output: Nothing.
550 *
551 * @hide
552 */
553 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
554 public static final String ACTION_MANAGE_CROSS_PROFILE_ACCESS =
555 "android.settings.MANAGE_CROSS_PROFILE_ACCESS";
556
557 /**
558 * Activity Action: Show the "Open by Default" page in a particular application's details page.
559 * <p>
560 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
561 * <p>
562 * Input: The Intent's data URI specifies the application package name
563 * to be shown, with the "package" scheme. That is "package:com.my.app".
564 * <p>
565 * Output: Nothing.
566 */
567 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
568 public static final String ACTION_APP_OPEN_BY_DEFAULT_SETTINGS =
569 "android.settings.APP_OPEN_BY_DEFAULT_SETTINGS";
570
571 /**
572 * Activity Action: Show trusted credentials settings, opening to the user tab,
573 * to allow management of installed credentials.
574 * <p>
575 * In some cases, a matching Activity may not exist, so ensure you
576 * safeguard against this.
577 * <p>
578 * Input: Nothing.
579 * <p>
580 * Output: Nothing.
581 * @hide
582 */
583 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
584 @UnsupportedAppUsage
585 public static final String ACTION_TRUSTED_CREDENTIALS_USER =
586 "com.android.settings.TRUSTED_CREDENTIALS_USER";
587
588 /**
589 * Activity Action: Show dialog explaining that an installed CA cert may enable
590 * monitoring of encrypted network traffic.
591 * <p>
592 * In some cases, a matching Activity may not exist, so ensure you
593 * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the
594 * number of certificates.
595 * <p>
596 * Input: Nothing.
597 * <p>
598 * Output: Nothing.
599 * @hide
600 */
601 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
602 public static final String ACTION_MONITORING_CERT_INFO =
603 "com.android.settings.MONITORING_CERT_INFO";
604
605 /**
606 * Activity Action: Show settings to allow configuration of privacy options.
607 * <p>
608 * In some cases, a matching Activity may not exist, so ensure you
609 * safeguard against this.
610 * <p>
611 * Input: Nothing.
612 * <p>
613 * Output: Nothing.
614 */
615 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
616 public static final String ACTION_PRIVACY_SETTINGS =
617 "android.settings.PRIVACY_SETTINGS";
618
619 /**
620 * Activity Action: Show settings to allow configuration of VPN.
621 * <p>
622 * In some cases, a matching Activity may not exist, so ensure you
623 * safeguard against this.
624 * <p>
625 * Input: Nothing.
626 * <p>
627 * Output: Nothing.
628 */
629 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
630 public static final String ACTION_VPN_SETTINGS =
631 "android.settings.VPN_SETTINGS";
632
633 /**
634 * Activity Action: Show settings to allow configuration of Wi-Fi.
635 * <p>
636 * In some cases, a matching Activity may not exist, so ensure you
637 * safeguard against this.
638 * <p>
639 * Input: Nothing.
640 * <p>
641 * Output: Nothing.
642 */
643 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
644 public static final String ACTION_WIFI_SETTINGS =
645 "android.settings.WIFI_SETTINGS";
646
647 /**
648 * Activity Action: Show settings to allow configuration of a static IP
649 * address for Wi-Fi.
650 * <p>
651 * In some cases, a matching Activity may not exist, so ensure you safeguard
652 * against this.
653 * <p>
654 * Input: Nothing.
655 * <p>
656 * Output: Nothing.
657 */
658 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
659 public static final String ACTION_WIFI_IP_SETTINGS =
660 "android.settings.WIFI_IP_SETTINGS";
661
662 /**
663 * Activity Action: Show setting page to process a Wi-Fi Easy Connect (aka DPP) URI and start
664 * configuration. This intent should be used when you want to use this device to take on the
665 * configurator role for an IoT/other device. When provided with a valid DPP URI
666 * string, Settings will open a Wi-Fi selection screen for the user to indicate which network
667 * they would like to configure the device specified in the DPP URI string and
668 * carry them through the rest of the flow for provisioning the device.
669 * <p>
670 * In some cases, a matching Activity may not exist, so ensure to safeguard against this by
671 * checking {@link WifiManager#isEasyConnectSupported()}.
672 * <p>
673 * Input: The Intent's data URI specifies bootstrapping information for authenticating and
674 * provisioning the peer, and uses a "DPP" scheme. The URI should be attached to the intent
675 * using {@link Intent#setData(Uri)}. The calling app can obtain a DPP URI in any
676 * way, e.g. by scanning a QR code or other out-of-band methods. The calling app may also
677 * attach the {@link #EXTRA_EASY_CONNECT_BAND_LIST} extra to provide information
678 * about the bands supported by the enrollee device.
679 * <p>
680 * Output: After calling {@link android.app.Activity#startActivityForResult}, the callback
681 * {@code onActivityResult} will have resultCode {@link android.app.Activity#RESULT_OK} if
682 * the Wi-Fi Easy Connect configuration succeeded and the user tapped the 'Done' button, or
683 * {@link android.app.Activity#RESULT_CANCELED} if the operation failed and user tapped the
684 * 'Cancel' button. In case the operation has failed, a status code from
685 * {@link android.net.wifi.EasyConnectStatusCallback} {@code EASY_CONNECT_EVENT_FAILURE_*} will
686 * be returned as an Extra {@link #EXTRA_EASY_CONNECT_ERROR_CODE}. Easy Connect R2
687 * Enrollees report additional details about the error they encountered, which will be
688 * provided in the {@link #EXTRA_EASY_CONNECT_ATTEMPTED_SSID},
689 * {@link #EXTRA_EASY_CONNECT_CHANNEL_LIST}, and {@link #EXTRA_EASY_CONNECT_BAND_LIST}.
690 */
691 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
692 public static final String ACTION_PROCESS_WIFI_EASY_CONNECT_URI =
693 "android.settings.PROCESS_WIFI_EASY_CONNECT_URI";
694
695 /**
696 * Activity Extra: The Easy Connect operation error code
697 * <p>
698 * An extra returned on the result intent received when using the
699 * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation.
700 * This extra contains the integer error code of the operation - one of
701 * {@link android.net.wifi.EasyConnectStatusCallback} {@code EASY_CONNECT_EVENT_FAILURE_*}. If
702 * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK},
703 * then this extra is not attached to the result intent.
704 * <p>
705 * Use the {@link Intent#hasExtra(String)} to determine whether the extra is attached and
706 * {@link Intent#getIntExtra(String, int)} to obtain the error code data.
707 */
708 public static final String EXTRA_EASY_CONNECT_ERROR_CODE =
709 "android.provider.extra.EASY_CONNECT_ERROR_CODE";
710
711 /**
712 * Activity Extra: The SSID that the Enrollee tried to connect to.
713 * <p>
714 * An extra returned on the result intent received when using the {@link
715 * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This
716 * extra contains the SSID of the Access Point that the remote Enrollee tried to connect to.
717 * This value is populated only by remote R2 devices, and only for the following error codes:
718 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK}
719 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION}.
720 * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. If
721 * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, then
722 * this extra is not attached to the result intent.
723 * <p>
724 * Use the {@link Intent#getStringExtra(String)} to obtain the SSID.
725 */
726 public static final String EXTRA_EASY_CONNECT_ATTEMPTED_SSID =
727 "android.provider.extra.EASY_CONNECT_ATTEMPTED_SSID";
728
729 /**
730 * Activity Extra: The Channel List that the Enrollee used to scan a network.
731 * <p>
732 * An extra returned on the result intent received when using the {@link
733 * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This
734 * extra contains the channel list that the Enrollee scanned for a network. This value is
735 * populated only by remote R2 devices, and only for the following error code: {@link
736 * android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK}.
737 * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. If
738 * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, then
739 * this extra is not attached to the result intent. The list is JSON formatted, as an array
740 * (Wi-Fi global operating classes) of arrays (Wi-Fi channels).
741 * <p>
742 * Use the {@link Intent#getStringExtra(String)} to obtain the list.
743 */
744 public static final String EXTRA_EASY_CONNECT_CHANNEL_LIST =
745 "android.provider.extra.EASY_CONNECT_CHANNEL_LIST";
746
747 /**
748 * Activity Extra: The Band List that the Enrollee supports.
749 * <p>
750 * This extra contains the bands the Enrollee supports, expressed as the Global Operating
751 * Class, see Table E-4 in IEEE Std 802.11-2016 Global operating classes. It is used both as
752 * input, to configure the Easy Connect operation and as output of the operation.
753 * <p>
754 * As input: an optional extra to be attached to the
755 * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI}. If attached, it indicates the bands which
756 * the remote device (enrollee, device-to-be-configured) supports. The Settings operation
757 * may take this into account when presenting the user with list of networks configurations
758 * to be used. The calling app may obtain this information in any out-of-band method. The
759 * information should be attached as an array of raw integers - using the
760 * {@link Intent#putExtra(String, int[])}.
761 * <p>
762 * As output: an extra returned on the result intent received when using the
763 * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation
764 * . This value is populated only by remote R2 devices, and only for the following error
765 * codes:
766 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK},
767 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION},
768 * or
769 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_REJECTED_CONFIGURATION}.
770 * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}.
771 * If there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}
772 * , then this extra is not attached to the result intent.
773 * <p>
774 * Use the {@link Intent#getIntArrayExtra(String)} to obtain the list.
775 */
776 public static final String EXTRA_EASY_CONNECT_BAND_LIST =
777 "android.provider.extra.EASY_CONNECT_BAND_LIST";
778
779 /**
780 * Activity Action: Show settings to allow configuration of data and view data usage.
781 * <p>
782 * In some cases, a matching Activity may not exist, so ensure you
783 * safeguard against this.
784 * <p>
785 * Input: Nothing.
786 * <p>
787 * Output: Nothing.
788 */
789 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
790 public static final String ACTION_DATA_USAGE_SETTINGS =
791 "android.settings.DATA_USAGE_SETTINGS";
792
793 /**
794 * Activity Action: Show settings to allow configuration of Bluetooth.
795 * <p>
796 * In some cases, a matching Activity may not exist, so ensure you
797 * safeguard against this.
798 * <p>
799 * Input: Nothing.
800 * <p>
801 * Output: Nothing.
802 */
803 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
804 public static final String ACTION_BLUETOOTH_SETTINGS =
805 "android.settings.BLUETOOTH_SETTINGS";
806
807 /**
808 * Activity action: Show Settings app search UI when this action is available for device.
809 * <p>
810 * Input: Nothing.
811 * <p>
812 * Output: Nothing.
813 */
814 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
815 public static final String ACTION_APP_SEARCH_SETTINGS = "android.settings.APP_SEARCH_SETTINGS";
816
817 /**
818 * Activity Action: Show settings to allow configuration of Assist Gesture.
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 * @hide
827 */
828 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
829 public static final String ACTION_ASSIST_GESTURE_SETTINGS =
830 "android.settings.ASSIST_GESTURE_SETTINGS";
831
832 /**
833 * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if
834 * necessary.
835 * @deprecated See {@link #ACTION_BIOMETRIC_ENROLL}.
836 * <p>
837 * Input: Nothing.
838 * <p>
839 * Output: Nothing.
840 */
841 @Deprecated
842 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
843 public static final String ACTION_FINGERPRINT_ENROLL =
844 "android.settings.FINGERPRINT_ENROLL";
845
846 /**
847 * Activity Action: Show settings to enroll biometrics, and setup PIN/Pattern/Pass if
848 * necessary. By default, this prompts the user to enroll biometrics with strength
849 * Weak or above, as defined by the CDD. Only biometrics that meet or exceed Strong, as defined
850 * in the CDD are allowed to participate in Keystore operations.
851 * <p>
852 * Input: extras {@link #EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED} as an integer, with
853 * constants defined in {@link android.hardware.biometrics.BiometricManager.Authenticators},
854 * e.g. {@link android.hardware.biometrics.BiometricManager.Authenticators#BIOMETRIC_STRONG}.
855 * If not specified, the default behavior is
856 * {@link android.hardware.biometrics.BiometricManager.Authenticators#BIOMETRIC_WEAK}.
857 * <p>
858 * Output: Nothing. Note that callers should still check
859 * {@link android.hardware.biometrics.BiometricManager#canAuthenticate(int)}
860 * afterwards to ensure that the user actually completed enrollment.
861 */
862 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
863 public static final String ACTION_BIOMETRIC_ENROLL =
864 "android.settings.BIOMETRIC_ENROLL";
865
866 /**
867 * Activity Extra: The minimum strength to request enrollment for.
868 * <p>
869 * This can be passed as an extra field to the {@link #ACTION_BIOMETRIC_ENROLL} intent to
870 * indicate that only enrollment for sensors that meet these requirements should be shown. The
871 * value should be a combination of the constants defined in
872 * {@link android.hardware.biometrics.BiometricManager.Authenticators}.
873 */
874 public static final String EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED =
875 "android.provider.extra.BIOMETRIC_AUTHENTICATORS_ALLOWED";
876
877 /**
878 * Activity Action: Show settings to allow configuration of cast endpoints.
879 * <p>
880 * In some cases, a matching Activity may not exist, so ensure you
881 * safeguard against this.
882 * <p>
883 * Input: Nothing.
884 * <p>
885 * Output: Nothing.
886 */
887 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
888 public static final String ACTION_CAST_SETTINGS =
889 "android.settings.CAST_SETTINGS";
890
891 /**
892 * Activity Action: Show settings to allow configuration of date and time.
893 * <p>
894 * In some cases, a matching Activity may not exist, so ensure you
895 * safeguard against this.
896 * <p>
897 * Input: Nothing.
898 * <p>
899 * Output: Nothing.
900 */
901 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
902 public static final String ACTION_DATE_SETTINGS =
903 "android.settings.DATE_SETTINGS";
904
905 /**
906 * Activity Action: Show settings to allow configuration of sound and volume.
907 * <p>
908 * In some cases, a matching Activity may not exist, so ensure you
909 * safeguard against this.
910 * <p>
911 * Input: Nothing.
912 * <p>
913 * Output: Nothing.
914 */
915 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
916 public static final String ACTION_SOUND_SETTINGS =
917 "android.settings.SOUND_SETTINGS";
918
919 /**
920 * Activity Action: Show settings to allow configuration of display.
921 * <p>
922 * In some cases, a matching Activity may not exist, so ensure you
923 * safeguard against this.
924 * <p>
925 * Input: Nothing.
926 * <p>
927 * Output: Nothing.
928 */
929 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
930 public static final String ACTION_DISPLAY_SETTINGS =
931 "android.settings.DISPLAY_SETTINGS";
932
933 /**
934 * Activity Action: Show Auto Rotate configuration settings.
935 */
936 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
937 public static final String ACTION_AUTO_ROTATE_SETTINGS =
938 "android.settings.AUTO_ROTATE_SETTINGS";
939
940 /**
941 * Activity Action: Show settings to allow configuration of Night display.
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_NIGHT_DISPLAY_SETTINGS =
952 "android.settings.NIGHT_DISPLAY_SETTINGS";
953
954 /**
955 * Activity Action: Show settings to allow configuration of Dark theme.
956 * <p>
957 * In some cases, a matching Activity may not exist, so ensure you
958 * safeguard against this.
959 * <p>
960 * Input: Nothing.
961 * <p>
962 * Output: Nothing.
963 *
964 * @hide
965 */
966 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
967 public static final String ACTION_DARK_THEME_SETTINGS =
968 "android.settings.DARK_THEME_SETTINGS";
969
970 /**
971 * Activity Action: Show settings to allow configuration of locale.
972 * <p>
973 * In some cases, a matching Activity may not exist, so ensure you
974 * safeguard against this.
975 * <p>
976 * Input: Nothing.
977 * <p>
978 * Output: Nothing.
979 */
980 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
981 public static final String ACTION_LOCALE_SETTINGS =
982 "android.settings.LOCALE_SETTINGS";
983
984 /**
985 * Activity Action: Show settings to allow configuration of per application locale.
986 * <p>
987 * Input: The Intent's data URI can specify the application package name to directly invoke the
988 * app locale details GUI specific to the package name.
989 * For example "package:com.my.app".
990 * <p>
991 * Output: Nothing.
992 */
993 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
994 public static final String ACTION_APP_LOCALE_SETTINGS =
995 "android.settings.APP_LOCALE_SETTINGS";
996
997 /**
998 * Activity Action: Show settings to allow configuration of lockscreen.
999 * <p>
1000 * In some cases, a matching Activity may not exist, so ensure you
1001 * safeguard against this.
1002 * <p>
1003 * Input: Nothing.
1004 * <p>
1005 * Output: Nothing.
1006 *
1007 * @hide
1008 */
1009 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1010 public static final String ACTION_LOCKSCREEN_SETTINGS = "android.settings.LOCK_SCREEN_SETTINGS";
1011
1012 /**
1013 * Activity Action: Show settings to allow pairing bluetooth devices.
1014 * <p>
1015 * In some cases, a matching Activity may not exist, so ensure you
1016 * safeguard against this.
1017 * <p>
1018 * Input: Nothing.
1019 * <p>
1020 * Output: Nothing.
1021 *
1022 * @hide
1023 */
1024 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1025 public static final String ACTION_BLUETOOTH_PAIRING_SETTINGS =
1026 "android.settings.BLUETOOTH_PAIRING_SETTINGS";
1027
1028 /**
1029 * Activity Action: Show settings to configure input methods, in particular
1030 * allowing the user to enable input methods.
1031 * <p>
1032 * In some cases, a matching Activity may not exist, so ensure you
1033 * safeguard against this.
1034 * <p>
1035 * Input: Nothing.
1036 * <p>
1037 * Output: Nothing.
1038 */
1039 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1040 public static final String ACTION_VOICE_INPUT_SETTINGS =
1041 "android.settings.VOICE_INPUT_SETTINGS";
1042
1043 /**
1044 * Activity Action: Show settings to configure input methods, in particular
1045 * allowing the user to enable input methods.
1046 * <p>
1047 * In some cases, a matching Activity may not exist, so ensure you
1048 * safeguard against this.
1049 * <p>
1050 * Input: Nothing.
1051 * <p>
1052 * Output: Nothing.
1053 */
1054 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1055 public static final String ACTION_INPUT_METHOD_SETTINGS =
1056 "android.settings.INPUT_METHOD_SETTINGS";
1057
1058 /**
1059 * Activity Action: Show settings to enable/disable input method subtypes.
1060 * <p>
1061 * In some cases, a matching Activity may not exist, so ensure you
1062 * safeguard against this.
1063 * <p>
1064 * To tell which input method's subtypes are displayed in the settings, add
1065 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
1066 * If there is no extra in this Intent, subtypes from all installed input methods
1067 * will be displayed in the settings.
1068 *
1069 * @see android.view.inputmethod.InputMethodInfo#getId
1070 * <p>
1071 * Input: Nothing.
1072 * <p>
1073 * Output: Nothing.
1074 */
1075 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1076 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
1077 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
1078
1079 /**
1080 * Activity Action: Show settings to manage the user input dictionary.
1081 * <p>
1082 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
1083 * it is guaranteed there will always be an appropriate implementation for this Intent action.
1084 * In prior releases of the platform this was optional, so ensure you safeguard against it.
1085 * <p>
1086 * Input: Nothing.
1087 * <p>
1088 * Output: Nothing.
1089 */
1090 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1091 public static final String ACTION_USER_DICTIONARY_SETTINGS =
1092 "android.settings.USER_DICTIONARY_SETTINGS";
1093
1094 /**
1095 * Activity Action: Show settings to configure the hardware keyboard.
1096 * <p>
1097 * In some cases, a matching Activity may not exist, so ensure you
1098 * safeguard against this.
1099 * <p>
1100 * Input: Nothing.
1101 * <p>
1102 * Output: Nothing.
1103 */
1104 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1105 public static final String ACTION_HARD_KEYBOARD_SETTINGS =
1106 "android.settings.HARD_KEYBOARD_SETTINGS";
1107
1108 /**
1109 * Activity Action: Adds a word to the user dictionary.
1110 * <p>
1111 * In some cases, a matching Activity may not exist, so ensure you
1112 * safeguard against this.
1113 * <p>
1114 * Input: An extra with key <code>word</code> that contains the word
1115 * that should be added to the dictionary.
1116 * <p>
1117 * Output: Nothing.
1118 *
1119 * @hide
1120 */
1121 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1122 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
1123 public static final String ACTION_USER_DICTIONARY_INSERT =
1124 "com.android.settings.USER_DICTIONARY_INSERT";
1125
1126 /**
1127 * Activity Action: Show settings to allow configuration of application-related settings.
1128 * <p>
1129 * In some cases, a matching Activity may not exist, so ensure you
1130 * safeguard against this.
1131 * <p>
1132 * Input: Nothing.
1133 * <p>
1134 * Output: Nothing.
1135 */
1136 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1137 public static final String ACTION_APPLICATION_SETTINGS =
1138 "android.settings.APPLICATION_SETTINGS";
1139
1140 /**
1141 * Activity Action: Show settings to allow configuration of application
1142 * development-related settings. As of
1143 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
1144 * a required part of the platform.
1145 * <p>
1146 * Input: Nothing.
1147 * <p>
1148 * Output: Nothing.
1149 */
1150 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1151 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
1152 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
1153
1154 /**
1155 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
1156 * <p>
1157 * In some cases, a matching Activity may not exist, so ensure you
1158 * safeguard against this.
1159 * <p>
1160 * Input: Nothing.
1161 * <p>
1162 * Output: Nothing.
1163 */
1164 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1165 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
1166 "android.settings.QUICK_LAUNCH_SETTINGS";
1167
1168 /**
1169 * Activity Action: Show settings to manage installed applications.
1170 * <p>
1171 * In some cases, a matching Activity may not exist, so ensure you
1172 * safeguard against this.
1173 * <p>
1174 * Input: Nothing.
1175 * <p>
1176 * Output: Nothing.
1177 */
1178 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1179 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
1180 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
1181
1182 /**
1183 * Activity Action: Show settings to manage all applications.
1184 * <p>
1185 * In some cases, a matching Activity may not exist, so ensure you
1186 * safeguard against this.
1187 * <p>
1188 * Input: Nothing.
1189 * <p>
1190 * Output: Nothing.
1191 */
1192 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1193 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
1194 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
1195
1196 /**
1197 * Activity Action: Show settings to manage all SIM profiles.
1198 * <p>
1199 * In some cases, a matching Activity may not exist, so ensure you
1200 * safeguard against this.
1201 * <p>
1202 * Input: Nothing.
1203 * <p>
1204 * Output: Nothing.
1205 */
1206 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1207 public static final String ACTION_MANAGE_ALL_SIM_PROFILES_SETTINGS =
1208 "android.settings.MANAGE_ALL_SIM_PROFILES_SETTINGS";
1209
1210 /**
1211 * Activity Action: Show screen for controlling which apps can draw on top of other apps.
1212 * <p>
1213 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1214 * <p>
1215 * Input: Optionally, in versions of Android prior to {@link android.os.Build.VERSION_CODES#R},
1216 * the Intent's data URI can specify the application package name to directly invoke the
1217 * management GUI specific to the package name.
1218 * For example "package:com.my.app".
1219 * <p>
1220 * Output: Nothing.
1221 */
1222 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1223 public static final String ACTION_MANAGE_OVERLAY_PERMISSION =
1224 "android.settings.action.MANAGE_OVERLAY_PERMISSION";
1225
1226 /**
1227 * Activity Action: Show screen for controlling if the app specified in the data URI of the
1228 * intent can draw on top of other apps.
1229 * <p>
1230 * Unlike {@link #ACTION_MANAGE_OVERLAY_PERMISSION}, which in Android {@link
1231 * android.os.Build.VERSION_CODES#R} can't be used to show a GUI for a specific package,
1232 * permission {@code android.permission.INTERNAL_SYSTEM_WINDOW} is needed to start an activity
1233 * with this intent.
1234 * <p>
1235 * In some cases, a matching Activity may not exist, so ensure you
1236 * safeguard against this.
1237 * <p>
1238 * Input: The Intent's data URI MUST specify the application package name whose ability of
1239 * drawing on top of other apps you want to control.
1240 * For example "package:com.my.app".
1241 * <p>
1242 * Output: Nothing.
1243 *
1244 * @hide
1245 */
1246 @SystemApi
1247 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1248 public static final String ACTION_MANAGE_APP_OVERLAY_PERMISSION =
1249 "android.settings.MANAGE_APP_OVERLAY_PERMISSION";
1250
1251 /**
1252 * Activity Action: Show screen for controlling which apps are allowed to write/modify
1253 * system settings.
1254 * <p>
1255 * In some cases, a matching Activity may not exist, so ensure you
1256 * safeguard against this.
1257 * <p>
1258 * Input: Optionally, the Intent's data URI can specify the application package name to
1259 * directly invoke the management GUI specific to the package name. For example
1260 * "package:com.my.app".
1261 * <p>
1262 * Output: Nothing.
1263 */
1264 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1265 public static final String ACTION_MANAGE_WRITE_SETTINGS =
1266 "android.settings.action.MANAGE_WRITE_SETTINGS";
1267
1268 /**
1269 * Activity Action: Show screen for controlling app usage properties for an app.
1270 * Input: Intent's extra {@link android.content.Intent#EXTRA_PACKAGE_NAME} must specify the
1271 * application package name.
1272 * Output: Nothing.
1273 */
1274 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1275 public static final String ACTION_APP_USAGE_SETTINGS =
1276 "android.settings.action.APP_USAGE_SETTINGS";
1277
1278 /**
1279 * Activity Action: Show screen of details about a particular application.
1280 * <p>
1281 * In some cases, a matching Activity may not exist, so ensure you
1282 * safeguard against this.
1283 * <p>
1284 * Input: The Intent's data URI specifies the application package name
1285 * to be shown, with the "package" scheme. That is "package:com.my.app".
1286 * <p>
1287 * Output: Nothing.
1288 */
1289 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1290 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
1291 "android.settings.APPLICATION_DETAILS_SETTINGS";
1292
1293 /**
1294 * Activity Action: Show list of applications that have been running
1295 * foreground services (to the user "running in the background").
1296 * <p>
1297 * Input: Extras "packages" is a string array of package names.
1298 * <p>
1299 * Output: Nothing.
1300 * @hide
1301 */
1302 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1303 public static final String ACTION_FOREGROUND_SERVICES_SETTINGS =
1304 "android.settings.FOREGROUND_SERVICES_SETTINGS";
1305
1306 /**
1307 * Activity Action: Show screen for controlling which apps can ignore battery optimizations.
1308 * <p>
1309 * Input: Nothing.
1310 * <p>
1311 * Output: Nothing.
1312 * <p>
1313 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
1314 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
1315 * already ignoring optimizations. You can use
1316 * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you
1317 * on this list.
1318 */
1319 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1320 public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS =
1321 "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS";
1322
1323 /**
1324 * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is,
1325 * put them on the whitelist of apps shown by
1326 * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also
1327 * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}
1328 * permission.
1329 * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities
1330 * provided by the platform for applications to operate correctly in the various power
1331 * saving modes. This is only for unusual applications that need to deeply control their own
1332 * execution, at the potential expense of the user's battery life. Note that these applications
1333 * greatly run the risk of showing to the user as high power consumers on their device.</p>
1334 * <p>
1335 * Input: The Intent's data URI must specify the application package name
1336 * to be shown, with the "package" scheme. That is "package:com.my.app".
1337 * <p>
1338 * Output: Nothing.
1339 * <p>
1340 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
1341 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
1342 * already ignoring optimizations.
1343 */
1344 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1345 public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS =
1346 "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
1347
1348 /**
1349 * Activity Action: Open the advanced power usage details page of an associated app.
1350 * <p>
1351 * Input: Intent's data URI set with an application name, using the
1352 * "package" schema (like "package:com.my.app")
1353 * <p>
1354 * Output: Nothing.
1355 *
1356 * @hide
1357 */
1358 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1359 public static final String ACTION_VIEW_ADVANCED_POWER_USAGE_DETAIL =
1360 "android.settings.VIEW_ADVANCED_POWER_USAGE_DETAIL";
1361
1362 /**
1363 * Activity Action: Show screen for controlling background data
1364 * restrictions for a particular application.
1365 * <p>
1366 * Input: Intent's data URI set with an application name, using the
1367 * "package" schema (like "package:com.my.app").
1368 *
1369 * <p>
1370 * Output: Nothing.
1371 * <p>
1372 * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus
1373 * ConnectivityManager#getRestrictBackgroundStatus()} to determine the
1374 * status of the background data restrictions for them.
1375 *
1376 * <p class="note">
1377 * In some cases, a matching Activity may not exist, so ensure you
1378 * safeguard against this.
1379 */
1380 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1381 public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS =
1382 "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS";
1383
1384 /**
1385 * @hide
1386 * Activity Action: Show the "app ops" settings screen.
1387 * <p>
1388 * Input: Nothing.
1389 * <p>
1390 * Output: Nothing.
1391 */
1392 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1393 public static final String ACTION_APP_OPS_SETTINGS =
1394 "android.settings.APP_OPS_SETTINGS";
1395
1396 /**
1397 * Activity Action: Show settings for system update functionality.
1398 * <p>
1399 * In some cases, a matching Activity may not exist, so ensure you
1400 * safeguard against this.
1401 * <p>
1402 * Input: Nothing.
1403 * <p>
1404 * Output: Nothing.
1405 *
1406 * @hide
1407 */
1408 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1409 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
1410 "android.settings.SYSTEM_UPDATE_SETTINGS";
1411
1412 /**
1413 * Activity Action: Show settings for managed profile settings.
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 * @hide
1423 */
1424 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1425 public static final String ACTION_MANAGED_PROFILE_SETTINGS =
1426 "android.settings.MANAGED_PROFILE_SETTINGS";
1427
1428 /**
1429 * Activity Action: Show settings to allow configuration of sync settings.
1430 * <p>
1431 * In some cases, a matching Activity may not exist, so ensure you
1432 * safeguard against this.
1433 * <p>
1434 * The account types available to add via the add account button may be restricted by adding an
1435 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
1436 * authorities. Only account types which can sync with that content provider will be offered to
1437 * the user.
1438 * <p>
1439 * Input: Nothing.
1440 * <p>
1441 * Output: Nothing.
1442 */
1443 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1444 public static final String ACTION_SYNC_SETTINGS =
1445 "android.settings.SYNC_SETTINGS";
1446
1447 /**
1448 * Activity Action: Show add account screen for creating a new account.
1449 * <p>
1450 * In some cases, a matching Activity may not exist, so ensure you
1451 * safeguard against this.
1452 * <p>
1453 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
1454 * extra to the Intent with one or more syncable content provider's authorities. Only account
1455 * types which can sync with that content provider will be offered to the user.
1456 * <p>
1457 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
1458 * Intent with one or more account types.
1459 * <p>
1460 * Input: Nothing.
1461 * <p>
1462 * Output: Nothing.
1463 */
1464 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1465 public static final String ACTION_ADD_ACCOUNT =
1466 "android.settings.ADD_ACCOUNT_SETTINGS";
1467
1468 /**
1469 * Activity Action: Show settings for enabling or disabling data saver
1470 * <p></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 * @hide
1479 */
1480 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1481 public static final String ACTION_DATA_SAVER_SETTINGS =
1482 "android.settings.DATA_SAVER_SETTINGS";
1483
1484 /**
1485 * Activity Action: Show settings for selecting the network operator.
1486 * <p>
1487 * In some cases, a matching Activity may not exist, so ensure you
1488 * safeguard against this.
1489 * <p>
1490 * The subscription ID of the subscription for which available network operators should be
1491 * displayed may be optionally specified with {@link #EXTRA_SUB_ID}.
1492 * <p>
1493 * Input: Nothing.
1494 * <p>
1495 * Output: Nothing.
1496 */
1497 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1498 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
1499 "android.settings.NETWORK_OPERATOR_SETTINGS";
1500
1501 /**
1502 * Activity Action: Show settings for selection of 2G/3G.
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 */
1511 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1512 public static final String ACTION_DATA_ROAMING_SETTINGS =
1513 "android.settings.DATA_ROAMING_SETTINGS";
1514
1515 /**
1516 * Activity Action: Show settings for internal storage.
1517 * <p>
1518 * In some cases, a matching Activity may not exist, so ensure you
1519 * safeguard against this.
1520 * <p>
1521 * Input: Nothing.
1522 * <p>
1523 * Output: Nothing.
1524 */
1525 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1526 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
1527 "android.settings.INTERNAL_STORAGE_SETTINGS";
1528 /**
1529 * Activity Action: Show settings for memory card storage.
1530 * <p>
1531 * In some cases, a matching Activity may not exist, so ensure you
1532 * safeguard against this.
1533 * <p>
1534 * Input: Nothing.
1535 * <p>
1536 * Output: Nothing.
1537 */
1538 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1539 public static final String ACTION_MEMORY_CARD_SETTINGS =
1540 "android.settings.MEMORY_CARD_SETTINGS";
1541
1542 /**
1543 * Activity Action: Show settings for global search.
1544 * <p>
1545 * In some cases, a matching Activity may not exist, so ensure you
1546 * safeguard against this.
1547 * <p>
1548 * Input: Nothing.
1549 * <p>
1550 * Output: Nothing
1551 */
1552 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1553 public static final String ACTION_SEARCH_SETTINGS =
1554 "android.search.action.SEARCH_SETTINGS";
1555
1556 /**
1557 * Activity Action: Show general device information settings (serial
1558 * number, software version, phone number, etc.).
1559 * <p>
1560 * In some cases, a matching Activity may not exist, so ensure you
1561 * safeguard against this.
1562 * <p>
1563 * Input: Nothing.
1564 * <p>
1565 * Output: Nothing
1566 */
1567 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1568 public static final String ACTION_DEVICE_INFO_SETTINGS =
1569 "android.settings.DEVICE_INFO_SETTINGS";
1570
1571 /**
1572 * Activity Action: Show NFC settings.
1573 * <p>
1574 * This shows UI that allows NFC to be turned on or off.
1575 * <p>
1576 * In some cases, a matching Activity may not exist, so ensure you
1577 * safeguard against this.
1578 * <p>
1579 * Input: Nothing.
1580 * <p>
1581 * Output: Nothing
1582 * @see android.nfc.NfcAdapter#isEnabled()
1583 */
1584 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1585 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
1586
1587 /**
1588 * Activity Action: Show NFC Sharing settings.
1589 * <p>
1590 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
1591 * off.
1592 * <p>
1593 * In some cases, a matching Activity may not exist, so ensure you
1594 * safeguard against this.
1595 * <p>
1596 * Input: Nothing.
1597 * <p>
1598 * Output: Nothing
1599 */
1600 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1601 public static final String ACTION_NFCSHARING_SETTINGS =
1602 "android.settings.NFCSHARING_SETTINGS";
1603
1604 /**
1605 * Activity Action: Show NFC Tap & Pay settings
1606 * <p>
1607 * This shows UI that allows the user to configure Tap&Pay
1608 * settings.
1609 * <p>
1610 * In some cases, a matching Activity may not exist, so ensure you
1611 * safeguard against this.
1612 * <p>
1613 * Input: Nothing.
1614 * <p>
1615 * Output: Nothing
1616 */
1617 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1618 public static final String ACTION_NFC_PAYMENT_SETTINGS =
1619 "android.settings.NFC_PAYMENT_SETTINGS";
1620
1621 /**
1622 * Activity Action: Show Daydream settings.
1623 * <p>
1624 * In some cases, a matching Activity may not exist, so ensure you
1625 * safeguard against this.
1626 * <p>
1627 * Input: Nothing.
1628 * <p>
1629 * Output: Nothing.
1630 * @see android.service.dreams.DreamService
1631 */
1632 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1633 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
1634
1635 /**
1636 * Activity Action: Show Notification assistant settings.
1637 * <p>
1638 * In some cases, a matching Activity may not exist, so ensure you
1639 * safeguard against this.
1640 * <p>
1641 * Input: Nothing.
1642 * <p>
1643 * Output: Nothing.
1644 * @see android.service.notification.NotificationAssistantService
1645 */
1646 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1647 public static final String ACTION_NOTIFICATION_ASSISTANT_SETTINGS =
1648 "android.settings.NOTIFICATION_ASSISTANT_SETTINGS";
1649
1650 /**
1651 * Activity Action: Show Notification listener settings.
1652 * <p>
1653 * In some cases, a matching Activity may not exist, so ensure you
1654 * safeguard against this.
1655 * <p>
1656 * Input: Nothing.
1657 * <p>
1658 * Output: Nothing.
1659 * @see android.service.notification.NotificationListenerService
1660 */
1661 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1662 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
1663 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
1664
1665 /**
1666 * Activity Action: Show notification listener permission settings page for app.
1667 * <p>
1668 * Users can grant and deny access to notifications for a {@link ComponentName} from here.
1669 * See
1670 * {@link android.app.NotificationManager#isNotificationListenerAccessGranted(ComponentName)}
1671 * for more details.
1672 * <p>
1673 * Input: The extra {@link #EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME} containing the name
1674 * of the component to grant or revoke notification listener access to.
1675 * <p>
1676 * Output: Nothing.
1677 */
1678 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1679 public static final String ACTION_NOTIFICATION_LISTENER_DETAIL_SETTINGS =
1680 "android.settings.NOTIFICATION_LISTENER_DETAIL_SETTINGS";
1681
1682 /**
1683 * Activity Extra: What component name to show the notification listener permission
1684 * page for.
1685 * <p>
1686 * A string extra containing a {@link ComponentName}. This must be passed as an extra field to
1687 * {@link #ACTION_NOTIFICATION_LISTENER_DETAIL_SETTINGS}.
1688 */
1689 public static final String EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME =
1690 "android.provider.extra.NOTIFICATION_LISTENER_COMPONENT_NAME";
1691
1692 /**
1693 * Activity Action: Show Do Not Disturb access settings.
1694 * <p>
1695 * Users can grant and deny access to Do Not Disturb configuration from here. Managed
1696 * profiles cannot grant Do Not Disturb access.
1697 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1698 * details.
1699 * <p>
1700 * Input: Nothing.
1701 * <p>
1702 * Output: Nothing.
1703 *
1704 * <p class="note">
1705 * In some cases, a matching Activity may not exist, so ensure you
1706 * safeguard against this.
1707 */
1708 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1709 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
1710 = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
1711
1712 /**
1713 * Activity Action: Show do not disturb setting page for app.
1714 * <p>
1715 * Users can grant and deny access to Do Not Disturb configuration for an app from here.
1716 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1717 * details.
1718 * <p>
1719 * Input: Intent's data URI set with an application name, using the
1720 * "package" schema (like "package:com.my.app").
1721 * <p>
1722 * Output: Nothing.
1723 *
1724 * @hide
1725 */
1726 @SystemApi
1727 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1728 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS =
1729 "android.settings.NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS";
1730
1731 /**
1732 * Activity Action: Show the automatic do not disturb rule listing page
1733 * <p>
1734 * Users can add, enable, disable, and remove automatic do not disturb rules from this
1735 * screen. See {@link NotificationManager#addAutomaticZenRule(AutomaticZenRule)} for more
1736 * details.
1737 * </p>
1738 * <p>
1739 * Input: Nothing
1740 * Output: Nothing
1741 * </p>
1742 *
1743 */
1744 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1745 public static final String ACTION_CONDITION_PROVIDER_SETTINGS
1746 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
1747
1748 /**
1749 * Activity Action: Show settings for video captioning.
1750 * <p>
1751 * In some cases, a matching Activity may not exist, so ensure you safeguard
1752 * against this.
1753 * <p>
1754 * Input: Nothing.
1755 * <p>
1756 * Output: Nothing.
1757 */
1758 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1759 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
1760
1761 /**
1762 * Activity Action: Show the top level print settings.
1763 * <p>
1764 * In some cases, a matching Activity may not exist, so ensure you
1765 * safeguard against this.
1766 * <p>
1767 * Input: Nothing.
1768 * <p>
1769 * Output: Nothing.
1770 */
1771 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1772 public static final String ACTION_PRINT_SETTINGS =
1773 "android.settings.ACTION_PRINT_SETTINGS";
1774
1775 /**
1776 * Activity Action: Show Zen Mode configuration settings.
1777 *
1778 * @hide
1779 */
1780 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1781 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
1782
1783 /**
1784 * Activity Action: Show Zen Mode visual effects configuration settings.
1785 *
1786 * @hide
1787 */
1788 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1789 public static final String ZEN_MODE_BLOCKED_EFFECTS_SETTINGS =
1790 "android.settings.ZEN_MODE_BLOCKED_EFFECTS_SETTINGS";
1791
1792 /**
1793 * Activity Action: Show Zen Mode onboarding activity.
1794 *
1795 * @hide
1796 */
1797 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1798 public static final String ZEN_MODE_ONBOARDING = "android.settings.ZEN_MODE_ONBOARDING";
1799
1800 /**
1801 * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings.
1802 */
1803 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1804 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
1805 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
1806
1807 /**
1808 * Activity Action: Show Zen Mode automation configuration settings.
1809 *
1810 * @hide
1811 */
1812 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1813 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
1814 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
1815
1816 /**
1817 * Activity Action: Modify do not disturb mode settings.
1818 * <p>
1819 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1820 * <p>
1821 * This intent MUST be started using
1822 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1823 * startVoiceActivity}.
1824 * <p>
1825 * Note: The Activity implementing this intent MUST verify that
1826 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
1827 * returns true before modifying the setting.
1828 * <p>
1829 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
1830 * how long the user wishes to avoid interruptions for. The optional
1831 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
1832 * enabling or disabling do not disturb mode. If either extra is not included, the
1833 * user maybe asked to provide the value.
1834 * <p>
1835 * Output: Nothing.
1836 */
1837 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1838 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
1839 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
1840
1841 /**
1842 * Activity Action: Show Zen Mode schedule rule configuration settings.
1843 *
1844 * @hide
1845 */
1846 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1847 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
1848 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
1849
1850 /**
1851 * Activity Action: Show Zen Mode event rule configuration settings.
1852 *
1853 * @hide
1854 */
1855 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1856 public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
1857 = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
1858
1859 /**
1860 * Activity Action: Show Zen Mode external rule configuration settings.
1861 *
1862 * @hide
1863 */
1864 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1865 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
1866 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
1867
1868 /**
1869 * Activity Action: Show the regulatory information screen for the device.
1870 * <p>
1871 * In some cases, a matching Activity may not exist, so ensure you safeguard
1872 * against this.
1873 * <p>
1874 * Input: Nothing.
1875 * <p>
1876 * Output: Nothing.
1877 */
1878 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1879 public static final String
1880 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
1881
1882 /**
1883 * Activity Action: Show Device Name Settings.
1884 * <p>
1885 * In some cases, a matching Activity may not exist, so ensure you safeguard
1886 * against this.
1887 *
1888 * @hide
1889 */
1890 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1891 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
1892
1893 /**
1894 * Activity Action: Show pairing settings.
1895 * <p>
1896 * In some cases, a matching Activity may not exist, so ensure you safeguard
1897 * against this.
1898 *
1899 * @hide
1900 */
1901 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1902 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
1903
1904 /**
1905 * Activity Action: Show battery saver settings.
1906 * <p>
1907 * In some cases, a matching Activity may not exist, so ensure you safeguard
1908 * against this.
1909 */
1910 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1911 public static final String ACTION_BATTERY_SAVER_SETTINGS
1912 = "android.settings.BATTERY_SAVER_SETTINGS";
1913
1914 /**
1915 * Activity Action: Modify Battery Saver mode setting using a voice command.
1916 * <p>
1917 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1918 * <p>
1919 * This intent MUST be started using
1920 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1921 * startVoiceActivity}.
1922 * <p>
1923 * Note: The activity implementing this intent MUST verify that
1924 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
1925 * modifying the setting.
1926 * <p>
1927 * Input: To tell which state batter saver mode should be set to, add the
1928 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
1929 * If the extra is not included, no changes will be made.
1930 * <p>
1931 * Output: Nothing.
1932 */
1933 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1934 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
1935 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
1936
1937 /**
1938 * Activity Action: Show Home selection settings. If there are multiple activities
1939 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
1940 * to pick your preferred activity.
1941 */
1942 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1943 public static final String ACTION_HOME_SETTINGS
1944 = "android.settings.HOME_SETTINGS";
1945
1946 /**
1947 * Activity Action: Show Default apps settings.
1948 * <p>
1949 * In some cases, a matching Activity may not exist, so ensure you
1950 * safeguard against this.
1951 * <p>
1952 * Input: Nothing.
1953 * <p>
1954 * Output: Nothing.
1955 */
1956 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1957 public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS
1958 = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS";
1959
1960 /**
1961 * Activity Action: Show More default apps settings.
1962 * <p>
1963 * If a Settings activity handles this intent action, a "More defaults" entry will be shown in
1964 * the Default apps settings, and clicking it will launch that activity.
1965 * <p>
1966 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1967 * <p>
1968 * Input: Nothing.
1969 * <p>
1970 * Output: Nothing.
1971 *
1972 * @hide
1973 */
1974 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1975 @SystemApi
1976 public static final String ACTION_MANAGE_MORE_DEFAULT_APPS_SETTINGS =
1977 "android.settings.MANAGE_MORE_DEFAULT_APPS_SETTINGS";
1978
1979 /**
1980 * Activity Action: Show notification settings.
1981 *
1982 * @hide
1983 */
1984 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1985 public static final String ACTION_NOTIFICATION_SETTINGS
1986 = "android.settings.NOTIFICATION_SETTINGS";
1987
1988 /**
1989 * Activity Action: Show conversation settings.
1990 *
1991 * @hide
1992 */
1993 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1994 public static final String ACTION_CONVERSATION_SETTINGS
1995 = "android.settings.CONVERSATION_SETTINGS";
1996
1997 /**
1998 * Activity Action: Show notification history screen.
1999 *
2000 * @hide
2001 */
2002 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2003 public static final String ACTION_NOTIFICATION_HISTORY
2004 = "android.settings.NOTIFICATION_HISTORY";
2005
2006 /**
2007 * Activity Action: Show app listing settings, filtered by those that send notifications.
2008 *
2009 */
2010 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2011 public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS =
2012 "android.settings.ALL_APPS_NOTIFICATION_SETTINGS";
2013
2014 /**
2015 * Activity Action: Show app settings specifically for sending notifications. Same as
2016 * ALL_APPS_NOTIFICATION_SETTINGS but meant for internal use.
2017 * @hide
2018 */
2019 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2020 public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS_FOR_REVIEW =
2021 "android.settings.ALL_APPS_NOTIFICATION_SETTINGS_FOR_REVIEW";
2022
2023 /**
2024 * Activity Action: Show notification settings for a single app.
2025 * <p>
2026 * Input: {@link #EXTRA_APP_PACKAGE}, the package to display.
2027 * <p>
2028 * Output: Nothing.
2029 */
2030 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2031 public static final String ACTION_APP_NOTIFICATION_SETTINGS
2032 = "android.settings.APP_NOTIFICATION_SETTINGS";
2033
2034 /**
2035 * Activity Action: Show notification settings for a single {@link NotificationChannel}.
2036 * <p>
2037 * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display.
2038 * Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display.
2039 * <p>
2040 * Output: Nothing.
2041 */
2042 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2043 public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS
2044 = "android.settings.CHANNEL_NOTIFICATION_SETTINGS";
2045
2046 /**
2047 * Activity Action: Show notification bubble settings for a single app.
2048 * See {@link NotificationManager#getBubblePreference()}.
2049 * <p>
2050 * Input: {@link #EXTRA_APP_PACKAGE}, the package to display.
2051 * <p>
2052 * Output: Nothing.
2053 */
2054 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2055 public static final String ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS
2056 = "android.settings.APP_NOTIFICATION_BUBBLE_SETTINGS";
2057
2058 /**
2059 * Activity Extra: The package owner of the notification channel settings to display.
2060 * <p>
2061 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
2062 */
2063 public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE";
2064
2065 /**
2066 * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings
2067 * to display.
2068 * <p>
2069 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
2070 */
2071 public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID";
2072
2073 /**
2074 * Activity Extra: The {@link NotificationChannel#getConversationId()} of the notification
2075 * conversation settings to display.
2076 * <p>
2077 * This is an optional extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. If
2078 * included the system will first look up notification settings by channel and conversation id,
2079 * and will fall back to channel id if a specialized channel for this conversation doesn't
2080 * exist, similar to {@link NotificationManager#getNotificationChannel(String, String)}.
2081 */
2082 public static final String EXTRA_CONVERSATION_ID = "android.provider.extra.CONVERSATION_ID";
2083
2084 /**
2085 * Activity Extra: An {@code Arraylist<String>} of {@link NotificationChannel} field names to
2086 * show on the Settings UI.
2087 *
2088 * <p>
2089 * This is an optional extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. If
2090 * included the system will filter out any Settings that doesn't appear in this list that
2091 * otherwise would display.
2092 */
2093 public static final String EXTRA_CHANNEL_FILTER_LIST
2094 = "android.provider.extra.CHANNEL_FILTER_LIST";
2095
2096 /**
2097 * Activity Action: Show notification redaction settings.
2098 *
2099 * @hide
2100 */
2101 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2102 public static final String ACTION_APP_NOTIFICATION_REDACTION
2103 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
2104
2105 /** @hide */
2106 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
2107 public static final String EXTRA_APP_UID = "app_uid";
2108
2109 /**
2110 * Activity Action: Show power menu settings.
2111 *
2112 * @hide
2113 */
2114 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2115 public static final String ACTION_POWER_MENU_SETTINGS =
2116 "android.settings.ACTION_POWER_MENU_SETTINGS";
2117
2118 /**
2119 * Activity Action: Show controls settings.
2120 *
2121 * @hide
2122 */
2123 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2124 public static final String ACTION_DEVICE_CONTROLS_SETTINGS =
2125 "android.settings.ACTION_DEVICE_CONTROLS_SETTINGS";
2126
2127 /**
2128 * Activity Action: Show media control settings
2129 *
2130 * @hide
2131 */
2132 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2133 public static final String ACTION_MEDIA_CONTROLS_SETTINGS =
2134 "android.settings.ACTION_MEDIA_CONTROLS_SETTINGS";
2135
2136 /**
2137 * Activity Action: Show a dialog with disabled by policy message.
2138 * <p> If an user action is disabled by policy, this dialog can be triggered to let
2139 * the user know about this.
2140 * <p>
2141 * Input: {@link Intent#EXTRA_USER}: The user of the admin.
2142 * <p>
2143 * Output: Nothing.
2144 *
2145 * @hide
2146 */
2147 // Intent#EXTRA_USER_ID can also be used
2148 @SystemApi
2149 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2150 public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS =
2151 "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
2152
2153 /**
2154 * Intent extra: The id of a setting restricted by supervisors.
2155 * <p>
2156 * Type: Integer with a value from the one of the SUPERVISOR_VERIFICATION_* constants below.
2157 * <ul>
2158 * <li>{@see #SUPERVISOR_VERIFICATION_SETTING_UNKNOWN}
2159 * <li>{@see #SUPERVISOR_VERIFICATION_SETTING_BIOMETRICS}
2160 * </ul>
2161 * </p>
2162 */
2163 public static final String EXTRA_SUPERVISOR_RESTRICTED_SETTING_KEY =
2164 "android.provider.extra.SUPERVISOR_RESTRICTED_SETTING_KEY";
2165
2166 /**
2167 * The unknown setting can usually be ignored and is used for compatibility with future
2168 * supervisor settings.
2169 */
2170 public static final int SUPERVISOR_VERIFICATION_SETTING_UNKNOWN = 0;
2171
2172 /**
2173 * Settings for supervisors to control what kinds of biometric sensors, such a face and
2174 * fingerprint scanners, can be used on the device.
2175 */
2176 public static final int SUPERVISOR_VERIFICATION_SETTING_BIOMETRICS = 1;
2177
2178 /**
2179 * Keys for {@link #EXTRA_SUPERVISOR_RESTRICTED_SETTING_KEY}.
2180 * @hide
2181 */
2182 @Retention(RetentionPolicy.SOURCE)
2183 @IntDef(prefix = { "SUPERVISOR_VERIFICATION_SETTING_" }, value = {
2184 SUPERVISOR_VERIFICATION_SETTING_UNKNOWN,
2185 SUPERVISOR_VERIFICATION_SETTING_BIOMETRICS,
2186 })
2187 public @interface SupervisorVerificationSetting {}
2188
2189 /**
2190 * Activity action: Launch UI to manage a setting restricted by supervisors.
2191 * <p>
2192 * Input: {@link #EXTRA_SUPERVISOR_RESTRICTED_SETTING_KEY} specifies what setting to open.
2193 * </p>
2194 * <p>
2195 * Output: Nothing.
2196 * </p>
2197 */
2198 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2199 public static final String ACTION_MANAGE_SUPERVISOR_RESTRICTED_SETTING =
2200 "android.settings.MANAGE_SUPERVISOR_RESTRICTED_SETTING";
2201
2202 /**
2203 * Activity Action: Show a dialog for remote bugreport flow.
2204 * <p>
2205 * Input: Nothing.
2206 * <p>
2207 * Output: Nothing.
2208 *
2209 * @hide
2210 */
2211 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2212 public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG
2213 = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG";
2214
2215 /**
2216 * Activity Action: Show VR listener settings.
2217 * <p>
2218 * Input: Nothing.
2219 * <p>
2220 * Output: Nothing.
2221 *
2222 * @see android.service.vr.VrListenerService
2223 */
2224 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2225 public static final String ACTION_VR_LISTENER_SETTINGS
2226 = "android.settings.VR_LISTENER_SETTINGS";
2227
2228 /**
2229 * Activity Action: Show Picture-in-picture settings.
2230 * <p>
2231 * Input: Nothing.
2232 * <p>
2233 * Output: Nothing.
2234 *
2235 * @hide
2236 */
2237 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2238 public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS
2239 = "android.settings.PICTURE_IN_PICTURE_SETTINGS";
2240
2241 /**
2242 * Activity Action: Show Storage Manager settings.
2243 * <p>
2244 * Input: Nothing.
2245 * <p>
2246 * Output: Nothing.
2247 *
2248 * @hide
2249 */
2250 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2251 public static final String ACTION_STORAGE_MANAGER_SETTINGS
2252 = "android.settings.STORAGE_MANAGER_SETTINGS";
2253
2254 /**
2255 * Activity Action: Allows user to select current webview implementation.
2256 * <p>
2257 * Input: Nothing.
2258 * <p>
2259 * Output: Nothing.
2260 * <p class="note">
2261 * In some cases, a matching Activity may not exist, so ensure you
2262 * safeguard against this.
2263
2264 */
2265 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2266 public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS";
2267
2268 /**
2269 * Activity Action: Show enterprise privacy section.
2270 * <p>
2271 * Input: Nothing.
2272 * <p>
2273 * Output: Nothing.
2274 * @hide
2275 */
2276 @SystemApi
2277 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2278 public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS
2279 = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
2280
2281 /**
2282 * Activity Action: Show Work Policy info.
2283 * DPC apps can implement an activity that handles this intent in order to show device policies
2284 * associated with the work profile or managed device.
2285 * <p>
2286 * Input: Nothing.
2287 * <p>
2288 * Output: Nothing.
2289 *
2290 */
2291 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2292 public static final String ACTION_SHOW_WORK_POLICY_INFO =
2293 "android.settings.SHOW_WORK_POLICY_INFO";
2294
2295 /**
2296 * Activity Action: Show screen that let user select its Autofill Service.
2297 * <p>
2298 * Input: Intent's data URI set with an application name, using the
2299 * "package" schema (like "package:com.my.app").
2300 *
2301 * <p>
2302 * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging
2303 * to the caller package.
2304 *
2305 * <p>
2306 * <b>NOTE: </b> Applications should call
2307 * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and
2308 * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action
2309 * to start an activity if they return {@code false} and {@code true} respectively.
2310 */
2311 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2312 public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE =
2313 "android.settings.REQUEST_SET_AUTOFILL_SERVICE";
2314
2315 /**
2316 * Activity Action: Show screen for controlling the Quick Access Wallet.
2317 * <p>
2318 * In some cases, a matching Activity may not exist, so ensure you
2319 * safeguard against this.
2320 * <p>
2321 * Input: Nothing.
2322 * <p>
2323 * Output: Nothing.
2324 */
2325 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2326 public static final String ACTION_QUICK_ACCESS_WALLET_SETTINGS =
2327 "android.settings.QUICK_ACCESS_WALLET_SETTINGS";
2328
2329 /**
2330 * Activity Action: Show screen for controlling which apps have access on volume directories.
2331 * <p>
2332 * Input: Nothing.
2333 * <p>
2334 * Output: Nothing.
2335 * <p>
2336 * Applications typically use this action to ask the user to revert the "Do not ask again"
2337 * status of directory access requests made by
2338 * {@link android.os.storage.StorageVolume#createAccessIntent(String)}.
2339 * @deprecated use {@link #ACTION_APPLICATION_DETAILS_SETTINGS} to manage storage permissions
2340 * for a specific application
2341 */
2342 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2343 @Deprecated
2344 public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS =
2345 "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS";
2346
2347
2348 /**
2349 * Activity Action: Show screen that let user select enable (or disable) Content Capture.
2350 * <p>
2351 * Input: Nothing.
2352 *
2353 * <p>
2354 * Output: Nothing
2355 *
2356 * @hide
2357 */
2358 @SystemApi
2359 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2360 public static final String ACTION_REQUEST_ENABLE_CONTENT_CAPTURE =
2361 "android.settings.REQUEST_ENABLE_CONTENT_CAPTURE";
2362
2363 /**
2364 * Activity Action: Show screen that let user manage how Android handles URL resolution.
2365 * <p>
2366 * Input: Nothing.
2367 * <p>
2368 * Output: Nothing
2369 *
2370 * @hide
2371 */
2372 @SystemApi
2373 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2374 public static final String ACTION_MANAGE_DOMAIN_URLS = "android.settings.MANAGE_DOMAIN_URLS";
2375
2376 /**
2377 * Activity Action: Show screen that let user select enable (or disable) tethering.
2378 * <p>
2379 * Input: Nothing.
2380 * <p>
2381 * Output: Nothing
2382 *
2383 * @hide
2384 */
2385 @SystemApi
2386 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2387 public static final String ACTION_TETHER_SETTINGS = "android.settings.TETHER_SETTINGS";
2388
2389 /**
2390 * Activity Action: Show screen that lets user configure wifi tethering.
2391 * <p>
2392 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
2393 * <p>
2394 * Input: Nothing
2395 * <p>
2396 * Output: Nothing
2397 *
2398 * @hide
2399 */
2400 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2401 public static final String ACTION_WIFI_TETHER_SETTING =
2402 "com.android.settings.WIFI_TETHER_SETTINGS";
2403
2404 /**
2405 * Broadcast to trigger notification of asking user to enable MMS.
2406 * Need to specify {@link #EXTRA_ENABLE_MMS_DATA_REQUEST_REASON} and {@link #EXTRA_SUB_ID}.
2407 *
2408 * @hide
2409 */
2410 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
2411 public static final String ACTION_ENABLE_MMS_DATA_REQUEST =
2412 "android.settings.ENABLE_MMS_DATA_REQUEST";
2413
2414 /**
2415 * Shows restrict settings dialog when settings is blocked.
2416 *
2417 * @hide
2418 */
2419 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
2420 public static final String ACTION_SHOW_RESTRICTED_SETTING_DIALOG =
2421 "android.settings.SHOW_RESTRICTED_SETTING_DIALOG";
2422
2423 /**
2424 * Integer value that specifies the reason triggering enable MMS data notification.
2425 * This must be passed as an extra field to the {@link #ACTION_ENABLE_MMS_DATA_REQUEST}.
2426 * Extra with value of EnableMmsDataReason interface.
2427 * @hide
2428 */
2429 public static final String EXTRA_ENABLE_MMS_DATA_REQUEST_REASON =
2430 "android.settings.extra.ENABLE_MMS_DATA_REQUEST_REASON";
2431
2432 /** @hide */
2433 @Retention(RetentionPolicy.SOURCE)
2434 @IntDef(prefix = { "ENABLE_MMS_DATA_REQUEST_REASON_" }, value = {
2435 ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS,
2436 ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS,
2437 })
2438 public @interface EnableMmsDataReason{}
2439
2440 /**
2441 * Requesting to enable MMS data because there's an incoming MMS.
2442 * @hide
2443 */
2444 public static final int ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS = 0;
2445
2446 /**
2447 * Requesting to enable MMS data because user is sending MMS.
2448 * @hide
2449 */
2450 public static final int ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS = 1;
2451
2452 /**
2453 * Activity Action: Show screen of a cellular subscription and highlight the
2454 * "enable MMS" toggle.
2455 * <p>
2456 * Input: {@link #EXTRA_SUB_ID}: Sub ID of the subscription.
2457 * <p>
2458 * Output: Nothing
2459 *
2460 * @hide
2461 */
2462 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2463 public static final String ACTION_MMS_MESSAGE_SETTING = "android.settings.MMS_MESSAGE_SETTING";
2464
2465 /**
2466 * Activity Action: Show a screen of bedtime settings, which is provided by the wellbeing app.
2467 * <p>
2468 * The handler of this intent action may not exist.
2469 * <p>
2470 * To start an activity with this intent, apps should set the wellbeing package explicitly in
2471 * the intent together with this action. The wellbeing package is defined in
2472 * {@code com.android.internal.R.string.config_defaultWellbeingPackage}.
2473 * <p>
2474 * Output: Nothing
2475 *
2476 * @hide
2477 */
2478 @SystemApi
2479 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2480 public static final String ACTION_BEDTIME_SETTINGS = "android.settings.BEDTIME_SETTINGS";
2481
2482 // End of Intent actions for Settings
2483
2484 /**
2485 * @hide - Private call() method on SettingsProvider to read from 'system' table.
2486 */
2487 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
2488
2489 /**
2490 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
2491 */
2492 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
2493
2494 /**
2495 * @hide - Private call() method on SettingsProvider to read from 'global' table.
2496 */
2497 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
2498
2499 /**
2500 * @hide - Private call() method on SettingsProvider to read from 'config' table.
2501 */
2502 public static final String CALL_METHOD_GET_CONFIG = "GET_config";
2503
2504 /**
2505 * @hide - Specifies that the caller of the fast-path call()-based flow tracks
2506 * the settings generation in order to cache values locally. If this key is
2507 * mapped to a <code>null</code> string extra in the request bundle, the response
2508 * bundle will contain the same key mapped to a parcelable extra which would be
2509 * an {@link android.util.MemoryIntArray}. The response will also contain an
2510 * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the
2511 * index in the array clients should use to lookup the generation. For efficiency
2512 * the caller should request the generation tracking memory array only if it
2513 * doesn't already have it.
2514 *
2515 * @see #CALL_METHOD_GENERATION_INDEX_KEY
2516 */
2517 public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation";
2518
2519 /**
2520 * @hide Key with the location in the {@link android.util.MemoryIntArray} where
2521 * to look up the generation id of the backing table. The value is an integer.
2522 *
2523 * @see #CALL_METHOD_TRACK_GENERATION_KEY
2524 */
2525 public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index";
2526
2527 /**
2528 * @hide Key with the settings table generation. The value is an integer.
2529 *
2530 * @see #CALL_METHOD_TRACK_GENERATION_KEY
2531 */
2532 public static final String CALL_METHOD_GENERATION_KEY = "_generation";
2533
2534 /**
2535 * @hide - User handle argument extra to the fast-path call()-based requests
2536 */
2537 public static final String CALL_METHOD_USER_KEY = "_user";
2538
2539 /**
2540 * @hide - Boolean argument extra to the fast-path call()-based requests
2541 */
2542 public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default";
2543
2544 /**
2545 * @hide - User handle argument extra to the fast-path call()-based requests
2546 */
2547 public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode";
2548
2549 /**
2550 * @hide - String argument extra to the fast-path call()-based requests
2551 */
2552 public static final String CALL_METHOD_TAG_KEY = "_tag";
2553
2554 /**
2555 * @hide - String argument extra to the fast-path call()-based requests
2556 */
2557 public static final String CALL_METHOD_PREFIX_KEY = "_prefix";
2558
2559 /**
2560 * @hide - String argument extra to the fast-path call()-based requests
2561 */
2562 public static final String CALL_METHOD_SYNC_DISABLED_MODE_KEY = "_disabled_mode";
2563
2564 /**
2565 * @hide - RemoteCallback monitor callback argument extra to the fast-path call()-based requests
2566 */
2567 public static final String CALL_METHOD_MONITOR_CALLBACK_KEY = "_monitor_callback_key";
2568
2569 /**
2570 * @hide - String argument extra to the fast-path call()-based requests
2571 */
2572 public static final String CALL_METHOD_FLAGS_KEY = "_flags";
2573
2574 /**
2575 * @hide - String argument extra to the fast-path call()-based requests
2576 */
2577 public static final String CALL_METHOD_OVERRIDEABLE_BY_RESTORE_KEY = "_overrideable_by_restore";
2578
2579 /** @hide - Private call() method to write to 'system' table */
2580 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
2581
2582 /** @hide - Private call() method to write to 'secure' table */
2583 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
2584
2585 /** @hide - Private call() method to write to 'global' table */
2586 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
2587
2588 /** @hide - Private call() method to write to 'configuration' table */
2589 public static final String CALL_METHOD_PUT_CONFIG = "PUT_config";
2590
2591 /** @hide - Private call() method to write to and delete from the 'configuration' table */
2592 public static final String CALL_METHOD_SET_ALL_CONFIG = "SET_ALL_config";
2593
2594 /** @hide - Private call() method to delete from the 'system' table */
2595 public static final String CALL_METHOD_DELETE_SYSTEM = "DELETE_system";
2596
2597 /** @hide - Private call() method to delete from the 'secure' table */
2598 public static final String CALL_METHOD_DELETE_SECURE = "DELETE_secure";
2599
2600 /** @hide - Private call() method to delete from the 'global' table */
2601 public static final String CALL_METHOD_DELETE_GLOBAL = "DELETE_global";
2602
2603 /** @hide - Private call() method to reset to defaults the 'configuration' table */
2604 public static final String CALL_METHOD_DELETE_CONFIG = "DELETE_config";
2605
2606 /** @hide - Private call() method to reset to defaults the 'secure' table */
2607 public static final String CALL_METHOD_RESET_SECURE = "RESET_secure";
2608
2609 /** @hide - Private call() method to reset to defaults the 'global' table */
2610 public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global";
2611
2612 /** @hide - Private call() method to reset to defaults the 'configuration' table */
2613 public static final String CALL_METHOD_RESET_CONFIG = "RESET_config";
2614
2615 /** @hide - Private call() method to query the 'system' table */
2616 public static final String CALL_METHOD_LIST_SYSTEM = "LIST_system";
2617
2618 /** @hide - Private call() method to query the 'secure' table */
2619 public static final String CALL_METHOD_LIST_SECURE = "LIST_secure";
2620
2621 /** @hide - Private call() method to query the 'global' table */
2622 public static final String CALL_METHOD_LIST_GLOBAL = "LIST_global";
2623
2624 /** @hide - Private call() method to reset to defaults the 'configuration' table */
2625 public static final String CALL_METHOD_LIST_CONFIG = "LIST_config";
2626
2627 /** @hide - Private call() method to disable / re-enable syncs to the 'configuration' table */
2628 public static final String CALL_METHOD_SET_SYNC_DISABLED_MODE_CONFIG =
2629 "SET_SYNC_DISABLED_MODE_config";
2630
2631 /**
2632 * @hide - Private call() method to return the current mode of sync disabling for the
2633 * 'configuration' table
2634 */
2635 public static final String CALL_METHOD_GET_SYNC_DISABLED_MODE_CONFIG =
2636 "GET_SYNC_DISABLED_MODE_config";
2637
2638 /** @hide - Private call() method to register monitor callback for 'configuration' table */
2639 public static final String CALL_METHOD_REGISTER_MONITOR_CALLBACK_CONFIG =
2640 "REGISTER_MONITOR_CALLBACK_config";
2641
2642 /** @hide - String argument extra to the config monitor callback */
2643 public static final String EXTRA_MONITOR_CALLBACK_TYPE = "monitor_callback_type";
2644
2645 /** @hide - String argument extra to the config monitor callback */
2646 public static final String EXTRA_ACCESS_CALLBACK = "access_callback";
2647
2648 /** @hide - String argument extra to the config monitor callback */
2649 public static final String EXTRA_NAMESPACE_UPDATED_CALLBACK =
2650 "namespace_updated_callback";
2651
2652 /** @hide - String argument extra to the config monitor callback */
2653 public static final String EXTRA_NAMESPACE = "namespace";
2654
2655 /** @hide - String argument extra to the config monitor callback */
2656 public static final String EXTRA_CALLING_PACKAGE = "calling_package";
2657
2658 /**
2659 * Activity Extra: Limit available options in launched activity based on the given authority.
2660 * <p>
2661 * This can be passed as an extra field in an Activity Intent with one or more syncable content
2662 * provider's authorities as a String[]. This field is used by some intents to alter the
2663 * behavior of the called activity.
2664 * <p>
2665 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
2666 * on the authority given.
2667 */
2668 public static final String EXTRA_AUTHORITIES = "authorities";
2669
2670 /**
2671 * Activity Extra: Limit available options in launched activity based on the given account
2672 * types.
2673 * <p>
2674 * This can be passed as an extra field in an Activity Intent with one or more account types
2675 * as a String[]. This field is used by some intents to alter the behavior of the called
2676 * activity.
2677 * <p>
2678 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
2679 * list.
2680 */
2681 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
2682
2683 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
2684
2685 /**
2686 * Activity Extra: The device identifier to act upon.
2687 * <p>
2688 * This can be passed as an extra field in an Activity Intent with a single
2689 * InputDeviceIdentifier. This field is used by some activities to jump straight into the
2690 * settings for the given device.
2691 * <p>
2692 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
2693 * dialog for the given device.
2694 * @hide
2695 */
2696 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
2697
2698 /**
2699 * Activity Extra: Enable or disable Airplane Mode.
2700 * <p>
2701 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
2702 * intent as a boolean to indicate if it should be enabled.
2703 */
2704 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
2705
2706 /**
2707 * Activity Extra: Enable or disable Battery saver mode.
2708 * <p>
2709 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
2710 * intent as a boolean to indicate if it should be enabled.
2711 */
2712 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
2713 "android.settings.extra.battery_saver_mode_enabled";
2714
2715 /**
2716 * Activity Extra: Enable or disable Do Not Disturb mode.
2717 * <p>
2718 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
2719 * intent as a boolean to indicate if it should be enabled.
2720 */
2721 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
2722 "android.settings.extra.do_not_disturb_mode_enabled";
2723
2724 /**
2725 * Activity Extra: How many minutes to enable do not disturb mode for.
2726 * <p>
2727 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
2728 * intent to indicate how long do not disturb mode should be enabled for.
2729 */
2730 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
2731 "android.settings.extra.do_not_disturb_mode_minutes";
2732
2733 /**
2734 * Reset mode: reset to defaults only settings changed by the
2735 * calling package. If there is a default set the setting
2736 * will be set to it, otherwise the setting will be deleted.
2737 * This is the only type of reset available to non-system clients.
2738 * @hide
2739 */
2740 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
2741 @TestApi
2742 public static final int RESET_MODE_PACKAGE_DEFAULTS = 1;
2743
2744 /**
2745 * Reset mode: reset all settings set by untrusted packages, which is
2746 * packages that aren't a part of the system, to the current defaults.
2747 * If there is a default set the setting will be set to it, otherwise
2748 * the setting will be deleted. This mode is only available to the system.
2749 * @hide
2750 */
2751 public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2;
2752
2753 /**
2754 * Reset mode: delete all settings set by untrusted packages, which is
2755 * packages that aren't a part of the system. If a setting is set by an
2756 * untrusted package it will be deleted if its default is not provided
2757 * by the system, otherwise the setting will be set to its default.
2758 * This mode is only available to the system.
2759 * @hide
2760 */
2761 public static final int RESET_MODE_UNTRUSTED_CHANGES = 3;
2762
2763 /**
2764 * Reset mode: reset all settings to defaults specified by trusted
2765 * packages, which is packages that are a part of the system, and
2766 * delete all settings set by untrusted packages. If a setting has
2767 * a default set by a system package it will be set to the default,
2768 * otherwise the setting will be deleted. This mode is only available
2769 * to the system.
2770 * @hide
2771 */
2772 public static final int RESET_MODE_TRUSTED_DEFAULTS = 4;
2773
2774 /** @hide */
2775 @Retention(RetentionPolicy.SOURCE)
2776 @IntDef(prefix = { "RESET_MODE_" }, value = {
2777 RESET_MODE_PACKAGE_DEFAULTS,
2778 RESET_MODE_UNTRUSTED_DEFAULTS,
2779 RESET_MODE_UNTRUSTED_CHANGES,
2780 RESET_MODE_TRUSTED_DEFAULTS
2781 })
2782 public @interface ResetMode{}
2783
2784 /**
2785 * Activity Extra: Number of certificates
2786 * <p>
2787 * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO}
2788 * intent to indicate the number of certificates
2789 * @hide
2790 */
2791 public static final String EXTRA_NUMBER_OF_CERTIFICATES =
2792 "android.settings.extra.number_of_certificates";
2793
2794 private static final String SYSTEM_PACKAGE_NAME = "android";
2795
2796 public static final String AUTHORITY = "settings";
2797
2798 private static final String TAG = "Settings";
2799 private static final boolean LOCAL_LOGV = false;
2800
2801 // Used in system server calling uid workaround in call()
2802 private static boolean sInSystemServer = false;
2803 private static final Object sInSystemServerLock = new Object();
2804
2805 /** @hide */
2806 public static void setInSystemServer() {
2807 synchronized (sInSystemServerLock) {
2808 sInSystemServer = true;
2809 }
2810 }
2811
2812 /** @hide */
2813 public static boolean isInSystemServer() {
2814 synchronized (sInSystemServerLock) {
2815 return sInSystemServer;
2816 }
2817 }
2818
2819 public static class SettingNotFoundException extends AndroidException {
2820 public SettingNotFoundException(String msg) {
2821 super(msg);
2822 }
2823 }
2824
2825 /**
2826 * Common base for tables of name/value settings.
2827 */
2828 public static class NameValueTable implements BaseColumns {
2829 public static final String NAME = "name";
2830 public static final String VALUE = "value";
2831 // A flag indicating whether the current value of a setting should be preserved during
2832 // restore.
2833 /** @hide */
2834 public static final String IS_PRESERVED_IN_RESTORE = "is_preserved_in_restore";
2835
2836 protected static boolean putString(ContentResolver resolver, Uri uri,
2837 String name, String value) {
2838 // The database will take care of replacing duplicates.
2839 try {
2840 ContentValues values = new ContentValues();
2841 values.put(NAME, name);
2842 values.put(VALUE, value);
2843 resolver.insert(uri, values);
2844 return true;
2845 } catch (SQLException e) {
2846 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
2847 return false;
2848 }
2849 }
2850
2851 public static Uri getUriFor(Uri uri, String name) {
2852 return Uri.withAppendedPath(uri, name);
2853 }
2854 }
2855
2856 private static final class GenerationTracker {
2857 private final MemoryIntArray mArray;
2858 private final Runnable mErrorHandler;
2859 private final int mIndex;
2860 private int mCurrentGeneration;
2861
2862 public GenerationTracker(@NonNull MemoryIntArray array, int index,
2863 int generation, Runnable errorHandler) {
2864 mArray = array;
2865 mIndex = index;
2866 mErrorHandler = errorHandler;
2867 mCurrentGeneration = generation;
2868 }
2869
2870 public boolean isGenerationChanged() {
2871 final int currentGeneration = readCurrentGeneration();
2872 if (currentGeneration >= 0) {
2873 if (currentGeneration == mCurrentGeneration) {
2874 return false;
2875 }
2876 mCurrentGeneration = currentGeneration;
2877 }
2878 return true;
2879 }
2880
2881 public int getCurrentGeneration() {
2882 return mCurrentGeneration;
2883 }
2884
2885 private int readCurrentGeneration() {
2886 try {
2887 return mArray.get(mIndex);
2888 } catch (IOException e) {
2889 Log.e(TAG, "Error getting current generation", e);
2890 if (mErrorHandler != null) {
2891 mErrorHandler.run();
2892 }
2893 }
2894 return -1;
2895 }
2896
2897 public void destroy() {
2898 try {
2899 mArray.close();
2900 } catch (IOException e) {
2901 Log.e(TAG, "Error closing backing array", e);
2902 if (mErrorHandler != null) {
2903 mErrorHandler.run();
2904 }
2905 }
2906 }
2907 }
2908
2909 private static final class ContentProviderHolder {
2910 private final Object mLock = new Object();
2911
2912 private final Uri mUri;
2913 @GuardedBy("mLock")
2914 @UnsupportedAppUsage
2915 private IContentProvider mContentProvider;
2916
2917 public ContentProviderHolder(Uri uri) {
2918 mUri = uri;
2919 }
2920
2921 public IContentProvider getProvider(ContentResolver contentResolver) {
2922 synchronized (mLock) {
2923 if (mContentProvider == null) {
2924 mContentProvider = contentResolver
2925 .acquireProvider(mUri.getAuthority());
2926 }
2927 return mContentProvider;
2928 }
2929 }
2930
2931 public void clearProviderForTest() {
2932 synchronized (mLock) {
2933 mContentProvider = null;
2934 }
2935 }
2936 }
2937
2938 // Thread-safe.
2939 private static class NameValueCache {
2940 private static final boolean DEBUG = false;
2941
2942 private static final String[] SELECT_VALUE_PROJECTION = new String[] {
2943 Settings.NameValueTable.VALUE
2944 };
2945
2946 private static final String NAME_EQ_PLACEHOLDER = "name=?";
2947
2948 // Must synchronize on 'this' to access mValues and mValuesVersion.
2949 private final ArrayMap<String, String> mValues = new ArrayMap<>();
2950
2951 private final Uri mUri;
2952 @UnsupportedAppUsage
2953 private final ContentProviderHolder mProviderHolder;
2954
2955 // The method we'll call (or null, to not use) on the provider
2956 // for the fast path of retrieving settings.
2957 private final String mCallGetCommand;
2958 private final String mCallSetCommand;
2959 private final String mCallDeleteCommand;
2960 private final String mCallListCommand;
2961 private final String mCallSetAllCommand;
2962
2963 private final ArraySet<String> mReadableFields;
2964 private final ArraySet<String> mAllFields;
2965 private final ArrayMap<String, Integer> mReadableFieldsWithMaxTargetSdk;
2966
2967 @GuardedBy("this")
2968 private GenerationTracker mGenerationTracker;
2969
2970 <T extends NameValueTable> NameValueCache(Uri uri, String getCommand,
2971 String setCommand, String deleteCommand, ContentProviderHolder providerHolder,
2972 Class<T> callerClass) {
2973 this(uri, getCommand, setCommand, deleteCommand, null, null, providerHolder,
2974 callerClass);
2975 }
2976
2977 private <T extends NameValueTable> NameValueCache(Uri uri, String getCommand,
2978 String setCommand, String deleteCommand, String listCommand, String setAllCommand,
2979 ContentProviderHolder providerHolder, Class<T> callerClass) {
2980 mUri = uri;
2981 mCallGetCommand = getCommand;
2982 mCallSetCommand = setCommand;
2983 mCallDeleteCommand = deleteCommand;
2984 mCallListCommand = listCommand;
2985 mCallSetAllCommand = setAllCommand;
2986 mProviderHolder = providerHolder;
2987 mReadableFields = new ArraySet<>();
2988 mAllFields = new ArraySet<>();
2989 mReadableFieldsWithMaxTargetSdk = new ArrayMap<>();
2990 getPublicSettingsForClass(callerClass, mAllFields, mReadableFields,
2991 mReadableFieldsWithMaxTargetSdk);
2992 }
2993
2994 public boolean putStringForUser(ContentResolver cr, String name, String value,
2995 String tag, boolean makeDefault, final int userHandle,
2996 boolean overrideableByRestore) {
2997 try {
2998 Bundle arg = new Bundle();
2999 arg.putString(Settings.NameValueTable.VALUE, value);
3000 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
3001 if (tag != null) {
3002 arg.putString(CALL_METHOD_TAG_KEY, tag);
3003 }
3004 if (makeDefault) {
3005 arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true);
3006 }
3007 if (overrideableByRestore) {
3008 arg.putBoolean(CALL_METHOD_OVERRIDEABLE_BY_RESTORE_KEY, true);
3009 }
3010 IContentProvider cp = mProviderHolder.getProvider(cr);
3011 cp.call(cr.getAttributionSource(),
3012 mProviderHolder.mUri.getAuthority(), mCallSetCommand, name, arg);
3013 } catch (RemoteException e) {
3014 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
3015 return false;
3016 }
3017 return true;
3018 }
3019
3020 public @SetAllResult int setStringsForPrefix(ContentResolver cr, String prefix,
3021 HashMap<String, String> keyValues) {
3022 if (mCallSetAllCommand == null) {
3023 // This NameValueCache does not support atomically setting multiple flags
3024 return SET_ALL_RESULT_FAILURE;
3025 }
3026 try {
3027 Bundle args = new Bundle();
3028 args.putString(CALL_METHOD_PREFIX_KEY, prefix);
3029 args.putSerializable(CALL_METHOD_FLAGS_KEY, keyValues);
3030 IContentProvider cp = mProviderHolder.getProvider(cr);
3031 Bundle bundle = cp.call(cr.getAttributionSource(),
3032 mProviderHolder.mUri.getAuthority(),
3033 mCallSetAllCommand, null, args);
3034 return bundle.getInt(KEY_CONFIG_SET_ALL_RETURN);
3035 } catch (RemoteException e) {
3036 // Not supported by the remote side
3037 return SET_ALL_RESULT_FAILURE;
3038 }
3039 }
3040
3041 public boolean deleteStringForUser(ContentResolver cr, String name, final int userHandle) {
3042 try {
3043 Bundle arg = new Bundle();
3044 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
3045 IContentProvider cp = mProviderHolder.getProvider(cr);
3046 cp.call(cr.getAttributionSource(),
3047 mProviderHolder.mUri.getAuthority(), mCallDeleteCommand, name, arg);
3048 } catch (RemoteException e) {
3049 Log.w(TAG, "Can't delete key " + name + " in " + mUri, e);
3050 return false;
3051 }
3052 return true;
3053 }
3054
3055 @UnsupportedAppUsage
3056 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
3057 // Check if the target settings key is readable. Reject if the caller is not system and
3058 // is trying to access a settings key defined in the Settings.Secure, Settings.System or
3059 // Settings.Global and is not annotated as @Readable.
3060 // Notice that a key string that is not defined in any of the Settings.* classes will
3061 // still be regarded as readable.
3062 if (!isCallerExemptFromReadableRestriction() && mAllFields.contains(name)) {
3063 if (!mReadableFields.contains(name)) {
3064 throw new SecurityException(
3065 "Settings key: <" + name + "> is not readable. From S+, settings keys "
3066 + "annotated with @hide are restricted to system_server and "
3067 + "system apps only, unless they are annotated with @Readable."
3068 );
3069 } else {
3070 // When the target settings key has @Readable annotation, if the caller app's
3071 // target sdk is higher than the maxTargetSdk of the annotation, reject access.
3072 if (mReadableFieldsWithMaxTargetSdk.containsKey(name)) {
3073 final int maxTargetSdk = mReadableFieldsWithMaxTargetSdk.get(name);
3074 final Application application = ActivityThread.currentApplication();
3075 final boolean targetSdkCheckOk = application != null
3076 && application.getApplicationInfo() != null
3077 && application.getApplicationInfo().targetSdkVersion
3078 <= maxTargetSdk;
3079 if (!targetSdkCheckOk) {
3080 throw new SecurityException(
3081 "Settings key: <" + name + "> is only readable to apps with "
3082 + "targetSdkVersion lower than or equal to: "
3083 + maxTargetSdk
3084 );
3085 }
3086 }
3087 }
3088 }
3089
3090 final boolean isSelf = (userHandle == UserHandle.myUserId());
3091 int currentGeneration = -1;
3092 if (isSelf) {
3093 synchronized (NameValueCache.this) {
3094 if (mGenerationTracker != null) {
3095 if (mGenerationTracker.isGenerationChanged()) {
3096 if (DEBUG) {
3097 Log.i(TAG, "Generation changed for type:"
3098 + mUri.getPath() + " in package:"
3099 + cr.getPackageName() +" and user:" + userHandle);
3100 }
3101 mValues.clear();
3102 } else if (mValues.containsKey(name)) {
3103 return mValues.get(name);
3104 }
3105 if (mGenerationTracker != null) {
3106 currentGeneration = mGenerationTracker.getCurrentGeneration();
3107 }
3108 }
3109 }
3110 } else {
3111 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
3112 + " by user " + UserHandle.myUserId() + " so skipping cache");
3113 }
3114
3115 IContentProvider cp = mProviderHolder.getProvider(cr);
3116
3117 // Try the fast path first, not using query(). If this
3118 // fails (alternate Settings provider that doesn't support
3119 // this interface?) then we fall back to the query/table
3120 // interface.
3121 if (mCallGetCommand != null) {
3122 try {
3123 Bundle args = null;
3124 if (!isSelf) {
3125 args = new Bundle();
3126 args.putInt(CALL_METHOD_USER_KEY, userHandle);
3127 }
3128 boolean needsGenerationTracker = false;
3129 synchronized (NameValueCache.this) {
3130 if (isSelf && mGenerationTracker == null) {
3131 needsGenerationTracker = true;
3132 if (args == null) {
3133 args = new Bundle();
3134 }
3135 args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
3136 if (DEBUG) {
3137 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath()
3138 + " in package:" + cr.getPackageName() +" and user:"
3139 + userHandle);
3140 }
3141 }
3142 }
3143 Bundle b;
3144 // If we're in system server and in a binder transaction we need to clear the
3145 // calling uid. This works around code in system server that did not call
3146 // clearCallingIdentity, previously this wasn't needed because reading settings
3147 // did not do permission checking but thats no longer the case.
3148 // Long term this should be removed and callers should properly call
3149 // clearCallingIdentity or use a ContentResolver from the caller as needed.
3150 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
3151 final long token = Binder.clearCallingIdentity();
3152 try {
3153 b = cp.call(cr.getAttributionSource(),
3154 mProviderHolder.mUri.getAuthority(), mCallGetCommand, name,
3155 args);
3156 } finally {
3157 Binder.restoreCallingIdentity(token);
3158 }
3159 } else {
3160 b = cp.call(cr.getAttributionSource(),
3161 mProviderHolder.mUri.getAuthority(), mCallGetCommand, name, args);
3162 }
3163 if (b != null) {
3164 String value = b.getString(Settings.NameValueTable.VALUE);
3165 // Don't update our cache for reads of other users' data
3166 if (isSelf) {
3167 synchronized (NameValueCache.this) {
3168 if (needsGenerationTracker) {
3169 MemoryIntArray array = b.getParcelable(
3170 CALL_METHOD_TRACK_GENERATION_KEY);
3171 final int index = b.getInt(
3172 CALL_METHOD_GENERATION_INDEX_KEY, -1);
3173 if (array != null && index >= 0) {
3174 final int generation = b.getInt(
3175 CALL_METHOD_GENERATION_KEY, 0);
3176 if (DEBUG) {
3177 Log.i(TAG, "Received generation tracker for type:"
3178 + mUri.getPath() + " in package:"
3179 + cr.getPackageName() + " and user:"
3180 + userHandle + " with index:" + index);
3181 }
3182 if (mGenerationTracker != null) {
3183 mGenerationTracker.destroy();
3184 }
3185 mGenerationTracker = new GenerationTracker(array, index,
3186 generation, () -> {
3187 synchronized (NameValueCache.this) {
3188 Log.e(TAG, "Error accessing generation"
3189 + " tracker - removing");
3190 if (mGenerationTracker != null) {
3191 GenerationTracker generationTracker =
3192 mGenerationTracker;
3193 mGenerationTracker = null;
3194 generationTracker.destroy();
3195 mValues.clear();
3196 }
3197 }
3198 });
3199 currentGeneration = generation;
3200 }
3201 }
3202 if (mGenerationTracker != null && currentGeneration ==
3203 mGenerationTracker.getCurrentGeneration()) {
3204 mValues.put(name, value);
3205 }
3206 }
3207 } else {
3208 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
3209 + " by " + UserHandle.myUserId()
3210 + " so not updating cache");
3211 }
3212 return value;
3213 }
3214 // If the response Bundle is null, we fall through
3215 // to the query interface below.
3216 } catch (RemoteException e) {
3217 // Not supported by the remote side? Fall through
3218 // to query().
3219 }
3220 }
3221
3222 Cursor c = null;
3223 try {
3224 Bundle queryArgs = ContentResolver.createSqlQueryBundle(
3225 NAME_EQ_PLACEHOLDER, new String[]{name}, null);
3226 // Same workaround as above.
3227 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
3228 final long token = Binder.clearCallingIdentity();
3229 try {
3230 c = cp.query(cr.getAttributionSource(), mUri,
3231 SELECT_VALUE_PROJECTION, queryArgs, null);
3232 } finally {
3233 Binder.restoreCallingIdentity(token);
3234 }
3235 } else {
3236 c = cp.query(cr.getAttributionSource(), mUri,
3237 SELECT_VALUE_PROJECTION, queryArgs, null);
3238 }
3239 if (c == null) {
3240 Log.w(TAG, "Can't get key " + name + " from " + mUri);
3241 return null;
3242 }
3243
3244 String value = c.moveToNext() ? c.getString(0) : null;
3245 synchronized (NameValueCache.this) {
3246 if (mGenerationTracker != null
3247 && currentGeneration == mGenerationTracker.getCurrentGeneration()) {
3248 mValues.put(name, value);
3249 }
3250 }
3251 if (LOCAL_LOGV) {
3252 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
3253 name + " = " + (value == null ? "(null)" : value));
3254 }
3255 return value;
3256 } catch (RemoteException e) {
3257 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
3258 return null; // Return null, but don't cache it.
3259 } finally {
3260 if (c != null) c.close();
3261 }
3262 }
3263
3264 private static boolean isCallerExemptFromReadableRestriction() {
3265 if (Settings.isInSystemServer()) {
3266 return true;
3267 }
3268 if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) {
3269 return true;
3270 }
3271 final Application application = ActivityThread.currentApplication();
3272 if (application == null || application.getApplicationInfo() == null) {
3273 return false;
3274 }
3275 final ApplicationInfo applicationInfo = application.getApplicationInfo();
3276 final boolean isTestOnly =
3277 (applicationInfo.flags & ApplicationInfo.FLAG_TEST_ONLY) != 0;
3278 return isTestOnly || applicationInfo.isSystemApp() || applicationInfo.isPrivilegedApp()
3279 || applicationInfo.isSignedWithPlatformKey();
3280 }
3281
3282 public ArrayMap<String, String> getStringsForPrefix(ContentResolver cr, String prefix,
3283 List<String> names) {
3284 String namespace = prefix.substring(0, prefix.length() - 1);
3285 DeviceConfig.enforceReadPermission(ActivityThread.currentApplication(), namespace);
3286 ArrayMap<String, String> keyValues = new ArrayMap<>();
3287 int currentGeneration = -1;
3288
3289 synchronized (NameValueCache.this) {
3290 if (mGenerationTracker != null) {
3291 if (mGenerationTracker.isGenerationChanged()) {
3292 if (DEBUG) {
3293 Log.i(TAG, "Generation changed for type:" + mUri.getPath()
3294 + " in package:" + cr.getPackageName());
3295 }
3296 mValues.clear();
3297 } else {
3298 boolean prefixCached = mValues.containsKey(prefix);
3299 if (prefixCached) {
3300 if (!names.isEmpty()) {
3301 for (String name : names) {
3302 if (mValues.containsKey(name)) {
3303 keyValues.put(name, mValues.get(name));
3304 }
3305 }
3306 } else {
3307 for (int i = 0; i < mValues.size(); ++i) {
3308 String key = mValues.keyAt(i);
3309 // Explicitly exclude the prefix as it is only there to
3310 // signal that the prefix has been cached.
3311 if (key.startsWith(prefix) && !key.equals(prefix)) {
3312 keyValues.put(key, mValues.get(key));
3313 }
3314 }
3315 }
3316 return keyValues;
3317 }
3318 }
3319 if (mGenerationTracker != null) {
3320 currentGeneration = mGenerationTracker.getCurrentGeneration();
3321 }
3322 }
3323 }
3324
3325 if (mCallListCommand == null) {
3326 // No list command specified, return empty map
3327 return keyValues;
3328 }
3329 IContentProvider cp = mProviderHolder.getProvider(cr);
3330
3331 try {
3332 Bundle args = new Bundle();
3333 args.putString(Settings.CALL_METHOD_PREFIX_KEY, prefix);
3334 boolean needsGenerationTracker = false;
3335 synchronized (NameValueCache.this) {
3336 if (mGenerationTracker == null) {
3337 needsGenerationTracker = true;
3338 args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
3339 if (DEBUG) {
3340 Log.i(TAG, "Requested generation tracker for type: "
3341 + mUri.getPath() + " in package:" + cr.getPackageName());
3342 }
3343 }
3344 }
3345
3346 Bundle b;
3347 // b/252663068: if we're in system server and the caller did not call
3348 // clearCallingIdentity, the read would fail due to mismatched AttributionSources.
3349 // TODO(b/256013480): remove this bypass after fixing the callers in system server.
3350 if (namespace.equals(DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER)
3351 && Settings.isInSystemServer()
3352 && Binder.getCallingUid() != Process.myUid()) {
3353 final long token = Binder.clearCallingIdentity();
3354 try {
3355 // Fetch all flags for the namespace at once for caching purposes
3356 b = cp.call(cr.getAttributionSource(),
3357 mProviderHolder.mUri.getAuthority(), mCallListCommand, null, args);
3358 } finally {
3359 Binder.restoreCallingIdentity(token);
3360 }
3361 } else {
3362 // Fetch all flags for the namespace at once for caching purposes
3363 b = cp.call(cr.getAttributionSource(),
3364 mProviderHolder.mUri.getAuthority(), mCallListCommand, null, args);
3365 }
3366 if (b == null) {
3367 // Invalid response, return an empty map
3368 return keyValues;
3369 }
3370
3371 // All flags for the namespace
3372 Map<String, String> flagsToValues =
3373 (HashMap) b.getSerializable(Settings.NameValueTable.VALUE);
3374 // Only the flags requested by the caller
3375 if (!names.isEmpty()) {
3376 for (Map.Entry<String, String> flag : flagsToValues.entrySet()) {
3377 if (names.contains(flag.getKey())) {
3378 keyValues.put(flag.getKey(), flag.getValue());
3379 }
3380 }
3381 } else {
3382 keyValues.putAll(flagsToValues);
3383 }
3384
3385 synchronized (NameValueCache.this) {
3386 if (needsGenerationTracker) {
3387 MemoryIntArray array = b.getParcelable(
3388 CALL_METHOD_TRACK_GENERATION_KEY);
3389 final int index = b.getInt(
3390 CALL_METHOD_GENERATION_INDEX_KEY, -1);
3391 if (array != null && index >= 0) {
3392 final int generation = b.getInt(
3393 CALL_METHOD_GENERATION_KEY, 0);
3394 if (DEBUG) {
3395 Log.i(TAG, "Received generation tracker for type:"
3396 + mUri.getPath() + " in package:"
3397 + cr.getPackageName() + " with index:" + index);
3398 }
3399 if (mGenerationTracker != null) {
3400 mGenerationTracker.destroy();
3401 }
3402 mGenerationTracker = new GenerationTracker(array, index,
3403 generation, () -> {
3404 synchronized (NameValueCache.this) {
3405 Log.e(TAG, "Error accessing generation tracker"
3406 + " - removing");
3407 if (mGenerationTracker != null) {
3408 GenerationTracker generationTracker =
3409 mGenerationTracker;
3410 mGenerationTracker = null;
3411 generationTracker.destroy();
3412 mValues.clear();
3413 }
3414 }
3415 });
3416 currentGeneration = generation;
3417 }
3418 }
3419 if (mGenerationTracker != null && currentGeneration
3420 == mGenerationTracker.getCurrentGeneration()) {
3421 // cache the complete list of flags for the namespace
3422 mValues.putAll(flagsToValues);
3423 // Adding the prefix as a signal that the prefix is cached.
3424 mValues.put(prefix, null);
3425 }
3426 }
3427 return keyValues;
3428 } catch (RemoteException e) {
3429 // Not supported by the remote side, return an empty map
3430 return keyValues;
3431 }
3432 }
3433
3434 public void clearGenerationTrackerForTest() {
3435 synchronized (NameValueCache.this) {
3436 if (mGenerationTracker != null) {
3437 mGenerationTracker.destroy();
3438 }
3439 mValues.clear();
3440 mGenerationTracker = null;
3441 }
3442 }
3443 }
3444
3445 /**
3446 * Checks if the specified context can draw on top of other apps. As of API
3447 * level 23, an app cannot draw on top of other apps unless it declares the
3448 * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its
3449 * manifest, <em>and</em> the user specifically grants the app this
3450 * capability. To prompt the user to grant this approval, the app must send an
3451 * intent with the action
3452 * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which
3453 * causes the system to display a permission management screen.
3454 *
3455 * @param context App context.
3456 * @return true if the specified context can draw on top of other apps, false otherwise
3457 */
3458 public static boolean canDrawOverlays(Context context) {
3459 return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(),
3460 context.getOpPackageName(), false) || context.checkSelfPermission(
3461 Manifest.permission.SYSTEM_APPLICATION_OVERLAY)
3462 == PackageManager.PERMISSION_GRANTED;
3463 }
3464
3465 /**
3466 * This annotation indicates that the value of a setting is allowed to be read
3467 * with the get* methods. The following settings should be readable:
3468 * 1) all the public settings
3469 * 2) all the hidden settings added before S
3470 */
3471 @Target({ ElementType.FIELD })
3472 @Retention(RetentionPolicy.RUNTIME)
3473 private @interface Readable {
3474 int maxTargetSdk() default 0;
3475 }
3476
3477 private static <T extends NameValueTable> void getPublicSettingsForClass(
3478 Class<T> callerClass, Set<String> allKeys, Set<String> readableKeys,
3479 ArrayMap<String, Integer> keysWithMaxTargetSdk) {
3480 final Field[] allFields = callerClass.getDeclaredFields();
3481 try {
3482 for (int i = 0; i < allFields.length; i++) {
3483 final Field field = allFields[i];
3484 if (!field.getType().equals(String.class)) {
3485 continue;
3486 }
3487 final Object value = field.get(callerClass);
3488 if (!value.getClass().equals(String.class)) {
3489 continue;
3490 }
3491 allKeys.add((String) value);
3492 final Readable annotation = field.getAnnotation(Readable.class);
3493
3494 if (annotation != null) {
3495 final String key = (String) value;
3496 final int maxTargetSdk = annotation.maxTargetSdk();
3497 readableKeys.add(key);
3498 if (maxTargetSdk != 0) {
3499 keysWithMaxTargetSdk.put(key, maxTargetSdk);
3500 }
3501 }
3502 }
3503 } catch (IllegalAccessException ignored) {
3504 }
3505 }
3506
3507 private static float parseFloatSetting(String settingValue, String settingName)
3508 throws SettingNotFoundException {
3509 if (settingValue == null) {
3510 throw new SettingNotFoundException(settingName);
3511 }
3512 try {
3513 return Float.parseFloat(settingValue);
3514 } catch (NumberFormatException e) {
3515 throw new SettingNotFoundException(settingName);
3516 }
3517 }
3518
3519 private static float parseFloatSettingWithDefault(String settingValue, float defaultValue) {
3520 try {
3521 return settingValue != null ? Float.parseFloat(settingValue) : defaultValue;
3522 } catch (NumberFormatException e) {
3523 return defaultValue;
3524 }
3525 }
3526
3527 private static int parseIntSetting(String settingValue, String settingName)
3528 throws SettingNotFoundException {
3529 if (settingValue == null) {
3530 throw new SettingNotFoundException(settingName);
3531 }
3532 try {
3533 return Integer.parseInt(settingValue);
3534 } catch (NumberFormatException e) {
3535 throw new SettingNotFoundException(settingName);
3536 }
3537 }
3538
3539 private static int parseIntSettingWithDefault(String settingValue, int defaultValue) {
3540 try {
3541 return settingValue != null ? Integer.parseInt(settingValue) : defaultValue;
3542 } catch (NumberFormatException e) {
3543 return defaultValue;
3544 }
3545 }
3546
3547 private static long parseLongSetting(String settingValue, String settingName)
3548 throws SettingNotFoundException {
3549 if (settingValue == null) {
3550 throw new SettingNotFoundException(settingName);
3551 }
3552 try {
3553 return Long.parseLong(settingValue);
3554 } catch (NumberFormatException e) {
3555 throw new SettingNotFoundException(settingName);
3556 }
3557 }
3558
3559 private static long parseLongSettingWithDefault(String settingValue, long defaultValue) {
3560 try {
3561 return settingValue != null ? Long.parseLong(settingValue) : defaultValue;
3562 } catch (NumberFormatException e) {
3563 return defaultValue;
3564 }
3565 }
3566
3567 /**
3568 * System settings, containing miscellaneous system preferences. This
3569 * table holds simple name/value pairs. There are convenience
3570 * functions for accessing individual settings entries.
3571 */
3572 public static final class System extends NameValueTable {
3573 // NOTE: If you add new settings here, be sure to add them to
3574 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked.
3575
3576 private static final float DEFAULT_FONT_SCALE = 1.0f;
3577 private static final int DEFAULT_FONT_WEIGHT = 0;
3578
3579 /**
3580 * The content:// style URL for this table
3581 */
3582 public static final Uri CONTENT_URI =
3583 Uri.parse("content://" + AUTHORITY + "/system");
3584
3585 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
3586 private static final ContentProviderHolder sProviderHolder =
3587 new ContentProviderHolder(CONTENT_URI);
3588
3589 @UnsupportedAppUsage
3590 private static final NameValueCache sNameValueCache = new NameValueCache(
3591 CONTENT_URI,
3592 CALL_METHOD_GET_SYSTEM,
3593 CALL_METHOD_PUT_SYSTEM,
3594 CALL_METHOD_DELETE_SYSTEM,
3595 sProviderHolder,
3596 System.class);
3597
3598 @UnsupportedAppUsage
3599 private static final HashSet<String> MOVED_TO_SECURE;
3600 static {
3601 MOVED_TO_SECURE = new HashSet<>(30);
3602 MOVED_TO_SECURE.add(Secure.ADAPTIVE_SLEEP);
3603 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
3604 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
3605 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
3606 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
3607 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
3608 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
3609 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
3610 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
3611 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
3612 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
3613 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
3614 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
3615 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
3616 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
3617 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
3618 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
3619 MOVED_TO_SECURE.add(Secure.WIFI_ON);
3620 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
3621 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
3622 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
3623 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
3624 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
3625 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
3626 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
3627 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
3628 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
3629 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
3630 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
3631
3632 // At one time in System, then Global, but now back in Secure
3633 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
3634 }
3635
3636 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
3637 private static final HashSet<String> MOVED_TO_GLOBAL;
3638 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
3639 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
3640 static {
3641 MOVED_TO_GLOBAL = new HashSet<>();
3642 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>();
3643
3644 // these were originally in system but migrated to secure in the past,
3645 // so are duplicated in the Secure.* namespace
3646 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
3647 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
3648 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
3649 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
3650 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
3651 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.NETWORK_PREFERENCE);
3652 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
3653 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
3654 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.WIFI_MAX_DHCP_RETRY_COUNT);
3655
3656 // these are moving directly from system to global
3657 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
3658 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
3659 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
3660 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
3661 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
3662 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
3663 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
3664 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
3665 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
3666 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
3667 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
3668 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
3669 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
3670 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
3671 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
3672 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
3673 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
3674 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
3675 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
3676 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
3677 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
3678 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
3679 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
3680 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
3681 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
3682 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
3683 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
3684 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
3685 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
3686 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
3687 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
3688 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
3689 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
3690 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
3691 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
3692 MOVED_TO_GLOBAL.add(Settings.Global.RADIO_NFC);
3693 MOVED_TO_GLOBAL.add(Settings.Global.RADIO_CELL);
3694 MOVED_TO_GLOBAL.add(Settings.Global.RADIO_WIFI);
3695 MOVED_TO_GLOBAL.add(Settings.Global.RADIO_BLUETOOTH);
3696 MOVED_TO_GLOBAL.add(Settings.Global.RADIO_WIMAX);
3697 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
3698 }
3699
3700 /** @hide */
3701 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
3702 outKeySet.addAll(MOVED_TO_GLOBAL);
3703 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
3704 }
3705
3706 /** @hide */
3707 public static void getMovedToSecureSettings(Set<String> outKeySet) {
3708 outKeySet.addAll(MOVED_TO_SECURE);
3709 }
3710
3711 /** @hide */
3712 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
3713 outKeySet.addAll(MOVED_TO_GLOBAL);
3714 }
3715
3716 /** @hide */
3717 public static void clearProviderForTest() {
3718 sProviderHolder.clearProviderForTest();
3719 sNameValueCache.clearGenerationTrackerForTest();
3720 }
3721
3722 /** @hide */
3723 public static void getPublicSettings(Set<String> allKeys, Set<String> readableKeys,
3724 ArrayMap<String, Integer> readableKeysWithMaxTargetSdk) {
3725 getPublicSettingsForClass(System.class, allKeys, readableKeys,
3726 readableKeysWithMaxTargetSdk);
3727 }
3728
3729 /**
3730 * Look up a name in the database.
3731 * @param resolver to access the database with
3732 * @param name to look up in the table
3733 * @return the corresponding value, or null if not present
3734 */
3735 public static String getString(ContentResolver resolver, String name) {
3736 return getStringForUser(resolver, name, resolver.getUserId());
3737 }
3738
3739 /** @hide */
3740 @UnsupportedAppUsage
3741 public static String getStringForUser(ContentResolver resolver, String name,
3742 int userHandle) {
3743 if (MOVED_TO_SECURE.contains(name)) {
3744 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3745 + " to android.provider.Settings.Secure, returning read-only value.");
3746 return Secure.getStringForUser(resolver, name, userHandle);
3747 }
3748 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
3749 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3750 + " to android.provider.Settings.Global, returning read-only value.");
3751 return Global.getStringForUser(resolver, name, userHandle);
3752 }
3753
3754 return sNameValueCache.getStringForUser(resolver, name, userHandle);
3755 }
3756
3757 /**
3758 * Store a name/value pair into the database.
3759 * @param resolver to access the database with
3760 * @param name to store
3761 * @param value to associate with the name
3762 * @return true if the value was set, false on database errors
3763 */
3764 public static boolean putString(ContentResolver resolver, String name, String value) {
3765 return putStringForUser(resolver, name, value, resolver.getUserId());
3766 }
3767
3768 /**
3769 * Store a name/value pair into the database. Values written by this method will be
3770 * overridden if a restore happens in the future.
3771 *
3772 * @param resolver to access the database with
3773 * @param name to store
3774 * @param value to associate with the name
3775 *
3776 * @return true if the value was set, false on database errors
3777 *
3778 * @hide
3779 */
3780 @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE)
3781 @SystemApi
3782 public static boolean putString(@NonNull ContentResolver resolver,
3783 @NonNull String name, @Nullable String value, boolean overrideableByRestore) {
3784 return putStringForUser(resolver, name, value, resolver.getUserId(),
3785 overrideableByRestore);
3786 }
3787
3788 /** @hide */
3789 @UnsupportedAppUsage
3790 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
3791 int userHandle) {
3792 return putStringForUser(resolver, name, value, userHandle,
3793 DEFAULT_OVERRIDEABLE_BY_RESTORE);
3794 }
3795
3796 private static boolean putStringForUser(ContentResolver resolver, String name, String value,
3797 int userHandle, boolean overrideableByRestore) {
3798 return putStringForUser(resolver, name, value, /* tag= */ null,
3799 /* makeDefault= */ false, userHandle, overrideableByRestore);
3800 }
3801
3802 private static boolean putStringForUser(ContentResolver resolver, String name, String value,
3803 String tag, boolean makeDefault, int userHandle, boolean overrideableByRestore) {
3804 if (MOVED_TO_SECURE.contains(name)) {
3805 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3806 + " to android.provider.Settings.Secure, value is unchanged.");
3807 return false;
3808 }
3809 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
3810 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3811 + " to android.provider.Settings.Global, value is unchanged.");
3812 return false;
3813 }
3814 return sNameValueCache.putStringForUser(resolver, name, value, tag, makeDefault,
3815 userHandle, overrideableByRestore);
3816 }
3817
3818 /**
3819 * Construct the content URI for a particular name/value pair,
3820 * useful for monitoring changes with a ContentObserver.
3821 * @param name to look up in the table
3822 * @return the corresponding content URI, or null if not present
3823 */
3824 public static Uri getUriFor(String name) {
3825 if (MOVED_TO_SECURE.contains(name)) {
3826 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3827 + " to android.provider.Settings.Secure, returning Secure URI.");
3828 return Secure.getUriFor(Secure.CONTENT_URI, name);
3829 }
3830 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
3831 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3832 + " to android.provider.Settings.Global, returning read-only global URI.");
3833 return Global.getUriFor(Global.CONTENT_URI, name);
3834 }
3835 return getUriFor(CONTENT_URI, name);
3836 }
3837
3838 /**
3839 * Convenience function for retrieving a single system settings value
3840 * as an integer. Note that internally setting values are always
3841 * stored as strings; this function converts the string to an integer
3842 * for you. The default value will be returned if the setting is
3843 * not defined or not an integer.
3844 *
3845 * @param cr The ContentResolver to access.
3846 * @param name The name of the setting to retrieve.
3847 * @param def Value to return if the setting is not defined.
3848 *
3849 * @return The setting's current value, or 'def' if it is not defined
3850 * or not a valid integer.
3851 */
3852 public static int getInt(ContentResolver cr, String name, int def) {
3853 return getIntForUser(cr, name, def, cr.getUserId());
3854 }
3855
3856 /** @hide */
3857 @UnsupportedAppUsage
3858 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
3859 String v = getStringForUser(cr, name, userHandle);
3860 return parseIntSettingWithDefault(v, def);
3861 }
3862
3863 /**
3864 * Convenience function for retrieving a single system settings value
3865 * as an integer. Note that internally setting values are always
3866 * stored as strings; this function converts the string to an integer
3867 * for you.
3868 * <p>
3869 * This version does not take a default value. If the setting has not
3870 * been set, or the string value is not a number,
3871 * it throws {@link SettingNotFoundException}.
3872 *
3873 * @param cr The ContentResolver to access.
3874 * @param name The name of the setting to retrieve.
3875 *
3876 * @throws SettingNotFoundException Thrown if a setting by the given
3877 * name can't be found or the setting value is not an integer.
3878 *
3879 * @return The setting's current value.
3880 */
3881 public static int getInt(ContentResolver cr, String name)
3882 throws SettingNotFoundException {
3883 return getIntForUser(cr, name, cr.getUserId());
3884 }
3885
3886 /** @hide */
3887 @UnsupportedAppUsage
3888 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
3889 throws SettingNotFoundException {
3890 String v = getStringForUser(cr, name, userHandle);
3891 return parseIntSetting(v, name);
3892 }
3893
3894 /**
3895 * Convenience function for updating a single settings value as an
3896 * integer. This will either create a new entry in the table if the
3897 * given name does not exist, or modify the value of the existing row
3898 * with that name. Note that internally setting values are always
3899 * stored as strings, so this function converts the given value to a
3900 * string before storing it.
3901 *
3902 * @param cr The ContentResolver to access.
3903 * @param name The name of the setting to modify.
3904 * @param value The new value for the setting.
3905 * @return true if the value was set, false on database errors
3906 */
3907 public static boolean putInt(ContentResolver cr, String name, int value) {
3908 return putIntForUser(cr, name, value, cr.getUserId());
3909 }
3910
3911 /** @hide */
3912 @UnsupportedAppUsage
3913 public static boolean putIntForUser(ContentResolver cr, String name, int value,
3914 int userHandle) {
3915 return putStringForUser(cr, name, Integer.toString(value), userHandle);
3916 }
3917
3918 /**
3919 * Convenience function for retrieving a single system settings value
3920 * as a {@code long}. Note that internally setting values are always
3921 * stored as strings; this function converts the string to a {@code long}
3922 * for you. The default value will be returned if the setting is
3923 * not defined or not a {@code long}.
3924 *
3925 * @param cr The ContentResolver to access.
3926 * @param name The name of the setting to retrieve.
3927 * @param def Value to return if the setting is not defined.
3928 *
3929 * @return The setting's current value, or 'def' if it is not defined
3930 * or not a valid {@code long}.
3931 */
3932 public static long getLong(ContentResolver cr, String name, long def) {
3933 return getLongForUser(cr, name, def, cr.getUserId());
3934 }
3935
3936 /** @hide */
3937 public static long getLongForUser(ContentResolver cr, String name, long def,
3938 int userHandle) {
3939 String v = getStringForUser(cr, name, userHandle);
3940 return parseLongSettingWithDefault(v, def);
3941 }
3942
3943 /**
3944 * Convenience function for retrieving a single system settings value
3945 * as a {@code long}. Note that internally setting values are always
3946 * stored as strings; this function converts the string to a {@code long}
3947 * for you.
3948 * <p>
3949 * This version does not take a default value. If the setting has not
3950 * been set, or the string value is not a number,
3951 * it throws {@link SettingNotFoundException}.
3952 *
3953 * @param cr The ContentResolver to access.
3954 * @param name The name of the setting to retrieve.
3955 *
3956 * @return The setting's current value.
3957 * @throws SettingNotFoundException Thrown if a setting by the given
3958 * name can't be found or the setting value is not an integer.
3959 */
3960 public static long getLong(ContentResolver cr, String name)
3961 throws SettingNotFoundException {
3962 return getLongForUser(cr, name, cr.getUserId());
3963 }
3964
3965 /** @hide */
3966 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
3967 throws SettingNotFoundException {
3968 String v = getStringForUser(cr, name, userHandle);
3969 return parseLongSetting(v, name);
3970 }
3971
3972 /**
3973 * Convenience function for updating a single settings value as a long
3974 * integer. This will either create a new entry in the table if the
3975 * given name does not exist, or modify the value of the existing row
3976 * with that name. Note that internally setting values are always
3977 * stored as strings, so this function converts the given value to a
3978 * string before storing it.
3979 *
3980 * @param cr The ContentResolver to access.
3981 * @param name The name of the setting to modify.
3982 * @param value The new value for the setting.
3983 * @return true if the value was set, false on database errors
3984 */
3985 public static boolean putLong(ContentResolver cr, String name, long value) {
3986 return putLongForUser(cr, name, value, cr.getUserId());
3987 }
3988
3989 /** @hide */
3990 public static boolean putLongForUser(ContentResolver cr, String name, long value,
3991 int userHandle) {
3992 return putStringForUser(cr, name, Long.toString(value), userHandle);
3993 }
3994
3995 /**
3996 * Convenience function for retrieving a single system settings value
3997 * as a floating point number. Note that internally setting values are
3998 * always stored as strings; this function converts the string to an
3999 * float for you. The default value will be returned if the setting
4000 * is not defined or not a valid float.
4001 *
4002 * @param cr The ContentResolver to access.
4003 * @param name The name of the setting to retrieve.
4004 * @param def Value to return if the setting is not defined.
4005 *
4006 * @return The setting's current value, or 'def' if it is not defined
4007 * or not a valid float.
4008 */
4009 public static float getFloat(ContentResolver cr, String name, float def) {
4010 return getFloatForUser(cr, name, def, cr.getUserId());
4011 }
4012
4013 /** @hide */
4014 public static float getFloatForUser(ContentResolver cr, String name, float def,
4015 int userHandle) {
4016 String v = getStringForUser(cr, name, userHandle);
4017 return parseFloatSettingWithDefault(v, def);
4018 }
4019
4020 /**
4021 * Convenience function for retrieving a single system settings value
4022 * as a float. Note that internally setting values are always
4023 * stored as strings; this function converts the string to a float
4024 * for you.
4025 * <p>
4026 * This version does not take a default value. If the setting has not
4027 * been set, or the string value is not a number,
4028 * it throws {@link SettingNotFoundException}.
4029 *
4030 * @param cr The ContentResolver to access.
4031 * @param name The name of the setting to retrieve.
4032 *
4033 * @throws SettingNotFoundException Thrown if a setting by the given
4034 * name can't be found or the setting value is not a float.
4035 *
4036 * @return The setting's current value.
4037 */
4038 public static float getFloat(ContentResolver cr, String name)
4039 throws SettingNotFoundException {
4040 return getFloatForUser(cr, name, cr.getUserId());
4041 }
4042
4043 /** @hide */
4044 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
4045 throws SettingNotFoundException {
4046 String v = getStringForUser(cr, name, userHandle);
4047 return parseFloatSetting(v, name);
4048 }
4049
4050 /**
4051 * Convenience function for updating a single settings value as a
4052 * floating point number. This will either create a new entry in the
4053 * table if the given name does not exist, or modify the value of the
4054 * existing row with that name. Note that internally setting values
4055 * are always stored as strings, so this function converts the given
4056 * value to a string before storing it.
4057 *
4058 * @param cr The ContentResolver to access.
4059 * @param name The name of the setting to modify.
4060 * @param value The new value for the setting.
4061 * @return true if the value was set, false on database errors
4062 */
4063 public static boolean putFloat(ContentResolver cr, String name, float value) {
4064 return putFloatForUser(cr, name, value, cr.getUserId());
4065 }
4066
4067 /** @hide */
4068 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
4069 int userHandle) {
4070 return putStringForUser(cr, name, Float.toString(value), userHandle);
4071 }
4072
4073 /**
4074 * Convenience function to read all of the current
4075 * configuration-related settings into a
4076 * {@link Configuration} object.
4077 *
4078 * @param cr The ContentResolver to access.
4079 * @param outConfig Where to place the configuration settings.
4080 */
4081 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
4082 adjustConfigurationForUser(cr, outConfig, cr.getUserId(),
4083 false /* updateSettingsIfEmpty */);
4084 }
4085
4086 /** @hide */
4087 public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig,
4088 int userHandle, boolean updateSettingsIfEmpty) {
4089 outConfig.fontScale = Settings.System.getFloatForUser(
4090 cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle);
4091 if (outConfig.fontScale < 0) {
4092 outConfig.fontScale = DEFAULT_FONT_SCALE;
4093 }
4094 outConfig.fontWeightAdjustment = Settings.Secure.getIntForUser(
4095 cr, Settings.Secure.FONT_WEIGHT_ADJUSTMENT, DEFAULT_FONT_WEIGHT, userHandle);
4096
4097 final String localeValue =
4098 Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle);
4099 if (localeValue != null) {
4100 outConfig.setLocales(LocaleList.forLanguageTags(localeValue));
4101 } else {
4102 // Do not update configuration with emtpy settings since we need to take over the
4103 // locale list of previous user if the settings value is empty. This happens when a
4104 // new user is created.
4105
4106 if (updateSettingsIfEmpty) {
4107 // Make current configuration persistent. This is necessary the first time a
4108 // user log in. At the first login, the configuration settings are empty, so we
4109 // need to store the adjusted configuration as the initial settings.
4110 Settings.System.putStringForUser(
4111 cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(),
4112 userHandle, DEFAULT_OVERRIDEABLE_BY_RESTORE);
4113 }
4114 }
4115 }
4116
4117 /**
4118 * @hide Erase the fields in the Configuration that should be applied
4119 * by the settings.
4120 */
4121 public static void clearConfiguration(Configuration inoutConfig) {
4122 inoutConfig.fontScale = 0;
4123 if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) {
4124 inoutConfig.clearLocales();
4125 }
4126 inoutConfig.fontWeightAdjustment = Configuration.FONT_WEIGHT_ADJUSTMENT_UNDEFINED;
4127 }
4128
4129 /**
4130 * Convenience function to write a batch of configuration-related
4131 * settings from a {@link Configuration} object.
4132 *
4133 * @param cr The ContentResolver to access.
4134 * @param config The settings to write.
4135 * @return true if the values were set, false on database errors
4136 */
4137 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
4138 return putConfigurationForUser(cr, config, cr.getUserId());
4139 }
4140
4141 /** @hide */
4142 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
4143 int userHandle) {
4144 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) &&
4145 Settings.System.putStringForUser(
4146 cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle,
4147 DEFAULT_OVERRIDEABLE_BY_RESTORE);
4148 }
4149
4150 /**
4151 * Convenience function for checking if settings should be overwritten with config changes.
4152 * @see #putConfigurationForUser(ContentResolver, Configuration, int)
4153 * @hide
4154 */
4155 public static boolean hasInterestingConfigurationChanges(int changes) {
4156 return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 ||
4157 (changes & ActivityInfo.CONFIG_LOCALE) != 0;
4158 }
4159
4160 /** @deprecated - Do not use */
4161 @Deprecated
4162 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
4163 return getShowGTalkServiceStatusForUser(cr, cr.getUserId());
4164 }
4165
4166 /**
4167 * @hide
4168 * @deprecated - Do not use
4169 */
4170 @Deprecated
4171 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
4172 int userHandle) {
4173 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
4174 }
4175
4176 /** @deprecated - Do not use */
4177 @Deprecated
4178 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
4179 setShowGTalkServiceStatusForUser(cr, flag, cr.getUserId());
4180 }
4181
4182 /**
4183 * @hide
4184 * @deprecated - Do not use
4185 */
4186 @Deprecated
4187 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
4188 int userHandle) {
4189 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
4190 }
4191
4192 /**
4193 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
4194 */
4195 @Deprecated
4196 public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN;
4197
4198 /**
4199 * What happens when the user presses the end call button if they're not
4200 * on a call.<br/>
4201 * <b>Values:</b><br/>
4202 * 0 - The end button does nothing.<br/>
4203 * 1 - The end button goes to the home screen.<br/>
4204 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
4205 * 3 - The end button goes to the home screen. If the user is already on the
4206 * home screen, it puts the device to sleep.
4207 */
4208 @Readable
4209 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
4210
4211 /**
4212 * END_BUTTON_BEHAVIOR value for "go home".
4213 * @hide
4214 */
4215 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
4216
4217 /**
4218 * END_BUTTON_BEHAVIOR value for "go to sleep".
4219 * @hide
4220 */
4221 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
4222
4223 /**
4224 * END_BUTTON_BEHAVIOR default value.
4225 * @hide
4226 */
4227 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
4228
4229 /**
4230 * Is advanced settings mode turned on. 0 == no, 1 == yes
4231 * @hide
4232 */
4233 @Readable
4234 public static final String ADVANCED_SETTINGS = "advanced_settings";
4235
4236 /**
4237 * ADVANCED_SETTINGS default value.
4238 * @hide
4239 */
4240 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
4241
4242 /**
4243 * If the triple press gesture for toggling accessibility is enabled.
4244 * Set to 1 for true and 0 for false.
4245 *
4246 * This setting is used only internally.
4247 * @hide
4248 */
4249 public static final String WEAR_ACCESSIBILITY_GESTURE_ENABLED
4250 = "wear_accessibility_gesture_enabled";
4251
4252 /**
4253 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
4254 */
4255 @Deprecated
4256 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
4257
4258 /**
4259 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
4260 */
4261 @Deprecated
4262 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
4263
4264 /**
4265 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
4266 */
4267 @Deprecated
4268 public static final String RADIO_WIFI = Global.RADIO_WIFI;
4269
4270 /**
4271 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
4272 * {@hide}
4273 */
4274 @Deprecated
4275 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
4276
4277 /**
4278 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
4279 */
4280 @Deprecated
4281 public static final String RADIO_CELL = Global.RADIO_CELL;
4282
4283 /**
4284 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
4285 */
4286 @Deprecated
4287 public static final String RADIO_NFC = Global.RADIO_NFC;
4288
4289 /**
4290 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
4291 */
4292 @Deprecated
4293 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
4294
4295 /**
4296 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
4297 *
4298 * {@hide}
4299 */
4300 @Deprecated
4301 @UnsupportedAppUsage
4302 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
4303 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
4304
4305 /**
4306 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
4307 */
4308 @Deprecated
4309 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
4310
4311 /**
4312 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
4313 */
4314 @Deprecated
4315 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
4316
4317 /**
4318 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
4319 */
4320 @Deprecated
4321 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
4322 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
4323
4324 /**
4325 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
4326 */
4327 @Deprecated
4328 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
4329
4330 /**
4331 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
4332 */
4333 @Deprecated
4334 public static final String MODE_RINGER = Global.MODE_RINGER;
4335
4336 /**
4337 * Whether to use static IP and other static network attributes.
4338 * <p>
4339 * Set to 1 for true and 0 for false.
4340 *
4341 * @deprecated Use {@link WifiManager} instead
4342 */
4343 @Deprecated
4344 @Readable
4345 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
4346
4347 /**
4348 * The static IP address.
4349 * <p>
4350 * Example: "192.168.1.51"
4351 *
4352 * @deprecated Use {@link WifiManager} instead
4353 */
4354 @Deprecated
4355 @Readable
4356 public static final String WIFI_STATIC_IP = "wifi_static_ip";
4357
4358 /**
4359 * If using static IP, the gateway's IP address.
4360 * <p>
4361 * Example: "192.168.1.1"
4362 *
4363 * @deprecated Use {@link WifiManager} instead
4364 */
4365 @Deprecated
4366 @Readable
4367 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
4368
4369 /**
4370 * If using static IP, the net mask.
4371 * <p>
4372 * Example: "255.255.255.0"
4373 *
4374 * @deprecated Use {@link WifiManager} instead
4375 */
4376 @Deprecated
4377 @Readable
4378 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
4379
4380 /**
4381 * If using static IP, the primary DNS's IP address.
4382 * <p>
4383 * Example: "192.168.1.1"
4384 *
4385 * @deprecated Use {@link WifiManager} instead
4386 */
4387 @Deprecated
4388 @Readable
4389 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
4390
4391 /**
4392 * If using static IP, the secondary DNS's IP address.
4393 * <p>
4394 * Example: "192.168.1.2"
4395 *
4396 * @deprecated Use {@link WifiManager} instead
4397 */
4398 @Deprecated
4399 @Readable
4400 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
4401
4402 /**
4403 * Determines whether remote devices may discover and/or connect to
4404 * this device.
4405 * <P>Type: INT</P>
4406 * 2 -- discoverable and connectable
4407 * 1 -- connectable but not discoverable
4408 * 0 -- neither connectable nor discoverable
4409 */
4410 @Readable
4411 public static final String BLUETOOTH_DISCOVERABILITY =
4412 "bluetooth_discoverability";
4413
4414 /**
4415 * Bluetooth discoverability timeout. If this value is nonzero, then
4416 * Bluetooth becomes discoverable for a certain number of seconds,
4417 * after which is becomes simply connectable. The value is in seconds.
4418 */
4419 @Readable
4420 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
4421 "bluetooth_discoverability_timeout";
4422
4423 /**
4424 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
4425 * instead
4426 */
4427 @Deprecated
4428 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
4429
4430 /**
4431 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
4432 * instead
4433 */
4434 @Deprecated
4435 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
4436
4437 /**
4438 * @deprecated Use
4439 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
4440 * instead
4441 */
4442 @Deprecated
4443 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
4444 "lock_pattern_tactile_feedback_enabled";
4445
4446 /**
4447 * A formatted string of the next alarm that is set, or the empty string
4448 * if there is no alarm set.
4449 *
4450 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
4451 */
4452 @Deprecated
4453 @Readable
4454 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
4455
4456 /**
4457 * Scaling factor for fonts, float.
4458 */
4459 @Readable
4460 public static final String FONT_SCALE = "font_scale";
4461
4462 /**
4463 * The serialized system locale value.
4464 *
4465 * Do not use this value directory.
4466 * To get system locale, use {@link LocaleList#getDefault} instead.
4467 * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales}
4468 * instead.
4469 * @hide
4470 */
4471 @Readable
4472 public static final String SYSTEM_LOCALES = "system_locales";
4473
4474
4475 /**
4476 * Name of an application package to be debugged.
4477 *
4478 * @deprecated Use {@link Global#DEBUG_APP} instead
4479 */
4480 @Deprecated
4481 public static final String DEBUG_APP = Global.DEBUG_APP;
4482
4483 /**
4484 * If 1, when launching DEBUG_APP it will wait for the debugger before
4485 * starting user code. If 0, it will run normally.
4486 *
4487 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
4488 */
4489 @Deprecated
4490 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
4491
4492 /**
4493 * Whether or not to dim the screen. 0=no 1=yes
4494 * @deprecated This setting is no longer used.
4495 */
4496 @Deprecated
4497 @Readable
4498 public static final String DIM_SCREEN = "dim_screen";
4499
4500 /**
4501 * The display color mode.
4502 * @hide
4503 */
4504 @Readable
4505 public static final String DISPLAY_COLOR_MODE = "display_color_mode";
4506
4507 /**
4508 * Hint to decide whether restored vendor color modes are compatible with the new device. If
4509 * unset or a match is not made, only the standard color modes will be restored.
4510 * @hide
4511 */
4512 public static final String DISPLAY_COLOR_MODE_VENDOR_HINT =
4513 "display_color_mode_vendor_hint";
4514
4515 /**
4516 * The user selected min refresh rate in frames per second.
4517 *
4518 * If this isn't set, 0 will be used.
4519 * @hide
4520 */
4521 @Readable
4522 public static final String MIN_REFRESH_RATE = "min_refresh_rate";
4523
4524 /**
4525 * The user selected peak refresh rate in frames per second.
4526 *
4527 * If this isn't set, the system falls back to a device specific default.
4528 * @hide
4529 */
4530 @Readable
4531 public static final String PEAK_REFRESH_RATE = "peak_refresh_rate";
4532
4533 /**
4534 * The amount of time in milliseconds before the device goes to sleep or begins
4535 * to dream after a period of inactivity. This value is also known as the
4536 * user activity timeout period since the screen isn't necessarily turned off
4537 * when it expires.
4538 *
4539 * <p>
4540 * This value is bounded by maximum timeout set by
4541 * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}.
4542 */
4543 @Readable
4544 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
4545
4546 /**
4547 * The screen backlight brightness between 0 and 255.
4548 */
4549 @Readable
4550 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
4551
4552 /**
4553 * The screen backlight brightness between 0 and 255.
4554 * @hide
4555 */
4556 @Readable
4557 public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr";
4558
4559 /**
4560 * The screen backlight brightness between 0.0f and 1.0f.
4561 * @hide
4562 */
4563 @Readable
4564 public static final String SCREEN_BRIGHTNESS_FOR_VR_FLOAT =
4565 "screen_brightness_for_vr_float";
4566
4567 /**
4568 * The screen backlight brightness between 0.0f and 1.0f.
4569 * @hide
4570 */
4571 @Readable
4572 public static final String SCREEN_BRIGHTNESS_FLOAT = "screen_brightness_float";
4573
4574 /**
4575 * Control whether to enable automatic brightness mode.
4576 */
4577 @Readable
4578 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
4579
4580 /**
4581 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
4582 * or less (<0.0 >-1.0) bright.
4583 * @hide
4584 */
4585 @UnsupportedAppUsage
4586 @Readable
4587 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
4588
4589 /**
4590 * SCREEN_BRIGHTNESS_MODE value for manual mode.
4591 */
4592 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
4593
4594 /**
4595 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
4596 */
4597 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
4598
4599 /**
4600 * Control whether to enable adaptive sleep mode.
4601 * @deprecated Use {@link android.provider.Settings.Secure#ADAPTIVE_SLEEP} instead.
4602 * @hide
4603 */
4604 @Deprecated
4605 @Readable
4606 public static final String ADAPTIVE_SLEEP = "adaptive_sleep";
4607
4608 /**
4609 * Control whether the process CPU usage meter should be shown.
4610 *
4611 * @deprecated This functionality is no longer available as of
4612 * {@link android.os.Build.VERSION_CODES#N_MR1}.
4613 */
4614 @Deprecated
4615 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
4616
4617 /**
4618 * If 1, the activity manager will aggressively finish activities and
4619 * processes as soon as they are no longer needed. If 0, the normal
4620 * extended lifetime is used.
4621 *
4622 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
4623 */
4624 @Deprecated
4625 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
4626
4627 /**
4628 * Determines which streams are affected by ringer and zen mode changes. The
4629 * stream type's bit should be set to 1 if it should be muted when going
4630 * into an inaudible ringer mode.
4631 */
4632 @Readable
4633 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
4634
4635 /**
4636 * Determines which streams are affected by mute. The
4637 * stream type's bit should be set to 1 if it should be muted when a mute request
4638 * is received.
4639 */
4640 @Readable
4641 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
4642
4643 /**
4644 * Whether vibrate is on for different events. This is used internally,
4645 * changing this value will not change the vibrate. See AudioManager.
4646 */
4647 @Readable
4648 public static final String VIBRATE_ON = "vibrate_on";
4649
4650 /**
4651 * Whether applying ramping ringer on incoming phone call ringtone.
4652 * <p>1 = apply ramping ringer
4653 * <p>0 = do not apply ramping ringer
4654 * @hide
4655 */
4656 @Readable
4657 public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer";
4658
4659 /**
4660 * If 1, redirects the system vibrator to all currently attached input devices
4661 * that support vibration. If there are no such input devices, then the system
4662 * vibrator is used instead.
4663 * If 0, does not register the system vibrator.
4664 *
4665 * This setting is mainly intended to provide a compatibility mechanism for
4666 * applications that only know about the system vibrator and do not use the
4667 * input device vibrator API.
4668 *
4669 * @hide
4670 */
4671 @Readable
4672 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
4673
4674 /**
4675 * The intensity of alarm vibrations, if configurable.
4676 *
4677 * Not all devices are capable of changing their vibration intensity; on these devices
4678 * there will likely be no difference between the various vibration intensities except for
4679 * intensity 0 (off) and the rest.
4680 *
4681 * <b>Values:</b><br/>
4682 * 0 - Vibration is disabled<br/>
4683 * 1 - Weak vibrations<br/>
4684 * 2 - Medium vibrations<br/>
4685 * 3 - Strong vibrations
4686 * @hide
4687 */
4688 public static final String ALARM_VIBRATION_INTENSITY =
4689 "alarm_vibration_intensity";
4690
4691 /**
4692 * The intensity of media vibrations, if configurable.
4693 *
4694 * This includes any vibration that is part of media, such as music, movie, soundtrack,
4695 * game or animations.
4696 *
4697 * Not all devices are capable of changing their vibration intensity; on these devices
4698 * there will likely be no difference between the various vibration intensities except for
4699 * intensity 0 (off) and the rest.
4700 *
4701 * <b>Values:</b><br/>
4702 * 0 - Vibration is disabled<br/>
4703 * 1 - Weak vibrations<br/>
4704 * 2 - Medium vibrations<br/>
4705 * 3 - Strong vibrations
4706 * @hide
4707 */
4708 public static final String MEDIA_VIBRATION_INTENSITY =
4709 "media_vibration_intensity";
4710
4711 /**
4712 * The intensity of notification vibrations, if configurable.
4713 *
4714 * Not all devices are capable of changing their vibration intensity; on these devices
4715 * there will likely be no difference between the various vibration intensities except for
4716 * intensity 0 (off) and the rest.
4717 *
4718 * <b>Values:</b><br/>
4719 * 0 - Vibration is disabled<br/>
4720 * 1 - Weak vibrations<br/>
4721 * 2 - Medium vibrations<br/>
4722 * 3 - Strong vibrations
4723 * @hide
4724 */
4725 @Readable
4726 public static final String NOTIFICATION_VIBRATION_INTENSITY =
4727 "notification_vibration_intensity";
4728
4729 /**
4730 * The intensity of ringtone vibrations, if configurable.
4731 *
4732 * Not all devices are capable of changing their vibration intensity; on these devices
4733 * there will likely be no difference between the various vibration intensities except for
4734 * intensity 0 (off) and the rest.
4735 *
4736 * <b>Values:</b><br/>
4737 * 0 - Vibration is disabled<br/>
4738 * 1 - Weak vibrations<br/>
4739 * 2 - Medium vibrations<br/>
4740 * 3 - Strong vibrations
4741 * @hide
4742 */
4743 @Readable
4744 public static final String RING_VIBRATION_INTENSITY =
4745 "ring_vibration_intensity";
4746
4747 /**
4748 * The intensity of haptic feedback vibrations, if configurable.
4749 *
4750 * Not all devices are capable of changing their feedback intensity; on these devices
4751 * there will likely be no difference between the various vibration intensities except for
4752 * intensity 0 (off) and the rest.
4753 *
4754 * <b>Values:</b><br/>
4755 * 0 - Vibration is disabled<br/>
4756 * 1 - Weak vibrations<br/>
4757 * 2 - Medium vibrations<br/>
4758 * 3 - Strong vibrations
4759 * @hide
4760 */
4761 @Readable
4762 public static final String HAPTIC_FEEDBACK_INTENSITY =
4763 "haptic_feedback_intensity";
4764
4765 /**
4766 * The intensity of haptic feedback vibrations for interaction with hardware components from
4767 * the device, like buttons and sensors, if configurable.
4768 *
4769 * Not all devices are capable of changing their feedback intensity; on these devices
4770 * there will likely be no difference between the various vibration intensities except for
4771 * intensity 0 (off) and the rest.
4772 *
4773 * <b>Values:</b><br/>
4774 * 0 - Vibration is disabled<br/>
4775 * 1 - Weak vibrations<br/>
4776 * 2 - Medium vibrations<br/>
4777 * 3 - Strong vibrations
4778 * @hide
4779 */
4780 public static final String HARDWARE_HAPTIC_FEEDBACK_INTENSITY =
4781 "hardware_haptic_feedback_intensity";
4782
4783 /**
4784 * Ringer volume. This is used internally, changing this value will not
4785 * change the volume. See AudioManager.
4786 *
4787 * @removed Not used by anything since API 2.
4788 */
4789 @Readable
4790 public static final String VOLUME_RING = "volume_ring";
4791
4792 /**
4793 * System/notifications volume. This is used internally, changing this
4794 * value will not change the volume. See AudioManager.
4795 *
4796 * @removed Not used by anything since API 2.
4797 */
4798 @Readable
4799 public static final String VOLUME_SYSTEM = "volume_system";
4800
4801 /**
4802 * Voice call volume. This is used internally, changing this value will
4803 * not change the volume. See AudioManager.
4804 *
4805 * @removed Not used by anything since API 2.
4806 */
4807 @Readable
4808 public static final String VOLUME_VOICE = "volume_voice";
4809
4810 /**
4811 * Music/media/gaming volume. This is used internally, changing this
4812 * value will not change the volume. See AudioManager.
4813 *
4814 * @removed Not used by anything since API 2.
4815 */
4816 @Readable
4817 public static final String VOLUME_MUSIC = "volume_music";
4818
4819 /**
4820 * Alarm volume. This is used internally, changing this
4821 * value will not change the volume. See AudioManager.
4822 *
4823 * @removed Not used by anything since API 2.
4824 */
4825 @Readable
4826 public static final String VOLUME_ALARM = "volume_alarm";
4827
4828 /**
4829 * Notification volume. This is used internally, changing this
4830 * value will not change the volume. See AudioManager.
4831 *
4832 * @removed Not used by anything since API 2.
4833 */
4834 @Readable
4835 public static final String VOLUME_NOTIFICATION = "volume_notification";
4836
4837 /**
4838 * Bluetooth Headset volume. This is used internally, changing this value will
4839 * not change the volume. See AudioManager.
4840 *
4841 * @removed Not used by anything since API 2.
4842 */
4843 @Readable
4844 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
4845
4846 /**
4847 * @hide
4848 * Acessibility volume. This is used internally, changing this
4849 * value will not change the volume.
4850 */
4851 @Readable
4852 public static final String VOLUME_ACCESSIBILITY = "volume_a11y";
4853
4854 /**
4855 * @hide
4856 * Volume index for virtual assistant.
4857 */
4858 @Readable
4859 public static final String VOLUME_ASSISTANT = "volume_assistant";
4860
4861 /**
4862 * Master volume (float in the range 0.0f to 1.0f).
4863 *
4864 * @hide
4865 */
4866 @Readable
4867 public static final String VOLUME_MASTER = "volume_master";
4868
4869 /**
4870 * Master mono (int 1 = mono, 0 = normal).
4871 *
4872 * @hide
4873 */
4874 @UnsupportedAppUsage
4875 @Readable
4876 public static final String MASTER_MONO = "master_mono";
4877
4878 /**
4879 * Master balance (float -1.f = 100% left, 0.f = dead center, 1.f = 100% right).
4880 *
4881 * @hide
4882 */
4883 @Readable
4884 public static final String MASTER_BALANCE = "master_balance";
4885
4886 /**
4887 * Whether the notifications should use the ring volume (value of 1) or
4888 * a separate notification volume (value of 0). In most cases, users
4889 * will have this enabled so the notification and ringer volumes will be
4890 * the same. However, power users can disable this and use the separate
4891 * notification volume control.
4892 * <p>
4893 * Note: This is a one-off setting that will be removed in the future
4894 * when there is profile support. For this reason, it is kept hidden
4895 * from the public APIs.
4896 *
4897 * @hide
4898 * @deprecated
4899 */
4900 @Deprecated
4901 @Readable
4902 public static final String NOTIFICATIONS_USE_RING_VOLUME =
4903 "notifications_use_ring_volume";
4904
4905 /**
4906 * Whether silent mode should allow vibration feedback. This is used
4907 * internally in AudioService and the Sound settings activity to
4908 * coordinate decoupling of vibrate and silent modes. This setting
4909 * will likely be removed in a future release with support for
4910 * audio/vibe feedback profiles.
4911 *
4912 * Not used anymore. On devices with vibrator, the user explicitly selects
4913 * silent or vibrate mode.
4914 * Kept for use by legacy database upgrade code in DatabaseHelper.
4915 * @hide
4916 */
4917 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
4918 @Readable
4919 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
4920
4921 /**
4922 * The mapping of stream type (integer) to its setting.
4923 *
4924 * @removed Not used by anything since API 2.
4925 */
4926 public static final String[] VOLUME_SETTINGS = {
4927 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
4928 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
4929 };
4930
4931 /**
4932 * @hide
4933 * The mapping of stream type (integer) to its setting.
4934 * Unlike the VOLUME_SETTINGS array, this one contains as many entries as
4935 * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes
4936 * are never persisted.
4937 */
4938 public static final String[] VOLUME_SETTINGS_INT = {
4939 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
4940 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO,
4941 "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/,
4942 "" /*STREAM_DTMF, no setting for this stream*/,
4943 "" /*STREAM_TTS, no setting for this stream*/,
4944 VOLUME_ACCESSIBILITY, VOLUME_ASSISTANT
4945 };
4946
4947 /**
4948 * Appended to various volume related settings to record the previous
4949 * values before they the settings were affected by a silent/vibrate
4950 * ringer mode change.
4951 *
4952 * @removed Not used by anything since API 2.
4953 */
4954 @Readable
4955 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
4956
4957 /**
4958 * Persistent store for the system-wide default ringtone URI.
4959 * <p>
4960 * If you need to play the default ringtone at any given time, it is recommended
4961 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
4962 * to the set default ringtone at the time of playing.
4963 *
4964 * @see #DEFAULT_RINGTONE_URI
4965 */
4966 @Readable
4967 public static final String RINGTONE = "ringtone";
4968
4969 /**
4970 * A {@link Uri} that will point to the current default ringtone at any
4971 * given time.
4972 * <p>
4973 * If the current default ringtone is in the DRM provider and the caller
4974 * does not have permission, the exception will be a
4975 * FileNotFoundException.
4976 */
4977 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
4978
4979 /** {@hide} */
4980 @Readable
4981 public static final String RINGTONE_CACHE = "ringtone_cache";
4982 /** {@hide} */
4983 public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE);
4984
4985 /**
4986 * Persistent store for the system-wide default notification sound.
4987 *
4988 * @see #RINGTONE
4989 * @see #DEFAULT_NOTIFICATION_URI
4990 */
4991 @Readable
4992 public static final String NOTIFICATION_SOUND = "notification_sound";
4993
4994 /**
4995 * A {@link Uri} that will point to the current default notification
4996 * sound at any given time.
4997 *
4998 * @see #DEFAULT_RINGTONE_URI
4999 */
5000 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
5001
5002 /** {@hide} */
5003 @Readable
5004 public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache";
5005 /** {@hide} */
5006 public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE);
5007
5008 /**
5009 * Persistent store for the system-wide default alarm alert.
5010 *
5011 * @see #RINGTONE
5012 * @see #DEFAULT_ALARM_ALERT_URI
5013 */
5014 @Readable
5015 public static final String ALARM_ALERT = "alarm_alert";
5016
5017 /**
5018 * A {@link Uri} that will point to the current default alarm alert at
5019 * any given time.
5020 *
5021 * @see #DEFAULT_ALARM_ALERT_URI
5022 */
5023 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
5024
5025 /** {@hide} */
5026 @Readable
5027 public static final String ALARM_ALERT_CACHE = "alarm_alert_cache";
5028 /** {@hide} */
5029 public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE);
5030
5031 /**
5032 * Persistent store for the system default media button event receiver.
5033 *
5034 * @hide
5035 */
5036 @Readable(maxTargetSdk = Build.VERSION_CODES.R)
5037 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
5038
5039 /**
5040 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
5041 */
5042 @Readable
5043 public static final String TEXT_AUTO_REPLACE = "auto_replace";
5044
5045 /**
5046 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
5047 */
5048 @Readable
5049 public static final String TEXT_AUTO_CAPS = "auto_caps";
5050
5051 /**
5052 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
5053 * feature converts two spaces to a "." and space.
5054 */
5055 @Readable
5056 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
5057
5058 /**
5059 * Setting to showing password characters in text editors. 1 = On, 0 = Off
5060 */
5061 @Readable
5062 public static final String TEXT_SHOW_PASSWORD = "show_password";
5063
5064 @Readable
5065 public static final String SHOW_GTALK_SERVICE_STATUS =
5066 "SHOW_GTALK_SERVICE_STATUS";
5067
5068 /**
5069 * Name of activity to use for wallpaper on the home screen.
5070 *
5071 * @deprecated Use {@link WallpaperManager} instead.
5072 */
5073 @Deprecated
5074 @Readable
5075 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
5076
5077 /**
5078 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
5079 * instead
5080 */
5081 @Deprecated
5082 public static final String AUTO_TIME = Global.AUTO_TIME;
5083
5084 /**
5085 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
5086 * instead
5087 */
5088 @Deprecated
5089 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
5090
5091 /**
5092 * Display the user's times, e.g. in the status bar, as 12 or 24 hours.
5093 * <ul>
5094 * <li>24 = 24 hour</li>
5095 * <li>12 = 12 hour</li>
5096 * <li>[unset] = use the device locale's default</li>
5097 * </ul>
5098 */
5099 @Readable
5100 public static final String TIME_12_24 = "time_12_24";
5101
5102 /**
5103 * @deprecated No longer used. Use {@link #TIME_12_24} instead.
5104 */
5105 @Deprecated
5106 @Readable
5107 public static final String DATE_FORMAT = "date_format";
5108
5109 /**
5110 * Whether the setup wizard has been run before (on first boot), or if
5111 * it still needs to be run.
5112 *
5113 * nonzero = it has been run in the past
5114 * 0 = it has not been run in the past
5115 */
5116 @Readable
5117 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
5118
5119 /**
5120 * Scaling factor for normal window animations. Setting to 0 will disable window
5121 * animations.
5122 *
5123 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
5124 */
5125 @Deprecated
5126 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
5127
5128 /**
5129 * Scaling factor for activity transition animations. Setting to 0 will disable window
5130 * animations.
5131 *
5132 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
5133 */
5134 @Deprecated
5135 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
5136
5137 /**
5138 * Scaling factor for Animator-based animations. This affects both the start delay and
5139 * duration of all such animations. Setting to 0 will cause animations to end immediately.
5140 * The default value is 1.
5141 *
5142 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
5143 */
5144 @Deprecated
5145 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
5146
5147 /**
5148 * Control whether the accelerometer will be used to change screen
5149 * orientation. If 0, it will not be used unless explicitly requested
5150 * by the application; if 1, it will be used by default unless explicitly
5151 * disabled by the application.
5152 */
5153 @Readable
5154 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
5155
5156 /**
5157 * Default screen rotation when no other policy applies.
5158 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
5159 * preference, this rotation value will be used. Must be one of the
5160 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
5161 *
5162 * @see Display#getRotation
5163 */
5164 @Readable
5165 public static final String USER_ROTATION = "user_rotation";
5166
5167 /**
5168 * Control whether the rotation lock toggle in the System UI should be hidden.
5169 * Typically this is done for accessibility purposes to make it harder for
5170 * the user to accidentally toggle the rotation lock while the display rotation
5171 * has been locked for accessibility.
5172 *
5173 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
5174 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
5175 *
5176 * @hide
5177 */
5178 @UnsupportedAppUsage
5179 @Readable
5180 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
5181 "hide_rotation_lock_toggle_for_accessibility";
5182
5183 /**
5184 * Whether the phone vibrates when it is ringing due to an incoming call. This will
5185 * be used by Phone and Setting apps; it shouldn't affect other apps.
5186 * The value is boolean (1 or 0).
5187 *
5188 * Note: this is not same as "vibrate on ring", which had been available until ICS.
5189 * It was about AudioManager's setting and thus affected all the applications which
5190 * relied on the setting, while this is purely about the vibration setting for incoming
5191 * calls.
5192 *
5193 * @deprecated Replaced by using {@link android.os.VibrationAttributes#USAGE_RINGTONE} on
5194 * vibrations for incoming calls. User settings are applied automatically by the service and
5195 * should not be applied by individual apps.
5196 */
5197 @Deprecated
5198 @Readable
5199 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
5200
5201 /**
5202 * When {@code 1}, Telecom enhanced call blocking functionality is enabled. When
5203 * {@code 0}, enhanced call blocking functionality is disabled.
5204 * @hide
5205 */
5206 @Readable
5207 public static final String DEBUG_ENABLE_ENHANCED_CALL_BLOCKING =
5208 "debug.enable_enhanced_calling";
5209
5210 /**
5211 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
5212 * boolean (1 or 0).
5213 */
5214 @Readable
5215 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
5216
5217 /**
5218 * CDMA only settings
5219 * DTMF tone type played by the dialer when dialing.
5220 * 0 = Normal
5221 * 1 = Long
5222 */
5223 @Readable
5224 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
5225
5226 /**
5227 * Whether the hearing aid is enabled. The value is
5228 * boolean (1 or 0).
5229 * @hide
5230 */
5231 @UnsupportedAppUsage
5232 @Readable
5233 public static final String HEARING_AID = "hearing_aid";
5234
5235 /**
5236 * CDMA only settings
5237 * TTY Mode
5238 * 0 = OFF
5239 * 1 = FULL
5240 * 2 = VCO
5241 * 3 = HCO
5242 * @hide
5243 */
5244 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5245 @Readable
5246 public static final String TTY_MODE = "tty_mode";
5247
5248 /**
5249 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
5250 * boolean (1 or 0).
5251 */
5252 @Readable
5253 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
5254
5255 /**
5256 * Whether haptic feedback (Vibrate on tap) is enabled. The value is
5257 * boolean (1 or 0).
5258 *
5259 * @deprecated Replaced by using {@link android.os.VibrationAttributes#USAGE_TOUCH} on
5260 * vibrations. User settings are applied automatically by the service and should not be
5261 * applied by individual apps.
5262 */
5263 @Deprecated
5264 @Readable
5265 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
5266
5267 /**
5268 * @deprecated Each application that shows web suggestions should have its own
5269 * setting for this.
5270 */
5271 @Deprecated
5272 @Readable
5273 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
5274
5275 /**
5276 * Whether the notification LED should repeatedly flash when a notification is
5277 * pending. The value is boolean (1 or 0).
5278 * @hide
5279 */
5280 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5281 @Readable
5282 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
5283
5284 /**
5285 * Show pointer location on screen?
5286 * 0 = no
5287 * 1 = yes
5288 * @hide
5289 */
5290 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5291 @Readable
5292 public static final String POINTER_LOCATION = "pointer_location";
5293
5294 /**
5295 * Show touch positions on screen?
5296 * 0 = no
5297 * 1 = yes
5298 * @hide
5299 */
5300 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5301 @Readable
5302 public static final String SHOW_TOUCHES = "show_touches";
5303
5304 /**
5305 * Log raw orientation data from
5306 * {@link com.android.server.policy.WindowOrientationListener} for use with the
5307 * orientationplot.py tool.
5308 * 0 = no
5309 * 1 = yes
5310 * @hide
5311 */
5312 @Readable
5313 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
5314 "window_orientation_listener_log";
5315
5316 /**
5317 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
5318 * instead
5319 * @hide
5320 */
5321 @Deprecated
5322 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
5323
5324 /**
5325 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
5326 * instead
5327 * @hide
5328 */
5329 @Deprecated
5330 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5331 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
5332
5333 /**
5334 * Whether to play sounds when the keyguard is shown and dismissed.
5335 * @hide
5336 */
5337 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5338 @Readable
5339 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
5340
5341 /**
5342 * Whether the lockscreen should be completely disabled.
5343 * @hide
5344 */
5345 @Readable
5346 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
5347
5348 /**
5349 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
5350 * instead
5351 * @hide
5352 */
5353 @Deprecated
5354 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
5355
5356 /**
5357 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
5358 * instead
5359 * @hide
5360 */
5361 @Deprecated
5362 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5363 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
5364
5365 /**
5366 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
5367 * instead
5368 * @hide
5369 */
5370 @Deprecated
5371 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5372 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
5373
5374 /**
5375 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
5376 * instead
5377 * @hide
5378 */
5379 @Deprecated
5380 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5381 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
5382
5383 /**
5384 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
5385 * instead
5386 * @hide
5387 */
5388 @Deprecated
5389 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5390 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
5391
5392 /**
5393 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
5394 * instead
5395 * @hide
5396 */
5397 @Deprecated
5398 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5399 public static final String LOCK_SOUND = Global.LOCK_SOUND;
5400
5401 /**
5402 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
5403 * instead
5404 * @hide
5405 */
5406 @Deprecated
5407 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5408 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
5409
5410 /**
5411 * Receive incoming SIP calls?
5412 * 0 = no
5413 * 1 = yes
5414 * @hide
5415 */
5416 @Readable
5417 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
5418
5419 /**
5420 * Call Preference String.
5421 * "SIP_ALWAYS" : Always use SIP with network access
5422 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
5423 * @hide
5424 */
5425 @Readable
5426 public static final String SIP_CALL_OPTIONS = "sip_call_options";
5427
5428 /**
5429 * One of the sip call options: Always use SIP with network access.
5430 * @hide
5431 */
5432 @Readable
5433 public static final String SIP_ALWAYS = "SIP_ALWAYS";
5434
5435 /**
5436 * One of the sip call options: Only if destination is a SIP address.
5437 * @hide
5438 */
5439 @Readable
5440 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
5441
5442 /**
5443 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that
5444 * the user should be prompted each time a call is made whether it should be placed using
5445 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with
5446 * SIP_ADDRESS_ONLY.
5447 * @hide
5448 */
5449 @Deprecated
5450 @Readable
5451 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
5452
5453 /**
5454 * Pointer speed setting.
5455 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
5456 * -7 = slowest
5457 * 0 = default speed
5458 * +7 = fastest
5459 * @hide
5460 */
5461 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5462 @Readable
5463 public static final String POINTER_SPEED = "pointer_speed";
5464
5465 /**
5466 * Whether lock-to-app will be triggered by long-press on recents.
5467 * @hide
5468 */
5469 @Readable
5470 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
5471
5472 /**
5473 * I am the lolrus.
5474 * <p>
5475 * Nonzero values indicate that the user has a bukkit.
5476 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
5477 * @hide
5478 */
5479 @Readable
5480 public static final String EGG_MODE = "egg_mode";
5481
5482 /**
5483 * Setting to determine whether or not to show the battery percentage in the status bar.
5484 * 0 - Don't show percentage
5485 * 1 - Show percentage
5486 * @hide
5487 */
5488 @Readable
5489 public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent";
5490
5491 /**
5492 * Whether or not to enable multiple audio focus.
5493 * When enabled, requires more management by user over application playback activity,
5494 * for instance pausing media apps when another starts.
5495 * @hide
5496 */
5497 @Readable
5498 public static final String MULTI_AUDIO_FOCUS_ENABLED = "multi_audio_focus_enabled";
5499
5500 /**
5501 * Whether desktop mode is enabled or not.
5502 * 0 = off
5503 * 1 = on
5504 * @hide
5505 */
5506 @Readable
5507 public static final String DESKTOP_MODE = "desktop_mode";
5508
5509 /**
5510 * IMPORTANT: If you add a new public settings you also have to add it to
5511 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
5512 * it to PRIVATE_SETTINGS below. Also add a validator that can validate
5513 * the setting value. See an example above.
5514 */
5515
5516 /**
5517 * Keys we no longer back up under the current schema, but want to continue to
5518 * process when restoring historical backup datasets.
5519 *
5520 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
5521 * otherwise they won't be restored.
5522 *
5523 * @hide
5524 */
5525 public static final String[] LEGACY_RESTORE_SETTINGS = {
5526 };
5527
5528 /**
5529 * These are all public system settings
5530 *
5531 * @hide
5532 */
5533 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5534 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
5535 static {
5536 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
5537 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
5538 PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
5539 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
5540 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
5541 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
5542 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
5543 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
5544 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
5545 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
5546 PUBLIC_SETTINGS.add(FONT_SCALE);
5547 PUBLIC_SETTINGS.add(SYSTEM_LOCALES);
5548 PUBLIC_SETTINGS.add(DIM_SCREEN);
5549 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
5550 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
5551 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FLOAT);
5552 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR);
5553 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR_FLOAT);
5554 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
5555 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
5556 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
5557 PUBLIC_SETTINGS.add(VIBRATE_ON);
5558 PUBLIC_SETTINGS.add(VOLUME_RING);
5559 PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
5560 PUBLIC_SETTINGS.add(VOLUME_VOICE);
5561 PUBLIC_SETTINGS.add(VOLUME_MUSIC);
5562 PUBLIC_SETTINGS.add(VOLUME_ALARM);
5563 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
5564 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
5565 PUBLIC_SETTINGS.add(VOLUME_ASSISTANT);
5566 PUBLIC_SETTINGS.add(RINGTONE);
5567 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
5568 PUBLIC_SETTINGS.add(ALARM_ALERT);
5569 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
5570 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
5571 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
5572 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
5573 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
5574 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
5575 PUBLIC_SETTINGS.add(TIME_12_24);
5576 PUBLIC_SETTINGS.add(DATE_FORMAT);
5577 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
5578 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
5579 PUBLIC_SETTINGS.add(USER_ROTATION);
5580 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
5581 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
5582 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
5583 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
5584 PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING);
5585 PUBLIC_SETTINGS.add(APPLY_RAMPING_RINGER);
5586 }
5587
5588 /**
5589 * These are all hidden system settings.
5590 *
5591 * @hide
5592 */
5593 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5594 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
5595 static {
5596 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
5597 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
5598 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
5599 PRIVATE_SETTINGS.add(WEAR_ACCESSIBILITY_GESTURE_ENABLED);
5600 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
5601 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
5602 PRIVATE_SETTINGS.add(VOLUME_MASTER);
5603 PRIVATE_SETTINGS.add(MASTER_MONO);
5604 PRIVATE_SETTINGS.add(MASTER_BALANCE);
5605 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
5606 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
5607 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
5608 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
5609 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
5610 PRIVATE_SETTINGS.add(HEARING_AID);
5611 PRIVATE_SETTINGS.add(TTY_MODE);
5612 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
5613 PRIVATE_SETTINGS.add(POINTER_LOCATION);
5614 PRIVATE_SETTINGS.add(SHOW_TOUCHES);
5615 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
5616 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
5617 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
5618 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
5619 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
5620 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
5621 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
5622 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
5623 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
5624 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
5625 PRIVATE_SETTINGS.add(LOCK_SOUND);
5626 PRIVATE_SETTINGS.add(UNLOCK_SOUND);
5627 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
5628 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
5629 PRIVATE_SETTINGS.add(SIP_ALWAYS);
5630 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
5631 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
5632 PRIVATE_SETTINGS.add(POINTER_SPEED);
5633 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
5634 PRIVATE_SETTINGS.add(EGG_MODE);
5635 PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT);
5636 PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE);
5637 PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE_VENDOR_HINT);
5638 PRIVATE_SETTINGS.add(DESKTOP_MODE);
5639 }
5640
5641 /**
5642 * These entries are considered common between the personal and the managed profile,
5643 * since the managed profile doesn't get to change them.
5644 */
5645 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5646 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
5647 static {
5648 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
5649 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
5650 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
5651 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
5652 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
5653 }
5654
5655 /** @hide */
5656 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
5657 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
5658 }
5659
5660 /**
5661 * These entries should be cloned from this profile's parent only if the dependency's
5662 * value is true ("1")
5663 *
5664 * Note: the dependencies must be Secure settings
5665 *
5666 * @hide
5667 */
5668 public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>();
5669 static {
5670 CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS);
5671 CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS);
5672 CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS);
5673 }
5674
5675 /** @hide */
5676 public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) {
5677 outMap.putAll(CLONE_FROM_PARENT_ON_VALUE);
5678 }
5679
5680 /**
5681 * System settings which can be accessed by instant apps.
5682 * @hide
5683 */
5684 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
5685 static {
5686 INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE);
5687 INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS);
5688 INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
5689 INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD);
5690 INSTANT_APP_SETTINGS.add(DATE_FORMAT);
5691 INSTANT_APP_SETTINGS.add(FONT_SCALE);
5692 INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
5693 INSTANT_APP_SETTINGS.add(TIME_12_24);
5694 INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED);
5695 INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION);
5696 }
5697
5698 /**
5699 * When to use Wi-Fi calling
5700 *
5701 * @see android.telephony.TelephonyManager.WifiCallingChoices
5702 * @hide
5703 */
5704 @Readable
5705 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
5706
5707 // Settings moved to Settings.Secure
5708
5709 /**
5710 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
5711 * instead
5712 */
5713 @Deprecated
5714 public static final String ADB_ENABLED = Global.ADB_ENABLED;
5715
5716 /**
5717 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
5718 */
5719 @Deprecated
5720 public static final String ANDROID_ID = Secure.ANDROID_ID;
5721
5722 /**
5723 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
5724 */
5725 @Deprecated
5726 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
5727
5728 /**
5729 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
5730 */
5731 @Deprecated
5732 public static final String DATA_ROAMING = Global.DATA_ROAMING;
5733
5734 /**
5735 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
5736 */
5737 @Deprecated
5738 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
5739
5740 /**
5741 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
5742 */
5743 @Deprecated
5744 public static final String HTTP_PROXY = Global.HTTP_PROXY;
5745
5746 /**
5747 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
5748 */
5749 @Deprecated
5750 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
5751
5752 /**
5753 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
5754 * instead
5755 */
5756 @Deprecated
5757 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
5758
5759 /**
5760 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
5761 */
5762 @Deprecated
5763 public static final String LOGGING_ID = Secure.LOGGING_ID;
5764
5765 /**
5766 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
5767 */
5768 @Deprecated
5769 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
5770
5771 /**
5772 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
5773 * instead
5774 */
5775 @Deprecated
5776 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
5777
5778 /**
5779 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
5780 * instead
5781 */
5782 @Deprecated
5783 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
5784
5785 /**
5786 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
5787 * instead
5788 */
5789 @Deprecated
5790 public static final String PARENTAL_CONTROL_REDIRECT_URL =
5791 Secure.PARENTAL_CONTROL_REDIRECT_URL;
5792
5793 /**
5794 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
5795 */
5796 @Deprecated
5797 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
5798
5799 /**
5800 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
5801 */
5802 @Deprecated
5803 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
5804
5805 /**
5806 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
5807 */
5808 @Deprecated
5809 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
5810
5811 /**
5812 * @deprecated Use
5813 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
5814 */
5815 @Deprecated
5816 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
5817
5818 /**
5819 * @deprecated Use
5820 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
5821 */
5822 @Deprecated
5823 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
5824 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
5825
5826 /**
5827 * @deprecated Use
5828 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
5829 */
5830 @Deprecated
5831 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
5832 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
5833
5834 /**
5835 * @deprecated Use
5836 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
5837 */
5838 @Deprecated
5839 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
5840 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
5841
5842 /**
5843 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
5844 * instead
5845 */
5846 @Deprecated
5847 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
5848
5849 /**
5850 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
5851 */
5852 @Deprecated
5853 public static final String WIFI_ON = Global.WIFI_ON;
5854
5855 /**
5856 * @deprecated Use
5857 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
5858 * instead
5859 */
5860 @Deprecated
5861 @Readable
5862 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
5863 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
5864
5865 /**
5866 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
5867 */
5868 @Deprecated
5869 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
5870
5871 /**
5872 * @deprecated Use
5873 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
5874 */
5875 @Deprecated
5876 @Readable
5877 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
5878 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
5879
5880 /**
5881 * @deprecated Use
5882 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
5883 */
5884 @Deprecated
5885 @Readable
5886 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
5887 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
5888
5889 /**
5890 * @deprecated Use
5891 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
5892 * instead
5893 */
5894 @Deprecated
5895 @Readable
5896 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
5897 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
5898
5899 /**
5900 * @deprecated Use
5901 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
5902 */
5903 @Deprecated
5904 @Readable
5905 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
5906 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
5907
5908 /**
5909 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
5910 * instead
5911 */
5912 @Deprecated
5913 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
5914
5915 /**
5916 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
5917 */
5918 @Deprecated
5919 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
5920
5921 /**
5922 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
5923 */
5924 @Deprecated
5925 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
5926
5927 /**
5928 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
5929 * instead
5930 */
5931 @Deprecated
5932 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
5933
5934 /**
5935 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
5936 * instead
5937 */
5938 @Deprecated
5939 @Readable
5940 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
5941 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
5942
5943 /**
5944 * Checks if the specified app can modify system settings. As of API
5945 * level 23, an app cannot modify system settings unless it declares the
5946 * {@link android.Manifest.permission#WRITE_SETTINGS}
5947 * permission in its manifest, <em>and</em> the user specifically grants
5948 * the app this capability. To prompt the user to grant this approval,
5949 * the app must send an intent with the action {@link
5950 * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes
5951 * the system to display a permission management screen.
5952 *
5953 * @param context App context.
5954 * @return true if the calling app can write to system settings, false otherwise
5955 */
5956 public static boolean canWrite(Context context) {
5957 return isCallingPackageAllowedToWriteSettings(context, Process.myUid(),
5958 context.getOpPackageName(), false);
5959 }
5960 }
5961
5962 /**
5963 * Secure system settings, containing system preferences that applications
5964 * can read but are not allowed to write. These are for preferences that
5965 * the user must explicitly modify through the UI of a system app. Normal
5966 * applications cannot modify the secure settings database, either directly
5967 * or by calling the "put" methods that this class contains.
5968 */
5969 public static final class Secure extends NameValueTable {
5970 // NOTE: If you add new settings here, be sure to add them to
5971 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked.
5972
5973 /**
5974 * The content:// style URL for this table
5975 */
5976 public static final Uri CONTENT_URI =
5977 Uri.parse("content://" + AUTHORITY + "/secure");
5978
5979 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5980 private static final ContentProviderHolder sProviderHolder =
5981 new ContentProviderHolder(CONTENT_URI);
5982
5983 // Populated lazily, guarded by class object:
5984 @UnsupportedAppUsage
5985 private static final NameValueCache sNameValueCache = new NameValueCache(
5986 CONTENT_URI,
5987 CALL_METHOD_GET_SECURE,
5988 CALL_METHOD_PUT_SECURE,
5989 CALL_METHOD_DELETE_SECURE,
5990 sProviderHolder,
5991 Secure.class);
5992
5993 private static ILockSettings sLockSettings = null;
5994
5995 private static boolean sIsSystemProcess;
5996 @UnsupportedAppUsage
5997 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
5998 @UnsupportedAppUsage
5999 private static final HashSet<String> MOVED_TO_GLOBAL;
6000 static {
6001 MOVED_TO_LOCK_SETTINGS = new HashSet<>(3);
6002 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
6003 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
6004 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
6005
6006 MOVED_TO_GLOBAL = new HashSet<>();
6007 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
6008 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
6009 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
6010 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
6011 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
6012 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
6013 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
6014 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
6015 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
6016 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
6017 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
6018 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
6019 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
6020 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
6021 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
6022 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
6023 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
6024 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
6025 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
6026 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
6027 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
6028 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
6029 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
6030 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
6031 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
6032 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
6033 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
6034 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
6035 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
6036 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
6037 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
6038 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
6039 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
6040 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
6041 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
6042 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
6043 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
6044 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
6045 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
6046 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
6047 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
6048 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
6049 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
6050 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
6051 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
6052 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
6053 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
6054 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
6055 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
6056 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
6057 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
6058 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
6059 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
6060 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
6061 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
6062 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
6063 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
6064 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
6065 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
6066 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
6067 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
6068 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
6069 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
6070 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED);
6071 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
6072 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
6073 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
6074 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
6075 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_PENDING_FACTORY_RESET);
6076 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
6077 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
6078 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
6079 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
6080 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
6081 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
6082 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
6083 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
6084 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
6085 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
6086 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
6087 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
6088 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
6089 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
6090 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
6091 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
6092 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
6093 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
6094 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
6095 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
6096 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
6097 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
6098 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
6099 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
6100 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
6101 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
6102 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
6103 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
6104 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
6105 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
6106 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
6107 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
6108 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
6109 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
6110 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
6111 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
6112 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
6113 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
6114 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
6115 }
6116
6117 /** @hide */
6118 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
6119 outKeySet.addAll(MOVED_TO_GLOBAL);
6120 }
6121
6122 /** @hide */
6123 public static void getMovedToSystemSettings(Set<String> outKeySet) {
6124 }
6125
6126 /** @hide */
6127 public static void clearProviderForTest() {
6128 sProviderHolder.clearProviderForTest();
6129 sNameValueCache.clearGenerationTrackerForTest();
6130 }
6131
6132 /** @hide */
6133 public static void getPublicSettings(Set<String> allKeys, Set<String> readableKeys,
6134 ArrayMap<String, Integer> readableKeysWithMaxTargetSdk) {
6135 getPublicSettingsForClass(Secure.class, allKeys, readableKeys,
6136 readableKeysWithMaxTargetSdk);
6137 }
6138
6139 /**
6140 * Look up a name in the database.
6141 * @param resolver to access the database with
6142 * @param name to look up in the table
6143 * @return the corresponding value, or null if not present
6144 */
6145 public static String getString(ContentResolver resolver, String name) {
6146 return getStringForUser(resolver, name, resolver.getUserId());
6147 }
6148
6149 /** @hide */
6150 @UnsupportedAppUsage
6151 public static String getStringForUser(ContentResolver resolver, String name,
6152 int userHandle) {
6153 if (MOVED_TO_GLOBAL.contains(name)) {
6154 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
6155 + " to android.provider.Settings.Global.");
6156 return Global.getStringForUser(resolver, name, userHandle);
6157 }
6158
6159 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
6160 synchronized (Secure.class) {
6161 if (sLockSettings == null) {
6162 sLockSettings = ILockSettings.Stub.asInterface(
6163 (IBinder) ServiceManager.getService("lock_settings"));
6164 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
6165 }
6166 }
6167 if (sLockSettings != null && !sIsSystemProcess) {
6168 // No context; use the ActivityThread's context as an approximation for
6169 // determining the target API level.
6170 Application application = ActivityThread.currentApplication();
6171
6172 boolean isPreMnc = application != null
6173 && application.getApplicationInfo() != null
6174 && application.getApplicationInfo().targetSdkVersion
6175 <= VERSION_CODES.LOLLIPOP_MR1;
6176 if (isPreMnc) {
6177 try {
6178 return sLockSettings.getString(name, "0", userHandle);
6179 } catch (RemoteException re) {
6180 // Fall through
6181 }
6182 } else {
6183 throw new SecurityException("Settings.Secure." + name
6184 + " is deprecated and no longer accessible."
6185 + " See API documentation for potential replacements.");
6186 }
6187 }
6188 }
6189
6190 return sNameValueCache.getStringForUser(resolver, name, userHandle);
6191 }
6192
6193 /**
6194 * Store a name/value pair into the database. Values written by this method will be
6195 * overridden if a restore happens in the future.
6196 *
6197 * @param resolver to access the database with
6198 * @param name to store
6199 * @param value to associate with the name
6200 * @return true if the value was set, false on database errors
6201 *
6202 * @hide
6203 */
6204 @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE)
6205 public static boolean putString(ContentResolver resolver, String name,
6206 String value, boolean overrideableByRestore) {
6207 return putStringForUser(resolver, name, value, /* tag */ null, /* makeDefault */ false,
6208 resolver.getUserId(), overrideableByRestore);
6209 }
6210
6211 /**
6212 * Store a name/value pair into the database.
6213 * @param resolver to access the database with
6214 * @param name to store
6215 * @param value to associate with the name
6216 * @return true if the value was set, false on database errors
6217 */
6218 public static boolean putString(ContentResolver resolver, String name, String value) {
6219 return putStringForUser(resolver, name, value, resolver.getUserId());
6220 }
6221
6222 /** @hide */
6223 @UnsupportedAppUsage
6224 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
6225 int userHandle) {
6226 return putStringForUser(resolver, name, value, null, false, userHandle,
6227 DEFAULT_OVERRIDEABLE_BY_RESTORE);
6228 }
6229
6230 /** @hide */
6231 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
6232 public static boolean putStringForUser(@NonNull ContentResolver resolver,
6233 @NonNull String name, @Nullable String value, @Nullable String tag,
6234 boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore) {
6235 if (MOVED_TO_GLOBAL.contains(name)) {
6236 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
6237 + " to android.provider.Settings.Global");
6238 return Global.putStringForUser(resolver, name, value,
6239 tag, makeDefault, userHandle, DEFAULT_OVERRIDEABLE_BY_RESTORE);
6240 }
6241 return sNameValueCache.putStringForUser(resolver, name, value, tag,
6242 makeDefault, userHandle, overrideableByRestore);
6243 }
6244
6245 /**
6246 * Store a name/value pair into the database.
6247 * <p>
6248 * The method takes an optional tag to associate with the setting
6249 * which can be used to clear only settings made by your package and
6250 * associated with this tag by passing the tag to {@link
6251 * #resetToDefaults(ContentResolver, String)}. Anyone can override
6252 * the current tag. Also if another package changes the setting
6253 * then the tag will be set to the one specified in the set call
6254 * which can be null. Also any of the settings setters that do not
6255 * take a tag as an argument effectively clears the tag.
6256 * </p><p>
6257 * For example, if you set settings A and B with tags T1 and T2 and
6258 * another app changes setting A (potentially to the same value), it
6259 * can assign to it a tag T3 (note that now the package that changed
6260 * the setting is not yours). Now if you reset your changes for T1 and
6261 * T2 only setting B will be reset and A not (as it was changed by
6262 * another package) but since A did not change you are in the desired
6263 * initial state. Now if the other app changes the value of A (assuming
6264 * you registered an observer in the beginning) you would detect that
6265 * the setting was changed by another app and handle this appropriately
6266 * (ignore, set back to some value, etc).
6267 * </p><p>
6268 * Also the method takes an argument whether to make the value the
6269 * default for this setting. If the system already specified a default
6270 * value, then the one passed in here will <strong>not</strong>
6271 * be set as the default.
6272 * </p>
6273 *
6274 * @param resolver to access the database with.
6275 * @param name to store.
6276 * @param value to associate with the name.
6277 * @param tag to associate with the setting.
6278 * @param makeDefault whether to make the value the default one.
6279 * @return true if the value was set, false on database errors.
6280 *
6281 * @see #resetToDefaults(ContentResolver, String)
6282 *
6283 * @hide
6284 */
6285 @SystemApi
6286 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
6287 public static boolean putString(@NonNull ContentResolver resolver,
6288 @NonNull String name, @Nullable String value, @Nullable String tag,
6289 boolean makeDefault) {
6290 return putStringForUser(resolver, name, value, tag, makeDefault,
6291 resolver.getUserId(), DEFAULT_OVERRIDEABLE_BY_RESTORE);
6292 }
6293
6294 /**
6295 * Reset the settings to their defaults. This would reset <strong>only</strong>
6296 * settings set by the caller's package. Think of it of a way to undo your own
6297 * changes to the global settings. Passing in the optional tag will reset only
6298 * settings changed by your package and associated with this tag.
6299 *
6300 * @param resolver Handle to the content resolver.
6301 * @param tag Optional tag which should be associated with the settings to reset.
6302 *
6303 * @see #putString(ContentResolver, String, String, String, boolean)
6304 *
6305 * @hide
6306 */
6307 @SystemApi
6308 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
6309 public static void resetToDefaults(@NonNull ContentResolver resolver,
6310 @Nullable String tag) {
6311 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
6312 resolver.getUserId());
6313 }
6314
6315 /**
6316 *
6317 * Reset the settings to their defaults for a given user with a specific mode. The
6318 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
6319 * allowing resetting the settings made by a package and associated with the tag.
6320 *
6321 * @param resolver Handle to the content resolver.
6322 * @param tag Optional tag which should be associated with the settings to reset.
6323 * @param mode The reset mode.
6324 * @param userHandle The user for which to reset to defaults.
6325 *
6326 * @see #RESET_MODE_PACKAGE_DEFAULTS
6327 * @see #RESET_MODE_UNTRUSTED_DEFAULTS
6328 * @see #RESET_MODE_UNTRUSTED_CHANGES
6329 * @see #RESET_MODE_TRUSTED_DEFAULTS
6330 *
6331 * @hide
6332 */
6333 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
6334 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
6335 try {
6336 Bundle arg = new Bundle();
6337 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
6338 if (tag != null) {
6339 arg.putString(CALL_METHOD_TAG_KEY, tag);
6340 }
6341 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
6342 IContentProvider cp = sProviderHolder.getProvider(resolver);
6343 cp.call(resolver.getAttributionSource(),
6344 sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_SECURE, null, arg);
6345 } catch (RemoteException e) {
6346 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
6347 }
6348 }
6349
6350 /**
6351 * Construct the content URI for a particular name/value pair,
6352 * useful for monitoring changes with a ContentObserver.
6353 * @param name to look up in the table
6354 * @return the corresponding content URI, or null if not present
6355 */
6356 public static Uri getUriFor(String name) {
6357 if (MOVED_TO_GLOBAL.contains(name)) {
6358 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
6359 + " to android.provider.Settings.Global, returning global URI.");
6360 return Global.getUriFor(Global.CONTENT_URI, name);
6361 }
6362 return getUriFor(CONTENT_URI, name);
6363 }
6364
6365 /**
6366 * Convenience function for retrieving a single secure settings value
6367 * as an integer. Note that internally setting values are always
6368 * stored as strings; this function converts the string to an integer
6369 * for you. The default value will be returned if the setting is
6370 * not defined or not an integer.
6371 *
6372 * @param cr The ContentResolver to access.
6373 * @param name The name of the setting to retrieve.
6374 * @param def Value to return if the setting is not defined.
6375 *
6376 * @return The setting's current value, or 'def' if it is not defined
6377 * or not a valid integer.
6378 */
6379 public static int getInt(ContentResolver cr, String name, int def) {
6380 return getIntForUser(cr, name, def, cr.getUserId());
6381 }
6382
6383 /** @hide */
6384 @UnsupportedAppUsage
6385 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
6386 String v = getStringForUser(cr, name, userHandle);
6387 return parseIntSettingWithDefault(v, def);
6388 }
6389
6390 /**
6391 * Convenience function for retrieving a single secure settings value
6392 * as an integer. Note that internally setting values are always
6393 * stored as strings; this function converts the string to an integer
6394 * for you.
6395 * <p>
6396 * This version does not take a default value. If the setting has not
6397 * been set, or the string value is not a number,
6398 * it throws {@link SettingNotFoundException}.
6399 *
6400 * @param cr The ContentResolver to access.
6401 * @param name The name of the setting to retrieve.
6402 *
6403 * @throws SettingNotFoundException Thrown if a setting by the given
6404 * name can't be found or the setting value is not an integer.
6405 *
6406 * @return The setting's current value.
6407 */
6408 public static int getInt(ContentResolver cr, String name)
6409 throws SettingNotFoundException {
6410 return getIntForUser(cr, name, cr.getUserId());
6411 }
6412
6413 /** @hide */
6414 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
6415 throws SettingNotFoundException {
6416 String v = getStringForUser(cr, name, userHandle);
6417 return parseIntSetting(v, name);
6418 }
6419
6420 /**
6421 * Convenience function for updating a single settings value as an
6422 * integer. This will either create a new entry in the table if the
6423 * given name does not exist, or modify the value of the existing row
6424 * with that name. Note that internally setting values are always
6425 * stored as strings, so this function converts the given value to a
6426 * string before storing it.
6427 *
6428 * @param cr The ContentResolver to access.
6429 * @param name The name of the setting to modify.
6430 * @param value The new value for the setting.
6431 * @return true if the value was set, false on database errors
6432 */
6433 public static boolean putInt(ContentResolver cr, String name, int value) {
6434 return putIntForUser(cr, name, value, cr.getUserId());
6435 }
6436
6437 /** @hide */
6438 @UnsupportedAppUsage
6439 public static boolean putIntForUser(ContentResolver cr, String name, int value,
6440 int userHandle) {
6441 return putStringForUser(cr, name, Integer.toString(value), userHandle);
6442 }
6443
6444 /**
6445 * Convenience function for retrieving a single secure settings value
6446 * as a {@code long}. Note that internally setting values are always
6447 * stored as strings; this function converts the string to a {@code long}
6448 * for you. The default value will be returned if the setting is
6449 * not defined or not a {@code long}.
6450 *
6451 * @param cr The ContentResolver to access.
6452 * @param name The name of the setting to retrieve.
6453 * @param def Value to return if the setting is not defined.
6454 *
6455 * @return The setting's current value, or 'def' if it is not defined
6456 * or not a valid {@code long}.
6457 */
6458 public static long getLong(ContentResolver cr, String name, long def) {
6459 return getLongForUser(cr, name, def, cr.getUserId());
6460 }
6461
6462 /** @hide */
6463 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
6464 public static long getLongForUser(ContentResolver cr, String name, long def,
6465 int userHandle) {
6466 String v = getStringForUser(cr, name, userHandle);
6467 return parseLongSettingWithDefault(v, def);
6468 }
6469
6470 /**
6471 * Convenience function for retrieving a single secure settings value
6472 * as a {@code long}. Note that internally setting values are always
6473 * stored as strings; this function converts the string to a {@code long}
6474 * for you.
6475 * <p>
6476 * This version does not take a default value. If the setting has not
6477 * been set, or the string value is not a number,
6478 * it throws {@link SettingNotFoundException}.
6479 *
6480 * @param cr The ContentResolver to access.
6481 * @param name The name of the setting to retrieve.
6482 *
6483 * @return The setting's current value.
6484 * @throws SettingNotFoundException Thrown if a setting by the given
6485 * name can't be found or the setting value is not an integer.
6486 */
6487 public static long getLong(ContentResolver cr, String name)
6488 throws SettingNotFoundException {
6489 return getLongForUser(cr, name, cr.getUserId());
6490 }
6491
6492 /** @hide */
6493 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
6494 throws SettingNotFoundException {
6495 String v = getStringForUser(cr, name, userHandle);
6496 return parseLongSetting(v, name);
6497 }
6498
6499 /**
6500 * Convenience function for updating a secure settings value as a long
6501 * integer. This will either create a new entry in the table if the
6502 * given name does not exist, or modify the value of the existing row
6503 * with that name. Note that internally setting values are always
6504 * stored as strings, so this function converts the given value to a
6505 * string before storing it.
6506 *
6507 * @param cr The ContentResolver to access.
6508 * @param name The name of the setting to modify.
6509 * @param value The new value for the setting.
6510 * @return true if the value was set, false on database errors
6511 */
6512 public static boolean putLong(ContentResolver cr, String name, long value) {
6513 return putLongForUser(cr, name, value, cr.getUserId());
6514 }
6515
6516 /** @hide */
6517 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
6518 public static boolean putLongForUser(ContentResolver cr, String name, long value,
6519 int userHandle) {
6520 return putStringForUser(cr, name, Long.toString(value), userHandle);
6521 }
6522
6523 /**
6524 * Convenience function for retrieving a single secure settings value
6525 * as a floating point number. Note that internally setting values are
6526 * always stored as strings; this function converts the string to an
6527 * float for you. The default value will be returned if the setting
6528 * is not defined or not a valid float.
6529 *
6530 * @param cr The ContentResolver to access.
6531 * @param name The name of the setting to retrieve.
6532 * @param def Value to return if the setting is not defined.
6533 *
6534 * @return The setting's current value, or 'def' if it is not defined
6535 * or not a valid float.
6536 */
6537 public static float getFloat(ContentResolver cr, String name, float def) {
6538 return getFloatForUser(cr, name, def, cr.getUserId());
6539 }
6540
6541 /** @hide */
6542 public static float getFloatForUser(ContentResolver cr, String name, float def,
6543 int userHandle) {
6544 String v = getStringForUser(cr, name, userHandle);
6545 return parseFloatSettingWithDefault(v, def);
6546 }
6547
6548 /**
6549 * Convenience function for retrieving a single secure settings value
6550 * as a float. Note that internally setting values are always
6551 * stored as strings; this function converts the string to a float
6552 * for you.
6553 * <p>
6554 * This version does not take a default value. If the setting has not
6555 * been set, or the string value is not a number,
6556 * it throws {@link SettingNotFoundException}.
6557 *
6558 * @param cr The ContentResolver to access.
6559 * @param name The name of the setting to retrieve.
6560 *
6561 * @throws SettingNotFoundException Thrown if a setting by the given
6562 * name can't be found or the setting value is not a float.
6563 *
6564 * @return The setting's current value.
6565 */
6566 public static float getFloat(ContentResolver cr, String name)
6567 throws SettingNotFoundException {
6568 return getFloatForUser(cr, name, cr.getUserId());
6569 }
6570
6571 /** @hide */
6572 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
6573 throws SettingNotFoundException {
6574 String v = getStringForUser(cr, name, userHandle);
6575 return parseFloatSetting(v, name);
6576 }
6577
6578 /**
6579 * Convenience function for updating a single settings value as a
6580 * floating point number. This will either create a new entry in the
6581 * table if the given name does not exist, or modify the value of the
6582 * existing row with that name. Note that internally setting values
6583 * are always stored as strings, so this function converts the given
6584 * value to a string before storing it.
6585 *
6586 * @param cr The ContentResolver to access.
6587 * @param name The name of the setting to modify.
6588 * @param value The new value for the setting.
6589 * @return true if the value was set, false on database errors
6590 */
6591 public static boolean putFloat(ContentResolver cr, String name, float value) {
6592 return putFloatForUser(cr, name, value, cr.getUserId());
6593 }
6594
6595 /** @hide */
6596 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
6597 int userHandle) {
6598 return putStringForUser(cr, name, Float.toString(value), userHandle);
6599 }
6600
6601 /**
6602 * Control whether to enable adaptive sleep mode.
6603 * @hide
6604 */
6605 @Readable
6606 public static final String ADAPTIVE_SLEEP = "adaptive_sleep";
6607
6608 /**
6609 * Setting key to indicate whether camera-based autorotate is enabled.
6610 *
6611 * @hide
6612 */
6613 public static final String CAMERA_AUTOROTATE = "camera_autorotate";
6614
6615 /**
6616 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
6617 * instead
6618 */
6619 @Deprecated
6620 public static final String DEVELOPMENT_SETTINGS_ENABLED =
6621 Global.DEVELOPMENT_SETTINGS_ENABLED;
6622
6623 /**
6624 * When the user has enable the option to have a "bug report" command
6625 * in the power menu.
6626 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
6627 * @hide
6628 */
6629 @Deprecated
6630 @Readable
6631 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
6632
6633 /**
6634 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
6635 */
6636 @Deprecated
6637 public static final String ADB_ENABLED = Global.ADB_ENABLED;
6638
6639 /**
6640 * Setting to allow mock locations and location provider status to be injected into the
6641 * LocationManager service for testing purposes during application development. These
6642 * locations and status values override actual location and status information generated
6643 * by network, gps, or other location providers.
6644 *
6645 * @deprecated This settings is not used anymore.
6646 */
6647 @Deprecated
6648 @Readable
6649 public static final String ALLOW_MOCK_LOCATION = "mock_location";
6650
6651 /**
6652 * This is used by Bluetooth Manager to store adapter name
6653 * @hide
6654 */
6655 @Readable(maxTargetSdk = Build.VERSION_CODES.S)
6656 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
6657 @SuppressLint("NoSettingsProvider")
6658 public static final String BLUETOOTH_NAME = "bluetooth_name";
6659
6660 /**
6661 * This is used by Bluetooth Manager to store adapter address
6662 * @hide
6663 */
6664 @Readable(maxTargetSdk = Build.VERSION_CODES.S)
6665 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
6666 @SuppressLint("NoSettingsProvider")
6667 public static final String BLUETOOTH_ADDRESS = "bluetooth_address";
6668
6669 /**
6670 * This is used by Bluetooth Manager to store whether adapter address is valid
6671 * @hide
6672 */
6673 @Readable(maxTargetSdk = Build.VERSION_CODES.S)
6674 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
6675 @SuppressLint("NoSettingsProvider")
6676 public static final String BLUETOOTH_ADDR_VALID = "bluetooth_addr_valid";
6677
6678 /**
6679 * This is used by LocalBluetoothLeBroadcast to store the broadcast program info.
6680 * @hide
6681 */
6682 public static final String BLUETOOTH_LE_BROADCAST_PROGRAM_INFO =
6683 "bluetooth_le_broadcast_program_info";
6684
6685 /**
6686 * This is used by LocalBluetoothLeBroadcast to store the broadcast code.
6687 * @hide
6688 */
6689 public static final String BLUETOOTH_LE_BROADCAST_CODE = "bluetooth_le_broadcast_code";
6690
6691 /**
6692 * This is used by LocalBluetoothLeBroadcast to store the app source name.
6693 * @hide
6694 */
6695 public static final String BLUETOOTH_LE_BROADCAST_APP_SOURCE_NAME =
6696 "bluetooth_le_broadcast_app_source_name";
6697
6698 /**
6699 * Setting to indicate that on device captions are enabled.
6700 *
6701 * @hide
6702 */
6703 @SystemApi
6704 @Readable
6705 public static final String ODI_CAPTIONS_ENABLED = "odi_captions_enabled";
6706
6707
6708 /**
6709 * Setting to indicate live caption button show or hide in the volume
6710 * rocker.
6711 *
6712 * @hide
6713 */
6714 public static final String ODI_CAPTIONS_VOLUME_UI_ENABLED =
6715 "odi_captions_volume_ui_enabled";
6716
6717 /**
6718 * On Android 8.0 (API level 26) and higher versions of the platform,
6719 * a 64-bit number (expressed as a hexadecimal string), unique to
6720 * each combination of app-signing key, user, and device.
6721 * Values of {@code ANDROID_ID} are scoped by signing key and user.
6722 * The value may change if a factory reset is performed on the
6723 * device or if an APK signing key changes.
6724 *
6725 * For more information about how the platform handles {@code ANDROID_ID}
6726 * in Android 8.0 (API level 26) and higher, see <a
6727 * href="{@docRoot}about/versions/oreo/android-8.0-changes.html#privacy-all">
6728 * Android 8.0 Behavior Changes</a>.
6729 *
6730 * <p class="note"><strong>Note:</strong> For apps that were installed
6731 * prior to updating the device to a version of Android 8.0
6732 * (API level 26) or higher, the value of {@code ANDROID_ID} changes
6733 * if the app is uninstalled and then reinstalled after the OTA.
6734 * To preserve values across uninstalls after an OTA to Android 8.0
6735 * or higher, developers can use
6736 * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html">
6737 * Key/Value Backup</a>.</p>
6738 *
6739 * <p>In versions of the platform lower than Android 8.0 (API level 26),
6740 * a 64-bit number (expressed as a hexadecimal string) that is randomly
6741 * generated when the user first sets up the device and should remain
6742 * constant for the lifetime of the user's device.
6743 *
6744 * On devices that have
6745 * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">
6746 * multiple users</a>, each user appears as a
6747 * completely separate device, so the {@code ANDROID_ID} value is
6748 * unique to each user.</p>
6749 *
6750 * <p class="note"><strong>Note:</strong> If the caller is an Instant App the ID is scoped
6751 * to the Instant App, it is generated when the Instant App is first installed and reset if
6752 * the user clears the Instant App.
6753 */
6754 @Readable
6755 public static final String ANDROID_ID = "android_id";
6756
6757 /**
6758 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
6759 */
6760 @Deprecated
6761 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
6762
6763 /**
6764 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
6765 */
6766 @Deprecated
6767 public static final String DATA_ROAMING = Global.DATA_ROAMING;
6768
6769 /**
6770 * Stores {@link android.view.inputmethod.InputMethodInfo#getId()} of the input method
6771 * service that is currently selected.
6772 *
6773 * <p>Although the name {@link #DEFAULT_INPUT_METHOD} implies that there is a concept of
6774 * <i>default</i> input method, in reality this setting is no more or less than the
6775 * <strong>currently selected</strong> input method. This setting can be updated at any
6776 * time as a result of user-initiated and system-initiated input method switching.</p>
6777 *
6778 * <p>Use {@link ComponentName#unflattenFromString(String)} to parse the stored value.</p>
6779 */
6780 @Readable
6781 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
6782
6783 /**
6784 * Setting to record the input method subtype used by default, holding the ID
6785 * of the desired method.
6786 */
6787 @Readable
6788 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
6789 "selected_input_method_subtype";
6790
6791 /**
6792 * The {@link android.view.inputmethod.InputMethodInfo.InputMethodInfo#getId() ID} of the
6793 * default voice input method.
6794 * <p>
6795 * This stores the last known default voice IME. If the related system config value changes,
6796 * this is reset by InputMethodManagerService.
6797 * <p>
6798 * This IME is not necessarily in the enabled IME list. That state is still stored in
6799 * {@link #ENABLED_INPUT_METHODS}.
6800 *
6801 * @hide
6802 */
6803 public static final String DEFAULT_VOICE_INPUT_METHOD = "default_voice_input_method";
6804
6805 /**
6806 * Setting to record the history of input method subtype, holding the pair of ID of IME
6807 * and its last used subtype.
6808 * @hide
6809 */
6810 @Readable
6811 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
6812 "input_methods_subtype_history";
6813
6814 /**
6815 * Setting to record the visibility of input method selector
6816 */
6817 @Readable
6818 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
6819 "input_method_selector_visibility";
6820
6821 /**
6822 * The currently selected voice interaction service flattened ComponentName.
6823 * @hide
6824 */
6825 @TestApi
6826 @Readable
6827 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
6828
6829 /**
6830 * The currently selected autofill service flattened ComponentName.
6831 * @hide
6832 */
6833 @TestApi
6834 @Readable
6835 public static final String AUTOFILL_SERVICE = "autofill_service";
6836
6837 /**
6838 * Boolean indicating if Autofill supports field classification.
6839 *
6840 * @see android.service.autofill.AutofillService
6841 *
6842 * @hide
6843 */
6844 @SystemApi
6845 @Readable
6846 public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION =
6847 "autofill_field_classification";
6848
6849 /**
6850 * Boolean indicating if the dark mode dialog shown on first toggle has been seen.
6851 *
6852 * @hide
6853 */
6854 @Readable
6855 public static final String DARK_MODE_DIALOG_SEEN =
6856 "dark_mode_dialog_seen";
6857
6858 /**
6859 * Custom time when Dark theme is scheduled to activate.
6860 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
6861 * @hide
6862 */
6863 @Readable
6864 public static final String DARK_THEME_CUSTOM_START_TIME =
6865 "dark_theme_custom_start_time";
6866
6867 /**
6868 * Custom time when Dark theme is scheduled to deactivate.
6869 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
6870 * @hide
6871 */
6872 @Readable
6873 public static final String DARK_THEME_CUSTOM_END_TIME =
6874 "dark_theme_custom_end_time";
6875
6876 /**
6877 * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}.
6878 *
6879 * @hide
6880 */
6881 @SystemApi
6882 @Readable
6883 public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE =
6884 "autofill_user_data_max_user_data_size";
6885
6886 /**
6887 * Defines value returned by
6888 * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}.
6889 *
6890 * @hide
6891 */
6892 @SystemApi
6893 @Readable
6894 public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE =
6895 "autofill_user_data_max_field_classification_size";
6896
6897 /**
6898 * Defines value returned by
6899 * {@link android.service.autofill.UserData#getMaxCategoryCount()}.
6900 *
6901 * @hide
6902 */
6903 @SystemApi
6904 @Readable
6905 public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT =
6906 "autofill_user_data_max_category_count";
6907
6908 /**
6909 * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}.
6910 *
6911 * @hide
6912 */
6913 @SystemApi
6914 @Readable
6915 public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH =
6916 "autofill_user_data_max_value_length";
6917
6918 /**
6919 * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}.
6920 *
6921 * @hide
6922 */
6923 @SystemApi
6924 @Readable
6925 public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH =
6926 "autofill_user_data_min_value_length";
6927
6928 /**
6929 * Defines whether Content Capture is enabled for the user.
6930 *
6931 * <p>Type: {@code int} ({@code 0} for disabled, {@code 1} for enabled).
6932 * <p>Default: enabled
6933 *
6934 * @hide
6935 */
6936 @TestApi
6937 @Readable
6938 public static final String CONTENT_CAPTURE_ENABLED = "content_capture_enabled";
6939
6940 /**
6941 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
6942 */
6943 @Deprecated
6944 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
6945
6946 /**
6947 * Indicates whether a DPC has been downloaded during provisioning.
6948 *
6949 * <p>Type: int (0 for false, 1 for true)
6950 *
6951 * <p>If this is true, then any attempts to begin setup again should result in factory reset
6952 *
6953 * @hide
6954 */
6955 @Readable
6956 public static final String MANAGED_PROVISIONING_DPC_DOWNLOADED =
6957 "managed_provisioning_dpc_downloaded";
6958
6959 /**
6960 * Indicates whether the device is under restricted secure FRP mode.
6961 * Secure FRP mode is enabled when the device is under FRP. On solving of FRP challenge,
6962 * device is removed from this mode.
6963 * <p>
6964 * Type: int (0 for false, 1 for true)
6965 */
6966 @Readable
6967 public static final String SECURE_FRP_MODE = "secure_frp_mode";
6968
6969 /**
6970 * Indicates whether the current user has completed setup via the setup wizard.
6971 * <p>
6972 * Type: int (0 for false, 1 for true)
6973 *
6974 * @hide
6975 */
6976 @SystemApi
6977 @Readable
6978 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
6979
6980 /**
6981 * Indicates that the user has not started setup personalization.
6982 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
6983 *
6984 * @hide
6985 */
6986 @SystemApi
6987 public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0;
6988
6989 /**
6990 * Indicates that the user has not yet completed setup personalization.
6991 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
6992 *
6993 * @hide
6994 */
6995 @SystemApi
6996 public static final int USER_SETUP_PERSONALIZATION_STARTED = 1;
6997
6998 /**
6999 * Indicates that the user has snoozed personalization and will complete it later.
7000 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
7001 *
7002 * @hide
7003 */
7004 @SystemApi
7005 public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2;
7006
7007 /**
7008 * Indicates that the user has completed setup personalization.
7009 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
7010 *
7011 * @hide
7012 */
7013 @SystemApi
7014 public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10;
7015
7016 /** @hide */
7017 @Retention(RetentionPolicy.SOURCE)
7018 @IntDef({
7019 USER_SETUP_PERSONALIZATION_NOT_STARTED,
7020 USER_SETUP_PERSONALIZATION_STARTED,
7021 USER_SETUP_PERSONALIZATION_PAUSED,
7022 USER_SETUP_PERSONALIZATION_COMPLETE
7023 })
7024 public @interface UserSetupPersonalization {}
7025
7026 /**
7027 * Defines the user's current state of device personalization.
7028 * The possible states are defined in {@link UserSetupPersonalization}.
7029 *
7030 * @hide
7031 */
7032 @SystemApi
7033 @Readable
7034 public static final String USER_SETUP_PERSONALIZATION_STATE =
7035 "user_setup_personalization_state";
7036
7037 /**
7038 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
7039 * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0
7040 * in case SetupWizard has been re-enabled on TV devices.
7041 *
7042 * @hide
7043 */
7044 @Readable
7045 public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete";
7046
7047 /**
7048 * The prefix for a category name that indicates whether a suggested action from that
7049 * category was marked as completed.
7050 * <p>
7051 * Type: int (0 for false, 1 for true)
7052 *
7053 * @hide
7054 */
7055 @SystemApi
7056 @Readable
7057 public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
7058
7059 /**
7060 * Whether or not compress blocks should be released on install.
7061 * <p>The setting only determines if the platform will attempt to release
7062 * compress blocks; it does not guarantee that the files will have their
7063 * compress blocks released. Compression is currently only supported on
7064 * some f2fs filesystems.
7065 * <p>
7066 * Type: int (0 for false, 1 for true)
7067 *
7068 * @hide
7069 */
7070 public static final String RELEASE_COMPRESS_BLOCKS_ON_INSTALL =
7071 "release_compress_blocks_on_install";
7072
7073 /**
7074 * List of input methods that are currently enabled. This is a string
7075 * containing the IDs of all enabled input methods, each ID separated
7076 * by ':'.
7077 *
7078 * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0"
7079 * where imeId is ComponentName and subtype is int32.
7080 */
7081 @Readable
7082 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
7083
7084 /**
7085 * List of system input methods that are currently disabled. This is a string
7086 * containing the IDs of all disabled input methods, each ID separated
7087 * by ':'.
7088 * @hide
7089 */
7090 @Readable
7091 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
7092
7093 /**
7094 * Whether to show the IME when a hard keyboard is connected. This is a boolean that
7095 * determines if the IME should be shown when a hard keyboard is attached.
7096 * @hide
7097 */
7098 @TestApi
7099 @Readable
7100 @SuppressLint("NoSettingsProvider")
7101 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
7102
7103 /**
7104 * Host name and port for global http proxy. Uses ':' seperator for
7105 * between host and port.
7106 *
7107 * @deprecated Use {@link Global#HTTP_PROXY}
7108 */
7109 @Deprecated
7110 public static final String HTTP_PROXY = Global.HTTP_PROXY;
7111
7112 /**
7113 * Package designated as always-on VPN provider.
7114 *
7115 * @hide
7116 */
7117 public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app";
7118
7119 /**
7120 * Whether to block networking outside of VPN connections while always-on is set.
7121 * @see #ALWAYS_ON_VPN_APP
7122 *
7123 * @hide
7124 */
7125 @Readable
7126 public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown";
7127
7128 /**
7129 * Comma separated list of packages that are allowed to access the network when VPN is in
7130 * lockdown mode but not running.
7131 * @see #ALWAYS_ON_VPN_LOCKDOWN
7132 *
7133 * @hide
7134 */
7135 @Readable(maxTargetSdk = Build.VERSION_CODES.S)
7136 public static final String ALWAYS_ON_VPN_LOCKDOWN_WHITELIST =
7137 "always_on_vpn_lockdown_whitelist";
7138
7139 /**
7140 * Whether applications can be installed for this user via the system's
7141 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
7142 *
7143 * <p>1 = permit app installation via the system package installer intent
7144 * <p>0 = do not allow use of the package installer
7145 * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use
7146 * {@link PackageManager#canRequestPackageInstalls()}
7147 * @see PackageManager#canRequestPackageInstalls()
7148 */
7149 @Deprecated
7150 @Readable
7151 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
7152
7153 /**
7154 * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that
7155 * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it
7156 * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES}
7157 * on behalf of the profile owner if needed to make the change transparent for profile
7158 * owners.
7159 *
7160 * @hide
7161 */
7162 @Readable
7163 public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED =
7164 "unknown_sources_default_reversed";
7165
7166 /**
7167 * Comma-separated list of location providers that are enabled. Do not rely on this value
7168 * being present or correct, or on ContentObserver notifications on the corresponding Uri.
7169 *
7170 * @deprecated This setting no longer exists from Android S onwards as it no longer is
7171 * capable of realistically reflecting location settings. Use {@link
7172 * LocationManager#isProviderEnabled(String)} or {@link LocationManager#isLocationEnabled()}
7173 * instead.
7174 */
7175 @Deprecated
7176 @Readable
7177 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
7178
7179 /**
7180 * The current location mode of the device. Do not rely on this value being present or on
7181 * ContentObserver notifications on the corresponding Uri.
7182 *
7183 * @deprecated The preferred methods for checking location mode and listening for changes
7184 * are via {@link LocationManager#isLocationEnabled()} and
7185 * {@link LocationManager#MODE_CHANGED_ACTION}.
7186 */
7187 @Deprecated
7188 @Readable
7189 public static final String LOCATION_MODE = "location_mode";
7190
7191 /**
7192 * The App or module that changes the location mode.
7193 * @hide
7194 */
7195 @Readable
7196 public static final String LOCATION_CHANGER = "location_changer";
7197
7198 /**
7199 * The location changer is unknown or unable to detect.
7200 * @hide
7201 */
7202 public static final int LOCATION_CHANGER_UNKNOWN = 0;
7203
7204 /**
7205 * Location settings in system settings.
7206 * @hide
7207 */
7208 public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1;
7209
7210 /**
7211 * The location icon in drop down notification drawer.
7212 * @hide
7213 */
7214 public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2;
7215
7216 /**
7217 * Location mode is off.
7218 */
7219 public static final int LOCATION_MODE_OFF = 0;
7220
7221 /**
7222 * This mode no longer has any distinct meaning, but is interpreted as the location mode is
7223 * on.
7224 *
7225 * @deprecated See {@link #LOCATION_MODE}.
7226 */
7227 @Deprecated
7228 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
7229
7230 /**
7231 * This mode no longer has any distinct meaning, but is interpreted as the location mode is
7232 * on.
7233 *
7234 * @deprecated See {@link #LOCATION_MODE}.
7235 */
7236 @Deprecated
7237 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
7238
7239 /**
7240 * This mode no longer has any distinct meaning, but is interpreted as the location mode is
7241 * on.
7242 *
7243 * @deprecated See {@link #LOCATION_MODE}.
7244 */
7245 @Deprecated
7246 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
7247
7248 /**
7249 * Location mode is on.
7250 *
7251 * @hide
7252 */
7253 @SystemApi
7254 public static final int LOCATION_MODE_ON = LOCATION_MODE_HIGH_ACCURACY;
7255
7256 /**
7257 * The current location time zone detection enabled state for the user.
7258 *
7259 * See {@link android.app.time.TimeManager#getTimeZoneCapabilitiesAndConfig} for access.
7260 * See {@link android.app.time.TimeManager#updateTimeZoneConfiguration} to update.
7261 * @hide
7262 */
7263 public static final String LOCATION_TIME_ZONE_DETECTION_ENABLED =
7264 "location_time_zone_detection_enabled";
7265
7266 /**
7267 * The accuracy in meters used for coarsening location for clients with only the coarse
7268 * location permission.
7269 *
7270 * @hide
7271 */
7272 @Readable
7273 public static final String LOCATION_COARSE_ACCURACY_M = "locationCoarseAccuracy";
7274
7275 /**
7276 * Whether or not to show display system location accesses.
7277 * @hide
7278 */
7279 public static final String LOCATION_SHOW_SYSTEM_OPS = "locationShowSystemOps";
7280
7281 /**
7282 * A flag containing settings used for biometric weak
7283 * @hide
7284 */
7285 @Deprecated
7286 @Readable
7287 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
7288 "lock_biometric_weak_flags";
7289
7290 /**
7291 * Whether lock-to-app will lock the keyguard when exiting.
7292 * @hide
7293 */
7294 @Readable
7295 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
7296
7297 /**
7298 * Whether autolock is enabled (0 = false, 1 = true)
7299 *
7300 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
7301 * level of the keyguard. Accessing this setting from an app that is targeting
7302 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
7303 */
7304 @Deprecated
7305 @Readable
7306 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
7307
7308 /**
7309 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
7310 *
7311 * @deprecated Accessing this setting from an app that is targeting
7312 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
7313 */
7314 @Deprecated
7315 @Readable
7316 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
7317
7318 /**
7319 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
7320 * true)
7321 *
7322 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
7323 * lockscreen uses
7324 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
7325 * Accessing this setting from an app that is targeting
7326 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
7327 */
7328 @Deprecated
7329 @Readable
7330 public static final String
7331 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
7332
7333 /**
7334 * This preference allows the device to be locked given time after screen goes off,
7335 * subject to current DeviceAdmin policy limits.
7336 * @hide
7337 */
7338 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
7339 @Readable
7340 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
7341
7342
7343 /**
7344 * This preference contains the string that shows for owner info on LockScreen.
7345 * @hide
7346 * @deprecated
7347 */
7348 @Deprecated
7349 @Readable
7350 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
7351
7352 /**
7353 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
7354 * @hide
7355 */
7356 @Deprecated
7357 @Readable
7358 public static final String LOCK_SCREEN_APPWIDGET_IDS =
7359 "lock_screen_appwidget_ids";
7360
7361 /**
7362 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
7363 * @hide
7364 */
7365 @Deprecated
7366 @Readable
7367 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
7368 "lock_screen_fallback_appwidget_id";
7369
7370 /**
7371 * Index of the lockscreen appwidget to restore, -1 if none.
7372 * @hide
7373 */
7374 @Deprecated
7375 @Readable
7376 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
7377 "lock_screen_sticky_appwidget";
7378
7379 /**
7380 * This preference enables showing the owner info on LockScreen.
7381 * @hide
7382 * @deprecated
7383 */
7384 @Deprecated
7385 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
7386 @Readable
7387 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
7388 "lock_screen_owner_info_enabled";
7389
7390 /**
7391 * Indicates whether the user has allowed notifications to be shown atop a securely locked
7392 * screen in their full "private" form (same as when the device is unlocked).
7393 * <p>
7394 * Type: int (0 for false, 1 for true)
7395 *
7396 * @hide
7397 */
7398 @SystemApi
7399 @Readable
7400 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
7401 "lock_screen_allow_private_notifications";
7402
7403 /**
7404 * When set by a user, allows notification remote input atop a securely locked screen
7405 * without having to unlock
7406 * @hide
7407 */
7408 @Readable
7409 public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT =
7410 "lock_screen_allow_remote_input";
7411
7412 /**
7413 * Indicates which clock face to show on lock screen and AOD formatted as a serialized
7414 * {@link org.json.JSONObject} with the format:
7415 * {"clock": id, "_applied_timestamp": timestamp}
7416 * @hide
7417 */
7418 @Readable
7419 public static final String LOCK_SCREEN_CUSTOM_CLOCK_FACE = "lock_screen_custom_clock_face";
7420
7421 /**
7422 * Indicates which clock face to show on lock screen and AOD while docked.
7423 * @hide
7424 */
7425 @Readable
7426 public static final String DOCKED_CLOCK_FACE = "docked_clock_face";
7427
7428 /**
7429 * Set by the system to track if the user needs to see the call to action for
7430 * the lockscreen notification policy.
7431 * @hide
7432 */
7433 @Readable
7434 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
7435 "show_note_about_notification_hiding";
7436
7437 /**
7438 * Set to 1 by the system after trust agents have been initialized.
7439 * @hide
7440 */
7441 @Readable
7442 public static final String TRUST_AGENTS_INITIALIZED =
7443 "trust_agents_initialized";
7444
7445 /**
7446 * Set to 1 by the system after the list of known trust agents have been initialized.
7447 * @hide
7448 */
7449 public static final String KNOWN_TRUST_AGENTS_INITIALIZED =
7450 "known_trust_agents_initialized";
7451
7452 /**
7453 * The Logging ID (a unique 64-bit value) as a hex string.
7454 * Used as a pseudonymous identifier for logging.
7455 * @deprecated This identifier is poorly initialized and has
7456 * many collisions. It should not be used.
7457 */
7458 @Deprecated
7459 @Readable
7460 public static final String LOGGING_ID = "logging_id";
7461
7462 /**
7463 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
7464 */
7465 @Deprecated
7466 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
7467
7468 /**
7469 * No longer supported.
7470 */
7471 @Readable
7472 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
7473
7474 /**
7475 * No longer supported.
7476 */
7477 @Readable
7478 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
7479
7480 /**
7481 * No longer supported.
7482 */
7483 @Readable
7484 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
7485
7486 /**
7487 * Settings classname to launch when Settings is clicked from All
7488 * Applications. Needed because of user testing between the old
7489 * and new Settings apps.
7490 */
7491 // TODO: 881807
7492 @Readable
7493 public static final String SETTINGS_CLASSNAME = "settings_classname";
7494
7495 /**
7496 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
7497 */
7498 @Deprecated
7499 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
7500
7501 /**
7502 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
7503 */
7504 @Deprecated
7505 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
7506
7507 /**
7508 * If accessibility is enabled.
7509 */
7510 @Readable
7511 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
7512
7513 /**
7514 * Whether select sound track with audio description by default.
7515 * @hide
7516 */
7517 public static final String ENABLED_ACCESSIBILITY_AUDIO_DESCRIPTION_BY_DEFAULT =
7518 "enabled_accessibility_audio_description_by_default";
7519
7520 /**
7521 * Setting specifying if the accessibility shortcut is enabled.
7522 * @hide
7523 */
7524 @Readable
7525 public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN =
7526 "accessibility_shortcut_on_lock_screen";
7527
7528 /**
7529 * Setting specifying if the accessibility shortcut dialog has been shown to this user.
7530 * @hide
7531 */
7532 @Readable
7533 public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN =
7534 "accessibility_shortcut_dialog_shown";
7535
7536 /**
7537 * Setting specifying if the timeout restriction
7538 * {@link ViewConfiguration#getAccessibilityShortcutKeyTimeout()}
7539 * of the accessibility shortcut dialog is skipped.
7540 *
7541 * @hide
7542 */
7543 public static final String SKIP_ACCESSIBILITY_SHORTCUT_DIALOG_TIMEOUT_RESTRICTION =
7544 "skip_accessibility_shortcut_dialog_timeout_restriction";
7545
7546 /**
7547 * Setting specifying the accessibility services, accessibility shortcut targets,
7548 * or features to be toggled via the accessibility shortcut.
7549 *
7550 * <p> This is a colon-separated string list which contains the flattened
7551 * {@link ComponentName} and the class name of a system class implementing a supported
7552 * accessibility feature.
7553 * @hide
7554 */
7555 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
7556 @TestApi
7557 @Readable
7558 public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE =
7559 "accessibility_shortcut_target_service";
7560
7561 /**
7562 * Setting specifying the accessibility service or feature to be toggled via the
7563 * accessibility button in the navigation bar. This is either a flattened
7564 * {@link ComponentName} or the class name of a system class implementing a supported
7565 * accessibility feature.
7566 * @hide
7567 */
7568 @Readable
7569 public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT =
7570 "accessibility_button_target_component";
7571
7572 /**
7573 * Setting specifying the accessibility services, accessibility shortcut targets,
7574 * or features to be toggled via the accessibility button in the navigation bar.
7575 *
7576 * <p> This is a colon-separated string list which contains the flattened
7577 * {@link ComponentName} and the class name of a system class implementing a supported
7578 * accessibility feature.
7579 * @hide
7580 */
7581 @Readable
7582 public static final String ACCESSIBILITY_BUTTON_TARGETS = "accessibility_button_targets";
7583
7584 /**
7585 * The system class name of magnification controller which is a target to be toggled via
7586 * accessibility shortcut or accessibility button.
7587 *
7588 * @hide
7589 */
7590 @Readable
7591 public static final String ACCESSIBILITY_SHORTCUT_TARGET_MAGNIFICATION_CONTROLLER =
7592 "com.android.server.accessibility.MagnificationController";
7593
7594 /**
7595 * If touch exploration is enabled.
7596 */
7597 @Readable
7598 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
7599
7600 /**
7601 * List of the enabled accessibility providers.
7602 */
7603 @Readable
7604 public static final String ENABLED_ACCESSIBILITY_SERVICES =
7605 "enabled_accessibility_services";
7606
7607 /**
7608 * List of the notified non-accessibility category accessibility services.
7609 *
7610 * @hide
7611 */
7612 @Readable
7613 public static final String NOTIFIED_NON_ACCESSIBILITY_CATEGORY_SERVICES =
7614 "notified_non_accessibility_category_services";
7615
7616 /**
7617 * List of the accessibility services to which the user has granted
7618 * permission to put the device into touch exploration mode.
7619 *
7620 * @hide
7621 */
7622 @Readable
7623 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
7624 "touch_exploration_granted_accessibility_services";
7625
7626 /**
7627 * Is talkback service enabled or not. 0 == no, 1 == yes
7628 *
7629 * @hide
7630 */
7631 public static final String WEAR_TALKBACK_ENABLED = "wear_talkback_enabled";
7632
7633 /**
7634 * Whether the Global Actions Panel is enabled.
7635 * @hide
7636 */
7637 @Readable
7638 public static final String GLOBAL_ACTIONS_PANEL_ENABLED = "global_actions_panel_enabled";
7639
7640 /**
7641 * Whether the Global Actions Panel can be toggled on or off in Settings.
7642 * @hide
7643 */
7644 @Readable
7645 public static final String GLOBAL_ACTIONS_PANEL_AVAILABLE =
7646 "global_actions_panel_available";
7647
7648 /**
7649 * Enables debug mode for the Global Actions Panel.
7650 * @hide
7651 */
7652 @Readable
7653 public static final String GLOBAL_ACTIONS_PANEL_DEBUG_ENABLED =
7654 "global_actions_panel_debug_enabled";
7655
7656 /**
7657 * Whether the hush gesture has ever been used
7658 * @hide
7659 */
7660 @SystemApi
7661 @Readable
7662 public static final String HUSH_GESTURE_USED = "hush_gesture_used";
7663
7664 /**
7665 * Number of times the user has manually clicked the ringer toggle
7666 * @hide
7667 */
7668 @Readable
7669 public static final String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count";
7670
7671 /**
7672 * Whether to play a sound for charging events.
7673 * @hide
7674 */
7675 @Readable
7676 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
7677
7678 /**
7679 * Whether to vibrate for charging events.
7680 * @hide
7681 */
7682 @Readable
7683 public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled";
7684
7685 /**
7686 * If 0, turning on dnd manually will last indefinitely.
7687 * Else if non-negative, turning on dnd manually will last for this many minutes.
7688 * Else (if negative), turning on dnd manually will surface a dialog that prompts
7689 * user to specify a duration.
7690 * @hide
7691 */
7692 @Readable
7693 public static final String ZEN_DURATION = "zen_duration";
7694
7695 /** @hide */ public static final int ZEN_DURATION_PROMPT = -1;
7696 /** @hide */ public static final int ZEN_DURATION_FOREVER = 0;
7697
7698 /**
7699 * If nonzero, will show the zen upgrade notification when the user toggles DND on/off.
7700 * @hide
7701 */
7702 @Readable
7703 public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";
7704
7705 /**
7706 * If nonzero, will show the zen update settings suggestion.
7707 * @hide
7708 */
7709 @Readable
7710 public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion";
7711
7712 /**
7713 * If nonzero, zen has not been updated to reflect new changes.
7714 * @hide
7715 */
7716 @Readable
7717 public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated";
7718
7719 /**
7720 * If nonzero, zen setting suggestion has been viewed by user
7721 * @hide
7722 */
7723 @Readable
7724 public static final String ZEN_SETTINGS_SUGGESTION_VIEWED =
7725 "zen_settings_suggestion_viewed";
7726
7727 /**
7728 * Whether the in call notification is enabled to play sound during calls. The value is
7729 * boolean (1 or 0).
7730 * @hide
7731 */
7732 @Readable
7733 public static final String IN_CALL_NOTIFICATION_ENABLED = "in_call_notification_enabled";
7734
7735 /**
7736 * Uri of the slice that's presented on the keyguard.
7737 * Defaults to a slice with the date and next alarm.
7738 *
7739 * @hide
7740 */
7741 @Readable
7742 public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri";
7743
7744 /**
7745 * The adjustment in font weight. This is used to draw text in bold.
7746 *
7747 * <p> This value can be negative. To display bolded text, the adjustment used is 300,
7748 * which is the difference between
7749 * {@link android.graphics.fonts.FontStyle#FONT_WEIGHT_NORMAL} and
7750 * {@link android.graphics.fonts.FontStyle#FONT_WEIGHT_BOLD}.
7751 *
7752 * @hide
7753 */
7754 @Readable
7755 public static final String FONT_WEIGHT_ADJUSTMENT = "font_weight_adjustment";
7756
7757 /**
7758 * Whether to speak passwords while in accessibility mode.
7759 *
7760 * @deprecated The speaking of passwords is controlled by individual accessibility services.
7761 * Apps should ignore this setting and provide complete information to accessibility
7762 * at all times, which was the behavior when this value was {@code true}.
7763 */
7764 @Deprecated
7765 @Readable
7766 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
7767
7768 /**
7769 * Whether to draw text with high contrast while in accessibility mode.
7770 *
7771 * @hide
7772 */
7773 @Readable
7774 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
7775 "high_text_contrast_enabled";
7776
7777 /**
7778 * The color contrast, float in [-1, 1], 1 being the highest contrast.
7779 *
7780 * @hide
7781 */
7782 public static final String CONTRAST_LEVEL = "contrast_level";
7783
7784 /**
7785 * Setting that specifies whether the display magnification is enabled via a system-wide
7786 * triple tap gesture. Display magnifications allows the user to zoom in the display content
7787 * and is targeted to low vision users. The current magnification scale is controlled by
7788 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
7789 *
7790 * @hide
7791 */
7792 @UnsupportedAppUsage
7793 @TestApi
7794 @Readable
7795 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
7796 "accessibility_display_magnification_enabled";
7797
7798 /**
7799 * Setting that specifies whether the display magnification is enabled via a shortcut
7800 * affordance within the system's navigation area. Display magnifications allows the user to
7801 * zoom in the display content and is targeted to low vision users. The current
7802 * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
7803 *
7804 * @deprecated Use {@link #ACCESSIBILITY_BUTTON_TARGETS} instead.
7805 * {@link #ACCESSIBILITY_BUTTON_TARGETS} holds the magnification system class name
7806 * when navigation bar magnification is enabled.
7807 * @hide
7808 */
7809 @SystemApi
7810 @Readable
7811 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED =
7812 "accessibility_display_magnification_navbar_enabled";
7813
7814 /**
7815 * Setting that specifies what the display magnification scale is.
7816 * Display magnifications allows the user to zoom in the display
7817 * content and is targeted to low vision users. Whether a display
7818 * magnification is performed is controlled by
7819 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and
7820 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED}
7821 *
7822 * @hide
7823 */
7824 @Readable
7825 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
7826 "accessibility_display_magnification_scale";
7827
7828 /**
7829 * Unused mangnification setting
7830 *
7831 * @hide
7832 * @deprecated
7833 */
7834 @Deprecated
7835 @Readable
7836 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
7837 "accessibility_display_magnification_auto_update";
7838
7839 /**
7840 * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be
7841 * modified from an AccessibilityService using the SoftKeyboardController.
7842 *
7843 * @hide
7844 */
7845 @Readable
7846 public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE =
7847 "accessibility_soft_keyboard_mode";
7848
7849 /**
7850 * Default soft keyboard behavior.
7851 *
7852 * @hide
7853 */
7854 public static final int SHOW_MODE_AUTO = 0;
7855
7856 /**
7857 * Soft keyboard is never shown.
7858 *
7859 * @hide
7860 */
7861 public static final int SHOW_MODE_HIDDEN = 1;
7862
7863 /**
7864 * Setting that specifies whether timed text (captions) should be
7865 * displayed in video content. Text display properties are controlled by
7866 * the following settings:
7867 * <ul>
7868 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
7869 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
7870 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
7871 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
7872 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
7873 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
7874 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
7875 * </ul>
7876 *
7877 * @hide
7878 */
7879 @Readable
7880 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
7881 "accessibility_captioning_enabled";
7882
7883 /**
7884 * Setting that specifies the language for captions as a locale string,
7885 * e.g. en_US.
7886 *
7887 * @see java.util.Locale#toString
7888 * @hide
7889 */
7890 @Readable
7891 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
7892 "accessibility_captioning_locale";
7893
7894 /**
7895 * Integer property that specifies the preset style for captions, one
7896 * of:
7897 * <ul>
7898 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
7899 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
7900 * </ul>
7901 *
7902 * @see java.util.Locale#toString
7903 * @hide
7904 */
7905 @Readable
7906 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
7907 "accessibility_captioning_preset";
7908
7909 /**
7910 * Integer property that specifes the background color for captions as a
7911 * packed 32-bit color.
7912 *
7913 * @see android.graphics.Color#argb
7914 * @hide
7915 */
7916 @Readable
7917 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
7918 "accessibility_captioning_background_color";
7919
7920 /**
7921 * Integer property that specifes the foreground color for captions as a
7922 * packed 32-bit color.
7923 *
7924 * @see android.graphics.Color#argb
7925 * @hide
7926 */
7927 @Readable
7928 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
7929 "accessibility_captioning_foreground_color";
7930
7931 /**
7932 * Integer property that specifes the edge type for captions, one of:
7933 * <ul>
7934 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
7935 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
7936 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
7937 * </ul>
7938 *
7939 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
7940 * @hide
7941 */
7942 @Readable
7943 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
7944 "accessibility_captioning_edge_type";
7945
7946 /**
7947 * Integer property that specifes the edge color for captions as a
7948 * packed 32-bit color.
7949 *
7950 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
7951 * @see android.graphics.Color#argb
7952 * @hide
7953 */
7954 @Readable
7955 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
7956 "accessibility_captioning_edge_color";
7957
7958 /**
7959 * Integer property that specifes the window color for captions as a
7960 * packed 32-bit color.
7961 *
7962 * @see android.graphics.Color#argb
7963 * @hide
7964 */
7965 @Readable
7966 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
7967 "accessibility_captioning_window_color";
7968
7969 /**
7970 * String property that specifies the typeface for captions, one of:
7971 * <ul>
7972 * <li>DEFAULT
7973 * <li>MONOSPACE
7974 * <li>SANS_SERIF
7975 * <li>SERIF
7976 * </ul>
7977 *
7978 * @see android.graphics.Typeface
7979 * @hide
7980 */
7981 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
7982 @Readable
7983 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
7984 "accessibility_captioning_typeface";
7985
7986 /**
7987 * Floating point property that specifies font scaling for captions.
7988 *
7989 * @hide
7990 */
7991 @Readable
7992 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
7993 "accessibility_captioning_font_scale";
7994
7995 /**
7996 * Setting that specifies whether display color inversion is enabled.
7997 */
7998 @Readable
7999 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
8000 "accessibility_display_inversion_enabled";
8001
8002 /**
8003 * Setting that specifies whether display color space adjustment is
8004 * enabled.
8005 *
8006 * @hide
8007 */
8008 @UnsupportedAppUsage
8009 @Readable
8010 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
8011 "accessibility_display_daltonizer_enabled";
8012
8013 /**
8014 * Integer property that specifies the type of color space adjustment to
8015 * perform. Valid values are defined in AccessibilityManager and Settings arrays.xml:
8016 * - AccessibilityManager.DALTONIZER_DISABLED = -1
8017 * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0
8018 * - <item>@string/daltonizer_mode_protanomaly</item> = 11
8019 * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY and
8020 * <item>@string/daltonizer_mode_deuteranomaly</item> = 12
8021 * - <item>@string/daltonizer_mode_tritanomaly</item> = 13
8022 *
8023 * @hide
8024 */
8025 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8026 @Readable
8027 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
8028 "accessibility_display_daltonizer";
8029
8030 /**
8031 * Setting that specifies whether automatic click when the mouse pointer stops moving is
8032 * enabled.
8033 *
8034 * @hide
8035 */
8036 @UnsupportedAppUsage
8037 @Readable
8038 public static final String ACCESSIBILITY_AUTOCLICK_ENABLED =
8039 "accessibility_autoclick_enabled";
8040
8041 /**
8042 * Integer setting specifying amount of time in ms the mouse pointer has to stay still
8043 * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set.
8044 *
8045 * @see #ACCESSIBILITY_AUTOCLICK_ENABLED
8046 * @hide
8047 */
8048 @Readable
8049 public static final String ACCESSIBILITY_AUTOCLICK_DELAY =
8050 "accessibility_autoclick_delay";
8051
8052 /**
8053 * Whether or not larger size icons are used for the pointer of mouse/trackpad for
8054 * accessibility.
8055 * (0 = false, 1 = true)
8056 * @hide
8057 */
8058 @UnsupportedAppUsage
8059 @Readable
8060 public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
8061 "accessibility_large_pointer_icon";
8062
8063 /**
8064 * The timeout for considering a press to be a long press in milliseconds.
8065 * @hide
8066 */
8067 @UnsupportedAppUsage
8068 @Readable
8069 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
8070
8071 /**
8072 * The duration in milliseconds between the first tap's up event and the second tap's
8073 * down event for an interaction to be considered part of the same multi-press.
8074 * @hide
8075 */
8076 @Readable
8077 public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout";
8078
8079 /**
8080 * Setting that specifies recommended timeout in milliseconds for controls
8081 * which don't need user's interactions.
8082 *
8083 * @hide
8084 */
8085 @Readable
8086 public static final String ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS =
8087 "accessibility_non_interactive_ui_timeout_ms";
8088
8089 /**
8090 * Setting that specifies recommended timeout in milliseconds for controls
8091 * which need user's interactions.
8092 *
8093 * @hide
8094 */
8095 @Readable
8096 public static final String ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS =
8097 "accessibility_interactive_ui_timeout_ms";
8098
8099
8100 /**
8101 * Setting that specifies whether Reduce Bright Colors, or brightness dimming by color
8102 * adjustment, is enabled.
8103 *
8104 * @hide
8105 */
8106 public static final String REDUCE_BRIGHT_COLORS_ACTIVATED =
8107 "reduce_bright_colors_activated";
8108
8109 /**
8110 * Setting that specifies the level of Reduce Bright Colors in intensity. The range is
8111 * [0, 100].
8112 *
8113 * @hide
8114 */
8115 public static final String REDUCE_BRIGHT_COLORS_LEVEL =
8116 "reduce_bright_colors_level";
8117
8118 /**
8119 * Setting that specifies whether Reduce Bright Colors should persist across reboots.
8120 *
8121 * @hide
8122 */
8123 public static final String REDUCE_BRIGHT_COLORS_PERSIST_ACROSS_REBOOTS =
8124 "reduce_bright_colors_persist_across_reboots";
8125
8126 /**
8127 * List of the enabled print services.
8128 *
8129 * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade
8130 * from pre-N.
8131 *
8132 * @hide
8133 */
8134 @UnsupportedAppUsage
8135 @Readable
8136 public static final String ENABLED_PRINT_SERVICES =
8137 "enabled_print_services";
8138
8139 /**
8140 * List of the disabled print services.
8141 *
8142 * @hide
8143 */
8144 @TestApi
8145 @Readable
8146 public static final String DISABLED_PRINT_SERVICES =
8147 "disabled_print_services";
8148
8149 /**
8150 * The saved value for WindowManagerService.setForcedDisplayDensity()
8151 * formatted as a single integer representing DPI. If unset, then use
8152 * the real display density.
8153 *
8154 * @hide
8155 */
8156 @Readable
8157 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
8158
8159 /**
8160 * Setting to always use the default text-to-speech settings regardless
8161 * of the application settings.
8162 * 1 = override application settings,
8163 * 0 = use application settings (if specified).
8164 *
8165 * @deprecated The value of this setting is no longer respected by
8166 * the framework text to speech APIs as of the Ice Cream Sandwich release.
8167 */
8168 @Deprecated
8169 @Readable
8170 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
8171
8172 /**
8173 * Default text-to-speech engine speech rate. 100 = 1x
8174 */
8175 @Readable
8176 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
8177
8178 /**
8179 * Default text-to-speech engine pitch. 100 = 1x
8180 */
8181 @Readable
8182 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
8183
8184 /**
8185 * Default text-to-speech engine.
8186 */
8187 @Readable
8188 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
8189
8190 /**
8191 * Default text-to-speech language.
8192 *
8193 * @deprecated this setting is no longer in use, as of the Ice Cream
8194 * Sandwich release. Apps should never need to read this setting directly,
8195 * instead can query the TextToSpeech framework classes for the default
8196 * locale. {@link TextToSpeech#getLanguage()}.
8197 */
8198 @Deprecated
8199 @Readable
8200 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
8201
8202 /**
8203 * Default text-to-speech country.
8204 *
8205 * @deprecated this setting is no longer in use, as of the Ice Cream
8206 * Sandwich release. Apps should never need to read this setting directly,
8207 * instead can query the TextToSpeech framework classes for the default
8208 * locale. {@link TextToSpeech#getLanguage()}.
8209 */
8210 @Deprecated
8211 @Readable
8212 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
8213
8214 /**
8215 * Default text-to-speech locale variant.
8216 *
8217 * @deprecated this setting is no longer in use, as of the Ice Cream
8218 * Sandwich release. Apps should never need to read this setting directly,
8219 * instead can query the TextToSpeech framework classes for the
8220 * locale that is in use {@link TextToSpeech#getLanguage()}.
8221 */
8222 @Deprecated
8223 @Readable
8224 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
8225
8226 /**
8227 * Stores the default tts locales on a per engine basis. Stored as
8228 * a comma seperated list of values, each value being of the form
8229 * {@code engine_name:locale} for example,
8230 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
8231 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
8232 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
8233 * setting directly, and can query the TextToSpeech framework classes
8234 * for the locale that is in use.
8235 *
8236 * @hide
8237 */
8238 @Readable
8239 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
8240
8241 /**
8242 * Space delimited list of plugin packages that are enabled.
8243 */
8244 @Readable
8245 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
8246
8247 /**
8248 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
8249 * instead.
8250 */
8251 @Deprecated
8252 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
8253 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
8254
8255 /**
8256 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
8257 * instead.
8258 */
8259 @Deprecated
8260 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
8261 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
8262
8263 /**
8264 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
8265 * instead.
8266 */
8267 @Deprecated
8268 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
8269 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
8270
8271 /**
8272 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
8273 * instead.
8274 */
8275 @Deprecated
8276 public static final String WIFI_ON = Global.WIFI_ON;
8277
8278 /**
8279 * The acceptable packet loss percentage (range 0 - 100) before trying
8280 * another AP on the same network.
8281 * @deprecated This setting is not used.
8282 */
8283 @Deprecated
8284 @Readable
8285 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
8286 "wifi_watchdog_acceptable_packet_loss_percentage";
8287
8288 /**
8289 * The number of access points required for a network in order for the
8290 * watchdog to monitor it.
8291 * @deprecated This setting is not used.
8292 */
8293 @Deprecated
8294 @Readable
8295 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
8296
8297 /**
8298 * The delay between background checks.
8299 * @deprecated This setting is not used.
8300 */
8301 @Deprecated
8302 @Readable
8303 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
8304 "wifi_watchdog_background_check_delay_ms";
8305
8306 /**
8307 * Whether the Wi-Fi watchdog is enabled for background checking even
8308 * after it thinks the user has connected to a good access point.
8309 * @deprecated This setting is not used.
8310 */
8311 @Deprecated
8312 @Readable
8313 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
8314 "wifi_watchdog_background_check_enabled";
8315
8316 /**
8317 * The timeout for a background ping
8318 * @deprecated This setting is not used.
8319 */
8320 @Deprecated
8321 @Readable
8322 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
8323 "wifi_watchdog_background_check_timeout_ms";
8324
8325 /**
8326 * The number of initial pings to perform that *may* be ignored if they
8327 * fail. Again, if these fail, they will *not* be used in packet loss
8328 * calculation. For example, one network always seemed to time out for
8329 * the first couple pings, so this is set to 3 by default.
8330 * @deprecated This setting is not used.
8331 */
8332 @Deprecated
8333 @Readable
8334 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
8335 "wifi_watchdog_initial_ignored_ping_count";
8336
8337 /**
8338 * The maximum number of access points (per network) to attempt to test.
8339 * If this number is reached, the watchdog will no longer monitor the
8340 * initial connection state for the network. This is a safeguard for
8341 * networks containing multiple APs whose DNS does not respond to pings.
8342 * @deprecated This setting is not used.
8343 */
8344 @Deprecated
8345 @Readable
8346 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
8347
8348 /**
8349 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
8350 */
8351 @Deprecated
8352 @Readable
8353 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
8354
8355 /**
8356 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
8357 * @deprecated This setting is not used.
8358 */
8359 @Deprecated
8360 @Readable
8361 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
8362
8363 /**
8364 * The number of pings to test if an access point is a good connection.
8365 * @deprecated This setting is not used.
8366 */
8367 @Deprecated
8368 @Readable
8369 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
8370
8371 /**
8372 * The delay between pings.
8373 * @deprecated This setting is not used.
8374 */
8375 @Deprecated
8376 @Readable
8377 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
8378
8379 /**
8380 * The timeout per ping.
8381 * @deprecated This setting is not used.
8382 */
8383 @Deprecated
8384 @Readable
8385 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
8386
8387 /**
8388 * @deprecated Use
8389 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
8390 */
8391 @Deprecated
8392 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
8393
8394 /**
8395 * @deprecated Use
8396 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
8397 */
8398 @Deprecated
8399 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
8400 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
8401
8402 /**
8403 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
8404 * the receivers of the PendingIntent an opportunity to make a new network request before
8405 * the Network satisfying the request is potentially removed.
8406 *
8407 * @hide
8408 */
8409 @Readable
8410 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
8411 "connectivity_release_pending_intent_delay_ms";
8412
8413 /**
8414 * Whether background data usage is allowed.
8415 *
8416 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
8417 * availability of background data depends on several
8418 * combined factors. When background data is unavailable,
8419 * {@link ConnectivityManager#getActiveNetworkInfo()} will
8420 * now appear disconnected.
8421 */
8422 @Deprecated
8423 @Readable
8424 public static final String BACKGROUND_DATA = "background_data";
8425
8426 /**
8427 * Origins for which browsers should allow geolocation by default.
8428 * The value is a space-separated list of origins.
8429 */
8430 @Readable
8431 public static final String ALLOWED_GEOLOCATION_ORIGINS
8432 = "allowed_geolocation_origins";
8433
8434 /**
8435 * The preferred TTY mode 0 = TTy Off, CDMA default
8436 * 1 = TTY Full
8437 * 2 = TTY HCO
8438 * 3 = TTY VCO
8439 * @hide
8440 */
8441 @Readable
8442 public static final String PREFERRED_TTY_MODE =
8443 "preferred_tty_mode";
8444
8445 /**
8446 * Whether the enhanced voice privacy mode is enabled.
8447 * 0 = normal voice privacy
8448 * 1 = enhanced voice privacy
8449 * @hide
8450 */
8451 @Readable
8452 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
8453
8454 /**
8455 * Whether the TTY mode mode is enabled.
8456 * 0 = disabled
8457 * 1 = enabled
8458 * @hide
8459 */
8460 @Readable
8461 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
8462
8463 /**
8464 * User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT
8465 * calls when supported by the device and carrier. Boolean value.
8466 * 0 = OFF
8467 * 1 = ON
8468 */
8469 @Readable
8470 public static final String RTT_CALLING_MODE = "rtt_calling_mode";
8471
8472 /**
8473 /**
8474 * Controls whether settings backup is enabled.
8475 * Type: int ( 0 = disabled, 1 = enabled )
8476 * @hide
8477 */
8478 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8479 @Readable
8480 public static final String BACKUP_ENABLED = "backup_enabled";
8481
8482 /**
8483 * Controls whether application data is automatically restored from backup
8484 * at install time.
8485 * Type: int ( 0 = disabled, 1 = enabled )
8486 * @hide
8487 */
8488 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8489 @Readable
8490 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
8491
8492 /**
8493 * Indicates whether settings backup has been fully provisioned.
8494 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
8495 * @hide
8496 */
8497 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8498 @Readable
8499 public static final String BACKUP_PROVISIONED = "backup_provisioned";
8500
8501 /**
8502 * Component of the transport to use for backup/restore.
8503 * @hide
8504 */
8505 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8506 @Readable
8507 public static final String BACKUP_TRANSPORT = "backup_transport";
8508
8509 /**
8510 * Indicates the version for which the setup wizard was last shown. The version gets
8511 * bumped for each release when there is new setup information to show.
8512 *
8513 * @hide
8514 */
8515 @SystemApi
8516 @Readable
8517 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
8518
8519 /**
8520 * The interval in milliseconds after which Wi-Fi is considered idle.
8521 * When idle, it is possible for the device to be switched from Wi-Fi to
8522 * the mobile data network.
8523 * @hide
8524 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
8525 * instead.
8526 */
8527 @Deprecated
8528 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
8529
8530 /**
8531 * The global search provider chosen by the user (if multiple global
8532 * search providers are installed). This will be the provider returned
8533 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
8534 * installed. This setting is stored as a flattened component name as
8535 * per {@link ComponentName#flattenToString()}.
8536 *
8537 * @hide
8538 */
8539 @Readable
8540 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
8541 "search_global_search_activity";
8542
8543 /**
8544 * The number of promoted sources in GlobalSearch.
8545 * @hide
8546 */
8547 @Readable
8548 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
8549 /**
8550 * The maximum number of suggestions returned by GlobalSearch.
8551 * @hide
8552 */
8553 @Readable
8554 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
8555 /**
8556 * The number of suggestions GlobalSearch will ask each non-web search source for.
8557 * @hide
8558 */
8559 @Readable
8560 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
8561 /**
8562 * The number of suggestions the GlobalSearch will ask the web search source for.
8563 * @hide
8564 */
8565 @Readable
8566 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
8567 "search_web_results_override_limit";
8568 /**
8569 * The number of milliseconds that GlobalSearch will wait for suggestions from
8570 * promoted sources before continuing with all other sources.
8571 * @hide
8572 */
8573 @Readable
8574 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
8575 "search_promoted_source_deadline_millis";
8576 /**
8577 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
8578 * @hide
8579 */
8580 @Readable
8581 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
8582 /**
8583 * The maximum number of milliseconds that GlobalSearch shows the previous results
8584 * after receiving a new query.
8585 * @hide
8586 */
8587 @Readable
8588 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
8589 /**
8590 * The maximum age of log data used for shortcuts in GlobalSearch.
8591 * @hide
8592 */
8593 @Readable
8594 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
8595 /**
8596 * The maximum age of log data used for source ranking in GlobalSearch.
8597 * @hide
8598 */
8599 @Readable
8600 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
8601 "search_max_source_event_age_millis";
8602 /**
8603 * The minimum number of impressions needed to rank a source in GlobalSearch.
8604 * @hide
8605 */
8606 @Readable
8607 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
8608 "search_min_impressions_for_source_ranking";
8609 /**
8610 * The minimum number of clicks needed to rank a source in GlobalSearch.
8611 * @hide
8612 */
8613 @Readable
8614 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
8615 "search_min_clicks_for_source_ranking";
8616 /**
8617 * The maximum number of shortcuts shown by GlobalSearch.
8618 * @hide
8619 */
8620 @Readable
8621 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
8622 /**
8623 * The size of the core thread pool for suggestion queries in GlobalSearch.
8624 * @hide
8625 */
8626 @Readable
8627 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
8628 "search_query_thread_core_pool_size";
8629 /**
8630 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
8631 * @hide
8632 */
8633 @Readable
8634 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
8635 "search_query_thread_max_pool_size";
8636 /**
8637 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
8638 * @hide
8639 */
8640 @Readable
8641 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
8642 "search_shortcut_refresh_core_pool_size";
8643 /**
8644 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
8645 * @hide
8646 */
8647 @Readable
8648 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
8649 "search_shortcut_refresh_max_pool_size";
8650 /**
8651 * The maximun time that excess threads in the GlobalSeach thread pools will
8652 * wait before terminating.
8653 * @hide
8654 */
8655 @Readable
8656 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
8657 "search_thread_keepalive_seconds";
8658 /**
8659 * The maximum number of concurrent suggestion queries to each source.
8660 * @hide
8661 */
8662 @Readable
8663 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
8664 "search_per_source_concurrent_query_limit";
8665
8666 /**
8667 * Whether or not alert sounds are played on StorageManagerService events.
8668 * (0 = false, 1 = true)
8669 * @hide
8670 */
8671 @Readable
8672 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
8673
8674 /**
8675 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
8676 * @hide
8677 */
8678 @Readable
8679 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
8680
8681 /**
8682 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
8683 * @hide
8684 */
8685 @Readable
8686 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
8687
8688 /**
8689 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
8690 * @hide
8691 */
8692 @Readable
8693 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
8694
8695 /**
8696 * If nonzero, ANRs in invisible background processes bring up a dialog.
8697 * Otherwise, the process will be silently killed.
8698 *
8699 * Also prevents ANRs and crash dialogs from being suppressed.
8700 * @hide
8701 */
8702 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8703 @TestApi
8704 @Readable
8705 @SuppressLint("NoSettingsProvider")
8706 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
8707
8708 /**
8709 * If nonzero, crashes in foreground processes will bring up a dialog.
8710 * Otherwise, the process will be silently killed.
8711 * @hide
8712 */
8713 @TestApi
8714 @Readable
8715 @SuppressLint("NoSettingsProvider")
8716 public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION =
8717 "show_first_crash_dialog_dev_option";
8718
8719 /**
8720 * The {@link ComponentName} string of the service to be used as the voice recognition
8721 * service.
8722 *
8723 * @hide
8724 */
8725 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8726 @Readable
8727 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
8728
8729 /**
8730 * The {@link ComponentName} string of the selected spell checker service which is
8731 * one of the services managed by the text service manager.
8732 *
8733 * @hide
8734 */
8735 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8736 @TestApi
8737 @Readable
8738 @SuppressLint("NoSettingsProvider")
8739 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
8740
8741 /**
8742 * {@link android.view.textservice.SpellCheckerSubtype#hashCode()} of the selected subtype
8743 * of the selected spell checker service which is one of the services managed by the text
8744 * service manager.
8745 *
8746 * @hide
8747 */
8748 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8749 @TestApi
8750 @Readable
8751 @SuppressLint("NoSettingsProvider")
8752 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
8753 "selected_spell_checker_subtype";
8754
8755 /**
8756 * Whether spell checker is enabled or not.
8757 *
8758 * @hide
8759 */
8760 @Readable
8761 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
8762
8763 /**
8764 * What happens when the user presses the Power button while in-call
8765 * and the screen is on.<br/>
8766 * <b>Values:</b><br/>
8767 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
8768 * 2 - The Power button hangs up the current call.<br/>
8769 *
8770 * @hide
8771 */
8772 @UnsupportedAppUsage
8773 @Readable
8774 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
8775
8776 /**
8777 * Whether the user allows minimal post processing or not.
8778 *
8779 * <p>Values:
8780 * 0 - Not allowed. Any preferences set through the Window.setPreferMinimalPostProcessing
8781 * API will be ignored.
8782 * 1 - Allowed. Any preferences set through the Window.setPreferMinimalPostProcessing API
8783 * will be respected and the appropriate signals will be sent to display.
8784 * (Default behaviour)
8785 *
8786 * @hide
8787 */
8788 @Readable
8789 public static final String MINIMAL_POST_PROCESSING_ALLOWED =
8790 "minimal_post_processing_allowed";
8791
8792 /**
8793 * No mode switching will happen.
8794 *
8795 * @see #MATCH_CONTENT_FRAME_RATE
8796 * @hide
8797 */
8798 public static final int MATCH_CONTENT_FRAMERATE_NEVER = 0;
8799
8800 /**
8801 * Allow only refresh rate switching between modes in the same configuration group.
8802 * This way only switches without visual interruptions for the user will be allowed.
8803 *
8804 * @see #MATCH_CONTENT_FRAME_RATE
8805 * @hide
8806 */
8807 public static final int MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY = 1;
8808
8809 /**
8810 * Allow refresh rate switching between all refresh rates even if the switch will have
8811 * visual interruptions for the user.
8812 *
8813 * @see #MATCH_CONTENT_FRAME_RATE
8814 * @hide
8815 */
8816 public static final int MATCH_CONTENT_FRAMERATE_ALWAYS = 2;
8817
8818 /**
8819 * User's preference for refresh rate switching.
8820 *
8821 * <p>Values:
8822 * 0 - Never switch refresh rates.
8823 * 1 - Switch refresh rates only when it can be done seamlessly. (Default behaviour)
8824 * 2 - Always prefer refresh rate switching even if it's going to have visual interruptions
8825 * for the user.
8826 *
8827 * @see android.view.Surface#setFrameRate
8828 * @see #MATCH_CONTENT_FRAMERATE_NEVER
8829 * @see #MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY
8830 * @see #MATCH_CONTENT_FRAMERATE_ALWAYS
8831 * @hide
8832 */
8833 public static final String MATCH_CONTENT_FRAME_RATE =
8834 "match_content_frame_rate";
8835
8836 /**
8837 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
8838 * @hide
8839 */
8840 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
8841
8842 /**
8843 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
8844 * @hide
8845 */
8846 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
8847
8848 /**
8849 * INCALL_POWER_BUTTON_BEHAVIOR default value.
8850 * @hide
8851 */
8852 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
8853 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
8854
8855 /**
8856 * What happens when the user presses the Back button while in-call
8857 * and the screen is on.<br/>
8858 * <b>Values:</b><br/>
8859 * 0 - The Back buttons does nothing different.<br/>
8860 * 1 - The Back button hangs up the current call.<br/>
8861 *
8862 * @hide
8863 */
8864 @Readable
8865 public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior";
8866
8867 /**
8868 * INCALL_BACK_BUTTON_BEHAVIOR value for no action.
8869 * @hide
8870 */
8871 public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0;
8872
8873 /**
8874 * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up".
8875 * @hide
8876 */
8877 public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1;
8878
8879 /**
8880 * INCALL_POWER_BUTTON_BEHAVIOR default value.
8881 * @hide
8882 */
8883 public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT =
8884 INCALL_BACK_BUTTON_BEHAVIOR_NONE;
8885
8886 /**
8887 * Whether the device should wake when the wake gesture sensor detects motion.
8888 * @hide
8889 */
8890 @Readable
8891 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
8892
8893 /**
8894 * Whether the device should doze if configured.
8895 * @hide
8896 */
8897 @UnsupportedAppUsage
8898 @Readable
8899 public static final String DOZE_ENABLED = "doze_enabled";
8900
8901 /**
8902 * Indicates whether doze should be always on.
8903 * <p>
8904 * Type: int (0 for false, 1 for true)
8905 *
8906 * @hide
8907 */
8908 @SystemApi
8909 @Readable
8910 public static final String DOZE_ALWAYS_ON = "doze_always_on";
8911
8912 /**
8913 * Whether the device should pulse on pick up gesture.
8914 * @hide
8915 */
8916 @Readable
8917 public static final String DOZE_PICK_UP_GESTURE = "doze_pulse_on_pick_up";
8918
8919 /**
8920 * Whether the device should pulse on long press gesture.
8921 * @hide
8922 */
8923 @Readable
8924 public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press";
8925
8926 /**
8927 * Whether the device should pulse on double tap gesture.
8928 * @hide
8929 */
8930 @Readable
8931 public static final String DOZE_DOUBLE_TAP_GESTURE = "doze_pulse_on_double_tap";
8932
8933 /**
8934 * Whether the device should respond to the SLPI tap gesture.
8935 * @hide
8936 */
8937 @Readable
8938 public static final String DOZE_TAP_SCREEN_GESTURE = "doze_tap_gesture";
8939
8940 /**
8941 * Gesture that wakes up the display, showing some version of the lock screen.
8942 * @hide
8943 */
8944 @Readable
8945 public static final String DOZE_WAKE_LOCK_SCREEN_GESTURE = "doze_wake_screen_gesture";
8946
8947 /**
8948 * Gesture that wakes up the display, toggling between {@link Display.STATE_OFF} and
8949 * {@link Display.STATE_DOZE}.
8950 * @hide
8951 */
8952 @Readable
8953 public static final String DOZE_WAKE_DISPLAY_GESTURE = "doze_wake_display_gesture";
8954
8955 /**
8956 * Gesture that wakes up the display on quick pickup, toggling between
8957 * {@link Display.STATE_OFF} and {@link Display.STATE_DOZE}.
8958 * @hide
8959 */
8960 public static final String DOZE_QUICK_PICKUP_GESTURE = "doze_quick_pickup_gesture";
8961
8962 /**
8963 * Whether the device should suppress the current doze configuration and disable dozing.
8964 * @hide
8965 */
8966 @Readable
8967 public static final String SUPPRESS_DOZE = "suppress_doze";
8968
8969 /**
8970 * Gesture that skips media.
8971 * @hide
8972 */
8973 @Readable
8974 public static final String SKIP_GESTURE = "skip_gesture";
8975
8976 /**
8977 * Count of successful gestures.
8978 * @hide
8979 */
8980 @Readable
8981 public static final String SKIP_GESTURE_COUNT = "skip_gesture_count";
8982
8983 /**
8984 * Count of non-gesture interaction.
8985 * @hide
8986 */
8987 @Readable
8988 public static final String SKIP_TOUCH_COUNT = "skip_touch_count";
8989
8990 /**
8991 * Direction to advance media for skip gesture
8992 * @hide
8993 */
8994 @Readable
8995 public static final String SKIP_DIRECTION = "skip_gesture_direction";
8996
8997 /**
8998 * Gesture that silences sound (alarms, notification, calls).
8999 * @hide
9000 */
9001 @Readable
9002 public static final String SILENCE_GESTURE = "silence_gesture";
9003
9004 /**
9005 * Count of successful silence alarms gestures.
9006 * @hide
9007 */
9008 @Readable
9009 public static final String SILENCE_ALARMS_GESTURE_COUNT = "silence_alarms_gesture_count";
9010
9011 /**
9012 * Count of successful silence timer gestures.
9013 * @hide
9014 */
9015 @Readable
9016 public static final String SILENCE_TIMER_GESTURE_COUNT = "silence_timer_gesture_count";
9017
9018 /**
9019 * Count of successful silence call gestures.
9020 * @hide
9021 */
9022 @Readable
9023 public static final String SILENCE_CALL_GESTURE_COUNT = "silence_call_gesture_count";
9024
9025 /**
9026 * Count of non-gesture interaction.
9027 * @hide
9028 */
9029 @Readable
9030 public static final String SILENCE_ALARMS_TOUCH_COUNT = "silence_alarms_touch_count";
9031
9032 /**
9033 * Count of non-gesture interaction.
9034 * @hide
9035 */
9036 @Readable
9037 public static final String SILENCE_TIMER_TOUCH_COUNT = "silence_timer_touch_count";
9038
9039 /**
9040 * Count of non-gesture interaction.
9041 * @hide
9042 */
9043 @Readable
9044 public static final String SILENCE_CALL_TOUCH_COUNT = "silence_call_touch_count";
9045
9046 /**
9047 * Number of successful "Motion Sense" tap gestures to pause media.
9048 * @hide
9049 */
9050 @Readable
9051 public static final String AWARE_TAP_PAUSE_GESTURE_COUNT = "aware_tap_pause_gesture_count";
9052
9053 /**
9054 * Number of touch interactions to pause media when a "Motion Sense" gesture could
9055 * have been used.
9056 * @hide
9057 */
9058 @Readable
9059 public static final String AWARE_TAP_PAUSE_TOUCH_COUNT = "aware_tap_pause_touch_count";
9060
9061 /**
9062 * For user preference if swipe bottom to expand notification gesture enabled.
9063 * @hide
9064 */
9065 public static final String SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED =
9066 "swipe_bottom_to_notification_enabled";
9067
9068 /**
9069 * Controls whether One-Handed mode is currently activated.
9070 * @hide
9071 */
9072 public static final String ONE_HANDED_MODE_ACTIVATED = "one_handed_mode_activated";
9073
9074 /**
9075 * For user preference if One-Handed Mode enabled.
9076 * @hide
9077 */
9078 public static final String ONE_HANDED_MODE_ENABLED = "one_handed_mode_enabled";
9079
9080 /**
9081 * For user preference if One-Handed Mode timeout.
9082 * @hide
9083 */
9084 public static final String ONE_HANDED_MODE_TIMEOUT = "one_handed_mode_timeout";
9085
9086 /**
9087 * For user taps app to exit One-Handed Mode.
9088 * @hide
9089 */
9090 public static final String TAPS_APP_TO_EXIT = "taps_app_to_exit";
9091
9092 /**
9093 * Internal use, one handed mode tutorial showed times.
9094 * @hide
9095 */
9096 public static final String ONE_HANDED_TUTORIAL_SHOW_COUNT =
9097 "one_handed_tutorial_show_count";
9098
9099 /**
9100 * Toggle to enable/disable for the apps to use the Ui translation for Views. The value
9101 * indicates whether the Ui translation is enabled by the user.
9102 * <p>
9103 * Type: {@code int} ({@code 0} for disabled, {@code 1} for enabled)
9104 *
9105 * @hide
9106 */
9107 @SystemApi
9108 @Readable
9109 @SuppressLint("NoSettingsProvider")
9110 public static final String UI_TRANSLATION_ENABLED = "ui_translation_enabled";
9111
9112 /**
9113 * The current night mode that has been selected by the user. Owned
9114 * and controlled by UiModeManagerService. Constants are as per
9115 * UiModeManager.
9116 * @hide
9117 */
9118 @Readable
9119 public static final String UI_NIGHT_MODE = "ui_night_mode";
9120
9121 /**
9122 * The current night mode custom type that has been selected by the user. Owned
9123 * and controlled by UiModeManagerService. Constants are as per UiModeManager.
9124 * @hide
9125 */
9126 @Readable
9127 @SuppressLint("NoSettingsProvider")
9128 public static final String UI_NIGHT_MODE_CUSTOM_TYPE = "ui_night_mode_custom_type";
9129
9130 /**
9131 * The current night mode that has been overridden to turn on by the system. Owned
9132 * and controlled by UiModeManagerService. Constants are as per
9133 * UiModeManager.
9134 * @hide
9135 */
9136 @Readable
9137 public static final String UI_NIGHT_MODE_OVERRIDE_ON = "ui_night_mode_override_on";
9138
9139 /**
9140 * The last computed night mode bool the last time the phone was on
9141 * @hide
9142 */
9143 public static final String UI_NIGHT_MODE_LAST_COMPUTED = "ui_night_mode_last_computed";
9144
9145 /**
9146 * The current night mode that has been overridden to turn off by the system. Owned
9147 * and controlled by UiModeManagerService. Constants are as per
9148 * UiModeManager.
9149 * @hide
9150 */
9151 @Readable
9152 public static final String UI_NIGHT_MODE_OVERRIDE_OFF = "ui_night_mode_override_off";
9153
9154 /**
9155 * Whether screensavers are enabled.
9156 * @hide
9157 */
9158 @Readable
9159 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
9160
9161 /**
9162 * The user's chosen screensaver components.
9163 *
9164 * These will be launched by the PhoneWindowManager after a timeout when not on
9165 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
9166 * @hide
9167 */
9168 @Readable
9169 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
9170
9171 /**
9172 * If screensavers are enabled, whether the screensaver should be automatically launched
9173 * when the device is inserted into a (desk) dock.
9174 * @hide
9175 */
9176 @Readable
9177 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
9178
9179 /**
9180 * If screensavers are enabled, whether the screensaver should be automatically launched
9181 * when the screen times out when not on battery.
9182 * @hide
9183 */
9184 @Readable
9185 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
9186
9187 /**
9188 * If screensavers are enabled, the default screensaver component.
9189 * @hide
9190 */
9191 @Readable
9192 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
9193
9194 /**
9195 * Whether complications are enabled to be shown over the screensaver by the user.
9196 *
9197 * @hide
9198 */
9199 public static final String SCREENSAVER_COMPLICATIONS_ENABLED =
9200 "screensaver_complications_enabled";
9201
9202
9203 /**
9204 * Default, indicates that the user has not yet started the dock setup flow.
9205 *
9206 * @hide
9207 */
9208 public static final int DOCK_SETUP_NOT_STARTED = 0;
9209
9210 /**
9211 * Indicates that the user has started but not yet completed dock setup.
9212 * One of the possible states for {@link #DOCK_SETUP_STATE}.
9213 *
9214 * @hide
9215 */
9216 public static final int DOCK_SETUP_STARTED = 1;
9217
9218 /**
9219 * Indicates that the user has snoozed dock setup and will complete it later.
9220 * One of the possible states for {@link #DOCK_SETUP_STATE}.
9221 *
9222 * @hide
9223 */
9224 public static final int DOCK_SETUP_PAUSED = 2;
9225
9226 /**
9227 * Indicates that the user has been prompted to start dock setup.
9228 * One of the possible states for {@link #DOCK_SETUP_STATE}.
9229 *
9230 * @hide
9231 */
9232 public static final int DOCK_SETUP_PROMPTED = 3;
9233
9234 /**
9235 * Indicates that the user has completed dock setup.
9236 * One of the possible states for {@link #DOCK_SETUP_STATE}.
9237 *
9238 * @hide
9239 */
9240 public static final int DOCK_SETUP_COMPLETED = 10;
9241
9242 /** @hide */
9243 @Retention(RetentionPolicy.SOURCE)
9244 @IntDef({
9245 DOCK_SETUP_NOT_STARTED,
9246 DOCK_SETUP_STARTED,
9247 DOCK_SETUP_PAUSED,
9248 DOCK_SETUP_PROMPTED,
9249 DOCK_SETUP_COMPLETED
9250 })
9251 public @interface DockSetupState {
9252 }
9253
9254 /**
9255 * Defines the user's current state of dock setup.
9256 * The possible states are defined in {@link DockSetupState}.
9257 *
9258 * @hide
9259 */
9260 public static final String DOCK_SETUP_STATE = "dock_setup_state";
9261
9262 /**
9263 * The default NFC payment component
9264 * @hide
9265 */
9266 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9267 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
9268
9269 /**
9270 * Whether NFC payment is handled by the foreground application or a default.
9271 * @hide
9272 */
9273 @Readable
9274 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
9275
9276 /**
9277 * Specifies the package name currently configured to be the primary sms application
9278 * @hide
9279 */
9280 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9281 @Readable
9282 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
9283
9284 /**
9285 * Specifies the package name currently configured to be the default dialer application
9286 * @hide
9287 */
9288 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9289 @Readable
9290 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
9291
9292 /**
9293 * Specifies the component name currently configured to be the default call screening
9294 * application
9295 * @hide
9296 */
9297 @Readable
9298 public static final String CALL_SCREENING_DEFAULT_COMPONENT =
9299 "call_screening_default_component";
9300
9301 /**
9302 * Specifies the package name currently configured to be the emergency assistance application
9303 *
9304 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
9305 *
9306 * @hide
9307 */
9308 @Readable
9309 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
9310
9311 /**
9312 * Specifies whether the current app context on scren (assist data) will be sent to the
9313 * assist application (active voice interaction service).
9314 *
9315 * @hide
9316 */
9317 @Readable
9318 public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
9319
9320 /**
9321 * Specifies whether a screenshot of the screen contents will be sent to the assist
9322 * application (active voice interaction service).
9323 *
9324 * @hide
9325 */
9326 @Readable
9327 public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";
9328
9329 /**
9330 * Specifies whether the screen will show an animation if screen contents are sent to the
9331 * assist application (active voice interaction service).
9332 *
9333 * Note that the disclosure will be forced for third-party assistants or if the device
9334 * does not support disabling it.
9335 *
9336 * @hide
9337 */
9338 @Readable
9339 public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled";
9340
9341 /**
9342 * Control if rotation suggestions are sent to System UI when in rotation locked mode.
9343 * Done to enable screen rotation while the screen rotation is locked. Enabling will
9344 * poll the accelerometer in rotation locked mode.
9345 *
9346 * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent.
9347 *
9348 * @hide
9349 */
9350 @Readable
9351 public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions";
9352
9353 /**
9354 * The disabled state of SHOW_ROTATION_SUGGESTIONS.
9355 * @hide
9356 */
9357 public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0;
9358
9359 /**
9360 * The enabled state of SHOW_ROTATION_SUGGESTIONS.
9361 * @hide
9362 */
9363 public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1;
9364
9365 /**
9366 * The default state of SHOW_ROTATION_SUGGESTIONS.
9367 * @hide
9368 */
9369 public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT =
9370 SHOW_ROTATION_SUGGESTIONS_ENABLED;
9371
9372 /**
9373 * The number of accepted rotation suggestions. Used to determine if the user has been
9374 * introduced to rotation suggestions.
9375 * @hide
9376 */
9377 @Readable
9378 public static final String NUM_ROTATION_SUGGESTIONS_ACCEPTED =
9379 "num_rotation_suggestions_accepted";
9380
9381 /**
9382 * Read only list of the service components that the current user has explicitly allowed to
9383 * see and assist with all of the user's notifications.
9384 *
9385 * @deprecated Use
9386 * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}.
9387 * @hide
9388 */
9389 @Deprecated
9390 @Readable
9391 public static final String ENABLED_NOTIFICATION_ASSISTANT =
9392 "enabled_notification_assistant";
9393
9394 /**
9395 * Read only list of the service components that the current user has explicitly allowed to
9396 * see all of the user's notifications, separated by ':'.
9397 *
9398 * @hide
9399 * @deprecated Use
9400 * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}.
9401 */
9402 @Deprecated
9403 @UnsupportedAppUsage
9404 @Readable
9405 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
9406
9407 /**
9408 * Read only list of the packages that the current user has explicitly allowed to
9409 * manage do not disturb, separated by ':'.
9410 *
9411 * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}.
9412 * @hide
9413 */
9414 @Deprecated
9415 @TestApi
9416 @Readable
9417 public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES =
9418 "enabled_notification_policy_access_packages";
9419
9420 /**
9421 * Defines whether managed profile ringtones should be synced from it's parent profile
9422 * <p>
9423 * 0 = ringtones are not synced
9424 * 1 = ringtones are synced from the profile's parent (default)
9425 * <p>
9426 * This value is only used for managed profiles.
9427 * @hide
9428 */
9429 @TestApi
9430 @Readable
9431 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
9432 public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds";
9433
9434 /**
9435 * @hide
9436 */
9437 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9438 @TestApi
9439 @Readable
9440 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
9441
9442 /**
9443 * This is the query URI for finding a print service to install.
9444 *
9445 * @hide
9446 */
9447 @Readable
9448 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
9449
9450 /**
9451 * This is the query URI for finding a NFC payment service to install.
9452 *
9453 * @hide
9454 */
9455 @Readable
9456 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
9457
9458 /**
9459 * This is the query URI for finding a auto fill service to install.
9460 *
9461 * @hide
9462 */
9463 @Readable
9464 public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri";
9465
9466 /**
9467 * If enabled, apps should try to skip any introductory hints on first launch. This might
9468 * apply to users that are already familiar with the environment or temporary users.
9469 * <p>
9470 * Type : int (0 to show hints, 1 to skip showing hints)
9471 */
9472 @Readable
9473 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
9474
9475 /**
9476 * Persisted playback time after a user confirmation of an unsafe volume level.
9477 *
9478 * @hide
9479 */
9480 @Readable
9481 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
9482
9483 /**
9484 * Indicates whether the spatial audio feature was enabled for this user.
9485 *
9486 * Type : int (0 disabled, 1 enabled)
9487 *
9488 * @hide
9489 */
9490 public static final String SPATIAL_AUDIO_ENABLED = "spatial_audio_enabled";
9491
9492 /**
9493 * Indicates whether notification display on the lock screen is enabled.
9494 * <p>
9495 * Type: int (0 for false, 1 for true)
9496 *
9497 * @hide
9498 */
9499 @SystemApi
9500 @Readable
9501 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
9502 "lock_screen_show_notifications";
9503
9504 /**
9505 * Indicates whether the lock screen should display silent notifications.
9506 * <p>
9507 * Type: int (0 for false, 1 for true)
9508 *
9509 * @hide
9510 */
9511 @Readable
9512 public static final String LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS =
9513 "lock_screen_show_silent_notifications";
9514
9515 /**
9516 * Indicates whether "seen" notifications should be suppressed from the lockscreen.
9517 * <p>
9518 * Type: int (0 for false, 1 for true)
9519 *
9520 * @hide
9521 */
9522 public static final String LOCK_SCREEN_SHOW_ONLY_UNSEEN_NOTIFICATIONS =
9523 "lock_screen_show_only_unseen_notifications";
9524
9525 /**
9526 * Indicates whether snooze options should be shown on notifications
9527 * <p>
9528 * Type: int (0 for false, 1 for true)
9529 *
9530 * @hide
9531 */
9532 @Readable
9533 public static final String SHOW_NOTIFICATION_SNOOZE = "show_notification_snooze";
9534
9535 /**
9536 * List of TV inputs that are currently hidden. This is a string
9537 * containing the IDs of all hidden TV inputs. Each ID is encoded by
9538 * {@link android.net.Uri#encode(String)} and separated by ':'.
9539 * @hide
9540 */
9541 @Readable
9542 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
9543
9544 /**
9545 * List of custom TV input labels. This is a string containing <TV input id, custom name>
9546 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
9547 * and separated by ','. Each pair is separated by ':'.
9548 * @hide
9549 */
9550 @Readable
9551 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
9552
9553 /**
9554 * Whether TV app uses non-system inputs.
9555 *
9556 * <p>
9557 * The value is boolean (1 or 0), where 1 means non-system TV inputs are allowed,
9558 * and 0 means non-system TV inputs are not allowed.
9559 *
9560 * <p>
9561 * Devices such as sound bars may have changed the system property allow_third_party_inputs
9562 * to false so the TV Application only uses HDMI and other built in inputs. This setting
9563 * allows user to override the default and have the TV Application use third party TV inputs
9564 * available on play store.
9565 *
9566 * @hide
9567 */
9568 @Readable
9569 public static final String TV_APP_USES_NON_SYSTEM_INPUTS = "tv_app_uses_non_system_inputs";
9570
9571 /**
9572 * Whether automatic routing of system audio to USB audio peripheral is disabled.
9573 * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
9574 * and 0 means automatic routing is enabled.
9575 *
9576 * @hide
9577 */
9578 @Readable
9579 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
9580 "usb_audio_automatic_routing_disabled";
9581
9582 /**
9583 * The timeout in milliseconds before the device fully goes to sleep after
9584 * a period of inactivity. This value sets an upper bound on how long the device
9585 * will stay awake or dreaming without user activity. It should generally
9586 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
9587 * will sleep before it ever has a chance to dream.
9588 * <p>
9589 * Use -1 to disable this timeout.
9590 * </p>
9591 *
9592 * @hide
9593 */
9594 @Readable
9595 public static final String SLEEP_TIMEOUT = "sleep_timeout";
9596
9597 /**
9598 * The timeout in milliseconds before the device goes to sleep due to user inattentiveness,
9599 * even if the system is holding wakelocks. It should generally be longer than {@code
9600 * config_attentiveWarningDuration}, as otherwise the device will show the attentive
9601 * warning constantly. Small timeouts are discouraged, as they will cause the device to
9602 * go to sleep quickly after waking up.
9603 * <p>
9604 * Use -1 to disable this timeout.
9605 * </p>
9606 *
9607 * @hide
9608 */
9609 @Readable
9610 public static final String ATTENTIVE_TIMEOUT = "attentive_timeout";
9611
9612 /**
9613 * Controls whether double tap to wake is enabled.
9614 * @hide
9615 */
9616 @Readable
9617 public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
9618
9619 /**
9620 * The current assistant component. It could be a voice interaction service,
9621 * or an activity that handles ACTION_ASSIST, or empty which means using the default
9622 * handling.
9623 *
9624 * <p>This should be set indirectly by setting the {@link
9625 * android.app.role.RoleManager#ROLE_ASSISTANT assistant role}.
9626 *
9627 * @hide
9628 */
9629 @UnsupportedAppUsage
9630 @Readable
9631 public static final String ASSISTANT = "assistant";
9632
9633 /**
9634 * Whether the camera launch gesture should be disabled.
9635 *
9636 * @hide
9637 */
9638 @Readable
9639 public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled";
9640
9641 /**
9642 * Whether the emergency gesture should be enabled.
9643 *
9644 * @hide
9645 */
9646 public static final String EMERGENCY_GESTURE_ENABLED = "emergency_gesture_enabled";
9647
9648 /**
9649 * Whether the emergency gesture sound should be enabled.
9650 *
9651 * @hide
9652 */
9653 public static final String EMERGENCY_GESTURE_SOUND_ENABLED =
9654 "emergency_gesture_sound_enabled";
9655
9656 /**
9657 * Whether the camera launch gesture to double tap the power button when the screen is off
9658 * should be disabled.
9659 *
9660 * @hide
9661 */
9662 @Readable
9663 public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED =
9664 "camera_double_tap_power_gesture_disabled";
9665
9666 /**
9667 * Whether the camera double twist gesture to flip between front and back mode should be
9668 * enabled.
9669 *
9670 * @hide
9671 */
9672 @Readable
9673 public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED =
9674 "camera_double_twist_to_flip_enabled";
9675
9676 /**
9677 * Whether or not the smart camera lift trigger that launches the camera when the user moves
9678 * the phone into a position for taking photos should be enabled.
9679 *
9680 * @hide
9681 */
9682 @Readable
9683 public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled";
9684
9685 /**
9686 * The default enable state of the camera lift trigger.
9687 *
9688 * @hide
9689 */
9690 public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1;
9691
9692 /**
9693 * Whether or not the flashlight (camera torch mode) is available required to turn
9694 * on flashlight.
9695 *
9696 * @hide
9697 */
9698 @Readable
9699 public static final String FLASHLIGHT_AVAILABLE = "flashlight_available";
9700
9701 /**
9702 * Whether or not flashlight is enabled.
9703 *
9704 * @hide
9705 */
9706 @Readable
9707 public static final String FLASHLIGHT_ENABLED = "flashlight_enabled";
9708
9709 /**
9710 * Whether or not face unlock is allowed on Keyguard.
9711 * @hide
9712 */
9713 @Readable
9714 public static final String FACE_UNLOCK_KEYGUARD_ENABLED = "face_unlock_keyguard_enabled";
9715
9716 /**
9717 * Whether or not face unlock dismisses the keyguard.
9718 * @hide
9719 */
9720 @Readable
9721 public static final String FACE_UNLOCK_DISMISSES_KEYGUARD =
9722 "face_unlock_dismisses_keyguard";
9723
9724 /**
9725 * Whether or not media is shown automatically when bypassing as a heads up.
9726 * @hide
9727 */
9728 @Readable
9729 public static final String SHOW_MEDIA_WHEN_BYPASSING =
9730 "show_media_when_bypassing";
9731
9732 /**
9733 * Whether or not face unlock requires attention. This is a cached value, the source of
9734 * truth is obtained through the HAL.
9735 * @hide
9736 */
9737 @Readable
9738 public static final String FACE_UNLOCK_ATTENTION_REQUIRED =
9739 "face_unlock_attention_required";
9740
9741 /**
9742 * Whether or not face unlock requires a diverse set of poses during enrollment. This is a
9743 * cached value, the source of truth is obtained through the HAL.
9744 * @hide
9745 */
9746 @Readable
9747 public static final String FACE_UNLOCK_DIVERSITY_REQUIRED =
9748 "face_unlock_diversity_required";
9749
9750
9751 /**
9752 * Whether or not face unlock is allowed for apps (through BiometricPrompt).
9753 * @hide
9754 */
9755 @Readable
9756 public static final String FACE_UNLOCK_APP_ENABLED = "face_unlock_app_enabled";
9757
9758 /**
9759 * Whether or not face unlock always requires user confirmation, meaning {@link
9760 * android.hardware.biometrics.BiometricPrompt.Builder#setConfirmationRequired(boolean)}
9761 * is always 'true'. This overrides the behavior that apps choose in the
9762 * setConfirmationRequired API.
9763 * @hide
9764 */
9765 @Readable
9766 public static final String FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION =
9767 "face_unlock_always_require_confirmation";
9768
9769 /**
9770 * Whether or not a user should re enroll their face.
9771 *
9772 * Face unlock re enroll.
9773 * 0 = No re enrollment.
9774 * 1 = Re enrollment is suggested.
9775 * 2 = Re enrollment is required after a set time period.
9776 * 3 = Re enrollment is required immediately.
9777 *
9778 * @hide
9779 */
9780 @Readable
9781 public static final String FACE_UNLOCK_RE_ENROLL = "face_unlock_re_enroll";
9782
9783 /**
9784 * The time (in millis) to wait for a power button before sending a
9785 * successful auth in to keyguard(for side fingerprint)
9786 * @hide
9787 */
9788 @Readable
9789 public static final String FINGERPRINT_SIDE_FPS_KG_POWER_WINDOW =
9790 "fingerprint_side_fps_kg_power_window";
9791
9792 /**
9793 * The time (in millis) to wait for a power button before sending
9794 * a successful auth in biometric prompt(for side fingerprint)
9795 * @hide
9796 */
9797 @Readable
9798 public static final String FINGERPRINT_SIDE_FPS_BP_POWER_WINDOW =
9799 "fingerprint_side_fps_bp_power_window";
9800
9801 /**
9802 * The time (in millis) that a finger tap will wait for a power button
9803 * before dismissing the power dialog during enrollment(for side
9804 * fingerprint)
9805 * @hide
9806 */
9807 @Readable
9808 public static final String FINGERPRINT_SIDE_FPS_ENROLL_TAP_WINDOW =
9809 "fingerprint_side_fps_enroll_tap_window";
9810
9811 /**
9812 * The time (in millis) that a power event will ignore future authentications
9813 * (for side fingerprint)
9814 * @hide
9815 */
9816 @Readable
9817 public static final String FINGERPRINT_SIDE_FPS_AUTH_DOWNTIME =
9818 "fingerprint_side_fps_auth_downtime";
9819
9820 /**
9821 * Whether or not a SFPS device is required to be interactive for auth to unlock the device.
9822 * @hide
9823 */
9824 public static final String SFPS_REQUIRE_SCREEN_ON_TO_AUTH_ENABLED =
9825 "sfps_require_screen_on_to_auth_enabled";
9826
9827 /**
9828 * Whether or not debugging is enabled.
9829 * @hide
9830 */
9831 @Readable
9832 public static final String BIOMETRIC_DEBUG_ENABLED =
9833 "biometric_debug_enabled";
9834
9835 /**
9836 * Whether or not biometric is allowed on Keyguard.
9837 * @hide
9838 */
9839 @Readable
9840 public static final String BIOMETRIC_KEYGUARD_ENABLED = "biometric_keyguard_enabled";
9841
9842 /**
9843 * Whether or not biometric is allowed for apps (through BiometricPrompt).
9844 * @hide
9845 */
9846 @Readable
9847 public static final String BIOMETRIC_APP_ENABLED = "biometric_app_enabled";
9848
9849 /**
9850 * Whether or not active unlock triggers on wake.
9851 * @hide
9852 */
9853 public static final String ACTIVE_UNLOCK_ON_WAKE = "active_unlock_on_wake";
9854
9855 /**
9856 * Whether or not active unlock triggers on unlock intent.
9857 * @hide
9858 */
9859 public static final String ACTIVE_UNLOCK_ON_UNLOCK_INTENT =
9860 "active_unlock_on_unlock_intent";
9861
9862 /**
9863 * Whether or not active unlock triggers on biometric failure.
9864 * @hide
9865 */
9866 public static final String ACTIVE_UNLOCK_ON_BIOMETRIC_FAIL =
9867 "active_unlock_on_biometric_fail";
9868
9869 /**
9870 * If active unlock triggers on biometric failures, include the following error codes
9871 * as a biometric failure. See {@link android.hardware.biometrics.BiometricFaceConstants}.
9872 * Error codes should be separated by a pipe. For example: "1|4|5". If active unlock
9873 * should never trigger on any face errors, this should be set to an empty string.
9874 * A null value will use the system default value (TIMEOUT).
9875 * @hide
9876 */
9877 public static final String ACTIVE_UNLOCK_ON_FACE_ERRORS =
9878 "active_unlock_on_face_errors";
9879
9880 /**
9881 * If active unlock triggers on biometric failures, include the following acquired info
9882 * as a "biometric failure". See {@link android.hardware.biometrics.BiometricFaceConstants}.
9883 * Acquired codes should be separated by a pipe. For example: "1|4|5". If active unlock
9884 * should never on trigger on any acquired info messages, this should be
9885 * set to an empty string. A null value will use the system default value (none).
9886 * @hide
9887 */
9888 public static final String ACTIVE_UNLOCK_ON_FACE_ACQUIRE_INFO =
9889 "active_unlock_on_face_acquire_info";
9890
9891 /**
9892 * If active unlock triggers on biometric failures, then also request active unlock on
9893 * unlock intent when each setting (BiometricType) is the only biometric type enrolled.
9894 * Biometric types should be separated by a pipe. For example: "0|3" or "0". If this
9895 * setting should be disabled, then this should be set to an empty string. A null value
9896 * will use the system default value (0 / None).
9897 * 0 = None, 1 = Any face, 2 = Any fingerprint, 3 = Under display fingerprint
9898 * @hide
9899 */
9900 public static final String ACTIVE_UNLOCK_ON_UNLOCK_INTENT_WHEN_BIOMETRIC_ENROLLED =
9901 "active_unlock_on_unlock_intent_when_biometric_enrolled";
9902
9903 /**
9904 * Whether the assist gesture should be enabled.
9905 *
9906 * @hide
9907 */
9908 @Readable
9909 public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled";
9910
9911 /**
9912 * Sensitivity control for the assist gesture.
9913 *
9914 * @hide
9915 */
9916 @Readable
9917 public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity";
9918
9919 /**
9920 * Whether the assist gesture should silence alerts.
9921 *
9922 * @hide
9923 */
9924 @Readable
9925 public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED =
9926 "assist_gesture_silence_alerts_enabled";
9927
9928 /**
9929 * Whether the assist gesture should wake the phone.
9930 *
9931 * @hide
9932 */
9933 @Readable
9934 public static final String ASSIST_GESTURE_WAKE_ENABLED =
9935 "assist_gesture_wake_enabled";
9936
9937 /**
9938 * Indicates whether the Assist Gesture Deferred Setup has been completed.
9939 * <p>
9940 * Type: int (0 for false, 1 for true)
9941 *
9942 * @hide
9943 */
9944 @SystemApi
9945 @Readable
9946 public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
9947
9948 /**
9949 * Whether the assistant can be triggered by a touch gesture.
9950 *
9951 * @hide
9952 */
9953 public static final String ASSIST_TOUCH_GESTURE_ENABLED =
9954 "assist_touch_gesture_enabled";
9955
9956 /**
9957 * Whether the assistant can be triggered by long-pressing the home button
9958 *
9959 * @hide
9960 */
9961 public static final String ASSIST_LONG_PRESS_HOME_ENABLED =
9962 "assist_long_press_home_enabled";
9963
9964 /**
9965 * Control whether Trust Agents are in active unlock or extend unlock mode.
9966 * @hide
9967 */
9968 @Readable
9969 public static final String TRUST_AGENTS_EXTEND_UNLOCK = "trust_agents_extend_unlock";
9970
9971 /**
9972 * Control whether the screen locks when trust is lost.
9973 * @hide
9974 */
9975 @Readable
9976 public static final String LOCK_SCREEN_WHEN_TRUST_LOST = "lock_screen_when_trust_lost";
9977
9978 /**
9979 * Control whether Night display is currently activated.
9980 * @hide
9981 */
9982 @Readable
9983 public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated";
9984
9985 /**
9986 * Control whether Night display will automatically activate/deactivate.
9987 * @hide
9988 */
9989 @Readable
9990 public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode";
9991
9992 /**
9993 * Control the color temperature of Night Display, represented in Kelvin.
9994 * @hide
9995 */
9996 @Readable
9997 public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE =
9998 "night_display_color_temperature";
9999
10000 /**
10001 * Custom time when Night display is scheduled to activate.
10002 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
10003 * @hide
10004 */
10005 @Readable
10006 public static final String NIGHT_DISPLAY_CUSTOM_START_TIME =
10007 "night_display_custom_start_time";
10008
10009 /**
10010 * Custom time when Night display is scheduled to deactivate.
10011 * Represented as milliseconds from midnight (e.g. 21600000 == 6am).
10012 * @hide
10013 */
10014 @Readable
10015 public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time";
10016
10017 /**
10018 * A String representing the LocalDateTime when Night display was last activated. Use to
10019 * decide whether to apply the current activated state after a reboot or user change. In
10020 * legacy cases, this is represented by the time in milliseconds (since epoch).
10021 * @hide
10022 */
10023 @Readable
10024 public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME =
10025 "night_display_last_activated_time";
10026
10027 /**
10028 * Control whether display white balance is currently enabled.
10029 * @hide
10030 */
10031 @Readable
10032 public static final String DISPLAY_WHITE_BALANCE_ENABLED = "display_white_balance_enabled";
10033
10034 /**
10035 * Names of the service components that the current user has explicitly allowed to
10036 * be a VR mode listener, separated by ':'.
10037 *
10038 * @hide
10039 */
10040 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
10041 @TestApi
10042 @Readable
10043 public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners";
10044
10045 /**
10046 * Behavior of the display while in VR mode.
10047 *
10048 * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}.
10049 *
10050 * @hide
10051 */
10052 @Readable
10053 public static final String VR_DISPLAY_MODE = "vr_display_mode";
10054
10055 /**
10056 * Lower the display persistence while the system is in VR mode.
10057 *
10058 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
10059 *
10060 * @hide.
10061 */
10062 public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0;
10063
10064 /**
10065 * Do not alter the display persistence while the system is in VR mode.
10066 *
10067 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
10068 *
10069 * @hide.
10070 */
10071 public static final int VR_DISPLAY_MODE_OFF = 1;
10072
10073 /**
10074 * The latest SDK version that CarrierAppUtils#disableCarrierAppsUntilPrivileged has been
10075 * executed for.
10076 *
10077 * <p>This is used to ensure that we only take one pass which will disable apps that are not
10078 * privileged (if any). From then on, we only want to enable apps (when a matching SIM is
10079 * inserted), to avoid disabling an app that the user might actively be using.
10080 *
10081 * <p>Will be set to {@link android.os.Build.VERSION#SDK_INT} once executed. Note that older
10082 * SDK versions prior to R set 1 for this value.
10083 *
10084 * @hide
10085 */
10086 @Readable
10087 public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled";
10088
10089 /**
10090 * Whether parent user can access remote contact in managed profile.
10091 *
10092 * @hide
10093 */
10094 @Readable
10095 public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH =
10096 "managed_profile_contact_remote_search";
10097
10098 /**
10099 * Whether parent profile can access remote calendar data in managed profile.
10100 *
10101 * @hide
10102 */
10103 @Readable
10104 public static final String CROSS_PROFILE_CALENDAR_ENABLED =
10105 "cross_profile_calendar_enabled";
10106
10107 /**
10108 * Whether or not the automatic storage manager is enabled and should run on the device.
10109 *
10110 * @hide
10111 */
10112 @Readable
10113 public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED =
10114 "automatic_storage_manager_enabled";
10115
10116 /**
10117 * How many days of information for the automatic storage manager to retain on the device.
10118 *
10119 * @hide
10120 */
10121 @Readable
10122 public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN =
10123 "automatic_storage_manager_days_to_retain";
10124
10125 /**
10126 * Default number of days of information for the automatic storage manager to retain.
10127 *
10128 * @hide
10129 */
10130 public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90;
10131
10132 /**
10133 * How many bytes the automatic storage manager has cleared out.
10134 *
10135 * @hide
10136 */
10137 @Readable
10138 public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED =
10139 "automatic_storage_manager_bytes_cleared";
10140
10141 /**
10142 * Last run time for the automatic storage manager.
10143 *
10144 * @hide
10145 */
10146 @Readable
10147 public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN =
10148 "automatic_storage_manager_last_run";
10149 /**
10150 * If the automatic storage manager has been disabled by policy. Note that this doesn't
10151 * mean that the automatic storage manager is prevented from being re-enabled -- this only
10152 * means that it was turned off by policy at least once.
10153 *
10154 * @hide
10155 */
10156 @Readable
10157 public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY =
10158 "automatic_storage_manager_turned_off_by_policy";
10159
10160 /**
10161 * Whether SystemUI navigation keys is enabled.
10162 * @hide
10163 */
10164 @Readable
10165 public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
10166 "system_navigation_keys_enabled";
10167
10168 /**
10169 * Holds comma separated list of ordering of QS tiles.
10170 *
10171 * @hide
10172 */
10173 @Readable
10174 public static final String QS_TILES = "sysui_qs_tiles";
10175
10176 /**
10177 * Whether this user has enabled Quick controls.
10178 *
10179 * 0 indicates disabled and 1 indicates enabled. A non existent value should be treated as
10180 * enabled.
10181 *
10182 * @deprecated Controls are migrated to Quick Settings, rendering this unnecessary and will
10183 * be removed in a future release.
10184 * @hide
10185 */
10186 @Readable
10187 @Deprecated
10188 public static final String CONTROLS_ENABLED = "controls_enabled";
10189
10190 /**
10191 * Whether power menu content (cards, passes, controls) will be shown when device is locked.
10192 *
10193 * 0 indicates hide and 1 indicates show. A non existent value will be treated as hide.
10194 * @hide
10195 */
10196 @TestApi
10197 @Readable
10198 public static final String POWER_MENU_LOCKED_SHOW_CONTENT =
10199 "power_menu_locked_show_content";
10200
10201 /**
10202 * Whether home controls should be accessible from the lockscreen
10203 *
10204 * @hide
10205 */
10206 public static final String LOCKSCREEN_SHOW_CONTROLS = "lockscreen_show_controls";
10207
10208 /**
10209 * Whether trivial home controls can be used without authentication
10210 *
10211 * @hide
10212 */
10213 public static final String LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS =
10214 "lockscreen_allow_trivial_controls";
10215
10216 /**
10217 * Whether wallet should be accessible from the lockscreen
10218 *
10219 * @hide
10220 */
10221 public static final String LOCKSCREEN_SHOW_WALLET = "lockscreen_show_wallet";
10222
10223 /**
10224 * Whether to use the lockscreen double-line clock
10225 *
10226 * @hide
10227 */
10228 public static final String LOCKSCREEN_USE_DOUBLE_LINE_CLOCK =
10229 "lockscreen_use_double_line_clock";
10230
10231 /**
10232 * Whether to show the vibrate icon in the Status Bar (default off)
10233 *
10234 * @hide
10235 */
10236 public static final String STATUS_BAR_SHOW_VIBRATE_ICON = "status_bar_show_vibrate_icon";
10237
10238 /**
10239 * Specifies whether the web action API is enabled.
10240 *
10241 * @hide
10242 */
10243 @SystemApi
10244 @Readable
10245 public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled";
10246
10247 /**
10248 * Whether qr code scanner should be accessible from the lockscreen
10249 *
10250 * @hide
10251 */
10252 public static final String LOCK_SCREEN_SHOW_QR_CODE_SCANNER =
10253 "lock_screen_show_qr_code_scanner";
10254
10255 /**
10256 * Whether or not to enable qr code code scanner setting to enable/disable lockscreen
10257 * entry point. Any value apart from null means setting needs to be enabled
10258 *
10259 * @hide
10260 */
10261 public static final String SHOW_QR_CODE_SCANNER_SETTING =
10262 "show_qr_code_scanner_setting";
10263
10264 /**
10265 * Has this pairable device been paired or upgraded from a previously paired system.
10266 * @hide
10267 */
10268 @Readable
10269 public static final String DEVICE_PAIRED = "device_paired";
10270
10271 /**
10272 * Specifies additional package name for broadcasting the CMAS messages.
10273 * @hide
10274 */
10275 @Readable
10276 public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg";
10277
10278 /**
10279 * Whether the launcher should show any notification badges.
10280 * The value is boolean (1 or 0).
10281 * @hide
10282 */
10283 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
10284 @TestApi
10285 @Readable
10286 public static final String NOTIFICATION_BADGING = "notification_badging";
10287
10288 /**
10289 * When enabled the system will maintain a rolling history of received notifications. When
10290 * disabled the history will be disabled and deleted.
10291 *
10292 * The value 1 - enable, 0 - disable
10293 * @hide
10294 */
10295 @Readable
10296 public static final String NOTIFICATION_HISTORY_ENABLED = "notification_history_enabled";
10297
10298 /**
10299 * When enabled conversations marked as favorites will be set to bubble.
10300 *
10301 * The value 1 - enable, 0 - disable
10302 * @hide
10303 */
10304 @Readable
10305 public static final String BUBBLE_IMPORTANT_CONVERSATIONS
10306 = "bubble_important_conversations";
10307
10308 /**
10309 * When enabled, notifications able to bubble will display an affordance allowing the user
10310 * to bubble them.
10311 * The value is boolean (1 to enable or 0 to disable).
10312 *
10313 * @hide
10314 */
10315 @TestApi
10316 @SuppressLint("NoSettingsProvider")
10317 @Readable
10318 public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
10319
10320 /**
10321 * Whether notifications are dismissed by a right-to-left swipe (instead of a left-to-right
10322 * swipe).
10323 *
10324 * @hide
10325 */
10326 @Readable
10327 public static final String NOTIFICATION_DISMISS_RTL = "notification_dismiss_rtl";
10328
10329 /**
10330 * Comma separated list of QS tiles that have been auto-added already.
10331 * @hide
10332 */
10333 @Readable
10334 public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles";
10335
10336 /**
10337 * The duration of timeout, in milliseconds, to switch from a non-Dock User to the
10338 * Dock User when the device is docked.
10339 * @hide
10340 */
10341 public static final String TIMEOUT_TO_DOCK_USER = "timeout_to_dock_user";
10342
10343 /**
10344 * Backup manager behavioral parameters.
10345 * This is encoded as a key=value list, separated by commas. Ex:
10346 *
10347 * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true"
10348 *
10349 * The following keys are supported:
10350 *
10351 * <pre>
10352 * key_value_backup_interval_milliseconds (long)
10353 * key_value_backup_fuzz_milliseconds (long)
10354 * key_value_backup_require_charging (boolean)
10355 * key_value_backup_required_network_type (int)
10356 * full_backup_interval_milliseconds (long)
10357 * full_backup_require_charging (boolean)
10358 * full_backup_required_network_type (int)
10359 * backup_finished_notification_receivers (String[])
10360 * </pre>
10361 *
10362 * backup_finished_notification_receivers uses ":" as delimeter for values.
10363 *
10364 * <p>
10365 * Type: string
10366 * @hide
10367 */
10368 @Readable
10369 public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants";
10370
10371
10372 /**
10373 * Local transport parameters so we can configure it for tests.
10374 * This is encoded as a key=value list, separated by commas.
10375 *
10376 * The following keys are supported:
10377 *
10378 * <pre>
10379 * fake_encryption_flag (boolean)
10380 * </pre>
10381 *
10382 * <p>
10383 * Type: string
10384 * @hide
10385 */
10386 @Readable
10387 public static final String BACKUP_LOCAL_TRANSPORT_PARAMETERS =
10388 "backup_local_transport_parameters";
10389
10390 /**
10391 * Flag to set if the system should predictively attempt to re-enable Bluetooth while
10392 * the user is driving.
10393 * @hide
10394 */
10395 @Readable
10396 public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving";
10397
10398 /**
10399 * What behavior should be invoked when the volume hush gesture is triggered
10400 * One of VOLUME_HUSH_OFF, VOLUME_HUSH_VIBRATE, VOLUME_HUSH_MUTE.
10401 *
10402 * @hide
10403 */
10404 @SystemApi
10405 @Readable
10406 public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture";
10407
10408 /** @hide */
10409 @SystemApi
10410 public static final int VOLUME_HUSH_OFF = 0;
10411 /** @hide */
10412 @SystemApi
10413 public static final int VOLUME_HUSH_VIBRATE = 1;
10414 /** @hide */
10415 @SystemApi
10416 public static final int VOLUME_HUSH_MUTE = 2;
10417
10418 /**
10419 * The number of times (integer) the user has manually enabled battery saver.
10420 * @hide
10421 */
10422 @Readable
10423 public static final String LOW_POWER_MANUAL_ACTIVATION_COUNT =
10424 "low_power_manual_activation_count";
10425
10426 /**
10427 * Whether the "first time battery saver warning" dialog needs to be shown (0: default)
10428 * or not (1).
10429 *
10430 * @hide
10431 */
10432 @Readable
10433 public static final String LOW_POWER_WARNING_ACKNOWLEDGED =
10434 "low_power_warning_acknowledged";
10435
10436 /**
10437 * 0 (default) Auto battery saver suggestion has not been suppressed. 1) it has been
10438 * suppressed.
10439 * @hide
10440 */
10441 @Readable
10442 public static final String SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION =
10443 "suppress_auto_battery_saver_suggestion";
10444
10445 /**
10446 * List of packages, which data need to be unconditionally cleared before full restore.
10447 * Type: string
10448 * @hide
10449 */
10450 @Readable
10451 public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE =
10452 "packages_to_clear_data_before_full_restore";
10453
10454 /**
10455 * How often to check for location access.
10456 * @hide
10457 */
10458 @SystemApi
10459 @Readable
10460 public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS =
10461 "location_access_check_interval_millis";
10462
10463 /**
10464 * Delay between granting location access and checking it.
10465 * @hide
10466 */
10467 @SystemApi
10468 @Readable
10469 public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS =
10470 "location_access_check_delay_millis";
10471
10472 /**
10473 * @deprecated This setting does not have any effect anymore
10474 * @hide
10475 */
10476 @SystemApi
10477 @Deprecated
10478 @Readable
10479 public static final String LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE =
10480 "location_permissions_upgrade_to_q_mode";
10481
10482 /**
10483 * Whether or not the system Auto Revoke feature is disabled.
10484 * @hide
10485 */
10486 @SystemApi
10487 @Readable
10488 public static final String AUTO_REVOKE_DISABLED = "auto_revoke_disabled";
10489
10490 /**
10491 * Map of android.theme.customization.* categories to the enabled overlay package for that
10492 * category, formatted as a serialized {@link org.json.JSONObject}. If there is no
10493 * corresponding package included for a category, then all overlay packages in that
10494 * category must be disabled.
10495 *
10496 * A few category keys have special meaning and are used for Material You theming.
10497 *
10498 * A {@code FabricatedOverlay} containing Material You tonal palettes will be generated
10499 * in case {@code android.theme.customization.system_palette} contains a
10500 * {@link android.annotation.ColorInt}.
10501 *
10502 * The strategy used for generating the tonal palettes can be defined with the
10503 * {@code android.theme.customization.theme_style} key, with one of the following options:
10504 * <ul>
10505 * <li> {@code TONAL_SPOT} is a mid vibrancy palette that uses an accent 3 analogous to
10506 * accent 1.</li>
10507 * <li> {@code VIBRANT} is a high vibrancy palette that harmoniously blends subtle shifts
10508 * between colors.</li>
10509 * <li> {@code EXPRESSIVE} is a high vibrancy palette that pairs unexpected and unique
10510 * accents colors together.</li>
10511 * <li> {@code SPRITZ} is a low vibrancy palette that creates a soft wash between
10512 * colors.</li>
10513 * <li> {@code RAINBOW} uses both chromatic accents and neutral surfaces to create a more
10514 * subtle color experience for users.</li>
10515 * <li> {@code FRUIT_SALAD} experiments with the concept of "two tone colors" to give
10516 * users more expression.</li>
10517 * </ul>
10518 *
10519 * Example of valid fabricated theme specification:
10520 * <pre>
10521 * {
10522 * "android.theme.customization.system_palette":"B1611C",
10523 * "android.theme.customization.theme_style":"EXPRESSIVE"
10524 * }
10525 * </pre>
10526 * @hide
10527 */
10528 @SystemApi
10529 @Readable
10530 public static final String THEME_CUSTOMIZATION_OVERLAY_PACKAGES =
10531 "theme_customization_overlay_packages";
10532
10533 /**
10534 * Indicates whether the nav bar is forced to always be visible, even in immersive mode.
10535 * <p>Type: int (0 for false, 1 for true)
10536 *
10537 * @hide
10538 */
10539 public static final String NAV_BAR_FORCE_VISIBLE = "nav_bar_force_visible";
10540
10541 /**
10542 * Indicates whether the device is in kids nav mode.
10543 * <p>Type: int (0 for false, 1 for true)
10544 *
10545 * @hide
10546 */
10547 public static final String NAV_BAR_KIDS_MODE = "nav_bar_kids_mode";
10548
10549 /**
10550 * Navigation bar mode.
10551 * 0 = 3 button
10552 * 1 = 2 button
10553 * 2 = fully gestural
10554 * @hide
10555 */
10556 @Readable
10557 public static final String NAVIGATION_MODE =
10558 "navigation_mode";
10559
10560 /**
10561 * Scale factor for the back gesture inset size on the left side of the screen.
10562 * @hide
10563 */
10564 @Readable
10565 public static final String BACK_GESTURE_INSET_SCALE_LEFT =
10566 "back_gesture_inset_scale_left";
10567
10568 /**
10569 * Scale factor for the back gesture inset size on the right side of the screen.
10570 * @hide
10571 */
10572 @Readable
10573 public static final String BACK_GESTURE_INSET_SCALE_RIGHT =
10574 "back_gesture_inset_scale_right";
10575
10576 /**
10577 * Current provider of proximity-based sharing services.
10578 * Default value in @string/config_defaultNearbySharingComponent.
10579 * No VALIDATOR as this setting will not be backed up.
10580 * @hide
10581 */
10582 @Readable
10583 public static final String NEARBY_SHARING_COMPONENT = "nearby_sharing_component";
10584
10585 /**
10586 * Nearby Sharing Slice URI for the SliceProvider to
10587 * read Nearby Sharing scan results and then draw the UI.
10588 * @hide
10589 */
10590 public static final String NEARBY_SHARING_SLICE_URI = "nearby_sharing_slice_uri";
10591
10592 /**
10593 * Current provider of Fast Pair saved devices page.
10594 * Default value in @string/config_defaultNearbyFastPairSettingsDevicesComponent.
10595 * No VALIDATOR as this setting will not be backed up.
10596 * @hide
10597 */
10598 public static final String NEARBY_FAST_PAIR_SETTINGS_DEVICES_COMPONENT =
10599 "nearby_fast_pair_settings_devices_component";
10600
10601 /**
10602 * Current provider of the component for requesting ambient context consent.
10603 * Default value in @string/config_defaultAmbientContextConsentComponent.
10604 * No VALIDATOR as this setting will not be backed up.
10605 * @hide
10606 */
10607 public static final String AMBIENT_CONTEXT_CONSENT_COMPONENT =
10608 "ambient_context_consent_component";
10609
10610 /**
10611 * Current provider of the intent extra key for the caller's package name while
10612 * requesting ambient context consent.
10613 * No VALIDATOR as this setting will not be backed up.
10614 * @hide
10615 */
10616 public static final String AMBIENT_CONTEXT_PACKAGE_NAME_EXTRA_KEY =
10617 "ambient_context_package_name_key";
10618
10619 /**
10620 * Current provider of the intent extra key for the event code int array while
10621 * requesting ambient context consent.
10622 * Default value in @string/config_ambientContextEventArrayExtraKey.
10623 * No VALIDATOR as this setting will not be backed up.
10624 * @hide
10625 */
10626 public static final String AMBIENT_CONTEXT_EVENT_ARRAY_EXTRA_KEY =
10627 "ambient_context_event_array_key";
10628
10629 /**
10630 * Controls whether aware is enabled.
10631 * @hide
10632 */
10633 @Readable
10634 public static final String AWARE_ENABLED = "aware_enabled";
10635
10636 /**
10637 * Controls whether aware_lock is enabled.
10638 * @hide
10639 */
10640 @Readable
10641 public static final String AWARE_LOCK_ENABLED = "aware_lock_enabled";
10642
10643 /**
10644 * Controls whether tap gesture is enabled.
10645 * @hide
10646 */
10647 @Readable
10648 public static final String TAP_GESTURE = "tap_gesture";
10649
10650 /**
10651 * Controls whether the people strip is enabled.
10652 * @hide
10653 */
10654 @Readable
10655 public static final String PEOPLE_STRIP = "people_strip";
10656
10657 /**
10658 * Whether or not to enable media resumption
10659 * When enabled, media controls in quick settings will populate on boot and persist if
10660 * resumable via a MediaBrowserService.
10661 * @see Settings.Global#SHOW_MEDIA_ON_QUICK_SETTINGS
10662 * @hide
10663 */
10664 @Readable
10665 public static final String MEDIA_CONTROLS_RESUME = "qs_media_resumption";
10666
10667 /**
10668 * Whether to enable media controls on lock screen.
10669 * When enabled, media controls will appear on lock screen.
10670 * @hide
10671 */
10672 public static final String MEDIA_CONTROLS_LOCK_SCREEN = "media_controls_lock_screen";
10673
10674 /**
10675 * Controls whether contextual suggestions can be shown in the media controls.
10676 * @hide
10677 */
10678 public static final String MEDIA_CONTROLS_RECOMMENDATION = "qs_media_recommend";
10679
10680 /**
10681 * Controls magnification mode when magnification is enabled via a system-wide triple tap
10682 * gesture or the accessibility shortcut.
10683 *
10684 * @see #ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN
10685 * @see #ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW
10686 * @hide
10687 */
10688 @TestApi
10689 @Readable
10690 public static final String ACCESSIBILITY_MAGNIFICATION_MODE =
10691 "accessibility_magnification_mode";
10692
10693 /**
10694 * Magnification mode value that is a default value for the magnification logging feature.
10695 * @hide
10696 */
10697 public static final int ACCESSIBILITY_MAGNIFICATION_MODE_NONE = 0x0;
10698
10699 /**
10700 * Magnification mode value that magnifies whole display.
10701 * @hide
10702 */
10703 @TestApi
10704 public static final int ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN = 0x1;
10705
10706 /**
10707 * Magnification mode value that magnifies magnify particular region in a window
10708 * @hide
10709 */
10710 @TestApi
10711 public static final int ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW = 0x2;
10712
10713 /**
10714 * Magnification mode value that is capable of magnifying whole display and particular
10715 * region in a window.
10716 * @hide
10717 */
10718 @TestApi
10719 public static final int ACCESSIBILITY_MAGNIFICATION_MODE_ALL = 0x3;
10720
10721 /**
10722 * Whether the following typing focus feature for magnification is enabled.
10723 * @hide
10724 */
10725 public static final String ACCESSIBILITY_MAGNIFICATION_FOLLOW_TYPING_ENABLED =
10726 "accessibility_magnification_follow_typing_enabled";
10727
10728 /**
10729 * Controls magnification capability. Accessibility magnification is capable of at least one
10730 * of the magnification modes.
10731 *
10732 * @see #ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN
10733 * @see #ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW
10734 * @see #ACCESSIBILITY_MAGNIFICATION_MODE_ALL
10735 * @hide
10736 */
10737 @TestApi
10738 @Readable
10739 public static final String ACCESSIBILITY_MAGNIFICATION_CAPABILITY =
10740 "accessibility_magnification_capability";
10741
10742 /**
10743 * Whether to show the window magnification prompt dialog when the user uses full-screen
10744 * magnification first time after database is upgraded.
10745 *
10746 * @hide
10747 */
10748 public static final String ACCESSIBILITY_SHOW_WINDOW_MAGNIFICATION_PROMPT =
10749 "accessibility_show_window_magnification_prompt";
10750
10751 /**
10752 * Controls the accessibility button mode. System will force-set the value to {@link
10753 * #ACCESSIBILITY_BUTTON_MODE_GESTURE} if {@link #NAVIGATION_MODE} is button; force-set the
10754 * value to {@link ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR} if {@link #NAVIGATION_MODE} is
10755 * gestural; otherwise, remain the option.
10756 * <ul>
10757 * <li> 0 = button in navigation bar </li>
10758 * <li> 1 = button floating on the display </li>
10759 * <li> 2 = button using gesture to trigger </li>
10760 * </ul>
10761 *
10762 * @see #ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR
10763 * @see #ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU
10764 * @see #ACCESSIBILITY_BUTTON_MODE_GESTURE
10765 * @hide
10766 */
10767 public static final String ACCESSIBILITY_BUTTON_MODE =
10768 "accessibility_button_mode";
10769
10770 /**
10771 * Accessibility button mode value that specifying the accessibility service or feature to
10772 * be toggled via the button in the navigation bar.
10773 *
10774 * @hide
10775 */
10776 public static final int ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR = 0x0;
10777
10778 /**
10779 * Accessibility button mode value that specifying the accessibility service or feature to
10780 * be toggled via the button floating on the display.
10781 *
10782 * @hide
10783 */
10784 public static final int ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU = 0x1;
10785
10786 /**
10787 * Accessibility button mode value that specifying the accessibility service or feature to
10788 * be toggled via the gesture.
10789 *
10790 * @hide
10791 */
10792 public static final int ACCESSIBILITY_BUTTON_MODE_GESTURE = 0x2;
10793
10794 /**
10795 * The size of the accessibility floating menu.
10796 * <ul>
10797 * <li> 0 = small size
10798 * <li> 1 = large size
10799 * </ul>
10800 *
10801 * @hide
10802 */
10803 public static final String ACCESSIBILITY_FLOATING_MENU_SIZE =
10804 "accessibility_floating_menu_size";
10805
10806 /**
10807 * The icon type of the accessibility floating menu.
10808 * <ul>
10809 * <li> 0 = full circle type
10810 * <li> 1 = half circle type
10811 * </ul>
10812 *
10813 * @hide
10814 */
10815 public static final String ACCESSIBILITY_FLOATING_MENU_ICON_TYPE =
10816 "accessibility_floating_menu_icon_type";
10817
10818 /**
10819 * Whether the fade effect for the accessibility floating menu is enabled.
10820 *
10821 * @hide
10822 */
10823 public static final String ACCESSIBILITY_FLOATING_MENU_FADE_ENABLED =
10824 "accessibility_floating_menu_fade_enabled";
10825
10826 /**
10827 * The opacity value for the accessibility floating menu fade out effect, from 0.0
10828 * (transparent) to 1.0 (opaque).
10829 *
10830 * @hide
10831 */
10832 public static final String ACCESSIBILITY_FLOATING_MENU_OPACITY =
10833 "accessibility_floating_menu_opacity";
10834
10835 /**
10836 * Prompts the user to the Accessibility button is replaced with the floating menu.
10837 * <ul>
10838 * <li> 0 = disabled </li>
10839 * <li> 1 = enabled </li>
10840 * </ul>
10841 *
10842 * @hide
10843 */
10844 public static final String ACCESSIBILITY_FLOATING_MENU_MIGRATION_TOOLTIP_PROMPT =
10845 "accessibility_floating_menu_migration_tooltip_prompt";
10846
10847 /**
10848 * Whether the Adaptive connectivity option is enabled.
10849 *
10850 * @hide
10851 */
10852 public static final String ADAPTIVE_CONNECTIVITY_ENABLED = "adaptive_connectivity_enabled";
10853
10854 /**
10855 * Keys we no longer back up under the current schema, but want to continue to
10856 * process when restoring historical backup datasets.
10857 *
10858 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
10859 * otherwise they won't be restored.
10860 *
10861 * @hide
10862 */
10863 @Readable
10864 public static final String[] LEGACY_RESTORE_SETTINGS = {
10865 ENABLED_NOTIFICATION_LISTENERS,
10866 ENABLED_NOTIFICATION_ASSISTANT,
10867 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES
10868 };
10869
10870 /**
10871 * How long Assistant handles have enabled in milliseconds.
10872 *
10873 * @hide
10874 */
10875 public static final String ASSIST_HANDLES_LEARNING_TIME_ELAPSED_MILLIS =
10876 "reminder_exp_learning_time_elapsed";
10877
10878 /**
10879 * How many times the Assistant has been triggered using the touch gesture.
10880 *
10881 * @hide
10882 */
10883 public static final String ASSIST_HANDLES_LEARNING_EVENT_COUNT =
10884 "reminder_exp_learning_event_count";
10885
10886 /**
10887 * Whether to show clipboard access notifications.
10888 *
10889 * @hide
10890 */
10891 public static final String CLIPBOARD_SHOW_ACCESS_NOTIFICATIONS =
10892 "clipboard_show_access_notifications";
10893
10894 /**
10895 * If nonzero, nas has not been updated to reflect new changes.
10896 * @hide
10897 */
10898 @Readable
10899 public static final String NAS_SETTINGS_UPDATED = "nas_settings_updated";
10900
10901 /**
10902 * Control whether Game Dashboard shortcut is always on for all games.
10903 * @hide
10904 */
10905 @Readable
10906 public static final String GAME_DASHBOARD_ALWAYS_ON = "game_dashboard_always_on";
10907
10908
10909 /**
10910 * For this device state, no specific auto-rotation lock setting should be applied.
10911 * If the user toggles the auto-rotate lock in this state, the setting will apply to the
10912 * previously valid device state.
10913 * @hide
10914 */
10915 public static final int DEVICE_STATE_ROTATION_LOCK_IGNORED = 0;
10916 /**
10917 * For this device state, the setting for auto-rotation is locked.
10918 * @hide
10919 */
10920 public static final int DEVICE_STATE_ROTATION_LOCK_LOCKED = 1;
10921 /**
10922 * For this device state, the setting for auto-rotation is unlocked.
10923 * @hide
10924 */
10925 public static final int DEVICE_STATE_ROTATION_LOCK_UNLOCKED = 2;
10926
10927 /**
10928 * The different settings that can be used as values with
10929 * {@link #DEVICE_STATE_ROTATION_LOCK}.
10930 * @hide
10931 */
10932 @IntDef(prefix = {"DEVICE_STATE_ROTATION_LOCK_"}, value = {
10933 DEVICE_STATE_ROTATION_LOCK_IGNORED,
10934 DEVICE_STATE_ROTATION_LOCK_LOCKED,
10935 DEVICE_STATE_ROTATION_LOCK_UNLOCKED,
10936 })
10937 @Retention(RetentionPolicy.SOURCE)
10938 public @interface DeviceStateRotationLockSetting {
10939 }
10940
10941 /**
10942 * Rotation lock setting keyed on device state.
10943 *
10944 * This holds a serialized map using int keys that represent Device States and value of
10945 * {@link DeviceStateRotationLockSetting} representing the rotation lock setting for that
10946 * device state.
10947 *
10948 * Serialized as key0:value0:key1:value1:...:keyN:valueN.
10949 *
10950 * Example: "0:1:1:2:2:1"
10951 * This example represents a map of:
10952 * <ul>
10953 * <li>0 -> DEVICE_STATE_ROTATION_LOCK_LOCKED</li>
10954 * <li>1 -> DEVICE_STATE_ROTATION_LOCK_UNLOCKED</li>
10955 * <li>2 -> DEVICE_STATE_ROTATION_LOCK_IGNORED</li>
10956 * </ul>
10957 *
10958 * @hide
10959 */
10960 public static final String DEVICE_STATE_ROTATION_LOCK =
10961 "device_state_rotation_lock";
10962
10963 /**
10964 * Control whether communal mode is allowed on this device.
10965 *
10966 * @hide
10967 */
10968 public static final String COMMUNAL_MODE_ENABLED = "communal_mode_enabled";
10969
10970 /**
10971 * An array of SSIDs of Wi-Fi networks that, when connected, are considered safe to enable
10972 * the communal mode.
10973 *
10974 * @hide
10975 */
10976 public static final String COMMUNAL_MODE_TRUSTED_NETWORKS =
10977 "communal_mode_trusted_networks";
10978
10979 /**
10980 * Setting to store denylisted system languages by the CEC {@code <Set Menu Language>}
10981 * confirmation dialog.
10982 *
10983 * @hide
10984 */
10985 public static final String HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST =
10986 "hdmi_cec_set_menu_language_denylist";
10987
10988 /**
10989 * Whether the Taskbar Education is about to be shown or is currently showing.
10990 *
10991 * <p>1 if true, 0 or unset otherwise.
10992 *
10993 * <p>This setting is used to inform other components that the Taskbar Education is
10994 * currently showing, which can prevent them from showing something else to the user.
10995 *
10996 * @hide
10997 */
10998 public static final String LAUNCHER_TASKBAR_EDUCATION_SHOWING =
10999 "launcher_taskbar_education_showing";
11000
11001 /**
11002 * Whether or not adaptive charging feature is enabled by user.
11003 * Type: int (0 for false, 1 for true)
11004 * Default: 1
11005 *
11006 * @hide
11007 */
11008 public static final String ADAPTIVE_CHARGING_ENABLED = "adaptive_charging_enabled";
11009
11010 /**
11011 * Whether battery saver is currently set to different schedule mode.
11012 *
11013 * @hide
11014 */
11015 public static final String EXTRA_AUTOMATIC_POWER_SAVE_MODE =
11016 "extra_automatic_power_save_mode";
11017
11018 /**
11019 * These entries are considered common between the personal and the managed profile,
11020 * since the managed profile doesn't get to change them.
11021 */
11022 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
11023
11024 static {
11025 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
11026 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
11027 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
11028 CLONE_TO_MANAGED_PROFILE.add(CONTENT_CAPTURE_ENABLED);
11029 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
11030 CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER);
11031 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
11032 CLONE_TO_MANAGED_PROFILE.add(SHOW_IME_WITH_HARD_KEYBOARD);
11033 CLONE_TO_MANAGED_PROFILE.add(NOTIFICATION_BUBBLES);
11034 }
11035
11036 /** @hide */
11037 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
11038 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
11039 }
11040
11041 /**
11042 * Secure settings which can be accessed by instant apps.
11043 * @hide
11044 */
11045 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
11046 static {
11047 INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES);
11048 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD);
11049 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED);
11050 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED);
11051 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET);
11052 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE);
11053 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR);
11054 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE);
11055 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR);
11056 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR);
11057 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE);
11058 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE);
11059 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR);
11060 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED);
11061 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER);
11062 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY);
11063 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED);
11064 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON);
11065
11066 INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD);
11067 INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS);
11068
11069 INSTANT_APP_SETTINGS.add(ANDROID_ID);
11070
11071 INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION);
11072 }
11073
11074 /**
11075 * Helper method for determining if a location provider is enabled.
11076 *
11077 * @param cr the content resolver to use
11078 * @param provider the location provider to query
11079 * @return true if the provider is enabled
11080 *
11081 * @deprecated use {@link LocationManager#isProviderEnabled(String)}
11082 */
11083 @Deprecated
11084 public static boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
11085 IBinder binder = ServiceManager.getService(Context.LOCATION_SERVICE);
11086 ILocationManager lm = Objects.requireNonNull(ILocationManager.Stub.asInterface(binder));
11087 try {
11088 return lm.isProviderEnabledForUser(provider, cr.getUserId());
11089 } catch (RemoteException e) {
11090 throw e.rethrowFromSystemServer();
11091 }
11092 }
11093
11094 /**
11095 * Thread-safe method for enabling or disabling a single location provider. This will have
11096 * no effect on Android Q and above.
11097 * @param cr the content resolver to use
11098 * @param provider the location provider to enable or disable
11099 * @param enabled true if the provider should be enabled
11100 * @deprecated This API is deprecated
11101 */
11102 @Deprecated
11103 public static void setLocationProviderEnabled(ContentResolver cr,
11104 String provider, boolean enabled) {
11105 }
11106 }
11107
11108 /**
11109 * Global system settings, containing preferences that always apply identically
11110 * to all defined users. Applications can read these but are not allowed to write;
11111 * like the "Secure" settings, these are for preferences that the user must
11112 * explicitly modify through the system UI or specialized APIs for those values.
11113 */
11114 public static final class Global extends NameValueTable {
11115 // NOTE: If you add new settings here, be sure to add them to
11116 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked.
11117
11118 /**
11119 * The content:// style URL for global secure settings items. Not public.
11120 */
11121 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
11122
11123 /**
11124 * Whether the notification bubbles are globally enabled
11125 * The value is boolean (1 or 0).
11126 * @hide
11127 * @deprecated moved to secure settings.
11128 */
11129 @Deprecated
11130 @TestApi
11131 @Readable
11132 public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
11133
11134 /**
11135 * Whether users are allowed to add more users or guest from lockscreen.
11136 * <p>
11137 * Type: int
11138 * @hide
11139 */
11140 @Readable
11141 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
11142
11143 /**
11144 * Whether guest user should be removed on exit from guest mode.
11145 * <p>
11146 * Type: int
11147 * @hide
11148 */
11149 public static final String REMOVE_GUEST_ON_EXIT = "remove_guest_on_exit";
11150
11151 /**
11152 * Whether applying ramping ringer on incoming phone call ringtone.
11153 * <p>1 = apply ramping ringer
11154 * <p>0 = do not apply ramping ringer
11155 * @deprecated Use {@link AudioManager#isRampingRingerEnabled()} instead
11156 */
11157 @Deprecated
11158 @Readable
11159 public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer";
11160
11161 /**
11162 * Setting whether the global gesture for enabling accessibility is enabled.
11163 * If this gesture is enabled the user will be able to perfrom it to enable
11164 * the accessibility state without visiting the settings app.
11165 *
11166 * @hide
11167 * No longer used. Should be removed once all dependencies have been updated.
11168 */
11169 @UnsupportedAppUsage
11170 @Readable
11171 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
11172 "enable_accessibility_global_gesture_enabled";
11173
11174 /**
11175 * Whether Airplane Mode is on.
11176 */
11177 @Readable
11178 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
11179
11180 /**
11181 * Whether Theater Mode is on.
11182 * {@hide}
11183 */
11184 @SystemApi
11185 @Readable
11186 public static final String THEATER_MODE_ON = "theater_mode_on";
11187
11188 /**
11189 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
11190 */
11191 @Readable
11192 public static final String RADIO_BLUETOOTH = "bluetooth";
11193
11194 /**
11195 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
11196 */
11197 @Readable
11198 public static final String RADIO_WIFI = "wifi";
11199
11200 /**
11201 * {@hide}
11202 */
11203 @Readable
11204 public static final String RADIO_WIMAX = "wimax";
11205 /**
11206 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
11207 */
11208 @Readable
11209 public static final String RADIO_CELL = "cell";
11210
11211 /**
11212 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
11213 */
11214 @Readable
11215 public static final String RADIO_NFC = "nfc";
11216
11217 /**
11218 * A comma separated list of radios that need to be disabled when airplane mode
11219 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
11220 * included in the comma separated list.
11221 */
11222 @Readable
11223 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
11224
11225 /**
11226 * A comma separated list of radios that should to be disabled when airplane mode
11227 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
11228 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
11229 * will be turned off when entering airplane mode, but the user will be able to reenable
11230 * Wifi in the Settings app.
11231 * @hide
11232 */
11233 @SystemApi
11234 @Readable
11235 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
11236
11237 /**
11238 * An integer representing the Bluetooth Class of Device (CoD).
11239 *
11240 * @hide
11241 */
11242 @Readable
11243 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
11244 @SuppressLint("NoSettingsProvider")
11245 public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device";
11246
11247 /**
11248 * A Long representing a bitmap of profiles that should be disabled when bluetooth starts.
11249 * See {@link android.bluetooth.BluetoothProfile}.
11250 * {@hide}
11251 */
11252 @Readable
11253 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
11254 @SuppressLint("NoSettingsProvider")
11255 public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";
11256
11257 /**
11258 * A semi-colon separated list of Bluetooth interoperability workarounds.
11259 * Each entry is a partial Bluetooth device address string and an integer representing
11260 * the feature to be disabled, separated by a comma. The integer must correspond
11261 * to a interoperability feature as defined in "interop.h" in /system/bt.
11262 * <p>
11263 * Example: <br/>
11264 * "00:11:22,0;01:02:03:04,2"
11265 * @hide
11266 */
11267 @Readable
11268 public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";
11269
11270 /**
11271 * The policy for deciding when Wi-Fi should go to sleep (which will in
11272 * turn switch to using the mobile data as an Internet connection).
11273 * <p>
11274 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
11275 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
11276 * {@link #WIFI_SLEEP_POLICY_NEVER}.
11277 * @deprecated This is no longer used or set by the platform.
11278 */
11279 @Deprecated
11280 @Readable
11281 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
11282
11283 /**
11284 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
11285 * policy, which is to sleep shortly after the turning off
11286 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
11287 * @deprecated This is no longer used by the platform.
11288 */
11289 @Deprecated
11290 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
11291
11292 /**
11293 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
11294 * the device is on battery, and never go to sleep when the device is
11295 * plugged in.
11296 * @deprecated This is no longer used by the platform.
11297 */
11298 @Deprecated
11299 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
11300
11301 /**
11302 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
11303 * @deprecated This is no longer used by the platform.
11304 */
11305 @Deprecated
11306 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
11307
11308 /**
11309 * Value to specify if the device's UTC system clock should be set automatically, e.g. using
11310 * telephony signals like NITZ, or other sources like GNSS or NTP. 1=yes, 0=no (manual)
11311 */
11312 @Readable
11313 public static final String AUTO_TIME = "auto_time";
11314
11315 /**
11316 * Value to specify if the device's time zone system property should be set automatically,
11317 * e.g. using telephony signals like MCC and NITZ, or other mechanisms like the location.
11318 * 1=yes, 0=no (manual).
11319 */
11320 @Readable
11321 public static final String AUTO_TIME_ZONE = "auto_time_zone";
11322
11323 /**
11324 * URI for the car dock "in" event sound.
11325 * @hide
11326 */
11327 @Readable
11328 public static final String CAR_DOCK_SOUND = "car_dock_sound";
11329
11330 /**
11331 * URI for the car dock "out" event sound.
11332 * @hide
11333 */
11334 @Readable
11335 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
11336
11337 /**
11338 * URI for the desk dock "in" event sound.
11339 * @hide
11340 */
11341 @Readable
11342 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
11343
11344 /**
11345 * URI for the desk dock "out" event sound.
11346 * @hide
11347 */
11348 @Readable
11349 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
11350
11351 /**
11352 * Whether to play a sound for dock events.
11353 * @hide
11354 */
11355 @Readable
11356 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
11357
11358 /**
11359 * Whether to play a sound for dock events, only when an accessibility service is on.
11360 * @hide
11361 */
11362 @Readable
11363 public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility";
11364
11365 /**
11366 * URI for the "device locked" (keyguard shown) sound.
11367 * @hide
11368 */
11369 @Readable
11370 public static final String LOCK_SOUND = "lock_sound";
11371
11372 /**
11373 * URI for the "device unlocked" sound.
11374 * @hide
11375 */
11376 @Readable
11377 public static final String UNLOCK_SOUND = "unlock_sound";
11378
11379 /**
11380 * URI for the "device is trusted" sound, which is played when the device enters the trusted
11381 * state without unlocking.
11382 * @hide
11383 */
11384 @Readable
11385 public static final String TRUSTED_SOUND = "trusted_sound";
11386
11387 /**
11388 * URI for the low battery sound file.
11389 * @hide
11390 */
11391 @Readable
11392 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
11393
11394 /**
11395 * Whether to play a sound for low-battery alerts.
11396 * @hide
11397 */
11398 @Readable
11399 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
11400
11401 /**
11402 * URI for the "wireless charging started" sound.
11403 * @hide
11404 */
11405 @Readable
11406 public static final String WIRELESS_CHARGING_STARTED_SOUND =
11407 "wireless_charging_started_sound";
11408
11409 /**
11410 * URI for "wired charging started" sound.
11411 * @hide
11412 */
11413 @Readable
11414 public static final String CHARGING_STARTED_SOUND = "charging_started_sound";
11415
11416 /**
11417 * Whether to play a sound for charging events.
11418 * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_SOUNDS_ENABLED} instead
11419 * @hide
11420 */
11421 @Deprecated
11422 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
11423
11424 /**
11425 * Whether to vibrate for wireless charging events.
11426 * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_VIBRATION_ENABLED}
11427 * @hide
11428 */
11429 @Deprecated
11430 public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled";
11431
11432 /**
11433 * Whether we keep the device on while the device is plugged in.
11434 * Supported values are:
11435 * <ul>
11436 * <li>{@code 0} to never stay on while plugged in</li>
11437 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
11438 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
11439 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
11440 * <li>{@link BatteryManager#BATTERY_PLUGGED_DOCK} to stay on for dock charger</li>
11441 * </ul>
11442 * These values can be OR-ed together.
11443 */
11444 @Readable
11445 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
11446
11447 /**
11448 * When the user has enable the option to have a "bug report" command
11449 * in the power menu.
11450 * @hide
11451 */
11452 @Readable
11453 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
11454
11455 /**
11456 * The package name for the custom bugreport handler app. This app must be whitelisted.
11457 * This is currently used only by Power Menu short press.
11458 *
11459 * @hide
11460 */
11461 @Readable
11462 public static final String CUSTOM_BUGREPORT_HANDLER_APP = "custom_bugreport_handler_app";
11463
11464 /**
11465 * The user id for the custom bugreport handler app. This is currently used only by Power
11466 * Menu short press.
11467 *
11468 * @hide
11469 */
11470 @Readable
11471 public static final String CUSTOM_BUGREPORT_HANDLER_USER = "custom_bugreport_handler_user";
11472
11473 /**
11474 * Whether ADB over USB is enabled.
11475 */
11476 @Readable
11477 public static final String ADB_ENABLED = "adb_enabled";
11478
11479 /**
11480 * Whether ADB over Wifi is enabled.
11481 * @hide
11482 */
11483 @Readable
11484 public static final String ADB_WIFI_ENABLED = "adb_wifi_enabled";
11485
11486 /**
11487 * Whether Views are allowed to save their attribute data.
11488 * @hide
11489 */
11490 @Readable
11491 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
11492
11493 /**
11494 * Which application package is allowed to save View attribute data.
11495 * @hide
11496 */
11497 @Readable
11498 public static final String DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE =
11499 "debug_view_attributes_application_package";
11500
11501 /**
11502 * Whether assisted GPS should be enabled or not.
11503 * @hide
11504 */
11505 @Readable
11506 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
11507
11508 /**
11509 * Whether bluetooth is enabled/disabled
11510 * 0=disabled. 1=enabled.
11511 */
11512 @Readable
11513 public static final String BLUETOOTH_ON = "bluetooth_on";
11514
11515 /**
11516 * CDMA Cell Broadcast SMS
11517 * 0 = CDMA Cell Broadcast SMS disabled
11518 * 1 = CDMA Cell Broadcast SMS enabled
11519 * @hide
11520 */
11521 @Readable
11522 public static final String CDMA_CELL_BROADCAST_SMS =
11523 "cdma_cell_broadcast_sms";
11524
11525 /**
11526 * The CDMA roaming mode 0 = Home Networks, CDMA default
11527 * 1 = Roaming on Affiliated networks
11528 * 2 = Roaming on any networks
11529 * @hide
11530 */
11531 @Readable
11532 public static final String CDMA_ROAMING_MODE = "roaming_settings";
11533
11534 /**
11535 * The CDMA subscription mode 0 = RUIM/SIM (default)
11536 * 1 = NV
11537 * @hide
11538 */
11539 @Readable
11540 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
11541
11542 /**
11543 * The default value for whether background data is enabled or not.
11544 *
11545 * Used by {@code NetworkPolicyManagerService}.
11546 *
11547 * @hide
11548 */
11549 @Readable
11550 public static final String DEFAULT_RESTRICT_BACKGROUND_DATA =
11551 "default_restrict_background_data";
11552
11553 /** Inactivity timeout to track mobile data activity.
11554 *
11555 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
11556 * infer the data activity of mobile network. After a period of no activity on mobile
11557 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
11558 * intent is fired to indicate a transition of network status from "active" to "idle". Any
11559 * subsequent activity on mobile networks triggers the firing of {@code
11560 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
11561 *
11562 * Network activity refers to transmitting or receiving data on the network interfaces.
11563 *
11564 * Tracking is disabled if set to zero or negative value.
11565 *
11566 * @hide
11567 */
11568 @Readable
11569 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
11570
11571 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
11572 * but for Wifi network.
11573 * @hide
11574 */
11575 @Readable
11576 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
11577
11578 /**
11579 * Whether or not data roaming is enabled. (0 = false, 1 = true)
11580 * Use {@link TelephonyManager#isDataRoamingEnabled} instead of calling via settings.
11581 */
11582 @Readable(maxTargetSdk = Build.VERSION_CODES.S_V2)
11583 public static final String DATA_ROAMING = "data_roaming";
11584
11585 /**
11586 * The value passed to a Mobile DataConnection via bringUp which defines the
11587 * number of retries to perform when setting up the initial connection. The default
11588 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
11589 * @hide
11590 */
11591 @Readable
11592 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
11593
11594 /**
11595 * Whether any package can be on external storage. When this is true, any
11596 * package, regardless of manifest values, is a candidate for installing
11597 * or moving onto external storage. (0 = false, 1 = true)
11598 * @hide
11599 */
11600 @Readable
11601 public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external";
11602
11603 /**
11604 * The default SM-DP+ configured for this device.
11605 *
11606 * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to
11607 * download profiles. If this value is set, the LPA will query this server for any profiles
11608 * available to this device. If any are available, they may be downloaded during device
11609 * provisioning or in settings without needing the user to enter an activation code.
11610 *
11611 * @see android.service.euicc.EuiccService
11612 * @hide
11613 */
11614 @SystemApi
11615 @Readable
11616 public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
11617
11618 /**
11619 * Whether any profile has ever been downloaded onto a eUICC on the device.
11620 *
11621 * <p>Used to hide eUICC UI from users who have never made use of it and would only be
11622 * confused by seeing references to it in settings.
11623 * (0 = false, 1 = true)
11624 * @hide
11625 */
11626 @SystemApi
11627 @Readable
11628 public static final String EUICC_PROVISIONED = "euicc_provisioned";
11629
11630 /**
11631 * List of ISO country codes in which eUICC UI is shown. Country codes should be separated
11632 * by comma.
11633 *
11634 * Note: if {@link #EUICC_SUPPORTED_COUNTRIES} is empty, then {@link
11635 * #EUICC_UNSUPPORTED_COUNTRIES} is used.
11636 *
11637 * <p>Used to hide eUICC UI from users who are currently in countries where no carriers
11638 * support eUICC.
11639 *
11640 * @hide
11641 */
11642 @SystemApi
11643 @Readable
11644 public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries";
11645
11646 /**
11647 * List of ISO country codes in which eUICC UI is not shown. Country codes should be
11648 * separated by comma.
11649 *
11650 * Note: if {@link #EUICC_SUPPORTED_COUNTRIES} is empty, then {@link
11651 * #EUICC_UNSUPPORTED_COUNTRIES} is used.
11652 *
11653 * <p>Used to hide eUICC UI from users who are currently in countries where no carriers
11654 * support eUICC.
11655 *
11656 * @hide
11657 */
11658 @SystemApi
11659 @Readable
11660 public static final String EUICC_UNSUPPORTED_COUNTRIES = "euicc_unsupported_countries";
11661
11662 /**
11663 * Whether any activity can be resized. When this is true, any
11664 * activity, regardless of manifest values, can be resized for multi-window.
11665 * (0 = false, 1 = true)
11666 * @hide
11667 */
11668 @Readable
11669 public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES
11670 = "force_resizable_activities";
11671
11672 /**
11673 * Whether to enable experimental freeform support for windows.
11674 * @hide
11675 */
11676 @Readable
11677 public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT
11678 = "enable_freeform_support";
11679
11680 /**
11681 * Whether to enable experimental desktop mode on secondary displays.
11682 * @hide
11683 */
11684 @Readable
11685 public static final String DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS =
11686 "force_desktop_mode_on_external_displays";
11687
11688 /**
11689 * Whether to allow non-resizable apps to be shown in multi-window. The app will be
11690 * letterboxed if the request orientation is not met, and will be shown in size-compat
11691 * mode if the container size has changed.
11692 * @hide
11693 */
11694 @TestApi
11695 @Readable
11696 @SuppressLint("NoSettingsProvider")
11697 public static final String DEVELOPMENT_ENABLE_NON_RESIZABLE_MULTI_WINDOW =
11698 "enable_non_resizable_multi_window";
11699
11700 /**
11701 * If true, shadows drawn around the window will be rendered by the system compositor. If
11702 * false, shadows will be drawn by the client by setting an elevation on the root view and
11703 * the contents will be inset by the surface insets.
11704 * (0 = false, 1 = true)
11705 * @hide
11706 */
11707 @Readable
11708 public static final String DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR =
11709 "render_shadows_in_compositor";
11710
11711 /**
11712 * If true, submit buffers using blast in ViewRootImpl.
11713 * (0 = false, 1 = true)
11714 * @hide
11715 */
11716 @Readable
11717 public static final String DEVELOPMENT_USE_BLAST_ADAPTER_VR =
11718 "use_blast_adapter_vr";
11719
11720 /**
11721 * Path to the WindowManager display settings file. If unset, the default file path will
11722 * be used.
11723 *
11724 * @hide
11725 */
11726 public static final String DEVELOPMENT_WM_DISPLAY_SETTINGS_PATH =
11727 "wm_display_settings_path";
11728
11729 /**
11730 * Whether user has enabled development settings.
11731 */
11732 @Readable
11733 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
11734
11735 /**
11736 * Whether the device has been provisioned (0 = false, 1 = true).
11737 * <p>On a multiuser device with a separate system user, the screen may be locked
11738 * as soon as this is set to true and further activities cannot be launched on the
11739 * system user unless they are marked to show over keyguard.
11740 */
11741 @Readable
11742 public static final String DEVICE_PROVISIONED = "device_provisioned";
11743
11744 /**
11745 * Whether bypassing the device policy management role holder qualifcation is allowed,
11746 * (0 = false, 1 = true).
11747 *
11748 * @hide
11749 */
11750 public static final String BYPASS_DEVICE_POLICY_MANAGEMENT_ROLE_QUALIFICATIONS =
11751 "bypass_device_policy_management_role_qualifications";
11752
11753 /**
11754 * Indicates whether mobile data should be allowed while the device is being provisioned.
11755 * This allows the provisioning process to turn off mobile data before the user
11756 * has an opportunity to set things up, preventing other processes from burning
11757 * precious bytes before wifi is setup.
11758 * <p>
11759 * Type: int (0 for false, 1 for true)
11760 *
11761 * @hide
11762 */
11763 @SystemApi
11764 @Readable
11765 public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED =
11766 "device_provisioning_mobile_data";
11767
11768 /**
11769 * The saved value for WindowManagerService.setForcedDisplaySize().
11770 * Two integers separated by a comma. If unset, then use the real display size.
11771 * @hide
11772 */
11773 @Readable
11774 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
11775
11776 /**
11777 * The saved value for WindowManagerService.setForcedDisplayScalingMode().
11778 * 0 or unset if scaling is automatic, 1 if scaling is disabled.
11779 * @hide
11780 */
11781 @Readable
11782 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
11783
11784 /**
11785 * The maximum size, in bytes, of a download that the download manager will transfer over
11786 * a non-wifi connection.
11787 * @hide
11788 */
11789 @Readable
11790 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
11791 "download_manager_max_bytes_over_mobile";
11792
11793 /**
11794 * The recommended maximum size, in bytes, of a download that the download manager should
11795 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
11796 * have the option to start the download over the mobile connection anyway.
11797 * @hide
11798 */
11799 @Readable
11800 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
11801 "download_manager_recommended_max_bytes_over_mobile";
11802
11803 /**
11804 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
11805 */
11806 @Deprecated
11807 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
11808
11809 /**
11810 * Whether or not media is shown automatically when bypassing as a heads up.
11811 * @hide
11812 */
11813 @Readable
11814 public static final String SHOW_MEDIA_ON_QUICK_SETTINGS =
11815 "qs_media_controls";
11816
11817 /**
11818 * The interval in milliseconds at which location requests will be throttled when they are
11819 * coming from the background.
11820 *
11821 * @hide
11822 */
11823 @Readable
11824 public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS =
11825 "location_background_throttle_interval_ms";
11826
11827 /**
11828 * Most frequent location update interval in milliseconds that proximity alert is allowed
11829 * to request.
11830 * @hide
11831 */
11832 @Readable
11833 public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS =
11834 "location_background_throttle_proximity_alert_interval_ms";
11835
11836 /**
11837 * Packages that are whitelisted for background throttling (throttling will not be applied).
11838 * @hide
11839 */
11840 @Readable
11841 public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST =
11842 "location_background_throttle_package_whitelist";
11843
11844 /**
11845 * Packages that are whitelisted for ignoring location settings (may retrieve location even
11846 * when user location settings are off), for emergency purposes.
11847 * @deprecated No longer used from Android 12+
11848 * @hide
11849 */
11850 @TestApi
11851 @Readable
11852 @Deprecated
11853 public static final String LOCATION_IGNORE_SETTINGS_PACKAGE_WHITELIST =
11854 "location_ignore_settings_package_whitelist";
11855
11856 /**
11857 * Whether to throttle location when the device is in doze and still.
11858 * @hide
11859 */
11860 public static final String LOCATION_ENABLE_STATIONARY_THROTTLE =
11861 "location_enable_stationary_throttle";
11862
11863 /**
11864 * Whether TV will switch to MHL port when a mobile device is plugged in.
11865 * (0 = false, 1 = true)
11866 * @hide
11867 */
11868 @Readable
11869 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
11870
11871 /**
11872 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
11873 * @hide
11874 */
11875 @Readable
11876 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
11877
11878 /**
11879 * Whether mobile data connections are allowed by the user. See
11880 * ConnectivityManager for more info.
11881 * @hide
11882 */
11883 @UnsupportedAppUsage
11884 @Readable
11885 public static final String MOBILE_DATA = "mobile_data";
11886
11887 /**
11888 * Whether the mobile data connection should remain active even when higher
11889 * priority networks like WiFi are active, to help make network switching faster.
11890 *
11891 * See ConnectivityService for more info.
11892 *
11893 * (0 = disabled, 1 = enabled)
11894 * @hide
11895 */
11896 @Readable
11897 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
11898
11899 /**
11900 * Whether the wifi data connection should remain active even when higher
11901 * priority networks like Ethernet are active, to keep both networks.
11902 * In the case where higher priority networks are connected, wifi will be
11903 * unused unless an application explicitly requests to use it.
11904 *
11905 * See ConnectivityService for more info.
11906 *
11907 * (0 = disabled, 1 = enabled)
11908 * @hide
11909 */
11910 @Readable
11911 public static final String WIFI_ALWAYS_REQUESTED = "wifi_always_requested";
11912
11913 /**
11914 * Size of the event buffer for IP connectivity metrics.
11915 * @hide
11916 */
11917 @Readable
11918 public static final String CONNECTIVITY_METRICS_BUFFER_SIZE =
11919 "connectivity_metrics_buffer_size";
11920
11921 /** {@hide} */
11922 @Readable
11923 public static final String NETSTATS_ENABLED = "netstats_enabled";
11924 /** {@hide} */
11925 @Readable
11926 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
11927 /**
11928 * @deprecated
11929 * {@hide}
11930 */
11931 @Deprecated
11932 @Readable
11933 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
11934 /** {@hide} */
11935 @Readable
11936 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
11937 /** {@hide} */
11938 @Readable
11939 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
11940 /** {@hide} */
11941 @Readable
11942 public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled";
11943 /** {@hide} */
11944 @Readable
11945 public static final String NETSTATS_COMBINE_SUBTYPE_ENABLED =
11946 "netstats_combine_subtype_enabled";
11947
11948 /** {@hide} */
11949 @Readable
11950 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
11951 /** {@hide} */
11952 @Readable
11953 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
11954 /** {@hide} */
11955 @Readable
11956 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
11957 /** {@hide} */
11958 @Readable
11959 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
11960
11961 /** {@hide} */
11962 @Readable
11963 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
11964 /** {@hide} */
11965 @Readable
11966 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
11967 /** {@hide} */
11968 @Readable
11969 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
11970 /** {@hide} */
11971 @Readable
11972 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
11973
11974 /** {@hide} */
11975 @Readable
11976 public static final String NETSTATS_UID_TAG_BUCKET_DURATION =
11977 "netstats_uid_tag_bucket_duration";
11978 /** {@hide} */
11979 @Readable
11980 public static final String NETSTATS_UID_TAG_PERSIST_BYTES =
11981 "netstats_uid_tag_persist_bytes";
11982 /** {@hide} */
11983 @Readable
11984 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
11985 /** {@hide} */
11986 @Readable
11987 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
11988
11989 /** {@hide} */
11990 @Readable
11991 public static final String NETPOLICY_QUOTA_ENABLED = "netpolicy_quota_enabled";
11992 /** {@hide} */
11993 @Readable
11994 public static final String NETPOLICY_QUOTA_UNLIMITED = "netpolicy_quota_unlimited";
11995 /** {@hide} */
11996 @Readable
11997 public static final String NETPOLICY_QUOTA_LIMITED = "netpolicy_quota_limited";
11998 /** {@hide} */
11999 @Readable
12000 public static final String NETPOLICY_QUOTA_FRAC_JOBS = "netpolicy_quota_frac_jobs";
12001 /** {@hide} */
12002 @Readable
12003 public static final String NETPOLICY_QUOTA_FRAC_MULTIPATH =
12004 "netpolicy_quota_frac_multipath";
12005
12006 /** {@hide} */
12007 @Readable
12008 public static final String NETPOLICY_OVERRIDE_ENABLED = "netpolicy_override_enabled";
12009
12010 /**
12011 * User preference for which network(s) should be used. Only the
12012 * connectivity service should touch this.
12013 */
12014 @Readable
12015 public static final String NETWORK_PREFERENCE = "network_preference";
12016
12017 /**
12018 * Which package name to use for network scoring. If null, or if the package is not a valid
12019 * scorer app, external network scores will neither be requested nor accepted.
12020 * @hide
12021 */
12022 @Readable
12023 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
12024 public static final String NETWORK_SCORER_APP = "network_scorer_app";
12025
12026 /**
12027 * Whether night display forced auto mode is available.
12028 * 0 = unavailable, 1 = available.
12029 * @hide
12030 */
12031 @Readable
12032 public static final String NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE =
12033 "night_display_forced_auto_mode_available";
12034
12035 /**
12036 * If Unix epoch time between two NITZ signals is greater than this value then the second
12037 * signal cannot be ignored.
12038 *
12039 * <p>This value is in milliseconds. It is used for telephony-based time and time zone
12040 * detection.
12041 * @hide
12042 */
12043 @Readable
12044 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
12045
12046 /**
12047 * If the elapsed realtime between two NITZ signals is greater than this value then the
12048 * second signal cannot be ignored.
12049 *
12050 * <p>This value is in milliseconds. It is used for telephony-based time and time zone
12051 * detection.
12052 * @hide
12053 */
12054 @Readable
12055 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
12056
12057 /**
12058 * If the device connects to a telephony network and was disconnected from a telephony
12059 * network for less than this time, a previously received NITZ signal can be restored.
12060 *
12061 * <p>This value is in milliseconds. It is used for telephony-based time and time zone
12062 * detection.
12063 * @hide
12064 */
12065 public static final String NITZ_NETWORK_DISCONNECT_RETENTION =
12066 "nitz_network_disconnect_retention";
12067
12068 /** Preferred NTP server. {@hide} */
12069 @Readable
12070 public static final String NTP_SERVER = "ntp_server";
12071 /** Timeout in milliseconds to wait for NTP server. {@hide} */
12072 @Readable
12073 public static final String NTP_TIMEOUT = "ntp_timeout";
12074
12075 /** {@hide} */
12076 @Readable
12077 public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval";
12078
12079 /**
12080 * Whether or not Settings should enable psd API.
12081 * {@hide}
12082 */
12083 @Readable
12084 public static final String SETTINGS_USE_PSD_API = "settings_use_psd_api";
12085
12086 /**
12087 * Whether or not Settings should enable external provider API.
12088 * {@hide}
12089 */
12090 @Readable
12091 public static final String SETTINGS_USE_EXTERNAL_PROVIDER_API =
12092 "settings_use_external_provider_api";
12093
12094 /**
12095 * Sample validity in seconds to configure for the system DNS resolver.
12096 * {@hide}
12097 */
12098 @Readable
12099 public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS =
12100 "dns_resolver_sample_validity_seconds";
12101
12102 /**
12103 * Success threshold in percent for use with the system DNS resolver.
12104 * {@hide}
12105 */
12106 @Readable
12107 public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT =
12108 "dns_resolver_success_threshold_percent";
12109
12110 /**
12111 * Minimum number of samples needed for statistics to be considered meaningful in the
12112 * system DNS resolver.
12113 * {@hide}
12114 */
12115 @Readable
12116 public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples";
12117
12118 /**
12119 * Maximum number taken into account for statistics purposes in the system DNS resolver.
12120 * {@hide}
12121 */
12122 @Readable
12123 public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples";
12124
12125 /**
12126 * Whether to disable the automatic scheduling of system updates.
12127 * 1 = system updates won't be automatically scheduled (will always
12128 * present notification instead).
12129 * 0 = system updates will be automatically scheduled. (default)
12130 * @hide
12131 */
12132 @SystemApi
12133 @Readable
12134 public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
12135
12136 /** Timeout for package verification.
12137 * @hide */
12138 @Readable
12139 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
12140
12141 /** Timeout for package verification during streaming installations.
12142 * @hide */
12143 @Readable
12144 public static final String PACKAGE_STREAMING_VERIFIER_TIMEOUT =
12145 "streaming_verifier_timeout";
12146
12147 /** Timeout for app integrity verification.
12148 * @hide */
12149 @Readable
12150 public static final String APP_INTEGRITY_VERIFICATION_TIMEOUT =
12151 "app_integrity_verification_timeout";
12152
12153 /** Default response code for package verification.
12154 * @hide */
12155 @Readable
12156 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
12157
12158 /**
12159 * Show package verification setting in the Settings app.
12160 * 1 = show (default)
12161 * 0 = hide
12162 * @hide
12163 */
12164 @Readable
12165 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
12166
12167 /**
12168 * Run package verification on apps installed through ADB/ADT/USB
12169 * 1 = perform package verification on ADB installs (default)
12170 * 0 = bypass package verification on ADB installs
12171 * @hide
12172 */
12173 @Readable
12174 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
12175
12176 /**
12177 * Run integrity checks for integrity rule providers.
12178 * 0 = bypass integrity verification on installs from rule providers (default)
12179 * 1 = perform integrity verification on installs from rule providers
12180 * @hide
12181 */
12182 @Readable
12183 public static final String INTEGRITY_CHECK_INCLUDES_RULE_PROVIDER =
12184 "verify_integrity_for_rule_provider";
12185
12186 /**
12187 * Time since last fstrim (milliseconds) after which we force one to happen
12188 * during device startup. If unset, the default is 3 days.
12189 * @hide
12190 */
12191 @Readable
12192 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
12193
12194 /**
12195 * The interval in milliseconds at which to check packet counts on the
12196 * mobile data interface when screen is on, to detect possible data
12197 * connection problems.
12198 * @hide
12199 */
12200 @Readable
12201 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
12202 "pdp_watchdog_poll_interval_ms";
12203
12204 /**
12205 * The interval in milliseconds at which to check packet counts on the
12206 * mobile data interface when screen is off, to detect possible data
12207 * connection problems.
12208 * @hide
12209 */
12210 @Readable
12211 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
12212 "pdp_watchdog_long_poll_interval_ms";
12213
12214 /**
12215 * The interval in milliseconds at which to check packet counts on the
12216 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
12217 * outgoing packets has been reached without incoming packets.
12218 * @hide
12219 */
12220 @Readable
12221 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
12222 "pdp_watchdog_error_poll_interval_ms";
12223
12224 /**
12225 * The number of outgoing packets sent without seeing an incoming packet
12226 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
12227 * device is logged to the event log
12228 * @hide
12229 */
12230 @Readable
12231 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
12232 "pdp_watchdog_trigger_packet_count";
12233
12234 /**
12235 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
12236 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
12237 * attempting data connection recovery.
12238 * @hide
12239 */
12240 @Readable
12241 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
12242 "pdp_watchdog_error_poll_count";
12243
12244 /**
12245 * The number of failed PDP reset attempts before moving to something more
12246 * drastic: re-registering to the network.
12247 * @hide
12248 */
12249 @Readable
12250 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
12251 "pdp_watchdog_max_pdp_reset_fail_count";
12252
12253 /**
12254 * URL to open browser on to allow user to manage a prepay account
12255 * @hide
12256 */
12257 @Readable
12258 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
12259 "setup_prepaid_data_service_url";
12260
12261 /**
12262 * URL to attempt a GET on to see if this is a prepay device
12263 * @hide
12264 */
12265 @Readable
12266 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
12267 "setup_prepaid_detection_target_url";
12268
12269 /**
12270 * Host to check for a redirect to after an attempt to GET
12271 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
12272 * this is a prepaid device with zero balance.)
12273 * @hide
12274 */
12275 @Readable
12276 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
12277 "setup_prepaid_detection_redir_host";
12278
12279 /**
12280 * The interval in milliseconds at which to check the number of SMS sent out without asking
12281 * for use permit, to limit the un-authorized SMS usage.
12282 *
12283 * @hide
12284 */
12285 @Readable
12286 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
12287 "sms_outgoing_check_interval_ms";
12288
12289 /**
12290 * The number of outgoing SMS sent without asking for user permit (of {@link
12291 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
12292 *
12293 * @hide
12294 */
12295 @Readable
12296 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
12297 "sms_outgoing_check_max_count";
12298
12299 /**
12300 * Used to disable SMS short code confirmation - defaults to true.
12301 * True indcates we will do the check, etc. Set to false to disable.
12302 * @see com.android.internal.telephony.SmsUsageMonitor
12303 * @hide
12304 */
12305 @Readable
12306 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
12307
12308 /**
12309 * Used to select which country we use to determine premium sms codes.
12310 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
12311 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
12312 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
12313 * @hide
12314 */
12315 @Readable
12316 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
12317
12318 /**
12319 * Used to select TCP's default initial receiver window size in segments - defaults to a
12320 * build config value.
12321 * @hide
12322 */
12323 @Readable
12324 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
12325
12326 /**
12327 * Used to disable Tethering on a device - defaults to true.
12328 * @hide
12329 */
12330 @SystemApi
12331 @Readable
12332 public static final String TETHER_SUPPORTED = "tether_supported";
12333
12334 /**
12335 * Used to require DUN APN on the device or not - defaults to a build config value
12336 * which defaults to false.
12337 * @hide
12338 */
12339 @Readable
12340 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
12341
12342 /**
12343 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
12344 * corresponding build config values are set it will override the APN DB
12345 * values.
12346 * Consists of a comma separated list of strings:
12347 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
12348 * note that empty fields can be omitted: "name,apn,,,,,,,,,310,260,,DUN"
12349 * @hide
12350 */
12351 @Readable
12352 public static final String TETHER_DUN_APN = "tether_dun_apn";
12353
12354 /**
12355 * Used to disable trying to talk to any available tethering offload HAL.
12356 *
12357 * Integer values are interpreted as boolean, and the absence of an explicit setting
12358 * is interpreted as |false|.
12359 * @hide
12360 */
12361 @SystemApi
12362 @Readable
12363 public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled";
12364
12365 /**
12366 * Use the old dnsmasq DHCP server for tethering instead of the framework implementation.
12367 *
12368 * Integer values are interpreted as boolean, and the absence of an explicit setting
12369 * is interpreted as |false|.
12370 * @hide
12371 */
12372 @Readable
12373 public static final String TETHER_ENABLE_LEGACY_DHCP_SERVER =
12374 "tether_enable_legacy_dhcp_server";
12375
12376 /**
12377 * List of certificate (hex string representation of the application's certificate - SHA-1
12378 * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for
12379 * install when a sim card with matching UICC carrier privilege rules is inserted. The
12380 * certificate is used as a key, so the certificate encoding here must be the same as the
12381 * certificate encoding used on the SIM.
12382 *
12383 * The value is "cert1:package1;cert2:package2;..."
12384 * @hide
12385 */
12386 @SystemApi
12387 @Readable
12388 public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
12389
12390 /**
12391 * Map of package name to application names. The application names cannot and will not be
12392 * localized. App names may not contain colons or semicolons.
12393 *
12394 * The value is "packageName1:appName1;packageName2:appName2;..."
12395 * @hide
12396 */
12397 @SystemApi
12398 @Readable
12399 public static final String CARRIER_APP_NAMES = "carrier_app_names";
12400
12401 /**
12402 * USB Mass Storage Enabled
12403 */
12404 @Readable
12405 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
12406
12407 /**
12408 * If this setting is set (to anything), then all references
12409 * to Gmail on the device must change to Google Mail.
12410 */
12411 @Readable
12412 public static final String USE_GOOGLE_MAIL = "use_google_mail";
12413
12414 /**
12415 * Whether or not switching/creating users is enabled by user.
12416 * @hide
12417 */
12418 @Readable
12419 public static final String USER_SWITCHER_ENABLED = "user_switcher_enabled";
12420
12421 /**
12422 * Webview Data reduction proxy key.
12423 * @hide
12424 */
12425 @Readable
12426 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
12427 "webview_data_reduction_proxy_key";
12428
12429 /**
12430 * Name of the package used as WebView provider (if unset the provider is instead determined
12431 * by the system).
12432 * @hide
12433 */
12434 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
12435 @Readable
12436 public static final String WEBVIEW_PROVIDER = "webview_provider";
12437
12438 /**
12439 * Developer setting to enable WebView multiprocess rendering.
12440 * @hide
12441 */
12442 @SystemApi
12443 @Readable
12444 public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
12445
12446 /**
12447 * The maximum number of notifications shown in 24 hours when switching networks.
12448 * @hide
12449 */
12450 @Readable
12451 public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT =
12452 "network_switch_notification_daily_limit";
12453
12454 /**
12455 * The minimum time in milliseconds between notifications when switching networks.
12456 * @hide
12457 */
12458 @Readable
12459 public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS =
12460 "network_switch_notification_rate_limit_millis";
12461
12462 /**
12463 * Whether to automatically switch away from wifi networks that lose Internet access.
12464 * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always
12465 * avoids such networks. Valid values are:
12466 *
12467 * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013.
12468 * null: Ask the user whether to switch away from bad wifi.
12469 * 1: Avoid bad wifi.
12470 *
12471 * @hide
12472 */
12473 @Readable
12474 public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi";
12475
12476 /**
12477 * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be
12478 * overridden by the system based on device or application state. If null, the value
12479 * specified by config_networkMeteredMultipathPreference is used.
12480 *
12481 * @hide
12482 */
12483 @Readable
12484 public static final String NETWORK_METERED_MULTIPATH_PREFERENCE =
12485 "network_metered_multipath_preference";
12486
12487 /**
12488 * Default daily multipath budget used by ConnectivityManager.getMultipathPreference()
12489 * on metered networks. This default quota is only used if quota could not be determined
12490 * from data plan or data limit/warning set by the user.
12491 * @hide
12492 */
12493 @Readable
12494 public static final String NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES =
12495 "network_default_daily_multipath_quota_bytes";
12496
12497 /**
12498 * Network watchlist last report time.
12499 * @hide
12500 */
12501 @Readable
12502 public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME =
12503 "network_watchlist_last_report_time";
12504
12505 /**
12506 * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of
12507 * colon-delimited key-value pairs. The key is the badging enum value defined in
12508 * android.net.ScoredNetwork and the value is the minimum sustained network throughput in
12509 * kbps required for the badge. For example: "10:3000,20:5000,30:25000"
12510 *
12511 * @hide
12512 */
12513 @SystemApi
12514 @Readable
12515 public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds";
12516
12517 /**
12518 * Whether Wifi display is enabled/disabled
12519 * 0=disabled. 1=enabled.
12520 * @hide
12521 */
12522 @Readable
12523 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
12524
12525 /**
12526 * Whether Wifi display certification mode is enabled/disabled
12527 * 0=disabled. 1=enabled.
12528 * @hide
12529 */
12530 @Readable
12531 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
12532 "wifi_display_certification_on";
12533
12534 /**
12535 * WPS Configuration method used by Wifi display, this setting only
12536 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
12537 *
12538 * Possible values are:
12539 *
12540 * WpsInfo.INVALID: use default WPS method chosen by framework
12541 * WpsInfo.PBC : use Push button
12542 * WpsInfo.KEYPAD : use Keypad
12543 * WpsInfo.DISPLAY: use Display
12544 * @hide
12545 */
12546 @Readable
12547 public static final String WIFI_DISPLAY_WPS_CONFIG =
12548 "wifi_display_wps_config";
12549
12550 /**
12551 * Whether to notify the user of open networks.
12552 * <p>
12553 * If not connected and the scan results have an open network, we will
12554 * put this notification up. If we attempt to connect to a network or
12555 * the open network(s) disappear, we remove the notification. When we
12556 * show the notification, we will not show it again for
12557 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
12558 *
12559 * @deprecated This feature is no longer controlled by this setting in
12560 * {@link android.os.Build.VERSION_CODES#O}.
12561 */
12562 @Deprecated
12563 @Readable
12564 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
12565 "wifi_networks_available_notification_on";
12566
12567 /**
12568 * {@hide}
12569 */
12570 @Readable
12571 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
12572 "wimax_networks_available_notification_on";
12573
12574 /**
12575 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
12576 * Connecting to a network will reset the timer.
12577 * @deprecated This is no longer used or set by the platform.
12578 */
12579 @Deprecated
12580 @Readable
12581 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
12582 "wifi_networks_available_repeat_delay";
12583
12584 /**
12585 * 802.11 country code in ISO 3166 format
12586 * @hide
12587 */
12588 @Readable
12589 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
12590
12591 /**
12592 * The interval in milliseconds to issue wake up scans when wifi needs
12593 * to connect. This is necessary to connect to an access point when
12594 * device is on the move and the screen is off.
12595 * @hide
12596 */
12597 @Readable
12598 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
12599 "wifi_framework_scan_interval_ms";
12600
12601 /**
12602 * The interval in milliseconds after which Wi-Fi is considered idle.
12603 * When idle, it is possible for the device to be switched from Wi-Fi to
12604 * the mobile data network.
12605 * @hide
12606 */
12607 @Readable
12608 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
12609
12610 /**
12611 * When the number of open networks exceeds this number, the
12612 * least-recently-used excess networks will be removed.
12613 * @deprecated This is no longer used or set by the platform.
12614 */
12615 @Deprecated
12616 @Readable
12617 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
12618
12619 /**
12620 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
12621 */
12622 @Readable
12623 public static final String WIFI_ON = "wifi_on";
12624
12625 /**
12626 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
12627 * @hide
12628 * @deprecated To be removed. Use {@link WifiManager#setScanAlwaysAvailable(boolean)} for
12629 * setting the value and {@link WifiManager#isScanAlwaysAvailable()} for query.
12630 */
12631 @Deprecated
12632 @Readable
12633 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
12634 "wifi_scan_always_enabled";
12635
12636 /**
12637 * Indicate whether factory reset request is pending.
12638 *
12639 * Type: int (0 for false, 1 for true)
12640 * @hide
12641 * @deprecated To be removed.
12642 */
12643 @Deprecated
12644 @Readable
12645 public static final String WIFI_P2P_PENDING_FACTORY_RESET =
12646 "wifi_p2p_pending_factory_reset";
12647
12648 /**
12649 * Whether soft AP will shut down after a timeout period when no devices are connected.
12650 *
12651 * Type: int (0 for false, 1 for true)
12652 * @hide
12653 * @deprecated To be removed. Use {@link SoftApConfiguration.Builder#
12654 * setAutoShutdownEnabled(boolean)} for setting the value and {@link SoftApConfiguration#
12655 * isAutoShutdownEnabled()} for query.
12656 */
12657 @Deprecated
12658 @Readable
12659 public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled";
12660
12661 /**
12662 * Value to specify if Wi-Fi Wakeup feature is enabled.
12663 *
12664 * Type: int (0 for false, 1 for true)
12665 * @hide
12666 * @deprecated Use {@link WifiManager#setAutoWakeupEnabled(boolean)} for setting the value
12667 * and {@link WifiManager#isAutoWakeupEnabled()} for query.
12668 */
12669 @Deprecated
12670 @SystemApi
12671 @Readable
12672 public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
12673
12674 /**
12675 * Value to specify if wifi settings migration is complete or not.
12676 * Note: This should only be used from within {@link android.net.wifi.WifiMigration} class.
12677 *
12678 * Type: int (0 for false, 1 for true)
12679 * @hide
12680 */
12681 @Readable
12682 public static final String WIFI_MIGRATION_COMPLETED = "wifi_migration_completed";
12683
12684 /**
12685 * Whether UWB should be enabled.
12686 * @hide
12687 */
12688 public static final String UWB_ENABLED = "uwb_enabled";
12689
12690 /**
12691 * Value to specify whether network quality scores and badging should be shown in the UI.
12692 *
12693 * Type: int (0 for false, 1 for true)
12694 * @deprecated {@link NetworkScoreManager} is deprecated.
12695 * @hide
12696 */
12697 @Deprecated
12698 @Readable
12699 public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled";
12700
12701 /**
12702 * Value to specify how long in milliseconds to retain seen score cache curves to be used
12703 * when generating SSID only bases score curves.
12704 *
12705 * Type: long
12706 * @deprecated {@link NetworkScoreManager} is deprecated.
12707 * @hide
12708 */
12709 @Deprecated
12710 @Readable
12711 public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS =
12712 "speed_label_cache_eviction_age_millis";
12713
12714 /**
12715 * Value to specify if network recommendations from
12716 * {@link com.android.server.NetworkScoreService} are enabled.
12717 *
12718 * Type: int
12719 * Valid values:
12720 * -1 = Forced off
12721 * 0 = Disabled
12722 * 1 = Enabled
12723 *
12724 * Most readers of this setting should simply check if value == 1 to determine the
12725 * enabled state.
12726 * @hide
12727 * @deprecated To be removed.
12728 */
12729 @Deprecated
12730 @Readable
12731 public static final String NETWORK_RECOMMENDATIONS_ENABLED =
12732 "network_recommendations_enabled";
12733
12734 /**
12735 * Which package name to use for network recommendations. If null, network recommendations
12736 * will neither be requested nor accepted.
12737 *
12738 * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and
12739 * {@link NetworkScoreManager#setActiveScorer(String)} to write it.
12740 *
12741 * Type: string - package name
12742 * @deprecated {@link NetworkScoreManager} is deprecated.
12743 * @hide
12744 */
12745 @Deprecated
12746 @Readable
12747 public static final String NETWORK_RECOMMENDATIONS_PACKAGE =
12748 "network_recommendations_package";
12749
12750 /**
12751 * The package name of the application that connect and secures high quality open wifi
12752 * networks automatically.
12753 *
12754 * Type: string package name or null if the feature is either not provided or disabled.
12755 * @deprecated {@link NetworkScoreManager} is deprecated.
12756 * @hide
12757 */
12758 @Deprecated
12759 @TestApi
12760 @Readable
12761 public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package";
12762
12763 /**
12764 * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in
12765 * {@link com.android.server.wifi.RecommendedNetworkEvaluator}.
12766 *
12767 * Type: long
12768 * @deprecated {@link NetworkScoreManager} is deprecated.
12769 * @hide
12770 */
12771 @Deprecated
12772 @Readable
12773 public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS =
12774 "recommended_network_evaluator_cache_expiry_ms";
12775
12776 /**
12777 * Whether wifi scan throttle is enabled or not.
12778 *
12779 * Type: int (0 for false, 1 for true)
12780 * @hide
12781 * @deprecated Use {@link WifiManager#setScanThrottleEnabled(boolean)} for setting the value
12782 * and {@link WifiManager#isScanThrottleEnabled()} for query.
12783 */
12784 @Deprecated
12785 @Readable
12786 public static final String WIFI_SCAN_THROTTLE_ENABLED = "wifi_scan_throttle_enabled";
12787
12788 /**
12789 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
12790 * connectivity.
12791 * @hide
12792 */
12793 @Readable
12794 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12795 @SuppressLint("NoSettingsProvider")
12796 public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled";
12797
12798 /**
12799 * The length in milliseconds of a BLE scan window in a low-power scan mode.
12800 * @hide
12801 */
12802 @Readable
12803 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12804 @SuppressLint("NoSettingsProvider")
12805 public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms";
12806
12807 /**
12808 * The length in milliseconds of a BLE scan window in a balanced scan mode.
12809 * @hide
12810 */
12811 @Readable
12812 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12813 @SuppressLint("NoSettingsProvider")
12814 public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms";
12815
12816 /**
12817 * The length in milliseconds of a BLE scan window in a low-latency scan mode.
12818 * @hide
12819 */
12820 @Readable
12821 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12822 @SuppressLint("NoSettingsProvider")
12823 public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS =
12824 "ble_scan_low_latency_window_ms";
12825
12826 /**
12827 * The length in milliseconds of a BLE scan interval in a low-power scan mode.
12828 * @hide
12829 */
12830 @Readable
12831 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12832 @SuppressLint("NoSettingsProvider")
12833 public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS =
12834 "ble_scan_low_power_interval_ms";
12835
12836 /**
12837 * The length in milliseconds of a BLE scan interval in a balanced scan mode.
12838 * @hide
12839 */
12840 @Readable
12841 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12842 @SuppressLint("NoSettingsProvider")
12843 public static final String BLE_SCAN_BALANCED_INTERVAL_MS =
12844 "ble_scan_balanced_interval_ms";
12845
12846 /**
12847 * The length in milliseconds of a BLE scan interval in a low-latency scan mode.
12848 * @hide
12849 */
12850 @Readable
12851 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12852 @SuppressLint("NoSettingsProvider")
12853 public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS =
12854 "ble_scan_low_latency_interval_ms";
12855
12856 /**
12857 * The mode that BLE scanning clients will be moved to when in the background.
12858 * @hide
12859 */
12860 @Readable
12861 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12862 @SuppressLint("NoSettingsProvider")
12863 public static final String BLE_SCAN_BACKGROUND_MODE = "ble_scan_background_mode";
12864
12865 /**
12866 * The interval in milliseconds to scan as used by the wifi supplicant
12867 * @hide
12868 */
12869 @Readable
12870 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
12871 "wifi_supplicant_scan_interval_ms";
12872
12873 /**
12874 * whether frameworks handles wifi auto-join
12875 * @hide
12876 */
12877 @Readable
12878 public static final String WIFI_ENHANCED_AUTO_JOIN =
12879 "wifi_enhanced_auto_join";
12880
12881 /**
12882 * whether settings show RSSI
12883 * @hide
12884 */
12885 @Readable
12886 public static final String WIFI_NETWORK_SHOW_RSSI =
12887 "wifi_network_show_rssi";
12888
12889 /**
12890 * The interval in milliseconds to scan at supplicant when p2p is connected
12891 * @hide
12892 */
12893 @Readable
12894 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
12895 "wifi_scan_interval_p2p_connected_ms";
12896
12897 /**
12898 * Whether the Wi-Fi watchdog is enabled.
12899 */
12900 @Readable
12901 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
12902
12903 /**
12904 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
12905 * the setting needs to be set to 0 to disable it.
12906 * @hide
12907 */
12908 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
12909 @Readable
12910 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
12911 "wifi_watchdog_poor_network_test_enabled";
12912
12913 /**
12914 * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1
12915 * will enable it. In the future, additional values may be supported.
12916 * @hide
12917 * @deprecated Use {@link WifiManager#setVerboseLoggingEnabled(boolean)} for setting the
12918 * value and {@link WifiManager#isVerboseLoggingEnabled()} for query.
12919 */
12920 @Deprecated
12921 @Readable
12922 public static final String WIFI_VERBOSE_LOGGING_ENABLED =
12923 "wifi_verbose_logging_enabled";
12924
12925 /**
12926 * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and
12927 * setting to 1 will enable it. In the future, additional values may be supported.
12928 * @deprecated MAC randomization is now a per-network setting
12929 * @hide
12930 */
12931 @Deprecated
12932 @Readable
12933 public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED =
12934 "wifi_connected_mac_randomization_enabled";
12935
12936 /**
12937 * Parameters to adjust the performance of framework wifi scoring methods.
12938 * <p>
12939 * Encoded as a comma-separated key=value list, for example:
12940 * "rssi5=-80:-77:-70:-57,rssi2=-83:-80:-73:-60,horizon=15"
12941 * This is intended for experimenting with new parameter values,
12942 * and is normally unset or empty. The example does not include all
12943 * parameters that may be honored.
12944 * Default values are provided by code or device configurations.
12945 * Errors in the parameters will cause the entire setting to be ignored.
12946 * @hide
12947 * @deprecated This is no longer used or set by the platform.
12948 */
12949 @Deprecated
12950 @Readable
12951 public static final String WIFI_SCORE_PARAMS =
12952 "wifi_score_params";
12953
12954 /**
12955 * The maximum number of times we will retry a connection to an access
12956 * point for which we have failed in acquiring an IP address from DHCP.
12957 * A value of N means that we will make N+1 connection attempts in all.
12958 */
12959 @Readable
12960 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
12961
12962 /**
12963 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
12964 * data connectivity to be established after a disconnect from Wi-Fi.
12965 */
12966 @Readable
12967 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
12968 "wifi_mobile_data_transition_wakelock_timeout_ms";
12969
12970 /**
12971 * This setting controls whether WiFi configurations created by a Device Owner app
12972 * should be locked down (that is, be editable or removable only by the Device Owner App,
12973 * not even by Settings app).
12974 * This setting takes integer values. Non-zero values mean DO created configurations
12975 * are locked down. Value of zero means they are not. Default value in the absence of
12976 * actual value to this setting is 0.
12977 */
12978 @Readable
12979 public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN =
12980 "wifi_device_owner_configs_lockdown";
12981
12982 /**
12983 * The operational wifi frequency band
12984 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
12985 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
12986 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
12987 *
12988 * @hide
12989 */
12990 @Readable
12991 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
12992
12993 /**
12994 * The Wi-Fi peer-to-peer device name
12995 * @hide
12996 * @deprecated Use {@link WifiP2pManager#setDeviceName(WifiP2pManager.Channel, String,
12997 * WifiP2pManager.ActionListener)} for setting the value and
12998 * {@link android.net.wifi.p2p.WifiP2pDevice#deviceName} for query.
12999 */
13000 @Deprecated
13001 @Readable
13002 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
13003
13004 /**
13005 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
13006 * from an ephemeral network if there is no BSSID for that network with a non-null score that
13007 * has been seen in this time period.
13008 *
13009 * If this is less than or equal to zero, we use a more conservative behavior and only check
13010 * for a non-null score from the currently connected or target BSSID.
13011 * @hide
13012 */
13013 @Readable
13014 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
13015 "wifi_ephemeral_out_of_range_timeout_ms";
13016
13017 /**
13018 * The number of milliseconds to delay when checking for data stalls during
13019 * non-aggressive detection. (screen is turned off.)
13020 * @hide
13021 */
13022 @Readable
13023 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
13024 "data_stall_alarm_non_aggressive_delay_in_ms";
13025
13026 /**
13027 * The number of milliseconds to delay when checking for data stalls during
13028 * aggressive detection. (screen on or suspected data stall)
13029 * @hide
13030 */
13031 @Readable
13032 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
13033 "data_stall_alarm_aggressive_delay_in_ms";
13034
13035 /**
13036 * The number of milliseconds to allow the provisioning apn to remain active
13037 * @hide
13038 */
13039 @Readable
13040 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
13041 "provisioning_apn_alarm_delay_in_ms";
13042
13043 /**
13044 * The interval in milliseconds at which to check gprs registration
13045 * after the first registration mismatch of gprs and voice service,
13046 * to detect possible data network registration problems.
13047 *
13048 * @hide
13049 */
13050 @Readable
13051 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
13052 "gprs_register_check_period_ms";
13053
13054 /**
13055 * Nonzero causes Log.wtf() to crash.
13056 * @hide
13057 */
13058 @Readable
13059 public static final String WTF_IS_FATAL = "wtf_is_fatal";
13060
13061 /**
13062 * Ringer mode. This is used internally, changing this value will not
13063 * change the ringer mode. See AudioManager.
13064 */
13065 @Readable
13066 public static final String MODE_RINGER = "mode_ringer";
13067
13068 /**
13069 * Overlay display devices setting.
13070 * The associated value is a specially formatted string that describes the
13071 * size and density of simulated secondary display devices.
13072 * <p>
13073 * Format:
13074 * <pre>
13075 * [display1];[display2];...
13076 * </pre>
13077 * with each display specified as:
13078 * <pre>
13079 * [mode1]|[mode2]|...,[flag1],[flag2],...
13080 * </pre>
13081 * with each mode specified as:
13082 * <pre>
13083 * [width]x[height]/[densityDpi]
13084 * </pre>
13085 * Supported flags:
13086 * <ul>
13087 * <li><pre>secure</pre>: creates a secure display</li>
13088 * <li><pre>own_content_only</pre>: only shows this display's own content</li>
13089 * <li><pre>should_show_system_decorations</pre>: supports system decorations</li>
13090 * </ul>
13091 * </p><p>
13092 * Example:
13093 * <ul>
13094 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
13095 * <li><code>1920x1080/320,secure;1280x720/213</code>: make two overlays, the first at
13096 * 1080p and secure; the second at 720p.</li>
13097 * <li><code>1920x1080/320|3840x2160/640</code>: make one overlay that is 1920x1080 at
13098 * 213dpi by default, but can also be upscaled to 3840x2160 at 640dpi by the system if the
13099 * display device allows.</li>
13100 * <li>If the value is empty, then no overlay display devices are created.</li>
13101 * </ul></p>
13102 *
13103 * @hide
13104 */
13105 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
13106 @TestApi
13107 @Readable
13108 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
13109
13110 /**
13111 * Threshold values for the duration and level of a discharge cycle,
13112 * under which we log discharge cycle info.
13113 *
13114 * @hide
13115 */
13116 @Readable
13117 public static final String
13118 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
13119
13120 /** @hide */
13121 @Readable
13122 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
13123
13124 /**
13125 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
13126 * intents on application crashes and ANRs. If this is disabled, the
13127 * crash/ANR dialog will never display the "Report" button.
13128 * <p>
13129 * Type: int (0 = disallow, 1 = allow)
13130 *
13131 * @hide
13132 */
13133 @Readable
13134 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
13135
13136 /**
13137 * Maximum age of entries kept by {@link DropBoxManager}.
13138 *
13139 * @hide
13140 */
13141 @Readable
13142 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
13143
13144 /**
13145 * Maximum number of entry files which {@link DropBoxManager} will keep
13146 * around.
13147 *
13148 * @hide
13149 */
13150 @Readable
13151 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
13152
13153 /**
13154 * Maximum amount of disk space used by {@link DropBoxManager} no matter
13155 * what.
13156 *
13157 * @hide
13158 */
13159 @Readable
13160 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
13161
13162 /**
13163 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
13164 * will use.
13165 *
13166 * @hide
13167 */
13168 @Readable
13169 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
13170
13171 /**
13172 * Percent of total disk which {@link DropBoxManager} will never dip
13173 * into.
13174 *
13175 * @hide
13176 */
13177 @Readable
13178 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
13179
13180 /**
13181 * Prefix for per-tag dropbox disable/enable settings.
13182 *
13183 * @hide
13184 */
13185 @Readable
13186 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
13187
13188 /**
13189 * Lines of logcat to include with system crash/ANR/etc. reports, as a
13190 * prefix of the dropbox tag of the report type. For example,
13191 * "logcat_for_system_server_anr" controls the lines of logcat captured
13192 * with system server ANR reports. 0 to disable.
13193 *
13194 * @hide
13195 */
13196 @Readable
13197 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
13198
13199 /**
13200 * Maximum number of bytes of a system crash/ANR/etc. report that
13201 * ActivityManagerService should send to DropBox, as a prefix of the
13202 * dropbox tag of the report type. For example,
13203 * "max_error_bytes_for_system_server_anr" controls the maximum
13204 * number of bytes captured with system server ANR reports.
13205 * <p>
13206 * Type: int (max size in bytes)
13207 *
13208 * @hide
13209 */
13210 @Readable
13211 public static final String MAX_ERROR_BYTES_PREFIX = "max_error_bytes_for_";
13212
13213 /**
13214 * The interval in minutes after which the amount of free storage left
13215 * on the device is logged to the event log
13216 *
13217 * @hide
13218 */
13219 @Readable
13220 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
13221
13222 /**
13223 * Threshold for the amount of change in disk free space required to
13224 * report the amount of free space. Used to prevent spamming the logs
13225 * when the disk free space isn't changing frequently.
13226 *
13227 * @hide
13228 */
13229 @Readable
13230 public static final String
13231 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
13232
13233 /**
13234 * Minimum percentage of free storage on the device that is used to
13235 * determine if the device is running low on storage. The default is 10.
13236 * <p>
13237 * Say this value is set to 10, the device is considered running low on
13238 * storage if 90% or more of the device storage is filled up.
13239 *
13240 * @hide
13241 */
13242 @Readable
13243 public static final String
13244 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
13245
13246 /**
13247 * Maximum byte size of the low storage threshold. This is to ensure
13248 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
13249 * overly large threshold for large storage devices. Currently this must
13250 * be less than 2GB. This default is 500MB.
13251 *
13252 * @hide
13253 */
13254 @Readable
13255 public static final String
13256 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
13257
13258 /**
13259 * Minimum bytes of free storage on the device before the data partition
13260 * is considered full. By default, 1 MB is reserved to avoid system-wide
13261 * SQLite disk full exceptions.
13262 *
13263 * @hide
13264 */
13265 @Readable
13266 public static final String
13267 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
13268
13269 /**
13270 * Minimum percentage of storage on the device that is reserved for
13271 * cached data.
13272 *
13273 * @hide
13274 */
13275 @Readable
13276 public static final String
13277 SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage";
13278
13279 /**
13280 * The maximum reconnect delay for short network outages or when the
13281 * network is suspended due to phone use.
13282 *
13283 * @hide
13284 */
13285 @Readable
13286 public static final String
13287 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
13288
13289 /**
13290 * The number of milliseconds to delay before sending out
13291 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
13292 *
13293 * @hide
13294 */
13295 @Readable
13296 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
13297
13298
13299 /**
13300 * Network sampling interval, in seconds. We'll generate link information
13301 * about bytes/packets sent and error rates based on data sampled in this interval
13302 *
13303 * @hide
13304 */
13305 @Readable
13306 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
13307 "connectivity_sampling_interval_in_seconds";
13308
13309 /**
13310 * The series of successively longer delays used in retrying to download PAC file.
13311 * Last delay is used between successful PAC downloads.
13312 *
13313 * @hide
13314 */
13315 @Readable
13316 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
13317
13318 /**
13319 * Don't attempt to detect captive portals.
13320 *
13321 * @hide
13322 */
13323 public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0;
13324
13325 /**
13326 * When detecting a captive portal, display a notification that
13327 * prompts the user to sign in.
13328 *
13329 * @hide
13330 */
13331 public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1;
13332
13333 /**
13334 * When detecting a captive portal, immediately disconnect from the
13335 * network and do not reconnect to that network in the future.
13336 *
13337 * @hide
13338 */
13339 public static final int CAPTIVE_PORTAL_MODE_AVOID = 2;
13340
13341 /**
13342 * What to do when connecting a network that presents a captive portal.
13343 * Must be one of the CAPTIVE_PORTAL_MODE_* constants above.
13344 *
13345 * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT.
13346 * @hide
13347 */
13348 @Readable
13349 public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
13350
13351 /**
13352 * Setting to turn off captive portal detection. Feature is enabled by
13353 * default and the setting needs to be set to 0 to disable it.
13354 *
13355 * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection
13356 * @hide
13357 */
13358 @Deprecated
13359 @Readable
13360 public static final String
13361 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
13362
13363 /**
13364 * The server used for captive portal detection upon a new conection. A
13365 * 204 response code from the server is used for validation.
13366 * TODO: remove this deprecated symbol.
13367 *
13368 * @hide
13369 */
13370 @Readable
13371 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
13372
13373 /**
13374 * The URL used for HTTPS captive portal detection upon a new connection.
13375 * A 204 response code from the server is used for validation.
13376 *
13377 * @hide
13378 */
13379 @Readable
13380 public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
13381
13382 /**
13383 * The URL used for HTTP captive portal detection upon a new connection.
13384 * A 204 response code from the server is used for validation.
13385 *
13386 * @hide
13387 */
13388 @Readable
13389 public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
13390
13391 /**
13392 * The URL used for fallback HTTP captive portal detection when previous HTTP
13393 * and HTTPS captive portal detection attemps did not return a conclusive answer.
13394 *
13395 * @hide
13396 */
13397 @Readable
13398 public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
13399
13400 /**
13401 * A comma separated list of URLs used for captive portal detection in addition to the
13402 * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings.
13403 *
13404 * @hide
13405 */
13406 @Readable
13407 public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS =
13408 "captive_portal_other_fallback_urls";
13409
13410 /**
13411 * A list of captive portal detection specifications used in addition to the fallback URLs.
13412 * Each spec has the format url@@/@@statusCodeRegex@@/@@contentRegex. Specs are separated
13413 * by "@@,@@".
13414 * @hide
13415 */
13416 @Readable
13417 public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS =
13418 "captive_portal_fallback_probe_specs";
13419
13420 /**
13421 * Whether to use HTTPS for network validation. This is enabled by default and the setting
13422 * needs to be set to 0 to disable it. This setting is a misnomer because captive portals
13423 * don't actually use HTTPS, but it's consistent with the other settings.
13424 *
13425 * @hide
13426 */
13427 @Readable
13428 public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
13429
13430 /**
13431 * Which User-Agent string to use in the header of the captive portal detection probes.
13432 * The User-Agent field is unset when this setting has no value (HttpUrlConnection default).
13433 *
13434 * @hide
13435 */
13436 @Readable
13437 public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
13438
13439 /**
13440 * Whether to try cellular data recovery when a bad network is reported.
13441 *
13442 * @hide
13443 */
13444 @Readable
13445 public static final String DATA_STALL_RECOVERY_ON_BAD_NETWORK =
13446 "data_stall_recovery_on_bad_network";
13447
13448 /**
13449 * Minumim duration in millisecodns between cellular data recovery attempts
13450 *
13451 * @hide
13452 */
13453 @Readable
13454 public static final String MIN_DURATION_BETWEEN_RECOVERY_STEPS_IN_MS =
13455 "min_duration_between_recovery_steps";
13456
13457 /**
13458 * Let user pick default install location.
13459 *
13460 * @hide
13461 */
13462 @Readable
13463 public static final String SET_INSTALL_LOCATION = "set_install_location";
13464
13465 /**
13466 * Default install location value.
13467 * 0 = auto, let system decide
13468 * 1 = internal
13469 * 2 = sdcard
13470 * @hide
13471 */
13472 @Readable
13473 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
13474
13475 /**
13476 * ms during which to consume extra events related to Inet connection
13477 * condition after a transtion to fully-connected
13478 *
13479 * @hide
13480 */
13481 @Readable
13482 public static final String
13483 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
13484
13485 /**
13486 * ms during which to consume extra events related to Inet connection
13487 * condtion after a transtion to partly-connected
13488 *
13489 * @hide
13490 */
13491 @Readable
13492 public static final String
13493 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
13494
13495 /** {@hide} */
13496 @Readable
13497 public static final String
13498 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
13499
13500 /**
13501 * Host name and port for global http proxy. Uses ':' seperator for
13502 * between host and port.
13503 */
13504 @Readable
13505 public static final String HTTP_PROXY = "http_proxy";
13506
13507 /**
13508 * Host name for global http proxy. Set via ConnectivityManager.
13509 *
13510 * @hide
13511 */
13512 @Readable
13513 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
13514
13515 /**
13516 * Integer host port for global http proxy. Set via ConnectivityManager.
13517 *
13518 * @hide
13519 */
13520 @Readable
13521 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
13522
13523 /**
13524 * Exclusion list for global proxy. This string contains a list of
13525 * comma-separated domains where the global proxy does not apply.
13526 * Domains should be listed in a comma- separated list. Example of
13527 * acceptable formats: ".domain1.com,my.domain2.com" Use
13528 * ConnectivityManager to set/get.
13529 *
13530 * @hide
13531 */
13532 @Readable
13533 public static final String
13534 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
13535
13536 /**
13537 * The location PAC File for the proxy.
13538 * @hide
13539 */
13540 @Readable
13541 public static final String
13542 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
13543
13544 /**
13545 * Enables the UI setting to allow the user to specify the global HTTP
13546 * proxy and associated exclusion list.
13547 *
13548 * @hide
13549 */
13550 @Readable
13551 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
13552
13553 /**
13554 * Setting for default DNS in case nobody suggests one
13555 *
13556 * @hide
13557 */
13558 @Readable
13559 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
13560
13561 /**
13562 * The requested Private DNS mode (string), and an accompanying specifier (string).
13563 *
13564 * Currently, the specifier holds the chosen provider name when the mode requests
13565 * a specific provider. It may be used to store the provider name even when the
13566 * mode changes so that temporarily disabling and re-enabling the specific
13567 * provider mode does not necessitate retyping the provider hostname.
13568 *
13569 * @hide
13570 */
13571 @Readable
13572 public static final String PRIVATE_DNS_MODE = "private_dns_mode";
13573
13574 /**
13575 * @hide
13576 */
13577 @Readable
13578 public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier";
13579
13580 /**
13581 * Forced override of the default mode (hardcoded as "automatic", nee "opportunistic").
13582 * This allows changing the default mode without effectively disabling other modes,
13583 * all of which require explicit user action to enable/configure. See also b/79719289.
13584 *
13585 * Value is a string, suitable for assignment to PRIVATE_DNS_MODE above.
13586 *
13587 * {@hide}
13588 */
13589 @Readable
13590 public static final String PRIVATE_DNS_DEFAULT_MODE = "private_dns_default_mode";
13591
13592
13593 /** {@hide} */
13594 @Readable
13595 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
13596 @SuppressLint("NoSettingsProvider")
13597 public static final String
13598 BLUETOOTH_BTSNOOP_DEFAULT_MODE = "bluetooth_btsnoop_default_mode";
13599 /** {@hide} */
13600 @Readable
13601 public static final String
13602 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
13603 /** {@hide} */
13604 @Readable
13605 public static final String
13606 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
13607 /** {@hide} */
13608 @Readable
13609 public static final String
13610 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_";
13611 /** {@hide} */
13612 @Readable
13613 public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX =
13614 "bluetooth_a2dp_supports_optional_codecs_";
13615 /** {@hide} */
13616 @Readable
13617 public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX =
13618 "bluetooth_a2dp_optional_codecs_enabled_";
13619 /** {@hide} */
13620 @Readable
13621 public static final String
13622 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
13623 /** {@hide} */
13624 @Readable
13625 public static final String
13626 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
13627 /** {@hide} */
13628 @Readable
13629 public static final String
13630 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_";
13631 /** {@hide} */
13632 @Readable
13633 public static final String
13634 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_";
13635 /** {@hide} */
13636 @Readable
13637 public static final String
13638 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
13639 /** {@hide} */
13640 @Readable
13641 public static final String
13642 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_";
13643 /** {@hide} */
13644 @Readable
13645 public static final String
13646 BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_";
13647
13648 /**
13649 * Enable/disable radio bug detection
13650 *
13651 * {@hide}
13652 */
13653 @Readable
13654 public static final String
13655 ENABLE_RADIO_BUG_DETECTION = "enable_radio_bug_detection";
13656
13657 /**
13658 * Count threshold of RIL wakelock timeout for radio bug detection
13659 *
13660 * {@hide}
13661 */
13662 @Readable
13663 public static final String
13664 RADIO_BUG_WAKELOCK_TIMEOUT_COUNT_THRESHOLD =
13665 "radio_bug_wakelock_timeout_count_threshold";
13666
13667 /**
13668 * Count threshold of RIL system error for radio bug detection
13669 *
13670 * {@hide}
13671 */
13672 @Readable
13673 public static final String
13674 RADIO_BUG_SYSTEM_ERROR_COUNT_THRESHOLD =
13675 "radio_bug_system_error_count_threshold";
13676
13677 /**
13678 * Activity manager specific settings.
13679 * This is encoded as a key=value list, separated by commas. Ex:
13680 *
13681 * "gc_timeout=5000,max_cached_processes=24"
13682 *
13683 * The following keys are supported:
13684 *
13685 * <pre>
13686 * max_cached_processes (int)
13687 * background_settle_time (long)
13688 * fgservice_min_shown_time (long)
13689 * fgservice_min_report_time (long)
13690 * fgservice_screen_on_before_time (long)
13691 * fgservice_screen_on_after_time (long)
13692 * content_provider_retain_time (long)
13693 * gc_timeout (long)
13694 * gc_min_interval (long)
13695 * full_pss_min_interval (long)
13696 * full_pss_lowered_interval (long)
13697 * power_check_interval (long)
13698 * power_check_max_cpu_1 (int)
13699 * power_check_max_cpu_2 (int)
13700 * power_check_max_cpu_3 (int)
13701 * power_check_max_cpu_4 (int)
13702 * service_usage_interaction_time (long)
13703 * usage_stats_interaction_interval (long)
13704 * service_restart_duration (long)
13705 * service_reset_run_duration (long)
13706 * service_restart_duration_factor (int)
13707 * service_min_restart_time_between (long)
13708 * service_max_inactivity (long)
13709 * service_bg_start_timeout (long)
13710 * service_bg_activity_start_timeout (long)
13711 * process_start_async (boolean)
13712 * </pre>
13713 *
13714 * <p>
13715 * Type: string
13716 * @hide
13717 * @see com.android.server.am.ActivityManagerConstants
13718 */
13719 @Readable
13720 public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants";
13721
13722 /**
13723 * Feature flag to enable or disable the activity starts logging feature.
13724 * Type: int (0 for false, 1 for true)
13725 * Default: 1
13726 * @hide
13727 */
13728 @Readable
13729 public static final String ACTIVITY_STARTS_LOGGING_ENABLED
13730 = "activity_starts_logging_enabled";
13731
13732 /**
13733 * Feature flag to enable or disable the foreground service starts logging feature.
13734 * Type: int (0 for false, 1 for true)
13735 * Default: 1
13736 * @hide
13737 */
13738 @Readable
13739 public static final String FOREGROUND_SERVICE_STARTS_LOGGING_ENABLED =
13740 "foreground_service_starts_logging_enabled";
13741
13742 /**
13743 * @hide
13744 * @see com.android.server.appbinding.AppBindingConstants
13745 */
13746 @Readable
13747 public static final String APP_BINDING_CONSTANTS = "app_binding_constants";
13748
13749 /**
13750 * App ops specific settings.
13751 * This is encoded as a key=value list, separated by commas. Ex:
13752 *
13753 * "state_settle_time=10000"
13754 *
13755 * The following keys are supported:
13756 *
13757 * <pre>
13758 * top_state_settle_time (long)
13759 * fg_service_state_settle_time (long)
13760 * bg_state_settle_time (long)
13761 * </pre>
13762 *
13763 * <p>
13764 * Type: string
13765 * @hide
13766 * @see com.android.server.AppOpsService.Constants
13767 */
13768 @TestApi
13769 @Readable
13770 public static final String APP_OPS_CONSTANTS = "app_ops_constants";
13771
13772 /**
13773 * Battery Saver specific settings
13774 * This is encoded as a key=value list, separated by commas. Ex:
13775 *
13776 * "vibration_disabled=true,adjust_brightness_factor=0.5"
13777 *
13778 * The following keys are supported:
13779 *
13780 * <pre>
13781 * advertise_is_enabled (boolean)
13782 * datasaver_disabled (boolean)
13783 * enable_night_mode (boolean)
13784 * launch_boost_disabled (boolean)
13785 * vibration_disabled (boolean)
13786 * animation_disabled (boolean)
13787 * soundtrigger_disabled (boolean)
13788 * fullbackup_deferred (boolean)
13789 * keyvaluebackup_deferred (boolean)
13790 * firewall_disabled (boolean)
13791 * gps_mode (int)
13792 * adjust_brightness_disabled (boolean)
13793 * adjust_brightness_factor (float)
13794 * force_all_apps_standby (boolean)
13795 * force_background_check (boolean)
13796 * optional_sensors_disabled (boolean)
13797 * aod_disabled (boolean)
13798 * quick_doze_enabled (boolean)
13799 * </pre>
13800 * @hide
13801 * @see com.android.server.power.batterysaver.BatterySaverPolicy
13802 */
13803 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
13804 @TestApi
13805 @Readable
13806 public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants";
13807
13808 /**
13809 * Battery Saver device specific settings
13810 * This is encoded as a key=value list, separated by commas.
13811 *
13812 * The following keys are supported:
13813 *
13814 * <pre>
13815 * cpufreq-i (list of "core-number:frequency" pairs concatenated with /)
13816 * cpufreq-n (list of "core-number:frequency" pairs concatenated with /)
13817 * </pre>
13818 *
13819 * See {@link com.android.server.power.batterysaver.BatterySaverPolicy} for the details.
13820 *
13821 * @hide
13822 */
13823 @Readable
13824 public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS =
13825 "battery_saver_device_specific_constants";
13826
13827 /**
13828 * Battery tip specific settings
13829 * This is encoded as a key=value list, separated by commas. Ex:
13830 *
13831 * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true,"
13832 * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50,"
13833 * "high_usage_battery_draining=25,high_usage_period_ms=3000"
13834 *
13835 * The following keys are supported:
13836 *
13837 * <pre>
13838 * battery_tip_enabled (boolean)
13839 * summary_enabled (boolean)
13840 * battery_saver_tip_enabled (boolean)
13841 * high_usage_enabled (boolean)
13842 * high_usage_app_count (int)
13843 * high_usage_period_ms (long)
13844 * high_usage_battery_draining (int)
13845 * app_restriction_enabled (boolean)
13846 * reduced_battery_enabled (boolean)
13847 * reduced_battery_percent (int)
13848 * low_battery_enabled (boolean)
13849 * low_battery_hour (int)
13850 * </pre>
13851 * @hide
13852 */
13853 @Readable
13854 public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants";
13855
13856 /**
13857 * Battery anomaly detection specific settings
13858 * This is encoded as a key=value list, separated by commas.
13859 * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via
13860 * {@link Uri#encode(String)}, separated by colons. Ex:
13861 *
13862 * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true,"
13863 * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon"
13864 *
13865 * The following keys are supported:
13866 *
13867 * <pre>
13868 * anomaly_detection_enabled (boolean)
13869 * wakelock_enabled (boolean)
13870 * wakelock_threshold (long)
13871 * wakeup_alarm_enabled (boolean)
13872 * wakeup_alarm_threshold (long)
13873 * wakeup_blacklisted_tags (string)
13874 * bluetooth_scan_enabled (boolean)
13875 * bluetooth_scan_threshold (long)
13876 * </pre>
13877 * @hide
13878 */
13879 @Readable
13880 public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants";
13881
13882 /**
13883 * An integer to show the version of the anomaly config. Ex: 1, which means
13884 * current version is 1.
13885 * @hide
13886 */
13887 @Readable
13888 public static final String ANOMALY_CONFIG_VERSION = "anomaly_config_version";
13889
13890 /**
13891 * A base64-encoded string represents anomaly stats config, used for
13892 * {@link android.app.StatsManager}.
13893 * @hide
13894 */
13895 @Readable
13896 public static final String ANOMALY_CONFIG = "anomaly_config";
13897
13898 /**
13899 * Always on display(AOD) specific settings
13900 * This is encoded as a key=value list, separated by commas. Ex:
13901 *
13902 * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4"
13903 *
13904 * The following keys are supported:
13905 *
13906 * <pre>
13907 * screen_brightness_array (int[])
13908 * dimming_scrim_array (int[])
13909 * prox_screen_off_delay (long)
13910 * prox_cooldown_trigger (long)
13911 * prox_cooldown_period (long)
13912 * </pre>
13913 * @hide
13914 */
13915 @Readable
13916 public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants";
13917
13918 /**
13919 * UidCpuPower global setting. This links the sys.uidcpupower system property.
13920 * The following values are supported:
13921 * 0 -> /proc/uid_cpupower/* are disabled
13922 * 1 -> /proc/uid_cpupower/* are enabled
13923 * Any other value defaults to enabled.
13924 * @hide
13925 */
13926 @Readable
13927 public static final String SYS_UIDCPUPOWER = "sys_uidcpupower";
13928
13929 /**
13930 * traced global setting. This controls weather the deamons: traced and
13931 * traced_probes run. This links the sys.traced system property.
13932 * The following values are supported:
13933 * 0 -> traced and traced_probes are disabled
13934 * 1 -> traced and traced_probes are enabled
13935 * Any other value defaults to disabled.
13936 * @hide
13937 */
13938 @Readable
13939 public static final String SYS_TRACED = "sys_traced";
13940
13941 /**
13942 * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the
13943 * device for this setting to take full effect.
13944 *
13945 * @hide
13946 */
13947 @Readable
13948 public static final String FPS_DEVISOR = "fps_divisor";
13949
13950 /**
13951 * Flag to enable or disable display panel low power mode (lpm)
13952 * false -> Display panel power saving mode is disabled.
13953 * true -> Display panel power saving mode is enabled.
13954 *
13955 * @hide
13956 */
13957 @Readable
13958 public static final String DISPLAY_PANEL_LPM = "display_panel_lpm";
13959
13960 /**
13961 * App time limit usage source setting.
13962 * This controls which app in a task will be considered the source of usage when
13963 * calculating app usage time limits.
13964 *
13965 * 1 -> task root app
13966 * 2 -> current app
13967 * Any other value defaults to task root app.
13968 *
13969 * Need to reboot the device for this setting to take effect.
13970 * @hide
13971 */
13972 @Readable
13973 public static final String APP_TIME_LIMIT_USAGE_SOURCE = "app_time_limit_usage_source";
13974
13975 /**
13976 * Enable ART bytecode verification verifications for debuggable apps.
13977 * 0 = disable, 1 = enable.
13978 * @hide
13979 */
13980 @Readable
13981 public static final String ART_VERIFIER_VERIFY_DEBUGGABLE =
13982 "art_verifier_verify_debuggable";
13983
13984 /**
13985 * Power manager specific settings.
13986 * This is encoded as a key=value list, separated by commas. Ex:
13987 *
13988 * "no_cached_wake_locks=1"
13989 *
13990 * The following keys are supported:
13991 *
13992 * <pre>
13993 * no_cached_wake_locks (boolean)
13994 * </pre>
13995 *
13996 * <p>
13997 * Type: string
13998 * @hide
13999 * @see com.android.server.power.PowerManagerConstants
14000 */
14001 @Readable
14002 public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants";
14003
14004 /**
14005 * ShortcutManager specific settings.
14006 * This is encoded as a key=value list, separated by commas. Ex:
14007 *
14008 * "reset_interval_sec=86400,max_updates_per_interval=1"
14009 *
14010 * The following keys are supported:
14011 *
14012 * <pre>
14013 * reset_interval_sec (long)
14014 * max_updates_per_interval (int)
14015 * max_icon_dimension_dp (int, DP)
14016 * max_icon_dimension_dp_lowram (int, DP)
14017 * max_shortcuts (int)
14018 * icon_quality (int, 0-100)
14019 * icon_format (String)
14020 * </pre>
14021 *
14022 * <p>
14023 * Type: string
14024 * @hide
14025 * @see com.android.server.pm.ShortcutService.ConfigConstants
14026 */
14027 @Readable
14028 public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants";
14029
14030 /**
14031 * DevicePolicyManager specific settings.
14032 * This is encoded as a key=value list, separated by commas. Ex:
14033 *
14034 * <pre>
14035 * das_died_service_reconnect_backoff_sec (long)
14036 * das_died_service_reconnect_backoff_increase (float)
14037 * das_died_service_reconnect_max_backoff_sec (long)
14038 * </pre>
14039 *
14040 * <p>
14041 * Type: string
14042 * @hide
14043 * see also com.android.server.devicepolicy.DevicePolicyConstants
14044 */
14045 @Readable
14046 public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants";
14047
14048 /**
14049 * TextClassifier specific settings.
14050 * This is encoded as a key=value list, separated by commas. String[] types like
14051 * entity_list_default use ":" as delimiter for values. Ex:
14052 *
14053 * <pre>
14054 * classify_text_max_range_length (int)
14055 * detect_language_from_text_enabled (boolean)
14056 * entity_list_default (String[])
14057 * entity_list_editable (String[])
14058 * entity_list_not_editable (String[])
14059 * generate_links_log_sample_rate (int)
14060 * generate_links_max_text_length (int)
14061 * in_app_conversation_action_types_default (String[])
14062 * lang_id_context_settings (float[])
14063 * lang_id_threshold_override (float)
14064 * local_textclassifier_enabled (boolean)
14065 * model_dark_launch_enabled (boolean)
14066 * notification_conversation_action_types_default (String[])
14067 * smart_linkify_enabled (boolean)
14068 * smart_select_animation_enabled (boolean)
14069 * smart_selection_enabled (boolean)
14070 * smart_text_share_enabled (boolean)
14071 * suggest_selection_max_range_length (int)
14072 * system_textclassifier_enabled (boolean)
14073 * template_intent_factory_enabled (boolean)
14074 * translate_in_classification_enabled (boolean)
14075 * </pre>
14076 *
14077 * <p>
14078 * Type: string
14079 * @hide
14080 * see also android.view.textclassifier.TextClassificationConstants
14081 */
14082 @Readable
14083 public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants";
14084
14085 /**
14086 * BatteryStats specific settings.
14087 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
14088 *
14089 * The following keys are supported:
14090 * <pre>
14091 * track_cpu_times_by_proc_state (boolean)
14092 * track_cpu_active_cluster_time (boolean)
14093 * read_binary_cpu_time (boolean)
14094 * proc_state_cpu_times_read_delay_ms (long)
14095 * external_stats_collection_rate_limit_ms (long)
14096 * battery_level_collection_delay_ms (long)
14097 * max_history_files (int)
14098 * max_history_buffer_kb (int)
14099 * battery_charged_delay_ms (int)
14100 * </pre>
14101 *
14102 * <p>
14103 * Type: string
14104 * @hide
14105 * see also com.android.internal.os.BatteryStatsImpl.Constants
14106 */
14107 @Readable
14108 public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants";
14109
14110 /**
14111 * SyncManager specific settings.
14112 *
14113 * <p>
14114 * Type: string
14115 * @hide
14116 * @see com.android.server.content.SyncManagerConstants
14117 */
14118 @Readable
14119 public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants";
14120
14121 /**
14122 * Broadcast dispatch tuning parameters specific to foreground broadcasts.
14123 *
14124 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
14125 *
14126 * The following keys are supported:
14127 * <pre>
14128 * bcast_timeout (long)
14129 * bcast_slow_time (long)
14130 * bcast_deferral (long)
14131 * bcast_deferral_decay_factor (float)
14132 * bcast_deferral_floor (long)
14133 * bcast_allow_bg_activity_start_timeout (long)
14134 * </pre>
14135 *
14136 * @hide
14137 */
14138 @Readable
14139 public static final String BROADCAST_FG_CONSTANTS = "bcast_fg_constants";
14140
14141 /**
14142 * Broadcast dispatch tuning parameters specific to background broadcasts.
14143 *
14144 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true".
14145 * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys.
14146 *
14147 * @hide
14148 */
14149 @Readable
14150 public static final String BROADCAST_BG_CONSTANTS = "bcast_bg_constants";
14151
14152 /**
14153 * Broadcast dispatch tuning parameters specific to specific "offline" broadcasts.
14154 *
14155 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true".
14156 * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys.
14157 *
14158 * @hide
14159 */
14160 @Readable
14161 public static final String BROADCAST_OFFLOAD_CONSTANTS = "bcast_offload_constants";
14162
14163 /**
14164 * Whether or not App Standby feature is enabled by system. This controls throttling of apps
14165 * based on usage patterns and predictions. Platform will turn on this feature if both this
14166 * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on.
14167 * Type: int (0 for false, 1 for true)
14168 * Default: 1
14169 * @hide
14170 * @see #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED
14171 */
14172 @SystemApi
14173 @Readable
14174 public static final String APP_STANDBY_ENABLED = "app_standby_enabled";
14175
14176 /**
14177 * Whether or not adaptive battery feature is enabled by user. Platform will turn on this
14178 * feature if both this flag and {@link #APP_STANDBY_ENABLED} is on.
14179 * Type: int (0 for false, 1 for true)
14180 * Default: 1
14181 * @hide
14182 * @see #APP_STANDBY_ENABLED
14183 */
14184 @Readable
14185 public static final String ADAPTIVE_BATTERY_MANAGEMENT_ENABLED =
14186 "adaptive_battery_management_enabled";
14187
14188 /**
14189 * Whether or not apps are allowed into the
14190 * {@link android.app.usage.UsageStatsManager#STANDBY_BUCKET_RESTRICTED} bucket.
14191 * Type: int (0 for false, 1 for true)
14192 * Default: {@value #DEFAULT_ENABLE_RESTRICTED_BUCKET}
14193 *
14194 * @hide
14195 */
14196 @Readable
14197 public static final String ENABLE_RESTRICTED_BUCKET = "enable_restricted_bucket";
14198
14199 /**
14200 * @see #ENABLE_RESTRICTED_BUCKET
14201 * @hide
14202 */
14203 public static final int DEFAULT_ENABLE_RESTRICTED_BUCKET = 1;
14204
14205 /**
14206 * Whether or not app auto restriction is enabled. When it is enabled, settings app will
14207 * auto restrict the app if it has bad behavior (e.g. hold wakelock for long time).
14208 *
14209 * Type: boolean (0 for false, 1 for true)
14210 * Default: 1
14211 *
14212 * @hide
14213 */
14214 @Readable
14215 public static final String APP_AUTO_RESTRICTION_ENABLED =
14216 "app_auto_restriction_enabled";
14217
14218 /**
14219 * Feature flag to enable or disable the Forced App Standby feature.
14220 * Type: int (0 for false, 1 for true)
14221 * Default: 1
14222 * @hide
14223 */
14224 @Readable
14225 public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled";
14226
14227 /**
14228 * Whether or not to enable Forced App Standby on small battery devices.
14229 * Type: int (0 for false, 1 for true)
14230 * Default: 0
14231 * @hide
14232 */
14233 @Readable
14234 public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED
14235 = "forced_app_standby_for_small_battery_enabled";
14236
14237 /**
14238 * Whether to enable the TARE subsystem as a whole or not.
14239 * 1 means enable, 0 means disable.
14240 *
14241 * @hide
14242 */
14243 public static final String ENABLE_TARE = "enable_tare";
14244
14245 /**
14246 * Default value for {@link #ENABLE_TARE}.
14247 *
14248 * @hide
14249 */
14250 public static final int DEFAULT_ENABLE_TARE = 0;
14251
14252 /**
14253 * Whether to enable the TARE AlarmManager economic policy or not.
14254 * 1 means enable, 0 means disable.
14255 *
14256 * @hide
14257 */
14258 public static final String ENABLE_TARE_ALARM_MANAGER = "enable_tare_alarm_manager";
14259
14260 /**
14261 * Default value for {@link #ENABLE_TARE_ALARM_MANAGER}.
14262 *
14263 * @hide
14264 */
14265 public static final int DEFAULT_ENABLE_TARE_ALARM_MANAGER = 0;
14266
14267 /**
14268 * Settings for AlarmManager's TARE EconomicPolicy (list of its economic factors).
14269 *
14270 * Keys are listed in {@link android.app.tare.EconomyManager}.
14271 *
14272 * @hide
14273 */
14274 public static final String TARE_ALARM_MANAGER_CONSTANTS = "tare_alarm_manager_constants";
14275
14276 /**
14277 * Whether to enable the TARE JobScheduler economic policy or not.
14278 * 1 means enable, 0 means disable.
14279 *
14280 * @hide
14281 */
14282 public static final String ENABLE_TARE_JOB_SCHEDULER = "enable_tare_job_scheduler";
14283
14284 /**
14285 * Default value for {@link #ENABLE_TARE_JOB_SCHEDULER}.
14286 *
14287 * @hide
14288 */
14289 public static final int DEFAULT_ENABLE_TARE_JOB_SCHEDULER = 0;
14290
14291 /**
14292 * Settings for JobScheduler's TARE EconomicPolicy (list of its economic factors).
14293 *
14294 * Keys are listed in {@link android.app.tare.EconomyManager}.
14295 *
14296 * @hide
14297 */
14298 public static final String TARE_JOB_SCHEDULER_CONSTANTS = "tare_job_scheduler_constants";
14299
14300 /**
14301 * Whether or not to enable the User Absent, Radios Off feature on small battery devices.
14302 * Type: int (0 for false, 1 for true)
14303 * Default: 0
14304 * @hide
14305 */
14306 @Readable
14307 public static final String USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED
14308 = "user_absent_radios_off_for_small_battery_enabled";
14309
14310 /**
14311 * Whether or not to enable the User Absent, Touch Off feature on small battery devices.
14312 * Type: int (0 for false, 1 for true)
14313 * Default: 0
14314 * @hide
14315 */
14316 @Readable
14317 public static final String USER_ABSENT_TOUCH_OFF_FOR_SMALL_BATTERY_ENABLED
14318 = "user_absent_touch_off_for_small_battery_enabled";
14319
14320 /**
14321 * Whether or not to turn on Wifi when proxy is disconnected.
14322 * Type: int (0 for false, 1 for true)
14323 * Default: 1
14324 * @hide
14325 */
14326 @Readable
14327 public static final String WIFI_ON_WHEN_PROXY_DISCONNECTED
14328 = "wifi_on_when_proxy_disconnected";
14329
14330 /**
14331 * Time Only Mode specific settings.
14332 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
14333 *
14334 * The following keys are supported:
14335 *
14336 * <pre>
14337 * enabled (boolean)
14338 * disable_home (boolean)
14339 * disable_tilt_to_wake (boolean)
14340 * disable_touch_to_wake (boolean)
14341 * </pre>
14342 * Type: string
14343 * @hide
14344 */
14345 @Readable
14346 public static final String TIME_ONLY_MODE_CONSTANTS
14347 = "time_only_mode_constants";
14348
14349 /**
14350 * Whether of not to send keycode sleep for ungaze when Home is the foreground activity on
14351 * watch type devices.
14352 * Type: int (0 for false, 1 for true)
14353 * Default: 1
14354 * @hide
14355 */
14356 @Readable
14357 public static final String UNGAZE_SLEEP_ENABLED = "ungaze_sleep_enabled";
14358
14359 /**
14360 * Whether or not Network Watchlist feature is enabled.
14361 * Type: int (0 for false, 1 for true)
14362 * Default: 0
14363 * @hide
14364 */
14365 @Readable
14366 public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled";
14367
14368 /**
14369 * Whether or not show hidden launcher icon apps feature is enabled.
14370 * Type: int (0 for false, 1 for true)
14371 * Default: 1
14372 * @hide
14373 */
14374 @Readable
14375 public static final String SHOW_HIDDEN_LAUNCHER_ICON_APPS_ENABLED =
14376 "show_hidden_icon_apps_enabled";
14377
14378 /**
14379 * Whether or not show new app installed notification is enabled.
14380 * Type: int (0 for false, 1 for true)
14381 * Default: 0
14382 * @hide
14383 */
14384 @Readable
14385 public static final String SHOW_NEW_APP_INSTALLED_NOTIFICATION_ENABLED =
14386 "show_new_app_installed_notification_enabled";
14387
14388 /**
14389 * Flag to keep background restricted profiles running after exiting. If disabled,
14390 * the restricted profile can be put into stopped state as soon as the user leaves it.
14391 * Type: int (0 for false, 1 for true)
14392 *
14393 * Overridden by the system based on device information. If null, the value specified
14394 * by {@code config_keepRestrictedProfilesInBackground} is used.
14395 *
14396 * @hide
14397 */
14398 @Readable
14399 public static final String KEEP_PROFILE_IN_BACKGROUND = "keep_profile_in_background";
14400
14401 /**
14402 * The default time in ms within which a subsequent connection from an always allowed system
14403 * is allowed to reconnect without user interaction.
14404 *
14405 * @hide
14406 */
14407 public static final long DEFAULT_ADB_ALLOWED_CONNECTION_TIME = 604800000;
14408
14409 /**
14410 * When the user first connects their device to a system a prompt is displayed to allow
14411 * the adb connection with an option to 'Always allow' connections from this system. If the
14412 * user selects this always allow option then the connection time is stored for the system.
14413 * This setting is the time in ms within which a subsequent connection from an always
14414 * allowed system is allowed to reconnect without user interaction.
14415 *
14416 * Type: long
14417 *
14418 * @hide
14419 */
14420 @Readable
14421 public static final String ADB_ALLOWED_CONNECTION_TIME =
14422 "adb_allowed_connection_time";
14423
14424 /**
14425 * Scaling factor for normal window animations.
14426 *
14427 * The value is a float. Setting to 0.0f will disable window animations.
14428 */
14429 @Readable
14430 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
14431
14432 /**
14433 * Setting to disable cross-window blurs. This includes window blur behind, (see
14434 * {@link LayoutParams#setBlurBehindRadius}) and window background blur (see
14435 * {@link Window#setBackgroundBlurRadius}).
14436 *
14437 * The value is a boolean (1 or 0).
14438 * @hide
14439 */
14440 @TestApi
14441 @Readable
14442 @SuppressLint("NoSettingsProvider")
14443 public static final String DISABLE_WINDOW_BLURS = "disable_window_blurs";
14444
14445 /**
14446 * Scaling factor for activity transition animations.
14447 *
14448 * The value is a float. Setting to 0.0f will disable window animations.
14449 */
14450 @Readable
14451 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
14452
14453 /**
14454 * Scaling factor for Animator-based animations. This affects both the
14455 * start delay and duration of all such animations.
14456 *
14457 * The value is a float. Setting to 0.0f will cause animations to end immediately.
14458 * The default value is 1.0f.
14459 */
14460 @Readable
14461 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
14462
14463 /**
14464 * Scaling factor for normal window animations. Setting to 0 will
14465 * disable window animations.
14466 *
14467 * @hide
14468 */
14469 @Readable
14470 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
14471
14472 /**
14473 * If 0, the compatibility mode is off for all applications.
14474 * If 1, older applications run under compatibility mode.
14475 * TODO: remove this settings before code freeze (bug/1907571)
14476 * @hide
14477 */
14478 @Readable
14479 public static final String COMPATIBILITY_MODE = "compatibility_mode";
14480
14481 /**
14482 * CDMA only settings
14483 * Emergency Tone 0 = Off
14484 * 1 = Alert
14485 * 2 = Vibrate
14486 * @hide
14487 */
14488 @Readable
14489 public static final String EMERGENCY_TONE = "emergency_tone";
14490
14491 /**
14492 * CDMA only settings
14493 * Whether the auto retry is enabled. The value is
14494 * boolean (1 or 0).
14495 * @hide
14496 */
14497 @Readable
14498 public static final String CALL_AUTO_RETRY = "call_auto_retry";
14499
14500 /**
14501 * A setting that can be read whether the emergency affordance is currently needed.
14502 * The value is a boolean (1 or 0).
14503 * @hide
14504 */
14505 @Readable
14506 public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed";
14507
14508 /**
14509 * The power button "cooldown" period in milliseconds after the Emergency gesture is
14510 * triggered, during which single-key actions on the power button are suppressed. Cooldown
14511 * period is disabled if set to zero.
14512 *
14513 * @hide
14514 */
14515 public static final String EMERGENCY_GESTURE_POWER_BUTTON_COOLDOWN_PERIOD_MS =
14516 "emergency_gesture_power_button_cooldown_period_ms";
14517
14518 /**
14519 * The minimum time in milliseconds to perform the emergency gesture.
14520 *
14521 * @hide
14522 */
14523 public static final String EMERGENCY_GESTURE_TAP_DETECTION_MIN_TIME_MS =
14524 "emergency_gesture_tap_detection_min_time_ms";
14525
14526 /**
14527 * Whether to enable automatic system server heap dumps. This only works on userdebug or
14528 * eng builds, not on user builds. This is set by the user and overrides the config value.
14529 * 1 means enable, 0 means disable.
14530 *
14531 * @hide
14532 */
14533 @Readable
14534 public static final String ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS =
14535 "enable_automatic_system_server_heap_dumps";
14536
14537 /**
14538 * See RIL_PreferredNetworkType in ril.h
14539 * @hide
14540 */
14541 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
14542 @Readable
14543 public static final String PREFERRED_NETWORK_MODE =
14544 "preferred_network_mode";
14545
14546 /**
14547 * Name of an application package to be debugged.
14548 */
14549 @Readable
14550 public static final String DEBUG_APP = "debug_app";
14551
14552 /**
14553 * If 1, when launching DEBUG_APP it will wait for the debugger before
14554 * starting user code. If 0, it will run normally.
14555 */
14556 @Readable
14557 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
14558
14559 /**
14560 * Allow GPU debug layers?
14561 * 0 = no
14562 * 1 = yes
14563 * @hide
14564 */
14565 @Readable
14566 public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers";
14567
14568 /**
14569 * App allowed to load GPU debug layers
14570 * @hide
14571 */
14572 @Readable
14573 public static final String GPU_DEBUG_APP = "gpu_debug_app";
14574
14575 /**
14576 * Package containing ANGLE libraries other than system, which are only available
14577 * to dumpable apps that opt-in.
14578 * @hide
14579 */
14580 @Readable
14581 public static final String ANGLE_DEBUG_PACKAGE = "angle_debug_package";
14582
14583 /**
14584 * Force all PKGs to use ANGLE, regardless of any other settings
14585 * The value is a boolean (1 or 0).
14586 * @hide
14587 */
14588 @Readable
14589 public static final String ANGLE_GL_DRIVER_ALL_ANGLE = "angle_gl_driver_all_angle";
14590
14591 /**
14592 * List of PKGs that have an OpenGL driver selected
14593 * @hide
14594 */
14595 @Readable
14596 public static final String ANGLE_GL_DRIVER_SELECTION_PKGS =
14597 "angle_gl_driver_selection_pkgs";
14598
14599 /**
14600 * List of selected OpenGL drivers, corresponding to the PKGs in GLOBAL_SETTINGS_DRIVER_PKGS
14601 * @hide
14602 */
14603 @Readable
14604 public static final String ANGLE_GL_DRIVER_SELECTION_VALUES =
14605 "angle_gl_driver_selection_values";
14606
14607 /**
14608 * Lists of ANGLE EGL features for debugging.
14609 * Each list of features is separated by a comma, each feature in each list is separated by
14610 * a colon.
14611 * e.g. feature1:feature2:feature3,feature1:feature3:feature5
14612 * @hide
14613 */
14614 @Readable
14615 public static final String ANGLE_EGL_FEATURES = "angle_egl_features";
14616
14617 /**
14618 * Comma-separated list of package names that ANGLE may have issues with
14619 * @hide
14620 */
14621 public static final String ANGLE_DEFERLIST = "angle_deferlist";
14622
14623 /**
14624 * Integer mode of the logic for applying `angle_deferlist`
14625 * @hide
14626 */
14627 public static final String ANGLE_DEFERLIST_MODE = "angle_deferlist_mode";
14628
14629 /**
14630 * Show the "ANGLE In Use" dialog box to the user when ANGLE is the OpenGL driver.
14631 * The value is a boolean (1 or 0).
14632 * @hide
14633 */
14634 @Readable
14635 public static final String SHOW_ANGLE_IN_USE_DIALOG_BOX = "show_angle_in_use_dialog_box";
14636
14637 /**
14638 * Updatable driver global preference for all Apps.
14639 * 0 = Default
14640 * 1 = All Apps use updatable production driver
14641 * 2 = All apps use updatable prerelease driver
14642 * 3 = All Apps use system graphics driver
14643 * @hide
14644 */
14645 @Readable
14646 public static final String UPDATABLE_DRIVER_ALL_APPS = "updatable_driver_all_apps";
14647
14648 /**
14649 * List of Apps selected to use updatable production driver.
14650 * i.e. <pkg1>,<pkg2>,...,<pkgN>
14651 * @hide
14652 */
14653 @Readable
14654 public static final String UPDATABLE_DRIVER_PRODUCTION_OPT_IN_APPS =
14655 "updatable_driver_production_opt_in_apps";
14656
14657 /**
14658 * List of Apps selected to use updatable prerelease driver.
14659 * i.e. <pkg1>,<pkg2>,...,<pkgN>
14660 * @hide
14661 */
14662 @Readable
14663 public static final String UPDATABLE_DRIVER_PRERELEASE_OPT_IN_APPS =
14664 "updatable_driver_prerelease_opt_in_apps";
14665
14666 /**
14667 * List of Apps selected not to use updatable production driver.
14668 * i.e. <pkg1>,<pkg2>,...,<pkgN>
14669 * @hide
14670 */
14671 @Readable
14672 public static final String UPDATABLE_DRIVER_PRODUCTION_OPT_OUT_APPS =
14673 "updatable_driver_production_opt_out_apps";
14674
14675 /**
14676 * Apps on the denylist that are forbidden to use updatable production driver.
14677 * @hide
14678 */
14679 @Readable
14680 public static final String UPDATABLE_DRIVER_PRODUCTION_DENYLIST =
14681 "updatable_driver_production_denylist";
14682
14683 /**
14684 * List of denylists, each denylist is a denylist for a specific version of
14685 * updatable production driver.
14686 * @hide
14687 */
14688 @Readable
14689 public static final String UPDATABLE_DRIVER_PRODUCTION_DENYLISTS =
14690 "updatable_driver_production_denylists";
14691
14692 /**
14693 * Apps on the allowlist that are allowed to use updatable production driver.
14694 * The string is a list of application package names, seperated by comma.
14695 * i.e. <apk1>,<apk2>,...,<apkN>
14696 * @hide
14697 */
14698 @Readable
14699 public static final String UPDATABLE_DRIVER_PRODUCTION_ALLOWLIST =
14700 "updatable_driver_production_allowlist";
14701
14702 /**
14703 * List of libraries in sphal accessible by updatable driver
14704 * The string is a list of library names, separated by colon.
14705 * i.e. <lib1>:<lib2>:...:<libN>
14706 * @hide
14707 */
14708 @Readable
14709 public static final String UPDATABLE_DRIVER_SPHAL_LIBRARIES =
14710 "updatable_driver_sphal_libraries";
14711
14712 /**
14713 * Ordered GPU debug layer list for Vulkan
14714 * i.e. <layer1>:<layer2>:...:<layerN>
14715 * @hide
14716 */
14717 @Readable
14718 public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers";
14719
14720 /**
14721 * Ordered GPU debug layer list for GLES
14722 * i.e. <layer1>:<layer2>:...:<layerN>
14723 * @hide
14724 */
14725 @Readable
14726 public static final String GPU_DEBUG_LAYERS_GLES = "gpu_debug_layers_gles";
14727
14728 /**
14729 * Addition app for GPU layer discovery
14730 * @hide
14731 */
14732 @Readable
14733 public static final String GPU_DEBUG_LAYER_APP = "gpu_debug_layer_app";
14734
14735 /**
14736 * Control whether the process CPU usage meter should be shown.
14737 *
14738 * @deprecated This functionality is no longer available as of
14739 * {@link android.os.Build.VERSION_CODES#N_MR1}.
14740 */
14741 @Deprecated
14742 @Readable
14743 public static final String SHOW_PROCESSES = "show_processes";
14744
14745 /**
14746 * If 1 low power mode (aka battery saver) is enabled.
14747 * @hide
14748 */
14749 @TestApi
14750 @Readable
14751 public static final String LOW_POWER_MODE = "low_power";
14752
14753 /**
14754 * If 1, battery saver ({@link #LOW_POWER_MODE}) will be re-activated after the device
14755 * is unplugged from a charger or rebooted.
14756 * @hide
14757 */
14758 @TestApi
14759 @Readable
14760 public static final String LOW_POWER_MODE_STICKY = "low_power_sticky";
14761
14762 /**
14763 * When a device is unplugged from a changer (or is rebooted), do not re-activate battery
14764 * saver even if {@link #LOW_POWER_MODE_STICKY} is 1, if the battery level is equal to or
14765 * above this threshold.
14766 *
14767 * @hide
14768 */
14769 @Readable
14770 public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL =
14771 "low_power_sticky_auto_disable_level";
14772
14773 /**
14774 * Whether sticky battery saver should be deactivated once the battery level has reached the
14775 * threshold specified by {@link #LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL}.
14776 *
14777 * @hide
14778 */
14779 @Readable
14780 public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED =
14781 "low_power_sticky_auto_disable_enabled";
14782
14783 /**
14784 * Battery level [1-100] at which low power mode automatically turns on.
14785 * If 0, it will not automatically turn on. For Q and newer, it will only automatically
14786 * turn on if the value is greater than 0 and the {@link #AUTOMATIC_POWER_SAVE_MODE}
14787 * setting is also set to
14788 * {@link android.os.PowerManager.AutoPowerSaveMode#POWER_SAVE_MODE_TRIGGER_PERCENTAGE}.
14789 * @see #AUTOMATIC_POWER_SAVE_MODE
14790 * @see android.os.PowerManager#getPowerSaveModeTrigger()
14791 * @hide
14792 */
14793 @Readable
14794 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
14795
14796 /**
14797 * Whether battery saver is currently set to trigger based on percentage, dynamic power
14798 * savings trigger, or none. See {@link AutoPowerSaveModeTriggers} for
14799 * accepted values.
14800 *
14801 * @hide
14802 */
14803 @TestApi
14804 @Readable
14805 public static final String AUTOMATIC_POWER_SAVE_MODE = "automatic_power_save_mode";
14806
14807 /**
14808 * The setting that backs the disable threshold for the setPowerSavingsWarning api in
14809 * PowerManager
14810 *
14811 * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int)
14812 * @hide
14813 */
14814 @TestApi
14815 @Readable
14816 public static final String DYNAMIC_POWER_SAVINGS_DISABLE_THRESHOLD =
14817 "dynamic_power_savings_disable_threshold";
14818
14819 /**
14820 * The setting which backs the setDynamicPowerSaveHint api in PowerManager.
14821 *
14822 * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int)
14823 * @hide
14824 */
14825 @TestApi
14826 @Readable
14827 public static final String DYNAMIC_POWER_SAVINGS_ENABLED = "dynamic_power_savings_enabled";
14828
14829 /**
14830 * A long value indicating how much longer the system battery is estimated to last in
14831 * millis. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value
14832 * was updated.
14833 *
14834 * @deprecated Use {@link PowerManager#getBatteryDischargePrediction()} instead.
14835 * @hide
14836 */
14837 @Deprecated
14838 @Readable
14839 public static final String TIME_REMAINING_ESTIMATE_MILLIS =
14840 "time_remaining_estimate_millis";
14841
14842 /**
14843 * A boolean indicating whether {@link #TIME_REMAINING_ESTIMATE_MILLIS} is customized
14844 * to the device's usage or using global models. See
14845 * {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value was updated.
14846 *
14847 * @deprecated Use {@link PowerManager#isBatteryDischargePredictionPersonalized()} instead.
14848 *
14849 * @hide
14850 */
14851 @Deprecated
14852 @Readable
14853 public static final String TIME_REMAINING_ESTIMATE_BASED_ON_USAGE =
14854 "time_remaining_estimate_based_on_usage";
14855
14856 /**
14857 * A long value indicating how long the system battery takes to deplete from 100% to 0% on
14858 * average based on historical drain rates. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME}
14859 * for the last time this value was updated.
14860 *
14861 * @deprecated Use {@link PowerManager#getHistoricalDischargeTime()} instead.
14862 * @hide
14863 */
14864 @Deprecated
14865 @Readable
14866 public static final String AVERAGE_TIME_TO_DISCHARGE = "average_time_to_discharge";
14867
14868 /**
14869 * A long indicating the epoch time in milliseconds when
14870 * {@link #TIME_REMAINING_ESTIMATE_MILLIS}, {@link #TIME_REMAINING_ESTIMATE_BASED_ON_USAGE},
14871 * and {@link #AVERAGE_TIME_TO_DISCHARGE} were last updated.
14872 *
14873 * @hide
14874 * @deprecated No longer needed due to {@link PowerManager#getBatteryDischargePrediction}.
14875 */
14876 @Deprecated
14877 @Readable
14878 public static final String BATTERY_ESTIMATES_LAST_UPDATE_TIME =
14879 "battery_estimates_last_update_time";
14880
14881 /**
14882 * The max value for {@link #LOW_POWER_MODE_TRIGGER_LEVEL}. If this setting is not set
14883 * or the value is 0, the default max will be used.
14884 *
14885 * @hide
14886 */
14887 @Readable
14888 public static final String LOW_POWER_MODE_TRIGGER_LEVEL_MAX = "low_power_trigger_level_max";
14889
14890 /**
14891 * See com.android.settingslib.fuelgauge.BatterySaverUtils.
14892 * @hide
14893 */
14894 @Readable
14895 public static final String LOW_POWER_MODE_SUGGESTION_PARAMS =
14896 "low_power_mode_suggestion_params";
14897
14898 /**
14899 * If not 0, the activity manager will aggressively finish activities and
14900 * processes as soon as they are no longer needed. If 0, the normal
14901 * extended lifetime is used.
14902 */
14903 @Readable
14904 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
14905
14906 /**
14907 * If nonzero, all system error dialogs will be hidden. For example, the
14908 * crash and ANR dialogs will not be shown, and the system will just proceed
14909 * as if they had been accepted by the user.
14910 * @hide
14911 */
14912 @TestApi
14913 @Readable
14914 public static final String HIDE_ERROR_DIALOGS = "hide_error_dialogs";
14915
14916 /**
14917 * Use Dock audio output for media:
14918 * 0 = disabled
14919 * 1 = enabled
14920 * @hide
14921 */
14922 @Readable
14923 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
14924
14925 /**
14926 * The surround sound formats AC3, DTS or IEC61937 are
14927 * available for use if they are detected.
14928 * This is the default mode.
14929 *
14930 * Note that AUTO is equivalent to ALWAYS for Android TVs and other
14931 * devices that have an S/PDIF output. This is because S/PDIF
14932 * is unidirectional and the TV cannot know if a decoder is
14933 * connected. So it assumes they are always available.
14934 * @hide
14935 */
14936 public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0;
14937
14938 /**
14939 * AC3, DTS or IEC61937 are NEVER available, even if they
14940 * are detected by the hardware. Those formats will not be
14941 * reported.
14942 *
14943 * An example use case would be an AVR reports that it is capable of
14944 * surround sound decoding but is broken. If NEVER is chosen
14945 * then apps must use PCM output instead of encoded output.
14946 * @hide
14947 */
14948 public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1;
14949
14950 /**
14951 * AC3, DTS or IEC61937 are ALWAYS available, even if they
14952 * are not detected by the hardware. Those formats will be
14953 * reported as part of the HDMI output capability. Applications
14954 * are then free to use either PCM or encoded output.
14955 *
14956 * An example use case would be a when TV was connected over
14957 * TOS-link to an AVR. But the TV could not see it because TOS-link
14958 * is unidirectional.
14959 * @hide
14960 */
14961 public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2;
14962
14963 /**
14964 * Surround sound formats are available according to the choice
14965 * of user, even if they are not detected by the hardware. Those
14966 * formats will be reported as part of the HDMI output capability.
14967 * Applications are then free to use either PCM or encoded output.
14968 *
14969 * An example use case would be an AVR that doesn't report a surround
14970 * format while the user knows the AVR does support it.
14971 * @hide
14972 */
14973 public static final int ENCODED_SURROUND_OUTPUT_MANUAL = 3;
14974
14975 /**
14976 * The maximum value for surround sound output mode in Android S.
14977 * @hide
14978 */
14979 public static final int ENCODED_SURROUND_SC_MAX = ENCODED_SURROUND_OUTPUT_MANUAL;
14980
14981 /**
14982 * Set to ENCODED_SURROUND_OUTPUT_AUTO,
14983 * ENCODED_SURROUND_OUTPUT_NEVER,
14984 * ENCODED_SURROUND_OUTPUT_ALWAYS or
14985 * ENCODED_SURROUND_OUTPUT_MANUAL
14986 * @hide
14987 */
14988 @Readable
14989 public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output";
14990
14991 /**
14992 * Surround sounds formats that are enabled when ENCODED_SURROUND_OUTPUT is set to
14993 * ENCODED_SURROUND_OUTPUT_MANUAL. Encoded as comma separated list. Allowed values
14994 * are the format constants defined in AudioFormat.java. Ex:
14995 *
14996 * "5,6"
14997 *
14998 * @hide
14999 */
15000 @Readable
15001 public static final String ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS =
15002 "encoded_surround_output_enabled_formats";
15003
15004 /**
15005 * Persisted safe headphone volume management state by AudioService
15006 * @hide
15007 */
15008 @Readable
15009 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
15010
15011 /**
15012 * URL for tzinfo (time zone) updates
15013 * @hide
15014 */
15015 @Readable
15016 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
15017
15018 /**
15019 * URL for tzinfo (time zone) update metadata
15020 * @hide
15021 */
15022 @Readable
15023 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
15024
15025 /**
15026 * URL for selinux (mandatory access control) updates
15027 * @hide
15028 */
15029 @Readable
15030 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
15031
15032 /**
15033 * URL for selinux (mandatory access control) update metadata
15034 * @hide
15035 */
15036 @Readable
15037 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
15038
15039 /**
15040 * URL for sms short code updates
15041 * @hide
15042 */
15043 @Readable
15044 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
15045 "sms_short_codes_content_url";
15046
15047 /**
15048 * URL for sms short code update metadata
15049 * @hide
15050 */
15051 @Readable
15052 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
15053 "sms_short_codes_metadata_url";
15054
15055 /**
15056 * URL for apn_db updates
15057 * @hide
15058 */
15059 @Readable
15060 public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url";
15061
15062 /**
15063 * URL for apn_db update metadata
15064 * @hide
15065 */
15066 @Readable
15067 public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url";
15068
15069 /**
15070 * URL for cert pinlist updates
15071 * @hide
15072 */
15073 @Readable
15074 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
15075
15076 /**
15077 * URL for cert pinlist updates
15078 * @hide
15079 */
15080 @Readable
15081 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
15082
15083 /**
15084 * URL for intent firewall updates
15085 * @hide
15086 */
15087 @Readable
15088 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
15089 "intent_firewall_content_url";
15090
15091 /**
15092 * URL for intent firewall update metadata
15093 * @hide
15094 */
15095 @Readable
15096 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
15097 "intent_firewall_metadata_url";
15098
15099 /**
15100 * URL for lang id model updates
15101 * @hide
15102 */
15103 @Readable
15104 public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url";
15105
15106 /**
15107 * URL for lang id model update metadata
15108 * @hide
15109 */
15110 @Readable
15111 public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url";
15112
15113 /**
15114 * URL for smart selection model updates
15115 * @hide
15116 */
15117 @Readable
15118 public static final String SMART_SELECTION_UPDATE_CONTENT_URL =
15119 "smart_selection_content_url";
15120
15121 /**
15122 * URL for smart selection model update metadata
15123 * @hide
15124 */
15125 @Readable
15126 public static final String SMART_SELECTION_UPDATE_METADATA_URL =
15127 "smart_selection_metadata_url";
15128
15129 /**
15130 * URL for conversation actions model updates
15131 * @hide
15132 */
15133 @Readable
15134 public static final String CONVERSATION_ACTIONS_UPDATE_CONTENT_URL =
15135 "conversation_actions_content_url";
15136
15137 /**
15138 * URL for conversation actions model update metadata
15139 * @hide
15140 */
15141 @Readable
15142 public static final String CONVERSATION_ACTIONS_UPDATE_METADATA_URL =
15143 "conversation_actions_metadata_url";
15144
15145 /**
15146 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
15147 * @hide
15148 */
15149 @Readable
15150 public static final String SELINUX_STATUS = "selinux_status";
15151
15152 /**
15153 * Developer setting to force RTL layout.
15154 * @hide
15155 */
15156 @Readable
15157 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
15158
15159 /**
15160 * Milliseconds after screen-off after which low battery sounds will be silenced.
15161 *
15162 * If zero, battery sounds will always play.
15163 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
15164 *
15165 * @hide
15166 */
15167 @Readable
15168 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
15169
15170 /**
15171 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
15172 * the caller is done with this, they should call {@link ContentResolver#delete} to
15173 * clean up any value that they may have written.
15174 *
15175 * @hide
15176 */
15177 @Readable
15178 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
15179
15180 /**
15181 * Defines global runtime overrides to window policy.
15182 *
15183 * See {@link com.android.server.wm.PolicyControl} for value format.
15184 *
15185 * @hide
15186 */
15187 @Readable
15188 public static final String POLICY_CONTROL = "policy_control";
15189
15190 /**
15191 * {@link android.view.DisplayCutout DisplayCutout} emulation mode.
15192 *
15193 * @hide
15194 */
15195 @Readable
15196 public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout";
15197
15198 /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0;
15199 /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1;
15200
15201 /**
15202 * A colon separated list of keys for Settings Slices.
15203 *
15204 * @hide
15205 */
15206 @Readable
15207 public static final String BLOCKED_SLICES = "blocked_slices";
15208
15209 /**
15210 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
15211 * or ZEN_MODE_NO_INTERRUPTIONS.
15212 *
15213 * @hide
15214 */
15215 @UnsupportedAppUsage
15216 @Readable
15217 public static final String ZEN_MODE = "zen_mode";
15218
15219 /** @hide */
15220 @UnsupportedAppUsage
15221 public static final int ZEN_MODE_OFF = 0;
15222 /** @hide */
15223 @UnsupportedAppUsage
15224 public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
15225 /** @hide */
15226 @UnsupportedAppUsage
15227 public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
15228 /** @hide */
15229 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
15230 public static final int ZEN_MODE_ALARMS = 3;
15231
15232 /**
15233 * A comma-separated list of HDR formats that have been disabled by the user.
15234 * <p>
15235 * If present, these formats will not be reported to apps, even if the display supports
15236 * them. This list is treated as empty if the ARE_USER_DISABLED_HDR_FORMATS_ALLOWED setting
15237 * is '1'.
15238 * </p>
15239 * @hide
15240 */
15241 @TestApi
15242 @Readable
15243 @SuppressLint("NoSettingsProvider")
15244 public static final String USER_DISABLED_HDR_FORMATS = "user_disabled_hdr_formats";
15245
15246 /**
15247 * Whether or not user-disabled HDR formats are allowed.
15248 * <p>
15249 * The value is boolean (1 or 0). The value '1' means the user preference for disabling a
15250 * format is ignored, and the disabled formats are still reported to apps (if supported
15251 * by the display). The value '0' means the user-disabled formats are not reported to
15252 * apps, even if the display supports them.
15253 * </p><p>
15254 * The list of formats disabled by the user are contained in the
15255 * USER_DISABLED_HDR_FORMATS setting. This list is treated as empty when the value of
15256 * this setting is '1'.
15257 * </p>
15258 * @hide
15259 */
15260 @TestApi
15261 @Readable
15262 @SuppressLint("NoSettingsProvider")
15263 public static final String ARE_USER_DISABLED_HDR_FORMATS_ALLOWED =
15264 "are_user_disabled_hdr_formats_allowed";
15265
15266 /**
15267 * Whether or not syncs (bulk set operations) for {@link DeviceConfig} are currently
15268 * persistently disabled. This is only used for the {@link
15269 * Config#SYNC_DISABLED_MODE_PERSISTENT persistent} mode, {@link
15270 * Config#SYNC_DISABLED_MODE_UNTIL_REBOOT until_reboot} mode is not stored in settings.
15271 * The value is boolean (1 or 0). The value '1' means that {@link
15272 * DeviceConfig#setProperties(DeviceConfig.Properties)} will return {@code false}.
15273 *
15274 * @hide
15275 */
15276 public static final String DEVICE_CONFIG_SYNC_DISABLED = "device_config_sync_disabled";
15277
15278
15279 /**
15280 * Whether back preview animations are played when user does a back gesture or presses
15281 * the back button.
15282 * @hide
15283 */
15284 public static final String ENABLE_BACK_ANIMATION = "enable_back_animation";
15285
15286 /** @hide */ public static String zenModeToString(int mode) {
15287 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
15288 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
15289 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
15290 return "ZEN_MODE_OFF";
15291 }
15292
15293 /** @hide */ public static boolean isValidZenMode(int value) {
15294 switch (value) {
15295 case Global.ZEN_MODE_OFF:
15296 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
15297 case Global.ZEN_MODE_ALARMS:
15298 case Global.ZEN_MODE_NO_INTERRUPTIONS:
15299 return true;
15300 default:
15301 return false;
15302 }
15303 }
15304
15305 /**
15306 * Value of the ringer before entering zen mode.
15307 *
15308 * @hide
15309 */
15310 @Readable
15311 public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level";
15312
15313 /**
15314 * Opaque value, changes when persisted zen mode configuration changes.
15315 *
15316 * @hide
15317 */
15318 @UnsupportedAppUsage
15319 @Readable
15320 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
15321
15322 /**
15323 * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION} instead
15324 * @hide
15325 */
15326 @Deprecated
15327 public static final String ZEN_DURATION = "zen_duration";
15328
15329 /**
15330 * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_PROMPT} instead
15331 * @hide
15332 */
15333 @Deprecated
15334 public static final int ZEN_DURATION_PROMPT = -1;
15335
15336 /**
15337 * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_FOREVER} instead
15338 * @hide
15339 */
15340 @Deprecated
15341 public static final int ZEN_DURATION_FOREVER = 0;
15342
15343 /**
15344 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
15345 *
15346 * @hide
15347 */
15348 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
15349 @Readable
15350 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
15351 "heads_up_notifications_enabled";
15352
15353 /** @hide */
15354 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
15355 public static final int HEADS_UP_OFF = 0;
15356 /** @hide */
15357 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
15358 public static final int HEADS_UP_ON = 1;
15359
15360 /**
15361 * The refresh rate chosen by the user.
15362 *
15363 * @hide
15364 */
15365 @TestApi
15366 @Readable
15367 @SuppressLint("NoSettingsProvider")
15368 public static final String USER_PREFERRED_REFRESH_RATE = "user_preferred_refresh_rate";
15369
15370 /**
15371 * The resolution height chosen by the user.
15372 *
15373 * @hide
15374 */
15375 @TestApi
15376 @Readable
15377 @SuppressLint("NoSettingsProvider")
15378 public static final String USER_PREFERRED_RESOLUTION_HEIGHT =
15379 "user_preferred_resolution_height";
15380
15381 /**
15382 * The resolution width chosen by the user.
15383 *
15384 * @hide
15385 */
15386 @TestApi
15387 @Readable
15388 @SuppressLint("NoSettingsProvider")
15389 public static final String USER_PREFERRED_RESOLUTION_WIDTH =
15390 "user_preferred_resolution_width";
15391
15392 /**
15393 * The name of the device
15394 */
15395 @Readable
15396 public static final String DEVICE_NAME = "device_name";
15397
15398 /**
15399 * Whether the NetworkScoringService has been first initialized.
15400 * <p>
15401 * Type: int (0 for false, 1 for true)
15402 * @hide
15403 */
15404 @Readable
15405 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
15406
15407 /**
15408 * Indicates whether the user wants to be prompted for password to decrypt the device on
15409 * boot. This only matters if the storage is encrypted.
15410 * <p>
15411 * Type: int (0 for false, 1 for true)
15412 *
15413 * @hide
15414 */
15415 @SystemApi
15416 @Readable
15417 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
15418
15419 /**
15420 * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config
15421 * value
15422 * {@link android.telephony.CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL}.
15423 * <p>
15424 * Type: int (0 for false, 1 for true)
15425 * @hide
15426 * @deprecated Use
15427 * {@link android.provider.Telephony.SimInfo#COLUMN_ENHANCED_4G_MODE_ENABLED} instead.
15428 */
15429 @Deprecated
15430 @Readable
15431 public static final String ENHANCED_4G_MODE_ENABLED =
15432 Telephony.SimInfo.COLUMN_ENHANCED_4G_MODE_ENABLED;
15433
15434 /**
15435 * Whether VT (Video Telephony over IMS) is enabled
15436 * <p>
15437 * Type: int (0 for false, 1 for true)
15438 *
15439 * @hide
15440 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_VT_IMS_ENABLED} instead.
15441 */
15442 @Deprecated
15443 @Readable
15444 public static final String VT_IMS_ENABLED = Telephony.SimInfo.COLUMN_VT_IMS_ENABLED;
15445
15446 /**
15447 * Whether WFC is enabled
15448 * <p>
15449 * Type: int (0 for false, 1 for true)
15450 *
15451 * @hide
15452 * @deprecated Use
15453 * {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ENABLED} instead.
15454 */
15455 @Deprecated
15456 @Readable
15457 public static final String WFC_IMS_ENABLED = Telephony.SimInfo.COLUMN_WFC_IMS_ENABLED;
15458
15459 /**
15460 * WFC mode on home/non-roaming network.
15461 * <p>
15462 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
15463 *
15464 * @hide
15465 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_MODE} instead.
15466 */
15467 @Deprecated
15468 @Readable
15469 public static final String WFC_IMS_MODE = Telephony.SimInfo.COLUMN_WFC_IMS_MODE;
15470
15471 /**
15472 * WFC mode on roaming network.
15473 * <p>
15474 * Type: int - see {@link #WFC_IMS_MODE} for values
15475 *
15476 * @hide
15477 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ROAMING_MODE}
15478 * instead.
15479 */
15480 @Deprecated
15481 @Readable
15482 public static final String WFC_IMS_ROAMING_MODE =
15483 Telephony.SimInfo.COLUMN_WFC_IMS_ROAMING_MODE;
15484
15485 /**
15486 * Whether WFC roaming is enabled
15487 * <p>
15488 * Type: int (0 for false, 1 for true)
15489 *
15490 * @hide
15491 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ROAMING_ENABLED}
15492 * instead
15493 */
15494 @Deprecated
15495 @Readable
15496 public static final String WFC_IMS_ROAMING_ENABLED =
15497 Telephony.SimInfo.COLUMN_WFC_IMS_ROAMING_ENABLED;
15498
15499 /**
15500 * Whether user can enable/disable LTE as a preferred network. A carrier might control
15501 * this via gservices, OMA-DM, carrier app, etc.
15502 * <p>
15503 * Type: int (0 for false, 1 for true)
15504 * @hide
15505 */
15506 @Readable
15507 public static final String LTE_SERVICE_FORCED = "lte_service_forced";
15508
15509
15510 /**
15511 * Specifies the behaviour the lid triggers when closed
15512 * <p>
15513 * See WindowManagerPolicy.WindowManagerFuncs
15514 * @hide
15515 */
15516 @Readable
15517 public static final String LID_BEHAVIOR = "lid_behavior";
15518
15519 /**
15520 * Ephemeral app cookie max size in bytes.
15521 * <p>
15522 * Type: int
15523 * @hide
15524 */
15525 @Readable
15526 public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES =
15527 "ephemeral_cookie_max_size_bytes";
15528
15529 /**
15530 * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is
15531 * enabled. Set to zero to disable.
15532 * <p>
15533 * Type: int (0 for false, 1 for true)
15534 *
15535 * @hide
15536 */
15537 @Readable
15538 public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature";
15539
15540 /**
15541 * Toggle to enable/disable dexopt for instant applications. The default is for dexopt
15542 * to be disabled.
15543 * <p>
15544 * Type: int (0 to disable, 1 to enable)
15545 *
15546 * @hide
15547 */
15548 @Readable
15549 public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled";
15550
15551 /**
15552 * The min period for caching installed instant apps in milliseconds.
15553 * <p>
15554 * Type: long
15555 * @hide
15556 */
15557 @Readable
15558 public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
15559 "installed_instant_app_min_cache_period";
15560
15561 /**
15562 * The max period for caching installed instant apps in milliseconds.
15563 * <p>
15564 * Type: long
15565 * @hide
15566 */
15567 @Readable
15568 public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
15569 "installed_instant_app_max_cache_period";
15570
15571 /**
15572 * The min period for caching uninstalled instant apps in milliseconds.
15573 * <p>
15574 * Type: long
15575 * @hide
15576 */
15577 @Readable
15578 public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
15579 "uninstalled_instant_app_min_cache_period";
15580
15581 /**
15582 * The max period for caching uninstalled instant apps in milliseconds.
15583 * <p>
15584 * Type: long
15585 * @hide
15586 */
15587 @Readable
15588 public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
15589 "uninstalled_instant_app_max_cache_period";
15590
15591 /**
15592 * The min period for caching unused static shared libs in milliseconds.
15593 * <p>
15594 * Type: long
15595 * @hide
15596 */
15597 @Readable
15598 public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD =
15599 "unused_static_shared_lib_min_cache_period";
15600
15601 /**
15602 * Allows switching users when system user is locked.
15603 * <p>
15604 * Type: int
15605 * @hide
15606 */
15607 @Readable
15608 public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED =
15609 "allow_user_switching_when_system_user_locked";
15610
15611 /**
15612 * Boot count since the device starts running API level 24.
15613 * <p>
15614 * Type: int
15615 */
15616 @Readable
15617 public static final String BOOT_COUNT = "boot_count";
15618
15619 /**
15620 * Whether the safe boot is disallowed.
15621 *
15622 * <p>This setting should have the identical value as the corresponding user restriction.
15623 * The purpose of the setting is to make the restriction available in early boot stages
15624 * before the user restrictions are loaded.
15625 * @hide
15626 */
15627 @Readable
15628 public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed";
15629
15630 /**
15631 * Indicates whether this device is currently in retail demo mode. If true, the device
15632 * usage is severely limited.
15633 * <p>
15634 * Type: int (0 for false, 1 for true)
15635 *
15636 * @hide
15637 */
15638 @SystemApi
15639 @Readable
15640 public static final String DEVICE_DEMO_MODE = "device_demo_mode";
15641
15642 /**
15643 * The reason for the settings database being downgraded. This is only for
15644 * troubleshooting purposes and its value should not be interpreted in any way.
15645 *
15646 * Type: string
15647 *
15648 * @hide
15649 */
15650 @Readable
15651 public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason";
15652
15653 /**
15654 * The build id of when the settings database was first created (or re-created due it
15655 * being missing).
15656 *
15657 * Type: string
15658 *
15659 * @hide
15660 */
15661 @Readable
15662 public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid";
15663
15664 /**
15665 * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by
15666 * default. Set to 0 to disable.
15667 *
15668 * @hide
15669 */
15670 @Readable
15671 public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled";
15672
15673 /**
15674 * Flag to enable the link to location permissions in location setting. Set to 0 to disable.
15675 *
15676 * @hide
15677 */
15678 @Readable
15679 public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED =
15680 "location_settings_link_to_permissions_enabled";
15681
15682 /**
15683 * Flag to set the waiting time for removing invisible euicc profiles inside System >
15684 * Settings.
15685 * Type: long
15686 *
15687 * @hide
15688 */
15689 @Readable
15690 public static final String EUICC_REMOVING_INVISIBLE_PROFILES_TIMEOUT_MILLIS =
15691 "euicc_removing_invisible_profiles_timeout_millis";
15692
15693 /**
15694 * Flag to set the waiting time for euicc factory reset inside System > Settings
15695 * Type: long
15696 *
15697 * @hide
15698 */
15699 @Readable
15700 public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS =
15701 "euicc_factory_reset_timeout_millis";
15702
15703 /**
15704 * Flag to set the waiting time for euicc slot switch.
15705 * Type: long
15706 *
15707 * @hide
15708 */
15709 public static final String EUICC_SWITCH_SLOT_TIMEOUT_MILLIS =
15710 "euicc_switch_slot_timeout_millis";
15711
15712 /**
15713 * Flag to set the waiting time for enabling multi SIM slot.
15714 * Type: long
15715 *
15716 * @hide
15717 */
15718 public static final String ENABLE_MULTI_SLOT_TIMEOUT_MILLIS =
15719 "enable_multi_slot_timeout_millis";
15720
15721 /**
15722 * Flag to set the timeout for when to refresh the storage settings cached data.
15723 * Type: long
15724 *
15725 * @hide
15726 */
15727 @Readable
15728 public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD =
15729 "storage_settings_clobber_threshold";
15730
15731 /**
15732 * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored
15733 * and restoring to lower version of platform API will be skipped.
15734 *
15735 * @hide
15736 */
15737 @Readable
15738 public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION =
15739 "override_settings_provider_restore_any_version";
15740 /**
15741 * Flag to toggle whether system services report attribution chains when they attribute
15742 * battery use via a {@code WorkSource}.
15743 *
15744 * Type: int (0 to disable, 1 to enable)
15745 *
15746 * @hide
15747 */
15748 @Readable
15749 public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED =
15750 "chained_battery_attribution_enabled";
15751
15752 /**
15753 * Toggle to enable/disable the incremental ADB installation by default.
15754 * If not set, default adb installations are incremental; set to zero to use full ones.
15755 * Note: only ADB uses it, no usages in the Framework code.
15756 * <p>
15757 * Type: int (0 to disable, 1 to enable)
15758 *
15759 * @hide
15760 */
15761 @Readable
15762 public static final String ENABLE_ADB_INCREMENTAL_INSTALL_DEFAULT =
15763 "enable_adb_incremental_install_default";
15764
15765 /**
15766 * The packages whitelisted to be run in autofill compatibility mode. The list
15767 * of packages is {@code ":"} colon delimited, and each entry has the name of the
15768 * package and an optional list of url bar resource ids (the list is delimited by
15769 * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited).
15770 *
15771 * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where
15772 * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 }
15773 * have 2 ids {@code url_foo} and {@code url_bas}) would be
15774 * {@code p1[url_bar]:p2:p3[url_foo,url_bas]}
15775 *
15776 * @hide
15777 * @deprecated Use {@link android.view.autofill.AutofillManager
15778 * #DEVICE_CONFIG_AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES} instead.
15779 */
15780 @Deprecated
15781 @SystemApi
15782 @Readable
15783 public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES =
15784 "autofill_compat_mode_allowed_packages";
15785
15786 /**
15787 * Level of autofill logging.
15788 *
15789 * <p>Valid values are
15790 * {@link android.view.autofill.AutofillManager#NO_LOGGING},
15791 * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_DEBUG}, or
15792 * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_VERBOSE}.
15793 *
15794 * @hide
15795 */
15796 @Readable
15797 public static final String AUTOFILL_LOGGING_LEVEL = "autofill_logging_level";
15798
15799 /**
15800 * Maximum number of partitions that can be allowed in an autofill session.
15801 *
15802 * @hide
15803 */
15804 @Readable
15805 public static final String AUTOFILL_MAX_PARTITIONS_SIZE = "autofill_max_partitions_size";
15806
15807 /**
15808 * Maximum number of visible datasets in the Autofill dataset picker UI, or {@code 0} to use
15809 * the default value from resources.
15810 *
15811 * @hide
15812 */
15813 @Readable
15814 public static final String AUTOFILL_MAX_VISIBLE_DATASETS = "autofill_max_visible_datasets";
15815
15816 /**
15817 * Toggle for enabling stylus handwriting. When enabled, current Input method receives
15818 * stylus {@link MotionEvent}s if an {@link Editor} is focused.
15819 *
15820 * @hide
15821 */
15822 @TestApi
15823 @Readable
15824 @SuppressLint("NoSettingsProvider")
15825 public static final String STYLUS_HANDWRITING_ENABLED = "stylus_handwriting_enabled";
15826
15827 /**
15828 * Indicates whether a stylus has ever been used on the device.
15829 *
15830 * @hide
15831 */
15832 @Readable
15833 @SuppressLint("NoSettingsProvider")
15834 public static final String STYLUS_EVER_USED = "stylus_ever_used";
15835
15836 /**
15837 * Exemptions to the hidden API blacklist.
15838 *
15839 * @hide
15840 */
15841 @TestApi
15842 @Readable
15843 public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS =
15844 "hidden_api_blacklist_exemptions";
15845
15846 /**
15847 * Hidden API enforcement policy for apps.
15848 *
15849 * Values correspond to @{@link
15850 * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy}
15851 *
15852 * @hide
15853 */
15854 @TestApi
15855 @Readable
15856 public static final String HIDDEN_API_POLICY = "hidden_api_policy";
15857
15858 /**
15859 * Flag for forcing {@link com.android.server.compat.OverrideValidatorImpl}
15860 * to consider this a non-debuggable build.
15861 *
15862 * @hide
15863 */
15864 public static final String FORCE_NON_DEBUGGABLE_FINAL_BUILD_FOR_COMPAT =
15865 "force_non_debuggable_final_build_for_compat";
15866
15867
15868 /**
15869 * Current version of signed configuration applied.
15870 *
15871 * @hide
15872 */
15873 @Readable
15874 public static final String SIGNED_CONFIG_VERSION = "signed_config_version";
15875
15876 /**
15877 * Timeout for a single {@link android.media.soundtrigger.SoundTriggerDetectionService}
15878 * operation (in ms).
15879 *
15880 * @hide
15881 */
15882 @Readable
15883 public static final String SOUND_TRIGGER_DETECTION_SERVICE_OP_TIMEOUT =
15884 "sound_trigger_detection_service_op_timeout";
15885
15886 /**
15887 * Maximum number of {@link android.media.soundtrigger.SoundTriggerDetectionService}
15888 * operations per day.
15889 *
15890 * @hide
15891 */
15892 @Readable
15893 public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY =
15894 "max_sound_trigger_detection_service_ops_per_day";
15895
15896 /**
15897 * Setting to determine if the Clockwork Home application is ready.
15898 *
15899 * <p>
15900 * Set to 1 when the Clockwork Home application has finished starting up.
15901 * </p>
15902 *
15903 * @hide
15904 */
15905 public static final String CLOCKWORK_HOME_READY = "clockwork_home_ready";
15906
15907 /**
15908 * Indicates whether aware is available in the current location.
15909 * @hide
15910 */
15911 @Readable
15912 public static final String AWARE_ALLOWED = "aware_allowed";
15913
15914 /**
15915 * Overrides internal R.integer.config_longPressOnPowerBehavior.
15916 * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
15917 * Used by PhoneWindowManager.
15918 * @hide
15919 */
15920 @Readable
15921 public static final String POWER_BUTTON_LONG_PRESS =
15922 "power_button_long_press";
15923
15924 /**
15925 * Override internal R.integer.config_longPressOnPowerDurationMs. It determines the length
15926 * of power button press to be considered a long press in milliseconds.
15927 * Used by PhoneWindowManager.
15928 * @hide
15929 */
15930 @Readable
15931 public static final String POWER_BUTTON_LONG_PRESS_DURATION_MS =
15932 "power_button_long_press_duration_ms";
15933
15934 /**
15935 * Overrides internal R.integer.config_veryLongPressOnPowerBehavior.
15936 * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
15937 * Used by PhoneWindowManager.
15938 * @hide
15939 */
15940 @Readable
15941 public static final String POWER_BUTTON_VERY_LONG_PRESS =
15942 "power_button_very_long_press";
15943
15944 /**
15945 * Overrides internal R.integer.config_keyChordPowerVolumeUp.
15946 * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
15947 * Used by PhoneWindowManager.
15948 * @hide
15949 */
15950 @Readable
15951 public static final String KEY_CHORD_POWER_VOLUME_UP =
15952 "key_chord_power_volume_up";
15953
15954 /**
15955 * Keyguard should be on the left hand side of the screen, for wide screen layouts.
15956 *
15957 * @hide
15958 */
15959 public static final int ONE_HANDED_KEYGUARD_SIDE_LEFT = 0;
15960
15961 /**
15962 * Keyguard should be on the right hand side of the screen, for wide screen layouts.
15963 *
15964 * @hide
15965 */
15966 public static final int ONE_HANDED_KEYGUARD_SIDE_RIGHT = 1;
15967 /**
15968 * In one handed mode, which side the keyguard should be on. Allowable values are one of
15969 * the ONE_HANDED_KEYGUARD_SIDE_* constants.
15970 *
15971 * @hide
15972 */
15973 public static final String ONE_HANDED_KEYGUARD_SIDE = "one_handed_keyguard_side";
15974
15975 /**
15976 * Global settings that shouldn't be persisted.
15977 *
15978 * @hide
15979 */
15980 public static final String[] TRANSIENT_SETTINGS = {
15981 CLOCKWORK_HOME_READY,
15982 };
15983
15984 /**
15985 * Keys we no longer back up under the current schema, but want to continue to
15986 * process when restoring historical backup datasets.
15987 *
15988 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
15989 * otherwise they won't be restored.
15990 *
15991 * @hide
15992 */
15993 public static final String[] LEGACY_RESTORE_SETTINGS = {
15994 };
15995
15996 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
15997 private static final ContentProviderHolder sProviderHolder =
15998 new ContentProviderHolder(CONTENT_URI);
15999
16000 // Populated lazily, guarded by class object:
16001 @UnsupportedAppUsage
16002 private static final NameValueCache sNameValueCache = new NameValueCache(
16003 CONTENT_URI,
16004 CALL_METHOD_GET_GLOBAL,
16005 CALL_METHOD_PUT_GLOBAL,
16006 CALL_METHOD_DELETE_GLOBAL,
16007 sProviderHolder,
16008 Global.class);
16009
16010 // Certain settings have been moved from global to the per-user secure namespace
16011 @UnsupportedAppUsage
16012 private static final HashSet<String> MOVED_TO_SECURE;
16013 static {
16014 MOVED_TO_SECURE = new HashSet<>(8);
16015 MOVED_TO_SECURE.add(Global.INSTALL_NON_MARKET_APPS);
16016 MOVED_TO_SECURE.add(Global.ZEN_DURATION);
16017 MOVED_TO_SECURE.add(Global.SHOW_ZEN_UPGRADE_NOTIFICATION);
16018 MOVED_TO_SECURE.add(Global.SHOW_ZEN_SETTINGS_SUGGESTION);
16019 MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_UPDATED);
16020 MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_SUGGESTION_VIEWED);
16021 MOVED_TO_SECURE.add(Global.CHARGING_SOUNDS_ENABLED);
16022 MOVED_TO_SECURE.add(Global.CHARGING_VIBRATION_ENABLED);
16023 MOVED_TO_SECURE.add(Global.NOTIFICATION_BUBBLES);
16024 }
16025
16026 // Certain settings have been moved from global to the per-user system namespace
16027 private static final HashSet<String> MOVED_TO_SYSTEM;
16028 static {
16029 MOVED_TO_SYSTEM = new HashSet<>(1);
16030 MOVED_TO_SYSTEM.add(Global.APPLY_RAMPING_RINGER);
16031 }
16032
16033 /** @hide */
16034 public static void getMovedToSecureSettings(Set<String> outKeySet) {
16035 outKeySet.addAll(MOVED_TO_SECURE);
16036 }
16037
16038 /** @hide */
16039 public static void getMovedToSystemSettings(Set<String> outKeySet) {
16040 outKeySet.addAll(MOVED_TO_SYSTEM);
16041 }
16042
16043 /** @hide */
16044 public static void clearProviderForTest() {
16045 sProviderHolder.clearProviderForTest();
16046 sNameValueCache.clearGenerationTrackerForTest();
16047 }
16048
16049 /** @hide */
16050 public static void getPublicSettings(Set<String> allKeys, Set<String> readableKeys,
16051 ArrayMap<String, Integer> readableKeysWithMaxTargetSdk) {
16052 getPublicSettingsForClass(Global.class, allKeys, readableKeys,
16053 readableKeysWithMaxTargetSdk);
16054 }
16055
16056 /**
16057 * Look up a name in the database.
16058 * @param resolver to access the database with
16059 * @param name to look up in the table
16060 * @return the corresponding value, or null if not present
16061 */
16062 public static String getString(ContentResolver resolver, String name) {
16063 return getStringForUser(resolver, name, resolver.getUserId());
16064 }
16065
16066 /** @hide */
16067 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
16068 public static String getStringForUser(ContentResolver resolver, String name,
16069 int userHandle) {
16070 if (MOVED_TO_SECURE.contains(name)) {
16071 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
16072 + " to android.provider.Settings.Secure, returning read-only value.");
16073 return Secure.getStringForUser(resolver, name, userHandle);
16074 }
16075 if (MOVED_TO_SYSTEM.contains(name)) {
16076 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
16077 + " to android.provider.Settings.System, returning read-only value.");
16078 return System.getStringForUser(resolver, name, userHandle);
16079 }
16080 return sNameValueCache.getStringForUser(resolver, name, userHandle);
16081 }
16082
16083 /**
16084 * Store a name/value pair into the database.
16085 * @param resolver to access the database with
16086 * @param name to store
16087 * @param value to associate with the name
16088 * @return true if the value was set, false on database errors
16089 */
16090 public static boolean putString(ContentResolver resolver,
16091 String name, String value) {
16092 return putStringForUser(resolver, name, value, null, false, resolver.getUserId(),
16093 DEFAULT_OVERRIDEABLE_BY_RESTORE);
16094 }
16095
16096 /**
16097 * Store a name/value pair into the database.
16098 *
16099 * @param resolver to access the database with
16100 * @param name to store
16101 * @param value to associate with the name
16102 * @param tag to associated with the setting.
16103 * @param makeDefault whether to make the value the default one.
16104 * @param overrideableByRestore whether restore can override this value
16105 * @return true if the value was set, false on database errors
16106 *
16107 * @hide
16108 */
16109 @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE)
16110 public static boolean putString(@NonNull ContentResolver resolver,
16111 @NonNull String name, @Nullable String value, @Nullable String tag,
16112 boolean makeDefault, boolean overrideableByRestore) {
16113 return putStringForUser(resolver, name, value, tag, makeDefault,
16114 resolver.getUserId(), overrideableByRestore);
16115 }
16116
16117 /**
16118 * Store a name/value pair into the database.
16119 * <p>
16120 * The method takes an optional tag to associate with the setting
16121 * which can be used to clear only settings made by your package and
16122 * associated with this tag by passing the tag to {@link
16123 * #resetToDefaults(ContentResolver, String)}. Anyone can override
16124 * the current tag. Also if another package changes the setting
16125 * then the tag will be set to the one specified in the set call
16126 * which can be null. Also any of the settings setters that do not
16127 * take a tag as an argument effectively clears the tag.
16128 * </p><p>
16129 * For example, if you set settings A and B with tags T1 and T2 and
16130 * another app changes setting A (potentially to the same value), it
16131 * can assign to it a tag T3 (note that now the package that changed
16132 * the setting is not yours). Now if you reset your changes for T1 and
16133 * T2 only setting B will be reset and A not (as it was changed by
16134 * another package) but since A did not change you are in the desired
16135 * initial state. Now if the other app changes the value of A (assuming
16136 * you registered an observer in the beginning) you would detect that
16137 * the setting was changed by another app and handle this appropriately
16138 * (ignore, set back to some value, etc).
16139 * </p><p>
16140 * Also the method takes an argument whether to make the value the
16141 * default for this setting. If the system already specified a default
16142 * value, then the one passed in here will <strong>not</strong>
16143 * be set as the default.
16144 * </p>
16145 *
16146 * @param resolver to access the database with.
16147 * @param name to store.
16148 * @param value to associate with the name.
16149 * @param tag to associated with the setting.
16150 * @param makeDefault whether to make the value the default one.
16151 * @return true if the value was set, false on database errors.
16152 *
16153 * @see #resetToDefaults(ContentResolver, String)
16154 *
16155 * @hide
16156 */
16157 @SystemApi
16158 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
16159 public static boolean putString(@NonNull ContentResolver resolver,
16160 @NonNull String name, @Nullable String value, @Nullable String tag,
16161 boolean makeDefault) {
16162 return putStringForUser(resolver, name, value, tag, makeDefault,
16163 resolver.getUserId(), DEFAULT_OVERRIDEABLE_BY_RESTORE);
16164 }
16165
16166 /**
16167 * Reset the settings to their defaults. This would reset <strong>only</strong>
16168 * settings set by the caller's package. Think of it of a way to undo your own
16169 * changes to the secure settings. Passing in the optional tag will reset only
16170 * settings changed by your package and associated with this tag.
16171 *
16172 * @param resolver Handle to the content resolver.
16173 * @param tag Optional tag which should be associated with the settings to reset.
16174 *
16175 * @see #putString(ContentResolver, String, String, String, boolean)
16176 *
16177 * @hide
16178 */
16179 @SystemApi
16180 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
16181 public static void resetToDefaults(@NonNull ContentResolver resolver,
16182 @Nullable String tag) {
16183 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
16184 resolver.getUserId());
16185 }
16186
16187 /**
16188 * Reset the settings to their defaults for a given user with a specific mode. The
16189 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
16190 * allowing resetting the settings made by a package and associated with the tag.
16191 *
16192 * @param resolver Handle to the content resolver.
16193 * @param tag Optional tag which should be associated with the settings to reset.
16194 * @param mode The reset mode.
16195 * @param userHandle The user for which to reset to defaults.
16196 *
16197 * @see #RESET_MODE_PACKAGE_DEFAULTS
16198 * @see #RESET_MODE_UNTRUSTED_DEFAULTS
16199 * @see #RESET_MODE_UNTRUSTED_CHANGES
16200 * @see #RESET_MODE_TRUSTED_DEFAULTS
16201 *
16202 * @hide
16203 */
16204 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
16205 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
16206 try {
16207 Bundle arg = new Bundle();
16208 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
16209 if (tag != null) {
16210 arg.putString(CALL_METHOD_TAG_KEY, tag);
16211 }
16212 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
16213 IContentProvider cp = sProviderHolder.getProvider(resolver);
16214 cp.call(resolver.getAttributionSource(),
16215 sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_GLOBAL, null, arg);
16216 } catch (RemoteException e) {
16217 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
16218 }
16219 }
16220
16221 /** @hide */
16222 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
16223 public static boolean putStringForUser(ContentResolver resolver,
16224 String name, String value, int userHandle) {
16225 return putStringForUser(resolver, name, value, null, false, userHandle,
16226 DEFAULT_OVERRIDEABLE_BY_RESTORE);
16227 }
16228
16229 /** @hide */
16230 public static boolean putStringForUser(@NonNull ContentResolver resolver,
16231 @NonNull String name, @Nullable String value, @Nullable String tag,
16232 boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore) {
16233 if (LOCAL_LOGV) {
16234 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
16235 + " for " + userHandle);
16236 }
16237 // Global and Secure have the same access policy so we can forward writes
16238 if (MOVED_TO_SECURE.contains(name)) {
16239 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
16240 + " to android.provider.Settings.Secure, value is unchanged.");
16241 return Secure.putStringForUser(resolver, name, value, tag,
16242 makeDefault, userHandle, overrideableByRestore);
16243 }
16244 // Global and System have the same access policy so we can forward writes
16245 if (MOVED_TO_SYSTEM.contains(name)) {
16246 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
16247 + " to android.provider.Settings.System, value is unchanged.");
16248 return System.putStringForUser(resolver, name, value, tag,
16249 makeDefault, userHandle, overrideableByRestore);
16250 }
16251 return sNameValueCache.putStringForUser(resolver, name, value, tag,
16252 makeDefault, userHandle, overrideableByRestore);
16253 }
16254
16255 /**
16256 * Construct the content URI for a particular name/value pair,
16257 * useful for monitoring changes with a ContentObserver.
16258 * @param name to look up in the table
16259 * @return the corresponding content URI, or null if not present
16260 */
16261 public static Uri getUriFor(String name) {
16262 return getUriFor(CONTENT_URI, name);
16263 }
16264
16265 /**
16266 * Convenience function for retrieving a single secure settings value
16267 * as an integer. Note that internally setting values are always
16268 * stored as strings; this function converts the string to an integer
16269 * for you. The default value will be returned if the setting is
16270 * not defined or not an integer.
16271 *
16272 * @param cr The ContentResolver to access.
16273 * @param name The name of the setting to retrieve.
16274 * @param def Value to return if the setting is not defined.
16275 *
16276 * @return The setting's current value, or 'def' if it is not defined
16277 * or not a valid integer.
16278 */
16279 public static int getInt(ContentResolver cr, String name, int def) {
16280 String v = getString(cr, name);
16281 return parseIntSettingWithDefault(v, def);
16282 }
16283
16284 /**
16285 * Convenience function for retrieving a single secure settings value
16286 * as an integer. Note that internally setting values are always
16287 * stored as strings; this function converts the string to an integer
16288 * for you.
16289 * <p>
16290 * This version does not take a default value. If the setting has not
16291 * been set, or the string value is not a number,
16292 * it throws {@link SettingNotFoundException}.
16293 *
16294 * @param cr The ContentResolver to access.
16295 * @param name The name of the setting to retrieve.
16296 *
16297 * @throws SettingNotFoundException Thrown if a setting by the given
16298 * name can't be found or the setting value is not an integer.
16299 *
16300 * @return The setting's current value.
16301 */
16302 public static int getInt(ContentResolver cr, String name)
16303 throws SettingNotFoundException {
16304 String v = getString(cr, name);
16305 return parseIntSetting(v, name);
16306 }
16307
16308 /**
16309 * Convenience function for updating a single settings value as an
16310 * integer. This will either create a new entry in the table if the
16311 * given name does not exist, or modify the value of the existing row
16312 * with that name. Note that internally setting values are always
16313 * stored as strings, so this function converts the given value to a
16314 * string before storing it.
16315 *
16316 * @param cr The ContentResolver to access.
16317 * @param name The name of the setting to modify.
16318 * @param value The new value for the setting.
16319 * @return true if the value was set, false on database errors
16320 */
16321 public static boolean putInt(ContentResolver cr, String name, int value) {
16322 return putString(cr, name, Integer.toString(value));
16323 }
16324
16325 /**
16326 * Convenience function for retrieving a single secure settings value
16327 * as a {@code long}. Note that internally setting values are always
16328 * stored as strings; this function converts the string to a {@code long}
16329 * for you. The default value will be returned if the setting is
16330 * not defined or not a {@code long}.
16331 *
16332 * @param cr The ContentResolver to access.
16333 * @param name The name of the setting to retrieve.
16334 * @param def Value to return if the setting is not defined.
16335 *
16336 * @return The setting's current value, or 'def' if it is not defined
16337 * or not a valid {@code long}.
16338 */
16339 public static long getLong(ContentResolver cr, String name, long def) {
16340 String v = getString(cr, name);
16341 return parseLongSettingWithDefault(v, def);
16342 }
16343
16344 /**
16345 * Convenience function for retrieving a single secure settings value
16346 * as a {@code long}. Note that internally setting values are always
16347 * stored as strings; this function converts the string to a {@code long}
16348 * for you.
16349 * <p>
16350 * This version does not take a default value. If the setting has not
16351 * been set, or the string value is not a number,
16352 * it throws {@link SettingNotFoundException}.
16353 *
16354 * @param cr The ContentResolver to access.
16355 * @param name The name of the setting to retrieve.
16356 *
16357 * @return The setting's current value.
16358 * @throws SettingNotFoundException Thrown if a setting by the given
16359 * name can't be found or the setting value is not an integer.
16360 */
16361 public static long getLong(ContentResolver cr, String name)
16362 throws SettingNotFoundException {
16363 String v = getString(cr, name);
16364 return parseLongSetting(v, name);
16365 }
16366
16367 /**
16368 * Convenience function for updating a secure settings value as a long
16369 * integer. This will either create a new entry in the table if the
16370 * given name does not exist, or modify the value of the existing row
16371 * with that name. Note that internally setting values are always
16372 * stored as strings, so this function converts the given value to a
16373 * string before storing it.
16374 *
16375 * @param cr The ContentResolver to access.
16376 * @param name The name of the setting to modify.
16377 * @param value The new value for the setting.
16378 * @return true if the value was set, false on database errors
16379 */
16380 public static boolean putLong(ContentResolver cr, String name, long value) {
16381 return putString(cr, name, Long.toString(value));
16382 }
16383
16384 /**
16385 * Convenience function for retrieving a single secure settings value
16386 * as a floating point number. Note that internally setting values are
16387 * always stored as strings; this function converts the string to an
16388 * float for you. The default value will be returned if the setting
16389 * is not defined or not a valid float.
16390 *
16391 * @param cr The ContentResolver to access.
16392 * @param name The name of the setting to retrieve.
16393 * @param def Value to return if the setting is not defined.
16394 *
16395 * @return The setting's current value, or 'def' if it is not defined
16396 * or not a valid float.
16397 */
16398 public static float getFloat(ContentResolver cr, String name, float def) {
16399 String v = getString(cr, name);
16400 return parseFloatSettingWithDefault(v, def);
16401 }
16402
16403 /**
16404 * Convenience function for retrieving a single secure settings value
16405 * as a float. Note that internally setting values are always
16406 * stored as strings; this function converts the string to a float
16407 * for you.
16408 * <p>
16409 * This version does not take a default value. If the setting has not
16410 * been set, or the string value is not a number,
16411 * it throws {@link SettingNotFoundException}.
16412 *
16413 * @param cr The ContentResolver to access.
16414 * @param name The name of the setting to retrieve.
16415 *
16416 * @throws SettingNotFoundException Thrown if a setting by the given
16417 * name can't be found or the setting value is not a float.
16418 *
16419 * @return The setting's current value.
16420 */
16421 public static float getFloat(ContentResolver cr, String name)
16422 throws SettingNotFoundException {
16423 String v = getString(cr, name);
16424 return parseFloatSetting(v, name);
16425 }
16426
16427 /**
16428 * Convenience function for updating a single settings value as a
16429 * floating point number. This will either create a new entry in the
16430 * table if the given name does not exist, or modify the value of the
16431 * existing row with that name. Note that internally setting values
16432 * are always stored as strings, so this function converts the given
16433 * value to a string before storing it.
16434 *
16435 * @param cr The ContentResolver to access.
16436 * @param name The name of the setting to modify.
16437 * @param value The new value for the setting.
16438 * @return true if the value was set, false on database errors
16439 */
16440 public static boolean putFloat(ContentResolver cr, String name, float value) {
16441 return putString(cr, name, Float.toString(value));
16442 }
16443
16444 /**
16445 * Subscription Id to be used for voice call on a multi sim device.
16446 * @hide
16447 */
16448 @Readable
16449 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
16450
16451 /**
16452 * Used to provide option to user to select subscription during dial.
16453 * The supported values are 0 = disable or 1 = enable prompt.
16454 * @hide
16455 */
16456 @UnsupportedAppUsage
16457 @Readable
16458 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
16459
16460 /**
16461 * Subscription Id to be used for data call on a multi sim device.
16462 * @hide
16463 */
16464 @Readable
16465 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
16466
16467 /**
16468 * Subscription Id to be used for SMS on a multi sim device.
16469 * @hide
16470 */
16471 @Readable
16472 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
16473
16474 /**
16475 * Used to provide option to user to select subscription during send SMS.
16476 * The value 1 - enable, 0 - disable
16477 * @hide
16478 */
16479 @Readable
16480 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
16481
16482 /** User preferred subscriptions setting.
16483 * This holds the details of the user selected subscription from the card and
16484 * the activation status. Each settings string have the comma separated values
16485 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
16486 * @hide
16487 */
16488 @UnsupportedAppUsage
16489 @Readable
16490 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
16491 "user_preferred_sub2","user_preferred_sub3"};
16492
16493 /**
16494 * Which subscription is enabled for a physical slot.
16495 * @hide
16496 */
16497 @Readable
16498 public static final String ENABLED_SUBSCRIPTION_FOR_SLOT = "enabled_subscription_for_slot";
16499
16500 /**
16501 * Whether corresponding logical modem is enabled for a physical slot.
16502 * The value 1 - enable, 0 - disable
16503 * @hide
16504 */
16505 @Readable
16506 public static final String MODEM_STACK_ENABLED_FOR_SLOT = "modem_stack_enabled_for_slot";
16507
16508 /**
16509 * Whether to enable new contacts aggregator or not.
16510 * The value 1 - enable, 0 - disable
16511 * @hide
16512 */
16513 @Readable
16514 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
16515
16516 /**
16517 * Whether to enable contacts metadata syncing or not
16518 * The value 1 - enable, 0 - disable
16519 *
16520 * @removed
16521 */
16522 @Deprecated
16523 @Readable
16524 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
16525
16526 /**
16527 * Whether to enable contacts metadata syncing or not
16528 * The value 1 - enable, 0 - disable
16529 */
16530 @Readable
16531 public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled";
16532
16533 /**
16534 * Whether to enable cellular on boot.
16535 * The value 1 - enable, 0 - disable
16536 * @hide
16537 */
16538 @Readable
16539 public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot";
16540
16541 /**
16542 * The maximum allowed notification enqueue rate in Hertz.
16543 *
16544 * Should be a float, and includes updates only.
16545 * @hide
16546 */
16547 @Readable
16548 public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate";
16549
16550 /**
16551 * Displays toasts when an app posts a notification that does not specify a valid channel.
16552 *
16553 * The value 1 - enable, 0 - disable
16554 * @hide
16555 */
16556 @Readable
16557 public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS =
16558 "show_notification_channel_warnings";
16559
16560 /**
16561 * Whether cell is enabled/disabled
16562 * @hide
16563 */
16564 @Readable
16565 public static final String CELL_ON = "cell_on";
16566
16567 /**
16568 * Global settings which can be accessed by instant apps.
16569 * @hide
16570 */
16571 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
16572 static {
16573 INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER);
16574 INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED);
16575 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES);
16576 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL);
16577 INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES);
16578 INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON);
16579 INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE);
16580 INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE);
16581 INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE);
16582 INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES);
16583 INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE);
16584 INSTANT_APP_SETTINGS.add(WTF_IS_FATAL);
16585 INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR);
16586 INSTANT_APP_SETTINGS.add(ZEN_MODE);
16587 }
16588
16589 /**
16590 * Whether to show the high temperature warning notification.
16591 * @hide
16592 */
16593 @Readable
16594 public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning";
16595
16596 /**
16597 * Whether to show the usb high temperature alarm notification.
16598 * @hide
16599 */
16600 @Readable
16601 public static final String SHOW_USB_TEMPERATURE_ALARM = "show_usb_temperature_alarm";
16602
16603 /**
16604 * Temperature at which the high temperature warning notification should be shown.
16605 * @hide
16606 */
16607 @Readable
16608 public static final String WARNING_TEMPERATURE = "warning_temperature";
16609
16610 /**
16611 * Whether the diskstats logging task is enabled/disabled.
16612 * @hide
16613 */
16614 @Readable
16615 public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging";
16616
16617 /**
16618 * Whether the cache quota calculation task is enabled/disabled.
16619 * @hide
16620 */
16621 @Readable
16622 public static final String ENABLE_CACHE_QUOTA_CALCULATION =
16623 "enable_cache_quota_calculation";
16624
16625 /**
16626 * Whether the Deletion Helper no threshold toggle is available.
16627 * @hide
16628 */
16629 @Readable
16630 public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE =
16631 "enable_deletion_helper_no_threshold_toggle";
16632
16633 /**
16634 * The list of snooze options for notifications
16635 * This is encoded as a key=value list, separated by commas. Ex:
16636 *
16637 * "default=60,options_array=15:30:60:120"
16638 *
16639 * The following keys are supported:
16640 *
16641 * <pre>
16642 * default (int)
16643 * options_array (int[])
16644 * </pre>
16645 *
16646 * All delays in integer minutes. Array order is respected.
16647 * Options will be used in order up to the maximum allowed by the UI.
16648 * @hide
16649 */
16650 @Readable
16651 public static final String NOTIFICATION_SNOOZE_OPTIONS =
16652 "notification_snooze_options";
16653
16654 /**
16655 * When enabled, notifications the notification assistant service has modified will show an
16656 * indicator. When tapped, this indicator will describe the adjustment made and solicit
16657 * feedback. This flag will also add a "automatic" option to the long press menu.
16658 *
16659 * The value 1 - enable, 0 - disable
16660 * @hide
16661 */
16662 public static final String NOTIFICATION_FEEDBACK_ENABLED = "notification_feedback_enabled";
16663
16664 /**
16665 * Settings key for the ratio of notification dismissals to notification views - one of the
16666 * criteria for showing the notification blocking helper.
16667 *
16668 * <p>The value is a float ranging from 0.0 to 1.0 (the closer to 0.0, the more intrusive
16669 * the blocking helper will be).
16670 *
16671 * @hide
16672 */
16673 @Readable
16674 public static final String BLOCKING_HELPER_DISMISS_TO_VIEW_RATIO_LIMIT =
16675 "blocking_helper_dismiss_to_view_ratio";
16676
16677 /**
16678 * Settings key for the longest streak of dismissals - one of the criteria for showing the
16679 * notification blocking helper.
16680 *
16681 * <p>The value is an integer greater than 0.
16682 *
16683 * @hide
16684 */
16685 @Readable
16686 public static final String BLOCKING_HELPER_STREAK_LIMIT = "blocking_helper_streak_limit";
16687
16688 /**
16689 * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated
16690 * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF
16691 *
16692 * Supported keys:<br/>
16693 * <li>
16694 * <ul> {@code legacy_compatibility_wal_enabled} : A {code boolean} flag that determines
16695 * whether or not "compatibility WAL" mode is enabled by default. This is a legacy flag
16696 * and is honoured on Android Q and higher. This flag will be removed in a future release.
16697 * </ul>
16698 * <ul> {@code wal_syncmode} : A {@code String} representing the synchronization mode to use
16699 * when WAL is enabled, either via {@code legacy_compatibility_wal_enabled} or using the
16700 * obsolete {@code compatibility_wal_supported} flag.
16701 * </ul>
16702 * <ul> {@code truncate_size} : A {@code int} flag that specifies the truncate size of the
16703 * WAL journal.
16704 * </ul>
16705 * <ul> {@code compatibility_wal_supported} : A {code boolean} flag that specifies whether
16706 * the legacy "compatibility WAL" mode is enabled by default. This flag is obsolete and is
16707 * only supported on Android Pie.
16708 * </ul>
16709 * </li>
16710 *
16711 * @hide
16712 */
16713 @Readable
16714 public static final String SQLITE_COMPATIBILITY_WAL_FLAGS =
16715 "sqlite_compatibility_wal_flags";
16716
16717 /**
16718 * Enable GNSS Raw Measurements Full Tracking?
16719 * 0 = no
16720 * 1 = yes
16721 * @hide
16722 */
16723 @Readable
16724 public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING =
16725 "enable_gnss_raw_meas_full_tracking";
16726
16727 /**
16728 * Whether the notification should be ongoing (persistent) when a carrier app install is
16729 * required.
16730 *
16731 * The value is a boolean (1 or 0).
16732 * @hide
16733 */
16734 @SystemApi
16735 @Readable
16736 public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT =
16737 "install_carrier_app_notification_persistent";
16738
16739 /**
16740 * The amount of time (ms) to hide the install carrier app notification after the user has
16741 * ignored it. After this time passes, the notification will be shown again
16742 *
16743 * The value is a long
16744 * @hide
16745 */
16746 @SystemApi
16747 @Readable
16748 public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS =
16749 "install_carrier_app_notification_sleep_millis";
16750
16751 /**
16752 * Whether we've enabled zram on this device. Takes effect on
16753 * reboot. The value "1" enables zram; "0" disables it, and
16754 * everything else is unspecified.
16755 * @hide
16756 */
16757 @Readable
16758 public static final String ZRAM_ENABLED =
16759 "zram_enabled";
16760
16761 /**
16762 * Whether the app freezer is enabled on this device.
16763 * The value of "enabled" enables the app freezer, "disabled" disables it and
16764 * "device_default" will let the system decide whether to enable the freezer or not
16765 * @hide
16766 */
16767 @Readable
16768 public static final String CACHED_APPS_FREEZER_ENABLED = "cached_apps_freezer";
16769
16770 /**
16771 * Configuration flags for smart replies in notifications.
16772 * This is encoded as a key=value list, separated by commas. Ex:
16773 *
16774 * "enabled=1,max_squeeze_remeasure_count=3"
16775 *
16776 * The following keys are supported:
16777 *
16778 * <pre>
16779 * enabled (boolean)
16780 * requires_targeting_p (boolean)
16781 * max_squeeze_remeasure_attempts (int)
16782 * edit_choices_before_sending (boolean)
16783 * show_in_heads_up (boolean)
16784 * min_num_system_generated_replies (int)
16785 * max_num_actions (int)
16786 * </pre>
16787 * @see com.android.systemui.statusbar.policy.SmartReplyConstants
16788 * @hide
16789 */
16790 @Readable
16791 public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS =
16792 "smart_replies_in_notifications_flags";
16793
16794 /**
16795 * Configuration flags for the automatic generation of smart replies and smart actions in
16796 * notifications. This is encoded as a key=value list, separated by commas. Ex:
16797 * "generate_replies=false,generate_actions=true".
16798 *
16799 * The following keys are supported:
16800 *
16801 * <pre>
16802 * generate_replies (boolean)
16803 * generate_actions (boolean)
16804 * </pre>
16805 * @hide
16806 */
16807 @Readable
16808 public static final String SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS =
16809 "smart_suggestions_in_notifications_flags";
16810
16811 /**
16812 * If nonzero, crashes in foreground processes will bring up a dialog.
16813 * Otherwise, the process will be silently killed.
16814 * @hide
16815 */
16816 @TestApi
16817 @Readable
16818 @SuppressLint("NoSettingsProvider")
16819 public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog";
16820
16821 /**
16822 * If nonzero, crash dialogs will show an option to restart the app.
16823 * @hide
16824 */
16825 @Readable
16826 public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog";
16827
16828 /**
16829 * If nonzero, crash dialogs will show an option to mute all future crash dialogs for
16830 * this app.
16831 * @hide
16832 */
16833 @Readable
16834 public static final String SHOW_MUTE_IN_CRASH_DIALOG = "show_mute_in_crash_dialog";
16835
16836
16837 /**
16838 * If nonzero, will show the zen upgrade notification when the user toggles DND on/off.
16839 * @hide
16840 * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_UPGRADE_NOTIFICATION}
16841 */
16842 @Deprecated
16843 public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";
16844
16845 /**
16846 * If nonzero, will show the zen update settings suggestion.
16847 * @hide
16848 * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_SETTINGS_SUGGESTION}
16849 */
16850 @Deprecated
16851 public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion";
16852
16853 /**
16854 * If nonzero, zen has not been updated to reflect new changes.
16855 * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_UPDATED}
16856 * @hide
16857 */
16858 @Deprecated
16859 public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated";
16860
16861 /**
16862 * If nonzero, zen setting suggestion has been viewed by user
16863 * @hide
16864 * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_SUGGESTION_VIEWED}
16865 */
16866 @Deprecated
16867 public static final String ZEN_SETTINGS_SUGGESTION_VIEWED =
16868 "zen_settings_suggestion_viewed";
16869
16870 /**
16871 * Backup and restore agent timeout parameters.
16872 * These parameters are represented by a comma-delimited key-value list.
16873 *
16874 * The following strings are supported as keys:
16875 * <pre>
16876 * kv_backup_agent_timeout_millis (long)
16877 * full_backup_agent_timeout_millis (long)
16878 * shared_backup_agent_timeout_millis (long)
16879 * restore_agent_timeout_millis (long)
16880 * restore_agent_finished_timeout_millis (long)
16881 * </pre>
16882 *
16883 * They map to milliseconds represented as longs.
16884 *
16885 * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000"
16886 *
16887 * @hide
16888 */
16889 @Readable
16890 public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS =
16891 "backup_agent_timeout_parameters";
16892
16893 /**
16894 * Blocklist of GNSS satellites.
16895 *
16896 * This is a list of integers separated by commas to represent pairs of (constellation,
16897 * svid). Thus, the number of integers should be even.
16898 *
16899 * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are
16900 * blocklisted. Note that svid=0 denotes all svids in the constellation are blocklisted.
16901 *
16902 * @hide
16903 */
16904 public static final String GNSS_SATELLITE_BLOCKLIST = "gnss_satellite_blocklist";
16905
16906 /**
16907 * Duration of updates in millisecond for GNSS location request from HAL to framework.
16908 *
16909 * If zero, the GNSS location request feature is disabled.
16910 *
16911 * The value is a non-negative long.
16912 *
16913 * @hide
16914 */
16915 @Readable
16916 public static final String GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS =
16917 "gnss_hal_location_request_duration_millis";
16918
16919 /**
16920 * Binder call stats settings.
16921 *
16922 * The following strings are supported as keys:
16923 * <pre>
16924 * enabled (boolean)
16925 * detailed_tracking (boolean)
16926 * upload_data (boolean)
16927 * sampling_interval (int)
16928 * </pre>
16929 *
16930 * @hide
16931 */
16932 @Readable
16933 public static final String BINDER_CALLS_STATS = "binder_calls_stats";
16934
16935 /**
16936 * Looper stats settings.
16937 *
16938 * The following strings are supported as keys:
16939 * <pre>
16940 * enabled (boolean)
16941 * sampling_interval (int)
16942 * </pre>
16943 *
16944 * @hide
16945 */
16946 @Readable
16947 public static final String LOOPER_STATS = "looper_stats";
16948
16949 /**
16950 * Settings for collecting statistics on CPU usage per thread
16951 *
16952 * The following strings are supported as keys:
16953 * <pre>
16954 * num_buckets (int)
16955 * collected_uids (string)
16956 * minimum_total_cpu_usage_millis (int)
16957 * </pre>
16958 *
16959 * @hide
16960 */
16961 @Readable
16962 public static final String KERNEL_CPU_THREAD_READER = "kernel_cpu_thread_reader";
16963
16964 /**
16965 * Whether we've enabled native flags health check on this device. Takes effect on
16966 * reboot. The value "1" enables native flags health check; otherwise it's disabled.
16967 * @hide
16968 */
16969 @Readable
16970 public static final String NATIVE_FLAGS_HEALTH_CHECK_ENABLED =
16971 "native_flags_health_check_enabled";
16972
16973 /**
16974 * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the mode
16975 * in which the historical registry operates.
16976 *
16977 * @hide
16978 */
16979 @Readable
16980 public static final String APPOP_HISTORY_MODE = "mode";
16981
16982 /**
16983 * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls how long
16984 * is the interval between snapshots in the base case i.e. the most recent
16985 * part of the history.
16986 *
16987 * @hide
16988 */
16989 @Readable
16990 public static final String APPOP_HISTORY_BASE_INTERVAL_MILLIS = "baseIntervalMillis";
16991
16992 /**
16993 * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the base
16994 * for the logarithmic step when building app op history.
16995 *
16996 * @hide
16997 */
16998 @Readable
16999 public static final String APPOP_HISTORY_INTERVAL_MULTIPLIER = "intervalMultiplier";
17000
17001 /**
17002 * Appop history parameters. These parameters are represented by
17003 * a comma-delimited key-value list.
17004 *
17005 * The following strings are supported as keys:
17006 * <pre>
17007 * mode (int)
17008 * baseIntervalMillis (long)
17009 * intervalMultiplier (int)
17010 * </pre>
17011 *
17012 * Ex: "mode=HISTORICAL_MODE_ENABLED_ACTIVE,baseIntervalMillis=1000,intervalMultiplier=10"
17013 *
17014 * @see #APPOP_HISTORY_MODE
17015 * @see #APPOP_HISTORY_BASE_INTERVAL_MILLIS
17016 * @see #APPOP_HISTORY_INTERVAL_MULTIPLIER
17017 *
17018 * @hide
17019 */
17020 @Readable
17021 public static final String APPOP_HISTORY_PARAMETERS =
17022 "appop_history_parameters";
17023
17024 /**
17025 * Auto revoke parameters. These parameters are represented by
17026 * a comma-delimited key-value list.
17027 *
17028 * <pre>
17029 * enabledForPreRApps (bolean)
17030 * unusedThresholdMs (long)
17031 * checkFrequencyMs (long)
17032 * </pre>
17033 *
17034 * Ex: "enabledForPreRApps=false,unusedThresholdMs=7776000000,checkFrequencyMs=1296000000"
17035 *
17036 * @hide
17037 */
17038 @Readable
17039 public static final String AUTO_REVOKE_PARAMETERS =
17040 "auto_revoke_parameters";
17041
17042 /**
17043 * Delay for sending ACTION_CHARGING after device is plugged in.
17044 * This is used as an override for constants defined in BatteryStatsImpl for
17045 * ease of experimentation.
17046 *
17047 * @see com.android.internal.os.BatteryStatsImpl.Constants.KEY_BATTERY_CHARGED_DELAY_MS
17048 * @hide
17049 */
17050 @Readable
17051 public static final String BATTERY_CHARGING_STATE_UPDATE_DELAY =
17052 "battery_charging_state_update_delay";
17053
17054 /**
17055 * A serialized string of params that will be loaded into a text classifier action model.
17056 *
17057 * @hide
17058 */
17059 @Readable
17060 public static final String TEXT_CLASSIFIER_ACTION_MODEL_PARAMS =
17061 "text_classifier_action_model_params";
17062
17063 /**
17064 * The amount of time to suppress "power-off" from the power button after the device has
17065 * woken due to a gesture (lifting the phone). Since users have learned to hit the power
17066 * button immediately when lifting their device, it can cause the device to turn off if a
17067 * gesture has just woken the device. This value tells us the milliseconds to wait after
17068 * a gesture before "power-off" via power-button is functional again. A value of 0 is no
17069 * delay, and reverts to the old behavior.
17070 *
17071 * @hide
17072 */
17073 @Readable
17074 public static final String POWER_BUTTON_SUPPRESSION_DELAY_AFTER_GESTURE_WAKE =
17075 "power_button_suppression_delay_after_gesture_wake";
17076
17077 /**
17078 * The usage amount of advanced battery. The value is 0~100.
17079 *
17080 * @hide
17081 */
17082 @Readable
17083 public static final String ADVANCED_BATTERY_USAGE_AMOUNT = "advanced_battery_usage_amount";
17084
17085 /**
17086 * For 5G NSA capable devices, determines whether NR tracking indications are on
17087 * when the screen is off.
17088 *
17089 * Values are:
17090 * 0: off - All 5G NSA tracking indications are off when the screen is off.
17091 * 1: extended - All 5G NSA tracking indications are on when the screen is off as long as
17092 * the device is camped on 5G NSA (5G icon is showing in status bar).
17093 * If the device is not camped on 5G NSA, tracking indications are off.
17094 * 2: always on - All 5G NSA tracking indications are on whether the screen is on or off.
17095 * @hide
17096 */
17097 @Readable
17098 public static final String NR_NSA_TRACKING_SCREEN_OFF_MODE =
17099 "nr_nsa_tracking_screen_off_mode";
17100
17101 /**
17102 * Whether to show People Space.
17103 * Values are:
17104 * 0: Disabled (default)
17105 * 1: Enabled
17106 * @hide
17107 */
17108 public static final String SHOW_PEOPLE_SPACE = "show_people_space";
17109
17110 /**
17111 * Which types of conversation(s) to show in People Space.
17112 * Values are:
17113 * 0: Single user-selected conversation (default)
17114 * 1: Priority conversations only
17115 * 2: All conversations
17116 * @hide
17117 */
17118 public static final String PEOPLE_SPACE_CONVERSATION_TYPE =
17119 "people_space_conversation_type";
17120
17121 /**
17122 * Whether to show new notification dismissal.
17123 * Values are:
17124 * 0: Disabled
17125 * 1: Enabled
17126 * @hide
17127 */
17128 public static final String SHOW_NEW_NOTIF_DISMISS = "show_new_notif_dismiss";
17129
17130 /**
17131 * Block untrusted touches mode.
17132 *
17133 * Can be one of:
17134 * <ul>
17135 * <li>0 = {@link BlockUntrustedTouchesMode#DISABLED}: Feature is off.
17136 * <li>1 = {@link BlockUntrustedTouchesMode#PERMISSIVE}: Untrusted touches are flagged
17137 * but not blocked
17138 * <li>2 = {@link BlockUntrustedTouchesMode#BLOCK}: Untrusted touches are blocked
17139 * </ul>
17140 *
17141 * @hide
17142 */
17143 @Readable
17144 public static final String BLOCK_UNTRUSTED_TOUCHES_MODE = "block_untrusted_touches";
17145
17146 /**
17147 * The maximum allowed obscuring opacity by UID to propagate touches.
17148 *
17149 * For certain window types (eg. SAWs), the decision of honoring {@link LayoutParams
17150 * #FLAG_NOT_TOUCHABLE} or not depends on the combined obscuring opacity of the windows
17151 * above the touch-consuming window.
17152 *
17153 * For a certain UID:
17154 * <ul>
17155 * <li>If it's the same as the UID of the touch-consuming window, allow it to propagate
17156 * the touch.
17157 * <li>Otherwise take all its windows of eligible window types above the touch-consuming
17158 * window, compute their combined obscuring opacity considering that {@code
17159 * opacity(A, B) = 1 - (1 - opacity(A))*(1 - opacity(B))}. If the computed value is
17160 * lesser than or equal to this setting and there are no other windows preventing the
17161 * touch, allow the UID to propagate the touch.
17162 * </ul>
17163 *
17164 * @see android.hardware.input.InputManager#getMaximumObscuringOpacityForTouch()
17165 * @see android.hardware.input.InputManager#setMaximumObscuringOpacityForTouch(float)
17166 *
17167 * @hide
17168 */
17169 @Readable
17170 public static final String MAXIMUM_OBSCURING_OPACITY_FOR_TOUCH =
17171 "maximum_obscuring_opacity_for_touch";
17172
17173 /**
17174 * Used to enable / disable the Restricted Networking Mode in which network access is
17175 * restricted to apps holding the CONNECTIVITY_USE_RESTRICTED_NETWORKS permission.
17176 *
17177 * Values are:
17178 * 0: disabled
17179 * 1: enabled
17180 * @hide
17181 */
17182 public static final String RESTRICTED_NETWORKING_MODE = "restricted_networking_mode";
17183
17184 /**
17185 * Setting indicating whether Low Power Standby is enabled, if supported.
17186 *
17187 * Values are:
17188 * 0: disabled
17189 * 1: enabled
17190 *
17191 * @hide
17192 */
17193 public static final String LOW_POWER_STANDBY_ENABLED = "low_power_standby_enabled";
17194
17195 /**
17196 * Setting indicating whether Low Power Standby is allowed to be active during doze
17197 * maintenance mode.
17198 *
17199 * Values are:
17200 * 0: Low Power Standby will be disabled during doze maintenance mode
17201 * 1: Low Power Standby can be active during doze maintenance mode
17202 *
17203 * @hide
17204 */
17205 public static final String LOW_POWER_STANDBY_ACTIVE_DURING_MAINTENANCE =
17206 "low_power_standby_active_during_maintenance";
17207
17208 /**
17209 * Timeout for the system server watchdog.
17210 *
17211 * @see {@link com.android.server.Watchdog}.
17212 *
17213 * @hide
17214 */
17215 public static final String WATCHDOG_TIMEOUT_MILLIS =
17216 "system_server_watchdog_timeout_ms";
17217
17218 /**
17219 * Whether to enable managed device provisioning via the role holder.
17220 *
17221 * @hide
17222 */
17223 public static final String MANAGED_PROVISIONING_DEFER_PROVISIONING_TO_ROLE_HOLDER =
17224 "managed_provisioning_defer_provisioning_to_role_holder";
17225
17226 /**
17227 * State of whether review notification permissions notification needs to
17228 * be shown the user, and whether the user has interacted.
17229 *
17230 * Valid values:
17231 * -1 = UNKNOWN
17232 * 0 = SHOULD_SHOW
17233 * 1 = USER_INTERACTED
17234 * 2 = DISMISSED
17235 * 3 = RESHOWN
17236 * @hide
17237 */
17238 public static final String REVIEW_PERMISSIONS_NOTIFICATION_STATE =
17239 "review_permissions_notification_state";
17240
17241 /**
17242 * Settings migrated from Wear OS settings provider.
17243 * @hide
17244 */
17245 public static class Wearable {
17246 /**
17247 * Whether the user has any pay tokens on their watch.
17248 * @hide
17249 */
17250 public static final String HAS_PAY_TOKENS = "has_pay_tokens";
17251
17252 /**
17253 * Gcm checkin timeout in minutes.
17254 * @hide
17255 */
17256 public static final String GMS_CHECKIN_TIMEOUT_MIN = "gms_checkin_timeout_min";
17257
17258 /**
17259 * If hotword detection should be enabled.
17260 * @hide
17261 */
17262 public static final String HOTWORD_DETECTION_ENABLED = "hotword_detection_enabled";
17263
17264 /**
17265 * Whether Smart Replies are enabled within Wear.
17266 * @hide
17267 */
17268 public static final String SMART_REPLIES_ENABLED = "smart_replies_enabled";
17269
17270 /**
17271 * The default vibration pattern.
17272 * @hide
17273 */
17274 public static final String DEFAULT_VIBRATION = "default_vibration";
17275
17276 /**
17277 * If FLP should obtain location data from the paired device.
17278 * @hide
17279 */
17280 public static final String OBTAIN_PAIRED_DEVICE_LOCATION =
17281 "obtain_paired_device_location";
17282
17283 /**
17284 * Whether the device is in retail mode.
17285 * @hide
17286 */
17287 public static final String RETAIL_MODE = "retail_mode";
17288
17289 // Possible retail mode states
17290 /** @hide */
17291 public static final int RETAIL_MODE_CONSUMER = 0;
17292 /** @hide */
17293 public static final int RETAIL_MODE_RETAIL = 1;
17294
17295 /**
17296 * The play store availability on companion phone.
17297 * @hide
17298 */
17299 public static final String PHONE_PLAY_STORE_AVAILABILITY =
17300 "phone_play_store_availability";
17301
17302 // Possible phone play store availability states
17303 /** @hide */
17304 public static final int PHONE_PLAY_STORE_AVAILABILITY_UNKNOWN = 0;
17305 /** @hide */
17306 public static final int PHONE_PLAY_STORE_AVAILABLE = 1;
17307 /** @hide */
17308 public static final int PHONE_PLAY_STORE_UNAVAILABLE = 2;
17309
17310 /**
17311 * Whether the bug report is enabled.
17312 * @hide
17313 */
17314 public static final String BUG_REPORT = "bug_report";
17315
17316 // Possible bug report states
17317 /** @hide */
17318 public static final int BUG_REPORT_DISABLED = 0;
17319 /** @hide */
17320 public static final int BUG_REPORT_ENABLED = 1;
17321
17322 /**
17323 * The enabled/disabled state of the SmartIlluminate.
17324 * @hide
17325 */
17326 public static final String SMART_ILLUMINATE_ENABLED = "smart_illuminate_enabled";
17327
17328 /**
17329 * Whether automatic time is enabled on the watch.
17330 * @hide
17331 */
17332 public static final String CLOCKWORK_AUTO_TIME = "clockwork_auto_time";
17333
17334 // Possible clockwork auto time states
17335 /** @hide */
17336 public static final int SYNC_TIME_FROM_PHONE = 0;
17337 /** @hide */
17338 public static final int SYNC_TIME_FROM_NETWORK = 1;
17339 /** @hide */
17340 public static final int AUTO_TIME_OFF = 2;
17341 /** @hide */
17342 public static final int INVALID_AUTO_TIME_STATE = 3;
17343
17344
17345 /**
17346 * Whether automatic time zone is enabled on the watch.
17347 * @hide
17348 */
17349 public static final String CLOCKWORK_AUTO_TIME_ZONE = "clockwork_auto_time_zone";
17350
17351 // Possible clockwork auto time zone states
17352 /** @hide */
17353 public static final int SYNC_TIME_ZONE_FROM_PHONE = 0;
17354 /** @hide */
17355 public static final int SYNC_TIME_ZONE_FROM_NETWORK = 1;
17356 /** @hide */
17357 public static final int AUTO_TIME_ZONE_OFF = 2;
17358 /** @hide */
17359 public static final int INVALID_AUTO_TIME_ZONE_STATE = 3;
17360
17361 /**
17362 * Whether 24 hour time format is enabled on the watch.
17363 * @hide
17364 */
17365 public static final String CLOCKWORK_24HR_TIME = "clockwork_24hr_time";
17366
17367 /**
17368 * Whether the auto wifi toggle setting is enabled.
17369 * @hide
17370 */
17371 public static final String AUTO_WIFI = "auto_wifi";
17372
17373 // Possible force wifi on states
17374 /** @hide */
17375 public static final int AUTO_WIFI_DISABLED = 0;
17376 /** @hide */
17377 public static final int AUTO_WIFI_ENABLED = 1;
17378
17379 /**
17380 * The number of minutes after the WiFi enters power save mode.
17381 * @hide
17382 */
17383 public static final String WIFI_POWER_SAVE = "wifi_power_save";
17384
17385 /**
17386 * The time at which we should no longer skip the wifi requirement check (we skip the
17387 * wifi requirement until this time). The time is in millis since epoch.
17388 * @hide
17389 */
17390 public static final String ALT_BYPASS_WIFI_REQUIREMENT_TIME_MILLIS =
17391 "alt_bypass_wifi_requirement_time_millis";
17392
17393 /**
17394 * Whether the setup was skipped.
17395 * @hide
17396 */
17397 public static final String SETUP_SKIPPED = "setup_skipped";
17398
17399 // Possible setup_skipped states
17400 /** @hide */
17401 public static final int SETUP_SKIPPED_UNKNOWN = 0;
17402 /** @hide */
17403 public static final int SETUP_SKIPPED_YES = 1;
17404 /** @hide */
17405 public static final int SETUP_SKIPPED_NO = 2;
17406
17407 /**
17408 * The last requested call forwarding action.
17409 * @hide
17410 */
17411 public static final String LAST_CALL_FORWARD_ACTION = "last_call_forward_action";
17412
17413 // Possible call forwarding actions
17414 /** @hide */
17415 public static final int CALL_FORWARD_ACTION_ON = 1;
17416 /** @hide */
17417 public static final int CALL_FORWARD_ACTION_OFF = 2;
17418 /** @hide */
17419 public static final int CALL_FORWARD_NO_LAST_ACTION = -1;
17420
17421 // Stem button settings.
17422 /** @hide */
17423 public static final String STEM_1_TYPE = "STEM_1_TYPE";
17424 /** @hide */
17425 public static final String STEM_1_DATA = "STEM_1_DATA";
17426 /** @hide */
17427 public static final String STEM_1_DEFAULT_DATA = "STEM_1_DEFAULT_DATA";
17428 /** @hide */
17429 public static final String STEM_2_TYPE = "STEM_2_TYPE";
17430 /** @hide */
17431 public static final String STEM_2_DATA = "STEM_2_DATA";
17432 /** @hide */
17433 public static final String STEM_2_DEFAULT_DATA = "STEM_2_DEFAULT_DATA";
17434 /** @hide */
17435 public static final String STEM_3_TYPE = "STEM_3_TYPE";
17436 /** @hide */
17437 public static final String STEM_3_DATA = "STEM_3_DATA";
17438 /** @hide */
17439 public static final String STEM_3_DEFAULT_DATA = "STEM_3_DEFAULT_DATA";
17440
17441 // Stem types
17442 /** @hide */
17443 public static final int STEM_TYPE_UNKNOWN = -1;
17444 /** @hide */
17445 public static final int STEM_TYPE_APP_LAUNCH = 0;
17446 /** @hide */
17447 public static final int STEM_TYPE_CONTACT_LAUNCH = 1;
17448
17449 /**
17450 * If the device should be muted when off body.
17451 * @hide
17452 */
17453 public static final String MUTE_WHEN_OFF_BODY_ENABLED = "obtain_mute_when_off_body";
17454
17455 /**
17456 * Wear OS version string.
17457 * @hide
17458 */
17459 public static final String WEAR_OS_VERSION_STRING = "wear_os_version_string";
17460
17461 /**
17462 * How round the corners of square screens are.
17463 * @hide
17464 */
17465 public static final String CORNER_ROUNDNESS = "corner_roundness";
17466
17467 /**
17468 * Whether the physical button has been set.
17469 * @hide
17470 */
17471 public static final String BUTTON_SET = "button_set";
17472
17473 /**
17474 * Whether there is a side button.
17475 * @hide
17476 */
17477 public static final String SIDE_BUTTON = "side_button";
17478
17479 /**
17480 * The android wear system version.
17481 * @hide
17482 */
17483 public static final String ANDROID_WEAR_VERSION = "android_wear_version";
17484
17485 /**
17486 * The wear system capabiltiies.
17487 * @hide
17488 */
17489 public static final String SYSTEM_CAPABILITIES = "system_capabilities";
17490
17491 /**
17492 * The android wear system edition.
17493 * @hide
17494 */
17495 public static final String SYSTEM_EDITION = "android_wear_system_edition";
17496
17497 /**
17498 * The Wear platform MR number.
17499 * @hide
17500 */
17501 public static final String WEAR_PLATFORM_MR_NUMBER = "wear_platform_mr_number";
17502
17503 /**
17504 * The mobile signal detector setting.
17505 * @hide
17506 */
17507 public static final String MOBILE_SIGNAL_DETECTOR = "mobile_signal_detector";
17508
17509
17510 /**
17511 * Whether ambient is currently enabled.
17512 * @hide
17513 */
17514 public static final String AMBIENT_ENABLED = "ambient_enabled";
17515
17516 /**
17517 * Whether ambient tilt to wake is enabled.
17518 * @hide
17519 */
17520 public static final String AMBIENT_TILT_TO_WAKE = "ambient_tilt_to_wake";
17521
17522 /**
17523 * Whether ambient low bit mode is enabled by developer options.
17524 * @hide
17525 */
17526 public static final String AMBIENT_LOW_BIT_ENABLED_DEV = "ambient_low_bit_enabled_dev";
17527
17528 /**
17529 * Whether ambient touch to wake is enabled.
17530 * @hide
17531 */
17532 public static final String AMBIENT_TOUCH_TO_WAKE = "ambient_touch_to_wake";
17533
17534 /**
17535 * Whether ambient tilt to bright is enabled.
17536 * @hide
17537 */
17538 public static final String AMBIENT_TILT_TO_BRIGHT = "ambient_tilt_to_bright";
17539
17540 /**
17541 * Whether the current watchface is decomposable.
17542 * @hide
17543 */
17544 public static final String DECOMPOSABLE_WATCHFACE = "current_watchface_decomposable";
17545
17546 /**
17547 * Whether to force ambient when docked.
17548 * @hide
17549 */
17550 public static final String AMBIENT_FORCE_WHEN_DOCKED = "ambient_force_when_docked";
17551
17552 /**
17553 * Whether the ambient low bit mode is enabled.
17554 * @hide
17555 */
17556 public static final String AMBIENT_LOW_BIT_ENABLED = "ambient_low_bit_enabled";
17557
17558 /**
17559 * The timeout duration in minutes of ambient mode when plugged in.
17560 * @hide
17561 */
17562 public static final String AMBIENT_PLUGGED_TIMEOUT_MIN = "ambient_plugged_timeout_min";
17563
17564 /**
17565 * What OS does paired device has.
17566 * @hide
17567 */
17568 public static final String PAIRED_DEVICE_OS_TYPE = "paired_device_os_type";
17569
17570 // Possible values of PAIRED_DEVICE_OS_TYPE
17571 /** @hide */
17572 public static final int PAIRED_DEVICE_OS_TYPE_UNKNOWN = 0;
17573 /** @hide */
17574 public static final int PAIRED_DEVICE_OS_TYPE_ANDROID = 1;
17575 /** @hide */
17576 public static final int PAIRED_DEVICE_OS_TYPE_IOS = 2;
17577
17578 /**
17579 * The bluetooth settings selected BLE role for the companion.
17580 * @hide
17581 */
17582 public static final String COMPANION_BLE_ROLE = "companion_ble_role";
17583
17584 // Possible values of COMPANION_BLE_ROLE
17585 /** @hide */
17586 public static final int BLUETOOTH_ROLE_CENTRAL = 1;
17587 /** @hide */
17588 public static final int BLUETOOTH_ROLE_PERIPHERAL = 2;
17589
17590 /**
17591 * The bluetooth settings stored companion device name.
17592 * @hide
17593 */
17594 public static final String COMPANION_NAME = "companion_bt_name";
17595
17596 /**
17597 * The user's last setting for hfp client.
17598 * @hide
17599 */
17600 public static final String USER_HFP_CLIENT_SETTING = "user_hfp_client_setting";
17601
17602 // Possible hfp client user setting values
17603 /** @hide */
17604 public static final int HFP_CLIENT_UNSET = 0;
17605 /** @hide */
17606 public static final int HFP_CLIENT_ENABLED = 1;
17607 /** @hide */
17608 public static final int HFP_CLIENT_DISABLED = 2;
17609
17610 /**
17611 * The companion phone's android version.
17612 * @hide
17613 */
17614 public static final String COMPANION_OS_VERSION = "wear_companion_os_version";
17615
17616 // Companion os version constants
17617 /** @hide */
17618 public static final int COMPANION_OS_VERSION_UNDEFINED = -1;
17619
17620 /**
17621 * A boolean value to indicate if we want to support all languages in LE edition on
17622 * wear. 1 for supporting, 0 for not supporting.
17623 * @hide
17624 */
17625 public static final String ENABLE_ALL_LANGUAGES = "enable_all_languages";
17626
17627 /**
17628 * The Locale (as language tag) the user chose at startup.
17629 * @hide
17630 */
17631 public static final String SETUP_LOCALE = "setup_locale";
17632
17633 /**
17634 * The version of oem setup present.
17635 * @hide
17636 */
17637 public static final String OEM_SETUP_VERSION = "oem_setup_version";
17638
17639 /**
17640 * Controls the gestures feature.
17641 * @hide
17642 */
17643 public static final String MASTER_GESTURES_ENABLED = "master_gestures_enabled";
17644
17645 /**
17646 * Whether or not ungaze is enabled.
17647 * @hide
17648 */
17649 public static final String UNGAZE_ENABLED = "ungaze_enabled";
17650
17651 /**
17652 * The device's battery saver mode, which can be one of the following:
17653 * -{@link BATTERY_SAVER_MODE_NONE}
17654 * -{@link BATTERY_SAVER_MODE_LIGHT}
17655 * -{@link BATTERY_SAVER_MODE_TRADITIONAL_WATCH}
17656 * -{@link BATTERY_SAVER_MODE_TIME_ONLY}
17657 * -{@link BATTERY_SAVER_MODE_CUSTOM}
17658 * @hide
17659 */
17660 public static final String BATTERY_SAVER_MODE = "battery_saver_mode";
17661
17662 /**
17663 * Not in Battery Saver Mode
17664 * @hide
17665 */
17666 public static final int BATTERY_SAVER_MODE_NONE = 0;
17667 /**
17668 * In Lightweight Battery Saver Mode
17669 * @hide
17670 */
17671 public static final int BATTERY_SAVER_MODE_LIGHT = 1;
17672 /**
17673 * In Traditional Watch Mode Battery Saver Mode
17674 * @hide
17675 */
17676 public static final int BATTERY_SAVER_MODE_TRADITIONAL_WATCH = 2;
17677 /**
17678 * In Time-only Mode Battery Saver Mode
17679 * @hide
17680 */
17681 public static final int BATTERY_SAVER_MODE_TIME_ONLY = 3;
17682 /**
17683 * Partner's Battery Saver implementation is being used
17684 * @hide
17685 */
17686 public static final int BATTERY_SAVER_MODE_CUSTOM = 4;
17687
17688 /**
17689 * The maximum ambient mode duration when an activity is allowed to auto resume.
17690 * @hide
17691 */
17692 public static final String WEAR_ACTIVITY_AUTO_RESUME_TIMEOUT_MS =
17693 "wear_activity_auto_resume_timeout_ms";
17694
17695 /**
17696 * If the current {@code WEAR_ACTIVITY_AUTO_RESUME_TIMEOUT_MS} value is set by user.
17697 * 1 for true, 0 for false.
17698 * @hide
17699 */
17700 public static final String WEAR_ACTIVITY_AUTO_RESUME_TIMEOUT_SET_BY_USER =
17701 "wear_activity_auto_resume_timeout_set_by_user";
17702
17703 /**
17704 * If burn in protection is enabled.
17705 * @hide
17706 */
17707 public static final String BURN_IN_PROTECTION_ENABLED = "burn_in_protection";
17708
17709 /**
17710 * Whether the device has combined location setting enabled.
17711 * @hide
17712 */
17713 public static final String COMBINED_LOCATION_ENABLED = "combined_location_enable";
17714
17715 /**
17716 * The wrist orientation mode of the device
17717 * Valid values - LEFT_WRIST_ROTATION_0 = "0" (default), LEFT_WRIST_ROTATION_180 = "1",
17718 * RIGHT_WRIST_ROTATION_0 = "2", RIGHT_WRIST_ROTATION_180 = "3"
17719 * @hide
17720 */
17721 public static final String WRIST_ORIENTATION_MODE = "wear_wrist_orientation_mode";
17722
17723 /**
17724 * Setting indicating the name of the Wear OS app package containing the device's sysui.
17725 *
17726 * @hide
17727 */
17728 public static final String CLOCKWORK_SYSUI_PACKAGE = "clockwork_sysui_package";
17729
17730 /**
17731 * Setting indicating the name of the main activity of the Wear OS sysui.
17732 *
17733 * @hide
17734 */
17735 public static final String CLOCKWORK_SYSUI_MAIN_ACTIVITY =
17736 "clockwork_sysui_main_activity";
17737
17738 /**
17739 * Setting to disable power button long press launching Assistant. It's boolean, i.e.
17740 * enabled = 1, disabled = 0. By default, this setting is enabled.
17741 *
17742 * @hide
17743 */
17744 public static final String CLOCKWORK_LONG_PRESS_TO_ASSISTANT_ENABLED =
17745 "clockwork_long_press_to_assistant_enabled";
17746
17747 /*
17748 * Whether the device has Cooldown Mode enabled.
17749 * @hide
17750 */
17751 public static final String COOLDOWN_MODE_ON = "cooldown_mode_on";
17752
17753 /*
17754 * Whether the device has Wet Mode/ Touch Lock Mode enabled.
17755 * @hide
17756 */
17757 public static final String WET_MODE_ON = "wet_mode_on";
17758 }
17759 }
17760
17761 /**
17762 * Configuration system settings, containing settings which are applied identically for all
17763 * defined users. Only Android can read these and only a specific configuration service can
17764 * write these.
17765 *
17766 * @hide
17767 */
17768 public static final class Config extends NameValueTable {
17769
17770 /**
17771 * The modes that can be used when disabling syncs to the 'config' settings.
17772 * @hide
17773 */
17774 @IntDef(prefix = "DISABLE_SYNC_MODE_",
17775 value = { SYNC_DISABLED_MODE_NONE, SYNC_DISABLED_MODE_PERSISTENT,
17776 SYNC_DISABLED_MODE_UNTIL_REBOOT })
17777 @Retention(RetentionPolicy.SOURCE)
17778 @Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE})
17779 public @interface SyncDisabledMode {}
17780
17781 /**
17782 * Sync is not disabled.
17783 *
17784 * @hide
17785 */
17786 public static final int SYNC_DISABLED_MODE_NONE = 0;
17787
17788 /**
17789 * Disabling of Config bulk update / syncing is persistent, i.e. it survives a device
17790 * reboot.
17791 * @hide
17792 */
17793 public static final int SYNC_DISABLED_MODE_PERSISTENT = 1;
17794
17795 /**
17796 * Disabling of Config bulk update / syncing is not persistent, i.e. it will not survive a
17797 * device reboot.
17798 * @hide
17799 */
17800 public static final int SYNC_DISABLED_MODE_UNTIL_REBOOT = 2;
17801
17802 private static final ContentProviderHolder sProviderHolder =
17803 new ContentProviderHolder(DeviceConfig.CONTENT_URI);
17804
17805 // Populated lazily, guarded by class object:
17806 private static final NameValueCache sNameValueCache = new NameValueCache(
17807 DeviceConfig.CONTENT_URI,
17808 CALL_METHOD_GET_CONFIG,
17809 CALL_METHOD_PUT_CONFIG,
17810 CALL_METHOD_DELETE_CONFIG,
17811 CALL_METHOD_LIST_CONFIG,
17812 CALL_METHOD_SET_ALL_CONFIG,
17813 sProviderHolder,
17814 Config.class);
17815
17816 /**
17817 * Look up a name in the database.
17818 * @param resolver to access the database with
17819 * @param name to look up in the table
17820 * @return the corresponding value, or null if not present
17821 *
17822 * @hide
17823 */
17824 @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG)
17825 static String getString(ContentResolver resolver, String name) {
17826 return sNameValueCache.getStringForUser(resolver, name, resolver.getUserId());
17827 }
17828
17829 /**
17830 * Look up a list of names in the database, within the specified namespace.
17831 *
17832 * @param resolver to access the database with
17833 * @param namespace to which the names belong
17834 * @param names to look up in the table
17835 * @return a non null, but possibly empty, map from name to value for any of the names that
17836 * were found during lookup.
17837 *
17838 * @hide
17839 */
17840 @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG)
17841 public static Map<String, String> getStrings(@NonNull ContentResolver resolver,
17842 @NonNull String namespace, @NonNull List<String> names) {
17843 List<String> compositeNames = new ArrayList<>(names.size());
17844 for (String name : names) {
17845 compositeNames.add(createCompositeName(namespace, name));
17846 }
17847
17848 String prefix = createPrefix(namespace);
17849 ArrayMap<String, String> rawKeyValues = sNameValueCache.getStringsForPrefix(
17850 resolver, prefix, compositeNames);
17851 int size = rawKeyValues.size();
17852 int substringLength = prefix.length();
17853 ArrayMap<String, String> keyValues = new ArrayMap<>(size);
17854 for (int i = 0; i < size; ++i) {
17855 keyValues.put(rawKeyValues.keyAt(i).substring(substringLength),
17856 rawKeyValues.valueAt(i));
17857 }
17858 return keyValues;
17859 }
17860
17861 /**
17862 * Store a name/value pair into the database within the specified namespace.
17863 * <p>
17864 * Also the method takes an argument whether to make the value the default for this setting.
17865 * If the system already specified a default value, then the one passed in here will
17866 * <strong>not</strong> be set as the default.
17867 * </p>
17868 *
17869 * @param resolver to access the database with.
17870 * @param namespace to store the name/value pair in.
17871 * @param name to store.
17872 * @param value to associate with the name.
17873 * @param makeDefault whether to make the value the default one.
17874 * @return true if the value was set, false on database errors.
17875 *
17876 * @see #resetToDefaults(ContentResolver, int, String)
17877 *
17878 * @hide
17879 */
17880 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
17881 static boolean putString(@NonNull ContentResolver resolver, @NonNull String namespace,
17882 @NonNull String name, @Nullable String value, boolean makeDefault) {
17883 return sNameValueCache.putStringForUser(resolver, createCompositeName(namespace, name),
17884 value, null, makeDefault, resolver.getUserId(),
17885 DEFAULT_OVERRIDEABLE_BY_RESTORE);
17886 }
17887
17888 /**
17889 * Clear all name/value pairs for the provided namespace and save new name/value pairs in
17890 * their place.
17891 *
17892 * @param resolver to access the database with.
17893 * @param namespace to which the names should be set.
17894 * @param keyValues map of key names (without the prefix) to values.
17895 * @return true if the name/value pairs were set, false if setting was blocked
17896 *
17897 * @hide
17898 */
17899 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
17900 public static boolean setStrings(@NonNull ContentResolver resolver,
17901 @NonNull String namespace, @NonNull Map<String, String> keyValues)
17902 throws DeviceConfig.BadConfigException {
17903 HashMap<String, String> compositeKeyValueMap = new HashMap<>(keyValues.keySet().size());
17904 for (Map.Entry<String, String> entry : keyValues.entrySet()) {
17905 compositeKeyValueMap.put(
17906 createCompositeName(namespace, entry.getKey()), entry.getValue());
17907 }
17908 int result = sNameValueCache.setStringsForPrefix(
17909 resolver, createPrefix(namespace), compositeKeyValueMap);
17910 if (result == SET_ALL_RESULT_SUCCESS) {
17911 return true;
17912 } else if (result == SET_ALL_RESULT_DISABLED) {
17913 return false;
17914 }
17915 // If can't set given configuration that means it's bad
17916 throw new DeviceConfig.BadConfigException();
17917 }
17918
17919 /**
17920 * Delete a name/value pair from the database for the specified namespace.
17921 *
17922 * @param resolver to access the database with.
17923 * @param namespace to delete the name/value pair from.
17924 * @param name to delete.
17925 * @return true if the value was deleted, false on database errors. If the name/value pair
17926 * did not exist, return True.
17927 *
17928 * @see #resetToDefaults(ContentResolver, int, String)
17929 *
17930 * @hide
17931 */
17932 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
17933 static boolean deleteString(@NonNull ContentResolver resolver, @NonNull String namespace,
17934 @NonNull String name) {
17935 return sNameValueCache.deleteStringForUser(resolver,
17936 createCompositeName(namespace, name), resolver.getUserId());
17937 }
17938
17939 /**
17940 * Reset the values to their defaults.
17941 * <p>
17942 * The method accepts an optional prefix parameter. If provided, only pairs with a name that
17943 * starts with the exact prefix will be reset. Otherwise all will be reset.
17944 *
17945 * @param resolver Handle to the content resolver.
17946 * @param resetMode The reset mode to use.
17947 * @param namespace Optionally, to limit which which namespace is reset.
17948 *
17949 * @see #putString(ContentResolver, String, String, String, boolean)
17950 *
17951 * @hide
17952 */
17953 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
17954 static void resetToDefaults(@NonNull ContentResolver resolver, @ResetMode int resetMode,
17955 @Nullable String namespace) {
17956 try {
17957 Bundle arg = new Bundle();
17958 arg.putInt(CALL_METHOD_USER_KEY, resolver.getUserId());
17959 arg.putInt(CALL_METHOD_RESET_MODE_KEY, resetMode);
17960 if (namespace != null) {
17961 arg.putString(Settings.CALL_METHOD_PREFIX_KEY, createPrefix(namespace));
17962 }
17963 IContentProvider cp = sProviderHolder.getProvider(resolver);
17964 cp.call(resolver.getAttributionSource(),
17965 sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_CONFIG, null, arg);
17966 } catch (RemoteException e) {
17967 Log.w(TAG, "Can't reset to defaults for " + DeviceConfig.CONTENT_URI, e);
17968 }
17969 }
17970
17971 /**
17972 * Bridge method between {@link DeviceConfig#setSyncDisabledMode(int)} and the
17973 * {@link com.android.providers.settings.SettingsProvider} implementation.
17974 *
17975 * @hide
17976 */
17977 @SuppressLint("AndroidFrameworkRequiresPermission")
17978 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
17979 static void setSyncDisabledMode(
17980 @NonNull ContentResolver resolver, @SyncDisabledMode int disableSyncMode) {
17981 try {
17982 Bundle args = new Bundle();
17983 args.putInt(CALL_METHOD_SYNC_DISABLED_MODE_KEY, disableSyncMode);
17984 IContentProvider cp = sProviderHolder.getProvider(resolver);
17985 cp.call(resolver.getAttributionSource(), sProviderHolder.mUri.getAuthority(),
17986 CALL_METHOD_SET_SYNC_DISABLED_MODE_CONFIG, null, args);
17987 } catch (RemoteException e) {
17988 Log.w(TAG, "Can't set sync disabled mode " + DeviceConfig.CONTENT_URI, e);
17989 }
17990 }
17991
17992 /**
17993 * Bridge method between {@link DeviceConfig#getSyncDisabledMode()} and the
17994 * {@link com.android.providers.settings.SettingsProvider} implementation.
17995 *
17996 * @hide
17997 */
17998 @SuppressLint("AndroidFrameworkRequiresPermission")
17999 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
18000 static int getSyncDisabledMode(@NonNull ContentResolver resolver) {
18001 try {
18002 Bundle args = Bundle.EMPTY;
18003 IContentProvider cp = sProviderHolder.getProvider(resolver);
18004 Bundle bundle = cp.call(resolver.getAttributionSource(),
18005 sProviderHolder.mUri.getAuthority(),
18006 CALL_METHOD_GET_SYNC_DISABLED_MODE_CONFIG,
18007 null, args);
18008 return bundle.getInt(KEY_CONFIG_GET_SYNC_DISABLED_MODE_RETURN);
18009 } catch (RemoteException e) {
18010 Log.w(TAG, "Can't query sync disabled mode " + DeviceConfig.CONTENT_URI, e);
18011 }
18012 return -1;
18013 }
18014
18015 /**
18016 * Register callback for monitoring Config table.
18017 *
18018 * @param resolver Handle to the content resolver.
18019 * @param callback callback to register
18020 *
18021 * @hide
18022 */
18023 @RequiresPermission(Manifest.permission.MONITOR_DEVICE_CONFIG_ACCESS)
18024 public static void registerMonitorCallback(@NonNull ContentResolver resolver,
18025 @NonNull RemoteCallback callback) {
18026 registerMonitorCallbackAsUser(resolver, resolver.getUserId(), callback);
18027 }
18028
18029 private static void registerMonitorCallbackAsUser(
18030 @NonNull ContentResolver resolver, @UserIdInt int userHandle,
18031 @NonNull RemoteCallback callback) {
18032 try {
18033 Bundle arg = new Bundle();
18034 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
18035 arg.putParcelable(CALL_METHOD_MONITOR_CALLBACK_KEY, callback);
18036 IContentProvider cp = sProviderHolder.getProvider(resolver);
18037 cp.call(resolver.getAttributionSource(),
18038 sProviderHolder.mUri.getAuthority(),
18039 CALL_METHOD_REGISTER_MONITOR_CALLBACK_CONFIG, null, arg);
18040 } catch (RemoteException e) {
18041 Log.w(TAG, "Can't register config monitor callback", e);
18042 }
18043 }
18044
18045 /** @hide */
18046 public static void clearProviderForTest() {
18047 sProviderHolder.clearProviderForTest();
18048 sNameValueCache.clearGenerationTrackerForTest();
18049 }
18050
18051 private static String createCompositeName(@NonNull String namespace, @NonNull String name) {
18052 Preconditions.checkNotNull(namespace);
18053 Preconditions.checkNotNull(name);
18054 return createPrefix(namespace) + name;
18055 }
18056
18057 private static String createPrefix(@NonNull String namespace) {
18058 Preconditions.checkNotNull(namespace);
18059 return namespace + "/";
18060 }
18061 }
18062
18063 /**
18064 * User-defined bookmarks and shortcuts. The target of each bookmark is an
18065 * Intent URL, allowing it to be either a web page or a particular
18066 * application activity.
18067 *
18068 * @hide
18069 */
18070 public static final class Bookmarks implements BaseColumns
18071 {
18072 private static final String TAG = "Bookmarks";
18073
18074 /**
18075 * The content:// style URL for this table
18076 */
18077 @UnsupportedAppUsage
18078 public static final Uri CONTENT_URI =
18079 Uri.parse("content://" + AUTHORITY + "/bookmarks");
18080
18081 /**
18082 * The row ID.
18083 * <p>Type: INTEGER</p>
18084 */
18085 public static final String ID = "_id";
18086
18087 /**
18088 * Descriptive name of the bookmark that can be displayed to the user.
18089 * If this is empty, the title should be resolved at display time (use
18090 * {@link #getTitle(Context, Cursor)} any time you want to display the
18091 * title of a bookmark.)
18092 * <P>
18093 * Type: TEXT
18094 * </P>
18095 */
18096 public static final String TITLE = "title";
18097
18098 /**
18099 * Arbitrary string (displayed to the user) that allows bookmarks to be
18100 * organized into categories. There are some special names for
18101 * standard folders, which all start with '@'. The label displayed for
18102 * the folder changes with the locale (via {@link #getLabelForFolder}) but
18103 * the folder name does not change so you can consistently query for
18104 * the folder regardless of the current locale.
18105 *
18106 * <P>Type: TEXT</P>
18107 *
18108 */
18109 public static final String FOLDER = "folder";
18110
18111 /**
18112 * The Intent URL of the bookmark, describing what it points to. This
18113 * value is given to {@link android.content.Intent#getIntent} to create
18114 * an Intent that can be launched.
18115 * <P>Type: TEXT</P>
18116 */
18117 public static final String INTENT = "intent";
18118
18119 /**
18120 * Optional shortcut character associated with this bookmark.
18121 * <P>Type: INTEGER</P>
18122 */
18123 public static final String SHORTCUT = "shortcut";
18124
18125 /**
18126 * The order in which the bookmark should be displayed
18127 * <P>Type: INTEGER</P>
18128 */
18129 public static final String ORDERING = "ordering";
18130
18131 private static final String[] sIntentProjection = { INTENT };
18132 private static final String[] sShortcutProjection = { ID, SHORTCUT };
18133 private static final String sShortcutSelection = SHORTCUT + "=?";
18134
18135 /**
18136 * Convenience function to retrieve the bookmarked Intent for a
18137 * particular shortcut key.
18138 *
18139 * @param cr The ContentResolver to query.
18140 * @param shortcut The shortcut key.
18141 *
18142 * @return Intent The bookmarked URL, or null if there is no bookmark
18143 * matching the given shortcut.
18144 */
18145 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
18146 {
18147 Intent intent = null;
18148
18149 Cursor c = cr.query(CONTENT_URI,
18150 sIntentProjection, sShortcutSelection,
18151 new String[] { String.valueOf((int) shortcut) }, ORDERING);
18152 // Keep trying until we find a valid shortcut
18153 try {
18154 while (intent == null && c.moveToNext()) {
18155 try {
18156 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
18157 intent = Intent.parseUri(intentURI, 0);
18158 } catch (java.net.URISyntaxException e) {
18159 // The stored URL is bad... ignore it.
18160 } catch (IllegalArgumentException e) {
18161 // Column not found
18162 Log.w(TAG, "Intent column not found", e);
18163 }
18164 }
18165 } finally {
18166 if (c != null) c.close();
18167 }
18168
18169 return intent;
18170 }
18171
18172 /**
18173 * Add a new bookmark to the system.
18174 *
18175 * @param cr The ContentResolver to query.
18176 * @param intent The desired target of the bookmark.
18177 * @param title Bookmark title that is shown to the user; null if none
18178 * or it should be resolved to the intent's title.
18179 * @param folder Folder in which to place the bookmark; null if none.
18180 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
18181 * this is non-zero and there is an existing bookmark entry
18182 * with this same shortcut, then that existing shortcut is
18183 * cleared (the bookmark is not removed).
18184 * @return The unique content URL for the new bookmark entry.
18185 */
18186 @UnsupportedAppUsage
18187 public static Uri add(ContentResolver cr,
18188 Intent intent,
18189 String title,
18190 String folder,
18191 char shortcut,
18192 int ordering)
18193 {
18194 // If a shortcut is supplied, and it is already defined for
18195 // another bookmark, then remove the old definition.
18196 if (shortcut != 0) {
18197 cr.delete(CONTENT_URI, sShortcutSelection,
18198 new String[] { String.valueOf((int) shortcut) });
18199 }
18200
18201 ContentValues values = new ContentValues();
18202 if (title != null) values.put(TITLE, title);
18203 if (folder != null) values.put(FOLDER, folder);
18204 values.put(INTENT, intent.toUri(0));
18205 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
18206 values.put(ORDERING, ordering);
18207 return cr.insert(CONTENT_URI, values);
18208 }
18209
18210 /**
18211 * Return the folder name as it should be displayed to the user. This
18212 * takes care of localizing special folders.
18213 *
18214 * @param r Resources object for current locale; only need access to
18215 * system resources.
18216 * @param folder The value found in the {@link #FOLDER} column.
18217 *
18218 * @return CharSequence The label for this folder that should be shown
18219 * to the user.
18220 */
18221 public static CharSequence getLabelForFolder(Resources r, String folder) {
18222 return folder;
18223 }
18224
18225 /**
18226 * Return the title as it should be displayed to the user. This takes
18227 * care of localizing bookmarks that point to activities.
18228 *
18229 * @param context A context.
18230 * @param cursor A cursor pointing to the row whose title should be
18231 * returned. The cursor must contain at least the {@link #TITLE}
18232 * and {@link #INTENT} columns.
18233 * @return A title that is localized and can be displayed to the user,
18234 * or the empty string if one could not be found.
18235 */
18236 public static CharSequence getTitle(Context context, Cursor cursor) {
18237 int titleColumn = cursor.getColumnIndex(TITLE);
18238 int intentColumn = cursor.getColumnIndex(INTENT);
18239 if (titleColumn == -1 || intentColumn == -1) {
18240 throw new IllegalArgumentException(
18241 "The cursor must contain the TITLE and INTENT columns.");
18242 }
18243
18244 String title = cursor.getString(titleColumn);
18245 if (!TextUtils.isEmpty(title)) {
18246 return title;
18247 }
18248
18249 String intentUri = cursor.getString(intentColumn);
18250 if (TextUtils.isEmpty(intentUri)) {
18251 return "";
18252 }
18253
18254 Intent intent;
18255 try {
18256 intent = Intent.parseUri(intentUri, 0);
18257 } catch (URISyntaxException e) {
18258 return "";
18259 }
18260
18261 PackageManager packageManager = context.getPackageManager();
18262 ResolveInfo info = packageManager.resolveActivity(intent, 0);
18263 return info != null ? info.loadLabel(packageManager) : "";
18264 }
18265 }
18266
18267 /**
18268 * <p>
18269 * A Settings panel is floating UI that contains a fixed subset of settings to address a
18270 * particular user problem. For example, the
18271 * {@link #ACTION_INTERNET_CONNECTIVITY Internet Panel} surfaces settings related to
18272 * connecting to the internet.
18273 * <p>
18274 * Settings panels appear above the calling app to address the problem without
18275 * the user needing to open Settings and thus leave their current screen.
18276 */
18277 public static final class Panel {
18278 private Panel() {
18279 }
18280
18281 /**
18282 * Activity Action: Show a settings dialog containing settings to enable internet
18283 * connection.
18284 * <p>
18285 * Input: Nothing.
18286 * <p>
18287 * Output: Nothing.
18288 */
18289 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
18290 public static final String ACTION_INTERNET_CONNECTIVITY =
18291 "android.settings.panel.action.INTERNET_CONNECTIVITY";
18292
18293 /**
18294 * Activity Action: Show a settings dialog containing NFC-related settings.
18295 * <p>
18296 * Input: Nothing.
18297 * <p>
18298 * Output: Nothing.
18299 */
18300 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
18301 public static final String ACTION_NFC =
18302 "android.settings.panel.action.NFC";
18303
18304 /**
18305 * Activity Action: Show a settings dialog containing controls for Wifi.
18306 * <p>
18307 * Input: Nothing.
18308 * <p>
18309 * Output: Nothing.
18310 */
18311 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
18312 public static final String ACTION_WIFI =
18313 "android.settings.panel.action.WIFI";
18314
18315 /**
18316 * Activity Action: Show a settings dialog containing all volume streams.
18317 * <p>
18318 * Input: Nothing.
18319 * <p>
18320 * Output: Nothing.
18321 */
18322 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
18323 public static final String ACTION_VOLUME =
18324 "android.settings.panel.action.VOLUME";
18325 }
18326
18327 /**
18328 * Activity Action: Show setting page to process the addition of Wi-Fi networks to the user's
18329 * saved network list. The app should send a new intent with an extra that holds a maximum
18330 * of five {@link android.net.wifi.WifiNetworkSuggestion} that specify credentials for the
18331 * networks to be added to the user's database. The Intent should be sent via the
18332 * {@link android.app.Activity#startActivityForResult(Intent, int)} API.
18333 * <p>
18334 * Note: The app sending the Intent to add the credentials doesn't get any ownership over the
18335 * newly added network(s). For the Wi-Fi stack, these networks will look like the user
18336 * manually added them from the Settings UI.
18337 * <p>
18338 * Input: The app should put parcelable array list of
18339 * {@link android.net.wifi.WifiNetworkSuggestion} into the {@link #EXTRA_WIFI_NETWORK_LIST}
18340 * extra.
18341 * <p>
18342 * Output: After {@link android.app.Activity#startActivityForResult(Intent, int)}, the
18343 * callback {@link android.app.Activity#onActivityResult(int, int, Intent)} will have a
18344 * result code {@link android.app.Activity#RESULT_OK} to indicate user pressed the save
18345 * button to save the networks or {@link android.app.Activity#RESULT_CANCELED} to indicate
18346 * that the user rejected the request. Additionally, an integer array list, stored in
18347 * {@link #EXTRA_WIFI_NETWORK_RESULT_LIST}, will indicate the process result of each network.
18348 */
18349 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
18350 public static final String ACTION_WIFI_ADD_NETWORKS =
18351 "android.settings.WIFI_ADD_NETWORKS";
18352
18353 /**
18354 * A bundle extra of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that indicates the list
18355 * of the {@link android.net.wifi.WifiNetworkSuggestion} elements. The maximum count of the
18356 * {@link android.net.wifi.WifiNetworkSuggestion} elements in the list will be five.
18357 * <p>
18358 * For example:
18359 * To provide credentials for one open and one WPA2 networks:
18360 *
18361 * <pre>{@code
18362 * final WifiNetworkSuggestion suggestion1 =
18363 * new WifiNetworkSuggestion.Builder()
18364 * .setSsid("test111111")
18365 * .build();
18366 * final WifiNetworkSuggestion suggestion2 =
18367 * new WifiNetworkSuggestion.Builder()
18368 * .setSsid("test222222")
18369 * .setWpa2Passphrase("test123456")
18370 * .build();
18371 * final List<WifiNetworkSuggestion> suggestionsList = new ArrayList<>;
18372 * suggestionsList.add(suggestion1);
18373 * suggestionsList.add(suggestion2);
18374 * Bundle bundle = new Bundle();
18375 * bundle.putParcelableArrayList(Settings.EXTRA_WIFI_NETWORK_LIST,(ArrayList<? extends
18376 * Parcelable>) suggestionsList);
18377 * final Intent intent = new Intent(Settings.ACTION_WIFI_ADD_NETWORKS);
18378 * intent.putExtras(bundle);
18379 * startActivityForResult(intent, 0);
18380 * }</pre>
18381 */
18382 public static final String EXTRA_WIFI_NETWORK_LIST =
18383 "android.provider.extra.WIFI_NETWORK_LIST";
18384
18385 /**
18386 * A bundle extra of the result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that
18387 * indicates the action result of the saved {@link android.net.wifi.WifiNetworkSuggestion}.
18388 * Its value is a list of integers, and all the elements will be 1:1 mapping to the elements
18389 * in {@link #EXTRA_WIFI_NETWORK_LIST}, if user press cancel to cancel the add networks
18390 * request, then its value will be null.
18391 * <p>
18392 * Note: The integer value will be one of the {@link #ADD_WIFI_RESULT_SUCCESS},
18393 * {@link #ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED}, or {@link #ADD_WIFI_RESULT_ALREADY_EXISTS}}.
18394 */
18395 public static final String EXTRA_WIFI_NETWORK_RESULT_LIST =
18396 "android.provider.extra.WIFI_NETWORK_RESULT_LIST";
18397
18398 /** @hide */
18399 @Retention(RetentionPolicy.SOURCE)
18400 @IntDef(prefix = {"ADD_WIFI_RESULT_"}, value = {
18401 ADD_WIFI_RESULT_SUCCESS,
18402 ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED,
18403 ADD_WIFI_RESULT_ALREADY_EXISTS
18404 })
18405 public @interface AddWifiResult {
18406 }
18407
18408 /**
18409 * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that saving or updating the
18410 * corresponding Wi-Fi network was successful.
18411 */
18412 public static final int ADD_WIFI_RESULT_SUCCESS = 0;
18413
18414 /**
18415 * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that saving the corresponding
18416 * Wi-Fi network failed.
18417 */
18418 public static final int ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED = 1;
18419
18420 /**
18421 * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that indicates the Wi-Fi network
18422 * already exists.
18423 */
18424 public static final int ADD_WIFI_RESULT_ALREADY_EXISTS = 2;
18425
18426 /**
18427 * Activity Action: Allows user to select current bug report handler.
18428 * <p>
18429 * Input: Nothing.
18430 * <p>
18431 * Output: Nothing.
18432 *
18433 * @hide
18434 */
18435 @SystemApi
18436 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
18437 public static final String ACTION_BUGREPORT_HANDLER_SETTINGS =
18438 "android.settings.BUGREPORT_HANDLER_SETTINGS";
18439
18440 private static final String[] PM_WRITE_SETTINGS = {
18441 android.Manifest.permission.WRITE_SETTINGS
18442 };
18443 private static final String[] PM_CHANGE_NETWORK_STATE = {
18444 android.Manifest.permission.CHANGE_NETWORK_STATE,
18445 android.Manifest.permission.WRITE_SETTINGS
18446 };
18447 private static final String[] PM_SYSTEM_ALERT_WINDOW = {
18448 android.Manifest.permission.SYSTEM_ALERT_WINDOW
18449 };
18450
18451 /**
18452 * Activity Action: Show screen for controlling which apps have access to manage external
18453 * storage.
18454 * <p>
18455 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
18456 * <p>
18457 * If you want to control a specific app's access to manage external storage, use
18458 * {@link #ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION} instead.
18459 * <p>
18460 * Output: Nothing.
18461 * @see #ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
18462 */
18463 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
18464 public static final String ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION =
18465 "android.settings.MANAGE_ALL_FILES_ACCESS_PERMISSION";
18466
18467 /**
18468 * Activity Action: Show screen for controlling if the app specified in the data URI of the
18469 * intent can manage external storage.
18470 * <p>
18471 * Launching the corresponding activity requires the permission
18472 * {@link Manifest.permission#MANAGE_EXTERNAL_STORAGE}.
18473 * <p>
18474 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
18475 * <p>
18476 * Input: The Intent's data URI MUST specify the application package name whose ability of
18477 * managing external storage you want to control.
18478 * For example "package:com.my.app".
18479 * <p>
18480 * Output: Nothing.
18481 * @see #ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION
18482 */
18483 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
18484 public static final String ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION =
18485 "android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION";
18486
18487 /**
18488 * Activity Action: For system or preinstalled apps to show their {@link Activity} embedded
18489 * in Settings app on large screen devices.
18490 *
18491 * Developers should resolve the Intent action before using it.
18492 *
18493 * <p>
18494 * Input: {@link #EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_INTENT_URI} must be included to
18495 * specify the intent for the activity which will be embedded in Settings app.
18496 * It's an intent URI string from {@code intent.toUri(Intent.URI_INTENT_SCHEME)}.
18497 *
18498 * Input: {@link #EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_HIGHLIGHT_MENU_KEY} must be included to
18499 * specify a key that indicates the menu item which will be highlighted on settings home menu.
18500 * <p>
18501 * Output: Nothing.
18502 */
18503 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
18504 public static final String ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY =
18505 "android.settings.SETTINGS_EMBED_DEEP_LINK_ACTIVITY";
18506
18507 /**
18508 * Activity Extra: Specify the intent for the {@link Activity} which will be embedded in
18509 * Settings app. It's an intent URI string from
18510 * {@code intent.toUri(Intent.URI_INTENT_SCHEME)}.
18511 * <p>
18512 * This must be passed as an extra field to
18513 * {@link #ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY}.
18514 */
18515 public static final String EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_INTENT_URI =
18516 "android.provider.extra.SETTINGS_EMBEDDED_DEEP_LINK_INTENT_URI";
18517
18518 /**
18519 * Activity Extra: Specify a key that indicates the menu item which should be highlighted on
18520 * settings home menu.
18521 * <p>
18522 * This must be passed as an extra field to
18523 * {@link #ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY}.
18524 */
18525 public static final String EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_HIGHLIGHT_MENU_KEY =
18526 "android.provider.extra.SETTINGS_EMBEDDED_DEEP_LINK_HIGHLIGHT_MENU_KEY";
18527
18528 /**
18529 * Performs a strict and comprehensive check of whether a calling package is allowed to
18530 * write/modify system settings, as the condition differs for pre-M, M+, and
18531 * privileged/preinstalled apps. If the provided uid does not match the
18532 * callingPackage, a negative result will be returned.
18533 * @hide
18534 */
18535 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
18536 public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid,
18537 String callingPackage, boolean throwException) {
18538 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
18539 callingPackage, null /*attribution not needed when not making note */,
18540 throwException, AppOpsManager.OP_WRITE_SETTINGS, PM_WRITE_SETTINGS,
18541 false);
18542 }
18543
18544 /**
18545 * @deprecated Use {@link #checkAndNoteWriteSettingsOperation(Context, int, String, String,
18546 * boolean)} instead.
18547 *
18548 * @hide
18549 */
18550 @Deprecated
18551 @SystemApi
18552 public static boolean checkAndNoteWriteSettingsOperation(@NonNull Context context, int uid,
18553 @NonNull String callingPackage, boolean throwException) {
18554 return checkAndNoteWriteSettingsOperation(context, uid, callingPackage, null,
18555 throwException);
18556 }
18557
18558 /**
18559 * Performs a strict and comprehensive check of whether a calling package is allowed to
18560 * write/modify system settings, as the condition differs for pre-M, M+, and
18561 * privileged/preinstalled apps. If the provided uid does not match the
18562 * callingPackage, a negative result will be returned. The caller is expected to have
18563 * the WRITE_SETTINGS permission declared.
18564 *
18565 * Note: if the check is successful, the operation of this app will be updated to the
18566 * current time.
18567 * @hide
18568 */
18569 @SystemApi
18570 public static boolean checkAndNoteWriteSettingsOperation(@NonNull Context context, int uid,
18571 @NonNull String callingPackage, @Nullable String callingAttributionTag,
18572 boolean throwException) {
18573 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
18574 callingPackage, callingAttributionTag, throwException,
18575 AppOpsManager.OP_WRITE_SETTINGS, PM_WRITE_SETTINGS, true);
18576 }
18577
18578 /**
18579 * Performs a strict and comprehensive check of whether a calling package is allowed to
18580 * draw on top of other apps, as the conditions differs for pre-M, M+, and
18581 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
18582 * a negative result will be returned.
18583 * @hide
18584 */
18585 @UnsupportedAppUsage
18586 public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid,
18587 String callingPackage, boolean throwException) {
18588 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
18589 callingPackage, null /*attribution not needed when not making note */,
18590 throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, PM_SYSTEM_ALERT_WINDOW,
18591 false);
18592 }
18593
18594 /**
18595 * Performs a strict and comprehensive check of whether a calling package is allowed to
18596 * draw on top of other apps, as the conditions differs for pre-M, M+, and
18597 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
18598 * a negative result will be returned.
18599 *
18600 * Note: if the check is successful, the operation of this app will be updated to the
18601 * current time.
18602 * @hide
18603 */
18604 public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid,
18605 String callingPackage, String callingAttributionTag, boolean throwException) {
18606 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
18607 callingPackage, callingAttributionTag, throwException,
18608 AppOpsManager.OP_SYSTEM_ALERT_WINDOW, PM_SYSTEM_ALERT_WINDOW, true);
18609 }
18610
18611 /**
18612 * @deprecated Use {@link #isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context,
18613 * int, String, String, boolean, int, String[], boolean)} instead.
18614 *
18615 * @hide
18616 */
18617 @Deprecated
18618 @UnsupportedAppUsage
18619 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
18620 int uid, String callingPackage, boolean throwException, int appOpsOpCode,
18621 String[] permissions, boolean makeNote) {
18622 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
18623 callingPackage, null, throwException, appOpsOpCode, permissions, makeNote);
18624 }
18625
18626 /**
18627 * Helper method to perform a general and comprehensive check of whether an operation that is
18628 * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and
18629 * OP_WRITE_SETTINGS
18630 * @hide
18631 */
18632 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
18633 int uid, String callingPackage, String callingAttributionTag, boolean throwException,
18634 int appOpsOpCode, String[] permissions, boolean makeNote) {
18635 if (callingPackage == null) {
18636 return false;
18637 }
18638
18639 AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE);
18640 int mode = AppOpsManager.MODE_DEFAULT;
18641 if (makeNote) {
18642 mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage, callingAttributionTag,
18643 null);
18644 } else {
18645 mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage);
18646 }
18647
18648 switch (mode) {
18649 case AppOpsManager.MODE_ALLOWED:
18650 return true;
18651
18652 case AppOpsManager.MODE_DEFAULT:
18653 // this is the default operating mode after an app's installation
18654 // In this case we will check all associated static permission to see
18655 // if it is granted during install time.
18656 for (String permission : permissions) {
18657 if (context.checkCallingOrSelfPermission(permission) == PackageManager
18658 .PERMISSION_GRANTED) {
18659 // if either of the permissions are granted, we will allow it
18660 return true;
18661 }
18662 }
18663
18664 default:
18665 // this is for all other cases trickled down here...
18666 if (!throwException) {
18667 return false;
18668 }
18669 }
18670
18671 // prepare string to throw SecurityException
18672 StringBuilder exceptionMessage = new StringBuilder();
18673 exceptionMessage.append(callingPackage);
18674 exceptionMessage.append(" was not granted ");
18675 if (permissions.length > 1) {
18676 exceptionMessage.append(" either of these permissions: ");
18677 } else {
18678 exceptionMessage.append(" this permission: ");
18679 }
18680 for (int i = 0; i < permissions.length; i++) {
18681 exceptionMessage.append(permissions[i]);
18682 exceptionMessage.append((i == permissions.length - 1) ? "." : ", ");
18683 }
18684
18685 throw new SecurityException(exceptionMessage.toString());
18686 }
18687
18688 /**
18689 * Retrieves a correponding package name for a given uid. It will query all
18690 * packages that are associated with the given uid, but it will return only
18691 * the zeroth result.
18692 * Note: If package could not be found, a null is returned.
18693 * @hide
18694 */
18695 public static String getPackageNameForUid(Context context, int uid) {
18696 String[] packages = context.getPackageManager().getPackagesForUid(uid);
18697 if (packages == null) {
18698 return null;
18699 }
18700 return packages[0];
18701 }
18702 }