• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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      * @see android.nfc.NfcAdapter#isNdefPushEnabled()
1600      */
1601     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1602     public static final String ACTION_NFCSHARING_SETTINGS =
1603         "android.settings.NFCSHARING_SETTINGS";
1604 
1605     /**
1606      * Activity Action: Show NFC Tap & Pay settings
1607      * <p>
1608      * This shows UI that allows the user to configure Tap&Pay
1609      * settings.
1610      * <p>
1611      * In some cases, a matching Activity may not exist, so ensure you
1612      * safeguard against this.
1613      * <p>
1614      * Input: Nothing.
1615      * <p>
1616      * Output: Nothing
1617      */
1618     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1619     public static final String ACTION_NFC_PAYMENT_SETTINGS =
1620         "android.settings.NFC_PAYMENT_SETTINGS";
1621 
1622     /**
1623      * Activity Action: Show Daydream settings.
1624      * <p>
1625      * In some cases, a matching Activity may not exist, so ensure you
1626      * safeguard against this.
1627      * <p>
1628      * Input: Nothing.
1629      * <p>
1630      * Output: Nothing.
1631      * @see android.service.dreams.DreamService
1632      */
1633     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1634     public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
1635 
1636     /**
1637      * Activity Action: Show Notification assistant settings.
1638      * <p>
1639      * In some cases, a matching Activity may not exist, so ensure you
1640      * safeguard against this.
1641      * <p>
1642      * Input: Nothing.
1643      * <p>
1644      * Output: Nothing.
1645      * @see android.service.notification.NotificationAssistantService
1646      */
1647     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1648     public static final String ACTION_NOTIFICATION_ASSISTANT_SETTINGS =
1649             "android.settings.NOTIFICATION_ASSISTANT_SETTINGS";
1650 
1651     /**
1652      * Activity Action: Show Notification listener settings.
1653      * <p>
1654      * In some cases, a matching Activity may not exist, so ensure you
1655      * safeguard against this.
1656      * <p>
1657      * Input: Nothing.
1658      * <p>
1659      * Output: Nothing.
1660      * @see android.service.notification.NotificationListenerService
1661      */
1662     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1663     public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
1664             = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
1665 
1666     /**
1667      * Activity Action: Show notification listener permission settings page for app.
1668      * <p>
1669      * Users can grant and deny access to notifications for a {@link ComponentName} from here.
1670      * See
1671      * {@link android.app.NotificationManager#isNotificationListenerAccessGranted(ComponentName)}
1672      * for more details.
1673      * <p>
1674      * Input: The extra {@link #EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME} containing the name
1675      * of the component to grant or revoke notification listener access to.
1676      * <p>
1677      * Output: Nothing.
1678      */
1679     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1680     public static final String ACTION_NOTIFICATION_LISTENER_DETAIL_SETTINGS =
1681             "android.settings.NOTIFICATION_LISTENER_DETAIL_SETTINGS";
1682 
1683     /**
1684      * Activity Extra: What component name to show the notification listener permission
1685      * page for.
1686      * <p>
1687      * A string extra containing a {@link ComponentName}. This must be passed as an extra field to
1688      * {@link #ACTION_NOTIFICATION_LISTENER_DETAIL_SETTINGS}.
1689      */
1690     public static final String EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME =
1691             "android.provider.extra.NOTIFICATION_LISTENER_COMPONENT_NAME";
1692 
1693     /**
1694      * Activity Action: Show Do Not Disturb access settings.
1695      * <p>
1696      * Users can grant and deny access to Do Not Disturb configuration from here. Managed
1697      * profiles cannot grant Do Not Disturb access.
1698      * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1699      * details.
1700      * <p>
1701      * Input: Nothing.
1702      * <p>
1703      * Output: Nothing.
1704      *
1705      * <p class="note">
1706      * In some cases, a matching Activity may not exist, so ensure you
1707      * safeguard against this.
1708      */
1709     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1710     public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
1711             = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
1712 
1713     /**
1714      * Activity Action: Show do not disturb setting page for app.
1715      * <p>
1716      * Users can grant and deny access to Do Not Disturb configuration for an app from here.
1717      * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1718      * details.
1719      * <p>
1720      * Input: Intent's data URI set with an application name, using the
1721      * "package" schema (like "package:com.my.app").
1722      * <p>
1723      * Output: Nothing.
1724      *
1725      * @hide
1726      */
1727     @SystemApi
1728     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1729     public static final String ACTION_NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS =
1730             "android.settings.NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS";
1731 
1732     /**
1733      * Activity Action: Show the automatic do not disturb rule listing page
1734      * <p>
1735      *     Users can add, enable, disable, and remove automatic do not disturb rules from this
1736      *     screen. See {@link NotificationManager#addAutomaticZenRule(AutomaticZenRule)} for more
1737      *     details.
1738      * </p>
1739      * <p>
1740      *     Input: Nothing
1741      *     Output: Nothing
1742      * </p>
1743      *
1744      */
1745     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1746     public static final String ACTION_CONDITION_PROVIDER_SETTINGS
1747             = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
1748 
1749     /**
1750      * Activity Action: Show settings for video captioning.
1751      * <p>
1752      * In some cases, a matching Activity may not exist, so ensure you safeguard
1753      * against this.
1754      * <p>
1755      * Input: Nothing.
1756      * <p>
1757      * Output: Nothing.
1758      */
1759     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1760     public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
1761 
1762     /**
1763      * Activity Action: Show the top level print settings.
1764      * <p>
1765      * In some cases, a matching Activity may not exist, so ensure you
1766      * safeguard against this.
1767      * <p>
1768      * Input: Nothing.
1769      * <p>
1770      * Output: Nothing.
1771      */
1772     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1773     public static final String ACTION_PRINT_SETTINGS =
1774             "android.settings.ACTION_PRINT_SETTINGS";
1775 
1776     /**
1777      * Activity Action: Show Zen Mode configuration settings.
1778      *
1779      * @hide
1780      */
1781     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1782     public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
1783 
1784     /**
1785      * Activity Action: Show Zen Mode visual effects configuration settings.
1786      *
1787      * @hide
1788      */
1789     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1790     public static final String ZEN_MODE_BLOCKED_EFFECTS_SETTINGS =
1791             "android.settings.ZEN_MODE_BLOCKED_EFFECTS_SETTINGS";
1792 
1793     /**
1794      * Activity Action: Show Zen Mode onboarding activity.
1795      *
1796      * @hide
1797      */
1798     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1799     public static final String ZEN_MODE_ONBOARDING = "android.settings.ZEN_MODE_ONBOARDING";
1800 
1801     /**
1802      * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings.
1803      */
1804     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1805     public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
1806             = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
1807 
1808     /**
1809      * Activity Action: Show Zen Mode automation configuration settings.
1810      *
1811      * @hide
1812      */
1813     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1814     public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
1815             = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
1816 
1817     /**
1818      * Activity Action: Modify do not disturb mode settings.
1819      * <p>
1820      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1821      * <p>
1822      * This intent MUST be started using
1823      * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1824      * startVoiceActivity}.
1825      * <p>
1826      * Note: The Activity implementing this intent MUST verify that
1827      * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
1828      * returns true before modifying the setting.
1829      * <p>
1830      * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
1831      * how long the user wishes to avoid interruptions for. The optional
1832      * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
1833      * enabling or disabling do not disturb mode. If either extra is not included, the
1834      * user maybe asked to provide the value.
1835      * <p>
1836      * Output: Nothing.
1837      */
1838     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1839     public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
1840             "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
1841 
1842     /**
1843      * Activity Action: Show Zen Mode schedule rule configuration settings.
1844      *
1845      * @hide
1846      */
1847     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1848     public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
1849             = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
1850 
1851     /**
1852      * Activity Action: Show Zen Mode event rule configuration settings.
1853      *
1854      * @hide
1855      */
1856     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1857     public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
1858             = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
1859 
1860     /**
1861      * Activity Action: Show Zen Mode external rule configuration settings.
1862      *
1863      * @hide
1864      */
1865     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1866     public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
1867             = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
1868 
1869     /**
1870      * Activity Action: Show the regulatory information screen for the device.
1871      * <p>
1872      * In some cases, a matching Activity may not exist, so ensure you safeguard
1873      * against this.
1874      * <p>
1875      * Input: Nothing.
1876      * <p>
1877      * Output: Nothing.
1878      */
1879     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1880     public static final String
1881             ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
1882 
1883     /**
1884      * Activity Action: Show Device Name Settings.
1885      * <p>
1886      * In some cases, a matching Activity may not exist, so ensure you safeguard
1887      * against this.
1888      *
1889      * @hide
1890      */
1891     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1892     public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
1893 
1894     /**
1895      * Activity Action: Show pairing settings.
1896      * <p>
1897      * In some cases, a matching Activity may not exist, so ensure you safeguard
1898      * against this.
1899      *
1900      * @hide
1901      */
1902     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1903     public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
1904 
1905     /**
1906      * Activity Action: Show battery saver settings.
1907      * <p>
1908      * In some cases, a matching Activity may not exist, so ensure you safeguard
1909      * against this.
1910      */
1911     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1912     public static final String ACTION_BATTERY_SAVER_SETTINGS
1913             = "android.settings.BATTERY_SAVER_SETTINGS";
1914 
1915     /**
1916      * Activity Action: Modify Battery Saver mode setting using a voice command.
1917      * <p>
1918      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1919      * <p>
1920      * This intent MUST be started using
1921      * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1922      * startVoiceActivity}.
1923      * <p>
1924      * Note: The activity implementing this intent MUST verify that
1925      * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
1926      * modifying the setting.
1927      * <p>
1928      * Input: To tell which state batter saver mode should be set to, add the
1929      * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
1930      * If the extra is not included, no changes will be made.
1931      * <p>
1932      * Output: Nothing.
1933      */
1934     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1935     public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
1936             "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
1937 
1938     /**
1939      * Activity Action: Show Home selection settings. If there are multiple activities
1940      * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
1941      * to pick your preferred activity.
1942      */
1943     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1944     public static final String ACTION_HOME_SETTINGS
1945             = "android.settings.HOME_SETTINGS";
1946 
1947     /**
1948      * Activity Action: Show Default apps settings.
1949      * <p>
1950      * In some cases, a matching Activity may not exist, so ensure you
1951      * safeguard against this.
1952      * <p>
1953      * Input: Nothing.
1954      * <p>
1955      * Output: Nothing.
1956      */
1957     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1958     public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS
1959             = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS";
1960 
1961     /**
1962      * Activity Action: Show More default apps settings.
1963      * <p>
1964      * If a Settings activity handles this intent action, a "More defaults" entry will be shown in
1965      * the Default apps settings, and clicking it will launch that activity.
1966      * <p>
1967      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1968      * <p>
1969      * Input: Nothing.
1970      * <p>
1971      * Output: Nothing.
1972      *
1973      * @hide
1974      */
1975     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1976     @SystemApi
1977     public static final String ACTION_MANAGE_MORE_DEFAULT_APPS_SETTINGS =
1978             "android.settings.MANAGE_MORE_DEFAULT_APPS_SETTINGS";
1979 
1980     /**
1981      * Activity Action: Show notification settings.
1982      *
1983      * @hide
1984      */
1985     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1986     public static final String ACTION_NOTIFICATION_SETTINGS
1987             = "android.settings.NOTIFICATION_SETTINGS";
1988 
1989     /**
1990      * Activity Action: Show conversation settings.
1991      *
1992      * @hide
1993      */
1994     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1995     public static final String ACTION_CONVERSATION_SETTINGS
1996             = "android.settings.CONVERSATION_SETTINGS";
1997 
1998     /**
1999      * Activity Action: Show notification history screen.
2000      *
2001      * @hide
2002      */
2003     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2004     public static final String ACTION_NOTIFICATION_HISTORY
2005             = "android.settings.NOTIFICATION_HISTORY";
2006 
2007     /**
2008      * Activity Action: Show app listing settings, filtered by those that send notifications.
2009      *
2010      */
2011     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2012     public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS =
2013             "android.settings.ALL_APPS_NOTIFICATION_SETTINGS";
2014 
2015     /**
2016      * Activity Action: Show app settings specifically for sending notifications. Same as
2017      * ALL_APPS_NOTIFICATION_SETTINGS but meant for internal use.
2018      * @hide
2019      */
2020     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2021     public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS_FOR_REVIEW =
2022             "android.settings.ALL_APPS_NOTIFICATION_SETTINGS_FOR_REVIEW";
2023 
2024     /**
2025      * Activity Action: Show notification settings for a single app.
2026      * <p>
2027      *     Input: {@link #EXTRA_APP_PACKAGE}, the package to display.
2028      * <p>
2029      * Output: Nothing.
2030      */
2031     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2032     public static final String ACTION_APP_NOTIFICATION_SETTINGS
2033             = "android.settings.APP_NOTIFICATION_SETTINGS";
2034 
2035     /**
2036      * Activity Action: Show notification settings for a single {@link NotificationChannel}.
2037      * <p>
2038      *     Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display.
2039      *     Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display.
2040      * <p>
2041      * Output: Nothing.
2042      */
2043     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2044     public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS
2045             = "android.settings.CHANNEL_NOTIFICATION_SETTINGS";
2046 
2047     /**
2048      * Activity Action: Show notification bubble settings for a single app.
2049      * See {@link NotificationManager#getBubblePreference()}.
2050      * <p>
2051      *     Input: {@link #EXTRA_APP_PACKAGE}, the package to display.
2052      * <p>
2053      * Output: Nothing.
2054      */
2055     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2056     public static final String ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS
2057             = "android.settings.APP_NOTIFICATION_BUBBLE_SETTINGS";
2058 
2059     /**
2060      * Activity Extra: The package owner of the notification channel settings to display.
2061      * <p>
2062      * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
2063      */
2064     public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE";
2065 
2066     /**
2067      * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings
2068      * to display.
2069      * <p>
2070      * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
2071      */
2072     public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID";
2073 
2074     /**
2075      * Activity Extra: The {@link NotificationChannel#getConversationId()} of the notification
2076      * conversation settings to display.
2077      * <p>
2078      * This is an optional extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. If
2079      * included the system will first look up notification settings by channel and conversation id,
2080      * and will fall back to channel id if a specialized channel for this conversation doesn't
2081      * exist, similar to {@link NotificationManager#getNotificationChannel(String, String)}.
2082      */
2083     public static final String EXTRA_CONVERSATION_ID = "android.provider.extra.CONVERSATION_ID";
2084 
2085     /**
2086      * Activity Extra: An {@code Arraylist<String>} of {@link NotificationChannel} field names to
2087      * show on the Settings UI.
2088      *
2089      * <p>
2090      * This is an optional extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. If
2091      * included the system will filter out any Settings that doesn't appear in this list that
2092      * otherwise would display.
2093      */
2094     public static final String EXTRA_CHANNEL_FILTER_LIST
2095             = "android.provider.extra.CHANNEL_FILTER_LIST";
2096 
2097     /**
2098      * Activity Action: Show notification redaction settings.
2099      *
2100      * @hide
2101      */
2102     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2103     public static final String ACTION_APP_NOTIFICATION_REDACTION
2104             = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
2105 
2106     /** @hide */
2107     @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
2108     public static final String EXTRA_APP_UID = "app_uid";
2109 
2110     /**
2111      * Activity Action: Show power menu settings.
2112      *
2113      * @hide
2114      */
2115     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2116     public static final String ACTION_POWER_MENU_SETTINGS =
2117             "android.settings.ACTION_POWER_MENU_SETTINGS";
2118 
2119     /**
2120      * Activity Action: Show controls settings.
2121      *
2122      * @hide
2123      */
2124     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2125     public static final String ACTION_DEVICE_CONTROLS_SETTINGS =
2126             "android.settings.ACTION_DEVICE_CONTROLS_SETTINGS";
2127 
2128     /**
2129      * Activity Action: Show media control settings
2130      *
2131      * @hide
2132      */
2133     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2134     public static final String ACTION_MEDIA_CONTROLS_SETTINGS =
2135             "android.settings.ACTION_MEDIA_CONTROLS_SETTINGS";
2136 
2137     /**
2138      * Activity Action: Show a dialog with disabled by policy message.
2139      * <p> If an user action is disabled by policy, this dialog can be triggered to let
2140      * the user know about this.
2141      * <p>
2142      * Input: {@link Intent#EXTRA_USER}: The user of the admin.
2143      * <p>
2144      * Output: Nothing.
2145      *
2146      * @hide
2147      */
2148     // Intent#EXTRA_USER_ID can also be used
2149     @SystemApi
2150     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2151     public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS =
2152             "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
2153 
2154     /**
2155      * Intent extra: The id of a setting restricted by supervisors.
2156      * <p>
2157      * Type: Integer with a value from the one of the SUPERVISOR_VERIFICATION_* constants below.
2158      * <ul>
2159      * <li>{@see #SUPERVISOR_VERIFICATION_SETTING_UNKNOWN}
2160      * <li>{@see #SUPERVISOR_VERIFICATION_SETTING_BIOMETRICS}
2161      * </ul>
2162      * </p>
2163      */
2164     public static final String EXTRA_SUPERVISOR_RESTRICTED_SETTING_KEY =
2165             "android.provider.extra.SUPERVISOR_RESTRICTED_SETTING_KEY";
2166 
2167     /**
2168      * The unknown setting can usually be ignored and is used for compatibility with future
2169      * supervisor settings.
2170      */
2171     public static final int SUPERVISOR_VERIFICATION_SETTING_UNKNOWN = 0;
2172 
2173     /**
2174      * Settings for supervisors to control what kinds of biometric sensors, such a face and
2175      * fingerprint scanners, can be used on the device.
2176      */
2177     public static final int SUPERVISOR_VERIFICATION_SETTING_BIOMETRICS = 1;
2178 
2179     /**
2180      * Keys for {@link #EXTRA_SUPERVISOR_RESTRICTED_SETTING_KEY}.
2181      * @hide
2182      */
2183     @Retention(RetentionPolicy.SOURCE)
2184     @IntDef(prefix = { "SUPERVISOR_VERIFICATION_SETTING_" }, value = {
2185             SUPERVISOR_VERIFICATION_SETTING_UNKNOWN,
2186             SUPERVISOR_VERIFICATION_SETTING_BIOMETRICS,
2187     })
2188     public @interface SupervisorVerificationSetting {}
2189 
2190     /**
2191      * Activity action: Launch UI to manage a setting restricted by supervisors.
2192      * <p>
2193      * Input: {@link #EXTRA_SUPERVISOR_RESTRICTED_SETTING_KEY} specifies what setting to open.
2194      * </p>
2195      * <p>
2196      * Output: Nothing.
2197      * </p>
2198      */
2199     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2200     public static final String ACTION_MANAGE_SUPERVISOR_RESTRICTED_SETTING =
2201             "android.settings.MANAGE_SUPERVISOR_RESTRICTED_SETTING";
2202 
2203     /**
2204      * Activity Action: Show a dialog for remote bugreport flow.
2205      * <p>
2206      * Input: Nothing.
2207      * <p>
2208      * Output: Nothing.
2209      *
2210      * @hide
2211      */
2212     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2213     public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG
2214             = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG";
2215 
2216     /**
2217      * Activity Action: Show VR listener settings.
2218      * <p>
2219      * Input: Nothing.
2220      * <p>
2221      * Output: Nothing.
2222      *
2223      * @see android.service.vr.VrListenerService
2224      */
2225     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2226     public static final String ACTION_VR_LISTENER_SETTINGS
2227             = "android.settings.VR_LISTENER_SETTINGS";
2228 
2229     /**
2230      * Activity Action: Show Picture-in-picture settings.
2231      * <p>
2232      * Input: Nothing.
2233      * <p>
2234      * Output: Nothing.
2235      *
2236      * @hide
2237      */
2238     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2239     public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS
2240             = "android.settings.PICTURE_IN_PICTURE_SETTINGS";
2241 
2242     /**
2243      * Activity Action: Show Storage Manager settings.
2244      * <p>
2245      * Input: Nothing.
2246      * <p>
2247      * Output: Nothing.
2248      *
2249      * @hide
2250      */
2251     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2252     public static final String ACTION_STORAGE_MANAGER_SETTINGS
2253             = "android.settings.STORAGE_MANAGER_SETTINGS";
2254 
2255     /**
2256      * Activity Action: Allows user to select current webview implementation.
2257      * <p>
2258      * Input: Nothing.
2259      * <p>
2260      * Output: Nothing.
2261      * <p class="note">
2262      * In some cases, a matching Activity may not exist, so ensure you
2263      * safeguard against this.
2264 
2265      */
2266     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2267     public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS";
2268 
2269     /**
2270      * Activity Action: Show enterprise privacy section.
2271      * <p>
2272      * Input: Nothing.
2273      * <p>
2274      * Output: Nothing.
2275      * @hide
2276      */
2277     @SystemApi
2278     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2279     public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS
2280             = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
2281 
2282     /**
2283      * Activity Action: Show Work Policy info.
2284      * DPC apps can implement an activity that handles this intent in order to show device policies
2285      * associated with the work profile or managed device.
2286      * <p>
2287      * Input: Nothing.
2288      * <p>
2289      * Output: Nothing.
2290      *
2291      */
2292     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2293     public static final String ACTION_SHOW_WORK_POLICY_INFO =
2294             "android.settings.SHOW_WORK_POLICY_INFO";
2295 
2296     /**
2297      * Activity Action: Show screen that let user select its Autofill Service.
2298      * <p>
2299      * Input: Intent's data URI set with an application name, using the
2300      * "package" schema (like "package:com.my.app").
2301      *
2302      * <p>
2303      * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging
2304      * to the caller package.
2305      *
2306      * <p>
2307      * <b>NOTE: </b> Applications should call
2308      * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and
2309      * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action
2310      * to start an activity if they return {@code false} and {@code true} respectively.
2311      */
2312     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2313     public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE =
2314             "android.settings.REQUEST_SET_AUTOFILL_SERVICE";
2315 
2316     /**
2317      * Activity Action: Show screen for controlling the Quick Access Wallet.
2318      * <p>
2319      * In some cases, a matching Activity may not exist, so ensure you
2320      * safeguard against this.
2321      * <p>
2322      * Input: Nothing.
2323      * <p>
2324      * Output: Nothing.
2325      */
2326     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2327     public static final String ACTION_QUICK_ACCESS_WALLET_SETTINGS =
2328             "android.settings.QUICK_ACCESS_WALLET_SETTINGS";
2329 
2330     /**
2331      * Activity Action: Show screen for controlling which apps have access on volume directories.
2332      * <p>
2333      * Input: Nothing.
2334      * <p>
2335      * Output: Nothing.
2336      * <p>
2337      * Applications typically use this action to ask the user to revert the "Do not ask again"
2338      * status of directory access requests made by
2339      * {@link android.os.storage.StorageVolume#createAccessIntent(String)}.
2340      * @deprecated use {@link #ACTION_APPLICATION_DETAILS_SETTINGS} to manage storage permissions
2341      *             for a specific application
2342      */
2343     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2344     @Deprecated
2345     public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS =
2346             "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS";
2347 
2348 
2349     /**
2350      * Activity Action: Show screen that let user select enable (or disable) Content Capture.
2351      * <p>
2352      * Input: Nothing.
2353      *
2354      * <p>
2355      * Output: Nothing
2356      *
2357      * @hide
2358      */
2359     @SystemApi
2360     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2361     public static final String ACTION_REQUEST_ENABLE_CONTENT_CAPTURE =
2362             "android.settings.REQUEST_ENABLE_CONTENT_CAPTURE";
2363 
2364     /**
2365      * Activity Action: Show screen that let user manage how Android handles URL resolution.
2366      * <p>
2367      * Input: Nothing.
2368      * <p>
2369      * Output: Nothing
2370      *
2371      * @hide
2372      */
2373     @SystemApi
2374     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2375     public static final String ACTION_MANAGE_DOMAIN_URLS = "android.settings.MANAGE_DOMAIN_URLS";
2376 
2377     /**
2378      * Activity Action: Show screen that let user select enable (or disable) tethering.
2379      * <p>
2380      * Input: Nothing.
2381      * <p>
2382      * Output: Nothing
2383      *
2384      * @hide
2385      */
2386     @SystemApi
2387     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2388     public static final String ACTION_TETHER_SETTINGS = "android.settings.TETHER_SETTINGS";
2389 
2390     /**
2391      * Activity Action: Show screen that lets user configure wifi tethering.
2392      * <p>
2393      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
2394      * <p>
2395      * Input: Nothing
2396      * <p>
2397      * Output: Nothing
2398      *
2399      * @hide
2400      */
2401     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2402     public static final String ACTION_WIFI_TETHER_SETTING =
2403             "com.android.settings.WIFI_TETHER_SETTINGS";
2404 
2405     /**
2406      * Broadcast to trigger notification of asking user to enable MMS.
2407      * Need to specify {@link #EXTRA_ENABLE_MMS_DATA_REQUEST_REASON} and {@link #EXTRA_SUB_ID}.
2408      *
2409      * @hide
2410      */
2411     @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
2412     public static final String ACTION_ENABLE_MMS_DATA_REQUEST =
2413             "android.settings.ENABLE_MMS_DATA_REQUEST";
2414 
2415     /**
2416      * Shows restrict settings dialog when settings is blocked.
2417      *
2418      * @hide
2419      */
2420     @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
2421     public static final String ACTION_SHOW_RESTRICTED_SETTING_DIALOG =
2422             "android.settings.SHOW_RESTRICTED_SETTING_DIALOG";
2423 
2424     /**
2425      * Integer value that specifies the reason triggering enable MMS data notification.
2426      * This must be passed as an extra field to the {@link #ACTION_ENABLE_MMS_DATA_REQUEST}.
2427      * Extra with value of EnableMmsDataReason interface.
2428      * @hide
2429      */
2430     public static final String EXTRA_ENABLE_MMS_DATA_REQUEST_REASON =
2431             "android.settings.extra.ENABLE_MMS_DATA_REQUEST_REASON";
2432 
2433     /** @hide */
2434     @Retention(RetentionPolicy.SOURCE)
2435     @IntDef(prefix = { "ENABLE_MMS_DATA_REQUEST_REASON_" }, value = {
2436             ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS,
2437             ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS,
2438     })
2439     public @interface EnableMmsDataReason{}
2440 
2441     /**
2442      * Requesting to enable MMS data because there's an incoming MMS.
2443      * @hide
2444      */
2445     public static final int ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS = 0;
2446 
2447     /**
2448      * Requesting to enable MMS data because user is sending MMS.
2449      * @hide
2450      */
2451     public static final int ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS = 1;
2452 
2453     /**
2454      * Activity Action: Show screen of a cellular subscription and highlight the
2455      * "enable MMS" toggle.
2456      * <p>
2457      * Input: {@link #EXTRA_SUB_ID}: Sub ID of the subscription.
2458      * <p>
2459      * Output: Nothing
2460      *
2461      * @hide
2462      */
2463     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2464     public static final String ACTION_MMS_MESSAGE_SETTING = "android.settings.MMS_MESSAGE_SETTING";
2465 
2466     /**
2467      * Activity Action: Show a screen of bedtime settings, which is provided by the wellbeing app.
2468      * <p>
2469      * The handler of this intent action may not exist.
2470      * <p>
2471      * To start an activity with this intent, apps should set the wellbeing package explicitly in
2472      * the intent together with this action. The wellbeing package is defined in
2473      * {@code com.android.internal.R.string.config_defaultWellbeingPackage}.
2474      * <p>
2475      * Output: Nothing
2476      *
2477      * @hide
2478      */
2479     @SystemApi
2480     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2481     public static final String ACTION_BEDTIME_SETTINGS = "android.settings.BEDTIME_SETTINGS";
2482 
2483     // End of Intent actions for Settings
2484 
2485     /**
2486      * @hide - Private call() method on SettingsProvider to read from 'system' table.
2487      */
2488     public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
2489 
2490     /**
2491      * @hide - Private call() method on SettingsProvider to read from 'secure' table.
2492      */
2493     public static final String CALL_METHOD_GET_SECURE = "GET_secure";
2494 
2495     /**
2496      * @hide - Private call() method on SettingsProvider to read from 'global' table.
2497      */
2498     public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
2499 
2500     /**
2501      * @hide - Private call() method on SettingsProvider to read from 'config' table.
2502      */
2503     public static final String CALL_METHOD_GET_CONFIG = "GET_config";
2504 
2505     /**
2506      * @hide - Specifies that the caller of the fast-path call()-based flow tracks
2507      * the settings generation in order to cache values locally. If this key is
2508      * mapped to a <code>null</code> string extra in the request bundle, the response
2509      * bundle will contain the same key mapped to a parcelable extra which would be
2510      * an {@link android.util.MemoryIntArray}. The response will also contain an
2511      * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the
2512      * index in the array clients should use to lookup the generation. For efficiency
2513      * the caller should request the generation tracking memory array only if it
2514      * doesn't already have it.
2515      *
2516      * @see #CALL_METHOD_GENERATION_INDEX_KEY
2517      */
2518     public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation";
2519 
2520     /**
2521      * @hide Key with the location in the {@link android.util.MemoryIntArray} where
2522      * to look up the generation id of the backing table. The value is an integer.
2523      *
2524      * @see #CALL_METHOD_TRACK_GENERATION_KEY
2525      */
2526     public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index";
2527 
2528     /**
2529      * @hide Key with the settings table generation. The value is an integer.
2530      *
2531      * @see #CALL_METHOD_TRACK_GENERATION_KEY
2532      */
2533     public static final String CALL_METHOD_GENERATION_KEY = "_generation";
2534 
2535     /**
2536      * @hide - User handle argument extra to the fast-path call()-based requests
2537      */
2538     public static final String CALL_METHOD_USER_KEY = "_user";
2539 
2540     /**
2541      * @hide - Boolean argument extra to the fast-path call()-based requests
2542      */
2543     public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default";
2544 
2545     /**
2546      * @hide - User handle argument extra to the fast-path call()-based requests
2547      */
2548     public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode";
2549 
2550     /**
2551      * @hide - String argument extra to the fast-path call()-based requests
2552      */
2553     public static final String CALL_METHOD_TAG_KEY = "_tag";
2554 
2555     /**
2556      * @hide - String argument extra to the fast-path call()-based requests
2557      */
2558     public static final String CALL_METHOD_PREFIX_KEY = "_prefix";
2559 
2560     /**
2561      * @hide - String argument extra to the fast-path call()-based requests
2562      */
2563     public static final String CALL_METHOD_SYNC_DISABLED_MODE_KEY = "_disabled_mode";
2564 
2565     /**
2566      * @hide - RemoteCallback monitor callback argument extra to the fast-path call()-based requests
2567      */
2568     public static final String CALL_METHOD_MONITOR_CALLBACK_KEY = "_monitor_callback_key";
2569 
2570     /**
2571      * @hide - String argument extra to the fast-path call()-based requests
2572      */
2573     public static final String CALL_METHOD_FLAGS_KEY = "_flags";
2574 
2575     /**
2576      * @hide - String argument extra to the fast-path call()-based requests
2577      */
2578     public static final String CALL_METHOD_OVERRIDEABLE_BY_RESTORE_KEY = "_overrideable_by_restore";
2579 
2580     /** @hide - Private call() method to write to 'system' table */
2581     public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
2582 
2583     /** @hide - Private call() method to write to 'secure' table */
2584     public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
2585 
2586     /** @hide - Private call() method to write to 'global' table */
2587     public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
2588 
2589     /** @hide - Private call() method to write to 'configuration' table */
2590     public static final String CALL_METHOD_PUT_CONFIG = "PUT_config";
2591 
2592     /** @hide - Private call() method to write to and delete from the 'configuration' table */
2593     public static final String CALL_METHOD_SET_ALL_CONFIG = "SET_ALL_config";
2594 
2595     /** @hide - Private call() method to delete from the 'system' table */
2596     public static final String CALL_METHOD_DELETE_SYSTEM = "DELETE_system";
2597 
2598     /** @hide - Private call() method to delete from the 'secure' table */
2599     public static final String CALL_METHOD_DELETE_SECURE = "DELETE_secure";
2600 
2601     /** @hide - Private call() method to delete from the 'global' table */
2602     public static final String CALL_METHOD_DELETE_GLOBAL = "DELETE_global";
2603 
2604     /** @hide - Private call() method to reset to defaults the 'configuration' table */
2605     public static final String CALL_METHOD_DELETE_CONFIG = "DELETE_config";
2606 
2607     /** @hide - Private call() method to reset to defaults the 'secure' table */
2608     public static final String CALL_METHOD_RESET_SECURE = "RESET_secure";
2609 
2610     /** @hide - Private call() method to reset to defaults the 'global' table */
2611     public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global";
2612 
2613     /** @hide - Private call() method to reset to defaults the 'configuration' table */
2614     public static final String CALL_METHOD_RESET_CONFIG = "RESET_config";
2615 
2616     /** @hide - Private call() method to query the 'system' table */
2617     public static final String CALL_METHOD_LIST_SYSTEM = "LIST_system";
2618 
2619     /** @hide - Private call() method to query the 'secure' table */
2620     public static final String CALL_METHOD_LIST_SECURE = "LIST_secure";
2621 
2622     /** @hide - Private call() method to query the 'global' table */
2623     public static final String CALL_METHOD_LIST_GLOBAL = "LIST_global";
2624 
2625     /** @hide - Private call() method to reset to defaults the 'configuration' table */
2626     public static final String CALL_METHOD_LIST_CONFIG = "LIST_config";
2627 
2628     /** @hide - Private call() method to disable / re-enable syncs to the 'configuration' table */
2629     public static final String CALL_METHOD_SET_SYNC_DISABLED_MODE_CONFIG =
2630             "SET_SYNC_DISABLED_MODE_config";
2631 
2632     /**
2633      * @hide - Private call() method to return the current mode of sync disabling for the
2634      * 'configuration' table
2635      */
2636     public static final String CALL_METHOD_GET_SYNC_DISABLED_MODE_CONFIG =
2637             "GET_SYNC_DISABLED_MODE_config";
2638 
2639     /** @hide - Private call() method to register monitor callback for 'configuration' table */
2640     public static final String CALL_METHOD_REGISTER_MONITOR_CALLBACK_CONFIG =
2641             "REGISTER_MONITOR_CALLBACK_config";
2642 
2643     /** @hide - String argument extra to the config monitor callback */
2644     public static final String EXTRA_MONITOR_CALLBACK_TYPE = "monitor_callback_type";
2645 
2646     /** @hide - String argument extra to the config monitor callback */
2647     public static final String EXTRA_ACCESS_CALLBACK = "access_callback";
2648 
2649     /** @hide - String argument extra to the config monitor callback */
2650     public static final String EXTRA_NAMESPACE_UPDATED_CALLBACK =
2651             "namespace_updated_callback";
2652 
2653     /** @hide - String argument extra to the config monitor callback */
2654     public static final String EXTRA_NAMESPACE = "namespace";
2655 
2656     /** @hide - String argument extra to the config monitor callback */
2657     public static final String EXTRA_CALLING_PACKAGE = "calling_package";
2658 
2659     /**
2660      * Activity Extra: Limit available options in launched activity based on the given authority.
2661      * <p>
2662      * This can be passed as an extra field in an Activity Intent with one or more syncable content
2663      * provider's authorities as a String[]. This field is used by some intents to alter the
2664      * behavior of the called activity.
2665      * <p>
2666      * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
2667      * on the authority given.
2668      */
2669     public static final String EXTRA_AUTHORITIES = "authorities";
2670 
2671     /**
2672      * Activity Extra: Limit available options in launched activity based on the given account
2673      * types.
2674      * <p>
2675      * This can be passed as an extra field in an Activity Intent with one or more account types
2676      * as a String[]. This field is used by some intents to alter the behavior of the called
2677      * activity.
2678      * <p>
2679      * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
2680      * list.
2681      */
2682     public static final String EXTRA_ACCOUNT_TYPES = "account_types";
2683 
2684     public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
2685 
2686     /**
2687      * Activity Extra: The device identifier to act upon.
2688      * <p>
2689      * This can be passed as an extra field in an Activity Intent with a single
2690      * InputDeviceIdentifier. This field is used by some activities to jump straight into the
2691      * settings for the given device.
2692      * <p>
2693      * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
2694      * dialog for the given device.
2695      * @hide
2696      */
2697     public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
2698 
2699     /**
2700      * Activity Extra: Enable or disable Airplane Mode.
2701      * <p>
2702      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
2703      * intent as a boolean to indicate if it should be enabled.
2704      */
2705     public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
2706 
2707     /**
2708      * Activity Extra: Enable or disable Battery saver mode.
2709      * <p>
2710      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
2711      * intent as a boolean to indicate if it should be enabled.
2712      */
2713     public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
2714             "android.settings.extra.battery_saver_mode_enabled";
2715 
2716     /**
2717      * Activity Extra: Enable or disable Do Not Disturb mode.
2718      * <p>
2719      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
2720      * intent as a boolean to indicate if it should be enabled.
2721      */
2722     public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
2723             "android.settings.extra.do_not_disturb_mode_enabled";
2724 
2725     /**
2726      * Activity Extra: How many minutes to enable do not disturb mode for.
2727      * <p>
2728      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
2729      * intent to indicate how long do not disturb mode should be enabled for.
2730      */
2731     public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
2732             "android.settings.extra.do_not_disturb_mode_minutes";
2733 
2734     /**
2735      * Reset mode: reset to defaults only settings changed by the
2736      * calling package. If there is a default set the setting
2737      * will be set to it, otherwise the setting will be deleted.
2738      * This is the only type of reset available to non-system clients.
2739      * @hide
2740      */
2741     @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
2742     @TestApi
2743     public static final int RESET_MODE_PACKAGE_DEFAULTS = 1;
2744 
2745     /**
2746      * Reset mode: reset all settings set by untrusted packages, which is
2747      * packages that aren't a part of the system, to the current defaults.
2748      * If there is a default set the setting will be set to it, otherwise
2749      * the setting will be deleted. This mode is only available to the system.
2750      * @hide
2751      */
2752     public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2;
2753 
2754     /**
2755      * Reset mode: delete all settings set by untrusted packages, which is
2756      * packages that aren't a part of the system. If a setting is set by an
2757      * untrusted package it will be deleted if its default is not provided
2758      * by the system, otherwise the setting will be set to its default.
2759      * This mode is only available to the system.
2760      * @hide
2761      */
2762     public static final int RESET_MODE_UNTRUSTED_CHANGES = 3;
2763 
2764     /**
2765      * Reset mode: reset all settings to defaults specified by trusted
2766      * packages, which is packages that are a part of the system, and
2767      * delete all settings set by untrusted packages. If a setting has
2768      * a default set by a system package it will be set to the default,
2769      * otherwise the setting will be deleted. This mode is only available
2770      * to the system.
2771      * @hide
2772      */
2773     public static final int RESET_MODE_TRUSTED_DEFAULTS = 4;
2774 
2775     /** @hide */
2776     @Retention(RetentionPolicy.SOURCE)
2777     @IntDef(prefix = { "RESET_MODE_" }, value = {
2778             RESET_MODE_PACKAGE_DEFAULTS,
2779             RESET_MODE_UNTRUSTED_DEFAULTS,
2780             RESET_MODE_UNTRUSTED_CHANGES,
2781             RESET_MODE_TRUSTED_DEFAULTS
2782     })
2783     public @interface ResetMode{}
2784 
2785     /**
2786      * Activity Extra: Number of certificates
2787      * <p>
2788      * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO}
2789      * intent to indicate the number of certificates
2790      * @hide
2791      */
2792     public static final String EXTRA_NUMBER_OF_CERTIFICATES =
2793             "android.settings.extra.number_of_certificates";
2794 
2795     private static final String SYSTEM_PACKAGE_NAME = "android";
2796 
2797     public static final String AUTHORITY = "settings";
2798 
2799     private static final String TAG = "Settings";
2800     private static final boolean LOCAL_LOGV = false;
2801 
2802     // Used in system server calling uid workaround in call()
2803     private static boolean sInSystemServer = false;
2804     private static final Object sInSystemServerLock = new Object();
2805 
2806     /** @hide */
setInSystemServer()2807     public static void setInSystemServer() {
2808         synchronized (sInSystemServerLock) {
2809             sInSystemServer = true;
2810         }
2811     }
2812 
2813     /** @hide */
isInSystemServer()2814     public static boolean isInSystemServer() {
2815         synchronized (sInSystemServerLock) {
2816             return sInSystemServer;
2817         }
2818     }
2819 
2820     public static class SettingNotFoundException extends AndroidException {
SettingNotFoundException(String msg)2821         public SettingNotFoundException(String msg) {
2822             super(msg);
2823         }
2824     }
2825 
2826     /**
2827      * Common base for tables of name/value settings.
2828      */
2829     public static class NameValueTable implements BaseColumns {
2830         public static final String NAME = "name";
2831         public static final String VALUE = "value";
2832         // A flag indicating whether the current value of a setting should be preserved during
2833         // restore.
2834         /** @hide */
2835         public static final String IS_PRESERVED_IN_RESTORE = "is_preserved_in_restore";
2836 
putString(ContentResolver resolver, Uri uri, String name, String value)2837         protected static boolean putString(ContentResolver resolver, Uri uri,
2838                 String name, String value) {
2839             // The database will take care of replacing duplicates.
2840             try {
2841                 ContentValues values = new ContentValues();
2842                 values.put(NAME, name);
2843                 values.put(VALUE, value);
2844                 resolver.insert(uri, values);
2845                 return true;
2846             } catch (SQLException e) {
2847                 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
2848                 return false;
2849             }
2850         }
2851 
getUriFor(Uri uri, String name)2852         public static Uri getUriFor(Uri uri, String name) {
2853             return Uri.withAppendedPath(uri, name);
2854         }
2855     }
2856 
2857     private static final class GenerationTracker {
2858         private final MemoryIntArray mArray;
2859         private final Runnable mErrorHandler;
2860         private final int mIndex;
2861         private int mCurrentGeneration;
2862 
GenerationTracker(@onNull MemoryIntArray array, int index, int generation, Runnable errorHandler)2863         public GenerationTracker(@NonNull MemoryIntArray array, int index,
2864                 int generation, Runnable errorHandler) {
2865             mArray = array;
2866             mIndex = index;
2867             mErrorHandler = errorHandler;
2868             mCurrentGeneration = generation;
2869         }
2870 
isGenerationChanged()2871         public boolean isGenerationChanged() {
2872             final int currentGeneration = readCurrentGeneration();
2873             if (currentGeneration >= 0) {
2874                 if (currentGeneration == mCurrentGeneration) {
2875                     return false;
2876                 }
2877                 mCurrentGeneration = currentGeneration;
2878             }
2879             return true;
2880         }
2881 
getCurrentGeneration()2882         public int getCurrentGeneration() {
2883             return mCurrentGeneration;
2884         }
2885 
readCurrentGeneration()2886         private int readCurrentGeneration() {
2887             try {
2888                 return mArray.get(mIndex);
2889             } catch (IOException e) {
2890                 Log.e(TAG, "Error getting current generation", e);
2891                 if (mErrorHandler != null) {
2892                     mErrorHandler.run();
2893                 }
2894             }
2895             return -1;
2896         }
2897 
destroy()2898         public void destroy() {
2899             try {
2900                 mArray.close();
2901             } catch (IOException e) {
2902                 Log.e(TAG, "Error closing backing array", e);
2903                 if (mErrorHandler != null) {
2904                     mErrorHandler.run();
2905                 }
2906             }
2907         }
2908     }
2909 
2910     private static final class ContentProviderHolder {
2911         private final Object mLock = new Object();
2912 
2913         private final Uri mUri;
2914         @GuardedBy("mLock")
2915         @UnsupportedAppUsage
2916         private IContentProvider mContentProvider;
2917 
ContentProviderHolder(Uri uri)2918         public ContentProviderHolder(Uri uri) {
2919             mUri = uri;
2920         }
2921 
getProvider(ContentResolver contentResolver)2922         public IContentProvider getProvider(ContentResolver contentResolver) {
2923             synchronized (mLock) {
2924                 if (mContentProvider == null) {
2925                     mContentProvider = contentResolver
2926                             .acquireProvider(mUri.getAuthority());
2927                 }
2928                 return mContentProvider;
2929             }
2930         }
2931 
clearProviderForTest()2932         public void clearProviderForTest() {
2933             synchronized (mLock) {
2934                 mContentProvider = null;
2935             }
2936         }
2937     }
2938 
2939     // Thread-safe.
2940     private static class NameValueCache {
2941         private static final boolean DEBUG = false;
2942 
2943         private static final String[] SELECT_VALUE_PROJECTION = new String[] {
2944                 Settings.NameValueTable.VALUE
2945         };
2946 
2947         private static final String NAME_EQ_PLACEHOLDER = "name=?";
2948 
2949         // Must synchronize on 'this' to access mValues and mValuesVersion.
2950         private final ArrayMap<String, String> mValues = new ArrayMap<>();
2951 
2952         private final Uri mUri;
2953         @UnsupportedAppUsage
2954         private final ContentProviderHolder mProviderHolder;
2955 
2956         // The method we'll call (or null, to not use) on the provider
2957         // for the fast path of retrieving settings.
2958         private final String mCallGetCommand;
2959         private final String mCallSetCommand;
2960         private final String mCallDeleteCommand;
2961         private final String mCallListCommand;
2962         private final String mCallSetAllCommand;
2963 
2964         private final ArraySet<String> mReadableFields;
2965         private final ArraySet<String> mAllFields;
2966         private final ArrayMap<String, Integer> mReadableFieldsWithMaxTargetSdk;
2967 
2968         @GuardedBy("this")
2969         private GenerationTracker mGenerationTracker;
2970 
NameValueCache(Uri uri, String getCommand, String setCommand, String deleteCommand, ContentProviderHolder providerHolder, Class<T> callerClass)2971         <T extends NameValueTable> NameValueCache(Uri uri, String getCommand,
2972                 String setCommand, String deleteCommand, ContentProviderHolder providerHolder,
2973                 Class<T> callerClass) {
2974             this(uri, getCommand, setCommand, deleteCommand, null, null, providerHolder,
2975                     callerClass);
2976         }
2977 
NameValueCache(Uri uri, String getCommand, String setCommand, String deleteCommand, String listCommand, String setAllCommand, ContentProviderHolder providerHolder, Class<T> callerClass)2978         private <T extends NameValueTable> NameValueCache(Uri uri, String getCommand,
2979                 String setCommand, String deleteCommand, String listCommand, String setAllCommand,
2980                 ContentProviderHolder providerHolder, Class<T> callerClass) {
2981             mUri = uri;
2982             mCallGetCommand = getCommand;
2983             mCallSetCommand = setCommand;
2984             mCallDeleteCommand = deleteCommand;
2985             mCallListCommand = listCommand;
2986             mCallSetAllCommand = setAllCommand;
2987             mProviderHolder = providerHolder;
2988             mReadableFields = new ArraySet<>();
2989             mAllFields = new ArraySet<>();
2990             mReadableFieldsWithMaxTargetSdk = new ArrayMap<>();
2991             getPublicSettingsForClass(callerClass, mAllFields, mReadableFields,
2992                     mReadableFieldsWithMaxTargetSdk);
2993         }
2994 
putStringForUser(ContentResolver cr, String name, String value, String tag, boolean makeDefault, final int userHandle, boolean overrideableByRestore)2995         public boolean putStringForUser(ContentResolver cr, String name, String value,
2996                 String tag, boolean makeDefault, final int userHandle,
2997                 boolean overrideableByRestore) {
2998             try {
2999                 Bundle arg = new Bundle();
3000                 arg.putString(Settings.NameValueTable.VALUE, value);
3001                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
3002                 if (tag != null) {
3003                     arg.putString(CALL_METHOD_TAG_KEY, tag);
3004                 }
3005                 if (makeDefault) {
3006                     arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true);
3007                 }
3008                 if (overrideableByRestore) {
3009                     arg.putBoolean(CALL_METHOD_OVERRIDEABLE_BY_RESTORE_KEY, true);
3010                 }
3011                 IContentProvider cp = mProviderHolder.getProvider(cr);
3012                 cp.call(cr.getAttributionSource(),
3013                         mProviderHolder.mUri.getAuthority(), mCallSetCommand, name, arg);
3014             } catch (RemoteException e) {
3015                 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
3016                 return false;
3017             }
3018             return true;
3019         }
3020 
setStringsForPrefix(ContentResolver cr, String prefix, HashMap<String, String> keyValues)3021         public @SetAllResult int setStringsForPrefix(ContentResolver cr, String prefix,
3022                 HashMap<String, String> keyValues) {
3023             if (mCallSetAllCommand == null) {
3024                 // This NameValueCache does not support atomically setting multiple flags
3025                 return SET_ALL_RESULT_FAILURE;
3026             }
3027             try {
3028                 Bundle args = new Bundle();
3029                 args.putString(CALL_METHOD_PREFIX_KEY, prefix);
3030                 args.putSerializable(CALL_METHOD_FLAGS_KEY, keyValues);
3031                 IContentProvider cp = mProviderHolder.getProvider(cr);
3032                 Bundle bundle = cp.call(cr.getAttributionSource(),
3033                         mProviderHolder.mUri.getAuthority(),
3034                         mCallSetAllCommand, null, args);
3035                 return bundle.getInt(KEY_CONFIG_SET_ALL_RETURN);
3036             } catch (RemoteException e) {
3037                 // Not supported by the remote side
3038                 return SET_ALL_RESULT_FAILURE;
3039             }
3040         }
3041 
deleteStringForUser(ContentResolver cr, String name, final int userHandle)3042         public boolean deleteStringForUser(ContentResolver cr, String name, final int userHandle) {
3043             try {
3044                 Bundle arg = new Bundle();
3045                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
3046                 IContentProvider cp = mProviderHolder.getProvider(cr);
3047                 cp.call(cr.getAttributionSource(),
3048                         mProviderHolder.mUri.getAuthority(), mCallDeleteCommand, name, arg);
3049             } catch (RemoteException e) {
3050                 Log.w(TAG, "Can't delete key " + name + " in " + mUri, e);
3051                 return false;
3052             }
3053             return true;
3054         }
3055 
3056         @UnsupportedAppUsage
getStringForUser(ContentResolver cr, String name, final int userHandle)3057         public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
3058             // Check if the target settings key is readable. Reject if the caller is not system and
3059             // is trying to access a settings key defined in the Settings.Secure, Settings.System or
3060             // Settings.Global and is not annotated as @Readable.
3061             // Notice that a key string that is not defined in any of the Settings.* classes will
3062             // still be regarded as readable.
3063             if (!isCallerExemptFromReadableRestriction() && mAllFields.contains(name)) {
3064                 if (!mReadableFields.contains(name)) {
3065                     throw new SecurityException(
3066                             "Settings key: <" + name + "> is not readable. From S+, settings keys "
3067                                     + "annotated with @hide are restricted to system_server and "
3068                                     + "system apps only, unless they are annotated with @Readable."
3069                     );
3070                 } else {
3071                     // When the target settings key has @Readable annotation, if the caller app's
3072                     // target sdk is higher than the maxTargetSdk of the annotation, reject access.
3073                     if (mReadableFieldsWithMaxTargetSdk.containsKey(name)) {
3074                         final int maxTargetSdk = mReadableFieldsWithMaxTargetSdk.get(name);
3075                         final Application application = ActivityThread.currentApplication();
3076                         final boolean targetSdkCheckOk = application != null
3077                                 && application.getApplicationInfo() != null
3078                                 && application.getApplicationInfo().targetSdkVersion
3079                                 <= maxTargetSdk;
3080                         if (!targetSdkCheckOk) {
3081                             throw new SecurityException(
3082                                     "Settings key: <" + name + "> is only readable to apps with "
3083                                             + "targetSdkVersion lower than or equal to: "
3084                                             + maxTargetSdk
3085                             );
3086                         }
3087                     }
3088                 }
3089             }
3090 
3091             final boolean isSelf = (userHandle == UserHandle.myUserId());
3092             int currentGeneration = -1;
3093             if (isSelf) {
3094                 synchronized (NameValueCache.this) {
3095                     if (mGenerationTracker != null) {
3096                         if (mGenerationTracker.isGenerationChanged()) {
3097                             if (DEBUG) {
3098                                 Log.i(TAG, "Generation changed for type:"
3099                                         + mUri.getPath() + " in package:"
3100                                         + cr.getPackageName() +" and user:" + userHandle);
3101                             }
3102                             mValues.clear();
3103                         } else if (mValues.containsKey(name)) {
3104                             return mValues.get(name);
3105                         }
3106                         if (mGenerationTracker != null) {
3107                             currentGeneration = mGenerationTracker.getCurrentGeneration();
3108                         }
3109                     }
3110                 }
3111             } else {
3112                 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
3113                         + " by user " + UserHandle.myUserId() + " so skipping cache");
3114             }
3115 
3116             IContentProvider cp = mProviderHolder.getProvider(cr);
3117 
3118             // Try the fast path first, not using query().  If this
3119             // fails (alternate Settings provider that doesn't support
3120             // this interface?) then we fall back to the query/table
3121             // interface.
3122             if (mCallGetCommand != null) {
3123                 try {
3124                     Bundle args = null;
3125                     if (!isSelf) {
3126                         args = new Bundle();
3127                         args.putInt(CALL_METHOD_USER_KEY, userHandle);
3128                     }
3129                     boolean needsGenerationTracker = false;
3130                     synchronized (NameValueCache.this) {
3131                         if (isSelf && mGenerationTracker == null) {
3132                             needsGenerationTracker = true;
3133                             if (args == null) {
3134                                 args = new Bundle();
3135                             }
3136                             args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
3137                             if (DEBUG) {
3138                                 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath()
3139                                         + " in package:" + cr.getPackageName() +" and user:"
3140                                         + userHandle);
3141                             }
3142                         }
3143                     }
3144                     Bundle b;
3145                     // If we're in system server and in a binder transaction we need to clear the
3146                     // calling uid. This works around code in system server that did not call
3147                     // clearCallingIdentity, previously this wasn't needed because reading settings
3148                     // did not do permission checking but thats no longer the case.
3149                     // Long term this should be removed and callers should properly call
3150                     // clearCallingIdentity or use a ContentResolver from the caller as needed.
3151                     if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
3152                         final long token = Binder.clearCallingIdentity();
3153                         try {
3154                             b = cp.call(cr.getAttributionSource(),
3155                                     mProviderHolder.mUri.getAuthority(), mCallGetCommand, name,
3156                                     args);
3157                         } finally {
3158                             Binder.restoreCallingIdentity(token);
3159                         }
3160                     } else {
3161                         b = cp.call(cr.getAttributionSource(),
3162                                 mProviderHolder.mUri.getAuthority(), mCallGetCommand, name, args);
3163                     }
3164                     if (b != null) {
3165                         String value = b.getString(Settings.NameValueTable.VALUE);
3166                         // Don't update our cache for reads of other users' data
3167                         if (isSelf) {
3168                             synchronized (NameValueCache.this) {
3169                                 if (needsGenerationTracker) {
3170                                     MemoryIntArray array = b.getParcelable(
3171                                             CALL_METHOD_TRACK_GENERATION_KEY);
3172                                     final int index = b.getInt(
3173                                             CALL_METHOD_GENERATION_INDEX_KEY, -1);
3174                                     if (array != null && index >= 0) {
3175                                         final int generation = b.getInt(
3176                                                 CALL_METHOD_GENERATION_KEY, 0);
3177                                         if (DEBUG) {
3178                                             Log.i(TAG, "Received generation tracker for type:"
3179                                                     + mUri.getPath() + " in package:"
3180                                                     + cr.getPackageName() + " and user:"
3181                                                     + userHandle + " with index:" + index);
3182                                         }
3183                                         if (mGenerationTracker != null) {
3184                                             mGenerationTracker.destroy();
3185                                         }
3186                                         mGenerationTracker = new GenerationTracker(array, index,
3187                                                 generation, () -> {
3188                                             synchronized (NameValueCache.this) {
3189                                                 Log.e(TAG, "Error accessing generation"
3190                                                         + " tracker - removing");
3191                                                 if (mGenerationTracker != null) {
3192                                                     GenerationTracker generationTracker =
3193                                                             mGenerationTracker;
3194                                                     mGenerationTracker = null;
3195                                                     generationTracker.destroy();
3196                                                     mValues.clear();
3197                                                 }
3198                                             }
3199                                         });
3200                                         currentGeneration = generation;
3201                                     }
3202                                 }
3203                                 if (mGenerationTracker != null && currentGeneration ==
3204                                         mGenerationTracker.getCurrentGeneration()) {
3205                                     mValues.put(name, value);
3206                                 }
3207                             }
3208                         } else {
3209                             if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
3210                                     + " by " + UserHandle.myUserId()
3211                                     + " so not updating cache");
3212                         }
3213                         return value;
3214                     }
3215                     // If the response Bundle is null, we fall through
3216                     // to the query interface below.
3217                 } catch (RemoteException e) {
3218                     // Not supported by the remote side?  Fall through
3219                     // to query().
3220                 }
3221             }
3222 
3223             Cursor c = null;
3224             try {
3225                 Bundle queryArgs = ContentResolver.createSqlQueryBundle(
3226                         NAME_EQ_PLACEHOLDER, new String[]{name}, null);
3227                 // Same workaround as above.
3228                 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
3229                     final long token = Binder.clearCallingIdentity();
3230                     try {
3231                         c = cp.query(cr.getAttributionSource(), mUri,
3232                                 SELECT_VALUE_PROJECTION, queryArgs, null);
3233                     } finally {
3234                         Binder.restoreCallingIdentity(token);
3235                     }
3236                 } else {
3237                     c = cp.query(cr.getAttributionSource(), mUri,
3238                             SELECT_VALUE_PROJECTION, queryArgs, null);
3239                 }
3240                 if (c == null) {
3241                     Log.w(TAG, "Can't get key " + name + " from " + mUri);
3242                     return null;
3243                 }
3244 
3245                 String value = c.moveToNext() ? c.getString(0) : null;
3246                 synchronized (NameValueCache.this) {
3247                     if (mGenerationTracker != null
3248                             && currentGeneration == mGenerationTracker.getCurrentGeneration()) {
3249                         mValues.put(name, value);
3250                     }
3251                 }
3252                 if (LOCAL_LOGV) {
3253                     Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
3254                             name + " = " + (value == null ? "(null)" : value));
3255                 }
3256                 return value;
3257             } catch (RemoteException e) {
3258                 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
3259                 return null;  // Return null, but don't cache it.
3260             } finally {
3261                 if (c != null) c.close();
3262             }
3263         }
3264 
isCallerExemptFromReadableRestriction()3265         private static boolean isCallerExemptFromReadableRestriction() {
3266             if (Settings.isInSystemServer()) {
3267                 return true;
3268             }
3269             if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) {
3270                 return true;
3271             }
3272             final Application application = ActivityThread.currentApplication();
3273             if (application == null || application.getApplicationInfo() == null) {
3274                 return false;
3275             }
3276             final ApplicationInfo applicationInfo = application.getApplicationInfo();
3277             final boolean isTestOnly =
3278                     (applicationInfo.flags & ApplicationInfo.FLAG_TEST_ONLY) != 0;
3279             return isTestOnly || applicationInfo.isSystemApp() || applicationInfo.isPrivilegedApp()
3280                     || applicationInfo.isSignedWithPlatformKey();
3281         }
3282 
getStringsForPrefix(ContentResolver cr, String prefix, List<String> names)3283         public ArrayMap<String, String> getStringsForPrefix(ContentResolver cr, String prefix,
3284                 List<String> names) {
3285             String namespace = prefix.substring(0, prefix.length() - 1);
3286             DeviceConfig.enforceReadPermission(ActivityThread.currentApplication(), namespace);
3287             ArrayMap<String, String> keyValues = new ArrayMap<>();
3288             int currentGeneration = -1;
3289 
3290             synchronized (NameValueCache.this) {
3291                 if (mGenerationTracker != null) {
3292                     if (mGenerationTracker.isGenerationChanged()) {
3293                         if (DEBUG) {
3294                             Log.i(TAG, "Generation changed for type:" + mUri.getPath()
3295                                     + " in package:" + cr.getPackageName());
3296                         }
3297                         mValues.clear();
3298                     } else {
3299                         boolean prefixCached = mValues.containsKey(prefix);
3300                         if (prefixCached) {
3301                             if (!names.isEmpty()) {
3302                                 for (String name : names) {
3303                                     if (mValues.containsKey(name)) {
3304                                         keyValues.put(name, mValues.get(name));
3305                                     }
3306                                 }
3307                             } else {
3308                                 for (int i = 0; i < mValues.size(); ++i) {
3309                                     String key = mValues.keyAt(i);
3310                                     // Explicitly exclude the prefix as it is only there to
3311                                     // signal that the prefix has been cached.
3312                                     if (key.startsWith(prefix) && !key.equals(prefix)) {
3313                                         keyValues.put(key, mValues.get(key));
3314                                     }
3315                                 }
3316                             }
3317                             return keyValues;
3318                         }
3319                     }
3320                     if (mGenerationTracker != null) {
3321                         currentGeneration = mGenerationTracker.getCurrentGeneration();
3322                     }
3323                 }
3324             }
3325 
3326             if (mCallListCommand == null) {
3327                 // No list command specified, return empty map
3328                 return keyValues;
3329             }
3330             IContentProvider cp = mProviderHolder.getProvider(cr);
3331 
3332             try {
3333                 Bundle args = new Bundle();
3334                 args.putString(Settings.CALL_METHOD_PREFIX_KEY, prefix);
3335                 boolean needsGenerationTracker = false;
3336                 synchronized (NameValueCache.this) {
3337                     if (mGenerationTracker == null) {
3338                         needsGenerationTracker = true;
3339                         args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
3340                         if (DEBUG) {
3341                             Log.i(TAG, "Requested generation tracker for type: "
3342                                     + mUri.getPath() + " in package:" + cr.getPackageName());
3343                         }
3344                     }
3345                 }
3346 
3347                 Bundle b;
3348                 // b/252663068: if we're in system server and the caller did not call
3349                 // clearCallingIdentity, the read would fail due to mismatched AttributionSources.
3350                 // TODO(b/256013480): remove this bypass after fixing the callers in system server.
3351                 if (namespace.equals(DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER)
3352                         && Settings.isInSystemServer()
3353                         && Binder.getCallingUid() != Process.myUid()) {
3354                     final long token = Binder.clearCallingIdentity();
3355                     try {
3356                         // Fetch all flags for the namespace at once for caching purposes
3357                         b = cp.call(cr.getAttributionSource(),
3358                                 mProviderHolder.mUri.getAuthority(), mCallListCommand, null, args);
3359                     } finally {
3360                         Binder.restoreCallingIdentity(token);
3361                     }
3362                 } else {
3363                     // Fetch all flags for the namespace at once for caching purposes
3364                     b = cp.call(cr.getAttributionSource(),
3365                             mProviderHolder.mUri.getAuthority(), mCallListCommand, null, args);
3366                 }
3367                 if (b == null) {
3368                     // Invalid response, return an empty map
3369                     return keyValues;
3370                 }
3371 
3372                 // All flags for the namespace
3373                 Map<String, String> flagsToValues =
3374                         (HashMap) b.getSerializable(Settings.NameValueTable.VALUE);
3375                 // Only the flags requested by the caller
3376                 if (!names.isEmpty()) {
3377                     for (Map.Entry<String, String> flag : flagsToValues.entrySet()) {
3378                         if (names.contains(flag.getKey())) {
3379                             keyValues.put(flag.getKey(), flag.getValue());
3380                         }
3381                     }
3382                 } else {
3383                     keyValues.putAll(flagsToValues);
3384                 }
3385 
3386                 synchronized (NameValueCache.this) {
3387                     if (needsGenerationTracker) {
3388                         MemoryIntArray array = b.getParcelable(
3389                                 CALL_METHOD_TRACK_GENERATION_KEY);
3390                         final int index = b.getInt(
3391                                 CALL_METHOD_GENERATION_INDEX_KEY, -1);
3392                         if (array != null && index >= 0) {
3393                             final int generation = b.getInt(
3394                                     CALL_METHOD_GENERATION_KEY, 0);
3395                             if (DEBUG) {
3396                                 Log.i(TAG, "Received generation tracker for type:"
3397                                         + mUri.getPath() + " in package:"
3398                                         + cr.getPackageName() + " with index:" + index);
3399                             }
3400                             if (mGenerationTracker != null) {
3401                                 mGenerationTracker.destroy();
3402                             }
3403                             mGenerationTracker = new GenerationTracker(array, index,
3404                                     generation, () -> {
3405                                 synchronized (NameValueCache.this) {
3406                                     Log.e(TAG, "Error accessing generation tracker"
3407                                             + " - removing");
3408                                     if (mGenerationTracker != null) {
3409                                         GenerationTracker generationTracker =
3410                                                 mGenerationTracker;
3411                                         mGenerationTracker = null;
3412                                         generationTracker.destroy();
3413                                         mValues.clear();
3414                                     }
3415                                 }
3416                             });
3417                             currentGeneration = generation;
3418                         }
3419                     }
3420                     if (mGenerationTracker != null && currentGeneration
3421                             == mGenerationTracker.getCurrentGeneration()) {
3422                         // cache the complete list of flags for the namespace
3423                         mValues.putAll(flagsToValues);
3424                         // Adding the prefix as a signal that the prefix is cached.
3425                         mValues.put(prefix, null);
3426                     }
3427                 }
3428                 return keyValues;
3429             } catch (RemoteException e) {
3430                 // Not supported by the remote side, return an empty map
3431                 return keyValues;
3432             }
3433         }
3434 
clearGenerationTrackerForTest()3435         public void clearGenerationTrackerForTest() {
3436             synchronized (NameValueCache.this) {
3437                 if (mGenerationTracker != null) {
3438                     mGenerationTracker.destroy();
3439                 }
3440                 mValues.clear();
3441                 mGenerationTracker = null;
3442             }
3443         }
3444     }
3445 
3446     /**
3447      * Checks if the specified context can draw on top of other apps. As of API
3448      * level 23, an app cannot draw on top of other apps unless it declares the
3449      * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its
3450      * manifest, <em>and</em> the user specifically grants the app this
3451      * capability. To prompt the user to grant this approval, the app must send an
3452      * intent with the action
3453      * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which
3454      * causes the system to display a permission management screen.
3455      *
3456      * @param context App context.
3457      * @return true if the specified context can draw on top of other apps, false otherwise
3458      */
canDrawOverlays(Context context)3459     public static boolean canDrawOverlays(Context context) {
3460         return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(),
3461                 context.getOpPackageName(), false) || context.checkSelfPermission(
3462                 Manifest.permission.SYSTEM_APPLICATION_OVERLAY)
3463                 == PackageManager.PERMISSION_GRANTED;
3464     }
3465 
3466     /**
3467      * This annotation indicates that the value of a setting is allowed to be read
3468      * with the get* methods. The following settings should be readable:
3469      * 1) all the public settings
3470      * 2) all the hidden settings added before S
3471      */
3472     @Target({ ElementType.FIELD })
3473     @Retention(RetentionPolicy.RUNTIME)
3474     private @interface Readable {
maxTargetSdk()3475         int maxTargetSdk() default 0;
3476     }
3477 
getPublicSettingsForClass( Class<T> callerClass, Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> keysWithMaxTargetSdk)3478     private static <T extends NameValueTable> void getPublicSettingsForClass(
3479             Class<T> callerClass, Set<String> allKeys, Set<String> readableKeys,
3480             ArrayMap<String, Integer> keysWithMaxTargetSdk) {
3481         final Field[] allFields = callerClass.getDeclaredFields();
3482         try {
3483             for (int i = 0; i < allFields.length; i++) {
3484                 final Field field = allFields[i];
3485                 if (!field.getType().equals(String.class)) {
3486                     continue;
3487                 }
3488                 final Object value = field.get(callerClass);
3489                 if (!value.getClass().equals(String.class)) {
3490                     continue;
3491                 }
3492                 allKeys.add((String) value);
3493                 final Readable annotation = field.getAnnotation(Readable.class);
3494 
3495                 if (annotation != null) {
3496                     final String key = (String) value;
3497                     final int maxTargetSdk = annotation.maxTargetSdk();
3498                     readableKeys.add(key);
3499                     if (maxTargetSdk != 0) {
3500                         keysWithMaxTargetSdk.put(key, maxTargetSdk);
3501                     }
3502                 }
3503             }
3504         } catch (IllegalAccessException ignored) {
3505         }
3506     }
3507 
parseFloatSetting(String settingValue, String settingName)3508     private static float parseFloatSetting(String settingValue, String settingName)
3509             throws SettingNotFoundException {
3510         if (settingValue == null) {
3511             throw new SettingNotFoundException(settingName);
3512         }
3513         try {
3514             return Float.parseFloat(settingValue);
3515         } catch (NumberFormatException e) {
3516             throw new SettingNotFoundException(settingName);
3517         }
3518     }
3519 
parseFloatSettingWithDefault(String settingValue, float defaultValue)3520     private static float parseFloatSettingWithDefault(String settingValue, float defaultValue) {
3521         try {
3522             return settingValue != null ? Float.parseFloat(settingValue) : defaultValue;
3523         } catch (NumberFormatException e) {
3524             return defaultValue;
3525         }
3526     }
3527 
parseIntSetting(String settingValue, String settingName)3528     private static int parseIntSetting(String settingValue, String settingName)
3529             throws SettingNotFoundException {
3530         if (settingValue == null) {
3531             throw new SettingNotFoundException(settingName);
3532         }
3533         try {
3534             return Integer.parseInt(settingValue);
3535         } catch (NumberFormatException e) {
3536             throw new SettingNotFoundException(settingName);
3537         }
3538     }
3539 
parseIntSettingWithDefault(String settingValue, int defaultValue)3540     private static int parseIntSettingWithDefault(String settingValue, int defaultValue) {
3541         try {
3542             return settingValue != null ? Integer.parseInt(settingValue) : defaultValue;
3543         } catch (NumberFormatException e) {
3544             return defaultValue;
3545         }
3546     }
3547 
parseLongSetting(String settingValue, String settingName)3548     private static long parseLongSetting(String settingValue, String settingName)
3549             throws SettingNotFoundException {
3550         if (settingValue == null) {
3551             throw new SettingNotFoundException(settingName);
3552         }
3553         try {
3554             return Long.parseLong(settingValue);
3555         } catch (NumberFormatException e) {
3556             throw new SettingNotFoundException(settingName);
3557         }
3558     }
3559 
parseLongSettingWithDefault(String settingValue, long defaultValue)3560     private static long parseLongSettingWithDefault(String settingValue, long defaultValue) {
3561         try {
3562             return settingValue != null ? Long.parseLong(settingValue) : defaultValue;
3563         } catch (NumberFormatException e) {
3564             return defaultValue;
3565         }
3566     }
3567 
3568     /**
3569      * System settings, containing miscellaneous system preferences.  This
3570      * table holds simple name/value pairs.  There are convenience
3571      * functions for accessing individual settings entries.
3572      */
3573     public static final class System extends NameValueTable {
3574         // NOTE: If you add new settings here, be sure to add them to
3575         // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked.
3576 
3577         private static final float DEFAULT_FONT_SCALE = 1.0f;
3578         private static final int DEFAULT_FONT_WEIGHT = 0;
3579 
3580         /**
3581          * The content:// style URL for this table
3582          */
3583         public static final Uri CONTENT_URI =
3584             Uri.parse("content://" + AUTHORITY + "/system");
3585 
3586         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
3587         private static final ContentProviderHolder sProviderHolder =
3588                 new ContentProviderHolder(CONTENT_URI);
3589 
3590         @UnsupportedAppUsage
3591         private static final NameValueCache sNameValueCache = new NameValueCache(
3592                 CONTENT_URI,
3593                 CALL_METHOD_GET_SYSTEM,
3594                 CALL_METHOD_PUT_SYSTEM,
3595                 CALL_METHOD_DELETE_SYSTEM,
3596                 sProviderHolder,
3597                 System.class);
3598 
3599         @UnsupportedAppUsage
3600         private static final HashSet<String> MOVED_TO_SECURE;
3601         static {
3602             MOVED_TO_SECURE = new HashSet<>(30);
3603             MOVED_TO_SECURE.add(Secure.ADAPTIVE_SLEEP);
3604             MOVED_TO_SECURE.add(Secure.ANDROID_ID);
3605             MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
3606             MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
3607             MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
3608             MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
3609             MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
3610             MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
3611             MOVED_TO_SECURE.add(Secure.LOGGING_ID);
3612             MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
3613             MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
3614             MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
3615             MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
3616             MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
3617             MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
3618             MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
3619             MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
3620             MOVED_TO_SECURE.add(Secure.WIFI_ON);
3621             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
3622             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
3623             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
3624             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
3625             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
3626             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
3627             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
3628             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
3629             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
3630             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
3631             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
3632 
3633             // At one time in System, then Global, but now back in Secure
3634             MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
3635         }
3636 
3637         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
3638         private static final HashSet<String> MOVED_TO_GLOBAL;
3639         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
3640         private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
3641         static {
3642             MOVED_TO_GLOBAL = new HashSet<>();
3643             MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>();
3644 
3645             // these were originally in system but migrated to secure in the past,
3646             // so are duplicated in the Secure.* namespace
3647             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
3648             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
3649             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
3650             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
3651             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
3652             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.NETWORK_PREFERENCE);
3653             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
3654             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
3655             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.WIFI_MAX_DHCP_RETRY_COUNT);
3656 
3657             // these are moving directly from system to global
3658             MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
3659             MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
3660             MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
3661             MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
3662             MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
3663             MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
3664             MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
3665             MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
3666             MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
3667             MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
3668             MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
3669             MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
3670             MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
3671             MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
3672             MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
3673             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
3674             MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
3675             MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
3676             MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
3677             MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
3678             MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
3679             MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
3680             MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
3681             MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
3682             MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
3683             MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
3684             MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
3685             MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
3686             MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
3687             MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
3688             MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
3689             MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
3690             MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
3691             MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
3692             MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
3693             MOVED_TO_GLOBAL.add(Settings.Global.RADIO_NFC);
3694             MOVED_TO_GLOBAL.add(Settings.Global.RADIO_CELL);
3695             MOVED_TO_GLOBAL.add(Settings.Global.RADIO_WIFI);
3696             MOVED_TO_GLOBAL.add(Settings.Global.RADIO_BLUETOOTH);
3697             MOVED_TO_GLOBAL.add(Settings.Global.RADIO_WIMAX);
3698             MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
3699         }
3700 
3701         /** @hide */
getMovedToGlobalSettings(Set<String> outKeySet)3702         public static void getMovedToGlobalSettings(Set<String> outKeySet) {
3703             outKeySet.addAll(MOVED_TO_GLOBAL);
3704             outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
3705         }
3706 
3707         /** @hide */
getMovedToSecureSettings(Set<String> outKeySet)3708         public static void getMovedToSecureSettings(Set<String> outKeySet) {
3709             outKeySet.addAll(MOVED_TO_SECURE);
3710         }
3711 
3712         /** @hide */
getNonLegacyMovedKeys(HashSet<String> outKeySet)3713         public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
3714             outKeySet.addAll(MOVED_TO_GLOBAL);
3715         }
3716 
3717         /** @hide */
clearProviderForTest()3718         public static void clearProviderForTest() {
3719             sProviderHolder.clearProviderForTest();
3720             sNameValueCache.clearGenerationTrackerForTest();
3721         }
3722 
3723         /** @hide */
getPublicSettings(Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> readableKeysWithMaxTargetSdk)3724         public static void getPublicSettings(Set<String> allKeys, Set<String> readableKeys,
3725                 ArrayMap<String, Integer> readableKeysWithMaxTargetSdk) {
3726             getPublicSettingsForClass(System.class, allKeys, readableKeys,
3727                     readableKeysWithMaxTargetSdk);
3728         }
3729 
3730         /**
3731          * Look up a name in the database.
3732          * @param resolver to access the database with
3733          * @param name to look up in the table
3734          * @return the corresponding value, or null if not present
3735          */
getString(ContentResolver resolver, String name)3736         public static String getString(ContentResolver resolver, String name) {
3737             return getStringForUser(resolver, name, resolver.getUserId());
3738         }
3739 
3740         /** @hide */
3741         @UnsupportedAppUsage
getStringForUser(ContentResolver resolver, String name, int userHandle)3742         public static String getStringForUser(ContentResolver resolver, String name,
3743                 int userHandle) {
3744             if (MOVED_TO_SECURE.contains(name)) {
3745                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3746                         + " to android.provider.Settings.Secure, returning read-only value.");
3747                 return Secure.getStringForUser(resolver, name, userHandle);
3748             }
3749             if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
3750                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3751                         + " to android.provider.Settings.Global, returning read-only value.");
3752                 return Global.getStringForUser(resolver, name, userHandle);
3753             }
3754 
3755             return sNameValueCache.getStringForUser(resolver, name, userHandle);
3756         }
3757 
3758         /**
3759          * Store a name/value pair into the database.
3760          * @param resolver to access the database with
3761          * @param name to store
3762          * @param value to associate with the name
3763          * @return true if the value was set, false on database errors
3764          */
putString(ContentResolver resolver, String name, String value)3765         public static boolean putString(ContentResolver resolver, String name, String value) {
3766             return putStringForUser(resolver, name, value, resolver.getUserId());
3767         }
3768 
3769         /**
3770          * Store a name/value pair into the database. Values written by this method will be
3771          * overridden if a restore happens in the future.
3772          *
3773          * @param resolver to access the database with
3774          * @param name to store
3775          * @param value to associate with the name
3776          *
3777          * @return true if the value was set, false on database errors
3778          *
3779          * @hide
3780          */
3781         @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE)
3782         @SystemApi
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, boolean overrideableByRestore)3783         public static boolean putString(@NonNull ContentResolver resolver,
3784                 @NonNull String name, @Nullable String value, boolean overrideableByRestore) {
3785             return putStringForUser(resolver, name, value, resolver.getUserId(),
3786                    overrideableByRestore);
3787         }
3788 
3789         /** @hide */
3790         @UnsupportedAppUsage
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)3791         public static boolean putStringForUser(ContentResolver resolver, String name, String value,
3792                 int userHandle) {
3793             return putStringForUser(resolver, name, value, userHandle,
3794                     DEFAULT_OVERRIDEABLE_BY_RESTORE);
3795         }
3796 
putStringForUser(ContentResolver resolver, String name, String value, int userHandle, boolean overrideableByRestore)3797         private static boolean putStringForUser(ContentResolver resolver, String name, String value,
3798                 int userHandle, boolean overrideableByRestore) {
3799             return putStringForUser(resolver, name, value, /* tag= */ null,
3800                     /* makeDefault= */ false, userHandle, overrideableByRestore);
3801         }
3802 
putStringForUser(ContentResolver resolver, String name, String value, String tag, boolean makeDefault, int userHandle, boolean overrideableByRestore)3803         private static boolean putStringForUser(ContentResolver resolver, String name, String value,
3804                 String tag, boolean makeDefault, int userHandle, boolean overrideableByRestore) {
3805             if (MOVED_TO_SECURE.contains(name)) {
3806                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3807                         + " to android.provider.Settings.Secure, value is unchanged.");
3808                 return false;
3809             }
3810             if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
3811                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3812                         + " to android.provider.Settings.Global, value is unchanged.");
3813                 return false;
3814             }
3815             return sNameValueCache.putStringForUser(resolver, name, value, tag, makeDefault,
3816                     userHandle, overrideableByRestore);
3817         }
3818 
3819         /**
3820          * Construct the content URI for a particular name/value pair,
3821          * useful for monitoring changes with a ContentObserver.
3822          * @param name to look up in the table
3823          * @return the corresponding content URI, or null if not present
3824          */
getUriFor(String name)3825         public static Uri getUriFor(String name) {
3826             if (MOVED_TO_SECURE.contains(name)) {
3827                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3828                     + " to android.provider.Settings.Secure, returning Secure URI.");
3829                 return Secure.getUriFor(Secure.CONTENT_URI, name);
3830             }
3831             if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
3832                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3833                         + " to android.provider.Settings.Global, returning read-only global URI.");
3834                 return Global.getUriFor(Global.CONTENT_URI, name);
3835             }
3836             return getUriFor(CONTENT_URI, name);
3837         }
3838 
3839         /**
3840          * Convenience function for retrieving a single system settings value
3841          * as an integer.  Note that internally setting values are always
3842          * stored as strings; this function converts the string to an integer
3843          * for you.  The default value will be returned if the setting is
3844          * not defined or not an integer.
3845          *
3846          * @param cr The ContentResolver to access.
3847          * @param name The name of the setting to retrieve.
3848          * @param def Value to return if the setting is not defined.
3849          *
3850          * @return The setting's current value, or 'def' if it is not defined
3851          * or not a valid integer.
3852          */
getInt(ContentResolver cr, String name, int def)3853         public static int getInt(ContentResolver cr, String name, int def) {
3854             return getIntForUser(cr, name, def, cr.getUserId());
3855         }
3856 
3857         /** @hide */
3858         @UnsupportedAppUsage
getIntForUser(ContentResolver cr, String name, int def, int userHandle)3859         public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
3860             String v = getStringForUser(cr, name, userHandle);
3861             return parseIntSettingWithDefault(v, def);
3862         }
3863 
3864         /**
3865          * Convenience function for retrieving a single system settings value
3866          * as an integer.  Note that internally setting values are always
3867          * stored as strings; this function converts the string to an integer
3868          * for you.
3869          * <p>
3870          * This version does not take a default value.  If the setting has not
3871          * been set, or the string value is not a number,
3872          * it throws {@link SettingNotFoundException}.
3873          *
3874          * @param cr The ContentResolver to access.
3875          * @param name The name of the setting to retrieve.
3876          *
3877          * @throws SettingNotFoundException Thrown if a setting by the given
3878          * name can't be found or the setting value is not an integer.
3879          *
3880          * @return The setting's current value.
3881          */
getInt(ContentResolver cr, String name)3882         public static int getInt(ContentResolver cr, String name)
3883                 throws SettingNotFoundException {
3884             return getIntForUser(cr, name, cr.getUserId());
3885         }
3886 
3887         /** @hide */
3888         @UnsupportedAppUsage
getIntForUser(ContentResolver cr, String name, int userHandle)3889         public static int getIntForUser(ContentResolver cr, String name, int userHandle)
3890                 throws SettingNotFoundException {
3891             String v = getStringForUser(cr, name, userHandle);
3892             return parseIntSetting(v, name);
3893         }
3894 
3895         /**
3896          * Convenience function for updating a single settings value as an
3897          * integer. This will either create a new entry in the table if the
3898          * given name does not exist, or modify the value of the existing row
3899          * with that name.  Note that internally setting values are always
3900          * stored as strings, so this function converts the given value to a
3901          * string before storing it.
3902          *
3903          * @param cr The ContentResolver to access.
3904          * @param name The name of the setting to modify.
3905          * @param value The new value for the setting.
3906          * @return true if the value was set, false on database errors
3907          */
putInt(ContentResolver cr, String name, int value)3908         public static boolean putInt(ContentResolver cr, String name, int value) {
3909             return putIntForUser(cr, name, value, cr.getUserId());
3910         }
3911 
3912         /** @hide */
3913         @UnsupportedAppUsage
putIntForUser(ContentResolver cr, String name, int value, int userHandle)3914         public static boolean putIntForUser(ContentResolver cr, String name, int value,
3915                 int userHandle) {
3916             return putStringForUser(cr, name, Integer.toString(value), userHandle);
3917         }
3918 
3919         /**
3920          * Convenience function for retrieving a single system settings value
3921          * as a {@code long}.  Note that internally setting values are always
3922          * stored as strings; this function converts the string to a {@code long}
3923          * for you.  The default value will be returned if the setting is
3924          * not defined or not a {@code long}.
3925          *
3926          * @param cr The ContentResolver to access.
3927          * @param name The name of the setting to retrieve.
3928          * @param def Value to return if the setting is not defined.
3929          *
3930          * @return The setting's current value, or 'def' if it is not defined
3931          * or not a valid {@code long}.
3932          */
getLong(ContentResolver cr, String name, long def)3933         public static long getLong(ContentResolver cr, String name, long def) {
3934             return getLongForUser(cr, name, def, cr.getUserId());
3935         }
3936 
3937         /** @hide */
getLongForUser(ContentResolver cr, String name, long def, int userHandle)3938         public static long getLongForUser(ContentResolver cr, String name, long def,
3939                 int userHandle) {
3940             String v = getStringForUser(cr, name, userHandle);
3941             return parseLongSettingWithDefault(v, def);
3942         }
3943 
3944         /**
3945          * Convenience function for retrieving a single system settings value
3946          * as a {@code long}.  Note that internally setting values are always
3947          * stored as strings; this function converts the string to a {@code long}
3948          * for you.
3949          * <p>
3950          * This version does not take a default value.  If the setting has not
3951          * been set, or the string value is not a number,
3952          * it throws {@link SettingNotFoundException}.
3953          *
3954          * @param cr The ContentResolver to access.
3955          * @param name The name of the setting to retrieve.
3956          *
3957          * @return The setting's current value.
3958          * @throws SettingNotFoundException Thrown if a setting by the given
3959          * name can't be found or the setting value is not an integer.
3960          */
getLong(ContentResolver cr, String name)3961         public static long getLong(ContentResolver cr, String name)
3962                 throws SettingNotFoundException {
3963             return getLongForUser(cr, name, cr.getUserId());
3964         }
3965 
3966         /** @hide */
getLongForUser(ContentResolver cr, String name, int userHandle)3967         public static long getLongForUser(ContentResolver cr, String name, int userHandle)
3968                 throws SettingNotFoundException {
3969             String v = getStringForUser(cr, name, userHandle);
3970             return parseLongSetting(v, name);
3971         }
3972 
3973         /**
3974          * Convenience function for updating a single settings value as a long
3975          * integer. This will either create a new entry in the table if the
3976          * given name does not exist, or modify the value of the existing row
3977          * with that name.  Note that internally setting values are always
3978          * stored as strings, so this function converts the given value to a
3979          * string before storing it.
3980          *
3981          * @param cr The ContentResolver to access.
3982          * @param name The name of the setting to modify.
3983          * @param value The new value for the setting.
3984          * @return true if the value was set, false on database errors
3985          */
putLong(ContentResolver cr, String name, long value)3986         public static boolean putLong(ContentResolver cr, String name, long value) {
3987             return putLongForUser(cr, name, value, cr.getUserId());
3988         }
3989 
3990         /** @hide */
putLongForUser(ContentResolver cr, String name, long value, int userHandle)3991         public static boolean putLongForUser(ContentResolver cr, String name, long value,
3992                 int userHandle) {
3993             return putStringForUser(cr, name, Long.toString(value), userHandle);
3994         }
3995 
3996         /**
3997          * Convenience function for retrieving a single system settings value
3998          * as a floating point number.  Note that internally setting values are
3999          * always stored as strings; this function converts the string to an
4000          * float for you. The default value will be returned if the setting
4001          * is not defined or not a valid float.
4002          *
4003          * @param cr The ContentResolver to access.
4004          * @param name The name of the setting to retrieve.
4005          * @param def Value to return if the setting is not defined.
4006          *
4007          * @return The setting's current value, or 'def' if it is not defined
4008          * or not a valid float.
4009          */
getFloat(ContentResolver cr, String name, float def)4010         public static float getFloat(ContentResolver cr, String name, float def) {
4011             return getFloatForUser(cr, name, def, cr.getUserId());
4012         }
4013 
4014         /** @hide */
getFloatForUser(ContentResolver cr, String name, float def, int userHandle)4015         public static float getFloatForUser(ContentResolver cr, String name, float def,
4016                 int userHandle) {
4017             String v = getStringForUser(cr, name, userHandle);
4018             return parseFloatSettingWithDefault(v, def);
4019         }
4020 
4021         /**
4022          * Convenience function for retrieving a single system settings value
4023          * as a float.  Note that internally setting values are always
4024          * stored as strings; this function converts the string to a float
4025          * for you.
4026          * <p>
4027          * This version does not take a default value.  If the setting has not
4028          * been set, or the string value is not a number,
4029          * it throws {@link SettingNotFoundException}.
4030          *
4031          * @param cr The ContentResolver to access.
4032          * @param name The name of the setting to retrieve.
4033          *
4034          * @throws SettingNotFoundException Thrown if a setting by the given
4035          * name can't be found or the setting value is not a float.
4036          *
4037          * @return The setting's current value.
4038          */
getFloat(ContentResolver cr, String name)4039         public static float getFloat(ContentResolver cr, String name)
4040                 throws SettingNotFoundException {
4041             return getFloatForUser(cr, name, cr.getUserId());
4042         }
4043 
4044         /** @hide */
getFloatForUser(ContentResolver cr, String name, int userHandle)4045         public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
4046                 throws SettingNotFoundException {
4047             String v = getStringForUser(cr, name, userHandle);
4048             return parseFloatSetting(v, name);
4049         }
4050 
4051         /**
4052          * Convenience function for updating a single settings value as a
4053          * floating point number. This will either create a new entry in the
4054          * table if the given name does not exist, or modify the value of the
4055          * existing row with that name.  Note that internally setting values
4056          * are always stored as strings, so this function converts the given
4057          * value to a string before storing it.
4058          *
4059          * @param cr The ContentResolver to access.
4060          * @param name The name of the setting to modify.
4061          * @param value The new value for the setting.
4062          * @return true if the value was set, false on database errors
4063          */
putFloat(ContentResolver cr, String name, float value)4064         public static boolean putFloat(ContentResolver cr, String name, float value) {
4065             return putFloatForUser(cr, name, value, cr.getUserId());
4066         }
4067 
4068         /** @hide */
putFloatForUser(ContentResolver cr, String name, float value, int userHandle)4069         public static boolean putFloatForUser(ContentResolver cr, String name, float value,
4070                 int userHandle) {
4071             return putStringForUser(cr, name, Float.toString(value), userHandle);
4072         }
4073 
4074         /**
4075          * Convenience function to read all of the current
4076          * configuration-related settings into a
4077          * {@link Configuration} object.
4078          *
4079          * @param cr The ContentResolver to access.
4080          * @param outConfig Where to place the configuration settings.
4081          */
getConfiguration(ContentResolver cr, Configuration outConfig)4082         public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
4083             adjustConfigurationForUser(cr, outConfig, cr.getUserId(),
4084                     false /* updateSettingsIfEmpty */);
4085         }
4086 
4087         /** @hide */
adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, int userHandle, boolean updateSettingsIfEmpty)4088         public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig,
4089                 int userHandle, boolean updateSettingsIfEmpty) {
4090             outConfig.fontScale = Settings.System.getFloatForUser(
4091                     cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle);
4092             if (outConfig.fontScale < 0) {
4093                 outConfig.fontScale = DEFAULT_FONT_SCALE;
4094             }
4095             outConfig.fontWeightAdjustment = Settings.Secure.getIntForUser(
4096                     cr, Settings.Secure.FONT_WEIGHT_ADJUSTMENT, DEFAULT_FONT_WEIGHT, userHandle);
4097 
4098             final String localeValue =
4099                     Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle);
4100             if (localeValue != null) {
4101                 outConfig.setLocales(LocaleList.forLanguageTags(localeValue));
4102             } else {
4103                 // Do not update configuration with emtpy settings since we need to take over the
4104                 // locale list of previous user if the settings value is empty. This happens when a
4105                 // new user is created.
4106 
4107                 if (updateSettingsIfEmpty) {
4108                     // Make current configuration persistent. This is necessary the first time a
4109                     // user log in. At the first login, the configuration settings are empty, so we
4110                     // need to store the adjusted configuration as the initial settings.
4111                     Settings.System.putStringForUser(
4112                             cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(),
4113                             userHandle, DEFAULT_OVERRIDEABLE_BY_RESTORE);
4114                 }
4115             }
4116         }
4117 
4118         /**
4119          * @hide Erase the fields in the Configuration that should be applied
4120          * by the settings.
4121          */
clearConfiguration(Configuration inoutConfig)4122         public static void clearConfiguration(Configuration inoutConfig) {
4123             inoutConfig.fontScale = 0;
4124             if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) {
4125                 inoutConfig.clearLocales();
4126             }
4127             inoutConfig.fontWeightAdjustment = Configuration.FONT_WEIGHT_ADJUSTMENT_UNDEFINED;
4128         }
4129 
4130         /**
4131          * Convenience function to write a batch of configuration-related
4132          * settings from a {@link Configuration} object.
4133          *
4134          * @param cr The ContentResolver to access.
4135          * @param config The settings to write.
4136          * @return true if the values were set, false on database errors
4137          */
putConfiguration(ContentResolver cr, Configuration config)4138         public static boolean putConfiguration(ContentResolver cr, Configuration config) {
4139             return putConfigurationForUser(cr, config, cr.getUserId());
4140         }
4141 
4142         /** @hide */
putConfigurationForUser(ContentResolver cr, Configuration config, int userHandle)4143         public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
4144                 int userHandle) {
4145             return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) &&
4146                     Settings.System.putStringForUser(
4147                             cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle,
4148                             DEFAULT_OVERRIDEABLE_BY_RESTORE);
4149         }
4150 
4151         /**
4152          * Convenience function for checking if settings should be overwritten with config changes.
4153          * @see #putConfigurationForUser(ContentResolver, Configuration, int)
4154          * @hide
4155          */
hasInterestingConfigurationChanges(int changes)4156         public static boolean hasInterestingConfigurationChanges(int changes) {
4157             return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 ||
4158                     (changes & ActivityInfo.CONFIG_LOCALE) != 0;
4159         }
4160 
4161         /** @deprecated - Do not use */
4162         @Deprecated
getShowGTalkServiceStatus(ContentResolver cr)4163         public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
4164             return getShowGTalkServiceStatusForUser(cr, cr.getUserId());
4165         }
4166 
4167         /**
4168          * @hide
4169          * @deprecated - Do not use
4170          */
4171         @Deprecated
getShowGTalkServiceStatusForUser(ContentResolver cr, int userHandle)4172         public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
4173                 int userHandle) {
4174             return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
4175         }
4176 
4177         /** @deprecated - Do not use */
4178         @Deprecated
setShowGTalkServiceStatus(ContentResolver cr, boolean flag)4179         public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
4180             setShowGTalkServiceStatusForUser(cr, flag, cr.getUserId());
4181         }
4182 
4183         /**
4184          * @hide
4185          * @deprecated - Do not use
4186          */
4187         @Deprecated
setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, int userHandle)4188         public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
4189                 int userHandle) {
4190             putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
4191         }
4192 
4193         /**
4194          * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
4195          */
4196         @Deprecated
4197         public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN;
4198 
4199         /**
4200          * What happens when the user presses the end call button if they're not
4201          * on a call.<br/>
4202          * <b>Values:</b><br/>
4203          * 0 - The end button does nothing.<br/>
4204          * 1 - The end button goes to the home screen.<br/>
4205          * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
4206          * 3 - The end button goes to the home screen.  If the user is already on the
4207          * home screen, it puts the device to sleep.
4208          */
4209         @Readable
4210         public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
4211 
4212         /**
4213          * END_BUTTON_BEHAVIOR value for "go home".
4214          * @hide
4215          */
4216         public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
4217 
4218         /**
4219          * END_BUTTON_BEHAVIOR value for "go to sleep".
4220          * @hide
4221          */
4222         public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
4223 
4224         /**
4225          * END_BUTTON_BEHAVIOR default value.
4226          * @hide
4227          */
4228         public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
4229 
4230         /**
4231          * Is advanced settings mode turned on. 0 == no, 1 == yes
4232          * @hide
4233          */
4234         @Readable
4235         public static final String ADVANCED_SETTINGS = "advanced_settings";
4236 
4237         /**
4238          * ADVANCED_SETTINGS default value.
4239          * @hide
4240          */
4241         public static final int ADVANCED_SETTINGS_DEFAULT = 0;
4242 
4243         /**
4244          * If the triple press gesture for toggling accessibility is enabled.
4245          * Set to 1 for true and 0 for false.
4246          *
4247          * This setting is used only internally.
4248          * @hide
4249          */
4250         public static final String WEAR_ACCESSIBILITY_GESTURE_ENABLED
4251                 = "wear_accessibility_gesture_enabled";
4252 
4253         /**
4254          * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
4255          */
4256         @Deprecated
4257         public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
4258 
4259         /**
4260          * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
4261          */
4262         @Deprecated
4263         public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
4264 
4265         /**
4266          * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
4267          */
4268         @Deprecated
4269         public static final String RADIO_WIFI = Global.RADIO_WIFI;
4270 
4271         /**
4272          * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
4273          * {@hide}
4274          */
4275         @Deprecated
4276         public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
4277 
4278         /**
4279          * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
4280          */
4281         @Deprecated
4282         public static final String RADIO_CELL = Global.RADIO_CELL;
4283 
4284         /**
4285          * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
4286          */
4287         @Deprecated
4288         public static final String RADIO_NFC = Global.RADIO_NFC;
4289 
4290         /**
4291          * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
4292          */
4293         @Deprecated
4294         public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
4295 
4296         /**
4297          * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
4298          *
4299          * {@hide}
4300          */
4301         @Deprecated
4302         @UnsupportedAppUsage
4303         public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
4304                 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
4305 
4306         /**
4307          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
4308          */
4309         @Deprecated
4310         public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
4311 
4312         /**
4313          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
4314          */
4315         @Deprecated
4316         public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
4317 
4318         /**
4319          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
4320          */
4321         @Deprecated
4322         public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
4323                 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
4324 
4325         /**
4326          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
4327          */
4328         @Deprecated
4329         public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
4330 
4331         /**
4332          * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
4333          */
4334         @Deprecated
4335         public static final String MODE_RINGER = Global.MODE_RINGER;
4336 
4337         /**
4338          * Whether to use static IP and other static network attributes.
4339          * <p>
4340          * Set to 1 for true and 0 for false.
4341          *
4342          * @deprecated Use {@link WifiManager} instead
4343          */
4344         @Deprecated
4345         @Readable
4346         public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
4347 
4348         /**
4349          * The static IP address.
4350          * <p>
4351          * Example: "192.168.1.51"
4352          *
4353          * @deprecated Use {@link WifiManager} instead
4354          */
4355         @Deprecated
4356         @Readable
4357         public static final String WIFI_STATIC_IP = "wifi_static_ip";
4358 
4359         /**
4360          * If using static IP, the gateway's IP address.
4361          * <p>
4362          * Example: "192.168.1.1"
4363          *
4364          * @deprecated Use {@link WifiManager} instead
4365          */
4366         @Deprecated
4367         @Readable
4368         public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
4369 
4370         /**
4371          * If using static IP, the net mask.
4372          * <p>
4373          * Example: "255.255.255.0"
4374          *
4375          * @deprecated Use {@link WifiManager} instead
4376          */
4377         @Deprecated
4378         @Readable
4379         public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
4380 
4381         /**
4382          * If using static IP, the primary DNS's IP address.
4383          * <p>
4384          * Example: "192.168.1.1"
4385          *
4386          * @deprecated Use {@link WifiManager} instead
4387          */
4388         @Deprecated
4389         @Readable
4390         public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
4391 
4392         /**
4393          * If using static IP, the secondary DNS's IP address.
4394          * <p>
4395          * Example: "192.168.1.2"
4396          *
4397          * @deprecated Use {@link WifiManager} instead
4398          */
4399         @Deprecated
4400         @Readable
4401         public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
4402 
4403         /**
4404          * Determines whether remote devices may discover and/or connect to
4405          * this device.
4406          * <P>Type: INT</P>
4407          * 2 -- discoverable and connectable
4408          * 1 -- connectable but not discoverable
4409          * 0 -- neither connectable nor discoverable
4410          */
4411         @Readable
4412         public static final String BLUETOOTH_DISCOVERABILITY =
4413             "bluetooth_discoverability";
4414 
4415         /**
4416          * Bluetooth discoverability timeout.  If this value is nonzero, then
4417          * Bluetooth becomes discoverable for a certain number of seconds,
4418          * after which is becomes simply connectable.  The value is in seconds.
4419          */
4420         @Readable
4421         public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
4422             "bluetooth_discoverability_timeout";
4423 
4424         /**
4425          * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
4426          * instead
4427          */
4428         @Deprecated
4429         public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
4430 
4431         /**
4432          * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
4433          * instead
4434          */
4435         @Deprecated
4436         public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
4437 
4438         /**
4439          * @deprecated Use
4440          * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
4441          * instead
4442          */
4443         @Deprecated
4444         public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
4445             "lock_pattern_tactile_feedback_enabled";
4446 
4447         /**
4448          * A formatted string of the next alarm that is set, or the empty string
4449          * if there is no alarm set.
4450          *
4451          * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
4452          */
4453         @Deprecated
4454         @Readable
4455         public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
4456 
4457         /**
4458          * Scaling factor for fonts, float.
4459          */
4460         @Readable
4461         public static final String FONT_SCALE = "font_scale";
4462 
4463         /**
4464          * The serialized system locale value.
4465          *
4466          * Do not use this value directory.
4467          * To get system locale, use {@link LocaleList#getDefault} instead.
4468          * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales}
4469          * instead.
4470          * @hide
4471          */
4472         @Readable
4473         public static final String SYSTEM_LOCALES = "system_locales";
4474 
4475 
4476         /**
4477          * Name of an application package to be debugged.
4478          *
4479          * @deprecated Use {@link Global#DEBUG_APP} instead
4480          */
4481         @Deprecated
4482         public static final String DEBUG_APP = Global.DEBUG_APP;
4483 
4484         /**
4485          * If 1, when launching DEBUG_APP it will wait for the debugger before
4486          * starting user code.  If 0, it will run normally.
4487          *
4488          * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
4489          */
4490         @Deprecated
4491         public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
4492 
4493         /**
4494          * Whether or not to dim the screen. 0=no  1=yes
4495          * @deprecated This setting is no longer used.
4496          */
4497         @Deprecated
4498         @Readable
4499         public static final String DIM_SCREEN = "dim_screen";
4500 
4501         /**
4502          * The display color mode.
4503          * @hide
4504          */
4505         @Readable
4506         public static final String DISPLAY_COLOR_MODE = "display_color_mode";
4507 
4508         /**
4509          * Hint to decide whether restored vendor color modes are compatible with the new device. If
4510          * unset or a match is not made, only the standard color modes will be restored.
4511          * @hide
4512          */
4513         public static final String DISPLAY_COLOR_MODE_VENDOR_HINT =
4514                 "display_color_mode_vendor_hint";
4515 
4516         /**
4517          * The user selected min refresh rate in frames per second.
4518          *
4519          * If this isn't set, 0 will be used.
4520          * @hide
4521          */
4522         @Readable
4523         public static final String MIN_REFRESH_RATE = "min_refresh_rate";
4524 
4525         /**
4526          * The user selected peak refresh rate in frames per second.
4527          *
4528          * If this isn't set, the system falls back to a device specific default.
4529          * @hide
4530          */
4531         @Readable
4532         public static final String PEAK_REFRESH_RATE = "peak_refresh_rate";
4533 
4534         /**
4535          * The amount of time in milliseconds before the device goes to sleep or begins
4536          * to dream after a period of inactivity.  This value is also known as the
4537          * user activity timeout period since the screen isn't necessarily turned off
4538          * when it expires.
4539          *
4540          * <p>
4541          * This value is bounded by maximum timeout set by
4542          * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}.
4543          */
4544         @Readable
4545         public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
4546 
4547         /**
4548          * The screen backlight brightness between 0 and 255.
4549          */
4550         @Readable
4551         public static final String SCREEN_BRIGHTNESS = "screen_brightness";
4552 
4553         /**
4554          * The screen backlight brightness between 0 and 255.
4555          * @hide
4556          */
4557         @Readable
4558         public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr";
4559 
4560         /**
4561          * The screen backlight brightness between 0.0f and 1.0f.
4562          * @hide
4563          */
4564         @Readable
4565         public static final String SCREEN_BRIGHTNESS_FOR_VR_FLOAT =
4566                 "screen_brightness_for_vr_float";
4567 
4568         /**
4569          * The screen backlight brightness between 0.0f and 1.0f.
4570          * @hide
4571          */
4572         @Readable
4573         public static final String SCREEN_BRIGHTNESS_FLOAT = "screen_brightness_float";
4574 
4575         /**
4576          * Control whether to enable automatic brightness mode.
4577          */
4578         @Readable
4579         public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
4580 
4581         /**
4582          * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
4583          * or less (<0.0 >-1.0) bright.
4584          * @hide
4585          */
4586         @UnsupportedAppUsage
4587         @Readable
4588         public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
4589 
4590         /**
4591          * SCREEN_BRIGHTNESS_MODE value for manual mode.
4592          */
4593         public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
4594 
4595         /**
4596          * SCREEN_BRIGHTNESS_MODE value for automatic mode.
4597          */
4598         public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
4599 
4600         /**
4601          * Control whether to enable adaptive sleep mode.
4602          * @deprecated Use {@link android.provider.Settings.Secure#ADAPTIVE_SLEEP} instead.
4603          * @hide
4604          */
4605         @Deprecated
4606         @Readable
4607         public static final String ADAPTIVE_SLEEP = "adaptive_sleep";
4608 
4609         /**
4610          * Control whether the process CPU usage meter should be shown.
4611          *
4612          * @deprecated This functionality is no longer available as of
4613          * {@link android.os.Build.VERSION_CODES#N_MR1}.
4614          */
4615         @Deprecated
4616         public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
4617 
4618         /**
4619          * If 1, the activity manager will aggressively finish activities and
4620          * processes as soon as they are no longer needed.  If 0, the normal
4621          * extended lifetime is used.
4622          *
4623          * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
4624          */
4625         @Deprecated
4626         public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
4627 
4628         /**
4629          * Determines which streams are affected by ringer and zen mode changes. The
4630          * stream type's bit should be set to 1 if it should be muted when going
4631          * into an inaudible ringer mode.
4632          */
4633         @Readable
4634         public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
4635 
4636         /**
4637           * Determines which streams are affected by mute. The
4638           * stream type's bit should be set to 1 if it should be muted when a mute request
4639           * is received.
4640           */
4641         @Readable
4642         public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
4643 
4644         /**
4645          * Whether vibrate is on for different events. This is used internally,
4646          * changing this value will not change the vibrate. See AudioManager.
4647          */
4648         @Readable
4649         public static final String VIBRATE_ON = "vibrate_on";
4650 
4651         /**
4652          * Whether applying ramping ringer on incoming phone call ringtone.
4653          * <p>1 = apply ramping ringer
4654          * <p>0 = do not apply ramping ringer
4655          * @hide
4656          */
4657         @Readable
4658         public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer";
4659 
4660         /**
4661          * If 1, redirects the system vibrator to all currently attached input devices
4662          * that support vibration.  If there are no such input devices, then the system
4663          * vibrator is used instead.
4664          * If 0, does not register the system vibrator.
4665          *
4666          * This setting is mainly intended to provide a compatibility mechanism for
4667          * applications that only know about the system vibrator and do not use the
4668          * input device vibrator API.
4669          *
4670          * @hide
4671          */
4672         @Readable
4673         public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
4674 
4675         /**
4676          * The intensity of alarm vibrations, if configurable.
4677          *
4678          * Not all devices are capable of changing their vibration intensity; on these devices
4679          * there will likely be no difference between the various vibration intensities except for
4680          * intensity 0 (off) and the rest.
4681          *
4682          * <b>Values:</b><br/>
4683          * 0 - Vibration is disabled<br/>
4684          * 1 - Weak vibrations<br/>
4685          * 2 - Medium vibrations<br/>
4686          * 3 - Strong vibrations
4687          * @hide
4688          */
4689         public static final String ALARM_VIBRATION_INTENSITY =
4690                 "alarm_vibration_intensity";
4691 
4692         /**
4693          * The intensity of media vibrations, if configurable.
4694          *
4695          * This includes any vibration that is part of media, such as music, movie, soundtrack,
4696          * game or animations.
4697          *
4698          * Not all devices are capable of changing their vibration intensity; on these devices
4699          * there will likely be no difference between the various vibration intensities except for
4700          * intensity 0 (off) and the rest.
4701          *
4702          * <b>Values:</b><br/>
4703          * 0 - Vibration is disabled<br/>
4704          * 1 - Weak vibrations<br/>
4705          * 2 - Medium vibrations<br/>
4706          * 3 - Strong vibrations
4707          * @hide
4708          */
4709         public static final String MEDIA_VIBRATION_INTENSITY =
4710                 "media_vibration_intensity";
4711 
4712         /**
4713          * The intensity of notification vibrations, if configurable.
4714          *
4715          * Not all devices are capable of changing their vibration intensity; on these devices
4716          * there will likely be no difference between the various vibration intensities except for
4717          * intensity 0 (off) and the rest.
4718          *
4719          * <b>Values:</b><br/>
4720          * 0 - Vibration is disabled<br/>
4721          * 1 - Weak vibrations<br/>
4722          * 2 - Medium vibrations<br/>
4723          * 3 - Strong vibrations
4724          * @hide
4725          */
4726         @Readable
4727         public static final String NOTIFICATION_VIBRATION_INTENSITY =
4728                 "notification_vibration_intensity";
4729 
4730         /**
4731          * The intensity of ringtone vibrations, if configurable.
4732          *
4733          * Not all devices are capable of changing their vibration intensity; on these devices
4734          * there will likely be no difference between the various vibration intensities except for
4735          * intensity 0 (off) and the rest.
4736          *
4737          * <b>Values:</b><br/>
4738          * 0 - Vibration is disabled<br/>
4739          * 1 - Weak vibrations<br/>
4740          * 2 - Medium vibrations<br/>
4741          * 3 - Strong vibrations
4742          * @hide
4743          */
4744         @Readable
4745         public static final String RING_VIBRATION_INTENSITY =
4746                 "ring_vibration_intensity";
4747 
4748         /**
4749          * The intensity of haptic feedback vibrations, if configurable.
4750          *
4751          * Not all devices are capable of changing their feedback intensity; on these devices
4752          * there will likely be no difference between the various vibration intensities except for
4753          * intensity 0 (off) and the rest.
4754          *
4755          * <b>Values:</b><br/>
4756          * 0 - Vibration is disabled<br/>
4757          * 1 - Weak vibrations<br/>
4758          * 2 - Medium vibrations<br/>
4759          * 3 - Strong vibrations
4760          * @hide
4761          */
4762         @Readable
4763         public static final String HAPTIC_FEEDBACK_INTENSITY =
4764                 "haptic_feedback_intensity";
4765 
4766         /**
4767          * The intensity of haptic feedback vibrations for interaction with hardware components from
4768          * the device, like buttons and sensors, if configurable.
4769          *
4770          * Not all devices are capable of changing their feedback intensity; on these devices
4771          * there will likely be no difference between the various vibration intensities except for
4772          * intensity 0 (off) and the rest.
4773          *
4774          * <b>Values:</b><br/>
4775          * 0 - Vibration is disabled<br/>
4776          * 1 - Weak vibrations<br/>
4777          * 2 - Medium vibrations<br/>
4778          * 3 - Strong vibrations
4779          * @hide
4780          */
4781         public static final String HARDWARE_HAPTIC_FEEDBACK_INTENSITY =
4782                 "hardware_haptic_feedback_intensity";
4783 
4784         /**
4785          * Ringer volume. This is used internally, changing this value will not
4786          * change the volume. See AudioManager.
4787          *
4788          * @removed Not used by anything since API 2.
4789          */
4790         @Readable
4791         public static final String VOLUME_RING = "volume_ring";
4792 
4793         /**
4794          * System/notifications volume. This is used internally, changing this
4795          * value will not change the volume. See AudioManager.
4796          *
4797          * @removed Not used by anything since API 2.
4798          */
4799         @Readable
4800         public static final String VOLUME_SYSTEM = "volume_system";
4801 
4802         /**
4803          * Voice call volume. This is used internally, changing this value will
4804          * not change the volume. See AudioManager.
4805          *
4806          * @removed Not used by anything since API 2.
4807          */
4808         @Readable
4809         public static final String VOLUME_VOICE = "volume_voice";
4810 
4811         /**
4812          * Music/media/gaming volume. This is used internally, changing this
4813          * value will not change the volume. See AudioManager.
4814          *
4815          * @removed Not used by anything since API 2.
4816          */
4817         @Readable
4818         public static final String VOLUME_MUSIC = "volume_music";
4819 
4820         /**
4821          * Alarm volume. This is used internally, changing this
4822          * value will not change the volume. See AudioManager.
4823          *
4824          * @removed Not used by anything since API 2.
4825          */
4826         @Readable
4827         public static final String VOLUME_ALARM = "volume_alarm";
4828 
4829         /**
4830          * Notification volume. This is used internally, changing this
4831          * value will not change the volume. See AudioManager.
4832          *
4833          * @removed Not used by anything since API 2.
4834          */
4835         @Readable
4836         public static final String VOLUME_NOTIFICATION = "volume_notification";
4837 
4838         /**
4839          * Bluetooth Headset volume. This is used internally, changing this value will
4840          * not change the volume. See AudioManager.
4841          *
4842          * @removed Not used by anything since API 2.
4843          */
4844         @Readable
4845         public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
4846 
4847         /**
4848          * @hide
4849          * Acessibility volume. This is used internally, changing this
4850          * value will not change the volume.
4851          */
4852         @Readable
4853         public static final String VOLUME_ACCESSIBILITY = "volume_a11y";
4854 
4855         /**
4856          * @hide
4857          * Volume index for virtual assistant.
4858          */
4859         @Readable
4860         public static final String VOLUME_ASSISTANT = "volume_assistant";
4861 
4862         /**
4863          * Master volume (float in the range 0.0f to 1.0f).
4864          *
4865          * @hide
4866          */
4867         @Readable
4868         public static final String VOLUME_MASTER = "volume_master";
4869 
4870         /**
4871          * Master mono (int 1 = mono, 0 = normal).
4872          *
4873          * @hide
4874          */
4875         @UnsupportedAppUsage
4876         @Readable
4877         public static final String MASTER_MONO = "master_mono";
4878 
4879         /**
4880          * Master balance (float -1.f = 100% left, 0.f = dead center, 1.f = 100% right).
4881          *
4882          * @hide
4883          */
4884         @Readable
4885         public static final String MASTER_BALANCE = "master_balance";
4886 
4887         /**
4888          * Whether the notifications should use the ring volume (value of 1) or
4889          * a separate notification volume (value of 0). In most cases, users
4890          * will have this enabled so the notification and ringer volumes will be
4891          * the same. However, power users can disable this and use the separate
4892          * notification volume control.
4893          * <p>
4894          * Note: This is a one-off setting that will be removed in the future
4895          * when there is profile support. For this reason, it is kept hidden
4896          * from the public APIs.
4897          *
4898          * @hide
4899          * @deprecated
4900          */
4901         @Deprecated
4902         @Readable
4903         public static final String NOTIFICATIONS_USE_RING_VOLUME =
4904             "notifications_use_ring_volume";
4905 
4906         /**
4907          * Whether silent mode should allow vibration feedback. This is used
4908          * internally in AudioService and the Sound settings activity to
4909          * coordinate decoupling of vibrate and silent modes. This setting
4910          * will likely be removed in a future release with support for
4911          * audio/vibe feedback profiles.
4912          *
4913          * Not used anymore. On devices with vibrator, the user explicitly selects
4914          * silent or vibrate mode.
4915          * Kept for use by legacy database upgrade code in DatabaseHelper.
4916          * @hide
4917          */
4918         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
4919         @Readable
4920         public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
4921 
4922         /**
4923          * The mapping of stream type (integer) to its setting.
4924          *
4925          * @removed  Not used by anything since API 2.
4926          */
4927         public static final String[] VOLUME_SETTINGS = {
4928             VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
4929             VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
4930         };
4931 
4932         /**
4933          * @hide
4934          * The mapping of stream type (integer) to its setting.
4935          * Unlike the VOLUME_SETTINGS array, this one contains as many entries as
4936          * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes
4937          * are never persisted.
4938          */
4939         public static final String[] VOLUME_SETTINGS_INT = {
4940                 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
4941                 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO,
4942                 "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/,
4943                 "" /*STREAM_DTMF, no setting for this stream*/,
4944                 "" /*STREAM_TTS, no setting for this stream*/,
4945                 VOLUME_ACCESSIBILITY, VOLUME_ASSISTANT
4946             };
4947 
4948         /**
4949          * Appended to various volume related settings to record the previous
4950          * values before they the settings were affected by a silent/vibrate
4951          * ringer mode change.
4952          *
4953          * @removed  Not used by anything since API 2.
4954          */
4955         @Readable
4956         public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
4957 
4958         /**
4959          * Persistent store for the system-wide default ringtone URI.
4960          * <p>
4961          * If you need to play the default ringtone at any given time, it is recommended
4962          * you give {@link #DEFAULT_RINGTONE_URI} to the media player.  It will resolve
4963          * to the set default ringtone at the time of playing.
4964          *
4965          * @see #DEFAULT_RINGTONE_URI
4966          */
4967         @Readable
4968         public static final String RINGTONE = "ringtone";
4969 
4970         /**
4971          * A {@link Uri} that will point to the current default ringtone at any
4972          * given time.
4973          * <p>
4974          * If the current default ringtone is in the DRM provider and the caller
4975          * does not have permission, the exception will be a
4976          * FileNotFoundException.
4977          */
4978         public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
4979 
4980         /** {@hide} */
4981         @Readable
4982         public static final String RINGTONE_CACHE = "ringtone_cache";
4983         /** {@hide} */
4984         public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE);
4985 
4986         /**
4987          * Persistent store for the system-wide default notification sound.
4988          *
4989          * @see #RINGTONE
4990          * @see #DEFAULT_NOTIFICATION_URI
4991          */
4992         @Readable
4993         public static final String NOTIFICATION_SOUND = "notification_sound";
4994 
4995         /**
4996          * A {@link Uri} that will point to the current default notification
4997          * sound at any given time.
4998          *
4999          * @see #DEFAULT_RINGTONE_URI
5000          */
5001         public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
5002 
5003         /** {@hide} */
5004         @Readable
5005         public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache";
5006         /** {@hide} */
5007         public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE);
5008 
5009         /**
5010          * Persistent store for the system-wide default alarm alert.
5011          *
5012          * @see #RINGTONE
5013          * @see #DEFAULT_ALARM_ALERT_URI
5014          */
5015         @Readable
5016         public static final String ALARM_ALERT = "alarm_alert";
5017 
5018         /**
5019          * A {@link Uri} that will point to the current default alarm alert at
5020          * any given time.
5021          *
5022          * @see #DEFAULT_ALARM_ALERT_URI
5023          */
5024         public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
5025 
5026         /** {@hide} */
5027         @Readable
5028         public static final String ALARM_ALERT_CACHE = "alarm_alert_cache";
5029         /** {@hide} */
5030         public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE);
5031 
5032         /**
5033          * Persistent store for the system default media button event receiver.
5034          *
5035          * @hide
5036          */
5037         @Readable(maxTargetSdk = Build.VERSION_CODES.R)
5038         public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
5039 
5040         /**
5041          * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
5042          */
5043         @Readable
5044         public static final String TEXT_AUTO_REPLACE = "auto_replace";
5045 
5046         /**
5047          * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
5048          */
5049         @Readable
5050         public static final String TEXT_AUTO_CAPS = "auto_caps";
5051 
5052         /**
5053          * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
5054          * feature converts two spaces to a "." and space.
5055          */
5056         @Readable
5057         public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
5058 
5059         /**
5060          * Setting to showing password characters in text editors. 1 = On, 0 = Off
5061          */
5062         @Readable
5063         public static final String TEXT_SHOW_PASSWORD = "show_password";
5064 
5065         @Readable
5066         public static final String SHOW_GTALK_SERVICE_STATUS =
5067                 "SHOW_GTALK_SERVICE_STATUS";
5068 
5069         /**
5070          * Name of activity to use for wallpaper on the home screen.
5071          *
5072          * @deprecated Use {@link WallpaperManager} instead.
5073          */
5074         @Deprecated
5075         @Readable
5076         public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
5077 
5078         /**
5079          * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
5080          * instead
5081          */
5082         @Deprecated
5083         public static final String AUTO_TIME = Global.AUTO_TIME;
5084 
5085         /**
5086          * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
5087          * instead
5088          */
5089         @Deprecated
5090         public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
5091 
5092         /**
5093          * Display the user's times, e.g. in the status bar, as 12 or 24 hours.
5094          * <ul>
5095          *    <li>24 = 24 hour</li>
5096          *    <li>12 = 12 hour</li>
5097          *    <li>[unset] = use the device locale's default</li>
5098          * </ul>
5099          */
5100         @Readable
5101         public static final String TIME_12_24 = "time_12_24";
5102 
5103         /**
5104          * @deprecated No longer used. Use {@link #TIME_12_24} instead.
5105          */
5106         @Deprecated
5107         @Readable
5108         public static final String DATE_FORMAT = "date_format";
5109 
5110         /**
5111          * Whether the setup wizard has been run before (on first boot), or if
5112          * it still needs to be run.
5113          *
5114          * nonzero = it has been run in the past
5115          * 0 = it has not been run in the past
5116          */
5117         @Readable
5118         public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
5119 
5120         /**
5121          * Scaling factor for normal window animations. Setting to 0 will disable window
5122          * animations.
5123          *
5124          * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
5125          */
5126         @Deprecated
5127         public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
5128 
5129         /**
5130          * Scaling factor for activity transition animations. Setting to 0 will disable window
5131          * animations.
5132          *
5133          * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
5134          */
5135         @Deprecated
5136         public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
5137 
5138         /**
5139          * Scaling factor for Animator-based animations. This affects both the start delay and
5140          * duration of all such animations. Setting to 0 will cause animations to end immediately.
5141          * The default value is 1.
5142          *
5143          * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
5144          */
5145         @Deprecated
5146         public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
5147 
5148         /**
5149          * Control whether the accelerometer will be used to change screen
5150          * orientation.  If 0, it will not be used unless explicitly requested
5151          * by the application; if 1, it will be used by default unless explicitly
5152          * disabled by the application.
5153          */
5154         @Readable
5155         public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
5156 
5157         /**
5158          * Default screen rotation when no other policy applies.
5159          * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
5160          * preference, this rotation value will be used. Must be one of the
5161          * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
5162          *
5163          * @see Display#getRotation
5164          */
5165         @Readable
5166         public static final String USER_ROTATION = "user_rotation";
5167 
5168         /**
5169          * Control whether the rotation lock toggle in the System UI should be hidden.
5170          * Typically this is done for accessibility purposes to make it harder for
5171          * the user to accidentally toggle the rotation lock while the display rotation
5172          * has been locked for accessibility.
5173          *
5174          * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
5175          * unavailable for other reasons).  If 1, then the rotation lock toggle is hidden.
5176          *
5177          * @hide
5178          */
5179         @UnsupportedAppUsage
5180         @Readable
5181         public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
5182                 "hide_rotation_lock_toggle_for_accessibility";
5183 
5184         /**
5185          * Whether the phone vibrates when it is ringing due to an incoming call. This will
5186          * be used by Phone and Setting apps; it shouldn't affect other apps.
5187          * The value is boolean (1 or 0).
5188          *
5189          * Note: this is not same as "vibrate on ring", which had been available until ICS.
5190          * It was about AudioManager's setting and thus affected all the applications which
5191          * relied on the setting, while this is purely about the vibration setting for incoming
5192          * calls.
5193          *
5194          * @deprecated Replaced by using {@link android.os.VibrationAttributes#USAGE_RINGTONE} on
5195          * vibrations for incoming calls. User settings are applied automatically by the service and
5196          * should not be applied by individual apps.
5197          */
5198         @Deprecated
5199         @Readable
5200         public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
5201 
5202         /**
5203          * When {@code 1}, Telecom enhanced call blocking functionality is enabled.  When
5204          * {@code 0}, enhanced call blocking functionality is disabled.
5205          * @hide
5206          */
5207         @Readable
5208         public static final String DEBUG_ENABLE_ENHANCED_CALL_BLOCKING =
5209                 "debug.enable_enhanced_calling";
5210 
5211         /**
5212          * Whether the audible DTMF tones are played by the dialer when dialing. The value is
5213          * boolean (1 or 0).
5214          */
5215         @Readable
5216         public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
5217 
5218         /**
5219          * CDMA only settings
5220          * DTMF tone type played by the dialer when dialing.
5221          *                 0 = Normal
5222          *                 1 = Long
5223          */
5224         @Readable
5225         public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
5226 
5227         /**
5228          * Whether the hearing aid is enabled. The value is
5229          * boolean (1 or 0).
5230          * @hide
5231          */
5232         @UnsupportedAppUsage
5233         @Readable
5234         public static final String HEARING_AID = "hearing_aid";
5235 
5236         /**
5237          * CDMA only settings
5238          * TTY Mode
5239          * 0 = OFF
5240          * 1 = FULL
5241          * 2 = VCO
5242          * 3 = HCO
5243          * @hide
5244          */
5245         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5246         @Readable
5247         public static final String TTY_MODE = "tty_mode";
5248 
5249         /**
5250          * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
5251          * boolean (1 or 0).
5252          */
5253         @Readable
5254         public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
5255 
5256         /**
5257          * Whether haptic feedback (Vibrate on tap) is enabled. The value is
5258          * boolean (1 or 0).
5259          *
5260          * @deprecated Replaced by using {@link android.os.VibrationAttributes#USAGE_TOUCH} on
5261          * vibrations. User settings are applied automatically by the service and should not be
5262          * applied by individual apps.
5263          */
5264         @Deprecated
5265         @Readable
5266         public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
5267 
5268         /**
5269          * @deprecated Each application that shows web suggestions should have its own
5270          * setting for this.
5271          */
5272         @Deprecated
5273         @Readable
5274         public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
5275 
5276         /**
5277          * Whether the notification LED should repeatedly flash when a notification is
5278          * pending. The value is boolean (1 or 0).
5279          * @hide
5280          */
5281         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5282         @Readable
5283         public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
5284 
5285         /**
5286          * Show pointer location on screen?
5287          * 0 = no
5288          * 1 = yes
5289          * @hide
5290          */
5291         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5292         @Readable
5293         public static final String POINTER_LOCATION = "pointer_location";
5294 
5295         /**
5296          * Show touch positions on screen?
5297          * 0 = no
5298          * 1 = yes
5299          * @hide
5300          */
5301         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5302         @Readable
5303         public static final String SHOW_TOUCHES = "show_touches";
5304 
5305         /**
5306          * Log raw orientation data from
5307          * {@link com.android.server.policy.WindowOrientationListener} for use with the
5308          * orientationplot.py tool.
5309          * 0 = no
5310          * 1 = yes
5311          * @hide
5312          */
5313         @Readable
5314         public static final String WINDOW_ORIENTATION_LISTENER_LOG =
5315                 "window_orientation_listener_log";
5316 
5317         /**
5318          * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
5319          * instead
5320          * @hide
5321          */
5322         @Deprecated
5323         public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
5324 
5325         /**
5326          * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
5327          * instead
5328          * @hide
5329          */
5330         @Deprecated
5331         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5332         public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
5333 
5334         /**
5335          * Whether to play sounds when the keyguard is shown and dismissed.
5336          * @hide
5337          */
5338         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5339         @Readable
5340         public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
5341 
5342         /**
5343          * Whether the lockscreen should be completely disabled.
5344          * @hide
5345          */
5346         @Readable
5347         public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
5348 
5349         /**
5350          * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
5351          * instead
5352          * @hide
5353          */
5354         @Deprecated
5355         public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
5356 
5357         /**
5358          * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
5359          * instead
5360          * @hide
5361          */
5362         @Deprecated
5363         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5364         public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
5365 
5366         /**
5367          * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
5368          * instead
5369          * @hide
5370          */
5371         @Deprecated
5372         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5373         public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
5374 
5375         /**
5376          * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
5377          * instead
5378          * @hide
5379          */
5380         @Deprecated
5381         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5382         public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
5383 
5384         /**
5385          * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
5386          * instead
5387          * @hide
5388          */
5389         @Deprecated
5390         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5391         public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
5392 
5393         /**
5394          * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
5395          * instead
5396          * @hide
5397          */
5398         @Deprecated
5399         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5400         public static final String LOCK_SOUND = Global.LOCK_SOUND;
5401 
5402         /**
5403          * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
5404          * instead
5405          * @hide
5406          */
5407         @Deprecated
5408         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5409         public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
5410 
5411         /**
5412          * Receive incoming SIP calls?
5413          * 0 = no
5414          * 1 = yes
5415          * @hide
5416          */
5417         @Readable
5418         public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
5419 
5420         /**
5421          * Call Preference String.
5422          * "SIP_ALWAYS" : Always use SIP with network access
5423          * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
5424          * @hide
5425          */
5426         @Readable
5427         public static final String SIP_CALL_OPTIONS = "sip_call_options";
5428 
5429         /**
5430          * One of the sip call options: Always use SIP with network access.
5431          * @hide
5432          */
5433         @Readable
5434         public static final String SIP_ALWAYS = "SIP_ALWAYS";
5435 
5436         /**
5437          * One of the sip call options: Only if destination is a SIP address.
5438          * @hide
5439          */
5440         @Readable
5441         public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
5442 
5443         /**
5444          * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead.  Formerly used to indicate that
5445          * the user should be prompted each time a call is made whether it should be placed using
5446          * SIP.  The {@link com.android.providers.settings.DatabaseHelper} replaces this with
5447          * SIP_ADDRESS_ONLY.
5448          * @hide
5449          */
5450         @Deprecated
5451         @Readable
5452         public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
5453 
5454         /**
5455          * Pointer speed setting.
5456          * This is an integer value in a range between -7 and +7, so there are 15 possible values.
5457          *   -7 = slowest
5458          *    0 = default speed
5459          *   +7 = fastest
5460          * @hide
5461          */
5462         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5463         @Readable
5464         public static final String POINTER_SPEED = "pointer_speed";
5465 
5466         /**
5467          * Whether lock-to-app will be triggered by long-press on recents.
5468          * @hide
5469          */
5470         @Readable
5471         public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
5472 
5473         /**
5474          * I am the lolrus.
5475          * <p>
5476          * Nonzero values indicate that the user has a bukkit.
5477          * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
5478          * @hide
5479          */
5480         @Readable
5481         public static final String EGG_MODE = "egg_mode";
5482 
5483         /**
5484          * Setting to determine whether or not to show the battery percentage in the status bar.
5485          *    0 - Don't show percentage
5486          *    1 - Show percentage
5487          * @hide
5488          */
5489         @Readable
5490         public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent";
5491 
5492         /**
5493          * Whether or not to enable multiple audio focus.
5494          * When enabled, requires more management by user over application playback activity,
5495          * for instance pausing media apps when another starts.
5496          * @hide
5497          */
5498         @Readable
5499         public static final String MULTI_AUDIO_FOCUS_ENABLED = "multi_audio_focus_enabled";
5500 
5501         /**
5502          * Whether desktop mode is enabled or not.
5503          * 0 = off
5504          * 1 = on
5505          * @hide
5506          */
5507         @Readable
5508         public static final String DESKTOP_MODE = "desktop_mode";
5509 
5510         /**
5511          * IMPORTANT: If you add a new public settings you also have to add it to
5512          * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
5513          * it to PRIVATE_SETTINGS below. Also add a validator that can validate
5514          * the setting value. See an example above.
5515          */
5516 
5517         /**
5518          * Keys we no longer back up under the current schema, but want to continue to
5519          * process when restoring historical backup datasets.
5520          *
5521          * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
5522          * otherwise they won't be restored.
5523          *
5524          * @hide
5525          */
5526         public static final String[] LEGACY_RESTORE_SETTINGS = {
5527         };
5528 
5529         /**
5530          * These are all public system settings
5531          *
5532          * @hide
5533          */
5534         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5535         public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
5536         static {
5537             PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
5538             PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
5539             PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
5540             PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
5541             PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
5542             PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
5543             PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
5544             PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
5545             PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
5546             PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
5547             PUBLIC_SETTINGS.add(FONT_SCALE);
5548             PUBLIC_SETTINGS.add(SYSTEM_LOCALES);
5549             PUBLIC_SETTINGS.add(DIM_SCREEN);
5550             PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
5551             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
5552             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FLOAT);
5553             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR);
5554             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR_FLOAT);
5555             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
5556             PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
5557             PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
5558             PUBLIC_SETTINGS.add(VIBRATE_ON);
5559             PUBLIC_SETTINGS.add(VOLUME_RING);
5560             PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
5561             PUBLIC_SETTINGS.add(VOLUME_VOICE);
5562             PUBLIC_SETTINGS.add(VOLUME_MUSIC);
5563             PUBLIC_SETTINGS.add(VOLUME_ALARM);
5564             PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
5565             PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
5566             PUBLIC_SETTINGS.add(VOLUME_ASSISTANT);
5567             PUBLIC_SETTINGS.add(RINGTONE);
5568             PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
5569             PUBLIC_SETTINGS.add(ALARM_ALERT);
5570             PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
5571             PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
5572             PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
5573             PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
5574             PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
5575             PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
5576             PUBLIC_SETTINGS.add(TIME_12_24);
5577             PUBLIC_SETTINGS.add(DATE_FORMAT);
5578             PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
5579             PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
5580             PUBLIC_SETTINGS.add(USER_ROTATION);
5581             PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
5582             PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
5583             PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
5584             PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
5585             PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING);
5586             PUBLIC_SETTINGS.add(APPLY_RAMPING_RINGER);
5587         }
5588 
5589         /**
5590          * These are all hidden system settings.
5591          *
5592          * @hide
5593          */
5594         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5595         public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
5596         static {
5597             PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
5598             PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
5599             PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
5600             PRIVATE_SETTINGS.add(WEAR_ACCESSIBILITY_GESTURE_ENABLED);
5601             PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
5602             PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
5603             PRIVATE_SETTINGS.add(VOLUME_MASTER);
5604             PRIVATE_SETTINGS.add(MASTER_MONO);
5605             PRIVATE_SETTINGS.add(MASTER_BALANCE);
5606             PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
5607             PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
5608             PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
5609             PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
5610             PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
5611             PRIVATE_SETTINGS.add(HEARING_AID);
5612             PRIVATE_SETTINGS.add(TTY_MODE);
5613             PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
5614             PRIVATE_SETTINGS.add(POINTER_LOCATION);
5615             PRIVATE_SETTINGS.add(SHOW_TOUCHES);
5616             PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
5617             PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
5618             PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
5619             PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
5620             PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
5621             PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
5622             PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
5623             PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
5624             PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
5625             PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
5626             PRIVATE_SETTINGS.add(LOCK_SOUND);
5627             PRIVATE_SETTINGS.add(UNLOCK_SOUND);
5628             PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
5629             PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
5630             PRIVATE_SETTINGS.add(SIP_ALWAYS);
5631             PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
5632             PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
5633             PRIVATE_SETTINGS.add(POINTER_SPEED);
5634             PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
5635             PRIVATE_SETTINGS.add(EGG_MODE);
5636             PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT);
5637             PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE);
5638             PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE_VENDOR_HINT);
5639             PRIVATE_SETTINGS.add(DESKTOP_MODE);
5640         }
5641 
5642         /**
5643          * These entries are considered common between the personal and the managed profile,
5644          * since the managed profile doesn't get to change them.
5645          */
5646         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5647         private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
5648         static {
5649             CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
5650             CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
5651             CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
5652             CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
5653             CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
5654         }
5655 
5656         /** @hide */
getCloneToManagedProfileSettings(Set<String> outKeySet)5657         public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
5658             outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
5659         }
5660 
5661         /**
5662          * These entries should be cloned from this profile's parent only if the dependency's
5663          * value is true ("1")
5664          *
5665          * Note: the dependencies must be Secure settings
5666          *
5667          * @hide
5668          */
5669         public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>();
5670         static {
CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS)5671             CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS);
CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS)5672             CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS);
CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS)5673             CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS);
5674         }
5675 
5676         /** @hide */
getCloneFromParentOnValueSettings(Map<String, String> outMap)5677         public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) {
5678             outMap.putAll(CLONE_FROM_PARENT_ON_VALUE);
5679         }
5680 
5681         /**
5682          * System settings which can be accessed by instant apps.
5683          * @hide
5684          */
5685         public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
5686         static {
5687             INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE);
5688             INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS);
5689             INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
5690             INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD);
5691             INSTANT_APP_SETTINGS.add(DATE_FORMAT);
5692             INSTANT_APP_SETTINGS.add(FONT_SCALE);
5693             INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
5694             INSTANT_APP_SETTINGS.add(TIME_12_24);
5695             INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED);
5696             INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION);
5697         }
5698 
5699         /**
5700          * When to use Wi-Fi calling
5701          *
5702          * @see android.telephony.TelephonyManager.WifiCallingChoices
5703          * @hide
5704          */
5705         @Readable
5706         public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
5707 
5708         // Settings moved to Settings.Secure
5709 
5710         /**
5711          * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
5712          * instead
5713          */
5714         @Deprecated
5715         public static final String ADB_ENABLED = Global.ADB_ENABLED;
5716 
5717         /**
5718          * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
5719          */
5720         @Deprecated
5721         public static final String ANDROID_ID = Secure.ANDROID_ID;
5722 
5723         /**
5724          * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
5725          */
5726         @Deprecated
5727         public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
5728 
5729         /**
5730          * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
5731          */
5732         @Deprecated
5733         public static final String DATA_ROAMING = Global.DATA_ROAMING;
5734 
5735         /**
5736          * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
5737          */
5738         @Deprecated
5739         public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
5740 
5741         /**
5742          * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
5743          */
5744         @Deprecated
5745         public static final String HTTP_PROXY = Global.HTTP_PROXY;
5746 
5747         /**
5748          * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
5749          */
5750         @Deprecated
5751         public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
5752 
5753         /**
5754          * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
5755          * instead
5756          */
5757         @Deprecated
5758         public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
5759 
5760         /**
5761          * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
5762          */
5763         @Deprecated
5764         public static final String LOGGING_ID = Secure.LOGGING_ID;
5765 
5766         /**
5767          * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
5768          */
5769         @Deprecated
5770         public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
5771 
5772         /**
5773          * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
5774          * instead
5775          */
5776         @Deprecated
5777         public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
5778 
5779         /**
5780          * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
5781          * instead
5782          */
5783         @Deprecated
5784         public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
5785 
5786         /**
5787          * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
5788          * instead
5789          */
5790         @Deprecated
5791         public static final String PARENTAL_CONTROL_REDIRECT_URL =
5792             Secure.PARENTAL_CONTROL_REDIRECT_URL;
5793 
5794         /**
5795          * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
5796          */
5797         @Deprecated
5798         public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
5799 
5800         /**
5801          * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
5802          */
5803         @Deprecated
5804         public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
5805 
5806         /**
5807          * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
5808          */
5809         @Deprecated
5810         public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
5811 
5812        /**
5813          * @deprecated Use
5814          * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
5815          */
5816         @Deprecated
5817         public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
5818 
5819         /**
5820          * @deprecated Use
5821          * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
5822          */
5823         @Deprecated
5824         public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
5825                 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
5826 
5827         /**
5828          * @deprecated Use
5829          * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
5830          */
5831         @Deprecated
5832         public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
5833                 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
5834 
5835         /**
5836          * @deprecated Use
5837          * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
5838          */
5839         @Deprecated
5840         public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
5841                 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
5842 
5843         /**
5844          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
5845          * instead
5846          */
5847         @Deprecated
5848         public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
5849 
5850         /**
5851          * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
5852          */
5853         @Deprecated
5854         public static final String WIFI_ON = Global.WIFI_ON;
5855 
5856         /**
5857          * @deprecated Use
5858          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
5859          * instead
5860          */
5861         @Deprecated
5862         @Readable
5863         public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
5864                 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
5865 
5866         /**
5867          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
5868          */
5869         @Deprecated
5870         public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
5871 
5872         /**
5873          * @deprecated Use
5874          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
5875          */
5876         @Deprecated
5877         @Readable
5878         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
5879                 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
5880 
5881         /**
5882          * @deprecated Use
5883          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
5884          */
5885         @Deprecated
5886         @Readable
5887         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
5888                 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
5889 
5890         /**
5891          * @deprecated Use
5892          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
5893          * instead
5894          */
5895         @Deprecated
5896         @Readable
5897         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
5898                 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
5899 
5900         /**
5901          * @deprecated Use
5902          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
5903          */
5904         @Deprecated
5905         @Readable
5906         public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
5907             Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
5908 
5909         /**
5910          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
5911          * instead
5912          */
5913         @Deprecated
5914         public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
5915 
5916         /**
5917          * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
5918          */
5919         @Deprecated
5920         public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
5921 
5922         /**
5923          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
5924          */
5925         @Deprecated
5926         public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
5927 
5928         /**
5929          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
5930          * instead
5931          */
5932         @Deprecated
5933         public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
5934 
5935         /**
5936          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
5937          * instead
5938          */
5939         @Deprecated
5940         @Readable
5941         public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
5942             Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
5943 
5944         /**
5945          * Checks if the specified app can modify system settings. As of API
5946          * level 23, an app cannot modify system settings unless it declares the
5947          * {@link android.Manifest.permission#WRITE_SETTINGS}
5948          * permission in its manifest, <em>and</em> the user specifically grants
5949          * the app this capability. To prompt the user to grant this approval,
5950          * the app must send an intent with the action {@link
5951          * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes
5952          * the system to display a permission management screen.
5953          *
5954          * @param context App context.
5955          * @return true if the calling app can write to system settings, false otherwise
5956          */
canWrite(Context context)5957         public static boolean canWrite(Context context) {
5958             return isCallingPackageAllowedToWriteSettings(context, Process.myUid(),
5959                     context.getOpPackageName(), false);
5960         }
5961     }
5962 
5963     /**
5964      * Secure system settings, containing system preferences that applications
5965      * can read but are not allowed to write.  These are for preferences that
5966      * the user must explicitly modify through the UI of a system app. Normal
5967      * applications cannot modify the secure settings database, either directly
5968      * or by calling the "put" methods that this class contains.
5969      */
5970     public static final class Secure extends NameValueTable {
5971         // NOTE: If you add new settings here, be sure to add them to
5972         // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked.
5973 
5974         /**
5975          * The content:// style URL for this table
5976          */
5977         public static final Uri CONTENT_URI =
5978             Uri.parse("content://" + AUTHORITY + "/secure");
5979 
5980         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5981         private static final ContentProviderHolder sProviderHolder =
5982                 new ContentProviderHolder(CONTENT_URI);
5983 
5984         // Populated lazily, guarded by class object:
5985         @UnsupportedAppUsage
5986         private static final NameValueCache sNameValueCache = new NameValueCache(
5987                 CONTENT_URI,
5988                 CALL_METHOD_GET_SECURE,
5989                 CALL_METHOD_PUT_SECURE,
5990                 CALL_METHOD_DELETE_SECURE,
5991                 sProviderHolder,
5992                 Secure.class);
5993 
5994         private static ILockSettings sLockSettings = null;
5995 
5996         private static boolean sIsSystemProcess;
5997         @UnsupportedAppUsage
5998         private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
5999         @UnsupportedAppUsage
6000         private static final HashSet<String> MOVED_TO_GLOBAL;
6001         static {
6002             MOVED_TO_LOCK_SETTINGS = new HashSet<>(3);
6003             MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
6004             MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
6005             MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
6006 
6007             MOVED_TO_GLOBAL = new HashSet<>();
6008             MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
6009             MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
6010             MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
6011             MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
6012             MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
6013             MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
6014             MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
6015             MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
6016             MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
6017             MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
6018             MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
6019             MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
6020             MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
6021             MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
6022             MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
6023             MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
6024             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
6025             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
6026             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
6027             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
6028             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
6029             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
6030             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
6031             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
6032             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
6033             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
6034             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
6035             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
6036             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
6037             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
6038             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
6039             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
6040             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
6041             MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
6042             MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
6043             MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
6044             MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
6045             MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
6046             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
6047             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
6048             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
6049             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
6050             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
6051             MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
6052             MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
6053             MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
6054             MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
6055             MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
6056             MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
6057             MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
6058             MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
6059             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
6060             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
6061             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
6062             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
6063             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
6064             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
6065             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
6066             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
6067             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
6068             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
6069             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
6070             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
6071             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED);
6072             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
6073             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
6074             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
6075             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
6076             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_PENDING_FACTORY_RESET);
6077             MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
6078             MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
6079             MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
6080             MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
6081             MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
6082             MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
6083             MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
6084             MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
6085             MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
6086             MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
6087             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
6088             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
6089             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
6090             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
6091             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
6092             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
6093             MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
6094             MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
6095             MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
6096             MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
6097             MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
6098             MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
6099             MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
6100             MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
6101             MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
6102             MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
6103             MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
6104             MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
6105             MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
6106             MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
6107             MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
6108             MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
6109             MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
6110             MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
6111             MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
6112             MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
6113             MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
6114             MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
6115             MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
6116         }
6117 
6118         /** @hide */
getMovedToGlobalSettings(Set<String> outKeySet)6119         public static void getMovedToGlobalSettings(Set<String> outKeySet) {
6120             outKeySet.addAll(MOVED_TO_GLOBAL);
6121         }
6122 
6123         /** @hide */
getMovedToSystemSettings(Set<String> outKeySet)6124         public static void getMovedToSystemSettings(Set<String> outKeySet) {
6125         }
6126 
6127         /** @hide */
clearProviderForTest()6128         public static void clearProviderForTest() {
6129             sProviderHolder.clearProviderForTest();
6130             sNameValueCache.clearGenerationTrackerForTest();
6131         }
6132 
6133         /** @hide */
getPublicSettings(Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> readableKeysWithMaxTargetSdk)6134         public static void getPublicSettings(Set<String> allKeys, Set<String> readableKeys,
6135                 ArrayMap<String, Integer> readableKeysWithMaxTargetSdk) {
6136             getPublicSettingsForClass(Secure.class, allKeys, readableKeys,
6137                     readableKeysWithMaxTargetSdk);
6138         }
6139 
6140         /**
6141          * Look up a name in the database.
6142          * @param resolver to access the database with
6143          * @param name to look up in the table
6144          * @return the corresponding value, or null if not present
6145          */
getString(ContentResolver resolver, String name)6146         public static String getString(ContentResolver resolver, String name) {
6147             return getStringForUser(resolver, name, resolver.getUserId());
6148         }
6149 
6150         /** @hide */
6151         @UnsupportedAppUsage
getStringForUser(ContentResolver resolver, String name, int userHandle)6152         public static String getStringForUser(ContentResolver resolver, String name,
6153                 int userHandle) {
6154             if (MOVED_TO_GLOBAL.contains(name)) {
6155                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
6156                         + " to android.provider.Settings.Global.");
6157                 return Global.getStringForUser(resolver, name, userHandle);
6158             }
6159 
6160             if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
6161                 synchronized (Secure.class) {
6162                     if (sLockSettings == null) {
6163                         sLockSettings = ILockSettings.Stub.asInterface(
6164                                 (IBinder) ServiceManager.getService("lock_settings"));
6165                         sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
6166                     }
6167                 }
6168                 if (sLockSettings != null && !sIsSystemProcess) {
6169                     // No context; use the ActivityThread's context as an approximation for
6170                     // determining the target API level.
6171                     Application application = ActivityThread.currentApplication();
6172 
6173                     boolean isPreMnc = application != null
6174                             && application.getApplicationInfo() != null
6175                             && application.getApplicationInfo().targetSdkVersion
6176                             <= VERSION_CODES.LOLLIPOP_MR1;
6177                     if (isPreMnc) {
6178                         try {
6179                             return sLockSettings.getString(name, "0", userHandle);
6180                         } catch (RemoteException re) {
6181                             // Fall through
6182                         }
6183                     } else {
6184                         throw new SecurityException("Settings.Secure." + name
6185                                 + " is deprecated and no longer accessible."
6186                                 + " See API documentation for potential replacements.");
6187                     }
6188                 }
6189             }
6190 
6191             return sNameValueCache.getStringForUser(resolver, name, userHandle);
6192         }
6193 
6194         /**
6195          * Store a name/value pair into the database. Values written by this method will be
6196          * overridden if a restore happens in the future.
6197          *
6198          * @param resolver to access the database with
6199          * @param name to store
6200          * @param value to associate with the name
6201          * @return true if the value was set, false on database errors
6202          *
6203          * @hide
6204          */
6205         @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE)
putString(ContentResolver resolver, String name, String value, boolean overrideableByRestore)6206         public static boolean putString(ContentResolver resolver, String name,
6207                 String value, boolean overrideableByRestore) {
6208             return putStringForUser(resolver, name, value, /* tag */ null, /* makeDefault */ false,
6209                     resolver.getUserId(), overrideableByRestore);
6210         }
6211 
6212         /**
6213          * Store a name/value pair into the database.
6214          * @param resolver to access the database with
6215          * @param name to store
6216          * @param value to associate with the name
6217          * @return true if the value was set, false on database errors
6218          */
putString(ContentResolver resolver, String name, String value)6219         public static boolean putString(ContentResolver resolver, String name, String value) {
6220             return putStringForUser(resolver, name, value, resolver.getUserId());
6221         }
6222 
6223         /** @hide */
6224         @UnsupportedAppUsage
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)6225         public static boolean putStringForUser(ContentResolver resolver, String name, String value,
6226                 int userHandle) {
6227             return putStringForUser(resolver, name, value, null, false, userHandle,
6228                     DEFAULT_OVERRIDEABLE_BY_RESTORE);
6229         }
6230 
6231         /** @hide */
6232         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore)6233         public static boolean putStringForUser(@NonNull ContentResolver resolver,
6234                 @NonNull String name, @Nullable String value, @Nullable String tag,
6235                 boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore) {
6236             if (MOVED_TO_GLOBAL.contains(name)) {
6237                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
6238                         + " to android.provider.Settings.Global");
6239                 return Global.putStringForUser(resolver, name, value,
6240                         tag, makeDefault, userHandle, DEFAULT_OVERRIDEABLE_BY_RESTORE);
6241             }
6242             return sNameValueCache.putStringForUser(resolver, name, value, tag,
6243                     makeDefault, userHandle, overrideableByRestore);
6244         }
6245 
6246         /**
6247          * Store a name/value pair into the database.
6248          * <p>
6249          * The method takes an optional tag to associate with the setting
6250          * which can be used to clear only settings made by your package and
6251          * associated with this tag by passing the tag to {@link
6252          * #resetToDefaults(ContentResolver, String)}. Anyone can override
6253          * the current tag. Also if another package changes the setting
6254          * then the tag will be set to the one specified in the set call
6255          * which can be null. Also any of the settings setters that do not
6256          * take a tag as an argument effectively clears the tag.
6257          * </p><p>
6258          * For example, if you set settings A and B with tags T1 and T2 and
6259          * another app changes setting A (potentially to the same value), it
6260          * can assign to it a tag T3 (note that now the package that changed
6261          * the setting is not yours). Now if you reset your changes for T1 and
6262          * T2 only setting B will be reset and A not (as it was changed by
6263          * another package) but since A did not change you are in the desired
6264          * initial state. Now if the other app changes the value of A (assuming
6265          * you registered an observer in the beginning) you would detect that
6266          * the setting was changed by another app and handle this appropriately
6267          * (ignore, set back to some value, etc).
6268          * </p><p>
6269          * Also the method takes an argument whether to make the value the
6270          * default for this setting. If the system already specified a default
6271          * value, then the one passed in here will <strong>not</strong>
6272          * be set as the default.
6273          * </p>
6274          *
6275          * @param resolver to access the database with.
6276          * @param name to store.
6277          * @param value to associate with the name.
6278          * @param tag to associate with the setting.
6279          * @param makeDefault whether to make the value the default one.
6280          * @return true if the value was set, false on database errors.
6281          *
6282          * @see #resetToDefaults(ContentResolver, String)
6283          *
6284          * @hide
6285          */
6286         @SystemApi
6287         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)6288         public static boolean putString(@NonNull ContentResolver resolver,
6289                 @NonNull String name, @Nullable String value, @Nullable String tag,
6290                 boolean makeDefault) {
6291             return putStringForUser(resolver, name, value, tag, makeDefault,
6292                     resolver.getUserId(), DEFAULT_OVERRIDEABLE_BY_RESTORE);
6293         }
6294 
6295         /**
6296          * Reset the settings to their defaults. This would reset <strong>only</strong>
6297          * settings set by the caller's package. Think of it of a way to undo your own
6298          * changes to the global settings. Passing in the optional tag will reset only
6299          * settings changed by your package and associated with this tag.
6300          *
6301          * @param resolver Handle to the content resolver.
6302          * @param tag Optional tag which should be associated with the settings to reset.
6303          *
6304          * @see #putString(ContentResolver, String, String, String, boolean)
6305          *
6306          * @hide
6307          */
6308         @SystemApi
6309         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)6310         public static void resetToDefaults(@NonNull ContentResolver resolver,
6311                 @Nullable String tag) {
6312             resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
6313                     resolver.getUserId());
6314         }
6315 
6316         /**
6317          *
6318          * Reset the settings to their defaults for a given user with a specific mode. The
6319          * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
6320          * allowing resetting the settings made by a package and associated with the tag.
6321          *
6322          * @param resolver Handle to the content resolver.
6323          * @param tag Optional tag which should be associated with the settings to reset.
6324          * @param mode The reset mode.
6325          * @param userHandle The user for which to reset to defaults.
6326          *
6327          * @see #RESET_MODE_PACKAGE_DEFAULTS
6328          * @see #RESET_MODE_UNTRUSTED_DEFAULTS
6329          * @see #RESET_MODE_UNTRUSTED_CHANGES
6330          * @see #RESET_MODE_TRUSTED_DEFAULTS
6331          *
6332          * @hide
6333          */
resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)6334         public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
6335                 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
6336             try {
6337                 Bundle arg = new Bundle();
6338                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
6339                 if (tag != null) {
6340                     arg.putString(CALL_METHOD_TAG_KEY, tag);
6341                 }
6342                 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
6343                 IContentProvider cp = sProviderHolder.getProvider(resolver);
6344                 cp.call(resolver.getAttributionSource(),
6345                         sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_SECURE, null, arg);
6346             } catch (RemoteException e) {
6347                 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
6348             }
6349         }
6350 
6351         /**
6352          * Construct the content URI for a particular name/value pair,
6353          * useful for monitoring changes with a ContentObserver.
6354          * @param name to look up in the table
6355          * @return the corresponding content URI, or null if not present
6356          */
getUriFor(String name)6357         public static Uri getUriFor(String name) {
6358             if (MOVED_TO_GLOBAL.contains(name)) {
6359                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
6360                         + " to android.provider.Settings.Global, returning global URI.");
6361                 return Global.getUriFor(Global.CONTENT_URI, name);
6362             }
6363             return getUriFor(CONTENT_URI, name);
6364         }
6365 
6366         /**
6367          * Convenience function for retrieving a single secure settings value
6368          * as an integer.  Note that internally setting values are always
6369          * stored as strings; this function converts the string to an integer
6370          * for you.  The default value will be returned if the setting is
6371          * not defined or not an integer.
6372          *
6373          * @param cr The ContentResolver to access.
6374          * @param name The name of the setting to retrieve.
6375          * @param def Value to return if the setting is not defined.
6376          *
6377          * @return The setting's current value, or 'def' if it is not defined
6378          * or not a valid integer.
6379          */
getInt(ContentResolver cr, String name, int def)6380         public static int getInt(ContentResolver cr, String name, int def) {
6381             return getIntForUser(cr, name, def, cr.getUserId());
6382         }
6383 
6384         /** @hide */
6385         @UnsupportedAppUsage
getIntForUser(ContentResolver cr, String name, int def, int userHandle)6386         public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
6387             String v = getStringForUser(cr, name, userHandle);
6388             return parseIntSettingWithDefault(v, def);
6389         }
6390 
6391         /**
6392          * Convenience function for retrieving a single secure settings value
6393          * as an integer.  Note that internally setting values are always
6394          * stored as strings; this function converts the string to an integer
6395          * for you.
6396          * <p>
6397          * This version does not take a default value.  If the setting has not
6398          * been set, or the string value is not a number,
6399          * it throws {@link SettingNotFoundException}.
6400          *
6401          * @param cr The ContentResolver to access.
6402          * @param name The name of the setting to retrieve.
6403          *
6404          * @throws SettingNotFoundException Thrown if a setting by the given
6405          * name can't be found or the setting value is not an integer.
6406          *
6407          * @return The setting's current value.
6408          */
getInt(ContentResolver cr, String name)6409         public static int getInt(ContentResolver cr, String name)
6410                 throws SettingNotFoundException {
6411             return getIntForUser(cr, name, cr.getUserId());
6412         }
6413 
6414         /** @hide */
getIntForUser(ContentResolver cr, String name, int userHandle)6415         public static int getIntForUser(ContentResolver cr, String name, int userHandle)
6416                 throws SettingNotFoundException {
6417             String v = getStringForUser(cr, name, userHandle);
6418             return parseIntSetting(v, name);
6419         }
6420 
6421         /**
6422          * Convenience function for updating a single settings value as an
6423          * integer. This will either create a new entry in the table if the
6424          * given name does not exist, or modify the value of the existing row
6425          * with that name.  Note that internally setting values are always
6426          * stored as strings, so this function converts the given value to a
6427          * string before storing it.
6428          *
6429          * @param cr The ContentResolver to access.
6430          * @param name The name of the setting to modify.
6431          * @param value The new value for the setting.
6432          * @return true if the value was set, false on database errors
6433          */
putInt(ContentResolver cr, String name, int value)6434         public static boolean putInt(ContentResolver cr, String name, int value) {
6435             return putIntForUser(cr, name, value, cr.getUserId());
6436         }
6437 
6438         /** @hide */
6439         @UnsupportedAppUsage
putIntForUser(ContentResolver cr, String name, int value, int userHandle)6440         public static boolean putIntForUser(ContentResolver cr, String name, int value,
6441                 int userHandle) {
6442             return putStringForUser(cr, name, Integer.toString(value), userHandle);
6443         }
6444 
6445         /**
6446          * Convenience function for retrieving a single secure settings value
6447          * as a {@code long}.  Note that internally setting values are always
6448          * stored as strings; this function converts the string to a {@code long}
6449          * for you.  The default value will be returned if the setting is
6450          * not defined or not a {@code long}.
6451          *
6452          * @param cr The ContentResolver to access.
6453          * @param name The name of the setting to retrieve.
6454          * @param def Value to return if the setting is not defined.
6455          *
6456          * @return The setting's current value, or 'def' if it is not defined
6457          * or not a valid {@code long}.
6458          */
getLong(ContentResolver cr, String name, long def)6459         public static long getLong(ContentResolver cr, String name, long def) {
6460             return getLongForUser(cr, name, def, cr.getUserId());
6461         }
6462 
6463         /** @hide */
6464         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
getLongForUser(ContentResolver cr, String name, long def, int userHandle)6465         public static long getLongForUser(ContentResolver cr, String name, long def,
6466                 int userHandle) {
6467             String v = getStringForUser(cr, name, userHandle);
6468             return parseLongSettingWithDefault(v, def);
6469         }
6470 
6471         /**
6472          * Convenience function for retrieving a single secure settings value
6473          * as a {@code long}.  Note that internally setting values are always
6474          * stored as strings; this function converts the string to a {@code long}
6475          * for you.
6476          * <p>
6477          * This version does not take a default value.  If the setting has not
6478          * been set, or the string value is not a number,
6479          * it throws {@link SettingNotFoundException}.
6480          *
6481          * @param cr The ContentResolver to access.
6482          * @param name The name of the setting to retrieve.
6483          *
6484          * @return The setting's current value.
6485          * @throws SettingNotFoundException Thrown if a setting by the given
6486          * name can't be found or the setting value is not an integer.
6487          */
getLong(ContentResolver cr, String name)6488         public static long getLong(ContentResolver cr, String name)
6489                 throws SettingNotFoundException {
6490             return getLongForUser(cr, name, cr.getUserId());
6491         }
6492 
6493         /** @hide */
getLongForUser(ContentResolver cr, String name, int userHandle)6494         public static long getLongForUser(ContentResolver cr, String name, int userHandle)
6495                 throws SettingNotFoundException {
6496             String v = getStringForUser(cr, name, userHandle);
6497             return parseLongSetting(v, name);
6498         }
6499 
6500         /**
6501          * Convenience function for updating a secure settings value as a long
6502          * integer. This will either create a new entry in the table if the
6503          * given name does not exist, or modify the value of the existing row
6504          * with that name.  Note that internally setting values are always
6505          * stored as strings, so this function converts the given value to a
6506          * string before storing it.
6507          *
6508          * @param cr The ContentResolver to access.
6509          * @param name The name of the setting to modify.
6510          * @param value The new value for the setting.
6511          * @return true if the value was set, false on database errors
6512          */
putLong(ContentResolver cr, String name, long value)6513         public static boolean putLong(ContentResolver cr, String name, long value) {
6514             return putLongForUser(cr, name, value, cr.getUserId());
6515         }
6516 
6517         /** @hide */
6518         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
putLongForUser(ContentResolver cr, String name, long value, int userHandle)6519         public static boolean putLongForUser(ContentResolver cr, String name, long value,
6520                 int userHandle) {
6521             return putStringForUser(cr, name, Long.toString(value), userHandle);
6522         }
6523 
6524         /**
6525          * Convenience function for retrieving a single secure settings value
6526          * as a floating point number.  Note that internally setting values are
6527          * always stored as strings; this function converts the string to an
6528          * float for you. The default value will be returned if the setting
6529          * is not defined or not a valid float.
6530          *
6531          * @param cr The ContentResolver to access.
6532          * @param name The name of the setting to retrieve.
6533          * @param def Value to return if the setting is not defined.
6534          *
6535          * @return The setting's current value, or 'def' if it is not defined
6536          * or not a valid float.
6537          */
getFloat(ContentResolver cr, String name, float def)6538         public static float getFloat(ContentResolver cr, String name, float def) {
6539             return getFloatForUser(cr, name, def, cr.getUserId());
6540         }
6541 
6542         /** @hide */
getFloatForUser(ContentResolver cr, String name, float def, int userHandle)6543         public static float getFloatForUser(ContentResolver cr, String name, float def,
6544                 int userHandle) {
6545             String v = getStringForUser(cr, name, userHandle);
6546             return parseFloatSettingWithDefault(v, def);
6547         }
6548 
6549         /**
6550          * Convenience function for retrieving a single secure settings value
6551          * as a float.  Note that internally setting values are always
6552          * stored as strings; this function converts the string to a float
6553          * for you.
6554          * <p>
6555          * This version does not take a default value.  If the setting has not
6556          * been set, or the string value is not a number,
6557          * it throws {@link SettingNotFoundException}.
6558          *
6559          * @param cr The ContentResolver to access.
6560          * @param name The name of the setting to retrieve.
6561          *
6562          * @throws SettingNotFoundException Thrown if a setting by the given
6563          * name can't be found or the setting value is not a float.
6564          *
6565          * @return The setting's current value.
6566          */
getFloat(ContentResolver cr, String name)6567         public static float getFloat(ContentResolver cr, String name)
6568                 throws SettingNotFoundException {
6569             return getFloatForUser(cr, name, cr.getUserId());
6570         }
6571 
6572         /** @hide */
getFloatForUser(ContentResolver cr, String name, int userHandle)6573         public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
6574                 throws SettingNotFoundException {
6575             String v = getStringForUser(cr, name, userHandle);
6576             return parseFloatSetting(v, name);
6577         }
6578 
6579         /**
6580          * Convenience function for updating a single settings value as a
6581          * floating point number. This will either create a new entry in the
6582          * table if the given name does not exist, or modify the value of the
6583          * existing row with that name.  Note that internally setting values
6584          * are always stored as strings, so this function converts the given
6585          * value to a string before storing it.
6586          *
6587          * @param cr The ContentResolver to access.
6588          * @param name The name of the setting to modify.
6589          * @param value The new value for the setting.
6590          * @return true if the value was set, false on database errors
6591          */
putFloat(ContentResolver cr, String name, float value)6592         public static boolean putFloat(ContentResolver cr, String name, float value) {
6593             return putFloatForUser(cr, name, value, cr.getUserId());
6594         }
6595 
6596         /** @hide */
putFloatForUser(ContentResolver cr, String name, float value, int userHandle)6597         public static boolean putFloatForUser(ContentResolver cr, String name, float value,
6598                 int userHandle) {
6599             return putStringForUser(cr, name, Float.toString(value), userHandle);
6600         }
6601 
6602         /**
6603          * Control whether to enable adaptive sleep mode.
6604          * @hide
6605          */
6606         @Readable
6607         public static final String ADAPTIVE_SLEEP = "adaptive_sleep";
6608 
6609         /**
6610          * Setting key to indicate whether camera-based autorotate is enabled.
6611          *
6612          * @hide
6613          */
6614         public static final String CAMERA_AUTOROTATE = "camera_autorotate";
6615 
6616         /**
6617          * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
6618          * instead
6619          */
6620         @Deprecated
6621         public static final String DEVELOPMENT_SETTINGS_ENABLED =
6622                 Global.DEVELOPMENT_SETTINGS_ENABLED;
6623 
6624         /**
6625          * When the user has enable the option to have a "bug report" command
6626          * in the power menu.
6627          * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
6628          * @hide
6629          */
6630         @Deprecated
6631         @Readable
6632         public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
6633 
6634         /**
6635          * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
6636          */
6637         @Deprecated
6638         public static final String ADB_ENABLED = Global.ADB_ENABLED;
6639 
6640         /**
6641          * Setting to allow mock locations and location provider status to be injected into the
6642          * LocationManager service for testing purposes during application development.  These
6643          * locations and status values  override actual location and status information generated
6644          * by network, gps, or other location providers.
6645          *
6646          * @deprecated This settings is not used anymore.
6647          */
6648         @Deprecated
6649         @Readable
6650         public static final String ALLOW_MOCK_LOCATION = "mock_location";
6651 
6652         /**
6653          * This is used by Bluetooth Manager to store adapter name
6654          * @hide
6655          */
6656         @Readable(maxTargetSdk = Build.VERSION_CODES.S)
6657         @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
6658         @SuppressLint("NoSettingsProvider")
6659         public static final String BLUETOOTH_NAME = "bluetooth_name";
6660 
6661         /**
6662          * This is used by Bluetooth Manager to store adapter address
6663          * @hide
6664          */
6665         @Readable(maxTargetSdk = Build.VERSION_CODES.S)
6666         @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
6667         @SuppressLint("NoSettingsProvider")
6668         public static final String BLUETOOTH_ADDRESS = "bluetooth_address";
6669 
6670         /**
6671          * This is used by Bluetooth Manager to store whether adapter address is valid
6672          * @hide
6673          */
6674         @Readable(maxTargetSdk = Build.VERSION_CODES.S)
6675         @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
6676         @SuppressLint("NoSettingsProvider")
6677         public static final String BLUETOOTH_ADDR_VALID = "bluetooth_addr_valid";
6678 
6679         /**
6680          * This is used by LocalBluetoothLeBroadcast to store the broadcast program info.
6681          * @hide
6682          */
6683         public static final String BLUETOOTH_LE_BROADCAST_PROGRAM_INFO =
6684                 "bluetooth_le_broadcast_program_info";
6685 
6686         /**
6687          * This is used by LocalBluetoothLeBroadcast to store the broadcast code.
6688          * @hide
6689          */
6690         public static final String BLUETOOTH_LE_BROADCAST_CODE = "bluetooth_le_broadcast_code";
6691 
6692         /**
6693          * This is used by LocalBluetoothLeBroadcast to store the app source name.
6694          * @hide
6695          */
6696         public static final String BLUETOOTH_LE_BROADCAST_APP_SOURCE_NAME =
6697                 "bluetooth_le_broadcast_app_source_name";
6698 
6699         /**
6700          * Setting to indicate that on device captions are enabled.
6701          *
6702          * @hide
6703          */
6704         @SystemApi
6705         @Readable
6706         public static final String ODI_CAPTIONS_ENABLED = "odi_captions_enabled";
6707 
6708 
6709         /**
6710          * Setting to indicate live caption button show or hide in the volume
6711          * rocker.
6712          *
6713          * @hide
6714          */
6715         public static final String ODI_CAPTIONS_VOLUME_UI_ENABLED =
6716                 "odi_captions_volume_ui_enabled";
6717 
6718         /**
6719          * On Android 8.0 (API level 26) and higher versions of the platform,
6720          * a 64-bit number (expressed as a hexadecimal string), unique to
6721          * each combination of app-signing key, user, and device.
6722          * Values of {@code ANDROID_ID} are scoped by signing key and user.
6723          * The value may change if a factory reset is performed on the
6724          * device or if an APK signing key changes.
6725          *
6726          * For more information about how the platform handles {@code ANDROID_ID}
6727          * in Android 8.0 (API level 26) and higher, see <a
6728          * href="{@docRoot}about/versions/oreo/android-8.0-changes.html#privacy-all">
6729          * Android 8.0 Behavior Changes</a>.
6730          *
6731          * <p class="note"><strong>Note:</strong> For apps that were installed
6732          * prior to updating the device to a version of Android 8.0
6733          * (API level 26) or higher, the value of {@code ANDROID_ID} changes
6734          * if the app is uninstalled and then reinstalled after the OTA.
6735          * To preserve values across uninstalls after an OTA to Android 8.0
6736          * or higher, developers can use
6737          * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html">
6738          * Key/Value Backup</a>.</p>
6739          *
6740          * <p>In versions of the platform lower than Android 8.0 (API level 26),
6741          * a 64-bit number (expressed as a hexadecimal string) that is randomly
6742          * generated when the user first sets up the device and should remain
6743          * constant for the lifetime of the user's device.
6744          *
6745          * On devices that have
6746          * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">
6747          * multiple users</a>, each user appears as a
6748          * completely separate device, so the {@code ANDROID_ID} value is
6749          * unique to each user.</p>
6750          *
6751          * <p class="note"><strong>Note:</strong> If the caller is an Instant App the ID is scoped
6752          * to the Instant App, it is generated when the Instant App is first installed and reset if
6753          * the user clears the Instant App.
6754          */
6755         @Readable
6756         public static final String ANDROID_ID = "android_id";
6757 
6758         /**
6759          * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
6760          */
6761         @Deprecated
6762         public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
6763 
6764         /**
6765          * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
6766          */
6767         @Deprecated
6768         public static final String DATA_ROAMING = Global.DATA_ROAMING;
6769 
6770         /**
6771          * Stores {@link android.view.inputmethod.InputMethodInfo#getId()} of the input method
6772          * service that is currently selected.
6773          *
6774          * <p>Although the name {@link #DEFAULT_INPUT_METHOD} implies that there is a concept of
6775          * <i>default</i> input method, in reality this setting is no more or less than the
6776          * <strong>currently selected</strong> input method. This setting can be updated at any
6777          * time as a result of user-initiated and system-initiated input method switching.</p>
6778          *
6779          * <p>Use {@link ComponentName#unflattenFromString(String)} to parse the stored value.</p>
6780          */
6781         @Readable
6782         public static final String DEFAULT_INPUT_METHOD = "default_input_method";
6783 
6784         /**
6785          * Setting to record the input method subtype used by default, holding the ID
6786          * of the desired method.
6787          */
6788         @Readable
6789         public static final String SELECTED_INPUT_METHOD_SUBTYPE =
6790                 "selected_input_method_subtype";
6791 
6792         /**
6793          * The {@link android.view.inputmethod.InputMethodInfo.InputMethodInfo#getId() ID} of the
6794          * default voice input method.
6795          * <p>
6796          * This stores the last known default voice IME. If the related system config value changes,
6797          * this is reset by InputMethodManagerService.
6798          * <p>
6799          * This IME is not necessarily in the enabled IME list. That state is still stored in
6800          * {@link #ENABLED_INPUT_METHODS}.
6801          *
6802          * @hide
6803          */
6804         public static final String DEFAULT_VOICE_INPUT_METHOD = "default_voice_input_method";
6805 
6806         /**
6807          * Setting to record the history of input method subtype, holding the pair of ID of IME
6808          * and its last used subtype.
6809          * @hide
6810          */
6811         @Readable
6812         public static final String INPUT_METHODS_SUBTYPE_HISTORY =
6813                 "input_methods_subtype_history";
6814 
6815         /**
6816          * Setting to record the visibility of input method selector
6817          */
6818         @Readable
6819         public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
6820                 "input_method_selector_visibility";
6821 
6822         /**
6823          * The currently selected voice interaction service flattened ComponentName.
6824          * @hide
6825          */
6826         @TestApi
6827         @Readable
6828         public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
6829 
6830         /**
6831          * The currently selected autofill service flattened ComponentName.
6832          * @hide
6833          */
6834         @TestApi
6835         @Readable
6836         public static final String AUTOFILL_SERVICE = "autofill_service";
6837 
6838         /**
6839          * Boolean indicating if Autofill supports field classification.
6840          *
6841          * @see android.service.autofill.AutofillService
6842          *
6843          * @hide
6844          */
6845         @SystemApi
6846         @Readable
6847         public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION =
6848                 "autofill_field_classification";
6849 
6850         /**
6851          * Boolean indicating if the dark mode dialog shown on first toggle has been seen.
6852          *
6853          * @hide
6854          */
6855         @Readable
6856         public static final String DARK_MODE_DIALOG_SEEN =
6857                 "dark_mode_dialog_seen";
6858 
6859         /**
6860          * Custom time when Dark theme is scheduled to activate.
6861          * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
6862          * @hide
6863          */
6864         @Readable
6865         public static final String DARK_THEME_CUSTOM_START_TIME =
6866                 "dark_theme_custom_start_time";
6867 
6868         /**
6869          * Custom time when Dark theme is scheduled to deactivate.
6870          * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
6871          * @hide
6872          */
6873         @Readable
6874         public static final String DARK_THEME_CUSTOM_END_TIME =
6875                 "dark_theme_custom_end_time";
6876 
6877         /**
6878          * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}.
6879          *
6880          * @hide
6881          */
6882         @SystemApi
6883         @Readable
6884         public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE =
6885                 "autofill_user_data_max_user_data_size";
6886 
6887         /**
6888          * Defines value returned by
6889          * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}.
6890          *
6891          * @hide
6892          */
6893         @SystemApi
6894         @Readable
6895         public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE =
6896                 "autofill_user_data_max_field_classification_size";
6897 
6898         /**
6899          * Defines value returned by
6900          * {@link android.service.autofill.UserData#getMaxCategoryCount()}.
6901          *
6902          * @hide
6903          */
6904         @SystemApi
6905         @Readable
6906         public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT =
6907                 "autofill_user_data_max_category_count";
6908 
6909         /**
6910          * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}.
6911          *
6912          * @hide
6913          */
6914         @SystemApi
6915         @Readable
6916         public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH =
6917                 "autofill_user_data_max_value_length";
6918 
6919         /**
6920          * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}.
6921          *
6922          * @hide
6923          */
6924         @SystemApi
6925         @Readable
6926         public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH =
6927                 "autofill_user_data_min_value_length";
6928 
6929         /**
6930          * Defines whether Content Capture is enabled for the user.
6931          *
6932          * <p>Type: {@code int} ({@code 0} for disabled, {@code 1} for enabled).
6933          * <p>Default: enabled
6934          *
6935          * @hide
6936          */
6937         @TestApi
6938         @Readable
6939         public static final String CONTENT_CAPTURE_ENABLED = "content_capture_enabled";
6940 
6941         /**
6942          * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
6943          */
6944         @Deprecated
6945         public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
6946 
6947         /**
6948          * Indicates whether a DPC has been downloaded during provisioning.
6949          *
6950          * <p>Type: int (0 for false, 1 for true)
6951          *
6952          * <p>If this is true, then any attempts to begin setup again should result in factory reset
6953          *
6954          * @hide
6955          */
6956         @Readable
6957         public static final String MANAGED_PROVISIONING_DPC_DOWNLOADED =
6958                 "managed_provisioning_dpc_downloaded";
6959 
6960         /**
6961          * Indicates whether the device is under restricted secure FRP mode.
6962          * Secure FRP mode is enabled when the device is under FRP. On solving of FRP challenge,
6963          * device is removed from this mode.
6964          * <p>
6965          * Type: int (0 for false, 1 for true)
6966          */
6967         @Readable
6968         public static final String SECURE_FRP_MODE = "secure_frp_mode";
6969 
6970         /**
6971          * Indicates whether the current user has completed setup via the setup wizard.
6972          * <p>
6973          * Type: int (0 for false, 1 for true)
6974          *
6975          * @hide
6976          */
6977         @SystemApi
6978         @Readable
6979         public static final String USER_SETUP_COMPLETE = "user_setup_complete";
6980 
6981         /**
6982          * Indicates that the user has not started setup personalization.
6983          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
6984          *
6985          * @hide
6986          */
6987         @SystemApi
6988         public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0;
6989 
6990         /**
6991          * Indicates that the user has not yet completed setup personalization.
6992          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
6993          *
6994          * @hide
6995          */
6996         @SystemApi
6997         public static final int USER_SETUP_PERSONALIZATION_STARTED = 1;
6998 
6999         /**
7000          * Indicates that the user has snoozed personalization and will complete it later.
7001          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
7002          *
7003          * @hide
7004          */
7005         @SystemApi
7006         public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2;
7007 
7008         /**
7009          * Indicates that the user has completed setup personalization.
7010          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
7011          *
7012          * @hide
7013          */
7014         @SystemApi
7015         public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10;
7016 
7017         /** @hide */
7018         @Retention(RetentionPolicy.SOURCE)
7019         @IntDef({
7020                 USER_SETUP_PERSONALIZATION_NOT_STARTED,
7021                 USER_SETUP_PERSONALIZATION_STARTED,
7022                 USER_SETUP_PERSONALIZATION_PAUSED,
7023                 USER_SETUP_PERSONALIZATION_COMPLETE
7024         })
7025         public @interface UserSetupPersonalization {}
7026 
7027         /**
7028          * Defines the user's current state of device personalization.
7029          * The possible states are defined in {@link UserSetupPersonalization}.
7030          *
7031          * @hide
7032          */
7033         @SystemApi
7034         @Readable
7035         public static final String USER_SETUP_PERSONALIZATION_STATE =
7036                 "user_setup_personalization_state";
7037 
7038         /**
7039          * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
7040          * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0
7041          * in case SetupWizard has been re-enabled on TV devices.
7042          *
7043          * @hide
7044          */
7045         @Readable
7046         public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete";
7047 
7048         /**
7049          * The prefix for a category name that indicates whether a suggested action from that
7050          * category was marked as completed.
7051          * <p>
7052          * Type: int (0 for false, 1 for true)
7053          *
7054          * @hide
7055          */
7056         @SystemApi
7057         @Readable
7058         public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
7059 
7060         /**
7061          * Whether or not compress blocks should be released on install.
7062          * <p>The setting only determines if the platform will attempt to release
7063          * compress blocks; it does not guarantee that the files will have their
7064          * compress blocks released. Compression is currently only supported on
7065          * some f2fs filesystems.
7066          * <p>
7067          * Type: int (0 for false, 1 for true)
7068          *
7069          * @hide
7070          */
7071         public static final String RELEASE_COMPRESS_BLOCKS_ON_INSTALL =
7072                 "release_compress_blocks_on_install";
7073 
7074         /**
7075          * List of input methods that are currently enabled.  This is a string
7076          * containing the IDs of all enabled input methods, each ID separated
7077          * by ':'.
7078          *
7079          * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0"
7080          * where imeId is ComponentName and subtype is int32.
7081          */
7082         @Readable
7083         public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
7084 
7085         /**
7086          * List of system input methods that are currently disabled.  This is a string
7087          * containing the IDs of all disabled input methods, each ID separated
7088          * by ':'.
7089          * @hide
7090          */
7091         @Readable
7092         public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
7093 
7094         /**
7095          * Whether to show the IME when a hard keyboard is connected. This is a boolean that
7096          * determines if the IME should be shown when a hard keyboard is attached.
7097          * @hide
7098          */
7099         @TestApi
7100         @Readable
7101         @SuppressLint("NoSettingsProvider")
7102         public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
7103 
7104         /**
7105          * Host name and port for global http proxy. Uses ':' seperator for
7106          * between host and port.
7107          *
7108          * @deprecated Use {@link Global#HTTP_PROXY}
7109          */
7110         @Deprecated
7111         public static final String HTTP_PROXY = Global.HTTP_PROXY;
7112 
7113         /**
7114          * Package designated as always-on VPN provider.
7115          *
7116          * @hide
7117          */
7118         public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app";
7119 
7120         /**
7121          * Whether to block networking outside of VPN connections while always-on is set.
7122          * @see #ALWAYS_ON_VPN_APP
7123          *
7124          * @hide
7125          */
7126         @Readable
7127         public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown";
7128 
7129         /**
7130          * Comma separated list of packages that are allowed to access the network when VPN is in
7131          * lockdown mode but not running.
7132          * @see #ALWAYS_ON_VPN_LOCKDOWN
7133          *
7134          * @hide
7135          */
7136         @Readable(maxTargetSdk = Build.VERSION_CODES.S)
7137         public static final String ALWAYS_ON_VPN_LOCKDOWN_WHITELIST =
7138                 "always_on_vpn_lockdown_whitelist";
7139 
7140         /**
7141          * Whether applications can be installed for this user via the system's
7142          * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
7143          *
7144          * <p>1 = permit app installation via the system package installer intent
7145          * <p>0 = do not allow use of the package installer
7146          * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use
7147          * {@link PackageManager#canRequestPackageInstalls()}
7148          * @see PackageManager#canRequestPackageInstalls()
7149          */
7150         @Deprecated
7151         @Readable
7152         public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
7153 
7154         /**
7155          * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that
7156          * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it
7157          * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES}
7158          * on behalf of the profile owner if needed to make the change transparent for profile
7159          * owners.
7160          *
7161          * @hide
7162          */
7163         @Readable
7164         public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED =
7165                 "unknown_sources_default_reversed";
7166 
7167         /**
7168          * Comma-separated list of location providers that are enabled. Do not rely on this value
7169          * being present or correct, or on ContentObserver notifications on the corresponding Uri.
7170          *
7171          * @deprecated This setting no longer exists from Android S onwards as it no longer is
7172          * capable of realistically reflecting location settings. Use {@link
7173          * LocationManager#isProviderEnabled(String)} or {@link LocationManager#isLocationEnabled()}
7174          * instead.
7175          */
7176         @Deprecated
7177         @Readable
7178         public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
7179 
7180         /**
7181          * The current location mode of the device. Do not rely on this value being present or on
7182          * ContentObserver notifications on the corresponding Uri.
7183          *
7184          * @deprecated The preferred methods for checking location mode and listening for changes
7185          * are via {@link LocationManager#isLocationEnabled()} and
7186          * {@link LocationManager#MODE_CHANGED_ACTION}.
7187          */
7188         @Deprecated
7189         @Readable
7190         public static final String LOCATION_MODE = "location_mode";
7191 
7192         /**
7193          * The App or module that changes the location mode.
7194          * @hide
7195          */
7196         @Readable
7197         public static final String LOCATION_CHANGER = "location_changer";
7198 
7199         /**
7200          * The location changer is unknown or unable to detect.
7201          * @hide
7202          */
7203         public static final int LOCATION_CHANGER_UNKNOWN = 0;
7204 
7205         /**
7206          * Location settings in system settings.
7207          * @hide
7208          */
7209         public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1;
7210 
7211         /**
7212          * The location icon in drop down notification drawer.
7213          * @hide
7214          */
7215         public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2;
7216 
7217         /**
7218          * Location mode is off.
7219          */
7220         public static final int LOCATION_MODE_OFF = 0;
7221 
7222         /**
7223          * This mode no longer has any distinct meaning, but is interpreted as the location mode is
7224          * on.
7225          *
7226          * @deprecated See {@link #LOCATION_MODE}.
7227          */
7228         @Deprecated
7229         public static final int LOCATION_MODE_SENSORS_ONLY = 1;
7230 
7231         /**
7232          * This mode no longer has any distinct meaning, but is interpreted as the location mode is
7233          * on.
7234          *
7235          * @deprecated See {@link #LOCATION_MODE}.
7236          */
7237         @Deprecated
7238         public static final int LOCATION_MODE_BATTERY_SAVING = 2;
7239 
7240         /**
7241          * This mode no longer has any distinct meaning, but is interpreted as the location mode is
7242          * on.
7243          *
7244          * @deprecated See {@link #LOCATION_MODE}.
7245          */
7246         @Deprecated
7247         public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
7248 
7249         /**
7250          * Location mode is on.
7251          *
7252          * @hide
7253          */
7254         @SystemApi
7255         public static final int LOCATION_MODE_ON = LOCATION_MODE_HIGH_ACCURACY;
7256 
7257         /**
7258          * The current location time zone detection enabled state for the user.
7259          *
7260          * See {@link android.app.time.TimeManager#getTimeZoneCapabilitiesAndConfig} for access.
7261          * See {@link android.app.time.TimeManager#updateTimeZoneConfiguration} to update.
7262          * @hide
7263          */
7264         public static final String LOCATION_TIME_ZONE_DETECTION_ENABLED =
7265                 "location_time_zone_detection_enabled";
7266 
7267         /**
7268          * The accuracy in meters used for coarsening location for clients with only the coarse
7269          * location permission.
7270          *
7271          * @hide
7272          */
7273         @Readable
7274         public static final String LOCATION_COARSE_ACCURACY_M = "locationCoarseAccuracy";
7275 
7276         /**
7277          * Whether or not to show display system location accesses.
7278          * @hide
7279          */
7280         public static final String LOCATION_SHOW_SYSTEM_OPS = "locationShowSystemOps";
7281 
7282         /**
7283          * A flag containing settings used for biometric weak
7284          * @hide
7285          */
7286         @Deprecated
7287         @Readable
7288         public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
7289                 "lock_biometric_weak_flags";
7290 
7291         /**
7292          * Whether lock-to-app will lock the keyguard when exiting.
7293          * @hide
7294          */
7295         @Readable
7296         public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
7297 
7298         /**
7299          * Whether autolock is enabled (0 = false, 1 = true)
7300          *
7301          * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
7302          *             level of the keyguard. Accessing this setting from an app that is targeting
7303          *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
7304          */
7305         @Deprecated
7306         @Readable
7307         public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
7308 
7309         /**
7310          * Whether lock pattern is visible as user enters (0 = false, 1 = true)
7311          *
7312          * @deprecated Accessing this setting from an app that is targeting
7313          *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
7314          */
7315         @Deprecated
7316         @Readable
7317         public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
7318 
7319         /**
7320          * Whether lock pattern will vibrate as user enters (0 = false, 1 =
7321          * true)
7322          *
7323          * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
7324          *             lockscreen uses
7325          *             {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
7326          *             Accessing this setting from an app that is targeting
7327          *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
7328          */
7329         @Deprecated
7330         @Readable
7331         public static final String
7332                 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
7333 
7334         /**
7335          * This preference allows the device to be locked given time after screen goes off,
7336          * subject to current DeviceAdmin policy limits.
7337          * @hide
7338          */
7339         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
7340         @Readable
7341         public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
7342 
7343 
7344         /**
7345          * This preference contains the string that shows for owner info on LockScreen.
7346          * @hide
7347          * @deprecated
7348          */
7349         @Deprecated
7350         @Readable
7351         public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
7352 
7353         /**
7354          * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
7355          * @hide
7356          */
7357         @Deprecated
7358         @Readable
7359         public static final String LOCK_SCREEN_APPWIDGET_IDS =
7360             "lock_screen_appwidget_ids";
7361 
7362         /**
7363          * Id of the appwidget shown on the lock screen when appwidgets are disabled.
7364          * @hide
7365          */
7366         @Deprecated
7367         @Readable
7368         public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
7369             "lock_screen_fallback_appwidget_id";
7370 
7371         /**
7372          * Index of the lockscreen appwidget to restore, -1 if none.
7373          * @hide
7374          */
7375         @Deprecated
7376         @Readable
7377         public static final String LOCK_SCREEN_STICKY_APPWIDGET =
7378             "lock_screen_sticky_appwidget";
7379 
7380         /**
7381          * This preference enables showing the owner info on LockScreen.
7382          * @hide
7383          * @deprecated
7384          */
7385         @Deprecated
7386         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
7387         @Readable
7388         public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
7389             "lock_screen_owner_info_enabled";
7390 
7391         /**
7392          * Indicates whether the user has allowed notifications to be shown atop a securely locked
7393          * screen in their full "private" form (same as when the device is unlocked).
7394          * <p>
7395          * Type: int (0 for false, 1 for true)
7396          *
7397          * @hide
7398          */
7399         @SystemApi
7400         @Readable
7401         public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
7402                 "lock_screen_allow_private_notifications";
7403 
7404         /**
7405          * When set by a user, allows notification remote input atop a securely locked screen
7406          * without having to unlock
7407          * @hide
7408          */
7409         @Readable
7410         public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT =
7411                 "lock_screen_allow_remote_input";
7412 
7413         /**
7414          * Indicates which clock face to show on lock screen and AOD formatted as a serialized
7415          * {@link org.json.JSONObject} with the format:
7416          *     {"clock": id, "_applied_timestamp": timestamp}
7417          * @hide
7418          */
7419         @Readable
7420         public static final String LOCK_SCREEN_CUSTOM_CLOCK_FACE = "lock_screen_custom_clock_face";
7421 
7422         /**
7423          * Indicates which clock face to show on lock screen and AOD while docked.
7424          * @hide
7425          */
7426         @Readable
7427         public static final String DOCKED_CLOCK_FACE = "docked_clock_face";
7428 
7429         /**
7430          * Set by the system to track if the user needs to see the call to action for
7431          * the lockscreen notification policy.
7432          * @hide
7433          */
7434         @Readable
7435         public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
7436                 "show_note_about_notification_hiding";
7437 
7438         /**
7439          * Set to 1 by the system after trust agents have been initialized.
7440          * @hide
7441          */
7442         @Readable
7443         public static final String TRUST_AGENTS_INITIALIZED =
7444                 "trust_agents_initialized";
7445 
7446         /**
7447          * Set to 1 by the system after the list of known trust agents have been initialized.
7448          * @hide
7449          */
7450         public static final String KNOWN_TRUST_AGENTS_INITIALIZED =
7451                 "known_trust_agents_initialized";
7452 
7453         /**
7454          * The Logging ID (a unique 64-bit value) as a hex string.
7455          * Used as a pseudonymous identifier for logging.
7456          * @deprecated This identifier is poorly initialized and has
7457          * many collisions.  It should not be used.
7458          */
7459         @Deprecated
7460         @Readable
7461         public static final String LOGGING_ID = "logging_id";
7462 
7463         /**
7464          * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
7465          */
7466         @Deprecated
7467         public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
7468 
7469         /**
7470          * No longer supported.
7471          */
7472         @Readable
7473         public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
7474 
7475         /**
7476          * No longer supported.
7477          */
7478         @Readable
7479         public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
7480 
7481         /**
7482          * No longer supported.
7483          */
7484         @Readable
7485         public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
7486 
7487         /**
7488          * Settings classname to launch when Settings is clicked from All
7489          * Applications.  Needed because of user testing between the old
7490          * and new Settings apps.
7491          */
7492         // TODO: 881807
7493         @Readable
7494         public static final String SETTINGS_CLASSNAME = "settings_classname";
7495 
7496         /**
7497          * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
7498          */
7499         @Deprecated
7500         public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
7501 
7502         /**
7503          * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
7504          */
7505         @Deprecated
7506         public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
7507 
7508         /**
7509          * If accessibility is enabled.
7510          */
7511         @Readable
7512         public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
7513 
7514         /**
7515          * Whether select sound track with audio description by default.
7516          * @hide
7517          */
7518         public static final String ENABLED_ACCESSIBILITY_AUDIO_DESCRIPTION_BY_DEFAULT =
7519                 "enabled_accessibility_audio_description_by_default";
7520 
7521         /**
7522          * Setting specifying if the accessibility shortcut is enabled.
7523          * @hide
7524          */
7525         @Readable
7526         public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN =
7527                 "accessibility_shortcut_on_lock_screen";
7528 
7529         /**
7530          * Setting specifying if the accessibility shortcut dialog has been shown to this user.
7531          * @hide
7532          */
7533         @Readable
7534         public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN =
7535                 "accessibility_shortcut_dialog_shown";
7536 
7537         /**
7538          * Setting specifying if the timeout restriction
7539          * {@link ViewConfiguration#getAccessibilityShortcutKeyTimeout()}
7540          * of the accessibility shortcut dialog is skipped.
7541          *
7542          * @hide
7543          */
7544         public static final String SKIP_ACCESSIBILITY_SHORTCUT_DIALOG_TIMEOUT_RESTRICTION =
7545                 "skip_accessibility_shortcut_dialog_timeout_restriction";
7546 
7547         /**
7548          * Setting specifying the accessibility services, accessibility shortcut targets,
7549          * or features to be toggled via the accessibility shortcut.
7550          *
7551          * <p> This is a colon-separated string list which contains the flattened
7552          * {@link ComponentName} and the class name of a system class implementing a supported
7553          * accessibility feature.
7554          * @hide
7555          */
7556         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
7557         @TestApi
7558         @Readable
7559         public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE =
7560                 "accessibility_shortcut_target_service";
7561 
7562         /**
7563          * Setting specifying the accessibility service or feature to be toggled via the
7564          * accessibility button in the navigation bar. This is either a flattened
7565          * {@link ComponentName} or the class name of a system class implementing a supported
7566          * accessibility feature.
7567          * @hide
7568          */
7569         @Readable
7570         public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT =
7571                 "accessibility_button_target_component";
7572 
7573         /**
7574          * Setting specifying the accessibility services, accessibility shortcut targets,
7575          * or features to be toggled via the accessibility button in the navigation bar.
7576          *
7577          * <p> This is a colon-separated string list which contains the flattened
7578          * {@link ComponentName} and the class name of a system class implementing a supported
7579          * accessibility feature.
7580          * @hide
7581          */
7582         @Readable
7583         public static final String ACCESSIBILITY_BUTTON_TARGETS = "accessibility_button_targets";
7584 
7585         /**
7586          * The system class name of magnification controller which is a target to be toggled via
7587          * accessibility shortcut or accessibility button.
7588          *
7589          * @hide
7590          */
7591         @Readable
7592         public static final String ACCESSIBILITY_SHORTCUT_TARGET_MAGNIFICATION_CONTROLLER =
7593                 "com.android.server.accessibility.MagnificationController";
7594 
7595         /**
7596          * If touch exploration is enabled.
7597          */
7598         @Readable
7599         public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
7600 
7601         /**
7602          * List of the enabled accessibility providers.
7603          */
7604         @Readable
7605         public static final String ENABLED_ACCESSIBILITY_SERVICES =
7606             "enabled_accessibility_services";
7607 
7608         /**
7609          * List of the notified non-accessibility category accessibility services.
7610          *
7611          * @hide
7612          */
7613         @Readable
7614         public static final String NOTIFIED_NON_ACCESSIBILITY_CATEGORY_SERVICES =
7615                 "notified_non_accessibility_category_services";
7616 
7617         /**
7618          * List of the accessibility services to which the user has granted
7619          * permission to put the device into touch exploration mode.
7620          *
7621          * @hide
7622          */
7623         @Readable
7624         public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
7625             "touch_exploration_granted_accessibility_services";
7626 
7627         /**
7628          * Is talkback service enabled or not. 0 == no, 1 == yes
7629          *
7630          * @hide
7631          */
7632         public static final String WEAR_TALKBACK_ENABLED = "wear_talkback_enabled";
7633 
7634         /**
7635          * Whether the Global Actions Panel is enabled.
7636          * @hide
7637          */
7638         @Readable
7639         public static final String GLOBAL_ACTIONS_PANEL_ENABLED = "global_actions_panel_enabled";
7640 
7641         /**
7642          * Whether the Global Actions Panel can be toggled on or off in Settings.
7643          * @hide
7644          */
7645         @Readable
7646         public static final String GLOBAL_ACTIONS_PANEL_AVAILABLE =
7647                 "global_actions_panel_available";
7648 
7649         /**
7650          * Enables debug mode for the Global Actions Panel.
7651          * @hide
7652          */
7653         @Readable
7654         public static final String GLOBAL_ACTIONS_PANEL_DEBUG_ENABLED =
7655                 "global_actions_panel_debug_enabled";
7656 
7657         /**
7658          * Whether the hush gesture has ever been used
7659          * @hide
7660          */
7661         @SystemApi
7662         @Readable
7663         public static final String HUSH_GESTURE_USED = "hush_gesture_used";
7664 
7665         /**
7666          * Number of times the user has manually clicked the ringer toggle
7667          * @hide
7668          */
7669         @Readable
7670         public static final String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count";
7671 
7672         /**
7673          * Whether to play a sound for charging events.
7674          * @hide
7675          */
7676         @Readable
7677         public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
7678 
7679         /**
7680          * Whether to vibrate for charging events.
7681          * @hide
7682          */
7683         @Readable
7684         public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled";
7685 
7686         /**
7687          * If 0, turning on dnd manually will last indefinitely.
7688          * Else if non-negative, turning on dnd manually will last for this many minutes.
7689          * Else (if negative), turning on dnd manually will surface a dialog that prompts
7690          * user to specify a duration.
7691          * @hide
7692          */
7693         @Readable
7694         public static final String ZEN_DURATION = "zen_duration";
7695 
7696         /** @hide */ public static final int ZEN_DURATION_PROMPT = -1;
7697         /** @hide */ public static final int ZEN_DURATION_FOREVER = 0;
7698 
7699         /**
7700          * If nonzero, will show the zen upgrade notification when the user toggles DND on/off.
7701          * @hide
7702          */
7703         @Readable
7704         public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";
7705 
7706         /**
7707          * If nonzero, will show the zen update settings suggestion.
7708          * @hide
7709          */
7710         @Readable
7711         public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion";
7712 
7713         /**
7714          * If nonzero, zen has not been updated to reflect new changes.
7715          * @hide
7716          */
7717         @Readable
7718         public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated";
7719 
7720         /**
7721          * If nonzero, zen setting suggestion has been viewed by user
7722          * @hide
7723          */
7724         @Readable
7725         public static final String ZEN_SETTINGS_SUGGESTION_VIEWED =
7726                 "zen_settings_suggestion_viewed";
7727 
7728         /**
7729          * Whether the in call notification is enabled to play sound during calls.  The value is
7730          * boolean (1 or 0).
7731          * @hide
7732          */
7733         @Readable
7734         public static final String IN_CALL_NOTIFICATION_ENABLED = "in_call_notification_enabled";
7735 
7736         /**
7737          * Uri of the slice that's presented on the keyguard.
7738          * Defaults to a slice with the date and next alarm.
7739          *
7740          * @hide
7741          */
7742         @Readable
7743         public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri";
7744 
7745         /**
7746          * The adjustment in font weight. This is used to draw text in bold.
7747          *
7748          * <p> This value can be negative. To display bolded text, the adjustment used is 300,
7749          * which is the difference between
7750          * {@link android.graphics.fonts.FontStyle#FONT_WEIGHT_NORMAL} and
7751          * {@link android.graphics.fonts.FontStyle#FONT_WEIGHT_BOLD}.
7752          *
7753          * @hide
7754          */
7755         @Readable
7756         public static final String FONT_WEIGHT_ADJUSTMENT = "font_weight_adjustment";
7757 
7758         /**
7759          * Whether to speak passwords while in accessibility mode.
7760          *
7761          * @deprecated The speaking of passwords is controlled by individual accessibility services.
7762          * Apps should ignore this setting and provide complete information to accessibility
7763          * at all times, which was the behavior when this value was {@code true}.
7764          */
7765         @Deprecated
7766         @Readable
7767         public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
7768 
7769         /**
7770          * Whether to draw text with high contrast while in accessibility mode.
7771          *
7772          * @hide
7773          */
7774         @Readable
7775         public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
7776                 "high_text_contrast_enabled";
7777 
7778         /**
7779          * The color contrast, float in [-1, 1], 1 being the highest contrast.
7780          *
7781          * @hide
7782          */
7783         public static final String CONTRAST_LEVEL = "contrast_level";
7784 
7785         /**
7786          * Setting that specifies whether the display magnification is enabled via a system-wide
7787          * triple tap gesture. Display magnifications allows the user to zoom in the display content
7788          * and is targeted to low vision users. The current magnification scale is controlled by
7789          * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
7790          *
7791          * @hide
7792          */
7793         @UnsupportedAppUsage
7794         @TestApi
7795         @Readable
7796         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
7797                 "accessibility_display_magnification_enabled";
7798 
7799         /**
7800          * Setting that specifies whether the display magnification is enabled via a shortcut
7801          * affordance within the system's navigation area. Display magnifications allows the user to
7802          * zoom in the display content and is targeted to low vision users. The current
7803          * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
7804          *
7805          * @deprecated Use {@link #ACCESSIBILITY_BUTTON_TARGETS} instead.
7806          * {@link #ACCESSIBILITY_BUTTON_TARGETS} holds the magnification system class name
7807          * when navigation bar magnification is enabled.
7808          * @hide
7809          */
7810         @SystemApi
7811         @Readable
7812         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED =
7813                 "accessibility_display_magnification_navbar_enabled";
7814 
7815         /**
7816          * Setting that specifies what the display magnification scale is.
7817          * Display magnifications allows the user to zoom in the display
7818          * content and is targeted to low vision users. Whether a display
7819          * magnification is performed is controlled by
7820          * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and
7821          * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED}
7822          *
7823          * @hide
7824          */
7825         @Readable
7826         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
7827                 "accessibility_display_magnification_scale";
7828 
7829         /**
7830          * Unused mangnification setting
7831          *
7832          * @hide
7833          * @deprecated
7834          */
7835         @Deprecated
7836         @Readable
7837         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
7838                 "accessibility_display_magnification_auto_update";
7839 
7840         /**
7841          * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be
7842          * modified from an AccessibilityService using the SoftKeyboardController.
7843          *
7844          * @hide
7845          */
7846         @Readable
7847         public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE =
7848                 "accessibility_soft_keyboard_mode";
7849 
7850         /**
7851          * Default soft keyboard behavior.
7852          *
7853          * @hide
7854          */
7855         public static final int SHOW_MODE_AUTO = 0;
7856 
7857         /**
7858          * Soft keyboard is never shown.
7859          *
7860          * @hide
7861          */
7862         public static final int SHOW_MODE_HIDDEN = 1;
7863 
7864         /**
7865          * Setting that specifies whether timed text (captions) should be
7866          * displayed in video content. Text display properties are controlled by
7867          * the following settings:
7868          * <ul>
7869          * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
7870          * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
7871          * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
7872          * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
7873          * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
7874          * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
7875          * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
7876          * </ul>
7877          *
7878          * @hide
7879          */
7880         @Readable
7881         public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
7882                 "accessibility_captioning_enabled";
7883 
7884         /**
7885          * Setting that specifies the language for captions as a locale string,
7886          * e.g. en_US.
7887          *
7888          * @see java.util.Locale#toString
7889          * @hide
7890          */
7891         @Readable
7892         public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
7893                 "accessibility_captioning_locale";
7894 
7895         /**
7896          * Integer property that specifies the preset style for captions, one
7897          * of:
7898          * <ul>
7899          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
7900          * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
7901          * </ul>
7902          *
7903          * @see java.util.Locale#toString
7904          * @hide
7905          */
7906         @Readable
7907         public static final String ACCESSIBILITY_CAPTIONING_PRESET =
7908                 "accessibility_captioning_preset";
7909 
7910         /**
7911          * Integer property that specifes the background color for captions as a
7912          * packed 32-bit color.
7913          *
7914          * @see android.graphics.Color#argb
7915          * @hide
7916          */
7917         @Readable
7918         public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
7919                 "accessibility_captioning_background_color";
7920 
7921         /**
7922          * Integer property that specifes the foreground color for captions as a
7923          * packed 32-bit color.
7924          *
7925          * @see android.graphics.Color#argb
7926          * @hide
7927          */
7928         @Readable
7929         public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
7930                 "accessibility_captioning_foreground_color";
7931 
7932         /**
7933          * Integer property that specifes the edge type for captions, one of:
7934          * <ul>
7935          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
7936          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
7937          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
7938          * </ul>
7939          *
7940          * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
7941          * @hide
7942          */
7943         @Readable
7944         public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
7945                 "accessibility_captioning_edge_type";
7946 
7947         /**
7948          * Integer property that specifes the edge color for captions as a
7949          * packed 32-bit color.
7950          *
7951          * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
7952          * @see android.graphics.Color#argb
7953          * @hide
7954          */
7955         @Readable
7956         public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
7957                 "accessibility_captioning_edge_color";
7958 
7959         /**
7960          * Integer property that specifes the window color for captions as a
7961          * packed 32-bit color.
7962          *
7963          * @see android.graphics.Color#argb
7964          * @hide
7965          */
7966         @Readable
7967         public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
7968                 "accessibility_captioning_window_color";
7969 
7970         /**
7971          * String property that specifies the typeface for captions, one of:
7972          * <ul>
7973          * <li>DEFAULT
7974          * <li>MONOSPACE
7975          * <li>SANS_SERIF
7976          * <li>SERIF
7977          * </ul>
7978          *
7979          * @see android.graphics.Typeface
7980          * @hide
7981          */
7982         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
7983         @Readable
7984         public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
7985                 "accessibility_captioning_typeface";
7986 
7987         /**
7988          * Floating point property that specifies font scaling for captions.
7989          *
7990          * @hide
7991          */
7992         @Readable
7993         public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
7994                 "accessibility_captioning_font_scale";
7995 
7996         /**
7997          * Setting that specifies whether display color inversion is enabled.
7998          */
7999         @Readable
8000         public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
8001                 "accessibility_display_inversion_enabled";
8002 
8003         /**
8004          * Flag that specifies whether font size has been changed. The flag will
8005          * be set when users change the scaled value of font size for the first time.
8006          * @hide
8007          */
8008         @Readable
8009         public static final String ACCESSIBILITY_FONT_SCALING_HAS_BEEN_CHANGED =
8010                 "accessibility_font_scaling_has_been_changed";
8011 
8012         /**
8013          * Setting that specifies whether display color space adjustment is
8014          * enabled.
8015          *
8016          * @hide
8017          */
8018         @UnsupportedAppUsage
8019         @Readable
8020         public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
8021                 "accessibility_display_daltonizer_enabled";
8022 
8023         /**
8024          * Integer property that specifies the type of color space adjustment to
8025          * perform. Valid values are defined in AccessibilityManager and Settings arrays.xml:
8026          * - AccessibilityManager.DALTONIZER_DISABLED = -1
8027          * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0
8028          * - <item>@string/daltonizer_mode_protanomaly</item> = 11
8029          * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY and
8030          *       <item>@string/daltonizer_mode_deuteranomaly</item> = 12
8031          * - <item>@string/daltonizer_mode_tritanomaly</item> = 13
8032          *
8033          * @hide
8034          */
8035         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8036         @Readable
8037         public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
8038                 "accessibility_display_daltonizer";
8039 
8040         /**
8041          * Setting that specifies whether automatic click when the mouse pointer stops moving is
8042          * enabled.
8043          *
8044          * @hide
8045          */
8046         @UnsupportedAppUsage
8047         @Readable
8048         public static final String ACCESSIBILITY_AUTOCLICK_ENABLED =
8049                 "accessibility_autoclick_enabled";
8050 
8051         /**
8052          * Integer setting specifying amount of time in ms the mouse pointer has to stay still
8053          * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set.
8054          *
8055          * @see #ACCESSIBILITY_AUTOCLICK_ENABLED
8056          * @hide
8057          */
8058         @Readable
8059         public static final String ACCESSIBILITY_AUTOCLICK_DELAY =
8060                 "accessibility_autoclick_delay";
8061 
8062         /**
8063          * Whether or not larger size icons are used for the pointer of mouse/trackpad for
8064          * accessibility.
8065          * (0 = false, 1 = true)
8066          * @hide
8067          */
8068         @UnsupportedAppUsage
8069         @Readable
8070         public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
8071                 "accessibility_large_pointer_icon";
8072 
8073         /**
8074          * The timeout for considering a press to be a long press in milliseconds.
8075          * @hide
8076          */
8077         @UnsupportedAppUsage
8078         @Readable
8079         public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
8080 
8081         /**
8082          * The duration in milliseconds between the first tap's up event and the second tap's
8083          * down event for an interaction to be considered part of the same multi-press.
8084          * @hide
8085          */
8086         @Readable
8087         public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout";
8088 
8089         /**
8090          * Setting that specifies recommended timeout in milliseconds for controls
8091          * which don't need user's interactions.
8092          *
8093          * @hide
8094          */
8095         @Readable
8096         public static final String ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS =
8097                 "accessibility_non_interactive_ui_timeout_ms";
8098 
8099         /**
8100          * Setting that specifies recommended timeout in milliseconds for controls
8101          * which need user's interactions.
8102          *
8103          * @hide
8104          */
8105         @Readable
8106         public static final String ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS =
8107                 "accessibility_interactive_ui_timeout_ms";
8108 
8109 
8110         /**
8111          * Setting that specifies whether Reduce Bright Colors, or brightness dimming by color
8112          * adjustment, is enabled.
8113          *
8114          * @hide
8115          */
8116         public static final String REDUCE_BRIGHT_COLORS_ACTIVATED =
8117                 "reduce_bright_colors_activated";
8118 
8119         /**
8120          * Setting that specifies the level of Reduce Bright Colors in intensity. The range is
8121          * [0, 100].
8122          *
8123          * @hide
8124          */
8125         public static final String REDUCE_BRIGHT_COLORS_LEVEL =
8126                 "reduce_bright_colors_level";
8127 
8128         /**
8129          * Setting that specifies whether Reduce Bright Colors should persist across reboots.
8130          *
8131          * @hide
8132          */
8133         public static final String REDUCE_BRIGHT_COLORS_PERSIST_ACROSS_REBOOTS =
8134                 "reduce_bright_colors_persist_across_reboots";
8135 
8136         /**
8137          * List of the enabled print services.
8138          *
8139          * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade
8140          * from pre-N.
8141          *
8142          * @hide
8143          */
8144         @UnsupportedAppUsage
8145         @Readable
8146         public static final String ENABLED_PRINT_SERVICES =
8147             "enabled_print_services";
8148 
8149         /**
8150          * List of the disabled print services.
8151          *
8152          * @hide
8153          */
8154         @TestApi
8155         @Readable
8156         public static final String DISABLED_PRINT_SERVICES =
8157             "disabled_print_services";
8158 
8159         /**
8160          * The saved value for WindowManagerService.setForcedDisplayDensity()
8161          * formatted as a single integer representing DPI. If unset, then use
8162          * the real display density.
8163          *
8164          * @hide
8165          */
8166         @Readable
8167         public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
8168 
8169         /**
8170          * Setting to always use the default text-to-speech settings regardless
8171          * of the application settings.
8172          * 1 = override application settings,
8173          * 0 = use application settings (if specified).
8174          *
8175          * @deprecated  The value of this setting is no longer respected by
8176          * the framework text to speech APIs as of the Ice Cream Sandwich release.
8177          */
8178         @Deprecated
8179         @Readable
8180         public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
8181 
8182         /**
8183          * Default text-to-speech engine speech rate. 100 = 1x
8184          */
8185         @Readable
8186         public static final String TTS_DEFAULT_RATE = "tts_default_rate";
8187 
8188         /**
8189          * Default text-to-speech engine pitch. 100 = 1x
8190          */
8191         @Readable
8192         public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
8193 
8194         /**
8195          * Default text-to-speech engine.
8196          */
8197         @Readable
8198         public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
8199 
8200         /**
8201          * Default text-to-speech language.
8202          *
8203          * @deprecated this setting is no longer in use, as of the Ice Cream
8204          * Sandwich release. Apps should never need to read this setting directly,
8205          * instead can query the TextToSpeech framework classes for the default
8206          * locale. {@link TextToSpeech#getLanguage()}.
8207          */
8208         @Deprecated
8209         @Readable
8210         public static final String TTS_DEFAULT_LANG = "tts_default_lang";
8211 
8212         /**
8213          * Default text-to-speech country.
8214          *
8215          * @deprecated this setting is no longer in use, as of the Ice Cream
8216          * Sandwich release. Apps should never need to read this setting directly,
8217          * instead can query the TextToSpeech framework classes for the default
8218          * locale. {@link TextToSpeech#getLanguage()}.
8219          */
8220         @Deprecated
8221         @Readable
8222         public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
8223 
8224         /**
8225          * Default text-to-speech locale variant.
8226          *
8227          * @deprecated this setting is no longer in use, as of the Ice Cream
8228          * Sandwich release. Apps should never need to read this setting directly,
8229          * instead can query the TextToSpeech framework classes for the
8230          * locale that is in use {@link TextToSpeech#getLanguage()}.
8231          */
8232         @Deprecated
8233         @Readable
8234         public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
8235 
8236         /**
8237          * Stores the default tts locales on a per engine basis. Stored as
8238          * a comma seperated list of values, each value being of the form
8239          * {@code engine_name:locale} for example,
8240          * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
8241          * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
8242          * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
8243          * setting directly, and can query the TextToSpeech framework classes
8244          * for the locale that is in use.
8245          *
8246          * @hide
8247          */
8248         @Readable
8249         public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
8250 
8251         /**
8252          * Space delimited list of plugin packages that are enabled.
8253          */
8254         @Readable
8255         public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
8256 
8257         /**
8258          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
8259          * instead.
8260          */
8261         @Deprecated
8262         public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
8263                 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
8264 
8265         /**
8266          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
8267          * instead.
8268          */
8269         @Deprecated
8270         public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
8271                 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
8272 
8273         /**
8274          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
8275          * instead.
8276          */
8277         @Deprecated
8278         public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
8279                 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
8280 
8281         /**
8282          * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
8283          * instead.
8284          */
8285         @Deprecated
8286         public static final String WIFI_ON = Global.WIFI_ON;
8287 
8288         /**
8289          * The acceptable packet loss percentage (range 0 - 100) before trying
8290          * another AP on the same network.
8291          * @deprecated This setting is not used.
8292          */
8293         @Deprecated
8294         @Readable
8295         public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
8296                 "wifi_watchdog_acceptable_packet_loss_percentage";
8297 
8298         /**
8299          * The number of access points required for a network in order for the
8300          * watchdog to monitor it.
8301          * @deprecated This setting is not used.
8302          */
8303         @Deprecated
8304         @Readable
8305         public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
8306 
8307         /**
8308          * The delay between background checks.
8309          * @deprecated This setting is not used.
8310          */
8311         @Deprecated
8312         @Readable
8313         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
8314                 "wifi_watchdog_background_check_delay_ms";
8315 
8316         /**
8317          * Whether the Wi-Fi watchdog is enabled for background checking even
8318          * after it thinks the user has connected to a good access point.
8319          * @deprecated This setting is not used.
8320          */
8321         @Deprecated
8322         @Readable
8323         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
8324                 "wifi_watchdog_background_check_enabled";
8325 
8326         /**
8327          * The timeout for a background ping
8328          * @deprecated This setting is not used.
8329          */
8330         @Deprecated
8331         @Readable
8332         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
8333                 "wifi_watchdog_background_check_timeout_ms";
8334 
8335         /**
8336          * The number of initial pings to perform that *may* be ignored if they
8337          * fail. Again, if these fail, they will *not* be used in packet loss
8338          * calculation. For example, one network always seemed to time out for
8339          * the first couple pings, so this is set to 3 by default.
8340          * @deprecated This setting is not used.
8341          */
8342         @Deprecated
8343         @Readable
8344         public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
8345             "wifi_watchdog_initial_ignored_ping_count";
8346 
8347         /**
8348          * The maximum number of access points (per network) to attempt to test.
8349          * If this number is reached, the watchdog will no longer monitor the
8350          * initial connection state for the network. This is a safeguard for
8351          * networks containing multiple APs whose DNS does not respond to pings.
8352          * @deprecated This setting is not used.
8353          */
8354         @Deprecated
8355         @Readable
8356         public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
8357 
8358         /**
8359          * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
8360          */
8361         @Deprecated
8362         @Readable
8363         public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
8364 
8365         /**
8366          * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
8367          * @deprecated This setting is not used.
8368          */
8369         @Deprecated
8370         @Readable
8371         public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
8372 
8373         /**
8374          * The number of pings to test if an access point is a good connection.
8375          * @deprecated This setting is not used.
8376          */
8377         @Deprecated
8378         @Readable
8379         public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
8380 
8381         /**
8382          * The delay between pings.
8383          * @deprecated This setting is not used.
8384          */
8385         @Deprecated
8386         @Readable
8387         public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
8388 
8389         /**
8390          * The timeout per ping.
8391          * @deprecated This setting is not used.
8392          */
8393         @Deprecated
8394         @Readable
8395         public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
8396 
8397         /**
8398          * @deprecated Use
8399          * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
8400          */
8401         @Deprecated
8402         public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
8403 
8404         /**
8405          * @deprecated Use
8406          * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
8407          */
8408         @Deprecated
8409         public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
8410                 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
8411 
8412         /**
8413          * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
8414          * the receivers of the PendingIntent an opportunity to make a new network request before
8415          * the Network satisfying the request is potentially removed.
8416          *
8417          * @hide
8418          */
8419         @Readable
8420         public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
8421                 "connectivity_release_pending_intent_delay_ms";
8422 
8423         /**
8424          * Whether background data usage is allowed.
8425          *
8426          * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
8427          *             availability of background data depends on several
8428          *             combined factors. When background data is unavailable,
8429          *             {@link ConnectivityManager#getActiveNetworkInfo()} will
8430          *             now appear disconnected.
8431          */
8432         @Deprecated
8433         @Readable
8434         public static final String BACKGROUND_DATA = "background_data";
8435 
8436         /**
8437          * Origins for which browsers should allow geolocation by default.
8438          * The value is a space-separated list of origins.
8439          */
8440         @Readable
8441         public static final String ALLOWED_GEOLOCATION_ORIGINS
8442                 = "allowed_geolocation_origins";
8443 
8444         /**
8445          * The preferred TTY mode     0 = TTy Off, CDMA default
8446          *                            1 = TTY Full
8447          *                            2 = TTY HCO
8448          *                            3 = TTY VCO
8449          * @hide
8450          */
8451         @Readable
8452         public static final String PREFERRED_TTY_MODE =
8453                 "preferred_tty_mode";
8454 
8455         /**
8456          * Whether the enhanced voice privacy mode is enabled.
8457          * 0 = normal voice privacy
8458          * 1 = enhanced voice privacy
8459          * @hide
8460          */
8461         @Readable
8462         public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
8463 
8464         /**
8465          * Whether the TTY mode mode is enabled.
8466          * 0 = disabled
8467          * 1 = enabled
8468          * @hide
8469          */
8470         @Readable
8471         public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
8472 
8473         /**
8474          * User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT
8475          * calls when supported by the device and carrier. Boolean value.
8476          * 0 = OFF
8477          * 1 = ON
8478          */
8479         @Readable
8480         public static final String RTT_CALLING_MODE = "rtt_calling_mode";
8481 
8482         /**
8483         /**
8484          * Controls whether settings backup is enabled.
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_ENABLED = "backup_enabled";
8491 
8492         /**
8493          * Controls whether application data is automatically restored from backup
8494          * at install time.
8495          * Type: int ( 0 = disabled, 1 = enabled )
8496          * @hide
8497          */
8498         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8499         @Readable
8500         public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
8501 
8502         /**
8503          * Indicates whether settings backup has been fully provisioned.
8504          * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
8505          * @hide
8506          */
8507         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8508         @Readable
8509         public static final String BACKUP_PROVISIONED = "backup_provisioned";
8510 
8511         /**
8512          * Component of the transport to use for backup/restore.
8513          * @hide
8514          */
8515         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8516         @Readable
8517         public static final String BACKUP_TRANSPORT = "backup_transport";
8518 
8519         /**
8520          * Indicates the version for which the setup wizard was last shown. The version gets
8521          * bumped for each release when there is new setup information to show.
8522          *
8523          * @hide
8524          */
8525         @SystemApi
8526         @Readable
8527         public static final String LAST_SETUP_SHOWN = "last_setup_shown";
8528 
8529         /**
8530          * The interval in milliseconds after which Wi-Fi is considered idle.
8531          * When idle, it is possible for the device to be switched from Wi-Fi to
8532          * the mobile data network.
8533          * @hide
8534          * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
8535          * instead.
8536          */
8537         @Deprecated
8538         public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
8539 
8540         /**
8541          * The global search provider chosen by the user (if multiple global
8542          * search providers are installed). This will be the provider returned
8543          * by {@link SearchManager#getGlobalSearchActivity()} if it's still
8544          * installed. This setting is stored as a flattened component name as
8545          * per {@link ComponentName#flattenToString()}.
8546          *
8547          * @hide
8548          */
8549         @Readable
8550         public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
8551                 "search_global_search_activity";
8552 
8553         /**
8554          * The number of promoted sources in GlobalSearch.
8555          * @hide
8556          */
8557         @Readable
8558         public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
8559         /**
8560          * The maximum number of suggestions returned by GlobalSearch.
8561          * @hide
8562          */
8563         @Readable
8564         public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
8565         /**
8566          * The number of suggestions GlobalSearch will ask each non-web search source for.
8567          * @hide
8568          */
8569         @Readable
8570         public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
8571         /**
8572          * The number of suggestions the GlobalSearch will ask the web search source for.
8573          * @hide
8574          */
8575         @Readable
8576         public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
8577                 "search_web_results_override_limit";
8578         /**
8579          * The number of milliseconds that GlobalSearch will wait for suggestions from
8580          * promoted sources before continuing with all other sources.
8581          * @hide
8582          */
8583         @Readable
8584         public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
8585                 "search_promoted_source_deadline_millis";
8586         /**
8587          * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
8588          * @hide
8589          */
8590         @Readable
8591         public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
8592         /**
8593          * The maximum number of milliseconds that GlobalSearch shows the previous results
8594          * after receiving a new query.
8595          * @hide
8596          */
8597         @Readable
8598         public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
8599         /**
8600          * The maximum age of log data used for shortcuts in GlobalSearch.
8601          * @hide
8602          */
8603         @Readable
8604         public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
8605         /**
8606          * The maximum age of log data used for source ranking in GlobalSearch.
8607          * @hide
8608          */
8609         @Readable
8610         public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
8611                 "search_max_source_event_age_millis";
8612         /**
8613          * The minimum number of impressions needed to rank a source in GlobalSearch.
8614          * @hide
8615          */
8616         @Readable
8617         public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
8618                 "search_min_impressions_for_source_ranking";
8619         /**
8620          * The minimum number of clicks needed to rank a source in GlobalSearch.
8621          * @hide
8622          */
8623         @Readable
8624         public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
8625                 "search_min_clicks_for_source_ranking";
8626         /**
8627          * The maximum number of shortcuts shown by GlobalSearch.
8628          * @hide
8629          */
8630         @Readable
8631         public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
8632         /**
8633          * The size of the core thread pool for suggestion queries in GlobalSearch.
8634          * @hide
8635          */
8636         @Readable
8637         public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
8638                 "search_query_thread_core_pool_size";
8639         /**
8640          * The maximum size of the thread pool for suggestion queries in GlobalSearch.
8641          * @hide
8642          */
8643         @Readable
8644         public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
8645                 "search_query_thread_max_pool_size";
8646         /**
8647          * The size of the core thread pool for shortcut refreshing in GlobalSearch.
8648          * @hide
8649          */
8650         @Readable
8651         public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
8652                 "search_shortcut_refresh_core_pool_size";
8653         /**
8654          * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
8655          * @hide
8656          */
8657         @Readable
8658         public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
8659                 "search_shortcut_refresh_max_pool_size";
8660         /**
8661          * The maximun time that excess threads in the GlobalSeach thread pools will
8662          * wait before terminating.
8663          * @hide
8664          */
8665         @Readable
8666         public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
8667                 "search_thread_keepalive_seconds";
8668         /**
8669          * The maximum number of concurrent suggestion queries to each source.
8670          * @hide
8671          */
8672         @Readable
8673         public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
8674                 "search_per_source_concurrent_query_limit";
8675 
8676         /**
8677          * Whether or not alert sounds are played on StorageManagerService events.
8678          * (0 = false, 1 = true)
8679          * @hide
8680          */
8681         @Readable
8682         public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
8683 
8684         /**
8685          * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
8686          * @hide
8687          */
8688         @Readable
8689         public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
8690 
8691         /**
8692          * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
8693          * @hide
8694          */
8695         @Readable
8696         public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
8697 
8698         /**
8699          * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
8700          * @hide
8701          */
8702         @Readable
8703         public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
8704 
8705         /**
8706          * If nonzero, ANRs in invisible background processes bring up a dialog.
8707          * Otherwise, the process will be silently killed.
8708          *
8709          * Also prevents ANRs and crash dialogs from being suppressed.
8710          * @hide
8711          */
8712         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8713         @TestApi
8714         @Readable
8715         @SuppressLint("NoSettingsProvider")
8716         public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
8717 
8718         /**
8719          * If nonzero, crashes in foreground processes will bring up a dialog.
8720          * Otherwise, the process will be silently killed.
8721          * @hide
8722          */
8723         @TestApi
8724         @Readable
8725         @SuppressLint("NoSettingsProvider")
8726         public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION =
8727                 "show_first_crash_dialog_dev_option";
8728 
8729         /**
8730          * The {@link ComponentName} string of the service to be used as the voice recognition
8731          * service.
8732          *
8733          * @hide
8734          */
8735         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8736         @Readable
8737         public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
8738 
8739         /**
8740          * The {@link ComponentName} string of the selected spell checker service which is
8741          * one of the services managed by the text service manager.
8742          *
8743          * @hide
8744          */
8745         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8746         @TestApi
8747         @Readable
8748         @SuppressLint("NoSettingsProvider")
8749         public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
8750 
8751         /**
8752          * {@link android.view.textservice.SpellCheckerSubtype#hashCode()} of the selected subtype
8753          * of the selected spell checker service which is one of the services managed by the text
8754          * service manager.
8755          *
8756          * @hide
8757          */
8758         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8759         @TestApi
8760         @Readable
8761         @SuppressLint("NoSettingsProvider")
8762         public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
8763                 "selected_spell_checker_subtype";
8764 
8765         /**
8766          * Whether spell checker is enabled or not.
8767          *
8768          * @hide
8769          */
8770         @Readable
8771         public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
8772 
8773         /**
8774          * What happens when the user presses the Power button while in-call
8775          * and the screen is on.<br/>
8776          * <b>Values:</b><br/>
8777          * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
8778          * 2 - The Power button hangs up the current call.<br/>
8779          *
8780          * @hide
8781          */
8782         @UnsupportedAppUsage
8783         @Readable
8784         public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
8785 
8786         /**
8787          * Whether the user allows minimal post processing or not.
8788          *
8789          * <p>Values:
8790          * 0 - Not allowed. Any preferences set through the Window.setPreferMinimalPostProcessing
8791          *     API will be ignored.
8792          * 1 - Allowed. Any preferences set through the Window.setPreferMinimalPostProcessing API
8793          *     will be respected and the appropriate signals will be sent to display.
8794          *     (Default behaviour)
8795          *
8796          * @hide
8797          */
8798         @Readable
8799         public static final String MINIMAL_POST_PROCESSING_ALLOWED =
8800                 "minimal_post_processing_allowed";
8801 
8802         /**
8803          * No mode switching will happen.
8804          *
8805          * @see #MATCH_CONTENT_FRAME_RATE
8806          * @hide
8807          */
8808         public static final int MATCH_CONTENT_FRAMERATE_NEVER = 0;
8809 
8810         /**
8811          * Allow only refresh rate switching between modes in the same configuration group.
8812          * This way only switches without visual interruptions for the user will be allowed.
8813          *
8814          * @see #MATCH_CONTENT_FRAME_RATE
8815          * @hide
8816          */
8817         public static final int MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY = 1;
8818 
8819         /**
8820          * Allow refresh rate switching between all refresh rates even if the switch will have
8821          * visual interruptions for the user.
8822          *
8823          * @see #MATCH_CONTENT_FRAME_RATE
8824          * @hide
8825          */
8826         public static final int MATCH_CONTENT_FRAMERATE_ALWAYS = 2;
8827 
8828         /**
8829          * User's preference for refresh rate switching.
8830          *
8831          * <p>Values:
8832          * 0 - Never switch refresh rates.
8833          * 1 - Switch refresh rates only when it can be done seamlessly. (Default behaviour)
8834          * 2 - Always prefer refresh rate switching even if it's going to have visual interruptions
8835          *     for the user.
8836          *
8837          * @see android.view.Surface#setFrameRate
8838          * @see #MATCH_CONTENT_FRAMERATE_NEVER
8839          * @see #MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY
8840          * @see #MATCH_CONTENT_FRAMERATE_ALWAYS
8841          * @hide
8842          */
8843         public static final String MATCH_CONTENT_FRAME_RATE =
8844                 "match_content_frame_rate";
8845 
8846         /**
8847          * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
8848          * @hide
8849          */
8850         public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
8851 
8852         /**
8853          * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
8854          * @hide
8855          */
8856         public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
8857 
8858         /**
8859          * INCALL_POWER_BUTTON_BEHAVIOR default value.
8860          * @hide
8861          */
8862         public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
8863                 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
8864 
8865         /**
8866          * What happens when the user presses the Back button while in-call
8867          * and the screen is on.<br/>
8868          * <b>Values:</b><br/>
8869          * 0 - The Back buttons does nothing different.<br/>
8870          * 1 - The Back button hangs up the current call.<br/>
8871          *
8872          * @hide
8873          */
8874         @Readable
8875         public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior";
8876 
8877         /**
8878          * INCALL_BACK_BUTTON_BEHAVIOR value for no action.
8879          * @hide
8880          */
8881         public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0;
8882 
8883         /**
8884          * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up".
8885          * @hide
8886          */
8887         public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1;
8888 
8889         /**
8890          * INCALL_POWER_BUTTON_BEHAVIOR default value.
8891          * @hide
8892          */
8893         public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT =
8894                 INCALL_BACK_BUTTON_BEHAVIOR_NONE;
8895 
8896         /**
8897          * Whether the device should wake when the wake gesture sensor detects motion.
8898          * @hide
8899          */
8900         @Readable
8901         public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
8902 
8903         /**
8904          * Whether the device should doze if configured.
8905          * @hide
8906          */
8907         @UnsupportedAppUsage
8908         @Readable
8909         public static final String DOZE_ENABLED = "doze_enabled";
8910 
8911         /**
8912          * Indicates whether doze should be always on.
8913          * <p>
8914          * Type: int (0 for false, 1 for true)
8915          *
8916          * @hide
8917          */
8918         @SystemApi
8919         @Readable
8920         public static final String DOZE_ALWAYS_ON = "doze_always_on";
8921 
8922         /**
8923          * Whether the device should pulse on pick up gesture.
8924          * @hide
8925          */
8926         @Readable
8927         public static final String DOZE_PICK_UP_GESTURE = "doze_pulse_on_pick_up";
8928 
8929         /**
8930          * Whether the device should pulse on long press gesture.
8931          * @hide
8932          */
8933         @Readable
8934         public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press";
8935 
8936         /**
8937          * Whether the device should pulse on double tap gesture.
8938          * @hide
8939          */
8940         @Readable
8941         public static final String DOZE_DOUBLE_TAP_GESTURE = "doze_pulse_on_double_tap";
8942 
8943         /**
8944          * Whether the device should respond to the SLPI tap gesture.
8945          * @hide
8946          */
8947         @Readable
8948         public static final String DOZE_TAP_SCREEN_GESTURE = "doze_tap_gesture";
8949 
8950         /**
8951          * Gesture that wakes up the display, showing some version of the lock screen.
8952          * @hide
8953          */
8954         @Readable
8955         public static final String DOZE_WAKE_LOCK_SCREEN_GESTURE = "doze_wake_screen_gesture";
8956 
8957         /**
8958          * Gesture that wakes up the display, toggling between {@link Display.STATE_OFF} and
8959          * {@link Display.STATE_DOZE}.
8960          * @hide
8961          */
8962         @Readable
8963         public static final String DOZE_WAKE_DISPLAY_GESTURE = "doze_wake_display_gesture";
8964 
8965         /**
8966          * Gesture that wakes up the display on quick pickup, toggling between
8967          * {@link Display.STATE_OFF} and {@link Display.STATE_DOZE}.
8968          * @hide
8969          */
8970         public static final String DOZE_QUICK_PICKUP_GESTURE = "doze_quick_pickup_gesture";
8971 
8972         /**
8973          * Whether the device should suppress the current doze configuration and disable dozing.
8974          * @hide
8975          */
8976         @Readable
8977         public static final String SUPPRESS_DOZE = "suppress_doze";
8978 
8979         /**
8980          * Gesture that skips media.
8981          * @hide
8982          */
8983         @Readable
8984         public static final String SKIP_GESTURE = "skip_gesture";
8985 
8986         /**
8987          * Count of successful gestures.
8988          * @hide
8989          */
8990         @Readable
8991         public static final String SKIP_GESTURE_COUNT = "skip_gesture_count";
8992 
8993         /**
8994          * Count of non-gesture interaction.
8995          * @hide
8996          */
8997         @Readable
8998         public static final String SKIP_TOUCH_COUNT = "skip_touch_count";
8999 
9000         /**
9001          * Direction to advance media for skip gesture
9002          * @hide
9003          */
9004         @Readable
9005         public static final String SKIP_DIRECTION = "skip_gesture_direction";
9006 
9007         /**
9008          * Gesture that silences sound (alarms, notification, calls).
9009          * @hide
9010          */
9011         @Readable
9012         public static final String SILENCE_GESTURE = "silence_gesture";
9013 
9014         /**
9015          * Count of successful silence alarms gestures.
9016          * @hide
9017          */
9018         @Readable
9019         public static final String SILENCE_ALARMS_GESTURE_COUNT = "silence_alarms_gesture_count";
9020 
9021         /**
9022          * Count of successful silence timer gestures.
9023          * @hide
9024          */
9025         @Readable
9026         public static final String SILENCE_TIMER_GESTURE_COUNT = "silence_timer_gesture_count";
9027 
9028         /**
9029          * Count of successful silence call gestures.
9030          * @hide
9031          */
9032         @Readable
9033         public static final String SILENCE_CALL_GESTURE_COUNT = "silence_call_gesture_count";
9034 
9035         /**
9036          * Count of non-gesture interaction.
9037          * @hide
9038          */
9039         @Readable
9040         public static final String SILENCE_ALARMS_TOUCH_COUNT = "silence_alarms_touch_count";
9041 
9042         /**
9043          * Count of non-gesture interaction.
9044          * @hide
9045          */
9046         @Readable
9047         public static final String SILENCE_TIMER_TOUCH_COUNT = "silence_timer_touch_count";
9048 
9049         /**
9050          * Count of non-gesture interaction.
9051          * @hide
9052          */
9053         @Readable
9054         public static final String SILENCE_CALL_TOUCH_COUNT = "silence_call_touch_count";
9055 
9056         /**
9057          * Number of successful "Motion Sense" tap gestures to pause media.
9058          * @hide
9059          */
9060         @Readable
9061         public static final String AWARE_TAP_PAUSE_GESTURE_COUNT = "aware_tap_pause_gesture_count";
9062 
9063         /**
9064          * Number of touch interactions to pause media when a "Motion Sense" gesture could
9065          * have been used.
9066          * @hide
9067          */
9068         @Readable
9069         public static final String AWARE_TAP_PAUSE_TOUCH_COUNT = "aware_tap_pause_touch_count";
9070 
9071         /**
9072          * For user preference if swipe bottom to expand notification gesture enabled.
9073          * @hide
9074          */
9075         public static final String SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED =
9076                 "swipe_bottom_to_notification_enabled";
9077 
9078         /**
9079          * Controls whether One-Handed mode is currently activated.
9080          * @hide
9081          */
9082         public static final String ONE_HANDED_MODE_ACTIVATED = "one_handed_mode_activated";
9083 
9084         /**
9085          * For user preference if One-Handed Mode enabled.
9086          * @hide
9087          */
9088         public static final String ONE_HANDED_MODE_ENABLED = "one_handed_mode_enabled";
9089 
9090         /**
9091          * For user preference if One-Handed Mode timeout.
9092          * @hide
9093          */
9094         public static final String ONE_HANDED_MODE_TIMEOUT = "one_handed_mode_timeout";
9095 
9096         /**
9097          * For user taps app to exit One-Handed Mode.
9098          * @hide
9099          */
9100         public static final String TAPS_APP_TO_EXIT = "taps_app_to_exit";
9101 
9102         /**
9103          * Internal use, one handed mode tutorial showed times.
9104          * @hide
9105          */
9106         public static final String ONE_HANDED_TUTORIAL_SHOW_COUNT =
9107                 "one_handed_tutorial_show_count";
9108 
9109         /**
9110          * Toggle to enable/disable for the apps to use the Ui translation for Views. The value
9111          * indicates whether the Ui translation is enabled by the user.
9112          * <p>
9113          * Type: {@code int} ({@code 0} for disabled, {@code 1} for enabled)
9114          *
9115          * @hide
9116          */
9117         @SystemApi
9118         @Readable
9119         @SuppressLint("NoSettingsProvider")
9120         public static final String UI_TRANSLATION_ENABLED = "ui_translation_enabled";
9121 
9122         /**
9123          * The current night mode that has been selected by the user.  Owned
9124          * and controlled by UiModeManagerService.  Constants are as per
9125          * UiModeManager.
9126          * @hide
9127          */
9128         @Readable
9129         public static final String UI_NIGHT_MODE = "ui_night_mode";
9130 
9131         /**
9132          * The current night mode custom type that has been selected by the user.  Owned
9133          * and controlled by UiModeManagerService. Constants are as per UiModeManager.
9134          * @hide
9135          */
9136         @Readable
9137         @SuppressLint("NoSettingsProvider")
9138         public static final String UI_NIGHT_MODE_CUSTOM_TYPE = "ui_night_mode_custom_type";
9139 
9140         /**
9141          * The current night mode that has been overridden to turn on by the system.  Owned
9142          * and controlled by UiModeManagerService.  Constants are as per
9143          * UiModeManager.
9144          * @hide
9145          */
9146         @Readable
9147         public static final String UI_NIGHT_MODE_OVERRIDE_ON = "ui_night_mode_override_on";
9148 
9149         /**
9150          * The last computed night mode bool the last time the phone was on
9151          * @hide
9152          */
9153         public static final String UI_NIGHT_MODE_LAST_COMPUTED = "ui_night_mode_last_computed";
9154 
9155         /**
9156          * The current night mode that has been overridden to turn off by the system.  Owned
9157          * and controlled by UiModeManagerService.  Constants are as per
9158          * UiModeManager.
9159          * @hide
9160          */
9161         @Readable
9162         public static final String UI_NIGHT_MODE_OVERRIDE_OFF = "ui_night_mode_override_off";
9163 
9164         /**
9165          * Whether screensavers are enabled.
9166          * @hide
9167          */
9168         @Readable
9169         public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
9170 
9171         /**
9172          * The user's chosen screensaver components.
9173          *
9174          * These will be launched by the PhoneWindowManager after a timeout when not on
9175          * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
9176          * @hide
9177          */
9178         @Readable
9179         public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
9180 
9181         /**
9182          * If screensavers are enabled, whether the screensaver should be automatically launched
9183          * when the device is inserted into a (desk) dock.
9184          * @hide
9185          */
9186         @Readable
9187         public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
9188 
9189         /**
9190          * If screensavers are enabled, whether the screensaver should be automatically launched
9191          * when the screen times out when not on battery.
9192          * @hide
9193          */
9194         @Readable
9195         public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
9196 
9197         /**
9198          * If screensavers are enabled, the default screensaver component.
9199          * @hide
9200          */
9201         @Readable
9202         public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
9203 
9204         /**
9205          * Whether complications are enabled to be shown over the screensaver by the user.
9206          *
9207          * @hide
9208          */
9209         public static final String SCREENSAVER_COMPLICATIONS_ENABLED =
9210                 "screensaver_complications_enabled";
9211 
9212         /**
9213          * Whether home controls are enabled to be shown over the screensaver by the user.
9214          *
9215          * @hide
9216          */
9217         public static final String SCREENSAVER_HOME_CONTROLS_ENABLED =
9218                 "screensaver_home_controls_enabled";
9219 
9220 
9221         /**
9222          * Default, indicates that the user has not yet started the dock setup flow.
9223          *
9224          * @hide
9225          */
9226         public static final int DOCK_SETUP_NOT_STARTED = 0;
9227 
9228         /**
9229          * Indicates that the user has started but not yet completed dock setup.
9230          * One of the possible states for {@link #DOCK_SETUP_STATE}.
9231          *
9232          * @hide
9233          */
9234         public static final int DOCK_SETUP_STARTED = 1;
9235 
9236         /**
9237          * Indicates that the user has snoozed dock setup and will complete it later.
9238          * One of the possible states for {@link #DOCK_SETUP_STATE}.
9239          *
9240          * @hide
9241          */
9242         public static final int DOCK_SETUP_PAUSED = 2;
9243 
9244         /**
9245          * Indicates that the user has been prompted to start dock setup.
9246          * One of the possible states for {@link #DOCK_SETUP_STATE}.
9247          *
9248          * @hide
9249          */
9250         public static final int DOCK_SETUP_PROMPTED = 3;
9251 
9252         /**
9253          * Indicates that the user has started dock setup but never finished it.
9254          * One of the possible states for {@link #DOCK_SETUP_STATE}.
9255          *
9256          * @hide
9257          */
9258         public static final int DOCK_SETUP_INCOMPLETE = 4;
9259 
9260         /**
9261          * Indicates that the user has completed dock setup.
9262          * One of the possible states for {@link #DOCK_SETUP_STATE}.
9263          *
9264          * @hide
9265          */
9266         public static final int DOCK_SETUP_COMPLETED = 10;
9267 
9268         /**
9269          * Indicates that dock setup timed out before the user could complete it.
9270          * One of the possible states for {@link #DOCK_SETUP_STATE}.
9271          *
9272          * @hide
9273          */
9274         public static final int DOCK_SETUP_TIMED_OUT = 11;
9275 
9276         /** @hide */
9277         @Retention(RetentionPolicy.SOURCE)
9278         @IntDef({
9279                 DOCK_SETUP_NOT_STARTED,
9280                 DOCK_SETUP_STARTED,
9281                 DOCK_SETUP_PAUSED,
9282                 DOCK_SETUP_PROMPTED,
9283                 DOCK_SETUP_INCOMPLETE,
9284                 DOCK_SETUP_COMPLETED,
9285                 DOCK_SETUP_TIMED_OUT
9286         })
9287         public @interface DockSetupState {
9288         }
9289 
9290         /**
9291          * Defines the user's current state of dock setup.
9292          * The possible states are defined in {@link DockSetupState}.
9293          *
9294          * @hide
9295          */
9296         public static final String DOCK_SETUP_STATE = "dock_setup_state";
9297 
9298         /**
9299          * The default NFC payment component
9300          * @hide
9301          */
9302         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9303         public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
9304 
9305         /**
9306          * Whether NFC payment is handled by the foreground application or a default.
9307          * @hide
9308          */
9309         @Readable
9310         public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
9311 
9312         /**
9313          * Specifies the package name currently configured to be the primary sms application
9314          * @hide
9315          */
9316         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9317         @Readable
9318         public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
9319 
9320         /**
9321          * Specifies the package name currently configured to be the default dialer application
9322          * @hide
9323          */
9324         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9325         @Readable
9326         public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
9327 
9328         /**
9329          * Specifies the component name currently configured to be the default call screening
9330          * application
9331          * @hide
9332          */
9333         @Readable
9334         public static final String CALL_SCREENING_DEFAULT_COMPONENT =
9335                 "call_screening_default_component";
9336 
9337         /**
9338          * Specifies the package name currently configured to be the emergency assistance application
9339          *
9340          * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
9341          *
9342          * @hide
9343          */
9344         @Readable
9345         public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
9346 
9347         /**
9348          * Specifies whether the current app context on scren (assist data) will be sent to the
9349          * assist application (active voice interaction service).
9350          *
9351          * @hide
9352          */
9353         @Readable
9354         public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
9355 
9356         /**
9357          * Specifies whether a screenshot of the screen contents will be sent to the assist
9358          * application (active voice interaction service).
9359          *
9360          * @hide
9361          */
9362         @Readable
9363         public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";
9364 
9365         /**
9366          * Specifies whether the screen will show an animation if screen contents are sent to the
9367          * assist application (active voice interaction service).
9368          *
9369          * Note that the disclosure will be forced for third-party assistants or if the device
9370          * does not support disabling it.
9371          *
9372          * @hide
9373          */
9374         @Readable
9375         public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled";
9376 
9377         /**
9378          * Control if rotation suggestions are sent to System UI when in rotation locked mode.
9379          * Done to enable screen rotation while the screen rotation is locked. Enabling will
9380          * poll the accelerometer in rotation locked mode.
9381          *
9382          * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent.
9383          *
9384          * @hide
9385          */
9386         @Readable
9387         public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions";
9388 
9389         /**
9390          * The disabled state of SHOW_ROTATION_SUGGESTIONS.
9391          * @hide
9392          */
9393         public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0;
9394 
9395         /**
9396          * The enabled state of SHOW_ROTATION_SUGGESTIONS.
9397          * @hide
9398          */
9399         public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1;
9400 
9401         /**
9402          * The default state of SHOW_ROTATION_SUGGESTIONS.
9403          * @hide
9404          */
9405         public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT =
9406                 SHOW_ROTATION_SUGGESTIONS_ENABLED;
9407 
9408         /**
9409          * The number of accepted rotation suggestions. Used to determine if the user has been
9410          * introduced to rotation suggestions.
9411          * @hide
9412          */
9413         @Readable
9414         public static final String NUM_ROTATION_SUGGESTIONS_ACCEPTED =
9415                 "num_rotation_suggestions_accepted";
9416 
9417         /**
9418          * Read only list of the service components that the current user has explicitly allowed to
9419          * see and assist with all of the user's notifications.
9420          *
9421          * @deprecated Use
9422          * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}.
9423          * @hide
9424          */
9425         @Deprecated
9426         @Readable
9427         public static final String ENABLED_NOTIFICATION_ASSISTANT =
9428                 "enabled_notification_assistant";
9429 
9430         /**
9431          * Read only list of the service components that the current user has explicitly allowed to
9432          * see all of the user's notifications, separated by ':'.
9433          *
9434          * @hide
9435          * @deprecated Use
9436          * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}.
9437          */
9438         @Deprecated
9439         @UnsupportedAppUsage
9440         @Readable
9441         public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
9442 
9443         /**
9444          * Read only list of the packages that the current user has explicitly allowed to
9445          * manage do not disturb, separated by ':'.
9446          *
9447          * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}.
9448          * @hide
9449          */
9450         @Deprecated
9451         @TestApi
9452         @Readable
9453         public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES =
9454                 "enabled_notification_policy_access_packages";
9455 
9456         /**
9457          * Defines whether managed profile ringtones should be synced from it's parent profile
9458          * <p>
9459          * 0 = ringtones are not synced
9460          * 1 = ringtones are synced from the profile's parent (default)
9461          * <p>
9462          * This value is only used for managed profiles.
9463          * @hide
9464          */
9465         @TestApi
9466         @Readable
9467         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
9468         public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds";
9469 
9470         /**
9471          * @hide
9472          */
9473         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9474         @TestApi
9475         @Readable
9476         public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
9477 
9478         /**
9479          * This is the query URI for finding a print service to install.
9480          *
9481          * @hide
9482          */
9483         @Readable
9484         public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
9485 
9486         /**
9487          * This is the query URI for finding a NFC payment service to install.
9488          *
9489          * @hide
9490          */
9491         @Readable
9492         public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
9493 
9494         /**
9495          * This is the query URI for finding a auto fill service to install.
9496          *
9497          * @hide
9498          */
9499         @Readable
9500         public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri";
9501 
9502         /**
9503          * If enabled, apps should try to skip any introductory hints on first launch. This might
9504          * apply to users that are already familiar with the environment or temporary users.
9505          * <p>
9506          * Type : int (0 to show hints, 1 to skip showing hints)
9507          */
9508         @Readable
9509         public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
9510 
9511         /**
9512          * Persisted playback time after a user confirmation of an unsafe volume level.
9513          *
9514          * @hide
9515          */
9516         @Readable
9517         public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
9518 
9519         /**
9520          * Indicates whether the spatial audio feature was enabled for this user.
9521          *
9522          * Type : int (0 disabled, 1 enabled)
9523          *
9524          * @hide
9525          */
9526         public static final String SPATIAL_AUDIO_ENABLED = "spatial_audio_enabled";
9527 
9528         /**
9529          * Indicates whether notification display on the lock screen is enabled.
9530          * <p>
9531          * Type: int (0 for false, 1 for true)
9532          *
9533          * @hide
9534          */
9535         @SystemApi
9536         @Readable
9537         public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
9538                 "lock_screen_show_notifications";
9539 
9540         /**
9541          * Indicates whether the lock screen should display silent notifications.
9542          * <p>
9543          * Type: int (0 for false, 1 for true)
9544          *
9545          * @hide
9546          */
9547         @Readable
9548         public static final String LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS =
9549                 "lock_screen_show_silent_notifications";
9550 
9551         /**
9552          * Indicates whether "seen" notifications should be suppressed from the lockscreen.
9553          * <p>
9554          * Type: int (0 for unset, 1 for true, 2 for false)
9555          *
9556          * @hide
9557          */
9558         public static final String LOCK_SCREEN_SHOW_ONLY_UNSEEN_NOTIFICATIONS =
9559                 "lock_screen_show_only_unseen_notifications";
9560 
9561         /**
9562          * Indicates whether snooze options should be shown on notifications
9563          * <p>
9564          * Type: int (0 for false, 1 for true)
9565          *
9566          * @hide
9567          */
9568         @Readable
9569         public static final String SHOW_NOTIFICATION_SNOOZE = "show_notification_snooze";
9570 
9571         /**
9572          * List of TV inputs that are currently hidden. This is a string
9573          * containing the IDs of all hidden TV inputs. Each ID is encoded by
9574          * {@link android.net.Uri#encode(String)} and separated by ':'.
9575          * @hide
9576          */
9577         @Readable
9578         public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
9579 
9580         /**
9581          * List of custom TV input labels. This is a string containing <TV input id, custom name>
9582          * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
9583          * and separated by ','. Each pair is separated by ':'.
9584          * @hide
9585          */
9586         @Readable
9587         public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
9588 
9589         /**
9590          * Whether TV app uses non-system inputs.
9591          *
9592          * <p>
9593          * The value is boolean (1 or 0), where 1 means non-system TV inputs are allowed,
9594          * and 0 means non-system TV inputs are not allowed.
9595          *
9596          * <p>
9597          * Devices such as sound bars may have changed the system property allow_third_party_inputs
9598          * to false so the TV Application only uses HDMI and other built in inputs. This setting
9599          * allows user to override the default and have the TV Application use third party TV inputs
9600          * available on play store.
9601          *
9602          * @hide
9603          */
9604         @Readable
9605         public static final String TV_APP_USES_NON_SYSTEM_INPUTS = "tv_app_uses_non_system_inputs";
9606 
9607         /**
9608          * Whether automatic routing of system audio to USB audio peripheral is disabled.
9609          * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
9610          * and 0 means automatic routing is enabled.
9611          *
9612          * @hide
9613          */
9614         @Readable
9615         public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
9616                 "usb_audio_automatic_routing_disabled";
9617 
9618         /**
9619          * The timeout in milliseconds before the device fully goes to sleep after
9620          * a period of inactivity.  This value sets an upper bound on how long the device
9621          * will stay awake or dreaming without user activity.  It should generally
9622          * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
9623          * will sleep before it ever has a chance to dream.
9624          * <p>
9625          * Use -1 to disable this timeout.
9626          * </p>
9627          *
9628          * @hide
9629          */
9630         @Readable
9631         public static final String SLEEP_TIMEOUT = "sleep_timeout";
9632 
9633         /**
9634          * The timeout in milliseconds before the device goes to sleep due to user inattentiveness,
9635          * even if the system is holding wakelocks. It should generally be longer than {@code
9636          * config_attentiveWarningDuration}, as otherwise the device will show the attentive
9637          * warning constantly. Small timeouts are discouraged, as they will cause the device to
9638          * go to sleep quickly after waking up.
9639          * <p>
9640          * Use -1 to disable this timeout.
9641          * </p>
9642          *
9643          * @hide
9644          */
9645         @Readable
9646         public static final String ATTENTIVE_TIMEOUT = "attentive_timeout";
9647 
9648         /**
9649          * Controls whether double tap to wake is enabled.
9650          * @hide
9651          */
9652         @Readable
9653         public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
9654 
9655         /**
9656          * The current assistant component. It could be a voice interaction service,
9657          * or an activity that handles ACTION_ASSIST, or empty which means using the default
9658          * handling.
9659          *
9660          * <p>This should be set indirectly by setting the {@link
9661          * android.app.role.RoleManager#ROLE_ASSISTANT assistant role}.
9662          *
9663          * @hide
9664          */
9665         @UnsupportedAppUsage
9666         @Readable
9667         public static final String ASSISTANT = "assistant";
9668 
9669         /**
9670          * Whether the camera launch gesture should be disabled.
9671          *
9672          * @hide
9673          */
9674         @Readable
9675         public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled";
9676 
9677         /**
9678          * Whether the emergency gesture should be enabled.
9679          *
9680          * @hide
9681          */
9682         public static final String EMERGENCY_GESTURE_ENABLED = "emergency_gesture_enabled";
9683 
9684         /**
9685          * Whether the emergency gesture sound should be enabled.
9686          *
9687          * @hide
9688          */
9689         public static final String EMERGENCY_GESTURE_SOUND_ENABLED =
9690                 "emergency_gesture_sound_enabled";
9691 
9692         /**
9693          * Whether the camera launch gesture to double tap the power button when the screen is off
9694          * should be disabled.
9695          *
9696          * @hide
9697          */
9698         @Readable
9699         public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED =
9700                 "camera_double_tap_power_gesture_disabled";
9701 
9702         /**
9703          * Whether the camera double twist gesture to flip between front and back mode should be
9704          * enabled.
9705          *
9706          * @hide
9707          */
9708         @Readable
9709         public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED =
9710                 "camera_double_twist_to_flip_enabled";
9711 
9712         /**
9713          * Whether or not the smart camera lift trigger that launches the camera when the user moves
9714          * the phone into a position for taking photos should be enabled.
9715          *
9716          * @hide
9717          */
9718         @Readable
9719         public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled";
9720 
9721         /**
9722          * The default enable state of the camera lift trigger.
9723          *
9724          * @hide
9725          */
9726         public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1;
9727 
9728         /**
9729          * Whether or not the flashlight (camera torch mode) is available required to turn
9730          * on flashlight.
9731          *
9732          * @hide
9733          */
9734         @Readable
9735         public static final String FLASHLIGHT_AVAILABLE = "flashlight_available";
9736 
9737         /**
9738          * Whether or not flashlight is enabled.
9739          *
9740          * @hide
9741          */
9742         @Readable
9743         public static final String FLASHLIGHT_ENABLED = "flashlight_enabled";
9744 
9745         /**
9746          * Whether or not face unlock is allowed on Keyguard.
9747          * @hide
9748          */
9749         @Readable
9750         public static final String FACE_UNLOCK_KEYGUARD_ENABLED = "face_unlock_keyguard_enabled";
9751 
9752         /**
9753          * Whether or not face unlock dismisses the keyguard.
9754          * @hide
9755          */
9756         @Readable
9757         public static final String FACE_UNLOCK_DISMISSES_KEYGUARD =
9758                 "face_unlock_dismisses_keyguard";
9759 
9760         /**
9761          * Whether or not media is shown automatically when bypassing as a heads up.
9762          * @hide
9763          */
9764         @Readable
9765         public static final String SHOW_MEDIA_WHEN_BYPASSING =
9766                 "show_media_when_bypassing";
9767 
9768         /**
9769          * Whether or not face unlock requires attention. This is a cached value, the source of
9770          * truth is obtained through the HAL.
9771          * @hide
9772          */
9773         @Readable
9774         public static final String FACE_UNLOCK_ATTENTION_REQUIRED =
9775                 "face_unlock_attention_required";
9776 
9777         /**
9778          * Whether or not face unlock requires a diverse set of poses during enrollment. This is a
9779          * cached value, the source of truth is obtained through the HAL.
9780          * @hide
9781          */
9782         @Readable
9783         public static final String FACE_UNLOCK_DIVERSITY_REQUIRED =
9784                 "face_unlock_diversity_required";
9785 
9786 
9787         /**
9788          * Whether or not face unlock is allowed for apps (through BiometricPrompt).
9789          * @hide
9790          */
9791         @Readable
9792         public static final String FACE_UNLOCK_APP_ENABLED = "face_unlock_app_enabled";
9793 
9794         /**
9795          * Whether or not face unlock always requires user confirmation, meaning {@link
9796          * android.hardware.biometrics.BiometricPrompt.Builder#setConfirmationRequired(boolean)}
9797          * is always 'true'. This overrides the behavior that apps choose in the
9798          * setConfirmationRequired API.
9799          * @hide
9800          */
9801         @Readable
9802         public static final String FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION =
9803                 "face_unlock_always_require_confirmation";
9804 
9805         /**
9806          * Whether or not a user should re enroll their face.
9807          *
9808          * Face unlock re enroll.
9809          *  0 = No re enrollment.
9810          *  1 = Re enrollment is suggested.
9811          *  2 = Re enrollment is required after a set time period.
9812          *  3 = Re enrollment is required immediately.
9813          *
9814          * @hide
9815          */
9816         @Readable
9817         public static final String FACE_UNLOCK_RE_ENROLL = "face_unlock_re_enroll";
9818 
9819         /**
9820          * The time (in millis) to wait for a power button before sending a
9821          * successful auth in to keyguard(for side fingerprint)
9822          * @hide
9823          */
9824         @Readable
9825         public static final String FINGERPRINT_SIDE_FPS_KG_POWER_WINDOW =
9826                 "fingerprint_side_fps_kg_power_window";
9827 
9828         /**
9829          * The time (in millis) to wait for a power button before sending
9830          * a successful auth in biometric prompt(for side fingerprint)
9831          * @hide
9832          */
9833         @Readable
9834         public static final String FINGERPRINT_SIDE_FPS_BP_POWER_WINDOW =
9835                 "fingerprint_side_fps_bp_power_window";
9836 
9837         /**
9838          * The time (in millis) that a finger tap will wait for a power button
9839          * before dismissing the power dialog during enrollment(for side
9840          * fingerprint)
9841          * @hide
9842          */
9843         @Readable
9844         public static final String FINGERPRINT_SIDE_FPS_ENROLL_TAP_WINDOW =
9845                 "fingerprint_side_fps_enroll_tap_window";
9846 
9847         /**
9848          * The time (in millis) that a power event will ignore future authentications
9849          * (for side fingerprint)
9850          * @hide
9851          */
9852         @Readable
9853         public static final String FINGERPRINT_SIDE_FPS_AUTH_DOWNTIME =
9854                 "fingerprint_side_fps_auth_downtime";
9855 
9856         /**
9857          * Whether or not a SFPS device is enabling the performant auth setting.
9858          * The "_V2" suffix was added to re-introduce the default behavior for
9859          * users. See b/265264294 fore more details.
9860          * @hide
9861          */
9862         public static final String SFPS_PERFORMANT_AUTH_ENABLED = "sfps_performant_auth_enabled_v2";
9863 
9864         /**
9865          * Whether or not debugging is enabled.
9866          * @hide
9867          */
9868         @Readable
9869         public static final String BIOMETRIC_DEBUG_ENABLED =
9870                 "biometric_debug_enabled";
9871 
9872         /**
9873          * Whether or not biometric is allowed on Keyguard.
9874          * @hide
9875          */
9876         @Readable
9877         public static final String BIOMETRIC_KEYGUARD_ENABLED = "biometric_keyguard_enabled";
9878 
9879         /**
9880          * Whether or not biometric is allowed for apps (through BiometricPrompt).
9881          * @hide
9882          */
9883         @Readable
9884         public static final String BIOMETRIC_APP_ENABLED = "biometric_app_enabled";
9885 
9886         /**
9887          * Whether or not active unlock triggers on wake.
9888          * @hide
9889          */
9890         public static final String ACTIVE_UNLOCK_ON_WAKE = "active_unlock_on_wake";
9891 
9892         /**
9893          * Whether or not active unlock triggers on unlock intent.
9894          * @hide
9895          */
9896         public static final String ACTIVE_UNLOCK_ON_UNLOCK_INTENT =
9897                 "active_unlock_on_unlock_intent";
9898 
9899         /**
9900          * Whether or not active unlock triggers on biometric failure.
9901          * @hide
9902          */
9903         public static final String ACTIVE_UNLOCK_ON_BIOMETRIC_FAIL =
9904                 "active_unlock_on_biometric_fail";
9905 
9906         /**
9907          * If active unlock triggers on biometric failures, include the following error codes
9908          * as a biometric failure. See {@link android.hardware.biometrics.BiometricFaceConstants}.
9909          * Error codes should be separated by a pipe. For example: "1|4|5". If active unlock
9910          * should never trigger on any face errors, this should be set to an empty string.
9911          * A null value will use the system default value (TIMEOUT).
9912          * @hide
9913          */
9914         public static final String ACTIVE_UNLOCK_ON_FACE_ERRORS =
9915                 "active_unlock_on_face_errors";
9916 
9917         /**
9918          * If active unlock triggers on biometric failures, include the following acquired info
9919          * as a "biometric failure". See {@link android.hardware.biometrics.BiometricFaceConstants}.
9920          * Acquired codes should be separated by a pipe. For example: "1|4|5". If active unlock
9921          * should never on trigger on any acquired info messages, this should be
9922          * set to an empty string. A null value will use the system default value (none).
9923          * @hide
9924          */
9925         public static final String ACTIVE_UNLOCK_ON_FACE_ACQUIRE_INFO =
9926                 "active_unlock_on_face_acquire_info";
9927 
9928         /**
9929          * If active unlock triggers on biometric failures, then also request active unlock on
9930          * unlock intent when each setting (BiometricType) is the only biometric type enrolled.
9931          * Biometric types should be separated by a pipe. For example: "0|3" or "0". If this
9932          * setting should be disabled, then this should be set to an empty string. A null value
9933          * will use the system default value (0 / None).
9934          *   0 = None, 1 = Any face, 2 = Any fingerprint, 3 = Under display fingerprint
9935          * @hide
9936          */
9937         public static final String ACTIVE_UNLOCK_ON_UNLOCK_INTENT_WHEN_BIOMETRIC_ENROLLED =
9938                 "active_unlock_on_unlock_intent_when_biometric_enrolled";
9939 
9940         /**
9941          * If active unlock triggers on unlock intents, then also request active unlock on
9942          * these wake-up reasons. See {@link PowerManager.WakeReason} for value mappings.
9943          * WakeReasons should be separated by a pipe. For example: "0|3" or "0". If this
9944          * setting should be disabled, then this should be set to an empty string. A null value
9945          * will use the system default value (WAKE_REASON_UNFOLD_DEVICE).
9946          * @hide
9947          */
9948         public static final String ACTIVE_UNLOCK_WAKEUPS_CONSIDERED_UNLOCK_INTENTS =
9949                 "active_unlock_wakeups_considered_unlock_intents";
9950 
9951         /**
9952          * If active unlock triggers and succeeds on these wakeups, force dismiss keyguard on
9953          * these wake reasons. See {@link PowerManager#WakeReason} for value mappings.
9954          * WakeReasons should be separated by a pipe. For example: "0|3" or "0". If this
9955          * setting should be disabled, then this should be set to an empty string. A null value
9956          * will use the system default value (WAKE_REASON_UNFOLD_DEVICE).
9957          * @hide
9958          */
9959         public static final String ACTIVE_UNLOCK_WAKEUPS_TO_FORCE_DISMISS_KEYGUARD =
9960                 "active_unlock_wakeups_to_force_dismiss_keyguard";
9961 
9962         /**
9963          * Whether the assist gesture should be enabled.
9964          *
9965          * @hide
9966          */
9967         @Readable
9968         public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled";
9969 
9970         /**
9971          * Sensitivity control for the assist gesture.
9972          *
9973          * @hide
9974          */
9975         @Readable
9976         public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity";
9977 
9978         /**
9979          * Whether the assist gesture should silence alerts.
9980          *
9981          * @hide
9982          */
9983         @Readable
9984         public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED =
9985                 "assist_gesture_silence_alerts_enabled";
9986 
9987         /**
9988          * Whether the assist gesture should wake the phone.
9989          *
9990          * @hide
9991          */
9992         @Readable
9993         public static final String ASSIST_GESTURE_WAKE_ENABLED =
9994                 "assist_gesture_wake_enabled";
9995 
9996         /**
9997          * Indicates whether the Assist Gesture Deferred Setup has been completed.
9998          * <p>
9999          * Type: int (0 for false, 1 for true)
10000          *
10001          * @hide
10002          */
10003         @SystemApi
10004         @Readable
10005         public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
10006 
10007         /**
10008          * Whether the assistant can be triggered by a touch gesture.
10009          *
10010          * @hide
10011          */
10012         public static final String ASSIST_TOUCH_GESTURE_ENABLED =
10013                 "assist_touch_gesture_enabled";
10014 
10015         /**
10016          * Whether the assistant can be triggered by long-pressing the home button
10017          *
10018          * @hide
10019          */
10020         public static final String ASSIST_LONG_PRESS_HOME_ENABLED =
10021                 "assist_long_press_home_enabled";
10022 
10023         /**
10024          * Control whether Trust Agents are in active unlock or extend unlock mode.
10025          * @hide
10026          */
10027         @Readable
10028         public static final String TRUST_AGENTS_EXTEND_UNLOCK = "trust_agents_extend_unlock";
10029 
10030         /**
10031          * Control whether the screen locks when trust is lost.
10032          * @hide
10033          */
10034         @Readable
10035         public static final String LOCK_SCREEN_WHEN_TRUST_LOST = "lock_screen_when_trust_lost";
10036 
10037         /**
10038          * Control whether Night display is currently activated.
10039          * @hide
10040          */
10041         @Readable
10042         public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated";
10043 
10044         /**
10045          * Control whether Night display will automatically activate/deactivate.
10046          * @hide
10047          */
10048         @Readable
10049         public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode";
10050 
10051         /**
10052          * Control the color temperature of Night Display, represented in Kelvin.
10053          * @hide
10054          */
10055         @Readable
10056         public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE =
10057                 "night_display_color_temperature";
10058 
10059         /**
10060          * Custom time when Night display is scheduled to activate.
10061          * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
10062          * @hide
10063          */
10064         @Readable
10065         public static final String NIGHT_DISPLAY_CUSTOM_START_TIME =
10066                 "night_display_custom_start_time";
10067 
10068         /**
10069          * Custom time when Night display is scheduled to deactivate.
10070          * Represented as milliseconds from midnight (e.g. 21600000 == 6am).
10071          * @hide
10072          */
10073         @Readable
10074         public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time";
10075 
10076         /**
10077          * A String representing the LocalDateTime when Night display was last activated. Use to
10078          * decide whether to apply the current activated state after a reboot or user change. In
10079          * legacy cases, this is represented by the time in milliseconds (since epoch).
10080          * @hide
10081          */
10082         @Readable
10083         public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME =
10084                 "night_display_last_activated_time";
10085 
10086         /**
10087          * Control whether display white balance is currently enabled.
10088          * @hide
10089          */
10090         @Readable
10091         public static final String DISPLAY_WHITE_BALANCE_ENABLED = "display_white_balance_enabled";
10092 
10093         /**
10094          * Names of the service components that the current user has explicitly allowed to
10095          * be a VR mode listener, separated by ':'.
10096          *
10097          * @hide
10098          */
10099         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
10100         @TestApi
10101         @Readable
10102         public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners";
10103 
10104         /**
10105          * Behavior of the display while in VR mode.
10106          *
10107          * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}.
10108          *
10109          * @hide
10110          */
10111         @Readable
10112         public static final String VR_DISPLAY_MODE = "vr_display_mode";
10113 
10114         /**
10115          * Lower the display persistence while the system is in VR mode.
10116          *
10117          * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
10118          *
10119          * @hide.
10120          */
10121         public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0;
10122 
10123         /**
10124          * Do not alter the display persistence while the system is in VR mode.
10125          *
10126          * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
10127          *
10128          * @hide.
10129          */
10130         public static final int VR_DISPLAY_MODE_OFF = 1;
10131 
10132         /**
10133          * The latest SDK version that CarrierAppUtils#disableCarrierAppsUntilPrivileged has been
10134          * executed for.
10135          *
10136          * <p>This is used to ensure that we only take one pass which will disable apps that are not
10137          * privileged (if any). From then on, we only want to enable apps (when a matching SIM is
10138          * inserted), to avoid disabling an app that the user might actively be using.
10139          *
10140          * <p>Will be set to {@link android.os.Build.VERSION#SDK_INT} once executed. Note that older
10141          * SDK versions prior to R set 1 for this value.
10142          *
10143          * @hide
10144          */
10145         @Readable
10146         public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled";
10147 
10148         /**
10149          * Whether parent user can access remote contact in managed profile.
10150          *
10151          * @hide
10152          */
10153         @Readable
10154         public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH =
10155                 "managed_profile_contact_remote_search";
10156 
10157         /**
10158          * Whether parent profile can access remote calendar data in managed profile.
10159          *
10160          * @hide
10161          */
10162         @Readable
10163         public static final String CROSS_PROFILE_CALENDAR_ENABLED =
10164                 "cross_profile_calendar_enabled";
10165 
10166         /**
10167          * Whether or not the automatic storage manager is enabled and should run on the device.
10168          *
10169          * @hide
10170          */
10171         @Readable
10172         public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED =
10173                 "automatic_storage_manager_enabled";
10174 
10175         /**
10176          * How many days of information for the automatic storage manager to retain on the device.
10177          *
10178          * @hide
10179          */
10180         @Readable
10181         public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN =
10182                 "automatic_storage_manager_days_to_retain";
10183 
10184         /**
10185          * Default number of days of information for the automatic storage manager to retain.
10186          *
10187          * @hide
10188          */
10189         public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90;
10190 
10191         /**
10192          * How many bytes the automatic storage manager has cleared out.
10193          *
10194          * @hide
10195          */
10196         @Readable
10197         public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED =
10198                 "automatic_storage_manager_bytes_cleared";
10199 
10200         /**
10201          * Last run time for the automatic storage manager.
10202          *
10203          * @hide
10204          */
10205         @Readable
10206         public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN =
10207                 "automatic_storage_manager_last_run";
10208         /**
10209          * If the automatic storage manager has been disabled by policy. Note that this doesn't
10210          * mean that the automatic storage manager is prevented from being re-enabled -- this only
10211          * means that it was turned off by policy at least once.
10212          *
10213          * @hide
10214          */
10215         @Readable
10216         public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY =
10217                 "automatic_storage_manager_turned_off_by_policy";
10218 
10219         /**
10220          * Whether SystemUI navigation keys is enabled.
10221          * @hide
10222          */
10223         @Readable
10224         public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
10225                 "system_navigation_keys_enabled";
10226 
10227         /**
10228          * Holds comma separated list of ordering of QS tiles.
10229          *
10230          * @hide
10231          */
10232         @Readable
10233         public static final String QS_TILES = "sysui_qs_tiles";
10234 
10235         /**
10236          * Whether this user has enabled Quick controls.
10237          *
10238          * 0 indicates disabled and 1 indicates enabled. A non existent value should be treated as
10239          * enabled.
10240          *
10241          * @deprecated Controls are migrated to Quick Settings, rendering this unnecessary and will
10242          *             be removed in a future release.
10243          * @hide
10244          */
10245         @Readable
10246         @Deprecated
10247         public static final String CONTROLS_ENABLED = "controls_enabled";
10248 
10249         /**
10250          * Whether power menu content (cards, passes, controls) will be shown when device is locked.
10251          *
10252          * 0 indicates hide and 1 indicates show. A non existent value will be treated as hide.
10253          * @hide
10254          */
10255         @TestApi
10256         @Readable
10257         public static final String POWER_MENU_LOCKED_SHOW_CONTENT =
10258                 "power_menu_locked_show_content";
10259 
10260         /**
10261          * Whether home controls should be accessible from the lockscreen
10262          *
10263          * @hide
10264          */
10265         public static final String LOCKSCREEN_SHOW_CONTROLS = "lockscreen_show_controls";
10266 
10267         /**
10268          * Whether trivial home controls can be used without authentication
10269          *
10270          * @hide
10271          */
10272         public static final String LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS =
10273                 "lockscreen_allow_trivial_controls";
10274 
10275         /**
10276          * Whether wallet should be accessible from the lockscreen
10277          *
10278          * @hide
10279          */
10280         public static final String LOCKSCREEN_SHOW_WALLET = "lockscreen_show_wallet";
10281 
10282         /**
10283          * Whether to use the lockscreen double-line clock
10284          *
10285          * @hide
10286          */
10287         public static final String LOCKSCREEN_USE_DOUBLE_LINE_CLOCK =
10288                 "lockscreen_use_double_line_clock";
10289 
10290         /**
10291          * Whether to show the vibrate icon in the Status Bar (default off)
10292          *
10293          * @hide
10294          */
10295         public static final String STATUS_BAR_SHOW_VIBRATE_ICON = "status_bar_show_vibrate_icon";
10296 
10297         /**
10298          * Specifies whether the web action API is enabled.
10299          *
10300          * @hide
10301          */
10302         @SystemApi
10303         @Readable
10304         public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled";
10305 
10306         /**
10307          * Whether qr code scanner should be accessible from the lockscreen
10308          *
10309          * @hide
10310          */
10311         public static final String LOCK_SCREEN_SHOW_QR_CODE_SCANNER =
10312                 "lock_screen_show_qr_code_scanner";
10313 
10314         /**
10315          * Whether or not to enable qr code code scanner setting to enable/disable lockscreen
10316          * entry point. Any value apart from null means setting needs to be enabled
10317          *
10318          * @hide
10319          */
10320         public static final String SHOW_QR_CODE_SCANNER_SETTING =
10321                 "show_qr_code_scanner_setting";
10322 
10323         /**
10324          * Has this pairable device been paired or upgraded from a previously paired system.
10325          * @hide
10326          */
10327         @Readable
10328         public static final String DEVICE_PAIRED = "device_paired";
10329 
10330         /**
10331          * Specifies additional package name for broadcasting the CMAS messages.
10332          * @hide
10333          */
10334         @Readable
10335         public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg";
10336 
10337         /**
10338          * Whether the launcher should show any notification badges.
10339          * The value is boolean (1 or 0).
10340          * @hide
10341          */
10342         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
10343         @TestApi
10344         @Readable
10345         public static final String NOTIFICATION_BADGING = "notification_badging";
10346 
10347         /**
10348          * When enabled the system will maintain a rolling history of received notifications. When
10349          * disabled the history will be disabled and deleted.
10350          *
10351          * The value 1 - enable, 0 - disable
10352          * @hide
10353          */
10354         @Readable
10355         public static final String NOTIFICATION_HISTORY_ENABLED = "notification_history_enabled";
10356 
10357         /**
10358          * When enabled conversations marked as favorites will be set to bubble.
10359          *
10360          * The value 1 - enable, 0 - disable
10361          * @hide
10362          */
10363         @Readable
10364         public static final String BUBBLE_IMPORTANT_CONVERSATIONS
10365                 = "bubble_important_conversations";
10366 
10367         /**
10368          * When enabled, notifications able to bubble will display an affordance allowing the user
10369          * to bubble them.
10370          * The value is boolean (1 to enable or 0 to disable).
10371          *
10372          * @hide
10373          */
10374         @TestApi
10375         @SuppressLint("NoSettingsProvider")
10376         @Readable
10377         public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
10378 
10379         /**
10380          * Whether notifications are dismissed by a right-to-left swipe (instead of a left-to-right
10381          * swipe).
10382          *
10383          * @hide
10384          */
10385         @Readable
10386         public static final String NOTIFICATION_DISMISS_RTL = "notification_dismiss_rtl";
10387 
10388         /**
10389          * Comma separated list of QS tiles that have been auto-added already.
10390          * @hide
10391          */
10392         @Readable
10393         public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles";
10394 
10395         /**
10396          * The duration of timeout, in milliseconds, to switch from a non-Dock User to the
10397          * Dock User when the device is docked.
10398          * @hide
10399          */
10400         public static final String TIMEOUT_TO_DOCK_USER = "timeout_to_dock_user";
10401 
10402         /**
10403          * Backup manager behavioral parameters.
10404          * This is encoded as a key=value list, separated by commas. Ex:
10405          *
10406          * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true"
10407          *
10408          * The following keys are supported:
10409          *
10410          * <pre>
10411          * key_value_backup_interval_milliseconds  (long)
10412          * key_value_backup_fuzz_milliseconds      (long)
10413          * key_value_backup_require_charging       (boolean)
10414          * key_value_backup_required_network_type  (int)
10415          * full_backup_interval_milliseconds       (long)
10416          * full_backup_require_charging            (boolean)
10417          * full_backup_required_network_type       (int)
10418          * backup_finished_notification_receivers  (String[])
10419          * </pre>
10420          *
10421          * backup_finished_notification_receivers uses ":" as delimeter for values.
10422          *
10423          * <p>
10424          * Type: string
10425          * @hide
10426          */
10427         @Readable
10428         public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants";
10429 
10430 
10431         /**
10432          * Local transport parameters so we can configure it for tests.
10433          * This is encoded as a key=value list, separated by commas.
10434          *
10435          * The following keys are supported:
10436          *
10437          * <pre>
10438          * fake_encryption_flag  (boolean)
10439          * </pre>
10440          *
10441          * <p>
10442          * Type: string
10443          * @hide
10444          */
10445         @Readable
10446         public static final String BACKUP_LOCAL_TRANSPORT_PARAMETERS =
10447                 "backup_local_transport_parameters";
10448 
10449         /**
10450          * Flag to set if the system should predictively attempt to re-enable Bluetooth while
10451          * the user is driving.
10452          * @hide
10453          */
10454         @Readable
10455         public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving";
10456 
10457         /**
10458          * What behavior should be invoked when the volume hush gesture is triggered
10459          * One of VOLUME_HUSH_OFF, VOLUME_HUSH_VIBRATE, VOLUME_HUSH_MUTE.
10460          *
10461          * @hide
10462          */
10463         @SystemApi
10464         @Readable
10465         public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture";
10466 
10467         /** @hide */
10468         @SystemApi
10469         public static final int VOLUME_HUSH_OFF = 0;
10470         /** @hide */
10471         @SystemApi
10472         public static final int VOLUME_HUSH_VIBRATE = 1;
10473         /** @hide */
10474         @SystemApi
10475         public static final int VOLUME_HUSH_MUTE = 2;
10476 
10477         /**
10478          * The number of times (integer) the user has manually enabled battery saver.
10479          * @hide
10480          */
10481         @Readable
10482         public static final String LOW_POWER_MANUAL_ACTIVATION_COUNT =
10483                 "low_power_manual_activation_count";
10484 
10485         /**
10486          * Whether the "first time battery saver warning" dialog needs to be shown (0: default)
10487          * or not (1).
10488          *
10489          * @hide
10490          */
10491         @Readable
10492         public static final String LOW_POWER_WARNING_ACKNOWLEDGED =
10493                 "low_power_warning_acknowledged";
10494 
10495         /**
10496          * 0 (default) Auto battery saver suggestion has not been suppressed. 1) it has been
10497          * suppressed.
10498          * @hide
10499          */
10500         @Readable
10501         public static final String SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION =
10502                 "suppress_auto_battery_saver_suggestion";
10503 
10504         /**
10505          * List of packages, which data need to be unconditionally cleared before full restore.
10506          * Type: string
10507          * @hide
10508          */
10509         @Readable
10510         public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE =
10511                 "packages_to_clear_data_before_full_restore";
10512 
10513         /**
10514          * How often to check for location access.
10515          * @hide
10516          */
10517         @SystemApi
10518         @Readable
10519         public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS =
10520                 "location_access_check_interval_millis";
10521 
10522         /**
10523          * Delay between granting location access and checking it.
10524          * @hide
10525          */
10526         @SystemApi
10527         @Readable
10528         public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS =
10529                 "location_access_check_delay_millis";
10530 
10531         /**
10532          * @deprecated This setting does not have any effect anymore
10533          * @hide
10534          */
10535         @SystemApi
10536         @Deprecated
10537         @Readable
10538         public static final String LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE =
10539                 "location_permissions_upgrade_to_q_mode";
10540 
10541         /**
10542          * Whether or not the system Auto Revoke feature is disabled.
10543          * @hide
10544          */
10545         @SystemApi
10546         @Readable
10547         public static final String AUTO_REVOKE_DISABLED = "auto_revoke_disabled";
10548 
10549         /**
10550          * Map of android.theme.customization.* categories to the enabled overlay package for that
10551          * category, formatted as a serialized {@link org.json.JSONObject}. If there is no
10552          * corresponding package included for a category, then all overlay packages in that
10553          * category must be disabled.
10554          *
10555          * A few category keys have special meaning and are used for Material You theming.
10556          *
10557          * A {@code FabricatedOverlay} containing Material You tonal palettes will be generated
10558          * in case {@code android.theme.customization.system_palette} contains a
10559          * {@link android.annotation.ColorInt}.
10560          *
10561          * The strategy used for generating the tonal palettes can be defined with the
10562          * {@code android.theme.customization.theme_style} key, with one of the following options:
10563          * <ul>
10564          *   <li> {@code TONAL_SPOT} is a mid vibrancy palette that uses an accent 3 analogous to
10565          *   accent 1.</li>
10566          *   <li> {@code VIBRANT} is a high vibrancy palette that harmoniously blends subtle shifts
10567          *   between colors.</li>
10568          *   <li> {@code EXPRESSIVE} is a high vibrancy palette that pairs unexpected and unique
10569          *   accents colors together.</li>
10570          *   <li> {@code SPRITZ} is a low vibrancy palette that creates a soft wash between
10571          *   colors.</li>
10572          *   <li> {@code RAINBOW} uses both chromatic accents and neutral surfaces to create a more
10573          *   subtle color experience for users.</li>
10574          *   <li> {@code FRUIT_SALAD} experiments with the concept of "two tone colors" to give
10575          *   users more expression.</li>
10576          * </ul>
10577          *
10578          * Example of valid fabricated theme specification:
10579          * <pre>
10580          * {
10581          *     "android.theme.customization.system_palette":"B1611C",
10582          *     "android.theme.customization.theme_style":"EXPRESSIVE"
10583          * }
10584          * </pre>
10585          * @hide
10586          */
10587         @SystemApi
10588         @Readable
10589         public static final String THEME_CUSTOMIZATION_OVERLAY_PACKAGES =
10590                 "theme_customization_overlay_packages";
10591 
10592         /**
10593          * Indicates whether the nav bar is forced to always be visible, even in immersive mode.
10594          * <p>Type: int (0 for false, 1 for true)
10595          *
10596          * @hide
10597          */
10598         public static final String NAV_BAR_FORCE_VISIBLE = "nav_bar_force_visible";
10599 
10600         /**
10601          * Indicates whether the device is in kids nav mode.
10602          * <p>Type: int (0 for false, 1 for true)
10603          *
10604          * @hide
10605          */
10606         public static final String NAV_BAR_KIDS_MODE = "nav_bar_kids_mode";
10607 
10608         /**
10609          * Navigation bar mode.
10610          *  0 = 3 button
10611          *  1 = 2 button
10612          *  2 = fully gestural
10613          * @hide
10614          */
10615         @Readable
10616         public static final String NAVIGATION_MODE =
10617                 "navigation_mode";
10618 
10619         /**
10620          * Scale factor for the back gesture inset size on the left side of the screen.
10621          * @hide
10622          */
10623         @Readable
10624         public static final String BACK_GESTURE_INSET_SCALE_LEFT =
10625                 "back_gesture_inset_scale_left";
10626 
10627         /**
10628          * Scale factor for the back gesture inset size on the right side of the screen.
10629          * @hide
10630          */
10631         @Readable
10632         public static final String BACK_GESTURE_INSET_SCALE_RIGHT =
10633                 "back_gesture_inset_scale_right";
10634 
10635         /**
10636          * Current provider of proximity-based sharing services.
10637          * Default value in @string/config_defaultNearbySharingComponent.
10638          * No VALIDATOR as this setting will not be backed up.
10639          * @hide
10640          */
10641         @Readable
10642         public static final String NEARBY_SHARING_COMPONENT = "nearby_sharing_component";
10643 
10644         /**
10645          * Nearby Sharing Slice URI for the SliceProvider to
10646          * read Nearby Sharing scan results and then draw the UI.
10647          * @hide
10648          */
10649         public static final String NEARBY_SHARING_SLICE_URI = "nearby_sharing_slice_uri";
10650 
10651         /**
10652          * Current provider of Fast Pair saved devices page.
10653          * Default value in @string/config_defaultNearbyFastPairSettingsDevicesComponent.
10654          * No VALIDATOR as this setting will not be backed up.
10655          * @hide
10656          */
10657         public static final String NEARBY_FAST_PAIR_SETTINGS_DEVICES_COMPONENT =
10658                 "nearby_fast_pair_settings_devices_component";
10659 
10660         /**
10661          * Current provider of the component for requesting ambient context consent.
10662          * Default value in @string/config_defaultAmbientContextConsentComponent.
10663          * No VALIDATOR as this setting will not be backed up.
10664          * @hide
10665          */
10666         public static final String AMBIENT_CONTEXT_CONSENT_COMPONENT =
10667                 "ambient_context_consent_component";
10668 
10669         /**
10670          * Current provider of the intent extra key for the caller's package name while
10671          * requesting ambient context consent.
10672          * No VALIDATOR as this setting will not be backed up.
10673          * @hide
10674          */
10675         public static final String AMBIENT_CONTEXT_PACKAGE_NAME_EXTRA_KEY =
10676                 "ambient_context_package_name_key";
10677 
10678         /**
10679          * Current provider of the intent extra key for the event code int array while
10680          * requesting ambient context consent.
10681          * Default value in @string/config_ambientContextEventArrayExtraKey.
10682          * No VALIDATOR as this setting will not be backed up.
10683          * @hide
10684          */
10685         public static final String AMBIENT_CONTEXT_EVENT_ARRAY_EXTRA_KEY =
10686                 "ambient_context_event_array_key";
10687 
10688         /**
10689          * Controls whether aware is enabled.
10690          * @hide
10691          */
10692         @Readable
10693         public static final String AWARE_ENABLED = "aware_enabled";
10694 
10695         /**
10696          * Controls whether aware_lock is enabled.
10697          * @hide
10698          */
10699         @Readable
10700         public static final String AWARE_LOCK_ENABLED = "aware_lock_enabled";
10701 
10702         /**
10703          * Controls whether tap gesture is enabled.
10704          * @hide
10705          */
10706         @Readable
10707         public static final String TAP_GESTURE = "tap_gesture";
10708 
10709         /**
10710          * Controls whether the people strip is enabled.
10711          * @hide
10712          */
10713         @Readable
10714         public static final String PEOPLE_STRIP = "people_strip";
10715 
10716         /**
10717          * Whether or not to enable media resumption
10718          * When enabled, media controls in quick settings will populate on boot and persist if
10719          * resumable via a MediaBrowserService.
10720          * @see Settings.Global#SHOW_MEDIA_ON_QUICK_SETTINGS
10721          * @hide
10722          */
10723         @Readable
10724         public static final String MEDIA_CONTROLS_RESUME = "qs_media_resumption";
10725 
10726         /**
10727          * Whether to enable media controls on lock screen.
10728          * When enabled, media controls will appear on lock screen.
10729          * @hide
10730          */
10731         public static final String MEDIA_CONTROLS_LOCK_SCREEN = "media_controls_lock_screen";
10732 
10733         /**
10734          * Controls whether contextual suggestions can be shown in the media controls.
10735          * @hide
10736          */
10737         public static final String MEDIA_CONTROLS_RECOMMENDATION = "qs_media_recommend";
10738 
10739         /**
10740          * Controls magnification mode when magnification is enabled via a system-wide triple tap
10741          * gesture or the accessibility shortcut.
10742          *
10743          * @see #ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN
10744          * @see #ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW
10745          * @hide
10746          */
10747         @TestApi
10748         @Readable
10749         public static final String ACCESSIBILITY_MAGNIFICATION_MODE =
10750                 "accessibility_magnification_mode";
10751 
10752         /**
10753          * Magnification mode value that is a default value for the magnification logging feature.
10754          * @hide
10755          */
10756         public static final int ACCESSIBILITY_MAGNIFICATION_MODE_NONE = 0x0;
10757 
10758         /**
10759          * Magnification mode value that magnifies whole display.
10760          * @hide
10761          */
10762         @TestApi
10763         public static final int ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN = 0x1;
10764 
10765         /**
10766          * Magnification mode value that magnifies magnify particular region in a window
10767          * @hide
10768          */
10769         @TestApi
10770         public static final int ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW = 0x2;
10771 
10772         /**
10773          * Magnification mode value that is capable of magnifying whole display and particular
10774          * region in a window.
10775          * @hide
10776          */
10777         @TestApi
10778         public static final int ACCESSIBILITY_MAGNIFICATION_MODE_ALL = 0x3;
10779 
10780         /**
10781          * Whether the following typing focus feature for magnification is enabled.
10782          * @hide
10783          */
10784         public static final String ACCESSIBILITY_MAGNIFICATION_FOLLOW_TYPING_ENABLED =
10785                 "accessibility_magnification_follow_typing_enabled";
10786 
10787         /**
10788          * Controls magnification capability. Accessibility magnification is capable of at least one
10789          * of the magnification modes.
10790          *
10791          * @see #ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN
10792          * @see #ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW
10793          * @see #ACCESSIBILITY_MAGNIFICATION_MODE_ALL
10794          * @hide
10795          */
10796         @TestApi
10797         @Readable
10798         public static final String ACCESSIBILITY_MAGNIFICATION_CAPABILITY =
10799                 "accessibility_magnification_capability";
10800 
10801         /**
10802          *  Whether to show the window magnification prompt dialog when the user uses full-screen
10803          *  magnification first time after database is upgraded.
10804          *
10805          * @hide
10806          */
10807         public static final String ACCESSIBILITY_SHOW_WINDOW_MAGNIFICATION_PROMPT =
10808                 "accessibility_show_window_magnification_prompt";
10809 
10810         /**
10811          * Controls the accessibility button mode. System will force-set the value to {@link
10812          * #ACCESSIBILITY_BUTTON_MODE_GESTURE} if {@link #NAVIGATION_MODE} is button; force-set the
10813          * value to {@link ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR} if {@link #NAVIGATION_MODE} is
10814          * gestural; otherwise, remain the option.
10815          * <ul>
10816          *    <li> 0 = button in navigation bar </li>
10817          *    <li> 1 = button floating on the display </li>
10818          *    <li> 2 = button using gesture to trigger </li>
10819          * </ul>
10820          *
10821          * @see #ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR
10822          * @see #ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU
10823          * @see #ACCESSIBILITY_BUTTON_MODE_GESTURE
10824          * @hide
10825          */
10826         public static final String ACCESSIBILITY_BUTTON_MODE =
10827                 "accessibility_button_mode";
10828 
10829         /**
10830          * Accessibility button mode value that specifying the accessibility service or feature to
10831          * be toggled via the button in the navigation bar.
10832          *
10833          * @hide
10834          */
10835         public static final int ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR = 0x0;
10836 
10837         /**
10838          * Accessibility button mode value that specifying the accessibility service or feature to
10839          * be toggled via the button floating on the display.
10840          *
10841          * @hide
10842          */
10843         public static final int ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU = 0x1;
10844 
10845         /**
10846          * Accessibility button mode value that specifying the accessibility service or feature to
10847          * be toggled via the gesture.
10848          *
10849          * @hide
10850          */
10851         public static final int ACCESSIBILITY_BUTTON_MODE_GESTURE = 0x2;
10852 
10853         /**
10854          * The size of the accessibility floating menu.
10855          * <ul>
10856          *     <li> 0 = small size
10857          *     <li> 1 = large size
10858          * </ul>
10859          *
10860          * @hide
10861          */
10862         public static final String ACCESSIBILITY_FLOATING_MENU_SIZE =
10863                 "accessibility_floating_menu_size";
10864 
10865         /**
10866          * The icon type of the accessibility floating menu.
10867          * <ul>
10868          *     <li> 0 = full circle type
10869          *     <li> 1 = half circle type
10870          * </ul>
10871          *
10872          * @hide
10873          */
10874         public static final String ACCESSIBILITY_FLOATING_MENU_ICON_TYPE =
10875                 "accessibility_floating_menu_icon_type";
10876 
10877         /**
10878          * Whether the fade effect for the accessibility floating menu is enabled.
10879          *
10880          * @hide
10881          */
10882         public static final String ACCESSIBILITY_FLOATING_MENU_FADE_ENABLED =
10883                 "accessibility_floating_menu_fade_enabled";
10884 
10885         /**
10886          * The opacity value for the accessibility floating menu fade out effect, from 0.0
10887          * (transparent) to 1.0 (opaque).
10888          *
10889          * @hide
10890          */
10891         public static final String ACCESSIBILITY_FLOATING_MENU_OPACITY =
10892                 "accessibility_floating_menu_opacity";
10893 
10894         /**
10895          * Prompts the user to the Accessibility button is replaced with the floating menu.
10896          * <ul>
10897          *    <li> 0 = disabled </li>
10898          *    <li> 1 = enabled </li>
10899          * </ul>
10900          *
10901          * @hide
10902          */
10903         public static final String ACCESSIBILITY_FLOATING_MENU_MIGRATION_TOOLTIP_PROMPT =
10904                 "accessibility_floating_menu_migration_tooltip_prompt";
10905 
10906         /**
10907          * Whether the Adaptive connectivity option is enabled.
10908          *
10909          * @hide
10910          */
10911         public static final String ADAPTIVE_CONNECTIVITY_ENABLED = "adaptive_connectivity_enabled";
10912 
10913         /**
10914          * Keys we no longer back up under the current schema, but want to continue to
10915          * process when restoring historical backup datasets.
10916          *
10917          * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
10918          * otherwise they won't be restored.
10919          *
10920          * @hide
10921          */
10922         @Readable
10923         public static final String[] LEGACY_RESTORE_SETTINGS = {
10924                 ENABLED_NOTIFICATION_LISTENERS,
10925                 ENABLED_NOTIFICATION_ASSISTANT,
10926                 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES
10927         };
10928 
10929         /**
10930          * How long Assistant handles have enabled in milliseconds.
10931          *
10932          * @hide
10933          */
10934         public static final String ASSIST_HANDLES_LEARNING_TIME_ELAPSED_MILLIS =
10935                 "reminder_exp_learning_time_elapsed";
10936 
10937         /**
10938          * How many times the Assistant has been triggered using the touch gesture.
10939          *
10940          * @hide
10941          */
10942         public static final String ASSIST_HANDLES_LEARNING_EVENT_COUNT =
10943                 "reminder_exp_learning_event_count";
10944 
10945         /**
10946          * Whether to show clipboard access notifications.
10947          *
10948          * @hide
10949          */
10950         public static final String CLIPBOARD_SHOW_ACCESS_NOTIFICATIONS =
10951                 "clipboard_show_access_notifications";
10952 
10953         /**
10954          * If nonzero, nas has not been updated to reflect new changes.
10955          * @hide
10956          */
10957         @Readable
10958         public static final String NAS_SETTINGS_UPDATED = "nas_settings_updated";
10959 
10960         /**
10961          * Control whether Game Dashboard shortcut is always on for all games.
10962          * @hide
10963          */
10964         @Readable
10965         public static final String GAME_DASHBOARD_ALWAYS_ON = "game_dashboard_always_on";
10966 
10967 
10968         /**
10969          * For this device state, no specific auto-rotation lock setting should be applied.
10970          * If the user toggles the auto-rotate lock in this state, the setting will apply to the
10971          * previously valid device state.
10972          * @hide
10973          */
10974         public static final int DEVICE_STATE_ROTATION_LOCK_IGNORED = 0;
10975         /**
10976          * For this device state, the setting for auto-rotation is locked.
10977          * @hide
10978          */
10979         public static final int DEVICE_STATE_ROTATION_LOCK_LOCKED = 1;
10980         /**
10981          * For this device state, the setting for auto-rotation is unlocked.
10982          * @hide
10983          */
10984         public static final int DEVICE_STATE_ROTATION_LOCK_UNLOCKED = 2;
10985 
10986         /**
10987          * The different settings that can be used as values with
10988          * {@link #DEVICE_STATE_ROTATION_LOCK}.
10989          * @hide
10990          */
10991         @IntDef(prefix = {"DEVICE_STATE_ROTATION_LOCK_"}, value = {
10992                 DEVICE_STATE_ROTATION_LOCK_IGNORED,
10993                 DEVICE_STATE_ROTATION_LOCK_LOCKED,
10994                 DEVICE_STATE_ROTATION_LOCK_UNLOCKED,
10995         })
10996         @Retention(RetentionPolicy.SOURCE)
10997         public @interface DeviceStateRotationLockSetting {
10998         }
10999 
11000         /** @hide */
11001         public static final int DEVICE_STATE_ROTATION_KEY_UNKNOWN = -1;
11002         /** @hide */
11003         public static final int DEVICE_STATE_ROTATION_KEY_FOLDED = 0;
11004         /** @hide */
11005         public static final int DEVICE_STATE_ROTATION_KEY_HALF_FOLDED = 1;
11006         /** @hide */
11007         public static final int DEVICE_STATE_ROTATION_KEY_UNFOLDED = 2;
11008 
11009         /**
11010          * The different postures that can be used as keys with
11011          * {@link #DEVICE_STATE_ROTATION_LOCK}.
11012          * @hide
11013          */
11014         @IntDef(prefix = {"DEVICE_STATE_ROTATION_KEY_"}, value = {
11015                 DEVICE_STATE_ROTATION_KEY_UNKNOWN,
11016                 DEVICE_STATE_ROTATION_KEY_FOLDED,
11017                 DEVICE_STATE_ROTATION_KEY_HALF_FOLDED,
11018                 DEVICE_STATE_ROTATION_KEY_UNFOLDED,
11019         })
11020         @Retention(RetentionPolicy.SOURCE)
11021         public @interface DeviceStateRotationLockKey {
11022         }
11023 
11024         /**
11025          * Rotation lock setting keyed on device state.
11026          *
11027          * This holds a serialized map using int keys that represent postures in
11028          * {@link DeviceStateRotationLockKey} and value of
11029          * {@link DeviceStateRotationLockSetting} representing the rotation lock setting for that
11030          * posture.
11031          *
11032          * Serialized as key0:value0:key1:value1:...:keyN:valueN.
11033          *
11034          * Example: "0:1:1:2:2:1"
11035          * This example represents a map of:
11036          * <ul>
11037          *     <li>DEVICE_STATE_ROTATION_KEY_FOLDED -> DEVICE_STATE_ROTATION_LOCK_LOCKED</li>
11038          *     <li>DEVICE_STATE_ROTATION_KEY_HALF_FOLDED -> DEVICE_STATE_ROTATION_LOCK_UNLOCKED</li>
11039          *     <li>DEVICE_STATE_ROTATION_KEY_UNFOLDED -> DEVICE_STATE_ROTATION_LOCK_IGNORED</li>
11040          * </ul>
11041          *
11042          * @hide
11043          */
11044         public static final String DEVICE_STATE_ROTATION_LOCK =
11045                 "device_state_rotation_lock";
11046 
11047         /**
11048          * Control whether communal mode is allowed on this device.
11049          *
11050          * @hide
11051          */
11052         public static final String COMMUNAL_MODE_ENABLED = "communal_mode_enabled";
11053 
11054         /**
11055          * An array of SSIDs of Wi-Fi networks that, when connected, are considered safe to enable
11056          * the communal mode.
11057          *
11058          * @hide
11059          */
11060         public static final String COMMUNAL_MODE_TRUSTED_NETWORKS =
11061                 "communal_mode_trusted_networks";
11062 
11063         /**
11064          * Setting to store denylisted system languages by the CEC {@code <Set Menu Language>}
11065          * confirmation dialog.
11066          *
11067          * @hide
11068          */
11069         public static final String HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST =
11070                 "hdmi_cec_set_menu_language_denylist";
11071 
11072         /**
11073          * Whether the Taskbar Education is about to be shown or is currently showing.
11074          *
11075          * <p>1 if true, 0 or unset otherwise.
11076          *
11077          * <p>This setting is used to inform other components that the Taskbar Education is
11078          * currently showing, which can prevent them from showing something else to the user.
11079          *
11080          * @hide
11081          */
11082         public static final String LAUNCHER_TASKBAR_EDUCATION_SHOWING =
11083                 "launcher_taskbar_education_showing";
11084 
11085         /**
11086          * Whether or not adaptive charging feature is enabled by user.
11087          * Type: int (0 for false, 1 for true)
11088          * Default: 1
11089          *
11090          * @hide
11091          */
11092         public static final String ADAPTIVE_CHARGING_ENABLED = "adaptive_charging_enabled";
11093 
11094         /**
11095          * Whether battery saver is currently set to different schedule mode.
11096          *
11097          * @hide
11098          */
11099         public static final String EXTRA_AUTOMATIC_POWER_SAVE_MODE =
11100                 "extra_automatic_power_save_mode";
11101 
11102         /**
11103          * Whether lockscreen weather is enabled.
11104          *
11105          * @hide
11106          */
11107         public static final String LOCK_SCREEN_WEATHER_ENABLED = "lockscreen_weather_enabled";
11108 
11109         /**
11110          * These entries are considered common between the personal and the managed profile,
11111          * since the managed profile doesn't get to change them.
11112          */
11113         private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
11114 
11115         static {
11116             CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
11117             CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
11118             CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
11119             CLONE_TO_MANAGED_PROFILE.add(CONTENT_CAPTURE_ENABLED);
11120             CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
11121             CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER);
11122             CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
11123             CLONE_TO_MANAGED_PROFILE.add(SHOW_IME_WITH_HARD_KEYBOARD);
11124             CLONE_TO_MANAGED_PROFILE.add(NOTIFICATION_BUBBLES);
11125         }
11126 
11127         /** @hide */
getCloneToManagedProfileSettings(Set<String> outKeySet)11128         public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
11129             outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
11130         }
11131 
11132         /**
11133          * Secure settings which can be accessed by instant apps.
11134          * @hide
11135          */
11136         public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
11137         static {
11138             INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES);
11139             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD);
11140             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED);
11141             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED);
11142             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET);
11143             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE);
11144             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR);
11145             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE);
11146             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR);
11147             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR);
11148             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE);
11149             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE);
11150             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR);
11151             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED);
11152             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER);
11153             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY);
11154             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED);
11155             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON);
11156 
11157             INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD);
11158             INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS);
11159 
11160             INSTANT_APP_SETTINGS.add(ANDROID_ID);
11161 
11162             INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION);
11163         }
11164 
11165         /**
11166          * Helper method for determining if a location provider is enabled.
11167          *
11168          * @param cr the content resolver to use
11169          * @param provider the location provider to query
11170          * @return true if the provider is enabled
11171          *
11172          * @deprecated use {@link LocationManager#isProviderEnabled(String)}
11173          */
11174         @Deprecated
isLocationProviderEnabled(ContentResolver cr, String provider)11175         public static boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
11176             IBinder binder = ServiceManager.getService(Context.LOCATION_SERVICE);
11177             ILocationManager lm = Objects.requireNonNull(ILocationManager.Stub.asInterface(binder));
11178             try {
11179                 return lm.isProviderEnabledForUser(provider, cr.getUserId());
11180             } catch (RemoteException e) {
11181                 throw e.rethrowFromSystemServer();
11182             }
11183         }
11184 
11185         /**
11186          * Thread-safe method for enabling or disabling a single location provider. This will have
11187          * no effect on Android Q and above.
11188          * @param cr the content resolver to use
11189          * @param provider the location provider to enable or disable
11190          * @param enabled true if the provider should be enabled
11191          * @deprecated This API is deprecated
11192          */
11193         @Deprecated
setLocationProviderEnabled(ContentResolver cr, String provider, boolean enabled)11194         public static void setLocationProviderEnabled(ContentResolver cr,
11195                 String provider, boolean enabled) {
11196         }
11197     }
11198 
11199     /**
11200      * Global system settings, containing preferences that always apply identically
11201      * to all defined users.  Applications can read these but are not allowed to write;
11202      * like the "Secure" settings, these are for preferences that the user must
11203      * explicitly modify through the system UI or specialized APIs for those values.
11204      */
11205     public static final class Global extends NameValueTable {
11206         // NOTE: If you add new settings here, be sure to add them to
11207         // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked.
11208 
11209         /**
11210          * The content:// style URL for global secure settings items.  Not public.
11211          */
11212         public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
11213 
11214         /**
11215          * Whether the notification bubbles are globally enabled
11216          * The value is boolean (1 or 0).
11217          * @hide
11218          * @deprecated moved to secure settings.
11219          */
11220         @Deprecated
11221         @TestApi
11222         @Readable
11223         public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
11224 
11225         /**
11226          * Whether users are allowed to add more users or guest from lockscreen.
11227          * <p>
11228          * Type: int
11229          * @hide
11230          */
11231         @Readable
11232         public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
11233 
11234         /**
11235          * Whether guest user should be removed on exit from guest mode.
11236          * <p>
11237          * Type: int
11238          * @hide
11239          */
11240         public static final String REMOVE_GUEST_ON_EXIT = "remove_guest_on_exit";
11241 
11242         /**
11243          * Whether applying ramping ringer on incoming phone call ringtone.
11244          * <p>1 = apply ramping ringer
11245          * <p>0 = do not apply ramping ringer
11246          * @deprecated Use {@link AudioManager#isRampingRingerEnabled()} instead
11247          */
11248         @Deprecated
11249         @Readable
11250         public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer";
11251 
11252         /**
11253          * Setting whether the global gesture for enabling accessibility is enabled.
11254          * If this gesture is enabled the user will be able to perfrom it to enable
11255          * the accessibility state without visiting the settings app.
11256          *
11257          * @hide
11258          * No longer used. Should be removed once all dependencies have been updated.
11259          */
11260         @UnsupportedAppUsage
11261         @Readable
11262         public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
11263                 "enable_accessibility_global_gesture_enabled";
11264 
11265         /**
11266          * Whether Airplane Mode is on.
11267          */
11268         @Readable
11269         public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
11270 
11271         /**
11272          * Whether Theater Mode is on.
11273          * {@hide}
11274          */
11275         @SystemApi
11276         @Readable
11277         public static final String THEATER_MODE_ON = "theater_mode_on";
11278 
11279         /**
11280          * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
11281          */
11282         @Readable
11283         public static final String RADIO_BLUETOOTH = "bluetooth";
11284 
11285         /**
11286          * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
11287          */
11288         @Readable
11289         public static final String RADIO_WIFI = "wifi";
11290 
11291         /**
11292          * {@hide}
11293          */
11294         @Readable
11295         public static final String RADIO_WIMAX = "wimax";
11296         /**
11297          * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
11298          */
11299         @Readable
11300         public static final String RADIO_CELL = "cell";
11301 
11302         /**
11303          * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
11304          */
11305         @Readable
11306         public static final String RADIO_NFC = "nfc";
11307 
11308         /**
11309          * A comma separated list of radios that need to be disabled when airplane mode
11310          * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
11311          * included in the comma separated list.
11312          */
11313         @Readable
11314         public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
11315 
11316         /**
11317          * A comma separated list of radios that should to be disabled when airplane mode
11318          * is on, but can be manually reenabled by the user.  For example, if RADIO_WIFI is
11319          * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
11320          * will be turned off when entering airplane mode, but the user will be able to reenable
11321          * Wifi in the Settings app.
11322          * @hide
11323          */
11324         @SystemApi
11325         @Readable
11326         public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
11327 
11328         /**
11329          * An integer representing the Bluetooth Class of Device (CoD).
11330          *
11331          * @hide
11332          */
11333         @Readable
11334         @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
11335         @SuppressLint("NoSettingsProvider")
11336         public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device";
11337 
11338         /**
11339          * A Long representing a bitmap of profiles that should be disabled when bluetooth starts.
11340          * See {@link android.bluetooth.BluetoothProfile}.
11341          * {@hide}
11342          */
11343         @Readable
11344         @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
11345         @SuppressLint("NoSettingsProvider")
11346         public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";
11347 
11348         /**
11349          * A semi-colon separated list of Bluetooth interoperability workarounds.
11350          * Each entry is a partial Bluetooth device address string and an integer representing
11351          * the feature to be disabled, separated by a comma. The integer must correspond
11352          * to a interoperability feature as defined in "interop.h" in /system/bt.
11353          * <p>
11354          * Example: <br/>
11355          *   "00:11:22,0;01:02:03:04,2"
11356          * @hide
11357          */
11358         @Readable
11359        public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";
11360 
11361         /**
11362          * The policy for deciding when Wi-Fi should go to sleep (which will in
11363          * turn switch to using the mobile data as an Internet connection).
11364          * <p>
11365          * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
11366          * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
11367          * {@link #WIFI_SLEEP_POLICY_NEVER}.
11368          * @deprecated This is no longer used or set by the platform.
11369          */
11370         @Deprecated
11371         @Readable
11372         public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
11373 
11374         /**
11375          * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
11376          * policy, which is to sleep shortly after the turning off
11377          * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
11378          * @deprecated This is no longer used by the platform.
11379          */
11380         @Deprecated
11381         public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
11382 
11383         /**
11384          * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
11385          * the device is on battery, and never go to sleep when the device is
11386          * plugged in.
11387          * @deprecated This is no longer used by the platform.
11388          */
11389         @Deprecated
11390         public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
11391 
11392         /**
11393          * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
11394          * @deprecated This is no longer used by the platform.
11395          */
11396         @Deprecated
11397         public static final int WIFI_SLEEP_POLICY_NEVER = 2;
11398 
11399         /**
11400          * Value to specify if the device's UTC system clock should be set automatically, e.g. using
11401          * telephony signals like NITZ, or other sources like GNSS or NTP. 1=yes, 0=no (manual)
11402          */
11403         @Readable
11404         public static final String AUTO_TIME = "auto_time";
11405 
11406         /**
11407          * Value to specify if the device's time zone system property should be set automatically,
11408          * e.g. using telephony signals like MCC and NITZ, or other mechanisms like the location.
11409          * 1=yes, 0=no (manual).
11410          */
11411         @Readable
11412         public static final String AUTO_TIME_ZONE = "auto_time_zone";
11413 
11414         /**
11415          * URI for the car dock "in" event sound.
11416          * @hide
11417          */
11418         @Readable
11419         public static final String CAR_DOCK_SOUND = "car_dock_sound";
11420 
11421         /**
11422          * URI for the car dock "out" event sound.
11423          * @hide
11424          */
11425         @Readable
11426         public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
11427 
11428         /**
11429          * URI for the desk dock "in" event sound.
11430          * @hide
11431          */
11432         @Readable
11433         public static final String DESK_DOCK_SOUND = "desk_dock_sound";
11434 
11435         /**
11436          * URI for the desk dock "out" event sound.
11437          * @hide
11438          */
11439         @Readable
11440         public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
11441 
11442         /**
11443          * Whether to play a sound for dock events.
11444          * @hide
11445          */
11446         @Readable
11447         public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
11448 
11449         /**
11450          * Whether to play a sound for dock events, only when an accessibility service is on.
11451          * @hide
11452          */
11453         @Readable
11454         public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility";
11455 
11456         /**
11457          * URI for the "device locked" (keyguard shown) sound.
11458          * @hide
11459          */
11460         @Readable
11461         public static final String LOCK_SOUND = "lock_sound";
11462 
11463         /**
11464          * URI for the "device unlocked" sound.
11465          * @hide
11466          */
11467         @Readable
11468         public static final String UNLOCK_SOUND = "unlock_sound";
11469 
11470         /**
11471          * URI for the "device is trusted" sound, which is played when the device enters the trusted
11472          * state without unlocking.
11473          * @hide
11474          */
11475         @Readable
11476         public static final String TRUSTED_SOUND = "trusted_sound";
11477 
11478         /**
11479          * URI for the low battery sound file.
11480          * @hide
11481          */
11482         @Readable
11483         public static final String LOW_BATTERY_SOUND = "low_battery_sound";
11484 
11485         /**
11486          * Whether to play a sound for low-battery alerts.
11487          * @hide
11488          */
11489         @Readable
11490         public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
11491 
11492         /**
11493          * URI for the "wireless charging started" sound.
11494          * @hide
11495          */
11496         @Readable
11497         public static final String WIRELESS_CHARGING_STARTED_SOUND =
11498                 "wireless_charging_started_sound";
11499 
11500         /**
11501          * URI for "wired charging started" sound.
11502          * @hide
11503          */
11504         @Readable
11505         public static final String CHARGING_STARTED_SOUND = "charging_started_sound";
11506 
11507         /**
11508          * Whether to play a sound for charging events.
11509          * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_SOUNDS_ENABLED} instead
11510          * @hide
11511          */
11512         @Deprecated
11513         public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
11514 
11515         /**
11516          * Whether to vibrate for wireless charging events.
11517          * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_VIBRATION_ENABLED}
11518          * @hide
11519          */
11520         @Deprecated
11521         public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled";
11522 
11523         /**
11524          * Whether we keep the device on while the device is plugged in.
11525          * Supported values are:
11526          * <ul>
11527          * <li>{@code 0} to never stay on while plugged in</li>
11528          * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
11529          * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
11530          * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
11531          * <li>{@link BatteryManager#BATTERY_PLUGGED_DOCK} to stay on for dock charger</li>
11532          * </ul>
11533          * These values can be OR-ed together.
11534          */
11535         @Readable
11536         public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
11537 
11538         /**
11539          * When the user has enable the option to have a "bug report" command
11540          * in the power menu.
11541          * @hide
11542          */
11543         @Readable
11544         public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
11545 
11546         /**
11547          * The package name for the custom bugreport handler app. This app must be whitelisted.
11548          * This is currently used only by Power Menu short press.
11549          *
11550          * @hide
11551          */
11552         @Readable
11553         public static final String CUSTOM_BUGREPORT_HANDLER_APP = "custom_bugreport_handler_app";
11554 
11555         /**
11556          * The user id for the custom bugreport handler app. This is currently used only by Power
11557          * Menu short press.
11558          *
11559          * @hide
11560          */
11561         @Readable
11562         public static final String CUSTOM_BUGREPORT_HANDLER_USER = "custom_bugreport_handler_user";
11563 
11564         /**
11565          * Whether ADB over USB is enabled.
11566          */
11567         @Readable
11568         public static final String ADB_ENABLED = "adb_enabled";
11569 
11570         /**
11571          * Whether ADB over Wifi is enabled.
11572          * @hide
11573          */
11574         @Readable
11575         public static final String ADB_WIFI_ENABLED = "adb_wifi_enabled";
11576 
11577         /**
11578          * Whether Views are allowed to save their attribute data.
11579          * @hide
11580          */
11581         @Readable
11582         public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
11583 
11584         /**
11585          * Which application package is allowed to save View attribute data.
11586          * @hide
11587          */
11588         @Readable
11589         public static final String DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE =
11590                 "debug_view_attributes_application_package";
11591 
11592         /**
11593          * Whether assisted GPS should be enabled or not.
11594          * @hide
11595          */
11596         @Readable
11597         public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
11598 
11599         /**
11600          * Whether bluetooth is enabled/disabled
11601          * 0=disabled. 1=enabled.
11602          */
11603         @Readable
11604         public static final String BLUETOOTH_ON = "bluetooth_on";
11605 
11606         /**
11607          * CDMA Cell Broadcast SMS
11608          *                            0 = CDMA Cell Broadcast SMS disabled
11609          *                            1 = CDMA Cell Broadcast SMS enabled
11610          * @hide
11611          */
11612         @Readable
11613         public static final String CDMA_CELL_BROADCAST_SMS =
11614                 "cdma_cell_broadcast_sms";
11615 
11616         /**
11617          * The CDMA roaming mode 0 = Home Networks, CDMA default
11618          *                       1 = Roaming on Affiliated networks
11619          *                       2 = Roaming on any networks
11620          * @hide
11621          */
11622         @Readable
11623         public static final String CDMA_ROAMING_MODE = "roaming_settings";
11624 
11625         /**
11626          * The CDMA subscription mode 0 = RUIM/SIM (default)
11627          *                                1 = NV
11628          * @hide
11629          */
11630         @Readable
11631         public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
11632 
11633         /**
11634          * The default value for whether background data is enabled or not.
11635          *
11636          * Used by {@code NetworkPolicyManagerService}.
11637          *
11638          * @hide
11639          */
11640         @Readable
11641         public static final String DEFAULT_RESTRICT_BACKGROUND_DATA =
11642                 "default_restrict_background_data";
11643 
11644         /** Inactivity timeout to track mobile data activity.
11645          *
11646          * If set to a positive integer, it indicates the inactivity timeout value in seconds to
11647          * infer the data activity of mobile network. After a period of no activity on mobile
11648          * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
11649          * intent is fired to indicate a transition of network status from "active" to "idle". Any
11650          * subsequent activity on mobile networks triggers the firing of {@code
11651          * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
11652          *
11653          * Network activity refers to transmitting or receiving data on the network interfaces.
11654          *
11655          * Tracking is disabled if set to zero or negative value.
11656          *
11657          * @hide
11658          */
11659         @Readable
11660         public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
11661 
11662         /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
11663          * but for Wifi network.
11664          * @hide
11665          */
11666         @Readable
11667         public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
11668 
11669         /**
11670          * Whether or not data roaming is enabled. (0 = false, 1 = true)
11671          * Use {@link TelephonyManager#isDataRoamingEnabled} instead of calling via settings.
11672          */
11673         @Readable(maxTargetSdk = Build.VERSION_CODES.S_V2)
11674         public static final String DATA_ROAMING = "data_roaming";
11675 
11676         /**
11677          * The value passed to a Mobile DataConnection via bringUp which defines the
11678          * number of retries to perform when setting up the initial connection. The default
11679          * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
11680          * @hide
11681          */
11682         @Readable
11683         public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
11684 
11685         /**
11686          * Whether any package can be on external storage. When this is true, any
11687          * package, regardless of manifest values, is a candidate for installing
11688          * or moving onto external storage. (0 = false, 1 = true)
11689          * @hide
11690          */
11691         @Readable
11692         public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external";
11693 
11694         /**
11695          * The default SM-DP+ configured for this device.
11696          *
11697          * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to
11698          * download profiles. If this value is set, the LPA will query this server for any profiles
11699          * available to this device. If any are available, they may be downloaded during device
11700          * provisioning or in settings without needing the user to enter an activation code.
11701          *
11702          * @see android.service.euicc.EuiccService
11703          * @hide
11704          */
11705         @SystemApi
11706         @Readable
11707         public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
11708 
11709         /**
11710          * Whether any profile has ever been downloaded onto a eUICC on the device.
11711          *
11712          * <p>Used to hide eUICC UI from users who have never made use of it and would only be
11713          * confused by seeing references to it in settings.
11714          * (0 = false, 1 = true)
11715          * @hide
11716          */
11717         @SystemApi
11718         @Readable
11719         public static final String EUICC_PROVISIONED = "euicc_provisioned";
11720 
11721         /**
11722          * List of ISO country codes in which eUICC UI is shown. Country codes should be separated
11723          * by comma.
11724          *
11725          * Note: if {@link #EUICC_SUPPORTED_COUNTRIES} is empty, then {@link
11726          * #EUICC_UNSUPPORTED_COUNTRIES} is used.
11727          *
11728          * <p>Used to hide eUICC UI from users who are currently in countries where no carriers
11729          * support eUICC.
11730          *
11731          * @hide
11732          */
11733         @SystemApi
11734         @Readable
11735         public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries";
11736 
11737         /**
11738          * List of ISO country codes in which eUICC UI is not shown. Country codes should be
11739          * separated by comma.
11740          *
11741          * Note: if {@link #EUICC_SUPPORTED_COUNTRIES} is empty, then {@link
11742          * #EUICC_UNSUPPORTED_COUNTRIES} is used.
11743          *
11744          * <p>Used to hide eUICC UI from users who are currently in countries where no carriers
11745          * support eUICC.
11746          *
11747          * @hide
11748          */
11749         @SystemApi
11750         @Readable
11751         public static final String EUICC_UNSUPPORTED_COUNTRIES = "euicc_unsupported_countries";
11752 
11753         /**
11754          * Whether any activity can be resized. When this is true, any
11755          * activity, regardless of manifest values, can be resized for multi-window.
11756          * (0 = false, 1 = true)
11757          * @hide
11758          */
11759         @Readable
11760         public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES
11761                 = "force_resizable_activities";
11762 
11763         /**
11764          * Whether to enable experimental freeform support for windows.
11765          * @hide
11766          */
11767         @Readable
11768         public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT
11769                 = "enable_freeform_support";
11770 
11771         /**
11772          * Whether to enable experimental desktop mode on secondary displays.
11773          * @hide
11774          */
11775         @Readable
11776         public static final String DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS =
11777                 "force_desktop_mode_on_external_displays";
11778 
11779         /**
11780          * Whether to allow non-resizable apps to be shown in multi-window. The app will be
11781          * letterboxed if the request orientation is not met, and will be shown in size-compat
11782          * mode if the container size has changed.
11783          * @hide
11784          */
11785         @TestApi
11786         @Readable
11787         @SuppressLint("NoSettingsProvider")
11788         public static final String DEVELOPMENT_ENABLE_NON_RESIZABLE_MULTI_WINDOW =
11789                 "enable_non_resizable_multi_window";
11790 
11791         /**
11792          * If true, shadows drawn around the window will be rendered by the system compositor. If
11793          * false, shadows will be drawn by the client by setting an elevation on the root view and
11794          * the contents will be inset by the surface insets.
11795          * (0 = false, 1 = true)
11796          * @hide
11797          */
11798         @Readable
11799         public static final String DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR =
11800                 "render_shadows_in_compositor";
11801 
11802         /**
11803          * If true, submit buffers using blast in ViewRootImpl.
11804          * (0 = false, 1 = true)
11805          * @hide
11806          */
11807         @Readable
11808         public static final String DEVELOPMENT_USE_BLAST_ADAPTER_VR =
11809                 "use_blast_adapter_vr";
11810 
11811         /**
11812          * Path to the WindowManager display settings file. If unset, the default file path will
11813          * be used.
11814          *
11815          * @hide
11816          */
11817         public static final String DEVELOPMENT_WM_DISPLAY_SETTINGS_PATH =
11818                 "wm_display_settings_path";
11819 
11820         /**
11821         * Whether user has enabled development settings.
11822         */
11823         @Readable
11824         public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
11825 
11826         /**
11827         * Whether the device has been provisioned (0 = false, 1 = true).
11828         * <p>On a multiuser device with a separate system user, the screen may be locked
11829         * as soon as this is set to true and further activities cannot be launched on the
11830         * system user unless they are marked to show over keyguard.
11831         */
11832         @Readable
11833         public static final String DEVICE_PROVISIONED = "device_provisioned";
11834 
11835         /**
11836          * Whether bypassing the device policy management role holder qualifcation is allowed,
11837          * (0 = false, 1 = true).
11838          *
11839          * @hide
11840          */
11841         public static final String BYPASS_DEVICE_POLICY_MANAGEMENT_ROLE_QUALIFICATIONS =
11842                 "bypass_device_policy_management_role_qualifications";
11843 
11844         /**
11845          * Indicates whether mobile data should be allowed while the device is being provisioned.
11846          * This allows the provisioning process to turn off mobile data before the user
11847          * has an opportunity to set things up, preventing other processes from burning
11848          * precious bytes before wifi is setup.
11849          * <p>
11850          * Type: int (0 for false, 1 for true)
11851          *
11852          * @hide
11853          */
11854         @SystemApi
11855         @Readable
11856         public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED =
11857                 "device_provisioning_mobile_data";
11858 
11859         /**
11860         * The saved value for WindowManagerService.setForcedDisplaySize().
11861         * Two integers separated by a comma.  If unset, then use the real display size.
11862         * @hide
11863         */
11864         @Readable
11865         public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
11866 
11867         /**
11868         * The saved value for WindowManagerService.setForcedDisplayScalingMode().
11869         * 0 or unset if scaling is automatic, 1 if scaling is disabled.
11870         * @hide
11871         */
11872         @Readable
11873         public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
11874 
11875         /**
11876         * The maximum size, in bytes, of a download that the download manager will transfer over
11877         * a non-wifi connection.
11878         * @hide
11879         */
11880         @Readable
11881         public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
11882                "download_manager_max_bytes_over_mobile";
11883 
11884         /**
11885         * The recommended maximum size, in bytes, of a download that the download manager should
11886         * transfer over a non-wifi connection. Over this size, the use will be warned, but will
11887         * have the option to start the download over the mobile connection anyway.
11888         * @hide
11889         */
11890         @Readable
11891         public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
11892                "download_manager_recommended_max_bytes_over_mobile";
11893 
11894         /**
11895         * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
11896         */
11897         @Deprecated
11898         public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
11899 
11900         /**
11901          * Whether or not media is shown automatically when bypassing as a heads up.
11902          * @hide
11903          */
11904         @Readable
11905         public static final String SHOW_MEDIA_ON_QUICK_SETTINGS =
11906                 "qs_media_controls";
11907 
11908         /**
11909          * The interval in milliseconds at which location requests will be throttled when they are
11910          * coming from the background.
11911          *
11912          * @hide
11913          */
11914         @Readable
11915         public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS =
11916                 "location_background_throttle_interval_ms";
11917 
11918         /**
11919          * Most frequent location update interval in milliseconds that proximity alert is allowed
11920          * to request.
11921          * @hide
11922          */
11923         @Readable
11924         public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS =
11925                 "location_background_throttle_proximity_alert_interval_ms";
11926 
11927         /**
11928          * Packages that are whitelisted for background throttling (throttling will not be applied).
11929          * @hide
11930          */
11931         @Readable
11932         public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST =
11933             "location_background_throttle_package_whitelist";
11934 
11935         /**
11936          * Packages that are whitelisted for ignoring location settings (may retrieve location even
11937          * when user location settings are off), for emergency purposes.
11938          * @deprecated No longer used from Android 12+
11939          * @hide
11940          */
11941         @TestApi
11942         @Readable
11943         @Deprecated
11944         public static final String LOCATION_IGNORE_SETTINGS_PACKAGE_WHITELIST =
11945                 "location_ignore_settings_package_whitelist";
11946 
11947         /**
11948          * Whether to throttle location when the device is in doze and still.
11949          * @hide
11950          */
11951         public static final String LOCATION_ENABLE_STATIONARY_THROTTLE =
11952                 "location_enable_stationary_throttle";
11953 
11954         /**
11955         * Whether TV will switch to MHL port when a mobile device is plugged in.
11956         * (0 = false, 1 = true)
11957         * @hide
11958         */
11959         @Readable
11960         public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
11961 
11962         /**
11963         * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
11964         * @hide
11965         */
11966         @Readable
11967         public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
11968 
11969         /**
11970         * Whether mobile data connections are allowed by the user.  See
11971         * ConnectivityManager for more info.
11972         * @hide
11973         */
11974         @UnsupportedAppUsage
11975         @Readable
11976         public static final String MOBILE_DATA = "mobile_data";
11977 
11978         /**
11979         * Whether the mobile data connection should remain active even when higher
11980         * priority networks like WiFi are active, to help make network switching faster.
11981         *
11982         * See ConnectivityService for more info.
11983         *
11984         * (0 = disabled, 1 = enabled)
11985         * @hide
11986         */
11987         @Readable
11988         public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
11989 
11990         /**
11991          * Whether the wifi data connection should remain active even when higher
11992          * priority networks like Ethernet are active, to keep both networks.
11993          * In the case where higher priority networks are connected, wifi will be
11994          * unused unless an application explicitly requests to use it.
11995          *
11996          * See ConnectivityService for more info.
11997          *
11998          * (0 = disabled, 1 = enabled)
11999          * @hide
12000          */
12001         @Readable
12002         public static final String WIFI_ALWAYS_REQUESTED = "wifi_always_requested";
12003 
12004         /**
12005          * Size of the event buffer for IP connectivity metrics.
12006          * @hide
12007          */
12008         @Readable
12009         public static final String CONNECTIVITY_METRICS_BUFFER_SIZE =
12010               "connectivity_metrics_buffer_size";
12011 
12012         /** {@hide} */
12013         @Readable
12014         public static final String NETSTATS_ENABLED = "netstats_enabled";
12015         /** {@hide} */
12016         @Readable
12017         public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
12018         /**
12019          * @deprecated
12020          * {@hide}
12021          */
12022         @Deprecated
12023         @Readable
12024         public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
12025         /** {@hide} */
12026         @Readable
12027         public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
12028         /** {@hide} */
12029         @Readable
12030         public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
12031         /** {@hide} */
12032         @Readable
12033         public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled";
12034         /** {@hide} */
12035         @Readable
12036         public static final String NETSTATS_COMBINE_SUBTYPE_ENABLED =
12037                 "netstats_combine_subtype_enabled";
12038 
12039         /** {@hide} */
12040         @Readable
12041         public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
12042         /** {@hide} */
12043         @Readable
12044         public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
12045         /** {@hide} */
12046         @Readable
12047         public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
12048         /** {@hide} */
12049         @Readable
12050         public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
12051 
12052         /** {@hide} */
12053         @Readable
12054         public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
12055         /** {@hide} */
12056         @Readable
12057         public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
12058         /** {@hide} */
12059         @Readable
12060         public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
12061         /** {@hide} */
12062         @Readable
12063         public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
12064 
12065         /** {@hide} */
12066         @Readable
12067         public static final String NETSTATS_UID_TAG_BUCKET_DURATION =
12068                 "netstats_uid_tag_bucket_duration";
12069         /** {@hide} */
12070         @Readable
12071         public static final String NETSTATS_UID_TAG_PERSIST_BYTES =
12072                 "netstats_uid_tag_persist_bytes";
12073         /** {@hide} */
12074         @Readable
12075         public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
12076         /** {@hide} */
12077         @Readable
12078         public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
12079 
12080         /** {@hide} */
12081         @Readable
12082         public static final String NETPOLICY_QUOTA_ENABLED = "netpolicy_quota_enabled";
12083         /** {@hide} */
12084         @Readable
12085         public static final String NETPOLICY_QUOTA_UNLIMITED = "netpolicy_quota_unlimited";
12086         /** {@hide} */
12087         @Readable
12088         public static final String NETPOLICY_QUOTA_LIMITED = "netpolicy_quota_limited";
12089         /** {@hide} */
12090         @Readable
12091         public static final String NETPOLICY_QUOTA_FRAC_JOBS = "netpolicy_quota_frac_jobs";
12092         /** {@hide} */
12093         @Readable
12094         public static final String NETPOLICY_QUOTA_FRAC_MULTIPATH =
12095                 "netpolicy_quota_frac_multipath";
12096 
12097         /** {@hide} */
12098         @Readable
12099         public static final String NETPOLICY_OVERRIDE_ENABLED = "netpolicy_override_enabled";
12100 
12101         /**
12102         * User preference for which network(s) should be used. Only the
12103         * connectivity service should touch this.
12104         */
12105         @Readable
12106         public static final String NETWORK_PREFERENCE = "network_preference";
12107 
12108         /**
12109         * Which package name to use for network scoring. If null, or if the package is not a valid
12110         * scorer app, external network scores will neither be requested nor accepted.
12111         * @hide
12112         */
12113         @Readable
12114         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
12115         public static final String NETWORK_SCORER_APP = "network_scorer_app";
12116 
12117         /**
12118          * Whether night display forced auto mode is available.
12119          * 0 = unavailable, 1 = available.
12120          * @hide
12121          */
12122         @Readable
12123         public static final String NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE =
12124                 "night_display_forced_auto_mode_available";
12125 
12126         /**
12127          * If Unix epoch time between two NITZ signals is greater than this value then the second
12128          * signal cannot be ignored.
12129          *
12130          * <p>This value is in milliseconds. It is used for telephony-based time and time zone
12131          * detection.
12132          * @hide
12133          */
12134         @Readable
12135         public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
12136 
12137         /**
12138          * If the elapsed realtime between two NITZ signals is greater than this value then the
12139          * second signal cannot be ignored.
12140          *
12141          * <p>This value is in milliseconds. It is used for telephony-based time and time zone
12142          * detection.
12143          * @hide
12144          */
12145         @Readable
12146         public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
12147 
12148         /**
12149          * If the device connects to a telephony network and was disconnected from a telephony
12150          * network for less than this time, a previously received NITZ signal can be restored.
12151          *
12152          * <p>This value is in milliseconds. It is used for telephony-based time and time zone
12153          * detection.
12154          * @hide
12155          */
12156         public static final String NITZ_NETWORK_DISCONNECT_RETENTION =
12157                 "nitz_network_disconnect_retention";
12158 
12159         /** Preferred NTP server. {@hide} */
12160         @Readable
12161         public static final String NTP_SERVER = "ntp_server";
12162         /** Timeout in milliseconds to wait for NTP server. {@hide} */
12163         @Readable
12164         public static final String NTP_TIMEOUT = "ntp_timeout";
12165 
12166         /** {@hide} */
12167         @Readable
12168         public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval";
12169 
12170         /**
12171          * Whether or not Settings should enable psd API.
12172          * {@hide}
12173          */
12174         @Readable
12175         public static final String SETTINGS_USE_PSD_API = "settings_use_psd_api";
12176 
12177         /**
12178          * Whether or not Settings should enable external provider API.
12179          * {@hide}
12180          */
12181         @Readable
12182         public static final String SETTINGS_USE_EXTERNAL_PROVIDER_API =
12183                 "settings_use_external_provider_api";
12184 
12185         /**
12186         * Sample validity in seconds to configure for the system DNS resolver.
12187         * {@hide}
12188         */
12189         @Readable
12190         public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS =
12191                "dns_resolver_sample_validity_seconds";
12192 
12193         /**
12194         * Success threshold in percent for use with the system DNS resolver.
12195         * {@hide}
12196         */
12197         @Readable
12198         public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT =
12199                 "dns_resolver_success_threshold_percent";
12200 
12201         /**
12202         * Minimum number of samples needed for statistics to be considered meaningful in the
12203         * system DNS resolver.
12204         * {@hide}
12205         */
12206         @Readable
12207         public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples";
12208 
12209         /**
12210         * Maximum number taken into account for statistics purposes in the system DNS resolver.
12211         * {@hide}
12212         */
12213         @Readable
12214         public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples";
12215 
12216         /**
12217         * Whether to disable the automatic scheduling of system updates.
12218         * 1 = system updates won't be automatically scheduled (will always
12219         * present notification instead).
12220         * 0 = system updates will be automatically scheduled. (default)
12221         * @hide
12222         */
12223         @SystemApi
12224         @Readable
12225         public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
12226 
12227         /** Timeout for package verification.
12228         * @hide */
12229         @Readable
12230         public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
12231 
12232         /** Timeout for package verification during streaming installations.
12233          * @hide */
12234         @Readable
12235         public static final String PACKAGE_STREAMING_VERIFIER_TIMEOUT =
12236                 "streaming_verifier_timeout";
12237 
12238         /** Timeout for app integrity verification.
12239          * @hide */
12240         @Readable
12241         public static final String APP_INTEGRITY_VERIFICATION_TIMEOUT =
12242                 "app_integrity_verification_timeout";
12243 
12244         /** Default response code for package verification.
12245         * @hide */
12246         @Readable
12247         public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
12248 
12249         /**
12250         * Show package verification setting in the Settings app.
12251         * 1 = show (default)
12252         * 0 = hide
12253         * @hide
12254         */
12255         @Readable
12256         public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
12257 
12258         /**
12259         * Run package verification on apps installed through ADB/ADT/USB
12260         * 1 = perform package verification on ADB installs (default)
12261         * 0 = bypass package verification on ADB installs
12262         * @hide
12263         */
12264         @Readable
12265         public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
12266 
12267         /**
12268          * Run integrity checks for integrity rule providers.
12269          * 0 = bypass integrity verification on installs from rule providers (default)
12270          * 1 = perform integrity verification on installs from rule providers
12271          * @hide
12272          */
12273         @Readable
12274         public static final String INTEGRITY_CHECK_INCLUDES_RULE_PROVIDER =
12275                 "verify_integrity_for_rule_provider";
12276 
12277         /**
12278         * Time since last fstrim (milliseconds) after which we force one to happen
12279         * during device startup.  If unset, the default is 3 days.
12280         * @hide
12281         */
12282         @Readable
12283         public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
12284 
12285         /**
12286         * The interval in milliseconds at which to check packet counts on the
12287         * mobile data interface when screen is on, to detect possible data
12288         * connection problems.
12289         * @hide
12290         */
12291         @Readable
12292         public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
12293                "pdp_watchdog_poll_interval_ms";
12294 
12295         /**
12296         * The interval in milliseconds at which to check packet counts on the
12297         * mobile data interface when screen is off, to detect possible data
12298         * connection problems.
12299         * @hide
12300         */
12301         @Readable
12302         public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
12303                "pdp_watchdog_long_poll_interval_ms";
12304 
12305         /**
12306         * The interval in milliseconds at which to check packet counts on the
12307         * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
12308         * outgoing packets has been reached without incoming packets.
12309         * @hide
12310         */
12311         @Readable
12312         public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
12313                "pdp_watchdog_error_poll_interval_ms";
12314 
12315         /**
12316         * The number of outgoing packets sent without seeing an incoming packet
12317         * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
12318         * device is logged to the event log
12319         * @hide
12320         */
12321         @Readable
12322         public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
12323                "pdp_watchdog_trigger_packet_count";
12324 
12325         /**
12326         * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
12327         * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
12328         * attempting data connection recovery.
12329         * @hide
12330         */
12331         @Readable
12332         public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
12333                "pdp_watchdog_error_poll_count";
12334 
12335         /**
12336         * The number of failed PDP reset attempts before moving to something more
12337         * drastic: re-registering to the network.
12338         * @hide
12339         */
12340         @Readable
12341         public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
12342                "pdp_watchdog_max_pdp_reset_fail_count";
12343 
12344         /**
12345         * URL to open browser on to allow user to manage a prepay account
12346         * @hide
12347         */
12348         @Readable
12349         public static final String SETUP_PREPAID_DATA_SERVICE_URL =
12350                "setup_prepaid_data_service_url";
12351 
12352         /**
12353         * URL to attempt a GET on to see if this is a prepay device
12354         * @hide
12355         */
12356         @Readable
12357         public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
12358                "setup_prepaid_detection_target_url";
12359 
12360         /**
12361         * Host to check for a redirect to after an attempt to GET
12362         * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
12363         * this is a prepaid device with zero balance.)
12364         * @hide
12365         */
12366         @Readable
12367         public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
12368                "setup_prepaid_detection_redir_host";
12369 
12370         /**
12371         * The interval in milliseconds at which to check the number of SMS sent out without asking
12372         * for use permit, to limit the un-authorized SMS usage.
12373         *
12374         * @hide
12375         */
12376         @Readable
12377         public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
12378                "sms_outgoing_check_interval_ms";
12379 
12380         /**
12381         * The number of outgoing SMS sent without asking for user permit (of {@link
12382         * #SMS_OUTGOING_CHECK_INTERVAL_MS}
12383         *
12384         * @hide
12385         */
12386         @Readable
12387         public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
12388                "sms_outgoing_check_max_count";
12389 
12390         /**
12391         * Used to disable SMS short code confirmation - defaults to true.
12392         * True indcates we will do the check, etc.  Set to false to disable.
12393         * @see com.android.internal.telephony.SmsUsageMonitor
12394         * @hide
12395         */
12396         @Readable
12397         public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
12398 
12399         /**
12400          * Used to select which country we use to determine premium sms codes.
12401          * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
12402          * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
12403          * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
12404          * @hide
12405          */
12406         @Readable
12407         public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
12408 
12409         /**
12410          * Used to select TCP's default initial receiver window size in segments - defaults to a
12411          * build config value.
12412          * @hide
12413          */
12414         @Readable
12415         public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
12416 
12417         /**
12418          * Used to disable Tethering on a device - defaults to true.
12419          * @hide
12420          */
12421         @SystemApi
12422         @Readable
12423         public static final String TETHER_SUPPORTED = "tether_supported";
12424 
12425         /**
12426          * Used to require DUN APN on the device or not - defaults to a build config value
12427          * which defaults to false.
12428          * @hide
12429          */
12430         @Readable
12431         public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
12432 
12433         /**
12434          * Used to hold a gservices-provisioned apn value for DUN.  If set, or the
12435          * corresponding build config values are set it will override the APN DB
12436          * values.
12437          * Consists of a comma separated list of strings:
12438          * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
12439          * note that empty fields can be omitted: "name,apn,,,,,,,,,310,260,,DUN"
12440          * @hide
12441          */
12442         @Readable
12443         public static final String TETHER_DUN_APN = "tether_dun_apn";
12444 
12445         /**
12446          * Used to disable trying to talk to any available tethering offload HAL.
12447          *
12448          * Integer values are interpreted as boolean, and the absence of an explicit setting
12449          * is interpreted as |false|.
12450          * @hide
12451          */
12452         @SystemApi
12453         @Readable
12454         public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled";
12455 
12456         /**
12457          * Use the old dnsmasq DHCP server for tethering instead of the framework implementation.
12458          *
12459          * Integer values are interpreted as boolean, and the absence of an explicit setting
12460          * is interpreted as |false|.
12461          * @hide
12462          */
12463         @Readable
12464         public static final String TETHER_ENABLE_LEGACY_DHCP_SERVER =
12465                 "tether_enable_legacy_dhcp_server";
12466 
12467         /**
12468          * List of certificate (hex string representation of the application's certificate - SHA-1
12469          * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for
12470          * install when a sim card with matching UICC carrier privilege rules is inserted.  The
12471          * certificate is used as a key, so the certificate encoding here must be the same as the
12472          * certificate encoding used on the SIM.
12473          *
12474          * The value is "cert1:package1;cert2:package2;..."
12475          * @hide
12476          */
12477         @SystemApi
12478         @Readable
12479         public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
12480 
12481         /**
12482          * Map of package name to application names. The application names cannot and will not be
12483          * localized. App names may not contain colons or semicolons.
12484          *
12485          * The value is "packageName1:appName1;packageName2:appName2;..."
12486          * @hide
12487          */
12488         @SystemApi
12489         @Readable
12490         public static final String CARRIER_APP_NAMES = "carrier_app_names";
12491 
12492         /**
12493         * USB Mass Storage Enabled
12494         */
12495         @Readable
12496         public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
12497 
12498         /**
12499         * If this setting is set (to anything), then all references
12500         * to Gmail on the device must change to Google Mail.
12501         */
12502         @Readable
12503         public static final String USE_GOOGLE_MAIL = "use_google_mail";
12504 
12505         /**
12506          * Whether or not switching/creating users is enabled by user.
12507          * @hide
12508          */
12509         @Readable
12510         public static final String USER_SWITCHER_ENABLED = "user_switcher_enabled";
12511 
12512         /**
12513          * Webview Data reduction proxy key.
12514          * @hide
12515          */
12516         @Readable
12517         public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
12518                 "webview_data_reduction_proxy_key";
12519 
12520         /**
12521         * Name of the package used as WebView provider (if unset the provider is instead determined
12522         * by the system).
12523         * @hide
12524         */
12525         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
12526         @Readable
12527         public static final String WEBVIEW_PROVIDER = "webview_provider";
12528 
12529         /**
12530         * Developer setting to enable WebView multiprocess rendering.
12531         * @hide
12532         */
12533         @SystemApi
12534         @Readable
12535         public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
12536 
12537         /**
12538         * The maximum number of notifications shown in 24 hours when switching networks.
12539         * @hide
12540         */
12541         @Readable
12542         public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT =
12543               "network_switch_notification_daily_limit";
12544 
12545         /**
12546         * The minimum time in milliseconds between notifications when switching networks.
12547         * @hide
12548         */
12549         @Readable
12550         public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS =
12551               "network_switch_notification_rate_limit_millis";
12552 
12553         /**
12554         * Whether to automatically switch away from wifi networks that lose Internet access.
12555         * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always
12556         * avoids such networks. Valid values are:
12557         *
12558         * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013.
12559         * null: Ask the user whether to switch away from bad wifi.
12560         * 1: Avoid bad wifi.
12561         *
12562         * @hide
12563         */
12564         @Readable
12565         public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi";
12566 
12567         /**
12568         * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be
12569         * overridden by the system based on device or application state. If null, the value
12570         * specified by config_networkMeteredMultipathPreference is used.
12571         *
12572         * @hide
12573         */
12574         @Readable
12575         public static final String NETWORK_METERED_MULTIPATH_PREFERENCE =
12576                "network_metered_multipath_preference";
12577 
12578         /**
12579          * Default daily multipath budget used by ConnectivityManager.getMultipathPreference()
12580          * on metered networks. This default quota is only used if quota could not be determined
12581          * from data plan or data limit/warning set by the user.
12582          * @hide
12583          */
12584         @Readable
12585         public static final String NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES =
12586                 "network_default_daily_multipath_quota_bytes";
12587 
12588         /**
12589          * Network watchlist last report time.
12590          * @hide
12591          */
12592         @Readable
12593         public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME =
12594                 "network_watchlist_last_report_time";
12595 
12596         /**
12597         * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of
12598         * colon-delimited key-value pairs. The key is the badging enum value defined in
12599         * android.net.ScoredNetwork and the value is the minimum sustained network throughput in
12600         * kbps required for the badge. For example: "10:3000,20:5000,30:25000"
12601         *
12602         * @hide
12603         */
12604         @SystemApi
12605         @Readable
12606         public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds";
12607 
12608         /**
12609         * Whether Wifi display is enabled/disabled
12610         * 0=disabled. 1=enabled.
12611         * @hide
12612         */
12613         @Readable
12614         public static final String WIFI_DISPLAY_ON = "wifi_display_on";
12615 
12616         /**
12617         * Whether Wifi display certification mode is enabled/disabled
12618         * 0=disabled. 1=enabled.
12619         * @hide
12620         */
12621         @Readable
12622         public static final String WIFI_DISPLAY_CERTIFICATION_ON =
12623                "wifi_display_certification_on";
12624 
12625         /**
12626         * WPS Configuration method used by Wifi display, this setting only
12627         * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
12628         *
12629         * Possible values are:
12630         *
12631         * WpsInfo.INVALID: use default WPS method chosen by framework
12632         * WpsInfo.PBC    : use Push button
12633         * WpsInfo.KEYPAD : use Keypad
12634         * WpsInfo.DISPLAY: use Display
12635         * @hide
12636         */
12637         @Readable
12638         public static final String WIFI_DISPLAY_WPS_CONFIG =
12639            "wifi_display_wps_config";
12640 
12641         /**
12642         * Whether to notify the user of open networks.
12643         * <p>
12644         * If not connected and the scan results have an open network, we will
12645         * put this notification up. If we attempt to connect to a network or
12646         * the open network(s) disappear, we remove the notification. When we
12647         * show the notification, we will not show it again for
12648         * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
12649         *
12650         * @deprecated This feature is no longer controlled by this setting in
12651         * {@link android.os.Build.VERSION_CODES#O}.
12652         */
12653         @Deprecated
12654         @Readable
12655         public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
12656                "wifi_networks_available_notification_on";
12657 
12658         /**
12659         * {@hide}
12660         */
12661         @Readable
12662         public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
12663                "wimax_networks_available_notification_on";
12664 
12665         /**
12666         * Delay (in seconds) before repeating the Wi-Fi networks available notification.
12667         * Connecting to a network will reset the timer.
12668         * @deprecated This is no longer used or set by the platform.
12669         */
12670         @Deprecated
12671         @Readable
12672         public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
12673                "wifi_networks_available_repeat_delay";
12674 
12675         /**
12676         * 802.11 country code in ISO 3166 format
12677         * @hide
12678         */
12679         @Readable
12680         public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
12681 
12682         /**
12683         * The interval in milliseconds to issue wake up scans when wifi needs
12684         * to connect. This is necessary to connect to an access point when
12685         * device is on the move and the screen is off.
12686         * @hide
12687         */
12688         @Readable
12689         public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
12690                "wifi_framework_scan_interval_ms";
12691 
12692         /**
12693         * The interval in milliseconds after which Wi-Fi is considered idle.
12694         * When idle, it is possible for the device to be switched from Wi-Fi to
12695         * the mobile data network.
12696         * @hide
12697         */
12698         @Readable
12699         public static final String WIFI_IDLE_MS = "wifi_idle_ms";
12700 
12701         /**
12702         * When the number of open networks exceeds this number, the
12703         * least-recently-used excess networks will be removed.
12704         * @deprecated This is no longer used or set by the platform.
12705         */
12706         @Deprecated
12707         @Readable
12708         public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
12709 
12710         /**
12711         * Whether the Wi-Fi should be on.  Only the Wi-Fi service should touch this.
12712         */
12713         @Readable
12714         public static final String WIFI_ON = "wifi_on";
12715 
12716         /**
12717         * Setting to allow scans to be enabled even wifi is turned off for connectivity.
12718         * @hide
12719         * @deprecated To be removed. Use {@link WifiManager#setScanAlwaysAvailable(boolean)} for
12720         * setting the value and {@link WifiManager#isScanAlwaysAvailable()} for query.
12721         */
12722         @Deprecated
12723         @Readable
12724         public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
12725                 "wifi_scan_always_enabled";
12726 
12727         /**
12728          * Indicate whether factory reset request is pending.
12729          *
12730          * Type: int (0 for false, 1 for true)
12731          * @hide
12732          * @deprecated To be removed.
12733          */
12734         @Deprecated
12735         @Readable
12736         public static final String WIFI_P2P_PENDING_FACTORY_RESET =
12737                 "wifi_p2p_pending_factory_reset";
12738 
12739         /**
12740          * Whether soft AP will shut down after a timeout period when no devices are connected.
12741          *
12742          * Type: int (0 for false, 1 for true)
12743          * @hide
12744          * @deprecated To be removed. Use {@link SoftApConfiguration.Builder#
12745          * setAutoShutdownEnabled(boolean)} for setting the value and {@link SoftApConfiguration#
12746          * isAutoShutdownEnabled()} for query.
12747          */
12748         @Deprecated
12749         @Readable
12750         public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled";
12751 
12752         /**
12753          * Value to specify if Wi-Fi Wakeup feature is enabled.
12754          *
12755          * Type: int (0 for false, 1 for true)
12756          * @hide
12757          * @deprecated Use {@link WifiManager#setAutoWakeupEnabled(boolean)} for setting the value
12758          * and {@link WifiManager#isAutoWakeupEnabled()} for query.
12759          */
12760         @Deprecated
12761         @SystemApi
12762         @Readable
12763         public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
12764 
12765         /**
12766          * Value to specify if wifi settings migration is complete or not.
12767          * Note: This should only be used from within {@link android.net.wifi.WifiMigration} class.
12768          *
12769          * Type: int (0 for false, 1 for true)
12770          * @hide
12771          */
12772         @Readable
12773         public static final String WIFI_MIGRATION_COMPLETED = "wifi_migration_completed";
12774 
12775         /**
12776          * Whether UWB should be enabled.
12777          * @hide
12778          */
12779         public static final String UWB_ENABLED = "uwb_enabled";
12780 
12781         /**
12782          * Value to specify whether network quality scores and badging should be shown in the UI.
12783          *
12784          * Type: int (0 for false, 1 for true)
12785          * @deprecated {@link NetworkScoreManager} is deprecated.
12786          * @hide
12787          */
12788         @Deprecated
12789         @Readable
12790         public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled";
12791 
12792         /**
12793          * Value to specify how long in milliseconds to retain seen score cache curves to be used
12794          * when generating SSID only bases score curves.
12795          *
12796          * Type: long
12797          * @deprecated {@link NetworkScoreManager} is deprecated.
12798          * @hide
12799          */
12800         @Deprecated
12801         @Readable
12802         public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS =
12803                 "speed_label_cache_eviction_age_millis";
12804 
12805         /**
12806          * Value to specify if network recommendations from
12807          * {@link com.android.server.NetworkScoreService} are enabled.
12808          *
12809          * Type: int
12810          * Valid values:
12811          *   -1 = Forced off
12812          *    0 = Disabled
12813          *    1 = Enabled
12814          *
12815          * Most readers of this setting should simply check if value == 1 to determine the
12816          * enabled state.
12817          * @hide
12818          * @deprecated To be removed.
12819          */
12820         @Deprecated
12821         @Readable
12822         public static final String NETWORK_RECOMMENDATIONS_ENABLED =
12823                 "network_recommendations_enabled";
12824 
12825         /**
12826          * Which package name to use for network recommendations. If null, network recommendations
12827          * will neither be requested nor accepted.
12828          *
12829          * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and
12830          * {@link NetworkScoreManager#setActiveScorer(String)} to write it.
12831          *
12832          * Type: string - package name
12833          * @deprecated {@link NetworkScoreManager} is deprecated.
12834          * @hide
12835          */
12836         @Deprecated
12837         @Readable
12838         public static final String NETWORK_RECOMMENDATIONS_PACKAGE =
12839                 "network_recommendations_package";
12840 
12841         /**
12842          * The package name of the application that connect and secures high quality open wifi
12843          * networks automatically.
12844          *
12845          * Type: string package name or null if the feature is either not provided or disabled.
12846          * @deprecated {@link NetworkScoreManager} is deprecated.
12847          * @hide
12848          */
12849         @Deprecated
12850         @TestApi
12851         @Readable
12852         public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package";
12853 
12854         /**
12855          * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in
12856          * {@link com.android.server.wifi.RecommendedNetworkEvaluator}.
12857          *
12858          * Type: long
12859          * @deprecated {@link NetworkScoreManager} is deprecated.
12860          * @hide
12861          */
12862         @Deprecated
12863         @Readable
12864         public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS =
12865                 "recommended_network_evaluator_cache_expiry_ms";
12866 
12867         /**
12868          * Whether wifi scan throttle is enabled or not.
12869          *
12870          * Type: int (0 for false, 1 for true)
12871          * @hide
12872          * @deprecated Use {@link WifiManager#setScanThrottleEnabled(boolean)} for setting the value
12873          * and {@link WifiManager#isScanThrottleEnabled()} for query.
12874          */
12875         @Deprecated
12876         @Readable
12877         public static final String WIFI_SCAN_THROTTLE_ENABLED = "wifi_scan_throttle_enabled";
12878 
12879         /**
12880         * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
12881         * connectivity.
12882         * @hide
12883         */
12884         @Readable
12885         @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12886         @SuppressLint("NoSettingsProvider")
12887         public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled";
12888 
12889         /**
12890          * The length in milliseconds of a BLE scan window in a low-power scan mode.
12891          * @hide
12892          */
12893         @Readable
12894         @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12895         @SuppressLint("NoSettingsProvider")
12896         public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms";
12897 
12898         /**
12899          * The length in milliseconds of a BLE scan window in a balanced scan mode.
12900          * @hide
12901          */
12902         @Readable
12903         @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12904         @SuppressLint("NoSettingsProvider")
12905         public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms";
12906 
12907         /**
12908          * The length in milliseconds of a BLE scan window in a low-latency scan mode.
12909          * @hide
12910          */
12911         @Readable
12912         @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12913         @SuppressLint("NoSettingsProvider")
12914         public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS =
12915                 "ble_scan_low_latency_window_ms";
12916 
12917         /**
12918          * The length in milliseconds of a BLE scan interval in a low-power scan mode.
12919          * @hide
12920          */
12921         @Readable
12922         @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12923         @SuppressLint("NoSettingsProvider")
12924         public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS =
12925                 "ble_scan_low_power_interval_ms";
12926 
12927         /**
12928          * The length in milliseconds of a BLE scan interval in a balanced scan mode.
12929          * @hide
12930          */
12931         @Readable
12932         @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12933         @SuppressLint("NoSettingsProvider")
12934         public static final String BLE_SCAN_BALANCED_INTERVAL_MS =
12935                 "ble_scan_balanced_interval_ms";
12936 
12937         /**
12938          * The length in milliseconds of a BLE scan interval in a low-latency scan mode.
12939          * @hide
12940          */
12941         @Readable
12942         @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12943         @SuppressLint("NoSettingsProvider")
12944         public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS =
12945                 "ble_scan_low_latency_interval_ms";
12946 
12947         /**
12948          * The mode that BLE scanning clients will be moved to when in the background.
12949          * @hide
12950          */
12951         @Readable
12952         @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
12953         @SuppressLint("NoSettingsProvider")
12954         public static final String BLE_SCAN_BACKGROUND_MODE = "ble_scan_background_mode";
12955 
12956         /**
12957         * The interval in milliseconds to scan as used by the wifi supplicant
12958         * @hide
12959         */
12960         @Readable
12961         public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
12962                "wifi_supplicant_scan_interval_ms";
12963 
12964         /**
12965          * whether frameworks handles wifi auto-join
12966          * @hide
12967          */
12968         @Readable
12969         public static final String WIFI_ENHANCED_AUTO_JOIN =
12970                 "wifi_enhanced_auto_join";
12971 
12972         /**
12973          * whether settings show RSSI
12974          * @hide
12975          */
12976         @Readable
12977         public static final String WIFI_NETWORK_SHOW_RSSI =
12978                 "wifi_network_show_rssi";
12979 
12980         /**
12981         * The interval in milliseconds to scan at supplicant when p2p is connected
12982         * @hide
12983         */
12984         @Readable
12985         public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
12986                "wifi_scan_interval_p2p_connected_ms";
12987 
12988         /**
12989         * Whether the Wi-Fi watchdog is enabled.
12990         */
12991         @Readable
12992         public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
12993 
12994         /**
12995         * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
12996         * the setting needs to be set to 0 to disable it.
12997         * @hide
12998         */
12999         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
13000         @Readable
13001         public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
13002                "wifi_watchdog_poor_network_test_enabled";
13003 
13004         /**
13005         * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1
13006         * will enable it. In the future, additional values may be supported.
13007         * @hide
13008         * @deprecated Use {@link WifiManager#setVerboseLoggingEnabled(boolean)} for setting the
13009         * value and {@link WifiManager#isVerboseLoggingEnabled()} for query.
13010         */
13011         @Deprecated
13012         @Readable
13013         public static final String WIFI_VERBOSE_LOGGING_ENABLED =
13014                "wifi_verbose_logging_enabled";
13015 
13016         /**
13017          * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and
13018          * setting to 1 will enable it. In the future, additional values may be supported.
13019          * @deprecated MAC randomization is now a per-network setting
13020          * @hide
13021          */
13022         @Deprecated
13023         @Readable
13024         public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED =
13025                 "wifi_connected_mac_randomization_enabled";
13026 
13027         /**
13028          * Parameters to adjust the performance of framework wifi scoring methods.
13029          * <p>
13030          * Encoded as a comma-separated key=value list, for example:
13031          *   "rssi5=-80:-77:-70:-57,rssi2=-83:-80:-73:-60,horizon=15"
13032          * This is intended for experimenting with new parameter values,
13033          * and is normally unset or empty. The example does not include all
13034          * parameters that may be honored.
13035          * Default values are provided by code or device configurations.
13036          * Errors in the parameters will cause the entire setting to be ignored.
13037          * @hide
13038          * @deprecated This is no longer used or set by the platform.
13039          */
13040         @Deprecated
13041         @Readable
13042         public static final String WIFI_SCORE_PARAMS =
13043                 "wifi_score_params";
13044 
13045         /**
13046         * The maximum number of times we will retry a connection to an access
13047         * point for which we have failed in acquiring an IP address from DHCP.
13048         * A value of N means that we will make N+1 connection attempts in all.
13049         */
13050         @Readable
13051         public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
13052 
13053         /**
13054         * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
13055         * data connectivity to be established after a disconnect from Wi-Fi.
13056         */
13057         @Readable
13058         public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
13059            "wifi_mobile_data_transition_wakelock_timeout_ms";
13060 
13061         /**
13062         * This setting controls whether WiFi configurations created by a Device Owner app
13063         * should be locked down (that is, be editable or removable only by the Device Owner App,
13064         * not even by Settings app).
13065         * This setting takes integer values. Non-zero values mean DO created configurations
13066         * are locked down. Value of zero means they are not. Default value in the absence of
13067         * actual value to this setting is 0.
13068         */
13069         @Readable
13070         public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN =
13071                "wifi_device_owner_configs_lockdown";
13072 
13073         /**
13074         * The operational wifi frequency band
13075         * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
13076         * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
13077         * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
13078         *
13079         * @hide
13080         */
13081         @Readable
13082         public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
13083 
13084         /**
13085         * The Wi-Fi peer-to-peer device name
13086         * @hide
13087         * @deprecated Use {@link WifiP2pManager#setDeviceName(WifiP2pManager.Channel, String,
13088         * WifiP2pManager.ActionListener)} for setting the value and
13089         * {@link android.net.wifi.p2p.WifiP2pDevice#deviceName} for query.
13090         */
13091         @Deprecated
13092         @Readable
13093         public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
13094 
13095         /**
13096         * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
13097         * from an ephemeral network if there is no BSSID for that network with a non-null score that
13098         * has been seen in this time period.
13099         *
13100         * If this is less than or equal to zero, we use a more conservative behavior and only check
13101         * for a non-null score from the currently connected or target BSSID.
13102         * @hide
13103         */
13104         @Readable
13105         public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
13106                "wifi_ephemeral_out_of_range_timeout_ms";
13107 
13108         /**
13109         * The number of milliseconds to delay when checking for data stalls during
13110         * non-aggressive detection. (screen is turned off.)
13111         * @hide
13112         */
13113         @Readable
13114         public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
13115                "data_stall_alarm_non_aggressive_delay_in_ms";
13116 
13117         /**
13118         * The number of milliseconds to delay when checking for data stalls during
13119         * aggressive detection. (screen on or suspected data stall)
13120         * @hide
13121         */
13122         @Readable
13123         public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
13124                "data_stall_alarm_aggressive_delay_in_ms";
13125 
13126         /**
13127         * The number of milliseconds to allow the provisioning apn to remain active
13128         * @hide
13129         */
13130         @Readable
13131         public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
13132                "provisioning_apn_alarm_delay_in_ms";
13133 
13134         /**
13135         * The interval in milliseconds at which to check gprs registration
13136         * after the first registration mismatch of gprs and voice service,
13137         * to detect possible data network registration problems.
13138         *
13139         * @hide
13140         */
13141         @Readable
13142         public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
13143                "gprs_register_check_period_ms";
13144 
13145         /**
13146         * Nonzero causes Log.wtf() to crash.
13147         * @hide
13148         */
13149         @Readable
13150         public static final String WTF_IS_FATAL = "wtf_is_fatal";
13151 
13152         /**
13153         * Ringer mode. This is used internally, changing this value will not
13154         * change the ringer mode. See AudioManager.
13155         */
13156         @Readable
13157         public static final String MODE_RINGER = "mode_ringer";
13158 
13159         /**
13160          * Overlay display devices setting.
13161          * The associated value is a specially formatted string that describes the
13162          * size and density of simulated secondary display devices.
13163          * <p>
13164          * Format:
13165          * <pre>
13166          * [display1];[display2];...
13167          * </pre>
13168          * with each display specified as:
13169          * <pre>
13170          * [mode1]|[mode2]|...,[flag1],[flag2],...
13171          * </pre>
13172          * with each mode specified as:
13173          * <pre>
13174          * [width]x[height]/[densityDpi]
13175          * </pre>
13176          * Supported flags:
13177          * <ul>
13178          * <li><pre>secure</pre>: creates a secure display</li>
13179          * <li><pre>own_content_only</pre>: only shows this display's own content</li>
13180          * <li><pre>should_show_system_decorations</pre>: supports system decorations</li>
13181          * </ul>
13182          * </p><p>
13183          * Example:
13184          * <ul>
13185          * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
13186          * <li><code>1920x1080/320,secure;1280x720/213</code>: make two overlays, the first at
13187          * 1080p and secure; the second at 720p.</li>
13188          * <li><code>1920x1080/320|3840x2160/640</code>: make one overlay that is 1920x1080 at
13189          * 213dpi by default, but can also be upscaled to 3840x2160 at 640dpi by the system if the
13190          * display device allows.</li>
13191          * <li>If the value is empty, then no overlay display devices are created.</li>
13192          * </ul></p>
13193          *
13194          * @hide
13195          */
13196         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
13197         @TestApi
13198         @Readable
13199         public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
13200 
13201         /**
13202          * Threshold values for the duration and level of a discharge cycle,
13203          * under which we log discharge cycle info.
13204          *
13205          * @hide
13206          */
13207         @Readable
13208         public static final String
13209                 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
13210 
13211         /** @hide */
13212         @Readable
13213         public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
13214 
13215         /**
13216          * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
13217          * intents on application crashes and ANRs. If this is disabled, the
13218          * crash/ANR dialog will never display the "Report" button.
13219          * <p>
13220          * Type: int (0 = disallow, 1 = allow)
13221          *
13222          * @hide
13223          */
13224         @Readable
13225         public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
13226 
13227         /**
13228          * Maximum age of entries kept by {@link DropBoxManager}.
13229          *
13230          * @hide
13231          */
13232         @Readable
13233         public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
13234 
13235         /**
13236          * Maximum number of entry files which {@link DropBoxManager} will keep
13237          * around.
13238          *
13239          * @hide
13240          */
13241         @Readable
13242         public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
13243 
13244         /**
13245          * Maximum amount of disk space used by {@link DropBoxManager} no matter
13246          * what.
13247          *
13248          * @hide
13249          */
13250         @Readable
13251         public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
13252 
13253         /**
13254          * Percent of free disk (excluding reserve) which {@link DropBoxManager}
13255          * will use.
13256          *
13257          * @hide
13258          */
13259         @Readable
13260         public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
13261 
13262         /**
13263          * Percent of total disk which {@link DropBoxManager} will never dip
13264          * into.
13265          *
13266          * @hide
13267          */
13268         @Readable
13269         public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
13270 
13271         /**
13272          * Prefix for per-tag dropbox disable/enable settings.
13273          *
13274          * @hide
13275          */
13276         @Readable
13277         public static final String DROPBOX_TAG_PREFIX = "dropbox:";
13278 
13279         /**
13280          * Lines of logcat to include with system crash/ANR/etc. reports, as a
13281          * prefix of the dropbox tag of the report type. For example,
13282          * "logcat_for_system_server_anr" controls the lines of logcat captured
13283          * with system server ANR reports. 0 to disable.
13284          *
13285          * @hide
13286          */
13287         @Readable
13288         public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
13289 
13290         /**
13291          * Maximum number of bytes of a system crash/ANR/etc. report that
13292          * ActivityManagerService should send to DropBox, as a prefix of the
13293          * dropbox tag of the report type. For example,
13294          * "max_error_bytes_for_system_server_anr" controls the maximum
13295          * number of bytes captured with system server ANR reports.
13296          * <p>
13297          * Type: int (max size in bytes)
13298          *
13299          * @hide
13300          */
13301         @Readable
13302         public static final String MAX_ERROR_BYTES_PREFIX = "max_error_bytes_for_";
13303 
13304         /**
13305          * The interval in minutes after which the amount of free storage left
13306          * on the device is logged to the event log
13307          *
13308          * @hide
13309          */
13310         @Readable
13311         public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
13312 
13313         /**
13314          * Threshold for the amount of change in disk free space required to
13315          * report the amount of free space. Used to prevent spamming the logs
13316          * when the disk free space isn't changing frequently.
13317          *
13318          * @hide
13319          */
13320         @Readable
13321         public static final String
13322                 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
13323 
13324         /**
13325          * Minimum percentage of free storage on the device that is used to
13326          * determine if the device is running low on storage. The default is 10.
13327          * <p>
13328          * Say this value is set to 10, the device is considered running low on
13329          * storage if 90% or more of the device storage is filled up.
13330          *
13331          * @hide
13332          */
13333         @Readable
13334         public static final String
13335                 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
13336 
13337         /**
13338          * Maximum byte size of the low storage threshold. This is to ensure
13339          * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
13340          * overly large threshold for large storage devices. Currently this must
13341          * be less than 2GB. This default is 500MB.
13342          *
13343          * @hide
13344          */
13345         @Readable
13346         public static final String
13347                 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
13348 
13349         /**
13350          * Minimum bytes of free storage on the device before the data partition
13351          * is considered full. By default, 1 MB is reserved to avoid system-wide
13352          * SQLite disk full exceptions.
13353          *
13354          * @hide
13355          */
13356         @Readable
13357         public static final String
13358                 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
13359 
13360         /**
13361          * Minimum percentage of storage on the device that is reserved for
13362          * cached data.
13363          *
13364          * @hide
13365          */
13366         @Readable
13367         public static final String
13368                 SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage";
13369 
13370         /**
13371          * The maximum reconnect delay for short network outages or when the
13372          * network is suspended due to phone use.
13373          *
13374          * @hide
13375          */
13376         @Readable
13377         public static final String
13378                 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
13379 
13380         /**
13381          * The number of milliseconds to delay before sending out
13382          * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
13383          *
13384          * @hide
13385          */
13386         @Readable
13387         public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
13388 
13389 
13390         /**
13391          * Network sampling interval, in seconds. We'll generate link information
13392          * about bytes/packets sent and error rates based on data sampled in this interval
13393          *
13394          * @hide
13395          */
13396         @Readable
13397         public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
13398                 "connectivity_sampling_interval_in_seconds";
13399 
13400         /**
13401          * The series of successively longer delays used in retrying to download PAC file.
13402          * Last delay is used between successful PAC downloads.
13403          *
13404          * @hide
13405          */
13406         @Readable
13407         public static final String PAC_CHANGE_DELAY = "pac_change_delay";
13408 
13409         /**
13410          * Don't attempt to detect captive portals.
13411          *
13412          * @hide
13413          */
13414         public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0;
13415 
13416         /**
13417          * When detecting a captive portal, display a notification that
13418          * prompts the user to sign in.
13419          *
13420          * @hide
13421          */
13422         public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1;
13423 
13424         /**
13425          * When detecting a captive portal, immediately disconnect from the
13426          * network and do not reconnect to that network in the future.
13427          *
13428          * @hide
13429          */
13430         public static final int CAPTIVE_PORTAL_MODE_AVOID = 2;
13431 
13432         /**
13433          * What to do when connecting a network that presents a captive portal.
13434          * Must be one of the CAPTIVE_PORTAL_MODE_* constants above.
13435          *
13436          * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT.
13437          * @hide
13438          */
13439         @Readable
13440         public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
13441 
13442         /**
13443          * Setting to turn off captive portal detection. Feature is enabled by
13444          * default and the setting needs to be set to 0 to disable it.
13445          *
13446          * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection
13447          * @hide
13448          */
13449         @Deprecated
13450         @Readable
13451         public static final String
13452                 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
13453 
13454         /**
13455          * The server used for captive portal detection upon a new conection. A
13456          * 204 response code from the server is used for validation.
13457          * TODO: remove this deprecated symbol.
13458          *
13459          * @hide
13460          */
13461         @Readable
13462         public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
13463 
13464         /**
13465          * The URL used for HTTPS captive portal detection upon a new connection.
13466          * A 204 response code from the server is used for validation.
13467          *
13468          * @hide
13469          */
13470         @Readable
13471         public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
13472 
13473         /**
13474          * The URL used for HTTP captive portal detection upon a new connection.
13475          * A 204 response code from the server is used for validation.
13476          *
13477          * @hide
13478          */
13479         @Readable
13480         public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
13481 
13482         /**
13483          * The URL used for fallback HTTP captive portal detection when previous HTTP
13484          * and HTTPS captive portal detection attemps did not return a conclusive answer.
13485          *
13486          * @hide
13487          */
13488         @Readable
13489         public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
13490 
13491         /**
13492          * A comma separated list of URLs used for captive portal detection in addition to the
13493          * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings.
13494          *
13495          * @hide
13496          */
13497         @Readable
13498         public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS =
13499                 "captive_portal_other_fallback_urls";
13500 
13501         /**
13502          * A list of captive portal detection specifications used in addition to the fallback URLs.
13503          * Each spec has the format url@@/@@statusCodeRegex@@/@@contentRegex. Specs are separated
13504          * by "@@,@@".
13505          * @hide
13506          */
13507         @Readable
13508         public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS =
13509                 "captive_portal_fallback_probe_specs";
13510 
13511         /**
13512          * Whether to use HTTPS for network validation. This is enabled by default and the setting
13513          * needs to be set to 0 to disable it. This setting is a misnomer because captive portals
13514          * don't actually use HTTPS, but it's consistent with the other settings.
13515          *
13516          * @hide
13517          */
13518         @Readable
13519         public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
13520 
13521         /**
13522          * Which User-Agent string to use in the header of the captive portal detection probes.
13523          * The User-Agent field is unset when this setting has no value (HttpUrlConnection default).
13524          *
13525          * @hide
13526          */
13527         @Readable
13528         public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
13529 
13530         /**
13531          * Whether to try cellular data recovery when a bad network is reported.
13532          *
13533          * @hide
13534          */
13535         @Readable
13536         public static final String DATA_STALL_RECOVERY_ON_BAD_NETWORK =
13537                 "data_stall_recovery_on_bad_network";
13538 
13539         /**
13540          * Minumim duration in millisecodns between cellular data recovery attempts
13541          *
13542          * @hide
13543          */
13544         @Readable
13545         public static final String MIN_DURATION_BETWEEN_RECOVERY_STEPS_IN_MS =
13546                 "min_duration_between_recovery_steps";
13547 
13548         /**
13549          * Let user pick default install location.
13550          *
13551          * @hide
13552          */
13553         @Readable
13554         public static final String SET_INSTALL_LOCATION = "set_install_location";
13555 
13556         /**
13557          * Default install location value.
13558          * 0 = auto, let system decide
13559          * 1 = internal
13560          * 2 = sdcard
13561          * @hide
13562          */
13563         @Readable
13564         public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
13565 
13566         /**
13567          * ms during which to consume extra events related to Inet connection
13568          * condition after a transtion to fully-connected
13569          *
13570          * @hide
13571          */
13572         @Readable
13573         public static final String
13574                 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
13575 
13576         /**
13577          * ms during which to consume extra events related to Inet connection
13578          * condtion after a transtion to partly-connected
13579          *
13580          * @hide
13581          */
13582         @Readable
13583         public static final String
13584                 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
13585 
13586         /** {@hide} */
13587         @Readable
13588         public static final String
13589                 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
13590 
13591         /**
13592          * Host name and port for global http proxy. Uses ':' seperator for
13593          * between host and port.
13594          */
13595         @Readable
13596         public static final String HTTP_PROXY = "http_proxy";
13597 
13598         /**
13599          * Host name for global http proxy. Set via ConnectivityManager.
13600          *
13601          * @hide
13602          */
13603         @Readable
13604         public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
13605 
13606         /**
13607          * Integer host port for global http proxy. Set via ConnectivityManager.
13608          *
13609          * @hide
13610          */
13611         @Readable
13612         public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
13613 
13614         /**
13615          * Exclusion list for global proxy. This string contains a list of
13616          * comma-separated domains where the global proxy does not apply.
13617          * Domains should be listed in a comma- separated list. Example of
13618          * acceptable formats: ".domain1.com,my.domain2.com" Use
13619          * ConnectivityManager to set/get.
13620          *
13621          * @hide
13622          */
13623         @Readable
13624         public static final String
13625                 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
13626 
13627         /**
13628          * The location PAC File for the proxy.
13629          * @hide
13630          */
13631         @Readable
13632         public static final String
13633                 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
13634 
13635         /**
13636          * Enables the UI setting to allow the user to specify the global HTTP
13637          * proxy and associated exclusion list.
13638          *
13639          * @hide
13640          */
13641         @Readable
13642         public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
13643 
13644         /**
13645          * Setting for default DNS in case nobody suggests one
13646          *
13647          * @hide
13648          */
13649         @Readable
13650         public static final String DEFAULT_DNS_SERVER = "default_dns_server";
13651 
13652         /**
13653          * The requested Private DNS mode (string), and an accompanying specifier (string).
13654          *
13655          * Currently, the specifier holds the chosen provider name when the mode requests
13656          * a specific provider. It may be used to store the provider name even when the
13657          * mode changes so that temporarily disabling and re-enabling the specific
13658          * provider mode does not necessitate retyping the provider hostname.
13659          *
13660          * @hide
13661          */
13662         @Readable
13663         public static final String PRIVATE_DNS_MODE = "private_dns_mode";
13664 
13665         /**
13666          * @hide
13667          */
13668         @Readable
13669         public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier";
13670 
13671         /**
13672           * Forced override of the default mode (hardcoded as "automatic", nee "opportunistic").
13673           * This allows changing the default mode without effectively disabling other modes,
13674           * all of which require explicit user action to enable/configure. See also b/79719289.
13675           *
13676           * Value is a string, suitable for assignment to PRIVATE_DNS_MODE above.
13677           *
13678           * {@hide}
13679           */
13680         @Readable
13681         public static final String PRIVATE_DNS_DEFAULT_MODE = "private_dns_default_mode";
13682 
13683 
13684         /** {@hide} */
13685         @Readable
13686         @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
13687         @SuppressLint("NoSettingsProvider")
13688         public static final String
13689                 BLUETOOTH_BTSNOOP_DEFAULT_MODE = "bluetooth_btsnoop_default_mode";
13690         /** {@hide} */
13691         @Readable
13692         public static final String
13693                 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
13694         /** {@hide} */
13695         @Readable
13696         public static final String
13697                 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
13698         /** {@hide} */
13699         @Readable
13700         public static final String
13701                 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_";
13702         /** {@hide} */
13703         @Readable
13704         public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX =
13705                 "bluetooth_a2dp_supports_optional_codecs_";
13706         /** {@hide} */
13707         @Readable
13708         public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX =
13709                 "bluetooth_a2dp_optional_codecs_enabled_";
13710         /** {@hide} */
13711         @Readable
13712         public static final String
13713                 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
13714         /** {@hide} */
13715         @Readable
13716         public static final String
13717                 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
13718         /** {@hide} */
13719         @Readable
13720         public static final String
13721                 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_";
13722         /** {@hide} */
13723         @Readable
13724         public static final String
13725                 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_";
13726         /** {@hide} */
13727         @Readable
13728         public static final String
13729                 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
13730         /** {@hide} */
13731         @Readable
13732         public static final String
13733                 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_";
13734         /** {@hide} */
13735         @Readable
13736         public static final String
13737                 BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_";
13738 
13739         /**
13740          * Enable/disable radio bug detection
13741          *
13742          * {@hide}
13743          */
13744         @Readable
13745         public static final String
13746                 ENABLE_RADIO_BUG_DETECTION = "enable_radio_bug_detection";
13747 
13748         /**
13749          * Count threshold of RIL wakelock timeout for radio bug detection
13750          *
13751          * {@hide}
13752          */
13753         @Readable
13754         public static final String
13755                 RADIO_BUG_WAKELOCK_TIMEOUT_COUNT_THRESHOLD =
13756                 "radio_bug_wakelock_timeout_count_threshold";
13757 
13758         /**
13759          * Count threshold of RIL system error for radio bug detection
13760          *
13761          * {@hide}
13762          */
13763         @Readable
13764         public static final String
13765                 RADIO_BUG_SYSTEM_ERROR_COUNT_THRESHOLD =
13766                 "radio_bug_system_error_count_threshold";
13767 
13768         /**
13769          * Activity manager specific settings.
13770          * This is encoded as a key=value list, separated by commas. Ex:
13771          *
13772          * "gc_timeout=5000,max_cached_processes=24"
13773          *
13774          * The following keys are supported:
13775          *
13776          * <pre>
13777          * max_cached_processes                 (int)
13778          * background_settle_time               (long)
13779          * fgservice_min_shown_time             (long)
13780          * fgservice_min_report_time            (long)
13781          * fgservice_screen_on_before_time      (long)
13782          * fgservice_screen_on_after_time       (long)
13783          * content_provider_retain_time         (long)
13784          * gc_timeout                           (long)
13785          * gc_min_interval                      (long)
13786          * full_pss_min_interval                (long)
13787          * full_pss_lowered_interval            (long)
13788          * power_check_interval                 (long)
13789          * power_check_max_cpu_1                (int)
13790          * power_check_max_cpu_2                (int)
13791          * power_check_max_cpu_3                (int)
13792          * power_check_max_cpu_4                (int)
13793          * service_usage_interaction_time       (long)
13794          * usage_stats_interaction_interval     (long)
13795          * service_restart_duration             (long)
13796          * service_reset_run_duration           (long)
13797          * service_restart_duration_factor      (int)
13798          * service_min_restart_time_between     (long)
13799          * service_max_inactivity               (long)
13800          * service_bg_start_timeout             (long)
13801          * service_bg_activity_start_timeout    (long)
13802          * process_start_async                  (boolean)
13803          * </pre>
13804          *
13805          * <p>
13806          * Type: string
13807          * @hide
13808          * @see com.android.server.am.ActivityManagerConstants
13809          */
13810         @Readable
13811         public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants";
13812 
13813         /**
13814          * Feature flag to enable or disable the activity starts logging feature.
13815          * Type: int (0 for false, 1 for true)
13816          * Default: 1
13817          * @hide
13818          */
13819         @Readable
13820         public static final String ACTIVITY_STARTS_LOGGING_ENABLED
13821                 = "activity_starts_logging_enabled";
13822 
13823         /**
13824          * Feature flag to enable or disable the foreground service starts logging feature.
13825          * Type: int (0 for false, 1 for true)
13826          * Default: 1
13827          * @hide
13828          */
13829         @Readable
13830         public static final String FOREGROUND_SERVICE_STARTS_LOGGING_ENABLED =
13831                 "foreground_service_starts_logging_enabled";
13832 
13833         /**
13834          * @hide
13835          * @see com.android.server.appbinding.AppBindingConstants
13836          */
13837         @Readable
13838         public static final String APP_BINDING_CONSTANTS = "app_binding_constants";
13839 
13840         /**
13841          * App ops specific settings.
13842          * This is encoded as a key=value list, separated by commas. Ex:
13843          *
13844          * "state_settle_time=10000"
13845          *
13846          * The following keys are supported:
13847          *
13848          * <pre>
13849          * top_state_settle_time                (long)
13850          * fg_service_state_settle_time         (long)
13851          * bg_state_settle_time                 (long)
13852          * </pre>
13853          *
13854          * <p>
13855          * Type: string
13856          * @hide
13857          * @see com.android.server.AppOpsService.Constants
13858          */
13859         @TestApi
13860         @Readable
13861         public static final String APP_OPS_CONSTANTS = "app_ops_constants";
13862 
13863         /**
13864          * Battery Saver specific settings
13865          * This is encoded as a key=value list, separated by commas. Ex:
13866          *
13867          * "vibration_disabled=true,adjust_brightness_factor=0.5"
13868          *
13869          * The following keys are supported:
13870          *
13871          * <pre>
13872          * advertise_is_enabled              (boolean)
13873          * datasaver_disabled                (boolean)
13874          * enable_night_mode                 (boolean)
13875          * launch_boost_disabled             (boolean)
13876          * vibration_disabled                (boolean)
13877          * animation_disabled                (boolean)
13878          * soundtrigger_disabled             (boolean)
13879          * fullbackup_deferred               (boolean)
13880          * keyvaluebackup_deferred           (boolean)
13881          * firewall_disabled                 (boolean)
13882          * gps_mode                          (int)
13883          * adjust_brightness_disabled        (boolean)
13884          * adjust_brightness_factor          (float)
13885          * force_all_apps_standby            (boolean)
13886          * force_background_check            (boolean)
13887          * optional_sensors_disabled         (boolean)
13888          * aod_disabled                      (boolean)
13889          * quick_doze_enabled                (boolean)
13890          * </pre>
13891          * @hide
13892          * @see com.android.server.power.batterysaver.BatterySaverPolicy
13893          */
13894         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
13895         @TestApi
13896         @Readable
13897         public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants";
13898 
13899         /**
13900          * Battery Saver device specific settings
13901          * This is encoded as a key=value list, separated by commas.
13902          *
13903          * The following keys are supported:
13904          *
13905          * <pre>
13906          *     cpufreq-i (list of "core-number:frequency" pairs concatenated with /)
13907          *     cpufreq-n (list of "core-number:frequency" pairs concatenated with /)
13908          * </pre>
13909          *
13910          * See {@link com.android.server.power.batterysaver.BatterySaverPolicy} for the details.
13911          *
13912          * @hide
13913          */
13914         @Readable
13915         public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS =
13916                 "battery_saver_device_specific_constants";
13917 
13918         /**
13919          * Battery tip specific settings
13920          * This is encoded as a key=value list, separated by commas. Ex:
13921          *
13922          * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true,"
13923          * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50,"
13924          * "high_usage_battery_draining=25,high_usage_period_ms=3000"
13925          *
13926          * The following keys are supported:
13927          *
13928          * <pre>
13929          * battery_tip_enabled              (boolean)
13930          * summary_enabled                  (boolean)
13931          * battery_saver_tip_enabled        (boolean)
13932          * high_usage_enabled               (boolean)
13933          * high_usage_app_count             (int)
13934          * high_usage_period_ms             (long)
13935          * high_usage_battery_draining      (int)
13936          * app_restriction_enabled          (boolean)
13937          * reduced_battery_enabled          (boolean)
13938          * reduced_battery_percent          (int)
13939          * low_battery_enabled              (boolean)
13940          * low_battery_hour                 (int)
13941          * </pre>
13942          * @hide
13943          */
13944         @Readable
13945         public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants";
13946 
13947         /**
13948          * Battery anomaly detection specific settings
13949          * This is encoded as a key=value list, separated by commas.
13950          * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via
13951          * {@link Uri#encode(String)}, separated by colons. Ex:
13952          *
13953          * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true,"
13954          * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon"
13955          *
13956          * The following keys are supported:
13957          *
13958          * <pre>
13959          * anomaly_detection_enabled       (boolean)
13960          * wakelock_enabled                (boolean)
13961          * wakelock_threshold              (long)
13962          * wakeup_alarm_enabled            (boolean)
13963          * wakeup_alarm_threshold          (long)
13964          * wakeup_blacklisted_tags         (string)
13965          * bluetooth_scan_enabled          (boolean)
13966          * bluetooth_scan_threshold        (long)
13967          * </pre>
13968          * @hide
13969          */
13970         @Readable
13971         public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants";
13972 
13973         /**
13974          * An integer to show the version of the anomaly config. Ex: 1, which means
13975          * current version is 1.
13976          * @hide
13977          */
13978         @Readable
13979         public static final String ANOMALY_CONFIG_VERSION = "anomaly_config_version";
13980 
13981         /**
13982          * A base64-encoded string represents anomaly stats config, used for
13983          * {@link android.app.StatsManager}.
13984          * @hide
13985          */
13986         @Readable
13987         public static final String ANOMALY_CONFIG = "anomaly_config";
13988 
13989         /**
13990          * Always on display(AOD) specific settings
13991          * This is encoded as a key=value list, separated by commas. Ex:
13992          *
13993          * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4"
13994          *
13995          * The following keys are supported:
13996          *
13997          * <pre>
13998          * screen_brightness_array         (int[])
13999          * dimming_scrim_array             (int[])
14000          * prox_screen_off_delay           (long)
14001          * prox_cooldown_trigger           (long)
14002          * prox_cooldown_period            (long)
14003          * </pre>
14004          * @hide
14005          */
14006         @Readable
14007         public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants";
14008 
14009         /**
14010         * UidCpuPower global setting. This links the sys.uidcpupower system property.
14011         * The following values are supported:
14012         * 0 -> /proc/uid_cpupower/* are disabled
14013         * 1 -> /proc/uid_cpupower/* are enabled
14014         * Any other value defaults to enabled.
14015         * @hide
14016         */
14017         @Readable
14018         public static final String SYS_UIDCPUPOWER = "sys_uidcpupower";
14019 
14020         /**
14021         * traced global setting. This controls weather the deamons: traced and
14022         * traced_probes run. This links the sys.traced system property.
14023         * The following values are supported:
14024         * 0 -> traced and traced_probes are disabled
14025         * 1 -> traced and traced_probes are enabled
14026         * Any other value defaults to disabled.
14027         * @hide
14028         */
14029         @Readable
14030         public static final String SYS_TRACED = "sys_traced";
14031 
14032         /**
14033          * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the
14034          * device for this setting to take full effect.
14035          *
14036          * @hide
14037          */
14038         @Readable
14039         public static final String FPS_DEVISOR = "fps_divisor";
14040 
14041         /**
14042          * Flag to enable or disable display panel low power mode (lpm)
14043          * false -> Display panel power saving mode is disabled.
14044          * true  -> Display panel power saving mode is enabled.
14045          *
14046          * @hide
14047          */
14048         @Readable
14049         public static final String DISPLAY_PANEL_LPM = "display_panel_lpm";
14050 
14051         /**
14052          * App time limit usage source setting.
14053          * This controls which app in a task will be considered the source of usage when
14054          * calculating app usage time limits.
14055          *
14056          * 1 -> task root app
14057          * 2 -> current app
14058          * Any other value defaults to task root app.
14059          *
14060          * Need to reboot the device for this setting to take effect.
14061          * @hide
14062          */
14063         @Readable
14064         public static final String APP_TIME_LIMIT_USAGE_SOURCE = "app_time_limit_usage_source";
14065 
14066         /**
14067          * Enable ART bytecode verification verifications for debuggable apps.
14068          * 0 = disable, 1 = enable.
14069          * @hide
14070          */
14071         @Readable
14072         public static final String ART_VERIFIER_VERIFY_DEBUGGABLE =
14073                 "art_verifier_verify_debuggable";
14074 
14075         /**
14076          * Power manager specific settings.
14077          * This is encoded as a key=value list, separated by commas. Ex:
14078          *
14079          * "no_cached_wake_locks=1"
14080          *
14081          * The following keys are supported:
14082          *
14083          * <pre>
14084          * no_cached_wake_locks                 (boolean)
14085          * </pre>
14086          *
14087          * <p>
14088          * Type: string
14089          * @hide
14090          * @see com.android.server.power.PowerManagerConstants
14091          */
14092         @Readable
14093         public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants";
14094 
14095         /**
14096          * ShortcutManager specific settings.
14097          * This is encoded as a key=value list, separated by commas. Ex:
14098          *
14099          * "reset_interval_sec=86400,max_updates_per_interval=1"
14100          *
14101          * The following keys are supported:
14102          *
14103          * <pre>
14104          * reset_interval_sec              (long)
14105          * max_updates_per_interval        (int)
14106          * max_icon_dimension_dp           (int, DP)
14107          * max_icon_dimension_dp_lowram    (int, DP)
14108          * max_shortcuts                   (int)
14109          * icon_quality                    (int, 0-100)
14110          * icon_format                     (String)
14111          * </pre>
14112          *
14113          * <p>
14114          * Type: string
14115          * @hide
14116          * @see com.android.server.pm.ShortcutService.ConfigConstants
14117          */
14118         @Readable
14119         public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants";
14120 
14121         /**
14122          * DevicePolicyManager specific settings.
14123          * This is encoded as a key=value list, separated by commas. Ex:
14124          *
14125          * <pre>
14126          * das_died_service_reconnect_backoff_sec       (long)
14127          * das_died_service_reconnect_backoff_increase  (float)
14128          * das_died_service_reconnect_max_backoff_sec   (long)
14129          * </pre>
14130          *
14131          * <p>
14132          * Type: string
14133          * @hide
14134          * see also com.android.server.devicepolicy.DevicePolicyConstants
14135          */
14136         @Readable
14137         public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants";
14138 
14139         /**
14140          * TextClassifier specific settings.
14141          * This is encoded as a key=value list, separated by commas. String[] types like
14142          * entity_list_default use ":" as delimiter for values. Ex:
14143          *
14144          * <pre>
14145          * classify_text_max_range_length                   (int)
14146          * detect_language_from_text_enabled                (boolean)
14147          * entity_list_default                              (String[])
14148          * entity_list_editable                             (String[])
14149          * entity_list_not_editable                         (String[])
14150          * generate_links_log_sample_rate                   (int)
14151          * generate_links_max_text_length                   (int)
14152          * in_app_conversation_action_types_default         (String[])
14153          * lang_id_context_settings                         (float[])
14154          * lang_id_threshold_override                       (float)
14155          * local_textclassifier_enabled                     (boolean)
14156          * model_dark_launch_enabled                        (boolean)
14157          * notification_conversation_action_types_default   (String[])
14158          * smart_linkify_enabled                            (boolean)
14159          * smart_select_animation_enabled                   (boolean)
14160          * smart_selection_enabled                          (boolean)
14161          * smart_text_share_enabled                         (boolean)
14162          * suggest_selection_max_range_length               (int)
14163          * system_textclassifier_enabled                    (boolean)
14164          * template_intent_factory_enabled                  (boolean)
14165          * translate_in_classification_enabled              (boolean)
14166          * </pre>
14167          *
14168          * <p>
14169          * Type: string
14170          * @hide
14171          * see also android.view.textclassifier.TextClassificationConstants
14172          */
14173         @Readable
14174         public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants";
14175 
14176         /**
14177          * BatteryStats specific settings.
14178          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
14179          *
14180          * The following keys are supported:
14181          * <pre>
14182          * track_cpu_times_by_proc_state (boolean)
14183          * track_cpu_active_cluster_time (boolean)
14184          * read_binary_cpu_time          (boolean)
14185          * proc_state_cpu_times_read_delay_ms (long)
14186          * external_stats_collection_rate_limit_ms (long)
14187          * battery_level_collection_delay_ms (long)
14188          * max_history_files (int)
14189          * max_history_buffer_kb (int)
14190          * battery_charged_delay_ms (int)
14191          * </pre>
14192          *
14193          * <p>
14194          * Type: string
14195          * @hide
14196          * see also com.android.internal.os.BatteryStatsImpl.Constants
14197          */
14198         @Readable
14199         public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants";
14200 
14201         /**
14202          * SyncManager specific settings.
14203          *
14204          * <p>
14205          * Type: string
14206          * @hide
14207          * @see com.android.server.content.SyncManagerConstants
14208          */
14209         @Readable
14210         public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants";
14211 
14212         /**
14213          * Broadcast dispatch tuning parameters specific to foreground broadcasts.
14214          *
14215          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
14216          *
14217          * The following keys are supported:
14218          * <pre>
14219          * bcast_timeout                (long)
14220          * bcast_slow_time              (long)
14221          * bcast_deferral               (long)
14222          * bcast_deferral_decay_factor  (float)
14223          * bcast_deferral_floor         (long)
14224          * bcast_allow_bg_activity_start_timeout    (long)
14225          * </pre>
14226          *
14227          * @hide
14228          */
14229         @Readable
14230         public static final String BROADCAST_FG_CONSTANTS = "bcast_fg_constants";
14231 
14232         /**
14233          * Broadcast dispatch tuning parameters specific to background broadcasts.
14234          *
14235          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true".
14236          * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys.
14237          *
14238          * @hide
14239          */
14240         @Readable
14241         public static final String BROADCAST_BG_CONSTANTS = "bcast_bg_constants";
14242 
14243         /**
14244          * Broadcast dispatch tuning parameters specific to specific "offline" broadcasts.
14245          *
14246          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true".
14247          * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys.
14248          *
14249          * @hide
14250          */
14251         @Readable
14252         public static final String BROADCAST_OFFLOAD_CONSTANTS = "bcast_offload_constants";
14253 
14254         /**
14255          * Whether or not App Standby feature is enabled by system. This controls throttling of apps
14256          * based on usage patterns and predictions. Platform will turn on this feature if both this
14257          * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on.
14258          * Type: int (0 for false, 1 for true)
14259          * Default: 1
14260          * @hide
14261          * @see #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED
14262          */
14263         @SystemApi
14264         @Readable
14265         public static final String APP_STANDBY_ENABLED = "app_standby_enabled";
14266 
14267         /**
14268          * Whether or not adaptive battery feature is enabled by user. Platform will turn on this
14269          * feature if both this flag and {@link #APP_STANDBY_ENABLED} is on.
14270          * Type: int (0 for false, 1 for true)
14271          * Default: 1
14272          * @hide
14273          * @see #APP_STANDBY_ENABLED
14274          */
14275         @Readable
14276         public static final String ADAPTIVE_BATTERY_MANAGEMENT_ENABLED =
14277                 "adaptive_battery_management_enabled";
14278 
14279         /**
14280          * Whether or not apps are allowed into the
14281          * {@link android.app.usage.UsageStatsManager#STANDBY_BUCKET_RESTRICTED} bucket.
14282          * Type: int (0 for false, 1 for true)
14283          * Default: {@value #DEFAULT_ENABLE_RESTRICTED_BUCKET}
14284          *
14285          * @hide
14286          */
14287         @Readable
14288         public static final String ENABLE_RESTRICTED_BUCKET = "enable_restricted_bucket";
14289 
14290         /**
14291          * @see #ENABLE_RESTRICTED_BUCKET
14292          * @hide
14293          */
14294         public static final int DEFAULT_ENABLE_RESTRICTED_BUCKET = 1;
14295 
14296         /**
14297          * Whether or not app auto restriction is enabled. When it is enabled, settings app will
14298          * auto restrict the app if it has bad behavior (e.g. hold wakelock for long time).
14299          *
14300          * Type: boolean (0 for false, 1 for true)
14301          * Default: 1
14302          *
14303          * @hide
14304          */
14305         @Readable
14306         public static final String APP_AUTO_RESTRICTION_ENABLED =
14307                 "app_auto_restriction_enabled";
14308 
14309         /**
14310          * Feature flag to enable or disable the Forced App Standby feature.
14311          * Type: int (0 for false, 1 for true)
14312          * Default: 1
14313          * @hide
14314          */
14315         @Readable
14316         public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled";
14317 
14318         /**
14319          * Whether or not to enable Forced App Standby on small battery devices.
14320          * Type: int (0 for false, 1 for true)
14321          * Default: 0
14322          * @hide
14323          */
14324         @Readable
14325         public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED
14326                 = "forced_app_standby_for_small_battery_enabled";
14327 
14328         /**
14329          * Whether to enable the TARE subsystem as a whole or not.
14330          * 1 means enable, 0 means disable.
14331          *
14332          * @hide
14333          */
14334         public static final String ENABLE_TARE = "enable_tare";
14335 
14336         /**
14337          * Default value for {@link #ENABLE_TARE}.
14338          *
14339          * @hide
14340          */
14341         public static final int DEFAULT_ENABLE_TARE = 0;
14342 
14343         /**
14344          * Whether to enable the TARE AlarmManager economic policy or not.
14345          * 1 means enable, 0 means disable.
14346          *
14347          * @hide
14348          */
14349         public static final String ENABLE_TARE_ALARM_MANAGER = "enable_tare_alarm_manager";
14350 
14351         /**
14352          * Default value for {@link #ENABLE_TARE_ALARM_MANAGER}.
14353          *
14354          * @hide
14355          */
14356         public static final int DEFAULT_ENABLE_TARE_ALARM_MANAGER = 0;
14357 
14358         /**
14359          * Settings for AlarmManager's TARE EconomicPolicy (list of its economic factors).
14360          *
14361          * Keys are listed in {@link android.app.tare.EconomyManager}.
14362          *
14363          * @hide
14364          */
14365         public static final String TARE_ALARM_MANAGER_CONSTANTS = "tare_alarm_manager_constants";
14366 
14367         /**
14368          * Whether to enable the TARE JobScheduler economic policy or not.
14369          * 1 means enable, 0 means disable.
14370          *
14371          * @hide
14372          */
14373         public static final String ENABLE_TARE_JOB_SCHEDULER = "enable_tare_job_scheduler";
14374 
14375         /**
14376          * Default value for {@link #ENABLE_TARE_JOB_SCHEDULER}.
14377          *
14378          * @hide
14379          */
14380         public static final int DEFAULT_ENABLE_TARE_JOB_SCHEDULER = 0;
14381 
14382         /**
14383          * Settings for JobScheduler's TARE EconomicPolicy (list of its economic factors).
14384          *
14385          * Keys are listed in {@link android.app.tare.EconomyManager}.
14386          *
14387          * @hide
14388          */
14389         public static final String TARE_JOB_SCHEDULER_CONSTANTS = "tare_job_scheduler_constants";
14390 
14391         /**
14392          * Whether or not to enable the User Absent, Radios Off feature on small battery devices.
14393          * Type: int (0 for false, 1 for true)
14394          * Default: 0
14395          * @hide
14396          */
14397         @Readable
14398         public static final String USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED
14399                 = "user_absent_radios_off_for_small_battery_enabled";
14400 
14401         /**
14402          * Whether or not to enable the User Absent, Touch Off feature on small battery devices.
14403          * Type: int (0 for false, 1 for true)
14404          * Default: 0
14405          * @hide
14406          */
14407         @Readable
14408         public static final String USER_ABSENT_TOUCH_OFF_FOR_SMALL_BATTERY_ENABLED
14409                 = "user_absent_touch_off_for_small_battery_enabled";
14410 
14411         /**
14412          * Whether or not to turn on Wifi when proxy is disconnected.
14413          * Type: int (0 for false, 1 for true)
14414          * Default: 1
14415          * @hide
14416          */
14417         @Readable
14418         public static final String WIFI_ON_WHEN_PROXY_DISCONNECTED
14419                 = "wifi_on_when_proxy_disconnected";
14420 
14421         /**
14422          * Time Only Mode specific settings.
14423          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
14424          *
14425          * The following keys are supported:
14426          *
14427          * <pre>
14428          * enabled                  (boolean)
14429          * disable_home             (boolean)
14430          * disable_tilt_to_wake     (boolean)
14431          * disable_touch_to_wake    (boolean)
14432          * </pre>
14433          * Type: string
14434          * @hide
14435          */
14436         @Readable
14437         public static final String TIME_ONLY_MODE_CONSTANTS
14438                 = "time_only_mode_constants";
14439 
14440         /**
14441          * Whether of not to send keycode sleep for ungaze when Home is the foreground activity on
14442          * watch type devices.
14443          * Type: int (0 for false, 1 for true)
14444          * Default: 1
14445          * @hide
14446          */
14447         @Readable
14448         public static final String UNGAZE_SLEEP_ENABLED = "ungaze_sleep_enabled";
14449 
14450         /**
14451          * Whether or not Network Watchlist feature is enabled.
14452          * Type: int (0 for false, 1 for true)
14453          * Default: 0
14454          * @hide
14455          */
14456         @Readable
14457         public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled";
14458 
14459         /**
14460          * Whether or not show hidden launcher icon apps feature is enabled.
14461          * Type: int (0 for false, 1 for true)
14462          * Default: 1
14463          * @hide
14464          */
14465         @Readable
14466         public static final String SHOW_HIDDEN_LAUNCHER_ICON_APPS_ENABLED =
14467                 "show_hidden_icon_apps_enabled";
14468 
14469         /**
14470          * Whether or not show new app installed notification is enabled.
14471          * Type: int (0 for false, 1 for true)
14472          * Default: 0
14473          * @hide
14474          */
14475         @Readable
14476         public static final String SHOW_NEW_APP_INSTALLED_NOTIFICATION_ENABLED =
14477                 "show_new_app_installed_notification_enabled";
14478 
14479         /**
14480          * Flag to keep background restricted profiles running after exiting. If disabled,
14481          * the restricted profile can be put into stopped state as soon as the user leaves it.
14482          * Type: int (0 for false, 1 for true)
14483          *
14484          * Overridden by the system based on device information. If null, the value specified
14485          * by {@code config_keepRestrictedProfilesInBackground} is used.
14486          *
14487          * @hide
14488          */
14489         @Readable
14490         public static final String KEEP_PROFILE_IN_BACKGROUND = "keep_profile_in_background";
14491 
14492         /**
14493          * The default time in ms within which a subsequent connection from an always allowed system
14494          * is allowed to reconnect without user interaction.
14495          *
14496          * @hide
14497          */
14498         public static final long DEFAULT_ADB_ALLOWED_CONNECTION_TIME = 604800000;
14499 
14500         /**
14501          * When the user first connects their device to a system a prompt is displayed to allow
14502          * the adb connection with an option to 'Always allow' connections from this system. If the
14503          * user selects this always allow option then the connection time is stored for the system.
14504          * This setting is the time in ms within which a subsequent connection from an always
14505          * allowed system is allowed to reconnect without user interaction.
14506          *
14507          * Type: long
14508          *
14509          * @hide
14510          */
14511         @Readable
14512         public static final String ADB_ALLOWED_CONNECTION_TIME =
14513                 "adb_allowed_connection_time";
14514 
14515         /**
14516          * Scaling factor for normal window animations.
14517          *
14518          * The value is a float. Setting to 0.0f will disable window animations.
14519          */
14520         @Readable
14521         public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
14522 
14523         /**
14524          * Setting to disable cross-window blurs. This includes window blur behind, (see
14525          *  {@link LayoutParams#setBlurBehindRadius}) and window background blur (see
14526          *  {@link Window#setBackgroundBlurRadius}).
14527          *
14528          * The value is a boolean (1 or 0).
14529          * @hide
14530          */
14531         @TestApi
14532         @Readable
14533         @SuppressLint("NoSettingsProvider")
14534         public static final String DISABLE_WINDOW_BLURS = "disable_window_blurs";
14535 
14536         /**
14537          * Scaling factor for activity transition animations.
14538          *
14539          * The value is a float. Setting to 0.0f will disable window animations.
14540          */
14541         @Readable
14542         public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
14543 
14544         /**
14545          * Scaling factor for Animator-based animations. This affects both the
14546          * start delay and duration of all such animations.
14547          *
14548          * The value is a float. Setting to 0.0f will cause animations to end immediately.
14549          * The default value is 1.0f.
14550          */
14551         @Readable
14552         public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
14553 
14554         /**
14555          * Scaling factor for normal window animations. Setting to 0 will
14556          * disable window animations.
14557          *
14558          * @hide
14559          */
14560         @Readable
14561         public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
14562 
14563         /**
14564          * If 0, the compatibility mode is off for all applications.
14565          * If 1, older applications run under compatibility mode.
14566          * TODO: remove this settings before code freeze (bug/1907571)
14567          * @hide
14568          */
14569         @Readable
14570         public static final String COMPATIBILITY_MODE = "compatibility_mode";
14571 
14572         /**
14573          * CDMA only settings
14574          * Emergency Tone  0 = Off
14575          *                 1 = Alert
14576          *                 2 = Vibrate
14577          * @hide
14578          */
14579         @Readable
14580         public static final String EMERGENCY_TONE = "emergency_tone";
14581 
14582         /**
14583          * CDMA only settings
14584          * Whether the auto retry is enabled. The value is
14585          * boolean (1 or 0).
14586          * @hide
14587          */
14588         @Readable
14589         public static final String CALL_AUTO_RETRY = "call_auto_retry";
14590 
14591         /**
14592          * A setting that can be read whether the emergency affordance is currently needed.
14593          * The value is a boolean (1 or 0).
14594          * @hide
14595          */
14596         @Readable
14597         public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed";
14598 
14599         /**
14600          * The power button "cooldown" period in milliseconds after the Emergency gesture is
14601          * triggered, during which single-key actions on the power button are suppressed. Cooldown
14602          * period is disabled if set to zero.
14603          *
14604          * @hide
14605          */
14606         public static final String EMERGENCY_GESTURE_POWER_BUTTON_COOLDOWN_PERIOD_MS =
14607                 "emergency_gesture_power_button_cooldown_period_ms";
14608 
14609         /**
14610          * The minimum time in milliseconds to perform the emergency gesture.
14611          *
14612          * @hide
14613          */
14614         public static final String EMERGENCY_GESTURE_TAP_DETECTION_MIN_TIME_MS =
14615                 "emergency_gesture_tap_detection_min_time_ms";
14616 
14617         /**
14618          * Whether to enable automatic system server heap dumps. This only works on userdebug or
14619          * eng builds, not on user builds. This is set by the user and overrides the config value.
14620          * 1 means enable, 0 means disable.
14621          *
14622          * @hide
14623          */
14624         @Readable
14625         public static final String ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS =
14626                 "enable_automatic_system_server_heap_dumps";
14627 
14628         /**
14629          * See RIL_PreferredNetworkType in ril.h
14630          * @hide
14631          */
14632         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
14633         @Readable
14634         public static final String PREFERRED_NETWORK_MODE =
14635                 "preferred_network_mode";
14636 
14637         /**
14638          * Name of an application package to be debugged.
14639          */
14640         @Readable
14641         public static final String DEBUG_APP = "debug_app";
14642 
14643         /**
14644          * If 1, when launching DEBUG_APP it will wait for the debugger before
14645          * starting user code.  If 0, it will run normally.
14646          */
14647         @Readable
14648         public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
14649 
14650         /**
14651          * Allow GPU debug layers?
14652          * 0 = no
14653          * 1 = yes
14654          * @hide
14655          */
14656         @Readable
14657         public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers";
14658 
14659         /**
14660          * App allowed to load GPU debug layers
14661          * @hide
14662          */
14663         @Readable
14664         public static final String GPU_DEBUG_APP = "gpu_debug_app";
14665 
14666         /**
14667          * Package containing ANGLE libraries other than system, which are only available
14668          * to dumpable apps that opt-in.
14669          * @hide
14670          */
14671         @Readable
14672         public static final String ANGLE_DEBUG_PACKAGE = "angle_debug_package";
14673 
14674         /**
14675          * Force all PKGs to use ANGLE, regardless of any other settings
14676          * The value is a boolean (1 or 0).
14677          * @hide
14678          */
14679         @Readable
14680         public static final String ANGLE_GL_DRIVER_ALL_ANGLE = "angle_gl_driver_all_angle";
14681 
14682         /**
14683          * List of PKGs that have an OpenGL driver selected
14684          * @hide
14685          */
14686         @Readable
14687         public static final String ANGLE_GL_DRIVER_SELECTION_PKGS =
14688                 "angle_gl_driver_selection_pkgs";
14689 
14690         /**
14691          * List of selected OpenGL drivers, corresponding to the PKGs in GLOBAL_SETTINGS_DRIVER_PKGS
14692          * @hide
14693          */
14694         @Readable
14695         public static final String ANGLE_GL_DRIVER_SELECTION_VALUES =
14696                 "angle_gl_driver_selection_values";
14697 
14698         /**
14699          * Lists of ANGLE EGL features for debugging.
14700          * Each list of features is separated by a comma, each feature in each list is separated by
14701          * a colon.
14702          * e.g. feature1:feature2:feature3,feature1:feature3:feature5
14703          * @hide
14704          */
14705         @Readable
14706         public static final String ANGLE_EGL_FEATURES = "angle_egl_features";
14707 
14708         /**
14709          * Show the "ANGLE In Use" dialog box to the user when ANGLE is the OpenGL driver.
14710          * The value is a boolean (1 or 0).
14711          * @hide
14712          */
14713         @Readable
14714         public static final String SHOW_ANGLE_IN_USE_DIALOG_BOX = "show_angle_in_use_dialog_box";
14715 
14716         /**
14717          * Updatable driver global preference for all Apps.
14718          * 0 = Default
14719          * 1 = All Apps use updatable production driver
14720          * 2 = All apps use updatable prerelease driver
14721          * 3 = All Apps use system graphics driver
14722          * @hide
14723          */
14724         @Readable
14725         public static final String UPDATABLE_DRIVER_ALL_APPS = "updatable_driver_all_apps";
14726 
14727         /**
14728          * List of Apps selected to use updatable production driver.
14729          * i.e. <pkg1>,<pkg2>,...,<pkgN>
14730          * @hide
14731          */
14732         @Readable
14733         public static final String UPDATABLE_DRIVER_PRODUCTION_OPT_IN_APPS =
14734                 "updatable_driver_production_opt_in_apps";
14735 
14736         /**
14737          * List of Apps selected to use updatable prerelease driver.
14738          * i.e. <pkg1>,<pkg2>,...,<pkgN>
14739          * @hide
14740          */
14741         @Readable
14742         public static final String UPDATABLE_DRIVER_PRERELEASE_OPT_IN_APPS =
14743                 "updatable_driver_prerelease_opt_in_apps";
14744 
14745         /**
14746          * List of Apps selected not to use updatable production driver.
14747          * i.e. <pkg1>,<pkg2>,...,<pkgN>
14748          * @hide
14749          */
14750         @Readable
14751         public static final String UPDATABLE_DRIVER_PRODUCTION_OPT_OUT_APPS =
14752                 "updatable_driver_production_opt_out_apps";
14753 
14754         /**
14755          * Apps on the denylist that are forbidden to use updatable production driver.
14756          * @hide
14757          */
14758         @Readable
14759         public static final String UPDATABLE_DRIVER_PRODUCTION_DENYLIST =
14760                 "updatable_driver_production_denylist";
14761 
14762         /**
14763          * List of denylists, each denylist is a denylist for a specific version of
14764          * updatable production driver.
14765          * @hide
14766          */
14767         @Readable
14768         public static final String UPDATABLE_DRIVER_PRODUCTION_DENYLISTS =
14769                 "updatable_driver_production_denylists";
14770 
14771         /**
14772          * Apps on the allowlist that are allowed to use updatable production driver.
14773          * The string is a list of application package names, seperated by comma.
14774          * i.e. <apk1>,<apk2>,...,<apkN>
14775          * @hide
14776          */
14777         @Readable
14778         public static final String UPDATABLE_DRIVER_PRODUCTION_ALLOWLIST =
14779                 "updatable_driver_production_allowlist";
14780 
14781         /**
14782          * List of libraries in sphal accessible by updatable driver
14783          * The string is a list of library names, separated by colon.
14784          * i.e. <lib1>:<lib2>:...:<libN>
14785          * @hide
14786          */
14787         @Readable
14788         public static final String UPDATABLE_DRIVER_SPHAL_LIBRARIES =
14789                 "updatable_driver_sphal_libraries";
14790 
14791         /**
14792          * Ordered GPU debug layer list for Vulkan
14793          * i.e. <layer1>:<layer2>:...:<layerN>
14794          * @hide
14795          */
14796         @Readable
14797         public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers";
14798 
14799         /**
14800          * Ordered GPU debug layer list for GLES
14801          * i.e. <layer1>:<layer2>:...:<layerN>
14802          * @hide
14803          */
14804         @Readable
14805         public static final String GPU_DEBUG_LAYERS_GLES = "gpu_debug_layers_gles";
14806 
14807         /**
14808          * Addition app for GPU layer discovery
14809          * @hide
14810          */
14811         @Readable
14812         public static final String GPU_DEBUG_LAYER_APP = "gpu_debug_layer_app";
14813 
14814         /**
14815          * Control whether the process CPU usage meter should be shown.
14816          *
14817          * @deprecated This functionality is no longer available as of
14818          * {@link android.os.Build.VERSION_CODES#N_MR1}.
14819          */
14820         @Deprecated
14821         @Readable
14822         public static final String SHOW_PROCESSES = "show_processes";
14823 
14824         /**
14825          * If 1 low power mode (aka battery saver) is enabled.
14826          * @hide
14827          */
14828         @TestApi
14829         @Readable
14830         public static final String LOW_POWER_MODE = "low_power";
14831 
14832         /**
14833          * If 1, battery saver ({@link #LOW_POWER_MODE}) will be re-activated after the device
14834          * is unplugged from a charger or rebooted.
14835          * @hide
14836          */
14837         @TestApi
14838         @Readable
14839         public static final String LOW_POWER_MODE_STICKY = "low_power_sticky";
14840 
14841         /**
14842          * When a device is unplugged from a changer (or is rebooted), do not re-activate battery
14843          * saver even if {@link #LOW_POWER_MODE_STICKY} is 1, if the battery level is equal to or
14844          * above this threshold.
14845          *
14846          * @hide
14847          */
14848         @Readable
14849         public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL =
14850                 "low_power_sticky_auto_disable_level";
14851 
14852         /**
14853          * Whether sticky battery saver should be deactivated once the battery level has reached the
14854          * threshold specified by {@link #LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL}.
14855          *
14856          * @hide
14857          */
14858         @Readable
14859         public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED =
14860                 "low_power_sticky_auto_disable_enabled";
14861 
14862         /**
14863          * Battery level [1-100] at which low power mode automatically turns on.
14864          * If 0, it will not automatically turn on. For Q and newer, it will only automatically
14865          * turn on if the value is greater than 0 and the {@link #AUTOMATIC_POWER_SAVE_MODE}
14866          * setting is also set to
14867          * {@link android.os.PowerManager.AutoPowerSaveMode#POWER_SAVE_MODE_TRIGGER_PERCENTAGE}.
14868          * @see #AUTOMATIC_POWER_SAVE_MODE
14869          * @see android.os.PowerManager#getPowerSaveModeTrigger()
14870          * @hide
14871          */
14872         @Readable
14873         public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
14874 
14875         /**
14876          * Whether battery saver is currently set to trigger based on percentage, dynamic power
14877          * savings trigger, or none. See {@link AutoPowerSaveModeTriggers} for
14878          * accepted values.
14879          *
14880          *  @hide
14881          */
14882         @TestApi
14883         @Readable
14884         public static final String AUTOMATIC_POWER_SAVE_MODE = "automatic_power_save_mode";
14885 
14886         /**
14887          * The setting that backs the disable threshold for the setPowerSavingsWarning api in
14888          * PowerManager
14889          *
14890          * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int)
14891          * @hide
14892          */
14893         @TestApi
14894         @Readable
14895         public static final String DYNAMIC_POWER_SAVINGS_DISABLE_THRESHOLD =
14896                 "dynamic_power_savings_disable_threshold";
14897 
14898         /**
14899          * The setting which backs the setDynamicPowerSaveHint api in PowerManager.
14900          *
14901          * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int)
14902          * @hide
14903          */
14904         @TestApi
14905         @Readable
14906         public static final String DYNAMIC_POWER_SAVINGS_ENABLED = "dynamic_power_savings_enabled";
14907 
14908         /**
14909          * A long value indicating how much longer the system battery is estimated to last in
14910          * millis. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value
14911          * was updated.
14912          *
14913          * @deprecated Use {@link PowerManager#getBatteryDischargePrediction()} instead.
14914          * @hide
14915          */
14916         @Deprecated
14917         @Readable
14918         public static final String TIME_REMAINING_ESTIMATE_MILLIS =
14919                 "time_remaining_estimate_millis";
14920 
14921         /**
14922          * A boolean indicating whether {@link #TIME_REMAINING_ESTIMATE_MILLIS} is customized
14923          * to the device's usage or using global models. See
14924          * {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value was updated.
14925          *
14926          * @deprecated Use {@link PowerManager#isBatteryDischargePredictionPersonalized()} instead.
14927          *
14928          * @hide
14929          */
14930         @Deprecated
14931         @Readable
14932         public static final String TIME_REMAINING_ESTIMATE_BASED_ON_USAGE =
14933                 "time_remaining_estimate_based_on_usage";
14934 
14935         /**
14936          * A long value indicating how long the system battery takes to deplete from 100% to 0% on
14937          * average based on historical drain rates. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME}
14938          * for the last time this value was updated.
14939          *
14940          * @deprecated Use {@link PowerManager#getHistoricalDischargeTime()} instead.
14941          * @hide
14942          */
14943         @Deprecated
14944         @Readable
14945         public static final String AVERAGE_TIME_TO_DISCHARGE = "average_time_to_discharge";
14946 
14947         /**
14948          * A long indicating the epoch time in milliseconds when
14949          * {@link #TIME_REMAINING_ESTIMATE_MILLIS}, {@link #TIME_REMAINING_ESTIMATE_BASED_ON_USAGE},
14950          * and {@link #AVERAGE_TIME_TO_DISCHARGE} were last updated.
14951          *
14952          * @hide
14953          * @deprecated No longer needed due to {@link PowerManager#getBatteryDischargePrediction}.
14954          */
14955         @Deprecated
14956         @Readable
14957         public static final String BATTERY_ESTIMATES_LAST_UPDATE_TIME =
14958                 "battery_estimates_last_update_time";
14959 
14960         /**
14961          * The max value for {@link #LOW_POWER_MODE_TRIGGER_LEVEL}. If this setting is not set
14962          * or the value is 0, the default max will be used.
14963          *
14964          * @hide
14965          */
14966         @Readable
14967         public static final String LOW_POWER_MODE_TRIGGER_LEVEL_MAX = "low_power_trigger_level_max";
14968 
14969         /**
14970          * See com.android.settingslib.fuelgauge.BatterySaverUtils.
14971          * @hide
14972          */
14973         @Readable
14974         public static final String LOW_POWER_MODE_SUGGESTION_PARAMS =
14975                 "low_power_mode_suggestion_params";
14976 
14977         /**
14978          * If not 0, the activity manager will aggressively finish activities and
14979          * processes as soon as they are no longer needed.  If 0, the normal
14980          * extended lifetime is used.
14981          */
14982         @Readable
14983         public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
14984 
14985         /**
14986          * If nonzero, all system error dialogs will be hidden.  For example, the
14987          * crash and ANR dialogs will not be shown, and the system will just proceed
14988          * as if they had been accepted by the user.
14989          * @hide
14990          */
14991         @TestApi
14992         @Readable
14993         public static final String HIDE_ERROR_DIALOGS = "hide_error_dialogs";
14994 
14995         /**
14996          * Use Dock audio output for media:
14997          *      0 = disabled
14998          *      1 = enabled
14999          * @hide
15000          */
15001         @Readable
15002         public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
15003 
15004         /**
15005          * The surround sound formats AC3, DTS or IEC61937 are
15006          * available for use if they are detected.
15007          * This is the default mode.
15008          *
15009          * Note that AUTO is equivalent to ALWAYS for Android TVs and other
15010          * devices that have an S/PDIF output. This is because S/PDIF
15011          * is unidirectional and the TV cannot know if a decoder is
15012          * connected. So it assumes they are always available.
15013          * @hide
15014          */
15015          public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0;
15016 
15017         /**
15018          * AC3, DTS or IEC61937 are NEVER available, even if they
15019          * are detected by the hardware. Those formats will not be
15020          * reported.
15021          *
15022          * An example use case would be an AVR reports that it is capable of
15023          * surround sound decoding but is broken. If NEVER is chosen
15024          * then apps must use PCM output instead of encoded output.
15025          * @hide
15026          */
15027          public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1;
15028 
15029         /**
15030          * AC3, DTS or IEC61937 are ALWAYS available, even if they
15031          * are not detected by the hardware. Those formats will be
15032          * reported as part of the HDMI output capability. Applications
15033          * are then free to use either PCM or encoded output.
15034          *
15035          * An example use case would be a when TV was connected over
15036          * TOS-link to an AVR. But the TV could not see it because TOS-link
15037          * is unidirectional.
15038          * @hide
15039          */
15040          public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2;
15041 
15042         /**
15043          * Surround sound formats are available according to the choice
15044          * of user, even if they are not detected by the hardware. Those
15045          * formats will be reported as part of the HDMI output capability.
15046          * Applications are then free to use either PCM or encoded output.
15047          *
15048          * An example use case would be an AVR that doesn't report a surround
15049          * format while the user knows the AVR does support it.
15050          * @hide
15051          */
15052         public static final int ENCODED_SURROUND_OUTPUT_MANUAL = 3;
15053 
15054         /**
15055          * The maximum value for surround sound output mode in Android S.
15056          * @hide
15057          */
15058         public static final int ENCODED_SURROUND_SC_MAX = ENCODED_SURROUND_OUTPUT_MANUAL;
15059 
15060         /**
15061          * Set to ENCODED_SURROUND_OUTPUT_AUTO,
15062          * ENCODED_SURROUND_OUTPUT_NEVER,
15063          * ENCODED_SURROUND_OUTPUT_ALWAYS or
15064          * ENCODED_SURROUND_OUTPUT_MANUAL
15065          * @hide
15066          */
15067         @Readable
15068         public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output";
15069 
15070         /**
15071          * Surround sounds formats that are enabled when ENCODED_SURROUND_OUTPUT is set to
15072          * ENCODED_SURROUND_OUTPUT_MANUAL. Encoded as comma separated list. Allowed values
15073          * are the format constants defined in AudioFormat.java. Ex:
15074          *
15075          * "5,6"
15076          *
15077          * @hide
15078          */
15079         @Readable
15080         public static final String ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS =
15081                 "encoded_surround_output_enabled_formats";
15082 
15083         /**
15084          * Persisted safe headphone volume management state by AudioService
15085          * @hide
15086          */
15087         @Readable
15088         public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
15089 
15090         /**
15091          * URL for tzinfo (time zone) updates
15092          * @hide
15093          */
15094         @Readable
15095         public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
15096 
15097         /**
15098          * URL for tzinfo (time zone) update metadata
15099          * @hide
15100          */
15101         @Readable
15102         public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
15103 
15104         /**
15105          * URL for selinux (mandatory access control) updates
15106          * @hide
15107          */
15108         @Readable
15109         public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
15110 
15111         /**
15112          * URL for selinux (mandatory access control) update metadata
15113          * @hide
15114          */
15115         @Readable
15116         public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
15117 
15118         /**
15119          * URL for sms short code updates
15120          * @hide
15121          */
15122         @Readable
15123         public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
15124                 "sms_short_codes_content_url";
15125 
15126         /**
15127          * URL for sms short code update metadata
15128          * @hide
15129          */
15130         @Readable
15131         public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
15132                 "sms_short_codes_metadata_url";
15133 
15134         /**
15135          * URL for apn_db updates
15136          * @hide
15137          */
15138         @Readable
15139         public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url";
15140 
15141         /**
15142          * URL for apn_db update metadata
15143          * @hide
15144          */
15145         @Readable
15146         public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url";
15147 
15148         /**
15149          * URL for cert pinlist updates
15150          * @hide
15151          */
15152         @Readable
15153         public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
15154 
15155         /**
15156          * URL for cert pinlist updates
15157          * @hide
15158          */
15159         @Readable
15160         public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
15161 
15162         /**
15163          * URL for intent firewall updates
15164          * @hide
15165          */
15166         @Readable
15167         public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
15168                 "intent_firewall_content_url";
15169 
15170         /**
15171          * URL for intent firewall update metadata
15172          * @hide
15173          */
15174         @Readable
15175         public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
15176                 "intent_firewall_metadata_url";
15177 
15178         /**
15179          * URL for lang id model updates
15180          * @hide
15181          */
15182         @Readable
15183         public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url";
15184 
15185         /**
15186          * URL for lang id model update metadata
15187          * @hide
15188          */
15189         @Readable
15190         public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url";
15191 
15192         /**
15193          * URL for smart selection model updates
15194          * @hide
15195          */
15196         @Readable
15197         public static final String SMART_SELECTION_UPDATE_CONTENT_URL =
15198                 "smart_selection_content_url";
15199 
15200         /**
15201          * URL for smart selection model update metadata
15202          * @hide
15203          */
15204         @Readable
15205         public static final String SMART_SELECTION_UPDATE_METADATA_URL =
15206                 "smart_selection_metadata_url";
15207 
15208         /**
15209          * URL for conversation actions model updates
15210          * @hide
15211          */
15212         @Readable
15213         public static final String CONVERSATION_ACTIONS_UPDATE_CONTENT_URL =
15214                 "conversation_actions_content_url";
15215 
15216         /**
15217          * URL for conversation actions model update metadata
15218          * @hide
15219          */
15220         @Readable
15221         public static final String CONVERSATION_ACTIONS_UPDATE_METADATA_URL =
15222                 "conversation_actions_metadata_url";
15223 
15224         /**
15225          * SELinux enforcement status. If 0, permissive; if 1, enforcing.
15226          * @hide
15227          */
15228         @Readable
15229         public static final String SELINUX_STATUS = "selinux_status";
15230 
15231         /**
15232          * Developer setting to force RTL layout.
15233          * @hide
15234          */
15235         @Readable
15236         public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
15237 
15238         /**
15239          * Milliseconds after screen-off after which low battery sounds will be silenced.
15240          *
15241          * If zero, battery sounds will always play.
15242          * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
15243          *
15244          * @hide
15245          */
15246         @Readable
15247         public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
15248 
15249         /**
15250          * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
15251          * the caller is done with this, they should call {@link ContentResolver#delete} to
15252          * clean up any value that they may have written.
15253          *
15254          * @hide
15255          */
15256         @Readable
15257         public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
15258 
15259         /**
15260          * Defines global runtime overrides to window policy.
15261          *
15262          * See {@link com.android.server.wm.PolicyControl} for value format.
15263          *
15264          * @hide
15265          */
15266         @Readable
15267         public static final String POLICY_CONTROL = "policy_control";
15268 
15269         /**
15270          * {@link android.view.DisplayCutout DisplayCutout} emulation mode.
15271          *
15272          * @hide
15273          */
15274         @Readable
15275         public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout";
15276 
15277         /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0;
15278         /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1;
15279 
15280         /**
15281          * A colon separated list of keys for Settings Slices.
15282          *
15283          * @hide
15284          */
15285         @Readable
15286         public static final String BLOCKED_SLICES = "blocked_slices";
15287 
15288         /**
15289          * Defines global zen mode.  ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
15290          * or ZEN_MODE_NO_INTERRUPTIONS.
15291          *
15292          * @hide
15293          */
15294         @UnsupportedAppUsage
15295         @Readable
15296         public static final String ZEN_MODE = "zen_mode";
15297 
15298         /** @hide */
15299         @UnsupportedAppUsage
15300         public static final int ZEN_MODE_OFF = 0;
15301         /** @hide */
15302         @UnsupportedAppUsage
15303         public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
15304         /** @hide */
15305         @UnsupportedAppUsage
15306         public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
15307         /** @hide */
15308         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
15309         public static final int ZEN_MODE_ALARMS = 3;
15310 
15311         /**
15312          * A comma-separated list of HDR formats that have been disabled by the user.
15313          * <p>
15314          * If present, these formats will not be reported to apps, even if the display supports
15315          * them. This list is treated as empty if the ARE_USER_DISABLED_HDR_FORMATS_ALLOWED setting
15316          * is '1'.
15317          * </p>
15318          * @hide
15319          */
15320         @TestApi
15321         @Readable
15322         @SuppressLint("NoSettingsProvider")
15323         public static final String USER_DISABLED_HDR_FORMATS = "user_disabled_hdr_formats";
15324 
15325         /**
15326          * Whether or not user-disabled HDR formats are allowed.
15327          * <p>
15328          * The value is boolean (1 or 0). The value '1' means the user preference for disabling a
15329          * format is ignored, and the disabled formats are still reported to apps (if supported
15330          * by the display). The value '0' means the user-disabled formats are not reported to
15331          * apps, even if the display supports them.
15332          * </p><p>
15333          * The list of formats disabled by the user are contained in the
15334          * USER_DISABLED_HDR_FORMATS setting. This list is treated as empty when the value of
15335          * this setting is '1'.
15336          * </p>
15337          * @hide
15338          */
15339         @TestApi
15340         @Readable
15341         @SuppressLint("NoSettingsProvider")
15342         public static final String ARE_USER_DISABLED_HDR_FORMATS_ALLOWED =
15343                 "are_user_disabled_hdr_formats_allowed";
15344 
15345         /**
15346          * Whether or not syncs (bulk set operations) for {@link DeviceConfig} are currently
15347          * persistently disabled. This is only used for the {@link
15348          * Config#SYNC_DISABLED_MODE_PERSISTENT persistent} mode, {@link
15349          * Config#SYNC_DISABLED_MODE_UNTIL_REBOOT until_reboot} mode is not stored in settings.
15350          * The value is boolean (1 or 0). The value '1' means that {@link
15351          * DeviceConfig#setProperties(DeviceConfig.Properties)} will return {@code false}.
15352          *
15353          * @hide
15354          */
15355         public static final String DEVICE_CONFIG_SYNC_DISABLED = "device_config_sync_disabled";
15356 
15357 
15358         /**
15359          * Whether back preview animations are played when user does a back gesture or presses
15360          * the back button.
15361          * @hide
15362          */
15363         public static final String ENABLE_BACK_ANIMATION = "enable_back_animation";
15364 
zenModeToString(int mode)15365         /** @hide */ public static String zenModeToString(int mode) {
15366             if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
15367             if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
15368             if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
15369             return "ZEN_MODE_OFF";
15370         }
15371 
isValidZenMode(int value)15372         /** @hide */ public static boolean isValidZenMode(int value) {
15373             switch (value) {
15374                 case Global.ZEN_MODE_OFF:
15375                 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
15376                 case Global.ZEN_MODE_ALARMS:
15377                 case Global.ZEN_MODE_NO_INTERRUPTIONS:
15378                     return true;
15379                 default:
15380                     return false;
15381             }
15382         }
15383 
15384         /**
15385          * Value of the ringer before entering zen mode.
15386          *
15387          * @hide
15388          */
15389         @Readable
15390         public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level";
15391 
15392         /**
15393          * Opaque value, changes when persisted zen mode configuration changes.
15394          *
15395          * @hide
15396          */
15397         @UnsupportedAppUsage
15398         @Readable
15399         public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
15400 
15401         /**
15402          * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION} instead
15403          * @hide
15404          */
15405         @Deprecated
15406         public static final String ZEN_DURATION = "zen_duration";
15407 
15408         /**
15409          * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_PROMPT} instead
15410          * @hide
15411          */
15412         @Deprecated
15413         public static final int ZEN_DURATION_PROMPT = -1;
15414 
15415         /**
15416          * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_FOREVER} instead
15417          * @hide
15418          */
15419         @Deprecated
15420         public static final int ZEN_DURATION_FOREVER = 0;
15421 
15422         /**
15423          * Defines global heads up toggle.  One of HEADS_UP_OFF, HEADS_UP_ON.
15424          *
15425          * @hide
15426          */
15427         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
15428         @Readable
15429         public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
15430                 "heads_up_notifications_enabled";
15431 
15432         /** @hide */
15433         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
15434         public static final int HEADS_UP_OFF = 0;
15435         /** @hide */
15436         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
15437         public static final int HEADS_UP_ON = 1;
15438 
15439         /**
15440          * The refresh rate chosen by the user.
15441          *
15442          * @hide
15443          */
15444         @TestApi
15445         @Readable
15446         @SuppressLint("NoSettingsProvider")
15447         public static final String USER_PREFERRED_REFRESH_RATE = "user_preferred_refresh_rate";
15448 
15449         /**
15450          * The resolution height chosen by the user.
15451          *
15452          * @hide
15453          */
15454         @TestApi
15455         @Readable
15456         @SuppressLint("NoSettingsProvider")
15457         public static final String USER_PREFERRED_RESOLUTION_HEIGHT =
15458                 "user_preferred_resolution_height";
15459 
15460         /**
15461          * The resolution width chosen by the user.
15462          *
15463          * @hide
15464          */
15465         @TestApi
15466         @Readable
15467         @SuppressLint("NoSettingsProvider")
15468         public static final String USER_PREFERRED_RESOLUTION_WIDTH =
15469                 "user_preferred_resolution_width";
15470 
15471         /**
15472          * The name of the device
15473          */
15474         @Readable
15475         public static final String DEVICE_NAME = "device_name";
15476 
15477         /**
15478          * Whether the NetworkScoringService has been first initialized.
15479          * <p>
15480          * Type: int (0 for false, 1 for true)
15481          * @hide
15482          */
15483         @Readable
15484         public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
15485 
15486         /**
15487          * Indicates whether the user wants to be prompted for password to decrypt the device on
15488          * boot. This only matters if the storage is encrypted.
15489          * <p>
15490          * Type: int (0 for false, 1 for true)
15491          *
15492          * @hide
15493          */
15494         @SystemApi
15495         @Readable
15496         public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
15497 
15498         /**
15499          * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config
15500          * value
15501          * {@link android.telephony.CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL}.
15502          * <p>
15503          * Type: int (0 for false, 1 for true)
15504          * @hide
15505          * @deprecated Use
15506          * {@link android.provider.Telephony.SimInfo#COLUMN_ENHANCED_4G_MODE_ENABLED} instead.
15507          */
15508         @Deprecated
15509         @Readable
15510         public static final String ENHANCED_4G_MODE_ENABLED =
15511                 Telephony.SimInfo.COLUMN_ENHANCED_4G_MODE_ENABLED;
15512 
15513         /**
15514          * Whether VT (Video Telephony over IMS) is enabled
15515          * <p>
15516          * Type: int (0 for false, 1 for true)
15517          *
15518          * @hide
15519          * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_VT_IMS_ENABLED} instead.
15520          */
15521         @Deprecated
15522         @Readable
15523         public static final String VT_IMS_ENABLED = Telephony.SimInfo.COLUMN_VT_IMS_ENABLED;
15524 
15525         /**
15526          * Whether WFC is enabled
15527          * <p>
15528          * Type: int (0 for false, 1 for true)
15529          *
15530          * @hide
15531          * @deprecated Use
15532          * {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ENABLED} instead.
15533          */
15534         @Deprecated
15535         @Readable
15536         public static final String WFC_IMS_ENABLED = Telephony.SimInfo.COLUMN_WFC_IMS_ENABLED;
15537 
15538         /**
15539          * WFC mode on home/non-roaming network.
15540          * <p>
15541          * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
15542          *
15543          * @hide
15544          * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_MODE} instead.
15545          */
15546         @Deprecated
15547         @Readable
15548         public static final String WFC_IMS_MODE = Telephony.SimInfo.COLUMN_WFC_IMS_MODE;
15549 
15550         /**
15551          * WFC mode on roaming network.
15552          * <p>
15553          * Type: int - see {@link #WFC_IMS_MODE} for values
15554          *
15555          * @hide
15556          * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ROAMING_MODE}
15557          * instead.
15558          */
15559         @Deprecated
15560         @Readable
15561         public static final String WFC_IMS_ROAMING_MODE =
15562                 Telephony.SimInfo.COLUMN_WFC_IMS_ROAMING_MODE;
15563 
15564         /**
15565          * Whether WFC roaming is enabled
15566          * <p>
15567          * Type: int (0 for false, 1 for true)
15568          *
15569          * @hide
15570          * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ROAMING_ENABLED}
15571          * instead
15572          */
15573         @Deprecated
15574         @Readable
15575         public static final String WFC_IMS_ROAMING_ENABLED =
15576                 Telephony.SimInfo.COLUMN_WFC_IMS_ROAMING_ENABLED;
15577 
15578         /**
15579          * Whether user can enable/disable LTE as a preferred network. A carrier might control
15580          * this via gservices, OMA-DM, carrier app, etc.
15581          * <p>
15582          * Type: int (0 for false, 1 for true)
15583          * @hide
15584          */
15585         @Readable
15586         public static final String LTE_SERVICE_FORCED = "lte_service_forced";
15587 
15588 
15589         /**
15590          * Specifies the behaviour the lid triggers when closed
15591          * <p>
15592          * See WindowManagerPolicy.WindowManagerFuncs
15593          * @hide
15594          */
15595         @Readable
15596         public static final String LID_BEHAVIOR = "lid_behavior";
15597 
15598         /**
15599          * Ephemeral app cookie max size in bytes.
15600          * <p>
15601          * Type: int
15602          * @hide
15603          */
15604         @Readable
15605         public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES =
15606                 "ephemeral_cookie_max_size_bytes";
15607 
15608         /**
15609          * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is
15610          * enabled. Set to zero to disable.
15611          * <p>
15612          * Type: int (0 for false, 1 for true)
15613          *
15614          * @hide
15615          */
15616         @Readable
15617         public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature";
15618 
15619         /**
15620          * Toggle to enable/disable dexopt for instant applications. The default is for dexopt
15621          * to be disabled.
15622          * <p>
15623          * Type: int (0 to disable, 1 to enable)
15624          *
15625          * @hide
15626          */
15627         @Readable
15628         public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled";
15629 
15630         /**
15631          * The min period for caching installed instant apps in milliseconds.
15632          * <p>
15633          * Type: long
15634          * @hide
15635          */
15636         @Readable
15637         public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
15638                 "installed_instant_app_min_cache_period";
15639 
15640         /**
15641          * The max period for caching installed instant apps in milliseconds.
15642          * <p>
15643          * Type: long
15644          * @hide
15645          */
15646         @Readable
15647         public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
15648                 "installed_instant_app_max_cache_period";
15649 
15650         /**
15651          * The min period for caching uninstalled instant apps in milliseconds.
15652          * <p>
15653          * Type: long
15654          * @hide
15655          */
15656         @Readable
15657         public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
15658                 "uninstalled_instant_app_min_cache_period";
15659 
15660         /**
15661          * The max period for caching uninstalled instant apps in milliseconds.
15662          * <p>
15663          * Type: long
15664          * @hide
15665          */
15666         @Readable
15667         public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
15668                 "uninstalled_instant_app_max_cache_period";
15669 
15670         /**
15671          * The min period for caching unused static shared libs in milliseconds.
15672          * <p>
15673          * Type: long
15674          * @hide
15675          */
15676         @Readable
15677         public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD =
15678                 "unused_static_shared_lib_min_cache_period";
15679 
15680         /**
15681          * Allows switching users when system user is locked.
15682          * <p>
15683          * Type: int
15684          * @hide
15685          */
15686         @Readable
15687         public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED =
15688                 "allow_user_switching_when_system_user_locked";
15689 
15690         /**
15691          * Boot count since the device starts running API level 24.
15692          * <p>
15693          * Type: int
15694          */
15695         @Readable
15696         public static final String BOOT_COUNT = "boot_count";
15697 
15698         /**
15699          * Whether the safe boot is disallowed.
15700          *
15701          * <p>This setting should have the identical value as the corresponding user restriction.
15702          * The purpose of the setting is to make the restriction available in early boot stages
15703          * before the user restrictions are loaded.
15704          * @hide
15705          */
15706         @Readable
15707         public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed";
15708 
15709         /**
15710          * Indicates whether this device is currently in retail demo mode. If true, the device
15711          * usage is severely limited.
15712          * <p>
15713          * Type: int (0 for false, 1 for true)
15714          *
15715          * @hide
15716          */
15717         @SystemApi
15718         @Readable
15719         public static final String DEVICE_DEMO_MODE = "device_demo_mode";
15720 
15721         /**
15722          * The reason for the settings database being downgraded. This is only for
15723          * troubleshooting purposes and its value should not be interpreted in any way.
15724          *
15725          * Type: string
15726          *
15727          * @hide
15728          */
15729         @Readable
15730         public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason";
15731 
15732         /**
15733          * The build id of when the settings database was first created (or re-created due it
15734          * being missing).
15735          *
15736          * Type: string
15737          *
15738          * @hide
15739          */
15740         @Readable
15741         public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid";
15742 
15743         /**
15744          * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by
15745          * default. Set to 0 to disable.
15746          *
15747          * @hide
15748          */
15749         @Readable
15750         public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled";
15751 
15752         /**
15753          * Flag to enable the link to location permissions in location setting. Set to 0 to disable.
15754          *
15755          * @hide
15756          */
15757         @Readable
15758         public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED =
15759                 "location_settings_link_to_permissions_enabled";
15760 
15761         /**
15762          * Flag to set the waiting time for removing invisible euicc profiles inside System >
15763          * Settings.
15764          * Type: long
15765          *
15766          * @hide
15767          */
15768         @Readable
15769         public static final String EUICC_REMOVING_INVISIBLE_PROFILES_TIMEOUT_MILLIS =
15770                 "euicc_removing_invisible_profiles_timeout_millis";
15771 
15772         /**
15773          * Flag to set the waiting time for euicc factory reset inside System > Settings
15774          * Type: long
15775          *
15776          * @hide
15777          */
15778         @Readable
15779         public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS =
15780                 "euicc_factory_reset_timeout_millis";
15781 
15782         /**
15783          * Flag to set the waiting time for euicc slot switch.
15784          * Type: long
15785          *
15786          * @hide
15787          */
15788         public static final String EUICC_SWITCH_SLOT_TIMEOUT_MILLIS =
15789                 "euicc_switch_slot_timeout_millis";
15790 
15791         /**
15792          * Flag to set the waiting time for enabling multi SIM slot.
15793          * Type: long
15794          *
15795          * @hide
15796          */
15797         public static final String ENABLE_MULTI_SLOT_TIMEOUT_MILLIS =
15798                 "enable_multi_slot_timeout_millis";
15799 
15800         /**
15801          * Flag to set the timeout for when to refresh the storage settings cached data.
15802          * Type: long
15803          *
15804          * @hide
15805          */
15806         @Readable
15807         public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD =
15808                 "storage_settings_clobber_threshold";
15809 
15810         /**
15811          * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored
15812          * and restoring to lower version of platform API will be skipped.
15813          *
15814          * @hide
15815          */
15816         @Readable
15817         public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION =
15818                 "override_settings_provider_restore_any_version";
15819         /**
15820          * Flag to toggle whether system services report attribution chains when they attribute
15821          * battery use via a {@code WorkSource}.
15822          *
15823          * Type: int (0 to disable, 1 to enable)
15824          *
15825          * @hide
15826          */
15827         @Readable
15828         public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED =
15829                 "chained_battery_attribution_enabled";
15830 
15831         /**
15832          * Toggle to enable/disable the incremental ADB installation by default.
15833          * If not set, default adb installations are incremental; set to zero to use full ones.
15834          * Note: only ADB uses it, no usages in the Framework code.
15835          * <p>
15836          * Type: int (0 to disable, 1 to enable)
15837          *
15838          * @hide
15839          */
15840         @Readable
15841         public static final String ENABLE_ADB_INCREMENTAL_INSTALL_DEFAULT =
15842                 "enable_adb_incremental_install_default";
15843 
15844         /**
15845          * The packages whitelisted to be run in autofill compatibility mode. The list
15846          * of packages is {@code ":"} colon delimited, and each entry has the name of the
15847          * package and an optional list of url bar resource ids (the list is delimited by
15848          * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited).
15849          *
15850          * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where
15851          * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 }
15852          * have 2 ids {@code url_foo} and {@code url_bas}) would be
15853          * {@code p1[url_bar]:p2:p3[url_foo,url_bas]}
15854          *
15855          * @hide
15856          * @deprecated Use {@link android.view.autofill.AutofillManager
15857          * #DEVICE_CONFIG_AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES} instead.
15858          */
15859         @Deprecated
15860         @SystemApi
15861         @Readable
15862         public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES =
15863                 "autofill_compat_mode_allowed_packages";
15864 
15865         /**
15866          * Level of autofill logging.
15867          *
15868          * <p>Valid values are
15869          * {@link android.view.autofill.AutofillManager#NO_LOGGING},
15870          * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_DEBUG}, or
15871          * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_VERBOSE}.
15872          *
15873          * @hide
15874          */
15875         @Readable
15876         public static final String AUTOFILL_LOGGING_LEVEL = "autofill_logging_level";
15877 
15878         /**
15879          * Maximum number of partitions that can be allowed in an autofill session.
15880          *
15881          * @hide
15882          */
15883         @Readable
15884         public static final String AUTOFILL_MAX_PARTITIONS_SIZE = "autofill_max_partitions_size";
15885 
15886         /**
15887          * Maximum number of visible datasets in the Autofill dataset picker UI, or {@code 0} to use
15888          * the default value from resources.
15889          *
15890          * @hide
15891          */
15892         @Readable
15893         public static final String AUTOFILL_MAX_VISIBLE_DATASETS = "autofill_max_visible_datasets";
15894 
15895         /**
15896          * Toggle for enabling stylus handwriting. When enabled, current Input method receives
15897          * stylus {@link MotionEvent}s if an {@link Editor} is focused.
15898          *
15899          * @hide
15900          */
15901         @TestApi
15902         @Readable
15903         @SuppressLint("NoSettingsProvider")
15904         public static final String STYLUS_HANDWRITING_ENABLED = "stylus_handwriting_enabled";
15905 
15906         /**
15907          * Indicates whether a stylus has ever been used on the device.
15908          *
15909          * @hide
15910          */
15911         @Readable
15912         @SuppressLint("NoSettingsProvider")
15913         public static final String STYLUS_EVER_USED = "stylus_ever_used";
15914 
15915         /**
15916          * Exemptions to the hidden API blacklist.
15917          *
15918          * @hide
15919          */
15920         @TestApi
15921         @Readable
15922         public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS =
15923                 "hidden_api_blacklist_exemptions";
15924 
15925         /**
15926          * Hidden API enforcement policy for apps.
15927          *
15928          * Values correspond to @{@link
15929          * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy}
15930          *
15931          * @hide
15932          */
15933         @TestApi
15934         @Readable
15935         public static final String HIDDEN_API_POLICY = "hidden_api_policy";
15936 
15937         /**
15938          * Flag for forcing {@link com.android.server.compat.OverrideValidatorImpl}
15939          * to consider this a non-debuggable build.
15940          *
15941          * @hide
15942          */
15943         public static final String FORCE_NON_DEBUGGABLE_FINAL_BUILD_FOR_COMPAT =
15944                 "force_non_debuggable_final_build_for_compat";
15945 
15946 
15947         /**
15948          * Current version of signed configuration applied.
15949          *
15950          * @hide
15951          */
15952         @Readable
15953         public static final String SIGNED_CONFIG_VERSION = "signed_config_version";
15954 
15955         /**
15956          * Timeout for a single {@link android.media.soundtrigger.SoundTriggerDetectionService}
15957          * operation (in ms).
15958          *
15959          * @hide
15960          */
15961         @Readable
15962         public static final String SOUND_TRIGGER_DETECTION_SERVICE_OP_TIMEOUT =
15963                 "sound_trigger_detection_service_op_timeout";
15964 
15965         /**
15966          * Maximum number of {@link android.media.soundtrigger.SoundTriggerDetectionService}
15967          * operations per day.
15968          *
15969          * @hide
15970          */
15971         @Readable
15972         public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY =
15973                 "max_sound_trigger_detection_service_ops_per_day";
15974 
15975         /**
15976          * Setting to determine if the Clockwork Home application is ready.
15977          *
15978          * <p>
15979          * Set to 1 when the Clockwork Home application has finished starting up.
15980          * </p>
15981          *
15982          * @hide
15983          */
15984         public static final String CLOCKWORK_HOME_READY = "clockwork_home_ready";
15985 
15986         /**
15987          * Indicates whether aware is available in the current location.
15988          * @hide
15989          */
15990         @Readable
15991         public static final String AWARE_ALLOWED = "aware_allowed";
15992 
15993         /**
15994          * Overrides internal R.integer.config_longPressOnPowerBehavior.
15995          * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
15996          * Used by PhoneWindowManager.
15997          * @hide
15998          */
15999         @Readable
16000         public static final String POWER_BUTTON_LONG_PRESS =
16001                 "power_button_long_press";
16002 
16003         /**
16004          * Override internal R.integer.config_longPressOnPowerDurationMs. It determines the length
16005          * of power button press to be considered a long press in milliseconds.
16006          * Used by PhoneWindowManager.
16007          * @hide
16008          */
16009         @Readable
16010         public static final String POWER_BUTTON_LONG_PRESS_DURATION_MS =
16011                 "power_button_long_press_duration_ms";
16012 
16013         /**
16014          * Overrides internal R.integer.config_veryLongPressOnPowerBehavior.
16015          * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
16016          * Used by PhoneWindowManager.
16017          * @hide
16018          */
16019         @Readable
16020         public static final String POWER_BUTTON_VERY_LONG_PRESS =
16021                 "power_button_very_long_press";
16022 
16023         /**
16024          * Overrides internal R.integer.config_keyChordPowerVolumeUp.
16025          * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
16026          * Used by PhoneWindowManager.
16027          * @hide
16028          */
16029         @Readable
16030         public static final String KEY_CHORD_POWER_VOLUME_UP =
16031                 "key_chord_power_volume_up";
16032 
16033         /**
16034          * Keyguard should be on the left hand side of the screen, for wide screen layouts.
16035          *
16036          * @hide
16037          */
16038         public static final int ONE_HANDED_KEYGUARD_SIDE_LEFT = 0;
16039 
16040         /**
16041          * Keyguard should be on the right hand side of the screen, for wide screen layouts.
16042          *
16043          * @hide
16044          */
16045         public static final int ONE_HANDED_KEYGUARD_SIDE_RIGHT = 1;
16046         /**
16047          * In one handed mode, which side the keyguard should be on. Allowable values are one of
16048          * the ONE_HANDED_KEYGUARD_SIDE_* constants.
16049          *
16050          * @hide
16051          */
16052         public static final String ONE_HANDED_KEYGUARD_SIDE = "one_handed_keyguard_side";
16053 
16054         /**
16055          * Global settings that shouldn't be persisted.
16056          *
16057          * @hide
16058          */
16059         public static final String[] TRANSIENT_SETTINGS = {
16060                 CLOCKWORK_HOME_READY,
16061         };
16062 
16063         /**
16064          * Keys we no longer back up under the current schema, but want to continue to
16065          * process when restoring historical backup datasets.
16066          *
16067          * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
16068          * otherwise they won't be restored.
16069          *
16070          * @hide
16071          */
16072         public static final String[] LEGACY_RESTORE_SETTINGS = {
16073         };
16074 
16075         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
16076         private static final ContentProviderHolder sProviderHolder =
16077                 new ContentProviderHolder(CONTENT_URI);
16078 
16079         // Populated lazily, guarded by class object:
16080         @UnsupportedAppUsage
16081         private static final NameValueCache sNameValueCache = new NameValueCache(
16082                     CONTENT_URI,
16083                     CALL_METHOD_GET_GLOBAL,
16084                     CALL_METHOD_PUT_GLOBAL,
16085                     CALL_METHOD_DELETE_GLOBAL,
16086                     sProviderHolder,
16087                     Global.class);
16088 
16089         // Certain settings have been moved from global to the per-user secure namespace
16090         @UnsupportedAppUsage
16091         private static final HashSet<String> MOVED_TO_SECURE;
16092         static {
16093             MOVED_TO_SECURE = new HashSet<>(8);
16094             MOVED_TO_SECURE.add(Global.INSTALL_NON_MARKET_APPS);
16095             MOVED_TO_SECURE.add(Global.ZEN_DURATION);
16096             MOVED_TO_SECURE.add(Global.SHOW_ZEN_UPGRADE_NOTIFICATION);
16097             MOVED_TO_SECURE.add(Global.SHOW_ZEN_SETTINGS_SUGGESTION);
16098             MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_UPDATED);
16099             MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_SUGGESTION_VIEWED);
16100             MOVED_TO_SECURE.add(Global.CHARGING_SOUNDS_ENABLED);
16101             MOVED_TO_SECURE.add(Global.CHARGING_VIBRATION_ENABLED);
16102             MOVED_TO_SECURE.add(Global.NOTIFICATION_BUBBLES);
16103         }
16104 
16105         // Certain settings have been moved from global to the per-user system namespace
16106         private static final HashSet<String> MOVED_TO_SYSTEM;
16107         static {
16108             MOVED_TO_SYSTEM = new HashSet<>(1);
16109             MOVED_TO_SYSTEM.add(Global.APPLY_RAMPING_RINGER);
16110         }
16111 
16112         /** @hide */
getMovedToSecureSettings(Set<String> outKeySet)16113         public static void getMovedToSecureSettings(Set<String> outKeySet) {
16114             outKeySet.addAll(MOVED_TO_SECURE);
16115         }
16116 
16117         /** @hide */
getMovedToSystemSettings(Set<String> outKeySet)16118         public static void getMovedToSystemSettings(Set<String> outKeySet) {
16119             outKeySet.addAll(MOVED_TO_SYSTEM);
16120         }
16121 
16122         /** @hide */
clearProviderForTest()16123         public static void clearProviderForTest() {
16124             sProviderHolder.clearProviderForTest();
16125             sNameValueCache.clearGenerationTrackerForTest();
16126         }
16127 
16128         /** @hide */
getPublicSettings(Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> readableKeysWithMaxTargetSdk)16129         public static void getPublicSettings(Set<String> allKeys, Set<String> readableKeys,
16130                 ArrayMap<String, Integer> readableKeysWithMaxTargetSdk) {
16131             getPublicSettingsForClass(Global.class, allKeys, readableKeys,
16132                     readableKeysWithMaxTargetSdk);
16133         }
16134 
16135         /**
16136          * Look up a name in the database.
16137          * @param resolver to access the database with
16138          * @param name to look up in the table
16139          * @return the corresponding value, or null if not present
16140          */
getString(ContentResolver resolver, String name)16141         public static String getString(ContentResolver resolver, String name) {
16142             return getStringForUser(resolver, name, resolver.getUserId());
16143         }
16144 
16145         /** @hide */
16146         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
getStringForUser(ContentResolver resolver, String name, int userHandle)16147         public static String getStringForUser(ContentResolver resolver, String name,
16148                 int userHandle) {
16149             if (MOVED_TO_SECURE.contains(name)) {
16150                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
16151                         + " to android.provider.Settings.Secure, returning read-only value.");
16152                 return Secure.getStringForUser(resolver, name, userHandle);
16153             }
16154             if (MOVED_TO_SYSTEM.contains(name)) {
16155                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
16156                         + " to android.provider.Settings.System, returning read-only value.");
16157                 return System.getStringForUser(resolver, name, userHandle);
16158             }
16159             return sNameValueCache.getStringForUser(resolver, name, userHandle);
16160         }
16161 
16162         /**
16163          * Store a name/value pair into the database.
16164          * @param resolver to access the database with
16165          * @param name to store
16166          * @param value to associate with the name
16167          * @return true if the value was set, false on database errors
16168          */
putString(ContentResolver resolver, String name, String value)16169         public static boolean putString(ContentResolver resolver,
16170                 String name, String value) {
16171             return putStringForUser(resolver, name, value, null, false, resolver.getUserId(),
16172                     DEFAULT_OVERRIDEABLE_BY_RESTORE);
16173         }
16174 
16175         /**
16176          * Store a name/value pair into the database.
16177          *
16178          * @param resolver to access the database with
16179          * @param name to store
16180          * @param value to associate with the name
16181          * @param tag to associated with the setting.
16182          * @param makeDefault whether to make the value the default one.
16183          * @param overrideableByRestore whether restore can override this value
16184          * @return true if the value was set, false on database errors
16185          *
16186          * @hide
16187          */
16188         @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, boolean overrideableByRestore)16189         public static boolean putString(@NonNull ContentResolver resolver,
16190                 @NonNull String name, @Nullable String value, @Nullable String tag,
16191                 boolean makeDefault, boolean overrideableByRestore) {
16192             return putStringForUser(resolver, name, value, tag, makeDefault,
16193                     resolver.getUserId(), overrideableByRestore);
16194         }
16195 
16196         /**
16197          * Store a name/value pair into the database.
16198          * <p>
16199          * The method takes an optional tag to associate with the setting
16200          * which can be used to clear only settings made by your package and
16201          * associated with this tag by passing the tag to {@link
16202          * #resetToDefaults(ContentResolver, String)}. Anyone can override
16203          * the current tag. Also if another package changes the setting
16204          * then the tag will be set to the one specified in the set call
16205          * which can be null. Also any of the settings setters that do not
16206          * take a tag as an argument effectively clears the tag.
16207          * </p><p>
16208          * For example, if you set settings A and B with tags T1 and T2 and
16209          * another app changes setting A (potentially to the same value), it
16210          * can assign to it a tag T3 (note that now the package that changed
16211          * the setting is not yours). Now if you reset your changes for T1 and
16212          * T2 only setting B will be reset and A not (as it was changed by
16213          * another package) but since A did not change you are in the desired
16214          * initial state. Now if the other app changes the value of A (assuming
16215          * you registered an observer in the beginning) you would detect that
16216          * the setting was changed by another app and handle this appropriately
16217          * (ignore, set back to some value, etc).
16218          * </p><p>
16219          * Also the method takes an argument whether to make the value the
16220          * default for this setting. If the system already specified a default
16221          * value, then the one passed in here will <strong>not</strong>
16222          * be set as the default.
16223          * </p>
16224          *
16225          * @param resolver to access the database with.
16226          * @param name to store.
16227          * @param value to associate with the name.
16228          * @param tag to associated with the setting.
16229          * @param makeDefault whether to make the value the default one.
16230          * @return true if the value was set, false on database errors.
16231          *
16232          * @see #resetToDefaults(ContentResolver, String)
16233          *
16234          * @hide
16235          */
16236         @SystemApi
16237         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)16238         public static boolean putString(@NonNull ContentResolver resolver,
16239                 @NonNull String name, @Nullable String value, @Nullable String tag,
16240                 boolean makeDefault) {
16241             return putStringForUser(resolver, name, value, tag, makeDefault,
16242                     resolver.getUserId(), DEFAULT_OVERRIDEABLE_BY_RESTORE);
16243         }
16244 
16245         /**
16246          * Reset the settings to their defaults. This would reset <strong>only</strong>
16247          * settings set by the caller's package. Think of it of a way to undo your own
16248          * changes to the secure settings. Passing in the optional tag will reset only
16249          * settings changed by your package and associated with this tag.
16250          *
16251          * @param resolver Handle to the content resolver.
16252          * @param tag Optional tag which should be associated with the settings to reset.
16253          *
16254          * @see #putString(ContentResolver, String, String, String, boolean)
16255          *
16256          * @hide
16257          */
16258         @SystemApi
16259         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)16260         public static void resetToDefaults(@NonNull ContentResolver resolver,
16261                 @Nullable String tag) {
16262             resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
16263                     resolver.getUserId());
16264         }
16265 
16266         /**
16267          * Reset the settings to their defaults for a given user with a specific mode. The
16268          * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
16269          * allowing resetting the settings made by a package and associated with the tag.
16270          *
16271          * @param resolver Handle to the content resolver.
16272          * @param tag Optional tag which should be associated with the settings to reset.
16273          * @param mode The reset mode.
16274          * @param userHandle The user for which to reset to defaults.
16275          *
16276          * @see #RESET_MODE_PACKAGE_DEFAULTS
16277          * @see #RESET_MODE_UNTRUSTED_DEFAULTS
16278          * @see #RESET_MODE_UNTRUSTED_CHANGES
16279          * @see #RESET_MODE_TRUSTED_DEFAULTS
16280          *
16281          * @hide
16282          */
resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)16283         public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
16284                 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
16285             try {
16286                 Bundle arg = new Bundle();
16287                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
16288                 if (tag != null) {
16289                     arg.putString(CALL_METHOD_TAG_KEY, tag);
16290                 }
16291                 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
16292                 IContentProvider cp = sProviderHolder.getProvider(resolver);
16293                 cp.call(resolver.getAttributionSource(),
16294                         sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_GLOBAL, null, arg);
16295             } catch (RemoteException e) {
16296                 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
16297             }
16298         }
16299 
16300         /** @hide */
16301         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)16302         public static boolean putStringForUser(ContentResolver resolver,
16303                 String name, String value, int userHandle) {
16304             return putStringForUser(resolver, name, value, null, false, userHandle,
16305                     DEFAULT_OVERRIDEABLE_BY_RESTORE);
16306         }
16307 
16308         /** @hide */
putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore)16309         public static boolean putStringForUser(@NonNull ContentResolver resolver,
16310                 @NonNull String name, @Nullable String value, @Nullable String tag,
16311                 boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore) {
16312             if (LOCAL_LOGV) {
16313                 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
16314                         + " for " + userHandle);
16315             }
16316             // Global and Secure have the same access policy so we can forward writes
16317             if (MOVED_TO_SECURE.contains(name)) {
16318                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
16319                         + " to android.provider.Settings.Secure, value is unchanged.");
16320                 return Secure.putStringForUser(resolver, name, value, tag,
16321                         makeDefault, userHandle, overrideableByRestore);
16322             }
16323             // Global and System have the same access policy so we can forward writes
16324             if (MOVED_TO_SYSTEM.contains(name)) {
16325                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
16326                         + " to android.provider.Settings.System, value is unchanged.");
16327                 return System.putStringForUser(resolver, name, value, tag,
16328                         makeDefault, userHandle, overrideableByRestore);
16329             }
16330             return sNameValueCache.putStringForUser(resolver, name, value, tag,
16331                     makeDefault, userHandle, overrideableByRestore);
16332         }
16333 
16334         /**
16335          * Construct the content URI for a particular name/value pair,
16336          * useful for monitoring changes with a ContentObserver.
16337          * @param name to look up in the table
16338          * @return the corresponding content URI, or null if not present
16339          */
getUriFor(String name)16340         public static Uri getUriFor(String name) {
16341             return getUriFor(CONTENT_URI, name);
16342         }
16343 
16344         /**
16345          * Convenience function for retrieving a single secure settings value
16346          * as an integer.  Note that internally setting values are always
16347          * stored as strings; this function converts the string to an integer
16348          * for you.  The default value will be returned if the setting is
16349          * not defined or not an integer.
16350          *
16351          * @param cr The ContentResolver to access.
16352          * @param name The name of the setting to retrieve.
16353          * @param def Value to return if the setting is not defined.
16354          *
16355          * @return The setting's current value, or 'def' if it is not defined
16356          * or not a valid integer.
16357          */
getInt(ContentResolver cr, String name, int def)16358         public static int getInt(ContentResolver cr, String name, int def) {
16359             String v = getString(cr, name);
16360             return parseIntSettingWithDefault(v, def);
16361         }
16362 
16363         /**
16364          * Convenience function for retrieving a single secure settings value
16365          * as an integer.  Note that internally setting values are always
16366          * stored as strings; this function converts the string to an integer
16367          * for you.
16368          * <p>
16369          * This version does not take a default value.  If the setting has not
16370          * been set, or the string value is not a number,
16371          * it throws {@link SettingNotFoundException}.
16372          *
16373          * @param cr The ContentResolver to access.
16374          * @param name The name of the setting to retrieve.
16375          *
16376          * @throws SettingNotFoundException Thrown if a setting by the given
16377          * name can't be found or the setting value is not an integer.
16378          *
16379          * @return The setting's current value.
16380          */
getInt(ContentResolver cr, String name)16381         public static int getInt(ContentResolver cr, String name)
16382                 throws SettingNotFoundException {
16383             String v = getString(cr, name);
16384             return parseIntSetting(v, name);
16385         }
16386 
16387         /**
16388          * Convenience function for updating a single settings value as an
16389          * integer. This will either create a new entry in the table if the
16390          * given name does not exist, or modify the value of the existing row
16391          * with that name.  Note that internally setting values are always
16392          * stored as strings, so this function converts the given value to a
16393          * string before storing it.
16394          *
16395          * @param cr The ContentResolver to access.
16396          * @param name The name of the setting to modify.
16397          * @param value The new value for the setting.
16398          * @return true if the value was set, false on database errors
16399          */
putInt(ContentResolver cr, String name, int value)16400         public static boolean putInt(ContentResolver cr, String name, int value) {
16401             return putString(cr, name, Integer.toString(value));
16402         }
16403 
16404         /**
16405          * Convenience function for retrieving a single secure settings value
16406          * as a {@code long}.  Note that internally setting values are always
16407          * stored as strings; this function converts the string to a {@code long}
16408          * for you.  The default value will be returned if the setting is
16409          * not defined or not a {@code long}.
16410          *
16411          * @param cr The ContentResolver to access.
16412          * @param name The name of the setting to retrieve.
16413          * @param def Value to return if the setting is not defined.
16414          *
16415          * @return The setting's current value, or 'def' if it is not defined
16416          * or not a valid {@code long}.
16417          */
getLong(ContentResolver cr, String name, long def)16418         public static long getLong(ContentResolver cr, String name, long def) {
16419             String v = getString(cr, name);
16420             return parseLongSettingWithDefault(v, def);
16421         }
16422 
16423         /**
16424          * Convenience function for retrieving a single secure settings value
16425          * as a {@code long}.  Note that internally setting values are always
16426          * stored as strings; this function converts the string to a {@code long}
16427          * for you.
16428          * <p>
16429          * This version does not take a default value.  If the setting has not
16430          * been set, or the string value is not a number,
16431          * it throws {@link SettingNotFoundException}.
16432          *
16433          * @param cr The ContentResolver to access.
16434          * @param name The name of the setting to retrieve.
16435          *
16436          * @return The setting's current value.
16437          * @throws SettingNotFoundException Thrown if a setting by the given
16438          * name can't be found or the setting value is not an integer.
16439          */
getLong(ContentResolver cr, String name)16440         public static long getLong(ContentResolver cr, String name)
16441                 throws SettingNotFoundException {
16442             String v = getString(cr, name);
16443             return parseLongSetting(v, name);
16444         }
16445 
16446         /**
16447          * Convenience function for updating a secure settings value as a long
16448          * integer. This will either create a new entry in the table if the
16449          * given name does not exist, or modify the value of the existing row
16450          * with that name.  Note that internally setting values are always
16451          * stored as strings, so this function converts the given value to a
16452          * string before storing it.
16453          *
16454          * @param cr The ContentResolver to access.
16455          * @param name The name of the setting to modify.
16456          * @param value The new value for the setting.
16457          * @return true if the value was set, false on database errors
16458          */
putLong(ContentResolver cr, String name, long value)16459         public static boolean putLong(ContentResolver cr, String name, long value) {
16460             return putString(cr, name, Long.toString(value));
16461         }
16462 
16463         /**
16464          * Convenience function for retrieving a single secure settings value
16465          * as a floating point number.  Note that internally setting values are
16466          * always stored as strings; this function converts the string to an
16467          * float for you. The default value will be returned if the setting
16468          * is not defined or not a valid float.
16469          *
16470          * @param cr The ContentResolver to access.
16471          * @param name The name of the setting to retrieve.
16472          * @param def Value to return if the setting is not defined.
16473          *
16474          * @return The setting's current value, or 'def' if it is not defined
16475          * or not a valid float.
16476          */
getFloat(ContentResolver cr, String name, float def)16477         public static float getFloat(ContentResolver cr, String name, float def) {
16478             String v = getString(cr, name);
16479             return parseFloatSettingWithDefault(v, def);
16480         }
16481 
16482         /**
16483          * Convenience function for retrieving a single secure settings value
16484          * as a float.  Note that internally setting values are always
16485          * stored as strings; this function converts the string to a float
16486          * for you.
16487          * <p>
16488          * This version does not take a default value.  If the setting has not
16489          * been set, or the string value is not a number,
16490          * it throws {@link SettingNotFoundException}.
16491          *
16492          * @param cr The ContentResolver to access.
16493          * @param name The name of the setting to retrieve.
16494          *
16495          * @throws SettingNotFoundException Thrown if a setting by the given
16496          * name can't be found or the setting value is not a float.
16497          *
16498          * @return The setting's current value.
16499          */
getFloat(ContentResolver cr, String name)16500         public static float getFloat(ContentResolver cr, String name)
16501                 throws SettingNotFoundException {
16502             String v = getString(cr, name);
16503             return parseFloatSetting(v, name);
16504         }
16505 
16506         /**
16507          * Convenience function for updating a single settings value as a
16508          * floating point number. This will either create a new entry in the
16509          * table if the given name does not exist, or modify the value of the
16510          * existing row with that name.  Note that internally setting values
16511          * are always stored as strings, so this function converts the given
16512          * value to a string before storing it.
16513          *
16514          * @param cr The ContentResolver to access.
16515          * @param name The name of the setting to modify.
16516          * @param value The new value for the setting.
16517          * @return true if the value was set, false on database errors
16518          */
putFloat(ContentResolver cr, String name, float value)16519         public static boolean putFloat(ContentResolver cr, String name, float value) {
16520             return putString(cr, name, Float.toString(value));
16521         }
16522 
16523         /**
16524           * Subscription Id to be used for voice call on a multi sim device.
16525           * @hide
16526           */
16527         @Readable
16528         public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
16529 
16530         /**
16531           * Used to provide option to user to select subscription during dial.
16532           * The supported values are 0 = disable or 1 = enable prompt.
16533           * @hide
16534           */
16535         @UnsupportedAppUsage
16536         @Readable
16537         public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
16538 
16539         /**
16540           * Subscription Id to be used for data call on a multi sim device.
16541           * @hide
16542           */
16543         @Readable
16544         public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
16545 
16546         /**
16547           * Subscription Id to be used for SMS on a multi sim device.
16548           * @hide
16549           */
16550         @Readable
16551         public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
16552 
16553         /**
16554           * Used to provide option to user to select subscription during send SMS.
16555           * The value 1 - enable, 0 - disable
16556           * @hide
16557           */
16558         @Readable
16559         public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
16560 
16561         /** User preferred subscriptions setting.
16562           * This holds the details of the user selected subscription from the card and
16563           * the activation status. Each settings string have the comma separated values
16564           * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
16565           * @hide
16566          */
16567         @UnsupportedAppUsage
16568         @Readable
16569         public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
16570                 "user_preferred_sub2","user_preferred_sub3"};
16571 
16572         /**
16573          * Which subscription is enabled for a physical slot.
16574          * @hide
16575          */
16576         @Readable
16577         public static final String ENABLED_SUBSCRIPTION_FOR_SLOT = "enabled_subscription_for_slot";
16578 
16579         /**
16580          * Whether corresponding logical modem is enabled for a physical slot.
16581          * The value 1 - enable, 0 - disable
16582          * @hide
16583          */
16584         @Readable
16585         public static final String MODEM_STACK_ENABLED_FOR_SLOT = "modem_stack_enabled_for_slot";
16586 
16587         /**
16588          * Whether to enable new contacts aggregator or not.
16589          * The value 1 - enable, 0 - disable
16590          * @hide
16591          */
16592         @Readable
16593         public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
16594 
16595         /**
16596          * Whether to enable contacts metadata syncing or not
16597          * The value 1 - enable, 0 - disable
16598          *
16599          * @removed
16600          */
16601         @Deprecated
16602         @Readable
16603         public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
16604 
16605         /**
16606          * Whether to enable contacts metadata syncing or not
16607          * The value 1 - enable, 0 - disable
16608          */
16609         @Readable
16610         public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled";
16611 
16612         /**
16613          * Whether to enable cellular on boot.
16614          * The value 1 - enable, 0 - disable
16615          * @hide
16616          */
16617         @Readable
16618         public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot";
16619 
16620         /**
16621          * The maximum allowed notification enqueue rate in Hertz.
16622          *
16623          * Should be a float, and includes updates only.
16624          * @hide
16625          */
16626         @Readable
16627         public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate";
16628 
16629         /**
16630          * Displays toasts when an app posts a notification that does not specify a valid channel.
16631          *
16632          * The value 1 - enable, 0 - disable
16633          * @hide
16634          */
16635         @Readable
16636         public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS =
16637                 "show_notification_channel_warnings";
16638 
16639         /**
16640          * Whether cell is enabled/disabled
16641          * @hide
16642          */
16643         @Readable
16644         public static final String CELL_ON = "cell_on";
16645 
16646         /**
16647          * Global settings which can be accessed by instant apps.
16648          * @hide
16649          */
16650         public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
16651         static {
16652             INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER);
16653             INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED);
16654             INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES);
16655             INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL);
16656             INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES);
16657             INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON);
16658             INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE);
16659             INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE);
16660             INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE);
16661             INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES);
16662             INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE);
16663             INSTANT_APP_SETTINGS.add(WTF_IS_FATAL);
16664             INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR);
16665             INSTANT_APP_SETTINGS.add(ZEN_MODE);
16666         }
16667 
16668         /**
16669          * Whether to show the high temperature warning notification.
16670          * @hide
16671          */
16672         @Readable
16673         public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning";
16674 
16675         /**
16676          * Whether to show the usb high temperature alarm notification.
16677          * @hide
16678          */
16679         @Readable
16680         public static final String SHOW_USB_TEMPERATURE_ALARM = "show_usb_temperature_alarm";
16681 
16682         /**
16683          * Temperature at which the high temperature warning notification should be shown.
16684          * @hide
16685          */
16686         @Readable
16687         public static final String WARNING_TEMPERATURE = "warning_temperature";
16688 
16689         /**
16690          * Whether the diskstats logging task is enabled/disabled.
16691          * @hide
16692          */
16693         @Readable
16694         public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging";
16695 
16696         /**
16697          * Whether the cache quota calculation task is enabled/disabled.
16698          * @hide
16699          */
16700         @Readable
16701         public static final String ENABLE_CACHE_QUOTA_CALCULATION =
16702                 "enable_cache_quota_calculation";
16703 
16704         /**
16705          * Whether the Deletion Helper no threshold toggle is available.
16706          * @hide
16707          */
16708         @Readable
16709         public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE =
16710                 "enable_deletion_helper_no_threshold_toggle";
16711 
16712         /**
16713          * The list of snooze options for notifications
16714          * This is encoded as a key=value list, separated by commas. Ex:
16715          *
16716          * "default=60,options_array=15:30:60:120"
16717          *
16718          * The following keys are supported:
16719          *
16720          * <pre>
16721          * default               (int)
16722          * options_array         (int[])
16723          * </pre>
16724          *
16725          * All delays in integer minutes. Array order is respected.
16726          * Options will be used in order up to the maximum allowed by the UI.
16727          * @hide
16728          */
16729         @Readable
16730         public static final String NOTIFICATION_SNOOZE_OPTIONS =
16731                 "notification_snooze_options";
16732 
16733         /**
16734          * When enabled, notifications the notification assistant service has modified will show an
16735          * indicator. When tapped, this indicator will describe the adjustment made and solicit
16736          * feedback. This flag will also add a "automatic" option to the long press menu.
16737          *
16738          * The value 1 - enable, 0 - disable
16739          * @hide
16740          */
16741         public static final String NOTIFICATION_FEEDBACK_ENABLED = "notification_feedback_enabled";
16742 
16743         /**
16744          * Settings key for the ratio of notification dismissals to notification views - one of the
16745          * criteria for showing the notification blocking helper.
16746          *
16747          * <p>The value is a float ranging from 0.0 to 1.0 (the closer to 0.0, the more intrusive
16748          * the blocking helper will be).
16749          *
16750          * @hide
16751          */
16752         @Readable
16753         public static final String BLOCKING_HELPER_DISMISS_TO_VIEW_RATIO_LIMIT =
16754                 "blocking_helper_dismiss_to_view_ratio";
16755 
16756         /**
16757          * Settings key for the longest streak of dismissals  - one of the criteria for showing the
16758          * notification blocking helper.
16759          *
16760          * <p>The value is an integer greater than 0.
16761          *
16762          * @hide
16763          */
16764         @Readable
16765         public static final String BLOCKING_HELPER_STREAK_LIMIT = "blocking_helper_streak_limit";
16766 
16767         /**
16768          * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated
16769          * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF
16770          *
16771          * Supported keys:<br/>
16772          * <li>
16773          * <ul> {@code legacy_compatibility_wal_enabled} : A {code boolean} flag that determines
16774          * whether or not "compatibility WAL" mode is enabled by default. This is a legacy flag
16775          * and is honoured on Android Q and higher. This flag will be removed in a future release.
16776          * </ul>
16777          * <ul> {@code wal_syncmode} : A {@code String} representing the synchronization mode to use
16778          * when WAL is enabled, either via {@code legacy_compatibility_wal_enabled} or using the
16779          * obsolete {@code compatibility_wal_supported} flag.
16780          * </ul>
16781          * <ul> {@code truncate_size} : A {@code int} flag that specifies the truncate size of the
16782          * WAL journal.
16783          * </ul>
16784          * <ul> {@code compatibility_wal_supported} : A {code boolean} flag that specifies whether
16785          * the legacy "compatibility WAL" mode is enabled by default. This flag is obsolete and is
16786          * only supported on Android Pie.
16787          * </ul>
16788          * </li>
16789          *
16790          * @hide
16791          */
16792         @Readable
16793         public static final String SQLITE_COMPATIBILITY_WAL_FLAGS =
16794                 "sqlite_compatibility_wal_flags";
16795 
16796         /**
16797          * Enable GNSS Raw Measurements Full Tracking?
16798          * 0 = no
16799          * 1 = yes
16800          * @hide
16801          */
16802         @Readable
16803         public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING =
16804                 "enable_gnss_raw_meas_full_tracking";
16805 
16806         /**
16807          * Whether the notification should be ongoing (persistent) when a carrier app install is
16808          * required.
16809          *
16810          * The value is a boolean (1 or 0).
16811          * @hide
16812          */
16813         @SystemApi
16814         @Readable
16815         public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT =
16816                 "install_carrier_app_notification_persistent";
16817 
16818         /**
16819          * The amount of time (ms) to hide the install carrier app notification after the user has
16820          * ignored it. After this time passes, the notification will be shown again
16821          *
16822          * The value is a long
16823          * @hide
16824          */
16825         @SystemApi
16826         @Readable
16827         public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS =
16828                 "install_carrier_app_notification_sleep_millis";
16829 
16830         /**
16831          * Whether we've enabled zram on this device. Takes effect on
16832          * reboot. The value "1" enables zram; "0" disables it, and
16833          * everything else is unspecified.
16834          * @hide
16835          */
16836         @Readable
16837         public static final String ZRAM_ENABLED =
16838                 "zram_enabled";
16839 
16840         /**
16841          * Whether the app freezer is enabled on this device.
16842          * The value of "enabled" enables the app freezer, "disabled" disables it and
16843          * "device_default" will let the system decide whether to enable the freezer or not
16844          * @hide
16845          */
16846         @Readable
16847         public static final String CACHED_APPS_FREEZER_ENABLED = "cached_apps_freezer";
16848 
16849         /**
16850          * Configuration flags for smart replies in notifications.
16851          * This is encoded as a key=value list, separated by commas. Ex:
16852          *
16853          * "enabled=1,max_squeeze_remeasure_count=3"
16854          *
16855          * The following keys are supported:
16856          *
16857          * <pre>
16858          * enabled                           (boolean)
16859          * requires_targeting_p              (boolean)
16860          * max_squeeze_remeasure_attempts    (int)
16861          * edit_choices_before_sending       (boolean)
16862          * show_in_heads_up                  (boolean)
16863          * min_num_system_generated_replies  (int)
16864          * max_num_actions                   (int)
16865          * </pre>
16866          * @see com.android.systemui.statusbar.policy.SmartReplyConstants
16867          * @hide
16868          */
16869         @Readable
16870         public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS =
16871                 "smart_replies_in_notifications_flags";
16872 
16873         /**
16874          * Configuration flags for the automatic generation of smart replies and smart actions in
16875          * notifications. This is encoded as a key=value list, separated by commas. Ex:
16876          * "generate_replies=false,generate_actions=true".
16877          *
16878          * The following keys are supported:
16879          *
16880          * <pre>
16881          * generate_replies                 (boolean)
16882          * generate_actions                 (boolean)
16883          * </pre>
16884          * @hide
16885          */
16886         @Readable
16887         public static final String SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS =
16888                 "smart_suggestions_in_notifications_flags";
16889 
16890         /**
16891          * If nonzero, crashes in foreground processes will bring up a dialog.
16892          * Otherwise, the process will be silently killed.
16893          * @hide
16894          */
16895         @TestApi
16896         @Readable
16897         @SuppressLint("NoSettingsProvider")
16898         public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog";
16899 
16900         /**
16901          * If nonzero, crash dialogs will show an option to restart the app.
16902          * @hide
16903          */
16904         @Readable
16905         public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog";
16906 
16907         /**
16908          * If nonzero, crash dialogs will show an option to mute all future crash dialogs for
16909          * this app.
16910          * @hide
16911          */
16912         @Readable
16913         public static final String SHOW_MUTE_IN_CRASH_DIALOG = "show_mute_in_crash_dialog";
16914 
16915 
16916         /**
16917          * If nonzero, will show the zen upgrade notification when the user toggles DND on/off.
16918          * @hide
16919          * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_UPGRADE_NOTIFICATION}
16920          */
16921         @Deprecated
16922         public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";
16923 
16924         /**
16925          * If nonzero, will show the zen update settings suggestion.
16926          * @hide
16927          * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_SETTINGS_SUGGESTION}
16928          */
16929         @Deprecated
16930         public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion";
16931 
16932         /**
16933          * If nonzero, zen has not been updated to reflect new changes.
16934          * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_UPDATED}
16935          * @hide
16936          */
16937         @Deprecated
16938         public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated";
16939 
16940         /**
16941          * If nonzero, zen setting suggestion has been viewed by user
16942          * @hide
16943          * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_SUGGESTION_VIEWED}
16944          */
16945         @Deprecated
16946         public static final String ZEN_SETTINGS_SUGGESTION_VIEWED =
16947                 "zen_settings_suggestion_viewed";
16948 
16949         /**
16950          * Backup and restore agent timeout parameters.
16951          * These parameters are represented by a comma-delimited key-value list.
16952          *
16953          * The following strings are supported as keys:
16954          * <pre>
16955          *     kv_backup_agent_timeout_millis         (long)
16956          *     full_backup_agent_timeout_millis       (long)
16957          *     shared_backup_agent_timeout_millis     (long)
16958          *     restore_agent_timeout_millis           (long)
16959          *     restore_agent_finished_timeout_millis  (long)
16960          * </pre>
16961          *
16962          * They map to milliseconds represented as longs.
16963          *
16964          * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000"
16965          *
16966          * @hide
16967          */
16968         @Readable
16969         public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS =
16970                 "backup_agent_timeout_parameters";
16971 
16972         /**
16973          * Blocklist of GNSS satellites.
16974          *
16975          * This is a list of integers separated by commas to represent pairs of (constellation,
16976          * svid). Thus, the number of integers should be even.
16977          *
16978          * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are
16979          * blocklisted. Note that svid=0 denotes all svids in the constellation are blocklisted.
16980          *
16981          * @hide
16982          */
16983         public static final String GNSS_SATELLITE_BLOCKLIST = "gnss_satellite_blocklist";
16984 
16985         /**
16986          * Duration of updates in millisecond for GNSS location request from HAL to framework.
16987          *
16988          * If zero, the GNSS location request feature is disabled.
16989          *
16990          * The value is a non-negative long.
16991          *
16992          * @hide
16993          */
16994         @Readable
16995         public static final String GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS =
16996                 "gnss_hal_location_request_duration_millis";
16997 
16998         /**
16999          * Binder call stats settings.
17000          *
17001          * The following strings are supported as keys:
17002          * <pre>
17003          *     enabled              (boolean)
17004          *     detailed_tracking    (boolean)
17005          *     upload_data          (boolean)
17006          *     sampling_interval    (int)
17007          * </pre>
17008          *
17009          * @hide
17010          */
17011         @Readable
17012         public static final String BINDER_CALLS_STATS = "binder_calls_stats";
17013 
17014         /**
17015          * Looper stats settings.
17016          *
17017          * The following strings are supported as keys:
17018          * <pre>
17019          *     enabled              (boolean)
17020          *     sampling_interval    (int)
17021          * </pre>
17022          *
17023          * @hide
17024          */
17025         @Readable
17026         public static final String LOOPER_STATS = "looper_stats";
17027 
17028         /**
17029          * Settings for collecting statistics on CPU usage per thread
17030          *
17031          * The following strings are supported as keys:
17032          * <pre>
17033          *     num_buckets          (int)
17034          *     collected_uids       (string)
17035          *     minimum_total_cpu_usage_millis (int)
17036          * </pre>
17037          *
17038          * @hide
17039          */
17040         @Readable
17041         public static final String KERNEL_CPU_THREAD_READER = "kernel_cpu_thread_reader";
17042 
17043         /**
17044          * Whether we've enabled native flags health check on this device. Takes effect on
17045          * reboot. The value "1" enables native flags health check; otherwise it's disabled.
17046          * @hide
17047          */
17048         @Readable
17049         public static final String NATIVE_FLAGS_HEALTH_CHECK_ENABLED =
17050                 "native_flags_health_check_enabled";
17051 
17052         /**
17053          * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the mode
17054          * in which the historical registry operates.
17055          *
17056          * @hide
17057          */
17058         @Readable
17059         public static final String APPOP_HISTORY_MODE = "mode";
17060 
17061         /**
17062          * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls how long
17063          * is the interval between snapshots in the base case i.e. the most recent
17064          * part of the history.
17065          *
17066          * @hide
17067          */
17068         @Readable
17069         public static final String APPOP_HISTORY_BASE_INTERVAL_MILLIS = "baseIntervalMillis";
17070 
17071         /**
17072          * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the base
17073          * for the logarithmic step when building app op history.
17074          *
17075          * @hide
17076          */
17077         @Readable
17078         public static final String APPOP_HISTORY_INTERVAL_MULTIPLIER = "intervalMultiplier";
17079 
17080         /**
17081          * Appop history parameters. These parameters are represented by
17082          * a comma-delimited key-value list.
17083          *
17084          * The following strings are supported as keys:
17085          * <pre>
17086          *     mode                  (int)
17087          *     baseIntervalMillis    (long)
17088          *     intervalMultiplier    (int)
17089          * </pre>
17090          *
17091          * Ex: "mode=HISTORICAL_MODE_ENABLED_ACTIVE,baseIntervalMillis=1000,intervalMultiplier=10"
17092          *
17093          * @see #APPOP_HISTORY_MODE
17094          * @see #APPOP_HISTORY_BASE_INTERVAL_MILLIS
17095          * @see #APPOP_HISTORY_INTERVAL_MULTIPLIER
17096          *
17097          * @hide
17098          */
17099         @Readable
17100         public static final String APPOP_HISTORY_PARAMETERS =
17101                 "appop_history_parameters";
17102 
17103         /**
17104          * Auto revoke parameters. These parameters are represented by
17105          * a comma-delimited key-value list.
17106          *
17107          * <pre>
17108          *     enabledForPreRApps    (bolean)
17109          *     unusedThresholdMs     (long)
17110          *     checkFrequencyMs      (long)
17111          * </pre>
17112          *
17113          * Ex: "enabledForPreRApps=false,unusedThresholdMs=7776000000,checkFrequencyMs=1296000000"
17114          *
17115          * @hide
17116          */
17117         @Readable
17118         public static final String AUTO_REVOKE_PARAMETERS =
17119                 "auto_revoke_parameters";
17120 
17121         /**
17122          * Delay for sending ACTION_CHARGING after device is plugged in.
17123          * This is used as an override for constants defined in BatteryStatsImpl for
17124          * ease of experimentation.
17125          *
17126          * @see com.android.internal.os.BatteryStatsImpl.Constants.KEY_BATTERY_CHARGED_DELAY_MS
17127          * @hide
17128          */
17129         @Readable
17130         public static final String BATTERY_CHARGING_STATE_UPDATE_DELAY =
17131                 "battery_charging_state_update_delay";
17132 
17133         /**
17134          * A serialized string of params that will be loaded into a text classifier action model.
17135          *
17136          * @hide
17137          */
17138         @Readable
17139         public static final String TEXT_CLASSIFIER_ACTION_MODEL_PARAMS =
17140                 "text_classifier_action_model_params";
17141 
17142         /**
17143          * The amount of time to suppress "power-off" from the power button after the device has
17144          * woken due to a gesture (lifting the phone).  Since users have learned to hit the power
17145          * button immediately when lifting their device, it can cause the device to turn off if a
17146          * gesture has just woken the device. This value tells us the milliseconds to wait after
17147          * a gesture before "power-off" via power-button is functional again. A value of 0 is no
17148          * delay, and reverts to the old behavior.
17149          *
17150          * @hide
17151          */
17152         @Readable
17153         public static final String POWER_BUTTON_SUPPRESSION_DELAY_AFTER_GESTURE_WAKE =
17154                 "power_button_suppression_delay_after_gesture_wake";
17155 
17156         /**
17157          * The usage amount of advanced battery. The value is 0~100.
17158          *
17159          * @hide
17160          */
17161         @Readable
17162         public static final String ADVANCED_BATTERY_USAGE_AMOUNT = "advanced_battery_usage_amount";
17163 
17164         /**
17165          * For 5G NSA capable devices, determines whether NR tracking indications are on
17166          * when the screen is off.
17167          *
17168          * Values are:
17169          * 0: off - All 5G NSA tracking indications are off when the screen is off.
17170          * 1: extended - All 5G NSA tracking indications are on when the screen is off as long as
17171          *    the device is camped on 5G NSA (5G icon is showing in status bar).
17172          *    If the device is not camped on 5G NSA, tracking indications are off.
17173          * 2: always on - All 5G NSA tracking indications are on whether the screen is on or off.
17174          * @hide
17175          */
17176         @Readable
17177         public static final String NR_NSA_TRACKING_SCREEN_OFF_MODE =
17178                 "nr_nsa_tracking_screen_off_mode";
17179 
17180         /**
17181          * Whether to show People Space.
17182          * Values are:
17183          * 0: Disabled (default)
17184          * 1: Enabled
17185          * @hide
17186          */
17187         public static final String SHOW_PEOPLE_SPACE = "show_people_space";
17188 
17189         /**
17190          * Which types of conversation(s) to show in People Space.
17191          * Values are:
17192          * 0: Single user-selected conversation (default)
17193          * 1: Priority conversations only
17194          * 2: All conversations
17195          * @hide
17196          */
17197         public static final String PEOPLE_SPACE_CONVERSATION_TYPE =
17198                 "people_space_conversation_type";
17199 
17200         /**
17201          * Whether to show new notification dismissal.
17202          * Values are:
17203          * 0: Disabled
17204          * 1: Enabled
17205          * @hide
17206          */
17207         public static final String SHOW_NEW_NOTIF_DISMISS = "show_new_notif_dismiss";
17208 
17209         /**
17210          * Block untrusted touches mode.
17211          *
17212          * Can be one of:
17213          * <ul>
17214          *      <li>0 = {@link BlockUntrustedTouchesMode#DISABLED}: Feature is off.
17215          *      <li>1 = {@link BlockUntrustedTouchesMode#PERMISSIVE}: Untrusted touches are flagged
17216          *          but not blocked
17217          *      <li>2 = {@link BlockUntrustedTouchesMode#BLOCK}: Untrusted touches are blocked
17218          * </ul>
17219          *
17220          * @hide
17221          */
17222         @Readable
17223         public static final String BLOCK_UNTRUSTED_TOUCHES_MODE = "block_untrusted_touches";
17224 
17225         /**
17226          * The maximum allowed obscuring opacity by UID to propagate touches.
17227          *
17228          * For certain window types (eg. SAWs), the decision of honoring {@link LayoutParams
17229          * #FLAG_NOT_TOUCHABLE} or not depends on the combined obscuring opacity of the windows
17230          * above the touch-consuming window.
17231          *
17232          * For a certain UID:
17233          * <ul>
17234          *     <li>If it's the same as the UID of the touch-consuming window, allow it to propagate
17235          *     the touch.
17236          *     <li>Otherwise take all its windows of eligible window types above the touch-consuming
17237          *     window, compute their combined obscuring opacity considering that {@code
17238          *     opacity(A, B) = 1 - (1 - opacity(A))*(1 - opacity(B))}. If the computed value is
17239          *     lesser than or equal to this setting and there are no other windows preventing the
17240          *     touch, allow the UID to propagate the touch.
17241          * </ul>
17242          *
17243          * @see android.hardware.input.InputManager#getMaximumObscuringOpacityForTouch()
17244          * @see android.hardware.input.InputManager#setMaximumObscuringOpacityForTouch(float)
17245          *
17246          * @hide
17247          */
17248         @Readable
17249         public static final String MAXIMUM_OBSCURING_OPACITY_FOR_TOUCH =
17250                 "maximum_obscuring_opacity_for_touch";
17251 
17252         /**
17253          * Used to enable / disable the Restricted Networking Mode in which network access is
17254          * restricted to apps holding the CONNECTIVITY_USE_RESTRICTED_NETWORKS permission.
17255          *
17256          * Values are:
17257          * 0: disabled
17258          * 1: enabled
17259          * @hide
17260          */
17261         public static final String RESTRICTED_NETWORKING_MODE = "restricted_networking_mode";
17262 
17263         /**
17264          * Setting indicating whether Low Power Standby is enabled, if supported.
17265          *
17266          * Values are:
17267          * 0: disabled
17268          * 1: enabled
17269          *
17270          * @hide
17271          */
17272         public static final String LOW_POWER_STANDBY_ENABLED = "low_power_standby_enabled";
17273 
17274         /**
17275          * Setting indicating whether Low Power Standby is allowed to be active during doze
17276          * maintenance mode.
17277          *
17278          * Values are:
17279          * 0: Low Power Standby will be disabled during doze maintenance mode
17280          * 1: Low Power Standby can be active during doze maintenance mode
17281          *
17282          * @hide
17283          */
17284         public static final String LOW_POWER_STANDBY_ACTIVE_DURING_MAINTENANCE =
17285                 "low_power_standby_active_during_maintenance";
17286 
17287         /**
17288          * Timeout for the system server watchdog.
17289          *
17290          * @see {@link com.android.server.Watchdog}.
17291          *
17292          * @hide
17293          */
17294         public static final String WATCHDOG_TIMEOUT_MILLIS =
17295                 "system_server_watchdog_timeout_ms";
17296 
17297         /**
17298          * Whether to enable managed device provisioning via the role holder.
17299          *
17300          * @hide
17301          */
17302         public static final String MANAGED_PROVISIONING_DEFER_PROVISIONING_TO_ROLE_HOLDER =
17303                 "managed_provisioning_defer_provisioning_to_role_holder";
17304 
17305         /**
17306          * State of whether review notification permissions notification needs to
17307          * be shown the user, and whether the user has interacted.
17308          *
17309          * Valid values:
17310          *   -1 = UNKNOWN
17311          *    0 = SHOULD_SHOW
17312          *    1 = USER_INTERACTED
17313          *    2 = DISMISSED
17314          *    3 = RESHOWN
17315          * @hide
17316          */
17317         public static final String REVIEW_PERMISSIONS_NOTIFICATION_STATE =
17318                 "review_permissions_notification_state";
17319 
17320         /**
17321          * Settings migrated from Wear OS settings provider.
17322          * @hide
17323          */
17324         public static class Wearable {
17325             /**
17326              * Whether the user has any pay tokens on their watch.
17327              * @hide
17328              */
17329             public static final String HAS_PAY_TOKENS = "has_pay_tokens";
17330 
17331             /**
17332              * Gcm checkin timeout in minutes.
17333              * @hide
17334              */
17335             public static final String GMS_CHECKIN_TIMEOUT_MIN = "gms_checkin_timeout_min";
17336 
17337             /**
17338              * If hotword detection should be enabled.
17339              * @hide
17340              */
17341             public static final String HOTWORD_DETECTION_ENABLED = "hotword_detection_enabled";
17342 
17343             /**
17344              * Whether Smart Replies are enabled within Wear.
17345              * @hide
17346              */
17347             public static final String SMART_REPLIES_ENABLED = "smart_replies_enabled";
17348 
17349             /**
17350              * The default vibration pattern.
17351              * @hide
17352              */
17353             public static final String DEFAULT_VIBRATION = "default_vibration";
17354 
17355             /**
17356              * If FLP should obtain location data from the paired device.
17357              * @hide
17358              */
17359             public static final String OBTAIN_PAIRED_DEVICE_LOCATION =
17360                     "obtain_paired_device_location";
17361 
17362             /**
17363              * Whether the device is in retail mode.
17364              * @hide
17365              */
17366             public static final String RETAIL_MODE = "retail_mode";
17367 
17368             // Possible retail mode states
17369             /** @hide */
17370             public static final int RETAIL_MODE_CONSUMER = 0;
17371             /** @hide */
17372             public static final int RETAIL_MODE_RETAIL = 1;
17373 
17374             /**
17375              * The play store availability on companion phone.
17376              * @hide
17377              */
17378             public static final String PHONE_PLAY_STORE_AVAILABILITY =
17379                     "phone_play_store_availability";
17380 
17381             // Possible phone play store availability states
17382             /** @hide */
17383             public static final int PHONE_PLAY_STORE_AVAILABILITY_UNKNOWN = 0;
17384             /** @hide */
17385             public static final int PHONE_PLAY_STORE_AVAILABLE = 1;
17386             /** @hide */
17387             public static final int PHONE_PLAY_STORE_UNAVAILABLE = 2;
17388 
17389             /**
17390              * Whether the bug report is enabled.
17391              * @hide
17392              */
17393             public static final String BUG_REPORT = "bug_report";
17394 
17395             // Possible bug report states
17396             /** @hide */
17397             public static final int BUG_REPORT_DISABLED = 0;
17398             /** @hide */
17399             public static final int BUG_REPORT_ENABLED = 1;
17400 
17401             /**
17402              * The enabled/disabled state of the SmartIlluminate.
17403              * @hide
17404              */
17405             public static final String SMART_ILLUMINATE_ENABLED = "smart_illuminate_enabled";
17406 
17407             /**
17408              * Whether automatic time is enabled on the watch.
17409              * @hide
17410              */
17411             public static final String CLOCKWORK_AUTO_TIME = "clockwork_auto_time";
17412 
17413             // Possible clockwork auto time states
17414             /** @hide */
17415             public static final int SYNC_TIME_FROM_PHONE = 0;
17416             /** @hide */
17417             public static final int SYNC_TIME_FROM_NETWORK = 1;
17418             /** @hide */
17419             public static final int AUTO_TIME_OFF = 2;
17420             /** @hide */
17421             public static final int INVALID_AUTO_TIME_STATE = 3;
17422 
17423 
17424             /**
17425              * Whether automatic time zone is enabled on the watch.
17426              * @hide
17427              */
17428             public static final String CLOCKWORK_AUTO_TIME_ZONE = "clockwork_auto_time_zone";
17429 
17430             // Possible clockwork auto time zone states
17431             /** @hide */
17432             public static final int SYNC_TIME_ZONE_FROM_PHONE = 0;
17433             /** @hide */
17434             public static final int SYNC_TIME_ZONE_FROM_NETWORK = 1;
17435             /** @hide */
17436             public static final int AUTO_TIME_ZONE_OFF = 2;
17437             /** @hide */
17438             public static final int INVALID_AUTO_TIME_ZONE_STATE = 3;
17439 
17440             /**
17441              * Whether 24 hour time format is enabled on the watch.
17442              * @hide
17443              */
17444             public static final String CLOCKWORK_24HR_TIME = "clockwork_24hr_time";
17445 
17446             /**
17447              * Whether the auto wifi toggle setting is enabled.
17448              * @hide
17449              */
17450             public static final String AUTO_WIFI = "auto_wifi";
17451 
17452             // Possible force wifi on states
17453             /** @hide */
17454             public static final int AUTO_WIFI_DISABLED = 0;
17455             /** @hide */
17456             public static final int AUTO_WIFI_ENABLED = 1;
17457 
17458             /**
17459              * The number of minutes after the WiFi enters power save mode.
17460              * @hide
17461              */
17462             public static final String WIFI_POWER_SAVE = "wifi_power_save";
17463 
17464             /**
17465              * The time at which we should no longer skip the wifi requirement check (we skip the
17466              * wifi requirement until this time). The time is in millis since epoch.
17467              * @hide
17468              */
17469             public static final String ALT_BYPASS_WIFI_REQUIREMENT_TIME_MILLIS =
17470                     "alt_bypass_wifi_requirement_time_millis";
17471 
17472             /**
17473              * Whether the setup was skipped.
17474              * @hide
17475              */
17476             public static final String SETUP_SKIPPED = "setup_skipped";
17477 
17478             // Possible setup_skipped states
17479             /** @hide */
17480             public static final int SETUP_SKIPPED_UNKNOWN = 0;
17481             /** @hide */
17482             public static final int SETUP_SKIPPED_YES = 1;
17483             /** @hide */
17484             public static final int SETUP_SKIPPED_NO = 2;
17485 
17486             /**
17487              * The last requested call forwarding action.
17488              * @hide
17489              */
17490             public static final String LAST_CALL_FORWARD_ACTION = "last_call_forward_action";
17491 
17492             // Possible call forwarding actions
17493             /** @hide */
17494             public static final int CALL_FORWARD_ACTION_ON = 1;
17495             /** @hide */
17496             public static final int CALL_FORWARD_ACTION_OFF = 2;
17497             /** @hide */
17498             public static final int CALL_FORWARD_NO_LAST_ACTION = -1;
17499 
17500             // Stem button settings.
17501             /** @hide */
17502             public static final String STEM_1_TYPE = "STEM_1_TYPE";
17503             /** @hide */
17504             public static final String STEM_1_DATA = "STEM_1_DATA";
17505             /** @hide */
17506             public static final String STEM_1_DEFAULT_DATA = "STEM_1_DEFAULT_DATA";
17507             /** @hide */
17508             public static final String STEM_2_TYPE = "STEM_2_TYPE";
17509             /** @hide */
17510             public static final String STEM_2_DATA = "STEM_2_DATA";
17511             /** @hide */
17512             public static final String STEM_2_DEFAULT_DATA = "STEM_2_DEFAULT_DATA";
17513             /** @hide */
17514             public static final String STEM_3_TYPE = "STEM_3_TYPE";
17515             /** @hide */
17516             public static final String STEM_3_DATA = "STEM_3_DATA";
17517             /** @hide */
17518             public static final String STEM_3_DEFAULT_DATA = "STEM_3_DEFAULT_DATA";
17519 
17520             // Stem types
17521             /** @hide */
17522             public static final int STEM_TYPE_UNKNOWN = -1;
17523             /** @hide */
17524             public static final int STEM_TYPE_APP_LAUNCH = 0;
17525             /** @hide */
17526             public static final int STEM_TYPE_CONTACT_LAUNCH = 1;
17527 
17528             /**
17529              * If the device should be muted when off body.
17530              * @hide
17531              */
17532             public static final String MUTE_WHEN_OFF_BODY_ENABLED = "obtain_mute_when_off_body";
17533 
17534             /**
17535              * Wear OS version string.
17536              * @hide
17537              */
17538             public static final String WEAR_OS_VERSION_STRING = "wear_os_version_string";
17539 
17540             /**
17541              * How round the corners of square screens are.
17542              * @hide
17543              */
17544             public static final String CORNER_ROUNDNESS = "corner_roundness";
17545 
17546             /**
17547              * Whether the physical button has been set.
17548              * @hide
17549              */
17550             public static final String BUTTON_SET = "button_set";
17551 
17552             /**
17553              * Whether there is a side button.
17554              * @hide
17555              */
17556             public static final String SIDE_BUTTON = "side_button";
17557 
17558             /**
17559              * The android wear system version.
17560              * @hide
17561              */
17562             public static final String ANDROID_WEAR_VERSION = "android_wear_version";
17563 
17564             /**
17565              * The wear system capabiltiies.
17566              * @hide
17567              */
17568             public static final String SYSTEM_CAPABILITIES = "system_capabilities";
17569 
17570             /**
17571              * The android wear system edition.
17572              * @hide
17573              */
17574             public static final String SYSTEM_EDITION = "android_wear_system_edition";
17575 
17576             /**
17577              * The Wear platform MR number.
17578              * @hide
17579              */
17580             public static final String WEAR_PLATFORM_MR_NUMBER = "wear_platform_mr_number";
17581 
17582             /**
17583              * The mobile signal detector setting.
17584              * @hide
17585              */
17586             public static final String MOBILE_SIGNAL_DETECTOR = "mobile_signal_detector";
17587 
17588 
17589             /**
17590              * Whether ambient is currently enabled.
17591              * @hide
17592              */
17593             public static final String AMBIENT_ENABLED = "ambient_enabled";
17594 
17595             /**
17596              * Whether ambient tilt to wake is enabled.
17597              * @hide
17598              */
17599             public static final String AMBIENT_TILT_TO_WAKE = "ambient_tilt_to_wake";
17600 
17601             /**
17602              * Whether ambient low bit mode is enabled by developer options.
17603              * @hide
17604              */
17605             public static final String AMBIENT_LOW_BIT_ENABLED_DEV = "ambient_low_bit_enabled_dev";
17606 
17607             /**
17608              * Whether ambient touch to wake is enabled.
17609              * @hide
17610              */
17611             public static final String AMBIENT_TOUCH_TO_WAKE = "ambient_touch_to_wake";
17612 
17613             /**
17614              * Whether ambient tilt to bright is enabled.
17615              * @hide
17616              */
17617             public static final String AMBIENT_TILT_TO_BRIGHT = "ambient_tilt_to_bright";
17618 
17619             /**
17620              * Whether the current watchface is decomposable.
17621              * @hide
17622              */
17623             public static final String DECOMPOSABLE_WATCHFACE = "current_watchface_decomposable";
17624 
17625             /**
17626              * Whether to force ambient when docked.
17627              * @hide
17628              */
17629             public static final String AMBIENT_FORCE_WHEN_DOCKED = "ambient_force_when_docked";
17630 
17631             /**
17632              * Whether the ambient low bit mode is enabled.
17633              * @hide
17634              */
17635             public static final String AMBIENT_LOW_BIT_ENABLED = "ambient_low_bit_enabled";
17636 
17637             /**
17638              * The timeout duration in minutes of ambient mode when plugged in.
17639              * @hide
17640              */
17641             public static final String AMBIENT_PLUGGED_TIMEOUT_MIN = "ambient_plugged_timeout_min";
17642 
17643             /**
17644              * What OS does paired device has.
17645              * @hide
17646              */
17647             public static final String PAIRED_DEVICE_OS_TYPE = "paired_device_os_type";
17648 
17649             // Possible values of PAIRED_DEVICE_OS_TYPE
17650             /** @hide */
17651             public static final int PAIRED_DEVICE_OS_TYPE_UNKNOWN = 0;
17652             /** @hide */
17653             public static final int PAIRED_DEVICE_OS_TYPE_ANDROID = 1;
17654             /** @hide */
17655             public static final int PAIRED_DEVICE_OS_TYPE_IOS = 2;
17656 
17657             /**
17658              * The bluetooth settings selected BLE role for the companion.
17659              * @hide
17660              */
17661             public static final String COMPANION_BLE_ROLE = "companion_ble_role";
17662 
17663             // Possible values of COMPANION_BLE_ROLE
17664             /** @hide */
17665             public static final int BLUETOOTH_ROLE_CENTRAL = 1;
17666             /** @hide */
17667             public static final int BLUETOOTH_ROLE_PERIPHERAL = 2;
17668 
17669             /**
17670              * The bluetooth settings stored companion device name.
17671              * @hide
17672              */
17673             public static final String COMPANION_NAME = "companion_bt_name";
17674 
17675             /**
17676              * The user's last setting for hfp client.
17677              * @hide
17678              */
17679             public static final String USER_HFP_CLIENT_SETTING = "user_hfp_client_setting";
17680 
17681             // Possible hfp client user setting values
17682             /** @hide */
17683             public static final int HFP_CLIENT_UNSET = 0;
17684             /** @hide */
17685             public static final int HFP_CLIENT_ENABLED = 1;
17686             /** @hide */
17687             public static final int HFP_CLIENT_DISABLED = 2;
17688 
17689             /**
17690              * The companion phone's android version.
17691              * @hide
17692              */
17693             public static final String COMPANION_OS_VERSION = "wear_companion_os_version";
17694 
17695             // Companion os version constants
17696             /** @hide */
17697             public static final int COMPANION_OS_VERSION_UNDEFINED = -1;
17698 
17699             /**
17700              * A boolean value to indicate if we want to support all languages in LE edition on
17701              * wear. 1 for supporting, 0 for not supporting.
17702              * @hide
17703              */
17704             public static final String ENABLE_ALL_LANGUAGES = "enable_all_languages";
17705 
17706             /**
17707              * The Locale (as language tag) the user chose at startup.
17708              * @hide
17709              */
17710             public static final String SETUP_LOCALE = "setup_locale";
17711 
17712             /**
17713              * The version of oem setup present.
17714              * @hide
17715              */
17716             public static final String OEM_SETUP_VERSION = "oem_setup_version";
17717 
17718             /**
17719              * Controls the gestures feature.
17720              * @hide
17721              */
17722             public static final String MASTER_GESTURES_ENABLED = "master_gestures_enabled";
17723 
17724             /**
17725              * Whether or not ungaze is enabled.
17726              * @hide
17727              */
17728             public static final String UNGAZE_ENABLED = "ungaze_enabled";
17729 
17730             /**
17731              * The device's battery saver mode, which can be one of the following:
17732              * -{@link BATTERY_SAVER_MODE_NONE}
17733              * -{@link BATTERY_SAVER_MODE_LIGHT}
17734              * -{@link BATTERY_SAVER_MODE_TRADITIONAL_WATCH}
17735              * -{@link BATTERY_SAVER_MODE_TIME_ONLY}
17736              * -{@link BATTERY_SAVER_MODE_CUSTOM}
17737              * @hide
17738              */
17739             public static final String BATTERY_SAVER_MODE = "battery_saver_mode";
17740 
17741             /**
17742              * Not in Battery Saver Mode
17743              * @hide
17744              */
17745             public static final int BATTERY_SAVER_MODE_NONE = 0;
17746             /**
17747              * In Lightweight Battery Saver Mode
17748              * @hide
17749              */
17750             public static final int BATTERY_SAVER_MODE_LIGHT = 1;
17751             /**
17752              * In Traditional Watch Mode Battery Saver Mode
17753              * @hide
17754              */
17755             public static final int BATTERY_SAVER_MODE_TRADITIONAL_WATCH = 2;
17756             /**
17757              * In Time-only Mode Battery Saver Mode
17758              * @hide
17759              */
17760             public static final int BATTERY_SAVER_MODE_TIME_ONLY = 3;
17761             /**
17762              * Partner's Battery Saver implementation is being used
17763              * @hide
17764              */
17765             public static final int BATTERY_SAVER_MODE_CUSTOM = 4;
17766 
17767             /**
17768              * The maximum ambient mode duration when an activity is allowed to auto resume.
17769              * @hide
17770              */
17771             public static final String WEAR_ACTIVITY_AUTO_RESUME_TIMEOUT_MS =
17772                     "wear_activity_auto_resume_timeout_ms";
17773 
17774             /**
17775              * If the current {@code WEAR_ACTIVITY_AUTO_RESUME_TIMEOUT_MS} value is set by user.
17776              * 1 for true, 0 for false.
17777              * @hide
17778              */
17779             public static final String WEAR_ACTIVITY_AUTO_RESUME_TIMEOUT_SET_BY_USER =
17780                     "wear_activity_auto_resume_timeout_set_by_user";
17781 
17782             /**
17783              * If burn in protection is enabled.
17784              * @hide
17785              */
17786             public static final String BURN_IN_PROTECTION_ENABLED = "burn_in_protection";
17787 
17788             /**
17789              * Whether the device has combined location setting enabled.
17790              * @hide
17791              */
17792             public static final String COMBINED_LOCATION_ENABLED = "combined_location_enable";
17793 
17794             /**
17795              * The wrist orientation mode of the device
17796              * Valid values - LEFT_WRIST_ROTATION_0 = "0" (default), LEFT_WRIST_ROTATION_180 = "1",
17797              *          RIGHT_WRIST_ROTATION_0 = "2", RIGHT_WRIST_ROTATION_180 = "3"
17798              * @hide
17799              */
17800             public static final String WRIST_ORIENTATION_MODE = "wear_wrist_orientation_mode";
17801 
17802             /**
17803              * Setting indicating the name of the Wear OS app package containing the device's sysui.
17804              *
17805              * @hide
17806              */
17807             public static final String CLOCKWORK_SYSUI_PACKAGE = "clockwork_sysui_package";
17808 
17809             /**
17810              * Setting indicating the name of the main activity of the Wear OS sysui.
17811              *
17812              * @hide
17813              */
17814             public static final String CLOCKWORK_SYSUI_MAIN_ACTIVITY =
17815                     "clockwork_sysui_main_activity";
17816 
17817             /**
17818              * Setting to disable power button long press launching Assistant. It's boolean, i.e.
17819              * enabled = 1, disabled = 0. By default, this setting is enabled.
17820              *
17821              * @hide
17822              */
17823             public static final String CLOCKWORK_LONG_PRESS_TO_ASSISTANT_ENABLED =
17824                     "clockwork_long_press_to_assistant_enabled";
17825 
17826             /*
17827              * Whether the device has Cooldown Mode enabled.
17828              * @hide
17829              */
17830             public static final String COOLDOWN_MODE_ON = "cooldown_mode_on";
17831 
17832             /*
17833              * Whether the device has Wet Mode/ Touch Lock Mode enabled.
17834              * @hide
17835              */
17836             public static final String WET_MODE_ON = "wet_mode_on";
17837         }
17838     }
17839 
17840     /**
17841      * Configuration system settings, containing settings which are applied identically for all
17842      * defined users. Only Android can read these and only a specific configuration service can
17843      * write these.
17844      *
17845      * @hide
17846      */
17847     public static final class Config extends NameValueTable {
17848 
17849         /**
17850          * The modes that can be used when disabling syncs to the 'config' settings.
17851          * @hide
17852          */
17853         @IntDef(prefix = "DISABLE_SYNC_MODE_",
17854                 value = { SYNC_DISABLED_MODE_NONE, SYNC_DISABLED_MODE_PERSISTENT,
17855                         SYNC_DISABLED_MODE_UNTIL_REBOOT })
17856         @Retention(RetentionPolicy.SOURCE)
17857         @Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE})
17858         public @interface SyncDisabledMode {}
17859 
17860         /**
17861          * Sync is not not disabled.
17862          *
17863          * @hide
17864          */
17865         public static final int SYNC_DISABLED_MODE_NONE = 0;
17866 
17867         /**
17868          * Disabling of Config bulk update / syncing is persistent, i.e. it survives a device
17869          * reboot.
17870          * @hide
17871          */
17872         public static final int SYNC_DISABLED_MODE_PERSISTENT = 1;
17873 
17874         /**
17875          * Disabling of Config bulk update / syncing is not persistent, i.e. it will not survive a
17876          * device reboot.
17877          * @hide
17878          */
17879         public static final int SYNC_DISABLED_MODE_UNTIL_REBOOT = 2;
17880 
17881         private static final ContentProviderHolder sProviderHolder =
17882                 new ContentProviderHolder(DeviceConfig.CONTENT_URI);
17883 
17884         // Populated lazily, guarded by class object:
17885         private static final NameValueCache sNameValueCache = new NameValueCache(
17886                 DeviceConfig.CONTENT_URI,
17887                 CALL_METHOD_GET_CONFIG,
17888                 CALL_METHOD_PUT_CONFIG,
17889                 CALL_METHOD_DELETE_CONFIG,
17890                 CALL_METHOD_LIST_CONFIG,
17891                 CALL_METHOD_SET_ALL_CONFIG,
17892                 sProviderHolder,
17893                 Config.class);
17894 
17895         /**
17896          * Look up a name in the database.
17897          * @param resolver to access the database with
17898          * @param name to look up in the table
17899          * @return the corresponding value, or null if not present
17900          *
17901          * @hide
17902          */
17903         @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG)
getString(ContentResolver resolver, String name)17904         static String getString(ContentResolver resolver, String name) {
17905             return sNameValueCache.getStringForUser(resolver, name, resolver.getUserId());
17906         }
17907 
17908         /**
17909          * Look up a list of names in the database, within the specified namespace.
17910          *
17911          * @param resolver to access the database with
17912          * @param namespace to which the names belong
17913          * @param names to look up in the table
17914          * @return a non null, but possibly empty, map from name to value for any of the names that
17915          *         were found during lookup.
17916          *
17917          * @hide
17918          */
17919         @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG)
getStrings(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull List<String> names)17920         public static Map<String, String> getStrings(@NonNull ContentResolver resolver,
17921                 @NonNull String namespace, @NonNull List<String> names) {
17922             List<String> compositeNames = new ArrayList<>(names.size());
17923             for (String name : names) {
17924                 compositeNames.add(createCompositeName(namespace, name));
17925             }
17926 
17927             String prefix = createPrefix(namespace);
17928             ArrayMap<String, String> rawKeyValues = sNameValueCache.getStringsForPrefix(
17929                     resolver, prefix, compositeNames);
17930             int size = rawKeyValues.size();
17931             int substringLength = prefix.length();
17932             ArrayMap<String, String> keyValues = new ArrayMap<>(size);
17933             for (int i = 0; i < size; ++i) {
17934                 keyValues.put(rawKeyValues.keyAt(i).substring(substringLength),
17935                         rawKeyValues.valueAt(i));
17936             }
17937             return keyValues;
17938         }
17939 
17940         /**
17941          * Store a name/value pair into the database within the specified namespace.
17942          * <p>
17943          * Also the method takes an argument whether to make the value the default for this setting.
17944          * If the system already specified a default value, then the one passed in here will
17945          * <strong>not</strong> be set as the default.
17946          * </p>
17947          *
17948          * @param resolver to access the database with.
17949          * @param namespace to store the name/value pair in.
17950          * @param name to store.
17951          * @param value to associate with the name.
17952          * @param makeDefault whether to make the value the default one.
17953          * @return true if the value was set, false on database errors.
17954          *
17955          * @see #resetToDefaults(ContentResolver, int, String)
17956          *
17957          * @hide
17958          */
17959         @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
putString(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull String name, @Nullable String value, boolean makeDefault)17960         static boolean putString(@NonNull ContentResolver resolver, @NonNull String namespace,
17961                 @NonNull String name, @Nullable String value, boolean makeDefault) {
17962             return sNameValueCache.putStringForUser(resolver, createCompositeName(namespace, name),
17963                     value, null, makeDefault, resolver.getUserId(),
17964                     DEFAULT_OVERRIDEABLE_BY_RESTORE);
17965         }
17966 
17967         /**
17968          * Clear all name/value pairs for the provided namespace and save new name/value pairs in
17969          * their place.
17970          *
17971          * @param resolver to access the database with.
17972          * @param namespace to which the names should be set.
17973          * @param keyValues map of key names (without the prefix) to values.
17974          * @return true if the name/value pairs were set, false if setting was blocked
17975          *
17976          * @hide
17977          */
17978         @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
setStrings(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull Map<String, String> keyValues)17979         public static boolean setStrings(@NonNull ContentResolver resolver,
17980                 @NonNull String namespace, @NonNull Map<String, String> keyValues)
17981                 throws DeviceConfig.BadConfigException {
17982             HashMap<String, String> compositeKeyValueMap = new HashMap<>(keyValues.keySet().size());
17983             for (Map.Entry<String, String> entry : keyValues.entrySet()) {
17984                 compositeKeyValueMap.put(
17985                         createCompositeName(namespace, entry.getKey()), entry.getValue());
17986             }
17987             int result = sNameValueCache.setStringsForPrefix(
17988                     resolver, createPrefix(namespace), compositeKeyValueMap);
17989             if (result == SET_ALL_RESULT_SUCCESS) {
17990                 return true;
17991             } else if (result == SET_ALL_RESULT_DISABLED) {
17992                 return false;
17993             }
17994             // If can't set given configuration that means it's bad
17995             throw new DeviceConfig.BadConfigException();
17996         }
17997 
17998         /**
17999          * Delete a name/value pair from the database for the specified namespace.
18000          *
18001          * @param resolver to access the database with.
18002          * @param namespace to delete the name/value pair from.
18003          * @param name to delete.
18004          * @return true if the value was deleted, false on database errors. If the name/value pair
18005          * did not exist, return True.
18006          *
18007          * @see #resetToDefaults(ContentResolver, int, String)
18008          *
18009          * @hide
18010          */
18011         @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
deleteString(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull String name)18012         static boolean deleteString(@NonNull ContentResolver resolver, @NonNull String namespace,
18013                 @NonNull String name) {
18014             return sNameValueCache.deleteStringForUser(resolver,
18015                     createCompositeName(namespace, name), resolver.getUserId());
18016         }
18017 
18018         /**
18019          * Reset the values to their defaults.
18020          * <p>
18021          * The method accepts an optional prefix parameter. If provided, only pairs with a name that
18022          * starts with the exact prefix will be reset. Otherwise all will be reset.
18023          *
18024          * @param resolver Handle to the content resolver.
18025          * @param resetMode The reset mode to use.
18026          * @param namespace Optionally, to limit which which namespace is reset.
18027          *
18028          * @see #putString(ContentResolver, String, String, String, boolean)
18029          *
18030          * @hide
18031          */
18032         @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
resetToDefaults(@onNull ContentResolver resolver, @ResetMode int resetMode, @Nullable String namespace)18033         static void resetToDefaults(@NonNull ContentResolver resolver, @ResetMode int resetMode,
18034                 @Nullable String namespace) {
18035             try {
18036                 Bundle arg = new Bundle();
18037                 arg.putInt(CALL_METHOD_USER_KEY, resolver.getUserId());
18038                 arg.putInt(CALL_METHOD_RESET_MODE_KEY, resetMode);
18039                 if (namespace != null) {
18040                     arg.putString(Settings.CALL_METHOD_PREFIX_KEY, createPrefix(namespace));
18041                 }
18042                 IContentProvider cp = sProviderHolder.getProvider(resolver);
18043                 cp.call(resolver.getAttributionSource(),
18044                         sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_CONFIG, null, arg);
18045             } catch (RemoteException e) {
18046                 Log.w(TAG, "Can't reset to defaults for " + DeviceConfig.CONTENT_URI, e);
18047             }
18048         }
18049 
18050         /**
18051          * Bridge method between {@link DeviceConfig#setSyncDisabledMode(int)} and the
18052          * {@link com.android.providers.settings.SettingsProvider} implementation.
18053          *
18054          * @hide
18055          */
18056         @SuppressLint("AndroidFrameworkRequiresPermission")
18057         @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
setSyncDisabledMode( @onNull ContentResolver resolver, @SyncDisabledMode int disableSyncMode)18058         static void setSyncDisabledMode(
18059                 @NonNull ContentResolver resolver, @SyncDisabledMode int disableSyncMode) {
18060             try {
18061                 Bundle args = new Bundle();
18062                 args.putInt(CALL_METHOD_SYNC_DISABLED_MODE_KEY, disableSyncMode);
18063                 IContentProvider cp = sProviderHolder.getProvider(resolver);
18064                 cp.call(resolver.getAttributionSource(), sProviderHolder.mUri.getAuthority(),
18065                         CALL_METHOD_SET_SYNC_DISABLED_MODE_CONFIG, null, args);
18066             } catch (RemoteException e) {
18067                 Log.w(TAG, "Can't set sync disabled mode " + DeviceConfig.CONTENT_URI, e);
18068             }
18069         }
18070 
18071         /**
18072          * Bridge method between {@link DeviceConfig#getSyncDisabledMode()} and the
18073          * {@link com.android.providers.settings.SettingsProvider} implementation.
18074          *
18075          * @hide
18076          */
18077         @SuppressLint("AndroidFrameworkRequiresPermission")
18078         @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
getSyncDisabledMode(@onNull ContentResolver resolver)18079         static int getSyncDisabledMode(@NonNull ContentResolver resolver) {
18080             try {
18081                 Bundle args = Bundle.EMPTY;
18082                 IContentProvider cp = sProviderHolder.getProvider(resolver);
18083                 Bundle bundle = cp.call(resolver.getAttributionSource(),
18084                         sProviderHolder.mUri.getAuthority(),
18085                         CALL_METHOD_GET_SYNC_DISABLED_MODE_CONFIG,
18086                         null, args);
18087                 return bundle.getInt(KEY_CONFIG_GET_SYNC_DISABLED_MODE_RETURN);
18088             } catch (RemoteException e) {
18089                 Log.w(TAG, "Can't query sync disabled mode " + DeviceConfig.CONTENT_URI, e);
18090             }
18091             return -1;
18092         }
18093 
18094         /**
18095          * Register callback for monitoring Config table.
18096          *
18097          * @param resolver Handle to the content resolver.
18098          * @param callback callback to register
18099          *
18100          * @hide
18101          */
18102         @RequiresPermission(Manifest.permission.MONITOR_DEVICE_CONFIG_ACCESS)
registerMonitorCallback(@onNull ContentResolver resolver, @NonNull RemoteCallback callback)18103         public static void registerMonitorCallback(@NonNull ContentResolver resolver,
18104                 @NonNull RemoteCallback callback) {
18105             registerMonitorCallbackAsUser(resolver, resolver.getUserId(), callback);
18106         }
18107 
registerMonitorCallbackAsUser( @onNull ContentResolver resolver, @UserIdInt int userHandle, @NonNull RemoteCallback callback)18108         private static void registerMonitorCallbackAsUser(
18109                 @NonNull ContentResolver resolver, @UserIdInt int userHandle,
18110                 @NonNull RemoteCallback callback) {
18111             try {
18112                 Bundle arg = new Bundle();
18113                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
18114                 arg.putParcelable(CALL_METHOD_MONITOR_CALLBACK_KEY, callback);
18115                 IContentProvider cp = sProviderHolder.getProvider(resolver);
18116                 cp.call(resolver.getAttributionSource(),
18117                         sProviderHolder.mUri.getAuthority(),
18118                         CALL_METHOD_REGISTER_MONITOR_CALLBACK_CONFIG, null, arg);
18119             } catch (RemoteException e) {
18120                 Log.w(TAG, "Can't register config monitor callback", e);
18121             }
18122         }
18123 
18124         /** @hide */
clearProviderForTest()18125         public static void clearProviderForTest() {
18126             sProviderHolder.clearProviderForTest();
18127             sNameValueCache.clearGenerationTrackerForTest();
18128         }
18129 
createCompositeName(@onNull String namespace, @NonNull String name)18130         private static String createCompositeName(@NonNull String namespace, @NonNull String name) {
18131             Preconditions.checkNotNull(namespace);
18132             Preconditions.checkNotNull(name);
18133             return createPrefix(namespace) + name;
18134         }
18135 
createPrefix(@onNull String namespace)18136         private static String createPrefix(@NonNull String namespace) {
18137             Preconditions.checkNotNull(namespace);
18138             return namespace + "/";
18139         }
18140     }
18141 
18142     /**
18143      * User-defined bookmarks and shortcuts.  The target of each bookmark is an
18144      * Intent URL, allowing it to be either a web page or a particular
18145      * application activity.
18146      *
18147      * @hide
18148      */
18149     public static final class Bookmarks implements BaseColumns
18150     {
18151         private static final String TAG = "Bookmarks";
18152 
18153         /**
18154          * The content:// style URL for this table
18155          */
18156         @UnsupportedAppUsage
18157         public static final Uri CONTENT_URI =
18158             Uri.parse("content://" + AUTHORITY + "/bookmarks");
18159 
18160         /**
18161          * The row ID.
18162          * <p>Type: INTEGER</p>
18163          */
18164         public static final String ID = "_id";
18165 
18166         /**
18167          * Descriptive name of the bookmark that can be displayed to the user.
18168          * If this is empty, the title should be resolved at display time (use
18169          * {@link #getTitle(Context, Cursor)} any time you want to display the
18170          * title of a bookmark.)
18171          * <P>
18172          * Type: TEXT
18173          * </P>
18174          */
18175         public static final String TITLE = "title";
18176 
18177         /**
18178          * Arbitrary string (displayed to the user) that allows bookmarks to be
18179          * organized into categories.  There are some special names for
18180          * standard folders, which all start with '@'.  The label displayed for
18181          * the folder changes with the locale (via {@link #getLabelForFolder}) but
18182          * the folder name does not change so you can consistently query for
18183          * the folder regardless of the current locale.
18184          *
18185          * <P>Type: TEXT</P>
18186          *
18187          */
18188         public static final String FOLDER = "folder";
18189 
18190         /**
18191          * The Intent URL of the bookmark, describing what it points to.  This
18192          * value is given to {@link android.content.Intent#getIntent} to create
18193          * an Intent that can be launched.
18194          * <P>Type: TEXT</P>
18195          */
18196         public static final String INTENT = "intent";
18197 
18198         /**
18199          * Optional shortcut character associated with this bookmark.
18200          * <P>Type: INTEGER</P>
18201          */
18202         public static final String SHORTCUT = "shortcut";
18203 
18204         /**
18205          * The order in which the bookmark should be displayed
18206          * <P>Type: INTEGER</P>
18207          */
18208         public static final String ORDERING = "ordering";
18209 
18210         private static final String[] sIntentProjection = { INTENT };
18211         private static final String[] sShortcutProjection = { ID, SHORTCUT };
18212         private static final String sShortcutSelection = SHORTCUT + "=?";
18213 
18214         /**
18215          * Convenience function to retrieve the bookmarked Intent for a
18216          * particular shortcut key.
18217          *
18218          * @param cr The ContentResolver to query.
18219          * @param shortcut The shortcut key.
18220          *
18221          * @return Intent The bookmarked URL, or null if there is no bookmark
18222          *         matching the given shortcut.
18223          */
getIntentForShortcut(ContentResolver cr, char shortcut)18224         public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
18225         {
18226             Intent intent = null;
18227 
18228             Cursor c = cr.query(CONTENT_URI,
18229                     sIntentProjection, sShortcutSelection,
18230                     new String[] { String.valueOf((int) shortcut) }, ORDERING);
18231             // Keep trying until we find a valid shortcut
18232             try {
18233                 while (intent == null && c.moveToNext()) {
18234                     try {
18235                         String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
18236                         intent = Intent.parseUri(intentURI, 0);
18237                     } catch (java.net.URISyntaxException e) {
18238                         // The stored URL is bad...  ignore it.
18239                     } catch (IllegalArgumentException e) {
18240                         // Column not found
18241                         Log.w(TAG, "Intent column not found", e);
18242                     }
18243                 }
18244             } finally {
18245                 if (c != null) c.close();
18246             }
18247 
18248             return intent;
18249         }
18250 
18251         /**
18252          * Add a new bookmark to the system.
18253          *
18254          * @param cr The ContentResolver to query.
18255          * @param intent The desired target of the bookmark.
18256          * @param title Bookmark title that is shown to the user; null if none
18257          *            or it should be resolved to the intent's title.
18258          * @param folder Folder in which to place the bookmark; null if none.
18259          * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
18260          *            this is non-zero and there is an existing bookmark entry
18261          *            with this same shortcut, then that existing shortcut is
18262          *            cleared (the bookmark is not removed).
18263          * @return The unique content URL for the new bookmark entry.
18264          */
18265         @UnsupportedAppUsage
add(ContentResolver cr, Intent intent, String title, String folder, char shortcut, int ordering)18266         public static Uri add(ContentResolver cr,
18267                                            Intent intent,
18268                                            String title,
18269                                            String folder,
18270                                            char shortcut,
18271                                            int ordering)
18272         {
18273             // If a shortcut is supplied, and it is already defined for
18274             // another bookmark, then remove the old definition.
18275             if (shortcut != 0) {
18276                 cr.delete(CONTENT_URI, sShortcutSelection,
18277                         new String[] { String.valueOf((int) shortcut) });
18278             }
18279 
18280             ContentValues values = new ContentValues();
18281             if (title != null) values.put(TITLE, title);
18282             if (folder != null) values.put(FOLDER, folder);
18283             values.put(INTENT, intent.toUri(0));
18284             if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
18285             values.put(ORDERING, ordering);
18286             return cr.insert(CONTENT_URI, values);
18287         }
18288 
18289         /**
18290          * Return the folder name as it should be displayed to the user.  This
18291          * takes care of localizing special folders.
18292          *
18293          * @param r Resources object for current locale; only need access to
18294          *          system resources.
18295          * @param folder The value found in the {@link #FOLDER} column.
18296          *
18297          * @return CharSequence The label for this folder that should be shown
18298          *         to the user.
18299          */
getLabelForFolder(Resources r, String folder)18300         public static CharSequence getLabelForFolder(Resources r, String folder) {
18301             return folder;
18302         }
18303 
18304         /**
18305          * Return the title as it should be displayed to the user. This takes
18306          * care of localizing bookmarks that point to activities.
18307          *
18308          * @param context A context.
18309          * @param cursor A cursor pointing to the row whose title should be
18310          *        returned. The cursor must contain at least the {@link #TITLE}
18311          *        and {@link #INTENT} columns.
18312          * @return A title that is localized and can be displayed to the user,
18313          *         or the empty string if one could not be found.
18314          */
getTitle(Context context, Cursor cursor)18315         public static CharSequence getTitle(Context context, Cursor cursor) {
18316             int titleColumn = cursor.getColumnIndex(TITLE);
18317             int intentColumn = cursor.getColumnIndex(INTENT);
18318             if (titleColumn == -1 || intentColumn == -1) {
18319                 throw new IllegalArgumentException(
18320                         "The cursor must contain the TITLE and INTENT columns.");
18321             }
18322 
18323             String title = cursor.getString(titleColumn);
18324             if (!TextUtils.isEmpty(title)) {
18325                 return title;
18326             }
18327 
18328             String intentUri = cursor.getString(intentColumn);
18329             if (TextUtils.isEmpty(intentUri)) {
18330                 return "";
18331             }
18332 
18333             Intent intent;
18334             try {
18335                 intent = Intent.parseUri(intentUri, 0);
18336             } catch (URISyntaxException e) {
18337                 return "";
18338             }
18339 
18340             PackageManager packageManager = context.getPackageManager();
18341             ResolveInfo info = packageManager.resolveActivity(intent, 0);
18342             return info != null ? info.loadLabel(packageManager) : "";
18343         }
18344     }
18345 
18346     /**
18347      * <p>
18348      *     A Settings panel is floating UI that contains a fixed subset of settings to address a
18349      *     particular user problem. For example, the
18350      *     {@link #ACTION_INTERNET_CONNECTIVITY Internet Panel} surfaces settings related to
18351      *     connecting to the internet.
18352      * <p>
18353      *     Settings panels appear above the calling app to address the problem without
18354      *     the user needing to open Settings and thus leave their current screen.
18355      */
18356     public static final class Panel {
Panel()18357         private Panel() {
18358         }
18359 
18360         /**
18361          * Activity Action: Show a settings dialog containing settings to enable internet
18362          * connection.
18363          * <p>
18364          * Input: Nothing.
18365          * <p>
18366          * Output: Nothing.
18367          */
18368         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
18369         public static final String ACTION_INTERNET_CONNECTIVITY =
18370                 "android.settings.panel.action.INTERNET_CONNECTIVITY";
18371 
18372         /**
18373          * Activity Action: Show a settings dialog containing NFC-related settings.
18374          * <p>
18375          * Input: Nothing.
18376          * <p>
18377          * Output: Nothing.
18378          */
18379         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
18380         public static final String ACTION_NFC =
18381                 "android.settings.panel.action.NFC";
18382 
18383         /**
18384          * Activity Action: Show a settings dialog containing controls for Wifi.
18385          * <p>
18386          * Input: Nothing.
18387          * <p>
18388          * Output: Nothing.
18389          */
18390         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
18391         public static final String ACTION_WIFI =
18392                 "android.settings.panel.action.WIFI";
18393 
18394         /**
18395          * Activity Action: Show a settings dialog containing all volume streams.
18396          * <p>
18397          * Input: Nothing.
18398          * <p>
18399          * Output: Nothing.
18400          */
18401         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
18402         public static final String ACTION_VOLUME =
18403                 "android.settings.panel.action.VOLUME";
18404     }
18405 
18406     /**
18407      * Activity Action: Show setting page to process the addition of Wi-Fi networks to the user's
18408      * saved network list. The app should send a new intent with an extra that holds a maximum
18409      * of five {@link android.net.wifi.WifiNetworkSuggestion} that specify credentials for the
18410      * networks to be added to the user's database. The Intent should be sent via the
18411      * {@link android.app.Activity#startActivityForResult(Intent, int)} API.
18412      * <p>
18413      * Note: The app sending the Intent to add the credentials doesn't get any ownership over the
18414      * newly added network(s). For the Wi-Fi stack, these networks will look like the user
18415      * manually added them from the Settings UI.
18416      * <p>
18417      * Input: The app should put parcelable array list of
18418      * {@link android.net.wifi.WifiNetworkSuggestion} into the {@link #EXTRA_WIFI_NETWORK_LIST}
18419      * extra.
18420      * <p>
18421      * Output: After {@link android.app.Activity#startActivityForResult(Intent, int)}, the
18422      * callback {@link android.app.Activity#onActivityResult(int, int, Intent)} will have a
18423      * result code {@link android.app.Activity#RESULT_OK} to indicate user pressed the save
18424      * button to save the networks or {@link android.app.Activity#RESULT_CANCELED} to indicate
18425      * that the user rejected the request. Additionally, an integer array list, stored in
18426      * {@link #EXTRA_WIFI_NETWORK_RESULT_LIST}, will indicate the process result of each network.
18427      */
18428     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
18429     public static final String ACTION_WIFI_ADD_NETWORKS =
18430             "android.settings.WIFI_ADD_NETWORKS";
18431 
18432     /**
18433      * A bundle extra of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that indicates the list
18434      * of the {@link android.net.wifi.WifiNetworkSuggestion} elements. The maximum count of the
18435      * {@link android.net.wifi.WifiNetworkSuggestion} elements in the list will be five.
18436      * <p>
18437      * For example:
18438      * To provide credentials for one open and one WPA2 networks:
18439      *
18440      * <pre>{@code
18441      * final WifiNetworkSuggestion suggestion1 =
18442      *       new WifiNetworkSuggestion.Builder()
18443      *       .setSsid("test111111")
18444      *       .build();
18445      * final WifiNetworkSuggestion suggestion2 =
18446      *       new WifiNetworkSuggestion.Builder()
18447      *       .setSsid("test222222")
18448      *       .setWpa2Passphrase("test123456")
18449      *       .build();
18450      * final List<WifiNetworkSuggestion> suggestionsList = new ArrayList<>;
18451      * suggestionsList.add(suggestion1);
18452      * suggestionsList.add(suggestion2);
18453      * Bundle bundle = new Bundle();
18454      * bundle.putParcelableArrayList(Settings.EXTRA_WIFI_NETWORK_LIST,(ArrayList<? extends
18455      * Parcelable>) suggestionsList);
18456      * final Intent intent = new Intent(Settings.ACTION_WIFI_ADD_NETWORKS);
18457      * intent.putExtras(bundle);
18458      * startActivityForResult(intent, 0);
18459      * }</pre>
18460      */
18461     public static final String EXTRA_WIFI_NETWORK_LIST =
18462             "android.provider.extra.WIFI_NETWORK_LIST";
18463 
18464     /**
18465      * A bundle extra of the result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that
18466      * indicates the action result of the saved {@link android.net.wifi.WifiNetworkSuggestion}.
18467      * Its value is a list of integers, and all the elements will be 1:1 mapping to the elements
18468      * in {@link #EXTRA_WIFI_NETWORK_LIST}, if user press cancel to cancel the add networks
18469      * request, then its value will be null.
18470      * <p>
18471      * Note: The integer value will be one of the {@link #ADD_WIFI_RESULT_SUCCESS},
18472      * {@link #ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED}, or {@link #ADD_WIFI_RESULT_ALREADY_EXISTS}}.
18473      */
18474     public static final String EXTRA_WIFI_NETWORK_RESULT_LIST =
18475             "android.provider.extra.WIFI_NETWORK_RESULT_LIST";
18476 
18477     /** @hide */
18478     @Retention(RetentionPolicy.SOURCE)
18479     @IntDef(prefix = {"ADD_WIFI_RESULT_"}, value = {
18480             ADD_WIFI_RESULT_SUCCESS,
18481             ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED,
18482             ADD_WIFI_RESULT_ALREADY_EXISTS
18483     })
18484     public @interface AddWifiResult {
18485     }
18486 
18487     /**
18488      * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that saving or updating the
18489      * corresponding Wi-Fi network was successful.
18490      */
18491     public static final int ADD_WIFI_RESULT_SUCCESS = 0;
18492 
18493     /**
18494      * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that saving the corresponding
18495      * Wi-Fi network failed.
18496      */
18497     public static final int ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED = 1;
18498 
18499     /**
18500      * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that indicates the Wi-Fi network
18501      * already exists.
18502      */
18503     public static final int ADD_WIFI_RESULT_ALREADY_EXISTS = 2;
18504 
18505     /**
18506      * Activity Action: Allows user to select current bug report handler.
18507      * <p>
18508      * Input: Nothing.
18509      * <p>
18510      * Output: Nothing.
18511      *
18512      * @hide
18513      */
18514     @SystemApi
18515     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
18516     public static final String ACTION_BUGREPORT_HANDLER_SETTINGS =
18517             "android.settings.BUGREPORT_HANDLER_SETTINGS";
18518 
18519     private static final String[] PM_WRITE_SETTINGS = {
18520         android.Manifest.permission.WRITE_SETTINGS
18521     };
18522     private static final String[] PM_CHANGE_NETWORK_STATE = {
18523         android.Manifest.permission.CHANGE_NETWORK_STATE,
18524         android.Manifest.permission.WRITE_SETTINGS
18525     };
18526     private static final String[] PM_SYSTEM_ALERT_WINDOW = {
18527         android.Manifest.permission.SYSTEM_ALERT_WINDOW
18528     };
18529 
18530     /**
18531      * Activity Action: Show screen for controlling which apps have access to manage external
18532      * storage.
18533      * <p>
18534      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
18535      * <p>
18536      * If you want to control a specific app's access to manage external storage, use
18537      * {@link #ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION} instead.
18538      * <p>
18539      * Output: Nothing.
18540      * @see #ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
18541      */
18542     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
18543     public static final String ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION =
18544             "android.settings.MANAGE_ALL_FILES_ACCESS_PERMISSION";
18545 
18546     /**
18547      * Activity Action: Show screen for controlling if the app specified in the data URI of the
18548      * intent can manage external storage.
18549      * <p>
18550      * Launching the corresponding activity requires the permission
18551      * {@link Manifest.permission#MANAGE_EXTERNAL_STORAGE}.
18552      * <p>
18553      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
18554      * <p>
18555      * Input: The Intent's data URI MUST specify the application package name whose ability of
18556      * managing external storage you want to control.
18557      * For example "package:com.my.app".
18558      * <p>
18559      * Output: Nothing.
18560      * @see #ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION
18561      */
18562     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
18563     public static final String ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION =
18564             "android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION";
18565 
18566     /**
18567      * Activity Action: For system or preinstalled apps to show their {@link Activity} embedded
18568      * in Settings app on large screen devices.
18569      *
18570      * Developers should resolve the Intent action before using it.
18571      *
18572      * <p>
18573      *     Input: {@link #EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_INTENT_URI} must be included to
18574      * specify the intent for the activity which will be embedded in Settings app.
18575      * It's an intent URI string from {@code intent.toUri(Intent.URI_INTENT_SCHEME)}.
18576      *
18577      *     Input: {@link #EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_HIGHLIGHT_MENU_KEY} must be included to
18578      * specify a key that indicates the menu item which will be highlighted on settings home menu.
18579      * <p>
18580      * Output: Nothing.
18581      */
18582     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
18583     public static final String ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY =
18584             "android.settings.SETTINGS_EMBED_DEEP_LINK_ACTIVITY";
18585 
18586     /**
18587      * Activity Extra: Specify the intent for the {@link Activity} which will be embedded in
18588      * Settings app. It's an intent URI string from
18589      * {@code intent.toUri(Intent.URI_INTENT_SCHEME)}.
18590      * <p>
18591      * This must be passed as an extra field to
18592      * {@link #ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY}.
18593      */
18594     public static final String EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_INTENT_URI =
18595             "android.provider.extra.SETTINGS_EMBEDDED_DEEP_LINK_INTENT_URI";
18596 
18597     /**
18598      * Activity Extra: Specify a key that indicates the menu item which should be highlighted on
18599      * settings home menu.
18600      * <p>
18601      * This must be passed as an extra field to
18602      * {@link #ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY}.
18603      */
18604     public static final String EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_HIGHLIGHT_MENU_KEY =
18605             "android.provider.extra.SETTINGS_EMBEDDED_DEEP_LINK_HIGHLIGHT_MENU_KEY";
18606 
18607     /**
18608      * Performs a strict and comprehensive check of whether a calling package is allowed to
18609      * write/modify system settings, as the condition differs for pre-M, M+, and
18610      * privileged/preinstalled apps. If the provided uid does not match the
18611      * callingPackage, a negative result will be returned.
18612      * @hide
18613      */
18614     @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
isCallingPackageAllowedToWriteSettings(Context context, int uid, String callingPackage, boolean throwException)18615     public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid,
18616             String callingPackage, boolean throwException) {
18617         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
18618                 callingPackage, null /*attribution not needed when not making note */,
18619                 throwException, AppOpsManager.OP_WRITE_SETTINGS, PM_WRITE_SETTINGS,
18620                 false);
18621     }
18622 
18623     /**
18624      * @deprecated Use {@link #checkAndNoteWriteSettingsOperation(Context, int, String, String,
18625      * boolean)} instead.
18626      *
18627      * @hide
18628      */
18629     @Deprecated
18630     @SystemApi
checkAndNoteWriteSettingsOperation(@onNull Context context, int uid, @NonNull String callingPackage, boolean throwException)18631     public static boolean checkAndNoteWriteSettingsOperation(@NonNull Context context, int uid,
18632             @NonNull String callingPackage, boolean throwException) {
18633         return checkAndNoteWriteSettingsOperation(context, uid, callingPackage, null,
18634                 throwException);
18635     }
18636 
18637     /**
18638      * Performs a strict and comprehensive check of whether a calling package is allowed to
18639      * write/modify system settings, as the condition differs for pre-M, M+, and
18640      * privileged/preinstalled apps. If the provided uid does not match the
18641      * callingPackage, a negative result will be returned. The caller is expected to have
18642      * the WRITE_SETTINGS permission declared.
18643      *
18644      * Note: if the check is successful, the operation of this app will be updated to the
18645      * current time.
18646      * @hide
18647      */
18648     @SystemApi
checkAndNoteWriteSettingsOperation(@onNull Context context, int uid, @NonNull String callingPackage, @Nullable String callingAttributionTag, boolean throwException)18649     public static boolean checkAndNoteWriteSettingsOperation(@NonNull Context context, int uid,
18650             @NonNull String callingPackage, @Nullable String callingAttributionTag,
18651             boolean throwException) {
18652         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
18653                 callingPackage, callingAttributionTag, throwException,
18654                 AppOpsManager.OP_WRITE_SETTINGS, PM_WRITE_SETTINGS, true);
18655     }
18656 
18657     /**
18658      * Performs a strict and comprehensive check of whether a calling package is allowed to
18659      * draw on top of other apps, as the conditions differs for pre-M, M+, and
18660      * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
18661      * a negative result will be returned.
18662      * @hide
18663      */
18664     @UnsupportedAppUsage
isCallingPackageAllowedToDrawOverlays(Context context, int uid, String callingPackage, boolean throwException)18665     public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid,
18666             String callingPackage, boolean throwException) {
18667         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
18668                 callingPackage, null /*attribution not needed when not making note */,
18669                 throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, PM_SYSTEM_ALERT_WINDOW,
18670                 false);
18671     }
18672 
18673     /**
18674      * Performs a strict and comprehensive check of whether a calling package is allowed to
18675      * draw on top of other apps, as the conditions differs for pre-M, M+, and
18676      * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
18677      * a negative result will be returned.
18678      *
18679      * Note: if the check is successful, the operation of this app will be updated to the
18680      * current time.
18681      * @hide
18682      */
checkAndNoteDrawOverlaysOperation(Context context, int uid, String callingPackage, String callingAttributionTag, boolean throwException)18683     public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid,
18684             String callingPackage, String callingAttributionTag, boolean throwException) {
18685         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
18686                 callingPackage, callingAttributionTag, throwException,
18687                 AppOpsManager.OP_SYSTEM_ALERT_WINDOW, PM_SYSTEM_ALERT_WINDOW, true);
18688     }
18689 
18690     /**
18691      * @deprecated Use {@link #isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context,
18692      * int, String, String, boolean, int, String[], boolean)} instead.
18693      *
18694      * @hide
18695      */
18696     @Deprecated
18697     @UnsupportedAppUsage
isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] permissions, boolean makeNote)18698     public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
18699             int uid, String callingPackage, boolean throwException, int appOpsOpCode,
18700             String[] permissions, boolean makeNote) {
18701         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
18702                 callingPackage, null, throwException, appOpsOpCode, permissions, makeNote);
18703     }
18704 
18705     /**
18706      * Helper method to perform a general and comprehensive check of whether an operation that is
18707      * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and
18708      * OP_WRITE_SETTINGS
18709      * @hide
18710      */
isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, int uid, String callingPackage, String callingAttributionTag, boolean throwException, int appOpsOpCode, String[] permissions, boolean makeNote)18711     public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
18712             int uid, String callingPackage, String callingAttributionTag, boolean throwException,
18713             int appOpsOpCode, String[] permissions, boolean makeNote) {
18714         if (callingPackage == null) {
18715             return false;
18716         }
18717 
18718         AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE);
18719         int mode = AppOpsManager.MODE_DEFAULT;
18720         if (makeNote) {
18721             mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage, callingAttributionTag,
18722                     null);
18723         } else {
18724             mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage);
18725         }
18726 
18727         switch (mode) {
18728             case AppOpsManager.MODE_ALLOWED:
18729                 return true;
18730 
18731             case AppOpsManager.MODE_DEFAULT:
18732                 // this is the default operating mode after an app's installation
18733                 // In this case we will check all associated static permission to see
18734                 // if it is granted during install time.
18735                 for (String permission : permissions) {
18736                     if (context.checkCallingOrSelfPermission(permission) == PackageManager
18737                             .PERMISSION_GRANTED) {
18738                         // if either of the permissions are granted, we will allow it
18739                         return true;
18740                     }
18741                 }
18742 
18743             default:
18744                 // this is for all other cases trickled down here...
18745                 if (!throwException) {
18746                     return false;
18747                 }
18748         }
18749 
18750         // prepare string to throw SecurityException
18751         StringBuilder exceptionMessage = new StringBuilder();
18752         exceptionMessage.append(callingPackage);
18753         exceptionMessage.append(" was not granted ");
18754         if (permissions.length > 1) {
18755             exceptionMessage.append(" either of these permissions: ");
18756         } else {
18757             exceptionMessage.append(" this permission: ");
18758         }
18759         for (int i = 0; i < permissions.length; i++) {
18760             exceptionMessage.append(permissions[i]);
18761             exceptionMessage.append((i == permissions.length - 1) ? "." : ", ");
18762         }
18763 
18764         throw new SecurityException(exceptionMessage.toString());
18765     }
18766 
18767     /**
18768      * Retrieves a correponding package name for a given uid. It will query all
18769      * packages that are associated with the given uid, but it will return only
18770      * the zeroth result.
18771      * Note: If package could not be found, a null is returned.
18772      * @hide
18773      */
getPackageNameForUid(Context context, int uid)18774     public static String getPackageNameForUid(Context context, int uid) {
18775         String[] packages = context.getPackageManager().getPackagesForUid(uid);
18776         if (packages == null) {
18777             return null;
18778         }
18779         return packages[0];
18780     }
18781 }
18782