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 static android.provider.SettingsValidators.ANY_INTEGER_VALIDATOR;
20 import static android.provider.SettingsValidators.ANY_STRING_VALIDATOR;
21 import static android.provider.SettingsValidators.BOOLEAN_VALIDATOR;
22 import static android.provider.SettingsValidators.COMPONENT_NAME_VALIDATOR;
23 import static android.provider.SettingsValidators.LENIENT_IP_ADDRESS_VALIDATOR;
24 import static android.provider.SettingsValidators.LOCALE_VALIDATOR;
25 import static android.provider.SettingsValidators.NON_NEGATIVE_INTEGER_VALIDATOR;
26 import static android.provider.SettingsValidators.NULLABLE_COMPONENT_NAME_VALIDATOR;
27 import static android.provider.SettingsValidators.PACKAGE_NAME_VALIDATOR;
28 import static android.provider.SettingsValidators.URI_VALIDATOR;
29 
30 import android.Manifest;
31 import android.annotation.IntDef;
32 import android.annotation.IntRange;
33 import android.annotation.NonNull;
34 import android.annotation.Nullable;
35 import android.annotation.RequiresPermission;
36 import android.annotation.SdkConstant;
37 import android.annotation.SdkConstant.SdkConstantType;
38 import android.annotation.SystemApi;
39 import android.annotation.TestApi;
40 import android.annotation.UnsupportedAppUsage;
41 import android.annotation.UserIdInt;
42 import android.app.ActivityThread;
43 import android.app.AppOpsManager;
44 import android.app.Application;
45 import android.app.NotificationChannel;
46 import android.app.NotificationManager;
47 import android.app.SearchManager;
48 import android.app.WallpaperManager;
49 import android.content.ComponentName;
50 import android.content.ContentResolver;
51 import android.content.ContentValues;
52 import android.content.Context;
53 import android.content.IContentProvider;
54 import android.content.Intent;
55 import android.content.pm.ActivityInfo;
56 import android.content.pm.PackageManager;
57 import android.content.pm.ResolveInfo;
58 import android.content.res.Configuration;
59 import android.content.res.Resources;
60 import android.database.Cursor;
61 import android.database.SQLException;
62 import android.hardware.display.ColorDisplayManager;
63 import android.location.LocationManager;
64 import android.media.AudioFormat;
65 import android.net.ConnectivityManager;
66 import android.net.NetworkScoreManager;
67 import android.net.Uri;
68 import android.net.wifi.WifiManager;
69 import android.os.BatteryManager;
70 import android.os.Binder;
71 import android.os.Build.VERSION_CODES;
72 import android.os.Bundle;
73 import android.os.DropBoxManager;
74 import android.os.IBinder;
75 import android.os.LocaleList;
76 import android.os.PowerManager.AutoPowerSaveModeTriggers;
77 import android.os.Process;
78 import android.os.RemoteException;
79 import android.os.ResultReceiver;
80 import android.os.ServiceManager;
81 import android.os.UserHandle;
82 import android.provider.SettingsValidators.Validator;
83 import android.speech.tts.TextToSpeech;
84 import android.telephony.SubscriptionManager;
85 import android.text.TextUtils;
86 import android.util.AndroidException;
87 import android.util.ArrayMap;
88 import android.util.ArraySet;
89 import android.util.Log;
90 import android.util.MemoryIntArray;
91 import android.view.inputmethod.InputMethodSystemProperty;
92 
93 import com.android.internal.annotations.GuardedBy;
94 import com.android.internal.widget.ILockSettings;
95 
96 import java.io.IOException;
97 import java.lang.annotation.Retention;
98 import java.lang.annotation.RetentionPolicy;
99 import java.net.URISyntaxException;
100 import java.text.SimpleDateFormat;
101 import java.util.HashMap;
102 import java.util.HashSet;
103 import java.util.Locale;
104 import java.util.Map;
105 import java.util.Set;
106 
107 /**
108  * The Settings provider contains global system-level device preferences.
109  */
110 public final class Settings {
111 
112     // Intent actions for Settings
113 
114     /**
115      * Activity Action: Show system settings.
116      * <p>
117      * Input: Nothing.
118      * <p>
119      * Output: Nothing.
120      */
121     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
122     public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
123 
124     /**
125      * Activity Action: Show settings to allow configuration of APNs.
126      * <p>
127      * Input: Nothing.
128      * <p>
129      * Output: Nothing.
130      *
131      * <p class="note">
132      * In some cases, a matching Activity may not exist, so ensure you
133      * safeguard against this.
134      */
135     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
136     public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
137 
138     /**
139      * Activity Action: Show settings to allow configuration of current location
140      * sources.
141      * <p>
142      * In some cases, a matching Activity may not exist, so ensure you
143      * safeguard against this.
144      * <p>
145      * Input: Nothing.
146      * <p>
147      * Output: Nothing.
148      */
149     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
150     public static final String ACTION_LOCATION_SOURCE_SETTINGS =
151             "android.settings.LOCATION_SOURCE_SETTINGS";
152 
153     /**
154      * Activity Action: Show settings to allow configuration of location controller extra package.
155      * <p>
156      * In some cases, a matching Activity may not exist, so ensure you
157      * safeguard against this.
158      * <p>
159      * Input: Nothing.
160      * <p>
161      * Output: Nothing.
162      *
163      * @hide
164      */
165     @SystemApi
166     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
167     public static final String ACTION_LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS =
168             "android.settings.LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS";
169 
170     /**
171      * Activity Action: Show scanning settings to allow configuration of Wi-Fi
172      * and Bluetooth scanning settings.
173      * <p>
174      * In some cases, a matching Activity may not exist, so ensure you
175      * safeguard against this.
176      * <p>
177      * Input: Nothing.
178      * <p>
179      * Output: Nothing.
180      * @hide
181      */
182     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
183     public static final String ACTION_LOCATION_SCANNING_SETTINGS =
184             "android.settings.LOCATION_SCANNING_SETTINGS";
185 
186     /**
187      * Activity Action: Show settings to allow configuration of users.
188      * <p>
189      * In some cases, a matching Activity may not exist, so ensure you
190      * safeguard against this.
191      * <p>
192      * Input: Nothing.
193      * <p>
194      * Output: Nothing.
195      * @hide
196      */
197     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
198     public static final String ACTION_USER_SETTINGS =
199             "android.settings.USER_SETTINGS";
200 
201     /**
202      * Activity Action: Show settings to allow configuration of wireless controls
203      * such as Wi-Fi, Bluetooth and Mobile networks.
204      * <p>
205      * In some cases, a matching Activity may not exist, so ensure you
206      * safeguard against this.
207      * <p>
208      * Input: Nothing.
209      * <p>
210      * Output: Nothing.
211      */
212     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
213     public static final String ACTION_WIRELESS_SETTINGS =
214             "android.settings.WIRELESS_SETTINGS";
215 
216     /**
217      * Activity Action: Show tether provisioning activity.
218      *
219      * <p>
220      * In some cases, a matching Activity may not exist, so ensure you
221      * safeguard against this.
222      * <p>
223      * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type
224      * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should
225      * contain a {@link ResultReceiver} which will be called back with a tether result code.
226      * <p>
227      * Output: The result of the provisioning check.
228      * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful,
229      * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure.
230      *
231      * @hide
232      */
233     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
234     public static final String ACTION_TETHER_PROVISIONING =
235             "android.settings.TETHER_PROVISIONING_UI";
236 
237     /**
238      * Activity Action: Show settings to allow entering/exiting airplane mode.
239      * <p>
240      * In some cases, a matching Activity may not exist, so ensure you
241      * safeguard against this.
242      * <p>
243      * Input: Nothing.
244      * <p>
245      * Output: Nothing.
246      */
247     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
248     public static final String ACTION_AIRPLANE_MODE_SETTINGS =
249             "android.settings.AIRPLANE_MODE_SETTINGS";
250 
251     /**
252      * Activity Action: Show mobile data usage list.
253      * <p>
254      * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify
255      * how and what mobile data statistics should be collected.
256      * <p>
257      * Output: Nothing
258      * @hide
259      */
260     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
261     public static final String ACTION_MOBILE_DATA_USAGE =
262             "android.settings.MOBILE_DATA_USAGE";
263 
264     /** @hide */
265     public static final String EXTRA_NETWORK_TEMPLATE = "network_template";
266 
267     /**
268      * An int extra specifying a subscription ID.
269      *
270      * @see android.telephony.SubscriptionInfo#getSubscriptionId
271      */
272     public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID";
273 
274     /**
275      * Activity Action: Modify Airplane mode settings using a voice command.
276      * <p>
277      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
278      * <p>
279      * This intent MUST be started using
280      * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
281      * startVoiceActivity}.
282      * <p>
283      * Note: The activity implementing this intent MUST verify that
284      * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
285      * modifying the setting.
286      * <p>
287      * Input: To tell which state airplane mode should be set to, add the
288      * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
289      * If the extra is not included, no changes will be made.
290      * <p>
291      * Output: Nothing.
292      */
293     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
294     public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
295             "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
296 
297     /**
298      * Activity Action: Show settings for accessibility modules.
299      * <p>
300      * In some cases, a matching Activity may not exist, so ensure you
301      * safeguard against this.
302      * <p>
303      * Input: Nothing.
304      * <p>
305      * Output: Nothing.
306      */
307     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
308     public static final String ACTION_ACCESSIBILITY_SETTINGS =
309             "android.settings.ACCESSIBILITY_SETTINGS";
310 
311     /**
312      * Activity Action: Show detail settings of a particular accessibility service.
313      * <p>
314      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
315      * <p>
316      * Input: {@link Intent#EXTRA_COMPONENT_NAME} must specify the accessibility service component
317      * name to be shown.
318      * <p>
319      * Output: Nothing.
320      * @hide
321      **/
322     @SystemApi
323     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
324     public static final String ACTION_ACCESSIBILITY_DETAILS_SETTINGS =
325             "android.settings.ACCESSIBILITY_DETAILS_SETTINGS";
326 
327     /**
328      * Activity Action: Show settings to control access to usage information.
329      * <p>
330      * In some cases, a matching Activity may not exist, so ensure you
331      * safeguard against this.
332      * <p>
333      * Input: Nothing.
334      * <p>
335      * Output: Nothing.
336      */
337     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
338     public static final String ACTION_USAGE_ACCESS_SETTINGS =
339             "android.settings.USAGE_ACCESS_SETTINGS";
340 
341     /**
342      * Activity Category: Show application settings related to usage access.
343      * <p>
344      * An activity that provides a user interface for adjusting usage access related
345      * preferences for its containing application. Optional but recommended for apps that
346      * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}.
347      * <p>
348      * The activity may define meta-data to describe what usage access is
349      * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which
350      * will be displayed in Settings.
351      * <p>
352      * Input: Nothing.
353      * <p>
354      * Output: Nothing.
355      */
356     @SdkConstant(SdkConstantType.INTENT_CATEGORY)
357     public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG =
358             "android.intent.category.USAGE_ACCESS_CONFIG";
359 
360     /**
361      * Metadata key: Reason for needing usage access.
362      * <p>
363      * A key for metadata attached to an activity that receives action
364      * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the
365      * user as description of how the app uses usage access.
366      * <p>
367      */
368     public static final String METADATA_USAGE_ACCESS_REASON =
369             "android.settings.metadata.USAGE_ACCESS_REASON";
370 
371     /**
372      * Activity Action: Show settings to allow configuration of security and
373      * location privacy.
374      * <p>
375      * In some cases, a matching Activity may not exist, so ensure you
376      * safeguard against this.
377      * <p>
378      * Input: Nothing.
379      * <p>
380      * Output: Nothing.
381      */
382     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
383     public static final String ACTION_SECURITY_SETTINGS =
384             "android.settings.SECURITY_SETTINGS";
385 
386     /**
387      * Activity Action: Show settings to allow configuration of trusted external sources
388      *
389      * Input: Optionally, the Intent's data URI can specify the application package name to
390      * directly invoke the management GUI specific to the package name. For example
391      * "package:com.my.app".
392      * <p>
393      * Output: Nothing.
394      */
395     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
396     public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES =
397             "android.settings.MANAGE_UNKNOWN_APP_SOURCES";
398 
399     /**
400      * Activity Action: Show the "Open by Default" page in a particular application's details page.
401      * <p>
402      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
403      * <p>
404      * Input: The Intent's data URI specifies the application package name
405      * to be shown, with the "package" scheme. That is "package:com.my.app".
406      * <p>
407      * Output: Nothing.
408      * @hide
409      */
410     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
411     public static final String ACTION_APP_OPEN_BY_DEFAULT_SETTINGS =
412             "com.android.settings.APP_OPEN_BY_DEFAULT_SETTINGS";
413 
414     /**
415      * Activity Action: Show trusted credentials settings, opening to the user tab,
416      * to allow management of installed credentials.
417      * <p>
418      * In some cases, a matching Activity may not exist, so ensure you
419      * safeguard against this.
420      * <p>
421      * Input: Nothing.
422      * <p>
423      * Output: Nothing.
424      * @hide
425      */
426     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
427     @UnsupportedAppUsage
428     public static final String ACTION_TRUSTED_CREDENTIALS_USER =
429             "com.android.settings.TRUSTED_CREDENTIALS_USER";
430 
431     /**
432      * Activity Action: Show dialog explaining that an installed CA cert may enable
433      * monitoring of encrypted network traffic.
434      * <p>
435      * In some cases, a matching Activity may not exist, so ensure you
436      * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the
437      * number of certificates.
438      * <p>
439      * Input: Nothing.
440      * <p>
441      * Output: Nothing.
442      * @hide
443      */
444     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
445     public static final String ACTION_MONITORING_CERT_INFO =
446             "com.android.settings.MONITORING_CERT_INFO";
447 
448     /**
449      * Activity Action: Show settings to allow configuration of privacy options.
450      * <p>
451      * In some cases, a matching Activity may not exist, so ensure you
452      * safeguard against this.
453      * <p>
454      * Input: Nothing.
455      * <p>
456      * Output: Nothing.
457      */
458     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
459     public static final String ACTION_PRIVACY_SETTINGS =
460             "android.settings.PRIVACY_SETTINGS";
461 
462     /**
463      * Activity Action: Show settings to allow configuration of VPN.
464      * <p>
465      * In some cases, a matching Activity may not exist, so ensure you
466      * safeguard against this.
467      * <p>
468      * Input: Nothing.
469      * <p>
470      * Output: Nothing.
471      */
472     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
473     public static final String ACTION_VPN_SETTINGS =
474             "android.settings.VPN_SETTINGS";
475 
476     /**
477      * Activity Action: Show settings to allow configuration of Wi-Fi.
478      * <p>
479      * In some cases, a matching Activity may not exist, so ensure you
480      * safeguard against this.
481      * <p>
482      * Input: Nothing.
483      * <p>
484      * Output: Nothing.
485      */
486     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
487     public static final String ACTION_WIFI_SETTINGS =
488             "android.settings.WIFI_SETTINGS";
489 
490     /**
491      * Activity Action: Show settings to allow configuration of a static IP
492      * address for Wi-Fi.
493      * <p>
494      * In some cases, a matching Activity may not exist, so ensure you safeguard
495      * against this.
496      * <p>
497      * Input: Nothing.
498      * <p>
499      * Output: Nothing.
500      */
501     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
502     public static final String ACTION_WIFI_IP_SETTINGS =
503             "android.settings.WIFI_IP_SETTINGS";
504 
505     /**
506      * Activity Action: Show setting page to process an Easy Connect (Wi-Fi DPP) QR code and start
507      * configuration. This intent should be used when you want to use this device to take on the
508      * configurator role for an IoT/other device. When provided with a valid DPP URI string Settings
509      * will open a wifi selection screen for the user to indicate which network they would like
510      * to configure the device specified in the DPP URI string for and carry them through the rest
511      * of the flow for provisioning the device.
512      * <p>
513      * In some cases, a matching Activity may not exist, so ensure you safeguard
514      * against this by checking WifiManager.isEasyConnectSupported();
515      * <p>
516      * Input: The Intent's data URI specifies bootstrapping information for authenticating and
517      * provisioning the peer, with the "DPP" scheme.
518      * <p>
519      * Output: After {@code startActivityForResult}, the callback {@code onActivityResult} will have
520      *         resultCode {@link android.app.Activity#RESULT_OK} if Wi-Fi Easy Connect configuration
521      *         success and the user clicks 'Done' button.
522      */
523     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
524     public static final String ACTION_PROCESS_WIFI_EASY_CONNECT_URI =
525             "android.settings.PROCESS_WIFI_EASY_CONNECT_URI";
526 
527     /**
528      * Activity Action: Show settings to allow configuration of data and view data usage.
529      * <p>
530      * In some cases, a matching Activity may not exist, so ensure you
531      * safeguard against this.
532      * <p>
533      * Input: Nothing.
534      * <p>
535      * Output: Nothing.
536      */
537     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
538     public static final String ACTION_DATA_USAGE_SETTINGS =
539             "android.settings.DATA_USAGE_SETTINGS";
540 
541     /**
542      * Activity Action: Show settings to allow configuration of Bluetooth.
543      * <p>
544      * In some cases, a matching Activity may not exist, so ensure you
545      * safeguard against this.
546      * <p>
547      * Input: Nothing.
548      * <p>
549      * Output: Nothing.
550      */
551     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
552     public static final String ACTION_BLUETOOTH_SETTINGS =
553             "android.settings.BLUETOOTH_SETTINGS";
554 
555     /**
556      * Activity action: Show Settings app search UI when this action is available for device.
557      * <p>
558      * Input: Nothing.
559      * <p>
560      * Output: Nothing.
561      */
562     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
563     public static final String ACTION_APP_SEARCH_SETTINGS = "android.settings.APP_SEARCH_SETTINGS";
564 
565     /**
566      * Activity Action: Show settings to allow configuration of Assist Gesture.
567      * <p>
568      * In some cases, a matching Activity may not exist, so ensure you
569      * safeguard against this.
570      * <p>
571      * Input: Nothing.
572      * <p>
573      * Output: Nothing.
574      * @hide
575      */
576     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
577     public static final String ACTION_ASSIST_GESTURE_SETTINGS =
578             "android.settings.ASSIST_GESTURE_SETTINGS";
579 
580     /**
581      * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if
582      * necessary.
583      * <p>
584      * Input: Nothing.
585      * <p>
586      * Output: Nothing.
587      */
588     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
589     public static final String ACTION_FINGERPRINT_ENROLL =
590             "android.settings.FINGERPRINT_ENROLL";
591 
592     /**
593      * Activity Action: Show settings to allow configuration of cast endpoints.
594      * <p>
595      * In some cases, a matching Activity may not exist, so ensure you
596      * safeguard against this.
597      * <p>
598      * Input: Nothing.
599      * <p>
600      * Output: Nothing.
601      */
602     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
603     public static final String ACTION_CAST_SETTINGS =
604             "android.settings.CAST_SETTINGS";
605 
606     /**
607      * Activity Action: Show settings to allow configuration of date and time.
608      * <p>
609      * In some cases, a matching Activity may not exist, so ensure you
610      * safeguard against this.
611      * <p>
612      * Input: Nothing.
613      * <p>
614      * Output: Nothing.
615      */
616     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
617     public static final String ACTION_DATE_SETTINGS =
618             "android.settings.DATE_SETTINGS";
619 
620     /**
621      * Activity Action: Show settings to allow configuration of sound and volume.
622      * <p>
623      * In some cases, a matching Activity may not exist, so ensure you
624      * safeguard against this.
625      * <p>
626      * Input: Nothing.
627      * <p>
628      * Output: Nothing.
629      */
630     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
631     public static final String ACTION_SOUND_SETTINGS =
632             "android.settings.SOUND_SETTINGS";
633 
634     /**
635      * Activity Action: Show settings to allow configuration of display.
636      * <p>
637      * In some cases, a matching Activity may not exist, so ensure you
638      * safeguard against this.
639      * <p>
640      * Input: Nothing.
641      * <p>
642      * Output: Nothing.
643      */
644     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
645     public static final String ACTION_DISPLAY_SETTINGS =
646             "android.settings.DISPLAY_SETTINGS";
647 
648     /**
649      * Activity Action: Show settings to allow configuration of Night display.
650      * <p>
651      * In some cases, a matching Activity may not exist, so ensure you
652      * safeguard 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_NIGHT_DISPLAY_SETTINGS =
660             "android.settings.NIGHT_DISPLAY_SETTINGS";
661 
662     /**
663      * Activity Action: Show settings to allow configuration of locale.
664      * <p>
665      * In some cases, a matching Activity may not exist, so ensure you
666      * safeguard against this.
667      * <p>
668      * Input: Nothing.
669      * <p>
670      * Output: Nothing.
671      */
672     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
673     public static final String ACTION_LOCALE_SETTINGS =
674             "android.settings.LOCALE_SETTINGS";
675 
676     /**
677      * Activity Action: Show settings to configure input methods, in particular
678      * allowing the user to enable input methods.
679      * <p>
680      * In some cases, a matching Activity may not exist, so ensure you
681      * safeguard against this.
682      * <p>
683      * Input: Nothing.
684      * <p>
685      * Output: Nothing.
686      */
687     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
688     public static final String ACTION_VOICE_INPUT_SETTINGS =
689             "android.settings.VOICE_INPUT_SETTINGS";
690 
691     /**
692      * Activity Action: Show settings to configure input methods, in particular
693      * allowing the user to enable input methods.
694      * <p>
695      * In some cases, a matching Activity may not exist, so ensure you
696      * safeguard against this.
697      * <p>
698      * Input: Nothing.
699      * <p>
700      * Output: Nothing.
701      */
702     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
703     public static final String ACTION_INPUT_METHOD_SETTINGS =
704             "android.settings.INPUT_METHOD_SETTINGS";
705 
706     /**
707      * Activity Action: Show settings to enable/disable input method subtypes.
708      * <p>
709      * In some cases, a matching Activity may not exist, so ensure you
710      * safeguard against this.
711      * <p>
712      * To tell which input method's subtypes are displayed in the settings, add
713      * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
714      * If there is no extra in this Intent, subtypes from all installed input methods
715      * will be displayed in the settings.
716      *
717      * @see android.view.inputmethod.InputMethodInfo#getId
718      * <p>
719      * Input: Nothing.
720      * <p>
721      * Output: Nothing.
722      */
723     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
724     public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
725             "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
726 
727     /**
728      * Activity Action: Show settings to manage the user input dictionary.
729      * <p>
730      * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
731      * it is guaranteed there will always be an appropriate implementation for this Intent action.
732      * In prior releases of the platform this was optional, so ensure you safeguard against it.
733      * <p>
734      * Input: Nothing.
735      * <p>
736      * Output: Nothing.
737      */
738     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
739     public static final String ACTION_USER_DICTIONARY_SETTINGS =
740             "android.settings.USER_DICTIONARY_SETTINGS";
741 
742     /**
743      * Activity Action: Show settings to configure the hardware keyboard.
744      * <p>
745      * In some cases, a matching Activity may not exist, so ensure you
746      * safeguard against this.
747      * <p>
748      * Input: Nothing.
749      * <p>
750      * Output: Nothing.
751      */
752     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
753     public static final String ACTION_HARD_KEYBOARD_SETTINGS =
754             "android.settings.HARD_KEYBOARD_SETTINGS";
755 
756     /**
757      * Activity Action: Adds a word to the user dictionary.
758      * <p>
759      * In some cases, a matching Activity may not exist, so ensure you
760      * safeguard against this.
761      * <p>
762      * Input: An extra with key <code>word</code> that contains the word
763      * that should be added to the dictionary.
764      * <p>
765      * Output: Nothing.
766      *
767      * @hide
768      */
769     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
770     @UnsupportedAppUsage
771     public static final String ACTION_USER_DICTIONARY_INSERT =
772             "com.android.settings.USER_DICTIONARY_INSERT";
773 
774     /**
775      * Activity Action: Show settings to allow configuration of application-related settings.
776      * <p>
777      * In some cases, a matching Activity may not exist, so ensure you
778      * safeguard against this.
779      * <p>
780      * Input: Nothing.
781      * <p>
782      * Output: Nothing.
783      */
784     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
785     public static final String ACTION_APPLICATION_SETTINGS =
786             "android.settings.APPLICATION_SETTINGS";
787 
788     /**
789      * Activity Action: Show settings to allow configuration of application
790      * development-related settings.  As of
791      * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
792      * a required part of the platform.
793      * <p>
794      * Input: Nothing.
795      * <p>
796      * Output: Nothing.
797      */
798     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
799     public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
800             "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
801 
802     /**
803      * Activity Action: Show settings to allow configuration of quick launch shortcuts.
804      * <p>
805      * In some cases, a matching Activity may not exist, so ensure you
806      * safeguard against this.
807      * <p>
808      * Input: Nothing.
809      * <p>
810      * Output: Nothing.
811      */
812     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
813     public static final String ACTION_QUICK_LAUNCH_SETTINGS =
814             "android.settings.QUICK_LAUNCH_SETTINGS";
815 
816     /**
817      * Activity Action: Show settings to manage installed applications.
818      * <p>
819      * In some cases, a matching Activity may not exist, so ensure you
820      * safeguard against this.
821      * <p>
822      * Input: Nothing.
823      * <p>
824      * Output: Nothing.
825      */
826     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
827     public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
828             "android.settings.MANAGE_APPLICATIONS_SETTINGS";
829 
830     /**
831      * Activity Action: Show settings to manage all applications.
832      * <p>
833      * In some cases, a matching Activity may not exist, so ensure you
834      * safeguard against this.
835      * <p>
836      * Input: Nothing.
837      * <p>
838      * Output: Nothing.
839      */
840     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
841     public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
842             "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
843 
844     /**
845      * Activity Action: Show screen for controlling which apps can draw on top of other apps.
846      * <p>
847      * In some cases, a matching Activity may not exist, so ensure you
848      * safeguard against this.
849      * <p>
850      * Input: Optionally, the Intent's data URI can specify the application package name to
851      * directly invoke the management GUI specific to the package name. For example
852      * "package:com.my.app".
853      * <p>
854      * Output: Nothing.
855      */
856     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
857     public static final String ACTION_MANAGE_OVERLAY_PERMISSION =
858             "android.settings.action.MANAGE_OVERLAY_PERMISSION";
859 
860     /**
861      * Activity Action: Show screen for controlling which apps are allowed to write/modify
862      * system settings.
863      * <p>
864      * In some cases, a matching Activity may not exist, so ensure you
865      * safeguard against this.
866      * <p>
867      * Input: Optionally, the Intent's data URI can specify the application package name to
868      * directly invoke the management GUI specific to the package name. For example
869      * "package:com.my.app".
870      * <p>
871      * Output: Nothing.
872      */
873     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
874     public static final String ACTION_MANAGE_WRITE_SETTINGS =
875             "android.settings.action.MANAGE_WRITE_SETTINGS";
876 
877     /**
878      * Activity Action: Show screen for controlling app usage properties for an app.
879      * Input: Intent's extra {@link android.content.Intent#EXTRA_PACKAGE_NAME} must specify the
880      * application package name.
881      * Output: Nothing.
882      */
883     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
884     public static final String ACTION_APP_USAGE_SETTINGS =
885             "android.settings.action.APP_USAGE_SETTINGS";
886 
887     /**
888      * Activity Action: Show screen of details about a particular application.
889      * <p>
890      * In some cases, a matching Activity may not exist, so ensure you
891      * safeguard against this.
892      * <p>
893      * Input: The Intent's data URI specifies the application package name
894      * to be shown, with the "package" scheme.  That is "package:com.my.app".
895      * <p>
896      * Output: Nothing.
897      */
898     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
899     public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
900             "android.settings.APPLICATION_DETAILS_SETTINGS";
901 
902     /**
903      * Activity Action: Show list of applications that have been running
904      * foreground services (to the user "running in the background").
905      * <p>
906      * Input: Extras "packages" is a string array of package names.
907      * <p>
908      * Output: Nothing.
909      * @hide
910      */
911     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
912     public static final String ACTION_FOREGROUND_SERVICES_SETTINGS =
913             "android.settings.FOREGROUND_SERVICES_SETTINGS";
914 
915     /**
916      * Activity Action: Show screen for controlling which apps can ignore battery optimizations.
917      * <p>
918      * Input: Nothing.
919      * <p>
920      * Output: Nothing.
921      * <p>
922      * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
923      * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
924      * already ignoring optimizations.  You can use
925      * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you
926      * on this list.
927      */
928     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
929     public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS =
930             "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS";
931 
932     /**
933      * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is,
934      * put them on the whitelist of apps shown by
935      * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}).  For an app to use this, it also
936      * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}
937      * permission.
938      * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities
939      * provided by the platform for applications to operate correctly in the various power
940      * saving modes.  This is only for unusual applications that need to deeply control their own
941      * execution, at the potential expense of the user's battery life.  Note that these applications
942      * greatly run the risk of showing to the user as high power consumers on their device.</p>
943      * <p>
944      * Input: The Intent's data URI must specify the application package name
945      * to be shown, with the "package" scheme.  That is "package:com.my.app".
946      * <p>
947      * Output: Nothing.
948      * <p>
949      * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
950      * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
951      * already ignoring optimizations.
952      */
953     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
954     public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS =
955             "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
956 
957     /**
958      * Activity Action: Open the advanced power usage details page of an associated app.
959      * <p>
960      * Input: Intent's data URI set with an application name, using the
961      * "package" schema (like "package:com.my.app")
962      * <p>
963      * Output: Nothing.
964      *
965      * @hide
966      */
967     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
968     public static final String ACTION_VIEW_ADVANCED_POWER_USAGE_DETAIL =
969             "android.settings.VIEW_ADVANCED_POWER_USAGE_DETAIL";
970 
971     /**
972      * Activity Action: Show screen for controlling background data
973      * restrictions for a particular application.
974      * <p>
975      * Input: Intent's data URI set with an application name, using the
976      * "package" schema (like "package:com.my.app").
977      *
978      * <p>
979      * Output: Nothing.
980      * <p>
981      * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus
982      * ConnectivityManager#getRestrictBackgroundStatus()} to determine the
983      * status of the background data restrictions for them.
984      *
985      * <p class="note">
986      * In some cases, a matching Activity may not exist, so ensure you
987      * safeguard against this.
988      */
989     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
990     public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS =
991             "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS";
992 
993     /**
994      * @hide
995      * Activity Action: Show the "app ops" settings screen.
996      * <p>
997      * Input: Nothing.
998      * <p>
999      * Output: Nothing.
1000      */
1001     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1002     public static final String ACTION_APP_OPS_SETTINGS =
1003             "android.settings.APP_OPS_SETTINGS";
1004 
1005     /**
1006      * Activity Action: Show settings for system update functionality.
1007      * <p>
1008      * In some cases, a matching Activity may not exist, so ensure you
1009      * safeguard against this.
1010      * <p>
1011      * Input: Nothing.
1012      * <p>
1013      * Output: Nothing.
1014      *
1015      * @hide
1016      */
1017     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1018     public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
1019             "android.settings.SYSTEM_UPDATE_SETTINGS";
1020 
1021     /**
1022      * Activity Action: Show settings for managed profile settings.
1023      * <p>
1024      * In some cases, a matching Activity may not exist, so ensure you
1025      * safeguard against this.
1026      * <p>
1027      * Input: Nothing.
1028      * <p>
1029      * Output: Nothing.
1030      *
1031      * @hide
1032      */
1033     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1034     public static final String ACTION_MANAGED_PROFILE_SETTINGS =
1035             "android.settings.MANAGED_PROFILE_SETTINGS";
1036 
1037     /**
1038      * Activity Action: Show settings to allow configuration of sync settings.
1039      * <p>
1040      * In some cases, a matching Activity may not exist, so ensure you
1041      * safeguard against this.
1042      * <p>
1043      * The account types available to add via the add account button may be restricted by adding an
1044      * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
1045      * authorities. Only account types which can sync with that content provider will be offered to
1046      * the user.
1047      * <p>
1048      * Input: Nothing.
1049      * <p>
1050      * Output: Nothing.
1051      */
1052     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1053     public static final String ACTION_SYNC_SETTINGS =
1054             "android.settings.SYNC_SETTINGS";
1055 
1056     /**
1057      * Activity Action: Show add account screen for creating a new account.
1058      * <p>
1059      * In some cases, a matching Activity may not exist, so ensure you
1060      * safeguard against this.
1061      * <p>
1062      * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
1063      * extra to the Intent with one or more syncable content provider's authorities.  Only account
1064      * types which can sync with that content provider will be offered to the user.
1065      * <p>
1066      * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
1067      * Intent with one or more account types.
1068      * <p>
1069      * Input: Nothing.
1070      * <p>
1071      * Output: Nothing.
1072      */
1073     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1074     public static final String ACTION_ADD_ACCOUNT =
1075             "android.settings.ADD_ACCOUNT_SETTINGS";
1076 
1077     /**
1078      * Activity Action: Show settings for enabling or disabling data saver
1079      * <p></p>
1080      * In some cases, a matching Activity may not exist, so ensure you
1081      * safeguard against this.
1082      * <p>
1083      * Input: Nothing.
1084      * <p>
1085      * Output: Nothing.
1086      *
1087      * @hide
1088      */
1089     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1090     public static final String ACTION_DATA_SAVER_SETTINGS =
1091             "android.settings.DATA_SAVER_SETTINGS";
1092 
1093     /**
1094      * Activity Action: Show settings for selecting the network operator.
1095      * <p>
1096      * In some cases, a matching Activity may not exist, so ensure you
1097      * safeguard against this.
1098      * <p>
1099      * The subscription ID of the subscription for which available network operators should be
1100      * displayed may be optionally specified with {@link #EXTRA_SUB_ID}.
1101      * <p>
1102      * Input: Nothing.
1103      * <p>
1104      * Output: Nothing.
1105      */
1106     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1107     public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
1108             "android.settings.NETWORK_OPERATOR_SETTINGS";
1109 
1110     /**
1111      * Activity Action: Show settings for selection of 2G/3G.
1112      * <p>
1113      * In some cases, a matching Activity may not exist, so ensure you
1114      * safeguard against this.
1115      * <p>
1116      * Input: Nothing.
1117      * <p>
1118      * Output: Nothing.
1119      */
1120     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1121     public static final String ACTION_DATA_ROAMING_SETTINGS =
1122             "android.settings.DATA_ROAMING_SETTINGS";
1123 
1124     /**
1125      * Activity Action: Show settings for internal storage.
1126      * <p>
1127      * In some cases, a matching Activity may not exist, so ensure you
1128      * safeguard against this.
1129      * <p>
1130      * Input: Nothing.
1131      * <p>
1132      * Output: Nothing.
1133      */
1134     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1135     public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
1136             "android.settings.INTERNAL_STORAGE_SETTINGS";
1137     /**
1138      * Activity Action: Show settings for memory card storage.
1139      * <p>
1140      * In some cases, a matching Activity may not exist, so ensure you
1141      * safeguard against this.
1142      * <p>
1143      * Input: Nothing.
1144      * <p>
1145      * Output: Nothing.
1146      */
1147     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1148     public static final String ACTION_MEMORY_CARD_SETTINGS =
1149             "android.settings.MEMORY_CARD_SETTINGS";
1150 
1151     /**
1152      * Activity Action: Show settings for global search.
1153      * <p>
1154      * In some cases, a matching Activity may not exist, so ensure you
1155      * safeguard against this.
1156      * <p>
1157      * Input: Nothing.
1158      * <p>
1159      * Output: Nothing
1160      */
1161     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1162     public static final String ACTION_SEARCH_SETTINGS =
1163         "android.search.action.SEARCH_SETTINGS";
1164 
1165     /**
1166      * Activity Action: Show general device information settings (serial
1167      * number, software version, phone number, etc.).
1168      * <p>
1169      * In some cases, a matching Activity may not exist, so ensure you
1170      * safeguard against this.
1171      * <p>
1172      * Input: Nothing.
1173      * <p>
1174      * Output: Nothing
1175      */
1176     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1177     public static final String ACTION_DEVICE_INFO_SETTINGS =
1178         "android.settings.DEVICE_INFO_SETTINGS";
1179 
1180     /**
1181      * Activity Action: Show NFC settings.
1182      * <p>
1183      * This shows UI that allows NFC to be turned on or off.
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      * @see android.nfc.NfcAdapter#isEnabled()
1192      */
1193     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1194     public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
1195 
1196     /**
1197      * Activity Action: Show NFC Sharing settings.
1198      * <p>
1199      * This shows UI that allows NDEF Push (Android Beam) to be turned on or
1200      * off.
1201      * <p>
1202      * In some cases, a matching Activity may not exist, so ensure you
1203      * safeguard against this.
1204      * <p>
1205      * Input: Nothing.
1206      * <p>
1207      * Output: Nothing
1208      * @see android.nfc.NfcAdapter#isNdefPushEnabled()
1209      */
1210     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1211     public static final String ACTION_NFCSHARING_SETTINGS =
1212         "android.settings.NFCSHARING_SETTINGS";
1213 
1214     /**
1215      * Activity Action: Show NFC Tap & Pay settings
1216      * <p>
1217      * This shows UI that allows the user to configure Tap&Pay
1218      * settings.
1219      * <p>
1220      * In some cases, a matching Activity may not exist, so ensure you
1221      * safeguard against this.
1222      * <p>
1223      * Input: Nothing.
1224      * <p>
1225      * Output: Nothing
1226      */
1227     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1228     public static final String ACTION_NFC_PAYMENT_SETTINGS =
1229         "android.settings.NFC_PAYMENT_SETTINGS";
1230 
1231     /**
1232      * Activity Action: Show Daydream settings.
1233      * <p>
1234      * In some cases, a matching Activity may not exist, so ensure you
1235      * safeguard against this.
1236      * <p>
1237      * Input: Nothing.
1238      * <p>
1239      * Output: Nothing.
1240      * @see android.service.dreams.DreamService
1241      */
1242     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1243     public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
1244 
1245     /**
1246      * Activity Action: Show Notification assistant settings.
1247      * <p>
1248      * In some cases, a matching Activity may not exist, so ensure you
1249      * safeguard against this.
1250      * <p>
1251      * Input: Nothing.
1252      * <p>
1253      * Output: Nothing.
1254      * @see android.service.notification.NotificationAssistantService
1255      */
1256     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1257     public static final String ACTION_NOTIFICATION_ASSISTANT_SETTINGS =
1258             "android.settings.NOTIFICATION_ASSISTANT_SETTINGS";
1259 
1260     /**
1261      * Activity Action: Show Notification listener settings.
1262      * <p>
1263      * In some cases, a matching Activity may not exist, so ensure you
1264      * safeguard against this.
1265      * <p>
1266      * Input: Nothing.
1267      * <p>
1268      * Output: Nothing.
1269      * @see android.service.notification.NotificationListenerService
1270      */
1271     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1272     public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
1273             = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
1274 
1275     /**
1276      * Activity Action: Show Do Not Disturb access settings.
1277      * <p>
1278      * Users can grant and deny access to Do Not Disturb configuration from here. Managed
1279      * profiles cannot grant Do Not Disturb access.
1280      * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1281      * details.
1282      * <p>
1283      * Input: Nothing.
1284      * <p>
1285      * Output: Nothing.
1286      *
1287      * <p class="note">
1288      * In some cases, a matching Activity may not exist, so ensure you
1289      * safeguard against this.
1290      */
1291     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1292     public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
1293             = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
1294 
1295     /**
1296      * Activity Action: Show do not disturb setting page for app.
1297      * <p>
1298      * Users can grant and deny access to Do Not Disturb configuration for an app from here.
1299      * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1300      * details.
1301      * <p>
1302      * Input: Intent's data URI set with an application name, using the
1303      * "package" schema (like "package:com.my.app").
1304      * <p>
1305      * Output: Nothing.
1306      *
1307      * @hide
1308      */
1309     @SystemApi
1310     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1311     public static final String ACTION_NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS =
1312             "android.settings.NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS";
1313 
1314     /**
1315      * @hide
1316      */
1317     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1318     public static final String ACTION_CONDITION_PROVIDER_SETTINGS
1319             = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
1320 
1321     /**
1322      * Activity Action: Show settings for video captioning.
1323      * <p>
1324      * In some cases, a matching Activity may not exist, so ensure you safeguard
1325      * against this.
1326      * <p>
1327      * Input: Nothing.
1328      * <p>
1329      * Output: Nothing.
1330      */
1331     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1332     public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
1333 
1334     /**
1335      * Activity Action: Show the top level print settings.
1336      * <p>
1337      * In some cases, a matching Activity may not exist, so ensure you
1338      * safeguard against this.
1339      * <p>
1340      * Input: Nothing.
1341      * <p>
1342      * Output: Nothing.
1343      */
1344     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1345     public static final String ACTION_PRINT_SETTINGS =
1346             "android.settings.ACTION_PRINT_SETTINGS";
1347 
1348     /**
1349      * Activity Action: Show Zen Mode configuration settings.
1350      *
1351      * @hide
1352      */
1353     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1354     public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
1355 
1356     /**
1357      * Activity Action: Show Zen Mode visual effects configuration settings.
1358      *
1359      * @hide
1360      */
1361     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1362     public static final String ZEN_MODE_BLOCKED_EFFECTS_SETTINGS =
1363             "android.settings.ZEN_MODE_BLOCKED_EFFECTS_SETTINGS";
1364 
1365     /**
1366      * Activity Action: Show Zen Mode onboarding activity.
1367      *
1368      * @hide
1369      */
1370     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1371     public static final String ZEN_MODE_ONBOARDING = "android.settings.ZEN_MODE_ONBOARDING";
1372 
1373     /**
1374      * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings.
1375      */
1376     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1377     public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
1378             = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
1379 
1380     /**
1381      * Activity Action: Show Zen Mode automation configuration settings.
1382      *
1383      * @hide
1384      */
1385     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1386     public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
1387             = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
1388 
1389     /**
1390      * Activity Action: Modify do not disturb mode settings.
1391      * <p>
1392      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1393      * <p>
1394      * This intent MUST be started using
1395      * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1396      * startVoiceActivity}.
1397      * <p>
1398      * Note: The Activity implementing this intent MUST verify that
1399      * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
1400      * returns true before modifying the setting.
1401      * <p>
1402      * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
1403      * how long the user wishes to avoid interruptions for. The optional
1404      * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
1405      * enabling or disabling do not disturb mode. If either extra is not included, the
1406      * user maybe asked to provide the value.
1407      * <p>
1408      * Output: Nothing.
1409      */
1410     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1411     public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
1412             "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
1413 
1414     /**
1415      * Activity Action: Show Zen Mode schedule rule configuration settings.
1416      *
1417      * @hide
1418      */
1419     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1420     public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
1421             = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
1422 
1423     /**
1424      * Activity Action: Show Zen Mode event rule configuration settings.
1425      *
1426      * @hide
1427      */
1428     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1429     public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
1430             = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
1431 
1432     /**
1433      * Activity Action: Show Zen Mode external rule configuration settings.
1434      *
1435      * @hide
1436      */
1437     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1438     public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
1439             = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
1440 
1441     /**
1442      * Activity Action: Show the regulatory information screen for the device.
1443      * <p>
1444      * In some cases, a matching Activity may not exist, so ensure you safeguard
1445      * against this.
1446      * <p>
1447      * Input: Nothing.
1448      * <p>
1449      * Output: Nothing.
1450      */
1451     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1452     public static final String
1453             ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
1454 
1455     /**
1456      * Activity Action: Show Device Name Settings.
1457      * <p>
1458      * In some cases, a matching Activity may not exist, so ensure you safeguard
1459      * against this.
1460      *
1461      * @hide
1462      */
1463     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1464     public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
1465 
1466     /**
1467      * Activity Action: Show pairing settings.
1468      * <p>
1469      * In some cases, a matching Activity may not exist, so ensure you safeguard
1470      * against this.
1471      *
1472      * @hide
1473      */
1474     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1475     public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
1476 
1477     /**
1478      * Activity Action: Show battery saver settings.
1479      * <p>
1480      * In some cases, a matching Activity may not exist, so ensure you safeguard
1481      * against this.
1482      */
1483     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1484     public static final String ACTION_BATTERY_SAVER_SETTINGS
1485             = "android.settings.BATTERY_SAVER_SETTINGS";
1486 
1487     /**
1488      * Activity Action: Modify Battery Saver mode setting using a voice command.
1489      * <p>
1490      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1491      * <p>
1492      * This intent MUST be started using
1493      * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1494      * startVoiceActivity}.
1495      * <p>
1496      * Note: The activity implementing this intent MUST verify that
1497      * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
1498      * modifying the setting.
1499      * <p>
1500      * Input: To tell which state batter saver mode should be set to, add the
1501      * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
1502      * If the extra is not included, no changes will be made.
1503      * <p>
1504      * Output: Nothing.
1505      */
1506     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1507     public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
1508             "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
1509 
1510     /**
1511      * Activity Action: Show Home selection settings. If there are multiple activities
1512      * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
1513      * to pick your preferred activity.
1514      */
1515     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1516     public static final String ACTION_HOME_SETTINGS
1517             = "android.settings.HOME_SETTINGS";
1518 
1519     /**
1520      * Activity Action: Show Default apps settings.
1521      * <p>
1522      * In some cases, a matching Activity may not exist, so ensure you
1523      * safeguard against this.
1524      * <p>
1525      * Input: Nothing.
1526      * <p>
1527      * Output: Nothing.
1528      */
1529     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1530     public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS
1531             = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS";
1532 
1533     /**
1534      * Activity Action: Show More default apps settings.
1535      * <p>
1536      * If a Settings activity handles this intent action, a "More defaults" entry will be shown in
1537      * the Default apps settings, and clicking it will launch that activity.
1538      * <p>
1539      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1540      * <p>
1541      * Input: Nothing.
1542      * <p>
1543      * Output: Nothing.
1544      *
1545      * @hide
1546      */
1547     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1548     @SystemApi
1549     public static final String ACTION_MANAGE_MORE_DEFAULT_APPS_SETTINGS =
1550             "android.settings.MANAGE_MORE_DEFAULT_APPS_SETTINGS";
1551 
1552     /**
1553      * Activity Action: Show notification settings.
1554      *
1555      * @hide
1556      */
1557     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1558     public static final String ACTION_NOTIFICATION_SETTINGS
1559             = "android.settings.NOTIFICATION_SETTINGS";
1560 
1561     /**
1562      * Activity Action: Show app listing settings, filtered by those that send notifications.
1563      *
1564      * @hide
1565      */
1566     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1567     public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS =
1568             "android.settings.ALL_APPS_NOTIFICATION_SETTINGS";
1569 
1570     /**
1571      * Activity Action: Show notification settings for a single app.
1572      * <p>
1573      *     Input: {@link #EXTRA_APP_PACKAGE}, the package to display.
1574      * <p>
1575      * Output: Nothing.
1576      */
1577     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1578     public static final String ACTION_APP_NOTIFICATION_SETTINGS
1579             = "android.settings.APP_NOTIFICATION_SETTINGS";
1580 
1581     /**
1582      * Activity Action: Show notification settings for a single {@link NotificationChannel}.
1583      * <p>
1584      *     Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display.
1585      *     Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display.
1586      * <p>
1587      * Output: Nothing.
1588      */
1589     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1590     public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS
1591             = "android.settings.CHANNEL_NOTIFICATION_SETTINGS";
1592 
1593     /**
1594      * Activity Action: Show notification bubble settings for a single app.
1595      * See {@link NotificationManager#areBubblesAllowed()}.
1596      * <p>
1597      *     Input: {@link #EXTRA_APP_PACKAGE}, the package to display.
1598      * <p>
1599      * Output: Nothing.
1600      */
1601     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1602     public static final String ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS
1603             = "android.settings.APP_NOTIFICATION_BUBBLE_SETTINGS";
1604 
1605     /**
1606      * Activity Extra: The package owner of the notification channel settings to display.
1607      * <p>
1608      * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
1609      */
1610     public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE";
1611 
1612     /**
1613      * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings
1614      * to display.
1615      * <p>
1616      * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
1617      */
1618     public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID";
1619 
1620     /**
1621      * Activity Action: Show notification redaction settings.
1622      *
1623      * @hide
1624      */
1625     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1626     public static final String ACTION_APP_NOTIFICATION_REDACTION
1627             = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
1628 
1629     /** @hide */
1630     @UnsupportedAppUsage
1631     public static final String EXTRA_APP_UID = "app_uid";
1632 
1633     /**
1634      * Activity Action: Show a dialog with disabled by policy message.
1635      * <p> If an user action is disabled by policy, this dialog can be triggered to let
1636      * the user know about this.
1637      * <p>
1638      * Input: {@link Intent#EXTRA_USER}: The user of the admin.
1639      * <p>
1640      * Output: Nothing.
1641      *
1642      * @hide
1643      */
1644     // Intent#EXTRA_USER_ID can also be used
1645     @SystemApi
1646     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1647     public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS
1648             = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
1649 
1650     /**
1651      * Activity Action: Show a dialog for remote bugreport flow.
1652      * <p>
1653      * Input: Nothing.
1654      * <p>
1655      * Output: Nothing.
1656      *
1657      * @hide
1658      */
1659     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1660     public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG
1661             = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG";
1662 
1663     /**
1664      * Activity Action: Show VR listener settings.
1665      * <p>
1666      * Input: Nothing.
1667      * <p>
1668      * Output: Nothing.
1669      *
1670      * @see android.service.vr.VrListenerService
1671      */
1672     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1673     public static final String ACTION_VR_LISTENER_SETTINGS
1674             = "android.settings.VR_LISTENER_SETTINGS";
1675 
1676     /**
1677      * Activity Action: Show Picture-in-picture settings.
1678      * <p>
1679      * Input: Nothing.
1680      * <p>
1681      * Output: Nothing.
1682      *
1683      * @hide
1684      */
1685     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1686     public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS
1687             = "android.settings.PICTURE_IN_PICTURE_SETTINGS";
1688 
1689     /**
1690      * Activity Action: Show Storage Manager settings.
1691      * <p>
1692      * Input: Nothing.
1693      * <p>
1694      * Output: Nothing.
1695      *
1696      * @hide
1697      */
1698     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1699     public static final String ACTION_STORAGE_MANAGER_SETTINGS
1700             = "android.settings.STORAGE_MANAGER_SETTINGS";
1701 
1702     /**
1703      * Activity Action: Allows user to select current webview implementation.
1704      * <p>
1705      * Input: Nothing.
1706      * <p>
1707      * Output: Nothing.
1708      */
1709     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1710     public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS";
1711 
1712     /**
1713      * Activity Action: Show enterprise privacy section.
1714      * <p>
1715      * Input: Nothing.
1716      * <p>
1717      * Output: Nothing.
1718      * @hide
1719      */
1720     @SystemApi
1721     @TestApi
1722     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1723     public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS
1724             = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
1725 
1726     /**
1727      * Activity Action: Show screen that let user select its Autofill Service.
1728      * <p>
1729      * Input: Intent's data URI set with an application name, using the
1730      * "package" schema (like "package:com.my.app").
1731      *
1732      * <p>
1733      * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging
1734      * to the caller package.
1735      *
1736      * <p>
1737      * <b>NOTE: </b> Applications should call
1738      * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and
1739      * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action
1740      * to start an activity if they return {@code false} and {@code true} respectively.
1741      */
1742     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1743     public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE =
1744             "android.settings.REQUEST_SET_AUTOFILL_SERVICE";
1745 
1746     /**
1747      * Activity Action: Show screen for controlling which apps have access on volume directories.
1748      * <p>
1749      * Input: Nothing.
1750      * <p>
1751      * Output: Nothing.
1752      * <p>
1753      * Applications typically use this action to ask the user to revert the "Do not ask again"
1754      * status of directory access requests made by
1755      * {@link android.os.storage.StorageVolume#createAccessIntent(String)}.
1756      * @deprecated use {@link #ACTION_APPLICATION_DETAILS_SETTINGS} to manage storage permissions
1757      *             for a specific application
1758      */
1759     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1760     @Deprecated
1761     public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS =
1762             "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS";
1763 
1764 
1765     /**
1766      * Activity Action: Show screen that let user select enable (or disable) Content Capture.
1767      * <p>
1768      * Input: Nothing.
1769      *
1770      * <p>
1771      * Output: Nothing
1772      *
1773      * @hide
1774      */
1775     @SystemApi
1776     @TestApi
1777     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1778     public static final String ACTION_REQUEST_ENABLE_CONTENT_CAPTURE =
1779             "android.settings.REQUEST_ENABLE_CONTENT_CAPTURE";
1780 
1781     /**
1782      * Activity Action: Show screen that let user manage how Android handles URL resolution.
1783      * <p>
1784      * Input: Nothing.
1785      * <p>
1786      * Output: Nothing
1787      *
1788      * @hide
1789      */
1790     @SystemApi
1791     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1792     public static final String ACTION_MANAGE_DOMAIN_URLS = "android.settings.MANAGE_DOMAIN_URLS";
1793 
1794     /**
1795      * Broadcast to trigger notification of asking user to enable MMS.
1796      * Need to specify {@link #EXTRA_ENABLE_MMS_DATA_REQUEST_REASON} and {@link #EXTRA_SUB_ID}.
1797      *
1798      * @hide
1799      */
1800     @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1801     public static final String ACTION_ENABLE_MMS_DATA_REQUEST =
1802             "android.settings.ENABLE_MMS_DATA_REQUEST";
1803 
1804     /**
1805      * Integer value that specifies the reason triggering enable MMS data notification.
1806      * This must be passed as an extra field to the {@link #ACTION_ENABLE_MMS_DATA_REQUEST}.
1807      * Extra with value of EnableMmsDataReason interface.
1808      * @hide
1809      */
1810     public static final String EXTRA_ENABLE_MMS_DATA_REQUEST_REASON =
1811             "android.settings.extra.ENABLE_MMS_DATA_REQUEST_REASON";
1812 
1813     /** @hide */
1814     @Retention(RetentionPolicy.SOURCE)
1815     @IntDef(prefix = { "ENABLE_MMS_DATA_REQUEST_REASON_" }, value = {
1816             ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS,
1817             ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS,
1818     })
1819     public @interface EnableMmsDataReason{}
1820 
1821     /**
1822      * Requesting to enable MMS data because there's an incoming MMS.
1823      * @hide
1824      */
1825     public static final int ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS = 0;
1826 
1827     /**
1828      * Requesting to enable MMS data because user is sending MMS.
1829      * @hide
1830      */
1831     public static final int ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS = 1;
1832 
1833     /**
1834      * Activity Action: Show screen of a cellular subscription and highlight the
1835      * "enable MMS" toggle.
1836      * <p>
1837      * Input: {@link #EXTRA_SUB_ID}: Sub ID of the subscription.
1838      * <p>
1839      * Output: Nothing
1840      *
1841      * @hide
1842      */
1843     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1844     public static final String ACTION_MMS_MESSAGE_SETTING = "android.settings.MMS_MESSAGE_SETTING";
1845 
1846     // End of Intent actions for Settings
1847 
1848     /**
1849      * @hide - Private call() method on SettingsProvider to read from 'system' table.
1850      */
1851     public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
1852 
1853     /**
1854      * @hide - Private call() method on SettingsProvider to read from 'secure' table.
1855      */
1856     public static final String CALL_METHOD_GET_SECURE = "GET_secure";
1857 
1858     /**
1859      * @hide - Private call() method on SettingsProvider to read from 'global' table.
1860      */
1861     public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
1862 
1863     /**
1864      * @hide - Private call() method on SettingsProvider to read from 'config' table.
1865      */
1866     public static final String CALL_METHOD_GET_CONFIG = "GET_config";
1867 
1868     /**
1869      * @hide - Specifies that the caller of the fast-path call()-based flow tracks
1870      * the settings generation in order to cache values locally. If this key is
1871      * mapped to a <code>null</code> string extra in the request bundle, the response
1872      * bundle will contain the same key mapped to a parcelable extra which would be
1873      * an {@link android.util.MemoryIntArray}. The response will also contain an
1874      * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the
1875      * index in the array clients should use to lookup the generation. For efficiency
1876      * the caller should request the generation tracking memory array only if it
1877      * doesn't already have it.
1878      *
1879      * @see #CALL_METHOD_GENERATION_INDEX_KEY
1880      */
1881     public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation";
1882 
1883     /**
1884      * @hide Key with the location in the {@link android.util.MemoryIntArray} where
1885      * to look up the generation id of the backing table. The value is an integer.
1886      *
1887      * @see #CALL_METHOD_TRACK_GENERATION_KEY
1888      */
1889     public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index";
1890 
1891     /**
1892      * @hide Key with the settings table generation. The value is an integer.
1893      *
1894      * @see #CALL_METHOD_TRACK_GENERATION_KEY
1895      */
1896     public static final String CALL_METHOD_GENERATION_KEY = "_generation";
1897 
1898     /**
1899      * @hide - User handle argument extra to the fast-path call()-based requests
1900      */
1901     public static final String CALL_METHOD_USER_KEY = "_user";
1902 
1903     /**
1904      * @hide - Boolean argument extra to the fast-path call()-based requests
1905      */
1906     public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default";
1907 
1908     /**
1909      * @hide - User handle argument extra to the fast-path call()-based requests
1910      */
1911     public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode";
1912 
1913     /**
1914      * @hide - String argument extra to the fast-path call()-based requests
1915      */
1916     public static final String CALL_METHOD_TAG_KEY = "_tag";
1917 
1918     /**
1919      * @hide - String argument extra to the fast-path call()-based requests
1920      */
1921     public static final String CALL_METHOD_PREFIX_KEY = "_prefix";
1922 
1923     /** @hide - Private call() method to write to 'system' table */
1924     public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
1925 
1926     /** @hide - Private call() method to write to 'secure' table */
1927     public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
1928 
1929     /** @hide - Private call() method to write to 'global' table */
1930     public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
1931 
1932     /** @hide - Private call() method to write to 'configuration' table */
1933     public static final String CALL_METHOD_PUT_CONFIG = "PUT_config";
1934 
1935     /** @hide - Private call() method to delete from the 'system' table */
1936     public static final String CALL_METHOD_DELETE_SYSTEM = "DELETE_system";
1937 
1938     /** @hide - Private call() method to delete from the 'secure' table */
1939     public static final String CALL_METHOD_DELETE_SECURE = "DELETE_secure";
1940 
1941     /** @hide - Private call() method to delete from the 'global' table */
1942     public static final String CALL_METHOD_DELETE_GLOBAL = "DELETE_global";
1943 
1944     /** @hide - Private call() method to reset to defaults the 'configuration' table */
1945     public static final String CALL_METHOD_DELETE_CONFIG = "DELETE_config";
1946 
1947     /** @hide - Private call() method to reset to defaults the 'secure' table */
1948     public static final String CALL_METHOD_RESET_SECURE = "RESET_secure";
1949 
1950     /** @hide - Private call() method to reset to defaults the 'global' table */
1951     public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global";
1952 
1953     /** @hide - Private call() method to reset to defaults the 'configuration' table */
1954     public static final String CALL_METHOD_RESET_CONFIG = "RESET_config";
1955 
1956     /** @hide - Private call() method to query the 'system' table */
1957     public static final String CALL_METHOD_LIST_SYSTEM = "LIST_system";
1958 
1959     /** @hide - Private call() method to query the 'secure' table */
1960     public static final String CALL_METHOD_LIST_SECURE = "LIST_secure";
1961 
1962     /** @hide - Private call() method to query the 'global' table */
1963     public static final String CALL_METHOD_LIST_GLOBAL = "LIST_global";
1964 
1965     /** @hide - Private call() method to reset to defaults the 'configuration' table */
1966     public static final String CALL_METHOD_LIST_CONFIG = "LIST_config";
1967 
1968     /**
1969      * Activity Extra: Limit available options in launched activity based on the given authority.
1970      * <p>
1971      * This can be passed as an extra field in an Activity Intent with one or more syncable content
1972      * provider's authorities as a String[]. This field is used by some intents to alter the
1973      * behavior of the called activity.
1974      * <p>
1975      * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
1976      * on the authority given.
1977      */
1978     public static final String EXTRA_AUTHORITIES = "authorities";
1979 
1980     /**
1981      * Activity Extra: Limit available options in launched activity based on the given account
1982      * types.
1983      * <p>
1984      * This can be passed as an extra field in an Activity Intent with one or more account types
1985      * as a String[]. This field is used by some intents to alter the behavior of the called
1986      * activity.
1987      * <p>
1988      * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
1989      * list.
1990      */
1991     public static final String EXTRA_ACCOUNT_TYPES = "account_types";
1992 
1993     public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
1994 
1995     /**
1996      * Activity Extra: The device identifier to act upon.
1997      * <p>
1998      * This can be passed as an extra field in an Activity Intent with a single
1999      * InputDeviceIdentifier. This field is used by some activities to jump straight into the
2000      * settings for the given device.
2001      * <p>
2002      * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
2003      * dialog for the given device.
2004      * @hide
2005      */
2006     public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
2007 
2008     /**
2009      * Activity Extra: Enable or disable Airplane Mode.
2010      * <p>
2011      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
2012      * intent as a boolean to indicate if it should be enabled.
2013      */
2014     public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
2015 
2016     /**
2017      * Activity Extra: Enable or disable Battery saver mode.
2018      * <p>
2019      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
2020      * intent as a boolean to indicate if it should be enabled.
2021      */
2022     public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
2023             "android.settings.extra.battery_saver_mode_enabled";
2024 
2025     /**
2026      * Activity Extra: Enable or disable Do Not Disturb mode.
2027      * <p>
2028      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
2029      * intent as a boolean to indicate if it should be enabled.
2030      */
2031     public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
2032             "android.settings.extra.do_not_disturb_mode_enabled";
2033 
2034     /**
2035      * Activity Extra: How many minutes to enable do not disturb mode for.
2036      * <p>
2037      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
2038      * intent to indicate how long do not disturb mode should be enabled for.
2039      */
2040     public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
2041             "android.settings.extra.do_not_disturb_mode_minutes";
2042 
2043     /**
2044      * Reset mode: reset to defaults only settings changed by the
2045      * calling package. If there is a default set the setting
2046      * will be set to it, otherwise the setting will be deleted.
2047      * This is the only type of reset available to non-system clients.
2048      * @hide
2049      */
2050     @TestApi
2051     public static final int RESET_MODE_PACKAGE_DEFAULTS = 1;
2052 
2053     /**
2054      * Reset mode: reset all settings set by untrusted packages, which is
2055      * packages that aren't a part of the system, to the current defaults.
2056      * If there is a default set the setting will be set to it, otherwise
2057      * the setting will be deleted. This mode is only available to the system.
2058      * @hide
2059      */
2060     public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2;
2061 
2062     /**
2063      * Reset mode: delete all settings set by untrusted packages, which is
2064      * packages that aren't a part of the system. If a setting is set by an
2065      * untrusted package it will be deleted if its default is not provided
2066      * by the system, otherwise the setting will be set to its default.
2067      * This mode is only available to the system.
2068      * @hide
2069      */
2070     public static final int RESET_MODE_UNTRUSTED_CHANGES = 3;
2071 
2072     /**
2073      * Reset mode: reset all settings to defaults specified by trusted
2074      * packages, which is packages that are a part of the system, and
2075      * delete all settings set by untrusted packages. If a setting has
2076      * a default set by a system package it will be set to the default,
2077      * otherwise the setting will be deleted. This mode is only available
2078      * to the system.
2079      * @hide
2080      */
2081     public static final int RESET_MODE_TRUSTED_DEFAULTS = 4;
2082 
2083     /** @hide */
2084     @Retention(RetentionPolicy.SOURCE)
2085     @IntDef(prefix = { "RESET_MODE_" }, value = {
2086             RESET_MODE_PACKAGE_DEFAULTS,
2087             RESET_MODE_UNTRUSTED_DEFAULTS,
2088             RESET_MODE_UNTRUSTED_CHANGES,
2089             RESET_MODE_TRUSTED_DEFAULTS
2090     })
2091     public @interface ResetMode{}
2092 
2093     /**
2094      * Activity Extra: Number of certificates
2095      * <p>
2096      * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO}
2097      * intent to indicate the number of certificates
2098      * @hide
2099      */
2100     public static final String EXTRA_NUMBER_OF_CERTIFICATES =
2101             "android.settings.extra.number_of_certificates";
2102 
2103     private static final String JID_RESOURCE_PREFIX = "android";
2104 
2105     public static final String AUTHORITY = "settings";
2106 
2107     private static final String TAG = "Settings";
2108     private static final boolean LOCAL_LOGV = false;
2109 
2110     // Lock ensures that when enabling/disabling the master location switch, we don't end up
2111     // with a partial enable/disable state in multi-threaded situations.
2112     private static final Object mLocationSettingsLock = new Object();
2113 
2114     // Used in system server calling uid workaround in call()
2115     private static boolean sInSystemServer = false;
2116     private static final Object sInSystemServerLock = new Object();
2117 
2118     /** @hide */
setInSystemServer()2119     public static void setInSystemServer() {
2120         synchronized (sInSystemServerLock) {
2121             sInSystemServer = true;
2122         }
2123     }
2124 
2125     /** @hide */
isInSystemServer()2126     public static boolean isInSystemServer() {
2127         synchronized (sInSystemServerLock) {
2128             return sInSystemServer;
2129         }
2130     }
2131 
2132     public static class SettingNotFoundException extends AndroidException {
SettingNotFoundException(String msg)2133         public SettingNotFoundException(String msg) {
2134             super(msg);
2135         }
2136     }
2137 
2138     /**
2139      * Common base for tables of name/value settings.
2140      */
2141     public static class NameValueTable implements BaseColumns {
2142         public static final String NAME = "name";
2143         public static final String VALUE = "value";
2144 
putString(ContentResolver resolver, Uri uri, String name, String value)2145         protected static boolean putString(ContentResolver resolver, Uri uri,
2146                 String name, String value) {
2147             // The database will take care of replacing duplicates.
2148             try {
2149                 ContentValues values = new ContentValues();
2150                 values.put(NAME, name);
2151                 values.put(VALUE, value);
2152                 resolver.insert(uri, values);
2153                 return true;
2154             } catch (SQLException e) {
2155                 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
2156                 return false;
2157             }
2158         }
2159 
getUriFor(Uri uri, String name)2160         public static Uri getUriFor(Uri uri, String name) {
2161             return Uri.withAppendedPath(uri, name);
2162         }
2163     }
2164 
2165     private static final class GenerationTracker {
2166         private final MemoryIntArray mArray;
2167         private final Runnable mErrorHandler;
2168         private final int mIndex;
2169         private int mCurrentGeneration;
2170 
GenerationTracker(@onNull MemoryIntArray array, int index, int generation, Runnable errorHandler)2171         public GenerationTracker(@NonNull MemoryIntArray array, int index,
2172                 int generation, Runnable errorHandler) {
2173             mArray = array;
2174             mIndex = index;
2175             mErrorHandler = errorHandler;
2176             mCurrentGeneration = generation;
2177         }
2178 
isGenerationChanged()2179         public boolean isGenerationChanged() {
2180             final int currentGeneration = readCurrentGeneration();
2181             if (currentGeneration >= 0) {
2182                 if (currentGeneration == mCurrentGeneration) {
2183                     return false;
2184                 }
2185                 mCurrentGeneration = currentGeneration;
2186             }
2187             return true;
2188         }
2189 
getCurrentGeneration()2190         public int getCurrentGeneration() {
2191             return mCurrentGeneration;
2192         }
2193 
readCurrentGeneration()2194         private int readCurrentGeneration() {
2195             try {
2196                 return mArray.get(mIndex);
2197             } catch (IOException e) {
2198                 Log.e(TAG, "Error getting current generation", e);
2199                 if (mErrorHandler != null) {
2200                     mErrorHandler.run();
2201                 }
2202             }
2203             return -1;
2204         }
2205 
destroy()2206         public void destroy() {
2207             try {
2208                 mArray.close();
2209             } catch (IOException e) {
2210                 Log.e(TAG, "Error closing backing array", e);
2211                 if (mErrorHandler != null) {
2212                     mErrorHandler.run();
2213                 }
2214             }
2215         }
2216     }
2217 
2218     private static final class ContentProviderHolder {
2219         private final Object mLock = new Object();
2220 
2221         @GuardedBy("mLock")
2222         private final Uri mUri;
2223         @GuardedBy("mLock")
2224         @UnsupportedAppUsage
2225         private IContentProvider mContentProvider;
2226 
ContentProviderHolder(Uri uri)2227         public ContentProviderHolder(Uri uri) {
2228             mUri = uri;
2229         }
2230 
getProvider(ContentResolver contentResolver)2231         public IContentProvider getProvider(ContentResolver contentResolver) {
2232             synchronized (mLock) {
2233                 if (mContentProvider == null) {
2234                     mContentProvider = contentResolver
2235                             .acquireProvider(mUri.getAuthority());
2236                 }
2237                 return mContentProvider;
2238             }
2239         }
2240 
clearProviderForTest()2241         public void clearProviderForTest() {
2242             synchronized (mLock) {
2243                 mContentProvider = null;
2244             }
2245         }
2246     }
2247 
2248     // Thread-safe.
2249     private static class NameValueCache {
2250         private static final boolean DEBUG = false;
2251 
2252         private static final String[] SELECT_VALUE_PROJECTION = new String[] {
2253                 Settings.NameValueTable.VALUE
2254         };
2255 
2256         private static final String NAME_EQ_PLACEHOLDER = "name=?";
2257 
2258         // Must synchronize on 'this' to access mValues and mValuesVersion.
2259         private final HashMap<String, String> mValues = new HashMap<>();
2260 
2261         private final Uri mUri;
2262         @UnsupportedAppUsage
2263         private final ContentProviderHolder mProviderHolder;
2264 
2265         // The method we'll call (or null, to not use) on the provider
2266         // for the fast path of retrieving settings.
2267         private final String mCallGetCommand;
2268         private final String mCallSetCommand;
2269 
2270         @GuardedBy("this")
2271         private GenerationTracker mGenerationTracker;
2272 
NameValueCache(Uri uri, String getCommand, String setCommand, ContentProviderHolder providerHolder)2273         public NameValueCache(Uri uri, String getCommand, String setCommand,
2274                 ContentProviderHolder providerHolder) {
2275             mUri = uri;
2276             mCallGetCommand = getCommand;
2277             mCallSetCommand = setCommand;
2278             mProviderHolder = providerHolder;
2279         }
2280 
putStringForUser(ContentResolver cr, String name, String value, String tag, boolean makeDefault, final int userHandle)2281         public boolean putStringForUser(ContentResolver cr, String name, String value,
2282                 String tag, boolean makeDefault, final int userHandle) {
2283             try {
2284                 Bundle arg = new Bundle();
2285                 arg.putString(Settings.NameValueTable.VALUE, value);
2286                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
2287                 if (tag != null) {
2288                     arg.putString(CALL_METHOD_TAG_KEY, tag);
2289                 }
2290                 if (makeDefault) {
2291                     arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true);
2292                 }
2293                 IContentProvider cp = mProviderHolder.getProvider(cr);
2294                 cp.call(cr.getPackageName(), mProviderHolder.mUri.getAuthority(),
2295                         mCallSetCommand, name, arg);
2296             } catch (RemoteException e) {
2297                 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
2298                 return false;
2299             }
2300             return true;
2301         }
2302 
2303         @UnsupportedAppUsage
getStringForUser(ContentResolver cr, String name, final int userHandle)2304         public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
2305             final boolean isSelf = (userHandle == UserHandle.myUserId());
2306             int currentGeneration = -1;
2307             if (isSelf) {
2308                 synchronized (NameValueCache.this) {
2309                     if (mGenerationTracker != null) {
2310                         if (mGenerationTracker.isGenerationChanged()) {
2311                             if (DEBUG) {
2312                                 Log.i(TAG, "Generation changed for type:"
2313                                         + mUri.getPath() + " in package:"
2314                                         + cr.getPackageName() +" and user:" + userHandle);
2315                             }
2316                             mValues.clear();
2317                         } else if (mValues.containsKey(name)) {
2318                             return mValues.get(name);
2319                         }
2320                         if (mGenerationTracker != null) {
2321                             currentGeneration = mGenerationTracker.getCurrentGeneration();
2322                         }
2323                     }
2324                 }
2325             } else {
2326                 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
2327                         + " by user " + UserHandle.myUserId() + " so skipping cache");
2328             }
2329 
2330             IContentProvider cp = mProviderHolder.getProvider(cr);
2331 
2332             // Try the fast path first, not using query().  If this
2333             // fails (alternate Settings provider that doesn't support
2334             // this interface?) then we fall back to the query/table
2335             // interface.
2336             if (mCallGetCommand != null) {
2337                 try {
2338                     Bundle args = null;
2339                     if (!isSelf) {
2340                         args = new Bundle();
2341                         args.putInt(CALL_METHOD_USER_KEY, userHandle);
2342                     }
2343                     boolean needsGenerationTracker = false;
2344                     synchronized (NameValueCache.this) {
2345                         if (isSelf && mGenerationTracker == null) {
2346                             needsGenerationTracker = true;
2347                             if (args == null) {
2348                                 args = new Bundle();
2349                             }
2350                             args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
2351                             if (DEBUG) {
2352                                 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath()
2353                                         + " in package:" + cr.getPackageName() +" and user:"
2354                                         + userHandle);
2355                             }
2356                         }
2357                     }
2358                     Bundle b;
2359                     // If we're in system server and in a binder transaction we need to clear the
2360                     // calling uid. This works around code in system server that did not call
2361                     // clearCallingIdentity, previously this wasn't needed because reading settings
2362                     // did not do permission checking but thats no longer the case.
2363                     // Long term this should be removed and callers should properly call
2364                     // clearCallingIdentity or use a ContentResolver from the caller as needed.
2365                     if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
2366                         final long token = Binder.clearCallingIdentity();
2367                         try {
2368                             b = cp.call(cr.getPackageName(), mProviderHolder.mUri.getAuthority(),
2369                                     mCallGetCommand, name, args);
2370                         } finally {
2371                             Binder.restoreCallingIdentity(token);
2372                         }
2373                     } else {
2374                         b = cp.call(cr.getPackageName(), mProviderHolder.mUri.getAuthority(),
2375                                 mCallGetCommand, name, args);
2376                     }
2377                     if (b != null) {
2378                         String value = b.getString(Settings.NameValueTable.VALUE);
2379                         // Don't update our cache for reads of other users' data
2380                         if (isSelf) {
2381                             synchronized (NameValueCache.this) {
2382                                 if (needsGenerationTracker) {
2383                                     MemoryIntArray array = b.getParcelable(
2384                                             CALL_METHOD_TRACK_GENERATION_KEY);
2385                                     final int index = b.getInt(
2386                                             CALL_METHOD_GENERATION_INDEX_KEY, -1);
2387                                     if (array != null && index >= 0) {
2388                                         final int generation = b.getInt(
2389                                                 CALL_METHOD_GENERATION_KEY, 0);
2390                                         if (DEBUG) {
2391                                             Log.i(TAG, "Received generation tracker for type:"
2392                                                     + mUri.getPath() + " in package:"
2393                                                     + cr.getPackageName() + " and user:"
2394                                                     + userHandle + " with index:" + index);
2395                                         }
2396                                         if (mGenerationTracker != null) {
2397                                             mGenerationTracker.destroy();
2398                                         }
2399                                         mGenerationTracker = new GenerationTracker(array, index,
2400                                                 generation, () -> {
2401                                             synchronized (NameValueCache.this) {
2402                                                 Log.e(TAG, "Error accessing generation"
2403                                                         + " tracker - removing");
2404                                                 if (mGenerationTracker != null) {
2405                                                     GenerationTracker generationTracker =
2406                                                             mGenerationTracker;
2407                                                     mGenerationTracker = null;
2408                                                     generationTracker.destroy();
2409                                                     mValues.clear();
2410                                                 }
2411                                             }
2412                                         });
2413                                     }
2414                                 }
2415                                 if (mGenerationTracker != null && currentGeneration ==
2416                                         mGenerationTracker.getCurrentGeneration()) {
2417                                     mValues.put(name, value);
2418                                 }
2419                             }
2420                         } else {
2421                             if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
2422                                     + " by " + UserHandle.myUserId()
2423                                     + " so not updating cache");
2424                         }
2425                         return value;
2426                     }
2427                     // If the response Bundle is null, we fall through
2428                     // to the query interface below.
2429                 } catch (RemoteException e) {
2430                     // Not supported by the remote side?  Fall through
2431                     // to query().
2432                 }
2433             }
2434 
2435             Cursor c = null;
2436             try {
2437                 Bundle queryArgs = ContentResolver.createSqlQueryBundle(
2438                         NAME_EQ_PLACEHOLDER, new String[]{name}, null);
2439                 // Same workaround as above.
2440                 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
2441                     final long token = Binder.clearCallingIdentity();
2442                     try {
2443                         c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs,
2444                                 null);
2445                     } finally {
2446                         Binder.restoreCallingIdentity(token);
2447                     }
2448                 } else {
2449                     c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs,
2450                             null);
2451                 }
2452                 if (c == null) {
2453                     Log.w(TAG, "Can't get key " + name + " from " + mUri);
2454                     return null;
2455                 }
2456 
2457                 String value = c.moveToNext() ? c.getString(0) : null;
2458                 synchronized (NameValueCache.this) {
2459                     if(mGenerationTracker != null &&
2460                             currentGeneration == mGenerationTracker.getCurrentGeneration()) {
2461                         mValues.put(name, value);
2462                     }
2463                 }
2464                 if (LOCAL_LOGV) {
2465                     Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
2466                             name + " = " + (value == null ? "(null)" : value));
2467                 }
2468                 return value;
2469             } catch (RemoteException e) {
2470                 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
2471                 return null;  // Return null, but don't cache it.
2472             } finally {
2473                 if (c != null) c.close();
2474             }
2475         }
2476 
clearGenerationTrackerForTest()2477         public void clearGenerationTrackerForTest() {
2478             synchronized (NameValueCache.this) {
2479                 if (mGenerationTracker != null) {
2480                     mGenerationTracker.destroy();
2481                 }
2482                 mValues.clear();
2483                 mGenerationTracker = null;
2484             }
2485         }
2486     }
2487 
2488     /**
2489      * Checks if the specified context can draw on top of other apps. As of API
2490      * level 23, an app cannot draw on top of other apps unless it declares the
2491      * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its
2492      * manifest, <em>and</em> the user specifically grants the app this
2493      * capability. To prompt the user to grant this approval, the app must send an
2494      * intent with the action
2495      * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which
2496      * causes the system to display a permission management screen.
2497      *
2498      * @param context App context.
2499      * @return true if the specified context can draw on top of other apps, false otherwise
2500      */
canDrawOverlays(Context context)2501     public static boolean canDrawOverlays(Context context) {
2502         return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(),
2503                 context.getOpPackageName(), false);
2504     }
2505 
2506     /**
2507      * System settings, containing miscellaneous system preferences.  This
2508      * table holds simple name/value pairs.  There are convenience
2509      * functions for accessing individual settings entries.
2510      */
2511     public static final class System extends NameValueTable {
2512         // NOTE: If you add new settings here, be sure to add them to
2513         // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked.
2514 
2515         private static final float DEFAULT_FONT_SCALE = 1.0f;
2516 
2517         /**
2518          * The content:// style URL for this table
2519          */
2520         public static final Uri CONTENT_URI =
2521             Uri.parse("content://" + AUTHORITY + "/system");
2522 
2523         @UnsupportedAppUsage
2524         private static final ContentProviderHolder sProviderHolder =
2525                 new ContentProviderHolder(CONTENT_URI);
2526 
2527         @UnsupportedAppUsage
2528         private static final NameValueCache sNameValueCache = new NameValueCache(
2529                 CONTENT_URI,
2530                 CALL_METHOD_GET_SYSTEM,
2531                 CALL_METHOD_PUT_SYSTEM,
2532                 sProviderHolder);
2533 
2534         @UnsupportedAppUsage
2535         private static final HashSet<String> MOVED_TO_SECURE;
2536         static {
2537             MOVED_TO_SECURE = new HashSet<>(30);
2538             MOVED_TO_SECURE.add(Secure.ANDROID_ID);
2539             MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
2540             MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
2541             MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
2542             MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
2543             MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
2544             MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
2545             MOVED_TO_SECURE.add(Secure.LOGGING_ID);
2546             MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
2547             MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
2548             MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
2549             MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
2550             MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
2551             MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
2552             MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
2553             MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
2554             MOVED_TO_SECURE.add(Secure.WIFI_ON);
2555             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
2556             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
2557             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
2558             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
2559             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
2560             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
2561             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
2562             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
2563             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
2564             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
2565             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
2566 
2567             // At one time in System, then Global, but now back in Secure
2568             MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
2569         }
2570 
2571         @UnsupportedAppUsage
2572         private static final HashSet<String> MOVED_TO_GLOBAL;
2573         @UnsupportedAppUsage
2574         private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
2575         static {
2576             MOVED_TO_GLOBAL = new HashSet<>();
2577             MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>();
2578 
2579             // these were originally in system but migrated to secure in the past,
2580             // so are duplicated in the Secure.* namespace
2581             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
2582             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
2583             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
2584             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
2585             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
2586             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
2587 
2588             // these are moving directly from system to global
2589             MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
2590             MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
2591             MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
2592             MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
2593             MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
2594             MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
2595             MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
2596             MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
2597             MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
2598             MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
2599             MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
2600             MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
2601             MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
2602             MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
2603             MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
2604             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
2605             MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
2606             MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
2607             MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
2608             MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
2609             MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
2610             MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
2611             MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
2612             MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
2613             MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
2614             MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
2615             MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
2616             MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
2617             MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
2618             MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
2619             MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
2620             MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
2621             MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
2622             MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
2623             MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
2624         }
2625 
2626         /** @hide */
getMovedToGlobalSettings(Set<String> outKeySet)2627         public static void getMovedToGlobalSettings(Set<String> outKeySet) {
2628             outKeySet.addAll(MOVED_TO_GLOBAL);
2629             outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
2630         }
2631 
2632         /** @hide */
getMovedToSecureSettings(Set<String> outKeySet)2633         public static void getMovedToSecureSettings(Set<String> outKeySet) {
2634             outKeySet.addAll(MOVED_TO_SECURE);
2635         }
2636 
2637         /** @hide */
getNonLegacyMovedKeys(HashSet<String> outKeySet)2638         public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
2639             outKeySet.addAll(MOVED_TO_GLOBAL);
2640         }
2641 
2642         /** @hide */
clearProviderForTest()2643         public static void clearProviderForTest() {
2644             sProviderHolder.clearProviderForTest();
2645             sNameValueCache.clearGenerationTrackerForTest();
2646         }
2647 
2648         /**
2649          * Look up a name in the database.
2650          * @param resolver to access the database with
2651          * @param name to look up in the table
2652          * @return the corresponding value, or null if not present
2653          */
getString(ContentResolver resolver, String name)2654         public static String getString(ContentResolver resolver, String name) {
2655             return getStringForUser(resolver, name, resolver.getUserId());
2656         }
2657 
2658         /** @hide */
2659         @UnsupportedAppUsage
getStringForUser(ContentResolver resolver, String name, int userHandle)2660         public static String getStringForUser(ContentResolver resolver, String name,
2661                 int userHandle) {
2662             if (MOVED_TO_SECURE.contains(name)) {
2663                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2664                         + " to android.provider.Settings.Secure, returning read-only value.");
2665                 return Secure.getStringForUser(resolver, name, userHandle);
2666             }
2667             if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
2668                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2669                         + " to android.provider.Settings.Global, returning read-only value.");
2670                 return Global.getStringForUser(resolver, name, userHandle);
2671             }
2672             return sNameValueCache.getStringForUser(resolver, name, userHandle);
2673         }
2674 
2675         /**
2676          * Store a name/value pair into the database.
2677          * @param resolver to access the database with
2678          * @param name to store
2679          * @param value to associate with the name
2680          * @return true if the value was set, false on database errors
2681          */
putString(ContentResolver resolver, String name, String value)2682         public static boolean putString(ContentResolver resolver, String name, String value) {
2683             return putStringForUser(resolver, name, value, resolver.getUserId());
2684         }
2685 
2686         /** @hide */
2687         @UnsupportedAppUsage
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)2688         public static boolean putStringForUser(ContentResolver resolver, String name, String value,
2689                 int userHandle) {
2690             if (MOVED_TO_SECURE.contains(name)) {
2691                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2692                         + " to android.provider.Settings.Secure, value is unchanged.");
2693                 return false;
2694             }
2695             if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
2696                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2697                         + " to android.provider.Settings.Global, value is unchanged.");
2698                 return false;
2699             }
2700             return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle);
2701         }
2702 
2703         /**
2704          * Construct the content URI for a particular name/value pair,
2705          * useful for monitoring changes with a ContentObserver.
2706          * @param name to look up in the table
2707          * @return the corresponding content URI, or null if not present
2708          */
getUriFor(String name)2709         public static Uri getUriFor(String name) {
2710             if (MOVED_TO_SECURE.contains(name)) {
2711                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2712                     + " to android.provider.Settings.Secure, returning Secure URI.");
2713                 return Secure.getUriFor(Secure.CONTENT_URI, name);
2714             }
2715             if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
2716                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2717                         + " to android.provider.Settings.Global, returning read-only global URI.");
2718                 return Global.getUriFor(Global.CONTENT_URI, name);
2719             }
2720             return getUriFor(CONTENT_URI, name);
2721         }
2722 
2723         /**
2724          * Convenience function for retrieving a single system settings value
2725          * as an integer.  Note that internally setting values are always
2726          * stored as strings; this function converts the string to an integer
2727          * for you.  The default value will be returned if the setting is
2728          * not defined or not an integer.
2729          *
2730          * @param cr The ContentResolver to access.
2731          * @param name The name of the setting to retrieve.
2732          * @param def Value to return if the setting is not defined.
2733          *
2734          * @return The setting's current value, or 'def' if it is not defined
2735          * or not a valid integer.
2736          */
getInt(ContentResolver cr, String name, int def)2737         public static int getInt(ContentResolver cr, String name, int def) {
2738             return getIntForUser(cr, name, def, cr.getUserId());
2739         }
2740 
2741         /** @hide */
2742         @UnsupportedAppUsage
getIntForUser(ContentResolver cr, String name, int def, int userHandle)2743         public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
2744             String v = getStringForUser(cr, name, userHandle);
2745             try {
2746                 return v != null ? Integer.parseInt(v) : def;
2747             } catch (NumberFormatException e) {
2748                 return def;
2749             }
2750         }
2751 
2752         /**
2753          * Convenience function for retrieving a single system settings value
2754          * as an integer.  Note that internally setting values are always
2755          * stored as strings; this function converts the string to an integer
2756          * for you.
2757          * <p>
2758          * This version does not take a default value.  If the setting has not
2759          * been set, or the string value is not a number,
2760          * it throws {@link SettingNotFoundException}.
2761          *
2762          * @param cr The ContentResolver to access.
2763          * @param name The name of the setting to retrieve.
2764          *
2765          * @throws SettingNotFoundException Thrown if a setting by the given
2766          * name can't be found or the setting value is not an integer.
2767          *
2768          * @return The setting's current value.
2769          */
getInt(ContentResolver cr, String name)2770         public static int getInt(ContentResolver cr, String name)
2771                 throws SettingNotFoundException {
2772             return getIntForUser(cr, name, cr.getUserId());
2773         }
2774 
2775         /** @hide */
2776         @UnsupportedAppUsage
getIntForUser(ContentResolver cr, String name, int userHandle)2777         public static int getIntForUser(ContentResolver cr, String name, int userHandle)
2778                 throws SettingNotFoundException {
2779             String v = getStringForUser(cr, name, userHandle);
2780             try {
2781                 return Integer.parseInt(v);
2782             } catch (NumberFormatException e) {
2783                 throw new SettingNotFoundException(name);
2784             }
2785         }
2786 
2787         /**
2788          * Convenience function for updating a single settings value as an
2789          * integer. This will either create a new entry in the table if the
2790          * given name does not exist, or modify the value of the existing row
2791          * with that name.  Note that internally setting values are always
2792          * stored as strings, so this function converts the given value to a
2793          * string before storing it.
2794          *
2795          * @param cr The ContentResolver to access.
2796          * @param name The name of the setting to modify.
2797          * @param value The new value for the setting.
2798          * @return true if the value was set, false on database errors
2799          */
putInt(ContentResolver cr, String name, int value)2800         public static boolean putInt(ContentResolver cr, String name, int value) {
2801             return putIntForUser(cr, name, value, cr.getUserId());
2802         }
2803 
2804         /** @hide */
2805         @UnsupportedAppUsage
putIntForUser(ContentResolver cr, String name, int value, int userHandle)2806         public static boolean putIntForUser(ContentResolver cr, String name, int value,
2807                 int userHandle) {
2808             return putStringForUser(cr, name, Integer.toString(value), userHandle);
2809         }
2810 
2811         /**
2812          * Convenience function for retrieving a single system settings value
2813          * as a {@code long}.  Note that internally setting values are always
2814          * stored as strings; this function converts the string to a {@code long}
2815          * for you.  The default value will be returned if the setting is
2816          * not defined or not a {@code long}.
2817          *
2818          * @param cr The ContentResolver to access.
2819          * @param name The name of the setting to retrieve.
2820          * @param def Value to return if the setting is not defined.
2821          *
2822          * @return The setting's current value, or 'def' if it is not defined
2823          * or not a valid {@code long}.
2824          */
getLong(ContentResolver cr, String name, long def)2825         public static long getLong(ContentResolver cr, String name, long def) {
2826             return getLongForUser(cr, name, def, cr.getUserId());
2827         }
2828 
2829         /** @hide */
getLongForUser(ContentResolver cr, String name, long def, int userHandle)2830         public static long getLongForUser(ContentResolver cr, String name, long def,
2831                 int userHandle) {
2832             String valString = getStringForUser(cr, name, userHandle);
2833             long value;
2834             try {
2835                 value = valString != null ? Long.parseLong(valString) : def;
2836             } catch (NumberFormatException e) {
2837                 value = def;
2838             }
2839             return value;
2840         }
2841 
2842         /**
2843          * Convenience function for retrieving a single system settings value
2844          * as a {@code long}.  Note that internally setting values are always
2845          * stored as strings; this function converts the string to a {@code long}
2846          * for you.
2847          * <p>
2848          * This version does not take a default value.  If the setting has not
2849          * been set, or the string value is not a number,
2850          * it throws {@link SettingNotFoundException}.
2851          *
2852          * @param cr The ContentResolver to access.
2853          * @param name The name of the setting to retrieve.
2854          *
2855          * @return The setting's current value.
2856          * @throws SettingNotFoundException Thrown if a setting by the given
2857          * name can't be found or the setting value is not an integer.
2858          */
getLong(ContentResolver cr, String name)2859         public static long getLong(ContentResolver cr, String name)
2860                 throws SettingNotFoundException {
2861             return getLongForUser(cr, name, cr.getUserId());
2862         }
2863 
2864         /** @hide */
getLongForUser(ContentResolver cr, String name, int userHandle)2865         public static long getLongForUser(ContentResolver cr, String name, int userHandle)
2866                 throws SettingNotFoundException {
2867             String valString = getStringForUser(cr, name, userHandle);
2868             try {
2869                 return Long.parseLong(valString);
2870             } catch (NumberFormatException e) {
2871                 throw new SettingNotFoundException(name);
2872             }
2873         }
2874 
2875         /**
2876          * Convenience function for updating a single settings value as a long
2877          * integer. This will either create a new entry in the table if the
2878          * given name does not exist, or modify the value of the existing row
2879          * with that name.  Note that internally setting values are always
2880          * stored as strings, so this function converts the given value to a
2881          * string before storing it.
2882          *
2883          * @param cr The ContentResolver to access.
2884          * @param name The name of the setting to modify.
2885          * @param value The new value for the setting.
2886          * @return true if the value was set, false on database errors
2887          */
putLong(ContentResolver cr, String name, long value)2888         public static boolean putLong(ContentResolver cr, String name, long value) {
2889             return putLongForUser(cr, name, value, cr.getUserId());
2890         }
2891 
2892         /** @hide */
putLongForUser(ContentResolver cr, String name, long value, int userHandle)2893         public static boolean putLongForUser(ContentResolver cr, String name, long value,
2894                 int userHandle) {
2895             return putStringForUser(cr, name, Long.toString(value), userHandle);
2896         }
2897 
2898         /**
2899          * Convenience function for retrieving a single system settings value
2900          * as a floating point number.  Note that internally setting values are
2901          * always stored as strings; this function converts the string to an
2902          * float for you. The default value will be returned if the setting
2903          * is not defined or not a valid float.
2904          *
2905          * @param cr The ContentResolver to access.
2906          * @param name The name of the setting to retrieve.
2907          * @param def Value to return if the setting is not defined.
2908          *
2909          * @return The setting's current value, or 'def' if it is not defined
2910          * or not a valid float.
2911          */
getFloat(ContentResolver cr, String name, float def)2912         public static float getFloat(ContentResolver cr, String name, float def) {
2913             return getFloatForUser(cr, name, def, cr.getUserId());
2914         }
2915 
2916         /** @hide */
getFloatForUser(ContentResolver cr, String name, float def, int userHandle)2917         public static float getFloatForUser(ContentResolver cr, String name, float def,
2918                 int userHandle) {
2919             String v = getStringForUser(cr, name, userHandle);
2920             try {
2921                 return v != null ? Float.parseFloat(v) : def;
2922             } catch (NumberFormatException e) {
2923                 return def;
2924             }
2925         }
2926 
2927         /**
2928          * Convenience function for retrieving a single system settings value
2929          * as a float.  Note that internally setting values are always
2930          * stored as strings; this function converts the string to a float
2931          * for you.
2932          * <p>
2933          * This version does not take a default value.  If the setting has not
2934          * been set, or the string value is not a number,
2935          * it throws {@link SettingNotFoundException}.
2936          *
2937          * @param cr The ContentResolver to access.
2938          * @param name The name of the setting to retrieve.
2939          *
2940          * @throws SettingNotFoundException Thrown if a setting by the given
2941          * name can't be found or the setting value is not a float.
2942          *
2943          * @return The setting's current value.
2944          */
getFloat(ContentResolver cr, String name)2945         public static float getFloat(ContentResolver cr, String name)
2946                 throws SettingNotFoundException {
2947             return getFloatForUser(cr, name, cr.getUserId());
2948         }
2949 
2950         /** @hide */
getFloatForUser(ContentResolver cr, String name, int userHandle)2951         public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
2952                 throws SettingNotFoundException {
2953             String v = getStringForUser(cr, name, userHandle);
2954             if (v == null) {
2955                 throw new SettingNotFoundException(name);
2956             }
2957             try {
2958                 return Float.parseFloat(v);
2959             } catch (NumberFormatException e) {
2960                 throw new SettingNotFoundException(name);
2961             }
2962         }
2963 
2964         /**
2965          * Convenience function for updating a single settings value as a
2966          * floating point number. This will either create a new entry in the
2967          * table if the given name does not exist, or modify the value of the
2968          * existing row with that name.  Note that internally setting values
2969          * are always stored as strings, so this function converts the given
2970          * value to a string before storing it.
2971          *
2972          * @param cr The ContentResolver to access.
2973          * @param name The name of the setting to modify.
2974          * @param value The new value for the setting.
2975          * @return true if the value was set, false on database errors
2976          */
putFloat(ContentResolver cr, String name, float value)2977         public static boolean putFloat(ContentResolver cr, String name, float value) {
2978             return putFloatForUser(cr, name, value, cr.getUserId());
2979         }
2980 
2981         /** @hide */
putFloatForUser(ContentResolver cr, String name, float value, int userHandle)2982         public static boolean putFloatForUser(ContentResolver cr, String name, float value,
2983                 int userHandle) {
2984             return putStringForUser(cr, name, Float.toString(value), userHandle);
2985         }
2986 
2987         /**
2988          * Convenience function to read all of the current
2989          * configuration-related settings into a
2990          * {@link Configuration} object.
2991          *
2992          * @param cr The ContentResolver to access.
2993          * @param outConfig Where to place the configuration settings.
2994          */
getConfiguration(ContentResolver cr, Configuration outConfig)2995         public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
2996             adjustConfigurationForUser(cr, outConfig, cr.getUserId(),
2997                     false /* updateSettingsIfEmpty */);
2998         }
2999 
3000         /** @hide */
adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, int userHandle, boolean updateSettingsIfEmpty)3001         public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig,
3002                 int userHandle, boolean updateSettingsIfEmpty) {
3003             outConfig.fontScale = Settings.System.getFloatForUser(
3004                     cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle);
3005             if (outConfig.fontScale < 0) {
3006                 outConfig.fontScale = DEFAULT_FONT_SCALE;
3007             }
3008 
3009             final String localeValue =
3010                     Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle);
3011             if (localeValue != null) {
3012                 outConfig.setLocales(LocaleList.forLanguageTags(localeValue));
3013             } else {
3014                 // Do not update configuration with emtpy settings since we need to take over the
3015                 // locale list of previous user if the settings value is empty. This happens when a
3016                 // new user is created.
3017 
3018                 if (updateSettingsIfEmpty) {
3019                     // Make current configuration persistent. This is necessary the first time a
3020                     // user log in. At the first login, the configuration settings are empty, so we
3021                     // need to store the adjusted configuration as the initial settings.
3022                     Settings.System.putStringForUser(
3023                             cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(),
3024                             userHandle);
3025                 }
3026             }
3027         }
3028 
3029         /**
3030          * @hide Erase the fields in the Configuration that should be applied
3031          * by the settings.
3032          */
clearConfiguration(Configuration inoutConfig)3033         public static void clearConfiguration(Configuration inoutConfig) {
3034             inoutConfig.fontScale = 0;
3035             if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) {
3036                 inoutConfig.clearLocales();
3037             }
3038         }
3039 
3040         /**
3041          * Convenience function to write a batch of configuration-related
3042          * settings from a {@link Configuration} object.
3043          *
3044          * @param cr The ContentResolver to access.
3045          * @param config The settings to write.
3046          * @return true if the values were set, false on database errors
3047          */
putConfiguration(ContentResolver cr, Configuration config)3048         public static boolean putConfiguration(ContentResolver cr, Configuration config) {
3049             return putConfigurationForUser(cr, config, cr.getUserId());
3050         }
3051 
3052         /** @hide */
putConfigurationForUser(ContentResolver cr, Configuration config, int userHandle)3053         public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
3054                 int userHandle) {
3055             return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) &&
3056                     Settings.System.putStringForUser(
3057                             cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle);
3058         }
3059 
3060         /** @hide */
hasInterestingConfigurationChanges(int changes)3061         public static boolean hasInterestingConfigurationChanges(int changes) {
3062             return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 ||
3063                     (changes & ActivityInfo.CONFIG_LOCALE) != 0;
3064         }
3065 
3066         /** @deprecated - Do not use */
3067         @Deprecated
getShowGTalkServiceStatus(ContentResolver cr)3068         public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
3069             return getShowGTalkServiceStatusForUser(cr, cr.getUserId());
3070         }
3071 
3072         /**
3073          * @hide
3074          * @deprecated - Do not use
3075          */
3076         @Deprecated
getShowGTalkServiceStatusForUser(ContentResolver cr, int userHandle)3077         public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
3078                 int userHandle) {
3079             return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
3080         }
3081 
3082         /** @deprecated - Do not use */
3083         @Deprecated
setShowGTalkServiceStatus(ContentResolver cr, boolean flag)3084         public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
3085             setShowGTalkServiceStatusForUser(cr, flag, cr.getUserId());
3086         }
3087 
3088         /**
3089          * @hide
3090          * @deprecated - Do not use
3091          */
3092         @Deprecated
setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, int userHandle)3093         public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
3094                 int userHandle) {
3095             putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
3096         }
3097 
3098         /**
3099          * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
3100          */
3101         @Deprecated
3102         public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN;
3103 
3104         private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() {
3105             @Override
3106             public boolean validate(String value) {
3107                 try {
3108                     int val = Integer.parseInt(value);
3109                     return (val == 0)
3110                             || (val == BatteryManager.BATTERY_PLUGGED_AC)
3111                             || (val == BatteryManager.BATTERY_PLUGGED_USB)
3112                             || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS)
3113                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
3114                                     | BatteryManager.BATTERY_PLUGGED_USB))
3115                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
3116                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS))
3117                             || (val == (BatteryManager.BATTERY_PLUGGED_USB
3118                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS))
3119                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
3120                                     | BatteryManager.BATTERY_PLUGGED_USB
3121                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS));
3122                 } catch (NumberFormatException e) {
3123                     return false;
3124                 }
3125             }
3126         };
3127 
3128         /**
3129          * What happens when the user presses the end call button if they're not
3130          * on a call.<br/>
3131          * <b>Values:</b><br/>
3132          * 0 - The end button does nothing.<br/>
3133          * 1 - The end button goes to the home screen.<br/>
3134          * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
3135          * 3 - The end button goes to the home screen.  If the user is already on the
3136          * home screen, it puts the device to sleep.
3137          */
3138         public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
3139 
3140         private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
3141                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
3142 
3143         /**
3144          * END_BUTTON_BEHAVIOR value for "go home".
3145          * @hide
3146          */
3147         public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
3148 
3149         /**
3150          * END_BUTTON_BEHAVIOR value for "go to sleep".
3151          * @hide
3152          */
3153         public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
3154 
3155         /**
3156          * END_BUTTON_BEHAVIOR default value.
3157          * @hide
3158          */
3159         public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
3160 
3161         /**
3162          * Is advanced settings mode turned on. 0 == no, 1 == yes
3163          * @hide
3164          */
3165         public static final String ADVANCED_SETTINGS = "advanced_settings";
3166 
3167         private static final Validator ADVANCED_SETTINGS_VALIDATOR = BOOLEAN_VALIDATOR;
3168 
3169         /**
3170          * ADVANCED_SETTINGS default value.
3171          * @hide
3172          */
3173         public static final int ADVANCED_SETTINGS_DEFAULT = 0;
3174 
3175         /**
3176          * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
3177          */
3178         @Deprecated
3179         public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
3180 
3181         /**
3182          * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
3183          */
3184         @Deprecated
3185         public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
3186 
3187         /**
3188          * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
3189          */
3190         @Deprecated
3191         public static final String RADIO_WIFI = Global.RADIO_WIFI;
3192 
3193         /**
3194          * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
3195          * {@hide}
3196          */
3197         @Deprecated
3198         public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
3199 
3200         /**
3201          * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
3202          */
3203         @Deprecated
3204         public static final String RADIO_CELL = Global.RADIO_CELL;
3205 
3206         /**
3207          * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
3208          */
3209         @Deprecated
3210         public static final String RADIO_NFC = Global.RADIO_NFC;
3211 
3212         /**
3213          * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
3214          */
3215         @Deprecated
3216         public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
3217 
3218         /**
3219          * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
3220          *
3221          * {@hide}
3222          */
3223         @Deprecated
3224         @UnsupportedAppUsage
3225         public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
3226                 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
3227 
3228         /**
3229          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
3230          */
3231         @Deprecated
3232         public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
3233 
3234         /**
3235          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
3236          */
3237         @Deprecated
3238         public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
3239 
3240         /**
3241          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
3242          */
3243         @Deprecated
3244         public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
3245                 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
3246 
3247         /**
3248          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
3249          */
3250         @Deprecated
3251         public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
3252 
3253         /**
3254          * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
3255          */
3256         @Deprecated
3257         public static final String MODE_RINGER = Global.MODE_RINGER;
3258 
3259         /**
3260          * Whether to use static IP and other static network attributes.
3261          * <p>
3262          * Set to 1 for true and 0 for false.
3263          *
3264          * @deprecated Use {@link WifiManager} instead
3265          */
3266         @Deprecated
3267         public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
3268 
3269         private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = BOOLEAN_VALIDATOR;
3270 
3271         /**
3272          * The static IP address.
3273          * <p>
3274          * Example: "192.168.1.51"
3275          *
3276          * @deprecated Use {@link WifiManager} instead
3277          */
3278         @Deprecated
3279         public static final String WIFI_STATIC_IP = "wifi_static_ip";
3280 
3281         private static final Validator WIFI_STATIC_IP_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
3282 
3283         /**
3284          * If using static IP, the gateway's IP address.
3285          * <p>
3286          * Example: "192.168.1.1"
3287          *
3288          * @deprecated Use {@link WifiManager} instead
3289          */
3290         @Deprecated
3291         public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
3292 
3293         private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
3294 
3295         /**
3296          * If using static IP, the net mask.
3297          * <p>
3298          * Example: "255.255.255.0"
3299          *
3300          * @deprecated Use {@link WifiManager} instead
3301          */
3302         @Deprecated
3303         public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
3304 
3305         private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
3306 
3307         /**
3308          * If using static IP, the primary DNS's IP address.
3309          * <p>
3310          * Example: "192.168.1.1"
3311          *
3312          * @deprecated Use {@link WifiManager} instead
3313          */
3314         @Deprecated
3315         public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
3316 
3317         private static final Validator WIFI_STATIC_DNS1_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
3318 
3319         /**
3320          * If using static IP, the secondary DNS's IP address.
3321          * <p>
3322          * Example: "192.168.1.2"
3323          *
3324          * @deprecated Use {@link WifiManager} instead
3325          */
3326         @Deprecated
3327         public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
3328 
3329         private static final Validator WIFI_STATIC_DNS2_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
3330 
3331         /**
3332          * Determines whether remote devices may discover and/or connect to
3333          * this device.
3334          * <P>Type: INT</P>
3335          * 2 -- discoverable and connectable
3336          * 1 -- connectable but not discoverable
3337          * 0 -- neither connectable nor discoverable
3338          */
3339         public static final String BLUETOOTH_DISCOVERABILITY =
3340             "bluetooth_discoverability";
3341 
3342         private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
3343                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 2);
3344 
3345         /**
3346          * Bluetooth discoverability timeout.  If this value is nonzero, then
3347          * Bluetooth becomes discoverable for a certain number of seconds,
3348          * after which is becomes simply connectable.  The value is in seconds.
3349          */
3350         public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
3351             "bluetooth_discoverability_timeout";
3352 
3353         private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
3354                 NON_NEGATIVE_INTEGER_VALIDATOR;
3355 
3356         /**
3357          * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
3358          * instead
3359          */
3360         @Deprecated
3361         public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
3362 
3363         /**
3364          * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
3365          * instead
3366          */
3367         @Deprecated
3368         public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
3369 
3370         /**
3371          * @deprecated Use
3372          * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
3373          * instead
3374          */
3375         @Deprecated
3376         public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
3377             "lock_pattern_tactile_feedback_enabled";
3378 
3379         /**
3380          * A formatted string of the next alarm that is set, or the empty string
3381          * if there is no alarm set.
3382          *
3383          * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
3384          */
3385         @Deprecated
3386         public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
3387 
3388         private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
3389             private static final int MAX_LENGTH = 1000;
3390 
3391             @Override
3392             public boolean validate(String value) {
3393                 // TODO: No idea what the correct format is.
3394                 return value == null || value.length() < MAX_LENGTH;
3395             }
3396         };
3397 
3398         /**
3399          * Scaling factor for fonts, float.
3400          */
3401         public static final String FONT_SCALE = "font_scale";
3402 
3403         private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
3404             @Override
3405             public boolean validate(@Nullable String value) {
3406                 try {
3407                     return Float.parseFloat(value) >= 0;
3408                 } catch (NumberFormatException | NullPointerException e) {
3409                     return false;
3410                 }
3411             }
3412         };
3413 
3414         /**
3415          * The serialized system locale value.
3416          *
3417          * Do not use this value directory.
3418          * To get system locale, use {@link LocaleList#getDefault} instead.
3419          * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales}
3420          * instead.
3421          * @hide
3422          */
3423         public static final String SYSTEM_LOCALES = "system_locales";
3424 
3425 
3426         /**
3427          * Name of an application package to be debugged.
3428          *
3429          * @deprecated Use {@link Global#DEBUG_APP} instead
3430          */
3431         @Deprecated
3432         public static final String DEBUG_APP = Global.DEBUG_APP;
3433 
3434         /**
3435          * If 1, when launching DEBUG_APP it will wait for the debugger before
3436          * starting user code.  If 0, it will run normally.
3437          *
3438          * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
3439          */
3440         @Deprecated
3441         public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
3442 
3443         /**
3444          * Whether or not to dim the screen. 0=no  1=yes
3445          * @deprecated This setting is no longer used.
3446          */
3447         @Deprecated
3448         public static final String DIM_SCREEN = "dim_screen";
3449 
3450         private static final Validator DIM_SCREEN_VALIDATOR = BOOLEAN_VALIDATOR;
3451 
3452         /**
3453          * The display color mode.
3454          * @hide
3455          */
3456         public static final String DISPLAY_COLOR_MODE = "display_color_mode";
3457 
3458         private static final Validator DISPLAY_COLOR_MODE_VALIDATOR = new Validator() {
3459             @Override
3460             public boolean validate(@Nullable String value) {
3461                 // Assume the actual validation that this device can properly handle this kind of
3462                 // color mode further down in ColorDisplayManager / ColorDisplayService.
3463                 try {
3464                     final int setting = Integer.parseInt(value);
3465                     final boolean isInFrameworkRange =
3466                             setting >= ColorDisplayManager.COLOR_MODE_NATURAL
3467                                     && setting <= ColorDisplayManager.COLOR_MODE_AUTOMATIC;
3468                     final boolean isInVendorRange =
3469                             setting >= ColorDisplayManager.VENDOR_COLOR_MODE_RANGE_MIN
3470                                     && setting <= ColorDisplayManager.VENDOR_COLOR_MODE_RANGE_MAX;
3471                     return isInFrameworkRange || isInVendorRange;
3472                 } catch (NumberFormatException | NullPointerException e) {
3473                     return false;
3474                 }
3475             }
3476         };
3477 
3478         /**
3479          * The user selected peak refresh rate in frames per second.
3480          *
3481          * If this isn't set, the system falls back to a device specific default.
3482          * @hide
3483          */
3484         public static final String PEAK_REFRESH_RATE = "peak_refresh_rate";
3485 
3486         private static final Validator PEAK_REFRESH_RATE_VALIDATOR =
3487                 new SettingsValidators.InclusiveFloatRangeValidator(24f, Float.MAX_VALUE);
3488 
3489         /**
3490          * The amount of time in milliseconds before the device goes to sleep or begins
3491          * to dream after a period of inactivity.  This value is also known as the
3492          * user activity timeout period since the screen isn't necessarily turned off
3493          * when it expires.
3494          *
3495          * <p>
3496          * This value is bounded by maximum timeout set by
3497          * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}.
3498          */
3499         public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
3500 
3501         private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR =
3502                 NON_NEGATIVE_INTEGER_VALIDATOR;
3503 
3504         /**
3505          * The screen backlight brightness between 0 and 255.
3506          */
3507         public static final String SCREEN_BRIGHTNESS = "screen_brightness";
3508 
3509         /**
3510          * The screen backlight brightness between 0 and 255.
3511          * @hide
3512          */
3513         public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr";
3514 
3515         private static final Validator SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR =
3516                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 255);
3517 
3518         /**
3519          * Control whether to enable automatic brightness mode.
3520          */
3521         public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
3522 
3523         private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = BOOLEAN_VALIDATOR;
3524 
3525         /**
3526          * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
3527          * or less (<0.0 >-1.0) bright.
3528          * @hide
3529          */
3530         @UnsupportedAppUsage
3531         public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
3532 
3533         private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
3534                 new SettingsValidators.InclusiveFloatRangeValidator(-1, 1);
3535 
3536         /**
3537          * SCREEN_BRIGHTNESS_MODE value for manual mode.
3538          */
3539         public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
3540 
3541         /**
3542          * SCREEN_BRIGHTNESS_MODE value for automatic mode.
3543          */
3544         public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
3545 
3546         /**
3547          * Control whether to enable adaptive sleep mode.
3548          * @hide
3549          */
3550         public static final String ADAPTIVE_SLEEP = "adaptive_sleep";
3551 
3552         private static final Validator ADAPTIVE_SLEEP_VALIDATOR = BOOLEAN_VALIDATOR;
3553 
3554         /**
3555          * Control whether the process CPU usage meter should be shown.
3556          *
3557          * @deprecated This functionality is no longer available as of
3558          * {@link android.os.Build.VERSION_CODES#N_MR1}.
3559          */
3560         @Deprecated
3561         public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
3562 
3563         /**
3564          * If 1, the activity manager will aggressively finish activities and
3565          * processes as soon as they are no longer needed.  If 0, the normal
3566          * extended lifetime is used.
3567          *
3568          * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
3569          */
3570         @Deprecated
3571         public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
3572 
3573         /**
3574          * Determines which streams are affected by ringer and zen mode changes. The
3575          * stream type's bit should be set to 1 if it should be muted when going
3576          * into an inaudible ringer mode.
3577          */
3578         public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
3579 
3580         private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
3581                 NON_NEGATIVE_INTEGER_VALIDATOR;
3582 
3583         /**
3584           * Determines which streams are affected by mute. The
3585           * stream type's bit should be set to 1 if it should be muted when a mute request
3586           * is received.
3587           */
3588         public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
3589 
3590         private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
3591                 NON_NEGATIVE_INTEGER_VALIDATOR;
3592 
3593         /**
3594          * Whether vibrate is on for different events. This is used internally,
3595          * changing this value will not change the vibrate. See AudioManager.
3596          */
3597         public static final String VIBRATE_ON = "vibrate_on";
3598 
3599         private static final Validator VIBRATE_ON_VALIDATOR = BOOLEAN_VALIDATOR;
3600 
3601         /**
3602          * If 1, redirects the system vibrator to all currently attached input devices
3603          * that support vibration.  If there are no such input devices, then the system
3604          * vibrator is used instead.
3605          * If 0, does not register the system vibrator.
3606          *
3607          * This setting is mainly intended to provide a compatibility mechanism for
3608          * applications that only know about the system vibrator and do not use the
3609          * input device vibrator API.
3610          *
3611          * @hide
3612          */
3613         public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
3614 
3615         private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = BOOLEAN_VALIDATOR;
3616 
3617         /**
3618          * The intensity of notification vibrations, if configurable.
3619          *
3620          * Not all devices are capable of changing their vibration intensity; on these devices
3621          * there will likely be no difference between the various vibration intensities except for
3622          * intensity 0 (off) and the rest.
3623          *
3624          * <b>Values:</b><br/>
3625          * 0 - Vibration is disabled<br/>
3626          * 1 - Weak vibrations<br/>
3627          * 2 - Medium vibrations<br/>
3628          * 3 - Strong vibrations
3629          * @hide
3630          */
3631         public static final String NOTIFICATION_VIBRATION_INTENSITY =
3632                 "notification_vibration_intensity";
3633         /**
3634          * The intensity of ringtone vibrations, if configurable.
3635          *
3636          * Not all devices are capable of changing their vibration intensity; on these devices
3637          * there will likely be no difference between the various vibration intensities except for
3638          * intensity 0 (off) and the rest.
3639          *
3640          * <b>Values:</b><br/>
3641          * 0 - Vibration is disabled<br/>
3642          * 1 - Weak vibrations<br/>
3643          * 2 - Medium vibrations<br/>
3644          * 3 - Strong vibrations
3645          * @hide
3646          */
3647         public static final String RING_VIBRATION_INTENSITY =
3648                 "ring_vibration_intensity";
3649 
3650         /**
3651          * The intensity of haptic feedback vibrations, if configurable.
3652          *
3653          * Not all devices are capable of changing their feedback intensity; on these devices
3654          * there will likely be no difference between the various vibration intensities except for
3655          * intensity 0 (off) and the rest.
3656          *
3657          * <b>Values:</b><br/>
3658          * 0 - Vibration is disabled<br/>
3659          * 1 - Weak vibrations<br/>
3660          * 2 - Medium vibrations<br/>
3661          * 3 - Strong vibrations
3662          * @hide
3663          */
3664         public static final String HAPTIC_FEEDBACK_INTENSITY =
3665                 "haptic_feedback_intensity";
3666 
3667         private static final Validator VIBRATION_INTENSITY_VALIDATOR =
3668                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
3669 
3670         /**
3671          * Ringer volume. This is used internally, changing this value will not
3672          * change the volume. See AudioManager.
3673          *
3674          * @removed Not used by anything since API 2.
3675          */
3676         public static final String VOLUME_RING = "volume_ring";
3677 
3678         /**
3679          * System/notifications volume. This is used internally, changing this
3680          * value will not change the volume. See AudioManager.
3681          *
3682          * @removed Not used by anything since API 2.
3683          */
3684         public static final String VOLUME_SYSTEM = "volume_system";
3685 
3686         /**
3687          * Voice call volume. This is used internally, changing this value will
3688          * not change the volume. See AudioManager.
3689          *
3690          * @removed Not used by anything since API 2.
3691          */
3692         public static final String VOLUME_VOICE = "volume_voice";
3693 
3694         /**
3695          * Music/media/gaming volume. This is used internally, changing this
3696          * value will not change the volume. See AudioManager.
3697          *
3698          * @removed Not used by anything since API 2.
3699          */
3700         public static final String VOLUME_MUSIC = "volume_music";
3701 
3702         /**
3703          * Alarm volume. This is used internally, changing this
3704          * value will not change the volume. See AudioManager.
3705          *
3706          * @removed Not used by anything since API 2.
3707          */
3708         public static final String VOLUME_ALARM = "volume_alarm";
3709 
3710         /**
3711          * Notification volume. This is used internally, changing this
3712          * value will not change the volume. See AudioManager.
3713          *
3714          * @removed Not used by anything since API 2.
3715          */
3716         public static final String VOLUME_NOTIFICATION = "volume_notification";
3717 
3718         /**
3719          * Bluetooth Headset volume. This is used internally, changing this value will
3720          * not change the volume. See AudioManager.
3721          *
3722          * @removed Not used by anything since API 2.
3723          */
3724         public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
3725 
3726         /**
3727          * @hide
3728          * Acessibility volume. This is used internally, changing this
3729          * value will not change the volume.
3730          */
3731         public static final String VOLUME_ACCESSIBILITY = "volume_a11y";
3732 
3733         /**
3734          * Master volume (float in the range 0.0f to 1.0f).
3735          *
3736          * @hide
3737          */
3738         public static final String VOLUME_MASTER = "volume_master";
3739 
3740         /**
3741          * Master mono (int 1 = mono, 0 = normal).
3742          *
3743          * @hide
3744          */
3745         @UnsupportedAppUsage
3746         public static final String MASTER_MONO = "master_mono";
3747 
3748         private static final Validator MASTER_MONO_VALIDATOR = BOOLEAN_VALIDATOR;
3749 
3750         /**
3751          * Master balance (float -1.f = 100% left, 0.f = dead center, 1.f = 100% right).
3752          *
3753          * @hide
3754          */
3755         public static final String MASTER_BALANCE = "master_balance";
3756 
3757         private static final Validator MASTER_BALANCE_VALIDATOR =
3758                 new SettingsValidators.InclusiveFloatRangeValidator(-1.f, 1.f);
3759 
3760         /**
3761          * Whether the notifications should use the ring volume (value of 1) or
3762          * a separate notification volume (value of 0). In most cases, users
3763          * will have this enabled so the notification and ringer volumes will be
3764          * the same. However, power users can disable this and use the separate
3765          * notification volume control.
3766          * <p>
3767          * Note: This is a one-off setting that will be removed in the future
3768          * when there is profile support. For this reason, it is kept hidden
3769          * from the public APIs.
3770          *
3771          * @hide
3772          * @deprecated
3773          */
3774         @Deprecated
3775         public static final String NOTIFICATIONS_USE_RING_VOLUME =
3776             "notifications_use_ring_volume";
3777 
3778         private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = BOOLEAN_VALIDATOR;
3779 
3780         /**
3781          * Whether silent mode should allow vibration feedback. This is used
3782          * internally in AudioService and the Sound settings activity to
3783          * coordinate decoupling of vibrate and silent modes. This setting
3784          * will likely be removed in a future release with support for
3785          * audio/vibe feedback profiles.
3786          *
3787          * Not used anymore. On devices with vibrator, the user explicitly selects
3788          * silent or vibrate mode.
3789          * Kept for use by legacy database upgrade code in DatabaseHelper.
3790          * @hide
3791          */
3792         @UnsupportedAppUsage
3793         public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
3794 
3795         private static final Validator VIBRATE_IN_SILENT_VALIDATOR = BOOLEAN_VALIDATOR;
3796 
3797         /**
3798          * The mapping of stream type (integer) to its setting.
3799          *
3800          * @removed  Not used by anything since API 2.
3801          */
3802         public static final String[] VOLUME_SETTINGS = {
3803             VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
3804             VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
3805         };
3806 
3807         /**
3808          * @hide
3809          * The mapping of stream type (integer) to its setting.
3810          * Unlike the VOLUME_SETTINGS array, this one contains as many entries as
3811          * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes
3812          * are never persisted.
3813          */
3814         public static final String[] VOLUME_SETTINGS_INT = {
3815                 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
3816                 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO,
3817                 "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/,
3818                 "" /*STREAM_DTMF, no setting for this stream*/,
3819                 "" /*STREAM_TTS, no setting for this stream*/,
3820                 VOLUME_ACCESSIBILITY
3821             };
3822 
3823         /**
3824          * Appended to various volume related settings to record the previous
3825          * values before they the settings were affected by a silent/vibrate
3826          * ringer mode change.
3827          *
3828          * @removed  Not used by anything since API 2.
3829          */
3830         public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
3831 
3832         /**
3833          * Persistent store for the system-wide default ringtone URI.
3834          * <p>
3835          * If you need to play the default ringtone at any given time, it is recommended
3836          * you give {@link #DEFAULT_RINGTONE_URI} to the media player.  It will resolve
3837          * to the set default ringtone at the time of playing.
3838          *
3839          * @see #DEFAULT_RINGTONE_URI
3840          */
3841         public static final String RINGTONE = "ringtone";
3842 
3843         private static final Validator RINGTONE_VALIDATOR = URI_VALIDATOR;
3844 
3845         /**
3846          * A {@link Uri} that will point to the current default ringtone at any
3847          * given time.
3848          * <p>
3849          * If the current default ringtone is in the DRM provider and the caller
3850          * does not have permission, the exception will be a
3851          * FileNotFoundException.
3852          */
3853         public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
3854 
3855         /** {@hide} */
3856         public static final String RINGTONE_CACHE = "ringtone_cache";
3857         /** {@hide} */
3858         public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE);
3859 
3860         /**
3861          * Persistent store for the system-wide default notification sound.
3862          *
3863          * @see #RINGTONE
3864          * @see #DEFAULT_NOTIFICATION_URI
3865          */
3866         public static final String NOTIFICATION_SOUND = "notification_sound";
3867 
3868         private static final Validator NOTIFICATION_SOUND_VALIDATOR = URI_VALIDATOR;
3869 
3870         /**
3871          * A {@link Uri} that will point to the current default notification
3872          * sound at any given time.
3873          *
3874          * @see #DEFAULT_RINGTONE_URI
3875          */
3876         public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
3877 
3878         /** {@hide} */
3879         public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache";
3880         /** {@hide} */
3881         public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE);
3882 
3883         /**
3884          * Persistent store for the system-wide default alarm alert.
3885          *
3886          * @see #RINGTONE
3887          * @see #DEFAULT_ALARM_ALERT_URI
3888          */
3889         public static final String ALARM_ALERT = "alarm_alert";
3890 
3891         private static final Validator ALARM_ALERT_VALIDATOR = URI_VALIDATOR;
3892 
3893         /**
3894          * A {@link Uri} that will point to the current default alarm alert at
3895          * any given time.
3896          *
3897          * @see #DEFAULT_ALARM_ALERT_URI
3898          */
3899         public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
3900 
3901         /** {@hide} */
3902         public static final String ALARM_ALERT_CACHE = "alarm_alert_cache";
3903         /** {@hide} */
3904         public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE);
3905 
3906         /**
3907          * Persistent store for the system default media button event receiver.
3908          *
3909          * @hide
3910          */
3911         public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
3912 
3913         private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = COMPONENT_NAME_VALIDATOR;
3914 
3915         /**
3916          * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
3917          */
3918         public static final String TEXT_AUTO_REPLACE = "auto_replace";
3919 
3920         private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = BOOLEAN_VALIDATOR;
3921 
3922         /**
3923          * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
3924          */
3925         public static final String TEXT_AUTO_CAPS = "auto_caps";
3926 
3927         private static final Validator TEXT_AUTO_CAPS_VALIDATOR = BOOLEAN_VALIDATOR;
3928 
3929         /**
3930          * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
3931          * feature converts two spaces to a "." and space.
3932          */
3933         public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
3934 
3935         private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = BOOLEAN_VALIDATOR;
3936 
3937         /**
3938          * Setting to showing password characters in text editors. 1 = On, 0 = Off
3939          */
3940         public static final String TEXT_SHOW_PASSWORD = "show_password";
3941 
3942         private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = BOOLEAN_VALIDATOR;
3943 
3944         public static final String SHOW_GTALK_SERVICE_STATUS =
3945                 "SHOW_GTALK_SERVICE_STATUS";
3946 
3947         private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = BOOLEAN_VALIDATOR;
3948 
3949         /**
3950          * Name of activity to use for wallpaper on the home screen.
3951          *
3952          * @deprecated Use {@link WallpaperManager} instead.
3953          */
3954         @Deprecated
3955         public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
3956 
3957         private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
3958             private static final int MAX_LENGTH = 1000;
3959 
3960             @Override
3961             public boolean validate(String value) {
3962                 if (value != null && value.length() > MAX_LENGTH) {
3963                     return false;
3964                 }
3965                 return ComponentName.unflattenFromString(value) != null;
3966             }
3967         };
3968 
3969         /**
3970          * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
3971          * instead
3972          */
3973         @Deprecated
3974         public static final String AUTO_TIME = Global.AUTO_TIME;
3975 
3976         private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR;
3977 
3978         /**
3979          * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
3980          * instead
3981          */
3982         @Deprecated
3983         public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
3984 
3985         private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR;
3986 
3987         /**
3988          * Display times as 12 or 24 hours
3989          *   12
3990          *   24
3991          */
3992         public static final String TIME_12_24 = "time_12_24";
3993 
3994         /** @hide */
3995         public static final Validator TIME_12_24_VALIDATOR =
3996                 new SettingsValidators.DiscreteValueValidator(new String[] {"12", "24", null});
3997 
3998         /**
3999          * Date format string
4000          *   mm/dd/yyyy
4001          *   dd/mm/yyyy
4002          *   yyyy/mm/dd
4003          */
4004         public static final String DATE_FORMAT = "date_format";
4005 
4006         /** @hide */
4007         public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
4008             @Override
4009             public boolean validate(@Nullable String value) {
4010                 try {
4011                     new SimpleDateFormat(value);
4012                     return true;
4013                 } catch (IllegalArgumentException | NullPointerException e) {
4014                     return false;
4015                 }
4016             }
4017         };
4018 
4019         /**
4020          * Whether the setup wizard has been run before (on first boot), or if
4021          * it still needs to be run.
4022          *
4023          * nonzero = it has been run in the past
4024          * 0 = it has not been run in the past
4025          */
4026         public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
4027 
4028         /** @hide */
4029         public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = BOOLEAN_VALIDATOR;
4030 
4031         /**
4032          * Scaling factor for normal window animations. Setting to 0 will disable window
4033          * animations.
4034          *
4035          * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
4036          */
4037         @Deprecated
4038         public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
4039 
4040         /**
4041          * Scaling factor for activity transition animations. Setting to 0 will disable window
4042          * animations.
4043          *
4044          * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
4045          */
4046         @Deprecated
4047         public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
4048 
4049         /**
4050          * Scaling factor for Animator-based animations. This affects both the start delay and
4051          * duration of all such animations. Setting to 0 will cause animations to end immediately.
4052          * The default value is 1.
4053          *
4054          * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
4055          */
4056         @Deprecated
4057         public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
4058 
4059         /**
4060          * Control whether the accelerometer will be used to change screen
4061          * orientation.  If 0, it will not be used unless explicitly requested
4062          * by the application; if 1, it will be used by default unless explicitly
4063          * disabled by the application.
4064          */
4065         public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
4066 
4067         /** @hide */
4068         public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = BOOLEAN_VALIDATOR;
4069 
4070         /**
4071          * Default screen rotation when no other policy applies.
4072          * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
4073          * preference, this rotation value will be used. Must be one of the
4074          * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
4075          *
4076          * @see android.view.Display#getRotation
4077          */
4078         public static final String USER_ROTATION = "user_rotation";
4079 
4080         /** @hide */
4081         public static final Validator USER_ROTATION_VALIDATOR =
4082                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
4083 
4084         /**
4085          * Control whether the rotation lock toggle in the System UI should be hidden.
4086          * Typically this is done for accessibility purposes to make it harder for
4087          * the user to accidentally toggle the rotation lock while the display rotation
4088          * has been locked for accessibility.
4089          *
4090          * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
4091          * unavailable for other reasons).  If 1, then the rotation lock toggle is hidden.
4092          *
4093          * @hide
4094          */
4095         @UnsupportedAppUsage
4096         public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
4097                 "hide_rotation_lock_toggle_for_accessibility";
4098 
4099         /** @hide */
4100         public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
4101                 BOOLEAN_VALIDATOR;
4102 
4103         /**
4104          * Whether the phone vibrates when it is ringing due to an incoming call. This will
4105          * be used by Phone and Setting apps; it shouldn't affect other apps.
4106          * The value is boolean (1 or 0).
4107          *
4108          * Note: this is not same as "vibrate on ring", which had been available until ICS.
4109          * It was about AudioManager's setting and thus affected all the applications which
4110          * relied on the setting, while this is purely about the vibration setting for incoming
4111          * calls.
4112          */
4113         public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
4114 
4115         /** @hide */
4116         public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = BOOLEAN_VALIDATOR;
4117 
4118         /**
4119          * When {@code 1}, Telecom enhanced call blocking functionality is enabled.  When
4120          * {@code 0}, enhanced call blocking functionality is disabled.
4121          * @hide
4122          */
4123         public static final String DEBUG_ENABLE_ENHANCED_CALL_BLOCKING =
4124                 "debug.enable_enhanced_calling";
4125 
4126         /**
4127          * Whether the audible DTMF tones are played by the dialer when dialing. The value is
4128          * boolean (1 or 0).
4129          */
4130         public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
4131 
4132         /** @hide */
4133         public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR;
4134 
4135         /**
4136          * CDMA only settings
4137          * DTMF tone type played by the dialer when dialing.
4138          *                 0 = Normal
4139          *                 1 = Long
4140          */
4141         public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
4142 
4143         /** @hide */
4144         public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR;
4145 
4146         /**
4147          * Whether the hearing aid is enabled. The value is
4148          * boolean (1 or 0).
4149          * @hide
4150          */
4151         @UnsupportedAppUsage
4152         public static final String HEARING_AID = "hearing_aid";
4153 
4154         /** @hide */
4155         public static final Validator HEARING_AID_VALIDATOR = BOOLEAN_VALIDATOR;
4156 
4157         /**
4158          * CDMA only settings
4159          * TTY Mode
4160          * 0 = OFF
4161          * 1 = FULL
4162          * 2 = VCO
4163          * 3 = HCO
4164          * @hide
4165          */
4166         @UnsupportedAppUsage
4167         public static final String TTY_MODE = "tty_mode";
4168 
4169         /** @hide */
4170         public static final Validator TTY_MODE_VALIDATOR =
4171                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
4172 
4173         /**
4174          * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
4175          * boolean (1 or 0).
4176          */
4177         public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
4178 
4179         /** @hide */
4180         public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4181 
4182         /**
4183          * Whether haptic feedback (Vibrate on tap) is enabled. The value is
4184          * boolean (1 or 0).
4185          */
4186         public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
4187 
4188         /** @hide */
4189         public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4190 
4191         /**
4192          * @deprecated Each application that shows web suggestions should have its own
4193          * setting for this.
4194          */
4195         @Deprecated
4196         public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
4197 
4198         /** @hide */
4199         public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = BOOLEAN_VALIDATOR;
4200 
4201         /**
4202          * Whether the notification LED should repeatedly flash when a notification is
4203          * pending. The value is boolean (1 or 0).
4204          * @hide
4205          */
4206         @UnsupportedAppUsage
4207         public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
4208 
4209         /** @hide */
4210         public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = BOOLEAN_VALIDATOR;
4211 
4212         /**
4213          * Show pointer location on screen?
4214          * 0 = no
4215          * 1 = yes
4216          * @hide
4217          */
4218         @UnsupportedAppUsage
4219         public static final String POINTER_LOCATION = "pointer_location";
4220 
4221         /** @hide */
4222         public static final Validator POINTER_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR;
4223 
4224         /**
4225          * Show touch positions on screen?
4226          * 0 = no
4227          * 1 = yes
4228          * @hide
4229          */
4230         @UnsupportedAppUsage
4231         public static final String SHOW_TOUCHES = "show_touches";
4232 
4233         /** @hide */
4234         public static final Validator SHOW_TOUCHES_VALIDATOR = BOOLEAN_VALIDATOR;
4235 
4236         /**
4237          * Log raw orientation data from
4238          * {@link com.android.server.policy.WindowOrientationListener} for use with the
4239          * orientationplot.py tool.
4240          * 0 = no
4241          * 1 = yes
4242          * @hide
4243          */
4244         public static final String WINDOW_ORIENTATION_LISTENER_LOG =
4245                 "window_orientation_listener_log";
4246 
4247         /** @hide */
4248         public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = BOOLEAN_VALIDATOR;
4249 
4250         /**
4251          * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
4252          * instead
4253          * @hide
4254          */
4255         @Deprecated
4256         public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
4257 
4258         private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4259 
4260         /**
4261          * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
4262          * instead
4263          * @hide
4264          */
4265         @Deprecated
4266         @UnsupportedAppUsage
4267         public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
4268 
4269         private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4270 
4271         /**
4272          * Whether to play sounds when the keyguard is shown and dismissed.
4273          * @hide
4274          */
4275         @UnsupportedAppUsage
4276         public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
4277 
4278         /** @hide */
4279         public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4280 
4281         /**
4282          * Whether the lockscreen should be completely disabled.
4283          * @hide
4284          */
4285         public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
4286 
4287         /** @hide */
4288         public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4289 
4290         /**
4291          * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
4292          * instead
4293          * @hide
4294          */
4295         @Deprecated
4296         public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
4297 
4298         /**
4299          * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
4300          * instead
4301          * @hide
4302          */
4303         @Deprecated
4304         @UnsupportedAppUsage
4305         public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
4306 
4307         /**
4308          * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
4309          * instead
4310          * @hide
4311          */
4312         @Deprecated
4313         @UnsupportedAppUsage
4314         public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
4315 
4316         /**
4317          * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
4318          * instead
4319          * @hide
4320          */
4321         @Deprecated
4322         @UnsupportedAppUsage
4323         public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
4324 
4325         /**
4326          * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
4327          * instead
4328          * @hide
4329          */
4330         @Deprecated
4331         @UnsupportedAppUsage
4332         public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
4333 
4334         /**
4335          * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
4336          * instead
4337          * @hide
4338          */
4339         @Deprecated
4340         @UnsupportedAppUsage
4341         public static final String LOCK_SOUND = Global.LOCK_SOUND;
4342 
4343         /**
4344          * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
4345          * instead
4346          * @hide
4347          */
4348         @Deprecated
4349         @UnsupportedAppUsage
4350         public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
4351 
4352         /**
4353          * Receive incoming SIP calls?
4354          * 0 = no
4355          * 1 = yes
4356          * @hide
4357          */
4358         public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
4359 
4360         /** @hide */
4361         public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = BOOLEAN_VALIDATOR;
4362 
4363         /**
4364          * Call Preference String.
4365          * "SIP_ALWAYS" : Always use SIP with network access
4366          * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
4367          * @hide
4368          */
4369         public static final String SIP_CALL_OPTIONS = "sip_call_options";
4370 
4371         /** @hide */
4372         public static final Validator SIP_CALL_OPTIONS_VALIDATOR =
4373                 new SettingsValidators.DiscreteValueValidator(
4374                         new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
4375 
4376         /**
4377          * One of the sip call options: Always use SIP with network access.
4378          * @hide
4379          */
4380         public static final String SIP_ALWAYS = "SIP_ALWAYS";
4381 
4382         /** @hide */
4383         public static final Validator SIP_ALWAYS_VALIDATOR = BOOLEAN_VALIDATOR;
4384 
4385         /**
4386          * One of the sip call options: Only if destination is a SIP address.
4387          * @hide
4388          */
4389         public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
4390 
4391         /** @hide */
4392         public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = BOOLEAN_VALIDATOR;
4393 
4394         /**
4395          * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead.  Formerly used to indicate that
4396          * the user should be prompted each time a call is made whether it should be placed using
4397          * SIP.  The {@link com.android.providers.settings.DatabaseHelper} replaces this with
4398          * SIP_ADDRESS_ONLY.
4399          * @hide
4400          */
4401         @Deprecated
4402         public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
4403 
4404         /** @hide */
4405         public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = BOOLEAN_VALIDATOR;
4406 
4407         /**
4408          * Pointer speed setting.
4409          * This is an integer value in a range between -7 and +7, so there are 15 possible values.
4410          *   -7 = slowest
4411          *    0 = default speed
4412          *   +7 = fastest
4413          * @hide
4414          */
4415         @UnsupportedAppUsage
4416         public static final String POINTER_SPEED = "pointer_speed";
4417 
4418         /** @hide */
4419         public static final Validator POINTER_SPEED_VALIDATOR =
4420                 new SettingsValidators.InclusiveFloatRangeValidator(-7, 7);
4421 
4422         /**
4423          * Whether lock-to-app will be triggered by long-press on recents.
4424          * @hide
4425          */
4426         public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
4427 
4428         /** @hide */
4429         public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4430 
4431         /**
4432          * I am the lolrus.
4433          * <p>
4434          * Nonzero values indicate that the user has a bukkit.
4435          * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
4436          * @hide
4437          */
4438         public static final String EGG_MODE = "egg_mode";
4439 
4440         /** @hide */
4441         public static final Validator EGG_MODE_VALIDATOR = new Validator() {
4442             @Override
4443             public boolean validate(@Nullable String value) {
4444                 try {
4445                     return Long.parseLong(value) >= 0;
4446                 } catch (NumberFormatException e) {
4447                     return false;
4448                 }
4449             }
4450         };
4451 
4452         /**
4453          * Setting to determine whether or not to show the battery percentage in the status bar.
4454          *    0 - Don't show percentage
4455          *    1 - Show percentage
4456          * @hide
4457          */
4458         public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent";
4459 
4460         /** @hide */
4461         private static final Validator SHOW_BATTERY_PERCENT_VALIDATOR = BOOLEAN_VALIDATOR;
4462 
4463         /**
4464          * IMPORTANT: If you add a new public settings you also have to add it to
4465          * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
4466          * it to PRIVATE_SETTINGS below. Also add a validator that can validate
4467          * the setting value. See an example above.
4468          */
4469 
4470         /**
4471          * Settings to backup. This is here so that it's in the same place as the settings
4472          * keys and easy to update.
4473          *
4474          * NOTE: Settings are backed up and restored in the order they appear
4475          *       in this array. If you have one setting depending on another,
4476          *       make sure that they are ordered appropriately.
4477          *
4478          * @hide
4479          */
4480         @UnsupportedAppUsage
4481         public static final String[] SETTINGS_TO_BACKUP = {
4482             STAY_ON_WHILE_PLUGGED_IN,   // moved to global
4483             WIFI_USE_STATIC_IP,
4484             WIFI_STATIC_IP,
4485             WIFI_STATIC_GATEWAY,
4486             WIFI_STATIC_NETMASK,
4487             WIFI_STATIC_DNS1,
4488             WIFI_STATIC_DNS2,
4489             BLUETOOTH_DISCOVERABILITY,
4490             BLUETOOTH_DISCOVERABILITY_TIMEOUT,
4491             FONT_SCALE,
4492             DIM_SCREEN,
4493             SCREEN_OFF_TIMEOUT,
4494             SCREEN_BRIGHTNESS_MODE,
4495             SCREEN_AUTO_BRIGHTNESS_ADJ,
4496             SCREEN_BRIGHTNESS_FOR_VR,
4497             ADAPTIVE_SLEEP,
4498             VIBRATE_INPUT_DEVICES,
4499             MODE_RINGER_STREAMS_AFFECTED,
4500             TEXT_AUTO_REPLACE,
4501             TEXT_AUTO_CAPS,
4502             TEXT_AUTO_PUNCTUATE,
4503             TEXT_SHOW_PASSWORD,
4504             AUTO_TIME,                  // moved to global
4505             AUTO_TIME_ZONE,             // moved to global
4506             TIME_12_24,
4507             DATE_FORMAT,
4508             DTMF_TONE_WHEN_DIALING,
4509             DTMF_TONE_TYPE_WHEN_DIALING,
4510             HEARING_AID,
4511             TTY_MODE,
4512             MASTER_MONO,
4513             MASTER_BALANCE,
4514             SOUND_EFFECTS_ENABLED,
4515             HAPTIC_FEEDBACK_ENABLED,
4516             POWER_SOUNDS_ENABLED,       // moved to global
4517             DOCK_SOUNDS_ENABLED,        // moved to global
4518             LOCKSCREEN_SOUNDS_ENABLED,
4519             SHOW_WEB_SUGGESTIONS,
4520             SIP_CALL_OPTIONS,
4521             SIP_RECEIVE_CALLS,
4522             POINTER_SPEED,
4523             VIBRATE_WHEN_RINGING,
4524             RINGTONE,
4525             LOCK_TO_APP_ENABLED,
4526             NOTIFICATION_SOUND,
4527             ACCELEROMETER_ROTATION,
4528             SHOW_BATTERY_PERCENT,
4529             NOTIFICATION_VIBRATION_INTENSITY,
4530             RING_VIBRATION_INTENSITY,
4531             HAPTIC_FEEDBACK_INTENSITY,
4532             DISPLAY_COLOR_MODE,
4533             ALARM_ALERT,
4534             NOTIFICATION_LIGHT_PULSE,
4535         };
4536 
4537         /**
4538          * Keys we no longer back up under the current schema, but want to continue to
4539          * process when restoring historical backup datasets.
4540          *
4541          * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
4542          * otherwise they won't be restored.
4543          *
4544          * @hide
4545          */
4546         public static final String[] LEGACY_RESTORE_SETTINGS = {
4547         };
4548 
4549         /**
4550          * These are all public system settings
4551          *
4552          * @hide
4553          */
4554         @UnsupportedAppUsage
4555         public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
4556         static {
4557             PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
4558             PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
4559             PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
4560             PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
4561             PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
4562             PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
4563             PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
4564             PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
4565             PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
4566             PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
4567             PUBLIC_SETTINGS.add(FONT_SCALE);
4568             PUBLIC_SETTINGS.add(SYSTEM_LOCALES);
4569             PUBLIC_SETTINGS.add(DIM_SCREEN);
4570             PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
4571             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
4572             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR);
4573             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
4574             PUBLIC_SETTINGS.add(ADAPTIVE_SLEEP);
4575             PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
4576             PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
4577             PUBLIC_SETTINGS.add(VIBRATE_ON);
4578             PUBLIC_SETTINGS.add(VOLUME_RING);
4579             PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
4580             PUBLIC_SETTINGS.add(VOLUME_VOICE);
4581             PUBLIC_SETTINGS.add(VOLUME_MUSIC);
4582             PUBLIC_SETTINGS.add(VOLUME_ALARM);
4583             PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
4584             PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
4585             PUBLIC_SETTINGS.add(RINGTONE);
4586             PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
4587             PUBLIC_SETTINGS.add(ALARM_ALERT);
4588             PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
4589             PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
4590             PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
4591             PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
4592             PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
4593             PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
4594             PUBLIC_SETTINGS.add(TIME_12_24);
4595             PUBLIC_SETTINGS.add(DATE_FORMAT);
4596             PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
4597             PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
4598             PUBLIC_SETTINGS.add(USER_ROTATION);
4599             PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
4600             PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
4601             PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
4602             PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
4603             PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING);
4604         }
4605 
4606         /**
4607          * These are all hidden system settings.
4608          *
4609          * @hide
4610          */
4611         @UnsupportedAppUsage
4612         public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
4613         static {
4614             PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
4615             PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
4616             PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
4617             PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
4618             PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
4619             PRIVATE_SETTINGS.add(VOLUME_MASTER);
4620             PRIVATE_SETTINGS.add(MASTER_MONO);
4621             PRIVATE_SETTINGS.add(MASTER_BALANCE);
4622             PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
4623             PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
4624             PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
4625             PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
4626             PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
4627             PRIVATE_SETTINGS.add(HEARING_AID);
4628             PRIVATE_SETTINGS.add(TTY_MODE);
4629             PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
4630             PRIVATE_SETTINGS.add(POINTER_LOCATION);
4631             PRIVATE_SETTINGS.add(SHOW_TOUCHES);
4632             PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
4633             PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
4634             PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
4635             PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
4636             PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
4637             PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
4638             PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
4639             PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
4640             PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
4641             PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
4642             PRIVATE_SETTINGS.add(LOCK_SOUND);
4643             PRIVATE_SETTINGS.add(UNLOCK_SOUND);
4644             PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
4645             PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
4646             PRIVATE_SETTINGS.add(SIP_ALWAYS);
4647             PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
4648             PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
4649             PRIVATE_SETTINGS.add(POINTER_SPEED);
4650             PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
4651             PRIVATE_SETTINGS.add(EGG_MODE);
4652             PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT);
4653             PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE);
4654         }
4655 
4656         /**
4657          * These are all public system settings
4658          *
4659          * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator,
4660          * otherwise they won't be restored.
4661          *
4662          * @hide
4663          */
4664         @UnsupportedAppUsage
4665         public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
4666         static {
VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR)4667             VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR);
VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR)4668             VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR)4669             VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR)4670             VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT, BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR)4671             VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
4672                     BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR)4673             VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR)4674             VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR)4675             VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
VALIDATORS.put(DISPLAY_COLOR_MODE, DISPLAY_COLOR_MODE_VALIDATOR)4676             VALIDATORS.put(DISPLAY_COLOR_MODE, DISPLAY_COLOR_MODE_VALIDATOR);
VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR)4677             VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR)4678             VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR);
VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR)4679             VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
VALIDATORS.put(ADAPTIVE_SLEEP, ADAPTIVE_SLEEP_VALIDATOR)4680             VALIDATORS.put(ADAPTIVE_SLEEP, ADAPTIVE_SLEEP_VALIDATOR);
VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR)4681             VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR)4682             VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR)4683             VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
VALIDATORS.put(NOTIFICATION_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR)4684             VALIDATORS.put(NOTIFICATION_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR);
VALIDATORS.put(RING_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR)4685             VALIDATORS.put(RING_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR);
VALIDATORS.put(HAPTIC_FEEDBACK_INTENSITY, VIBRATION_INTENSITY_VALIDATOR)4686             VALIDATORS.put(HAPTIC_FEEDBACK_INTENSITY, VIBRATION_INTENSITY_VALIDATOR);
VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR)4687             VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR)4688             VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR)4689             VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR)4690             VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR)4691             VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR)4692             VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR)4693             VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR)4694             VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR);
VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR)4695             VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR);
VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR)4696             VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR)4697             VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR)4698             VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR)4699             VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR)4700             VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR)4701             VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR)4702             VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR)4703             VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR)4704             VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR)4705             VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR)4706             VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR)4707             VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR)4708             VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR)4709             VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR)4710             VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR)4711             VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR)4712             VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR)4713             VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR)4714             VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR);
VALIDATORS.put(MASTER_BALANCE, MASTER_BALANCE_VALIDATOR)4715             VALIDATORS.put(MASTER_BALANCE, MASTER_BALANCE_VALIDATOR);
VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR)4716             VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR)4717             VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR)4718             VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR)4719             VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
4720                     HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR)4721             VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR)4722             VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR)4723             VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR)4724             VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR)4725             VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR)4726             VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR)4727             VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG, WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR)4728             VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
4729                     WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR)4730             VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR)4731             VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR)4732             VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR)4733             VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR)4734             VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR)4735             VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR)4736             VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR)4737             VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR)4738             VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR)4739             VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR)4740             VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR)4741             VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR)4742             VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR)4743             VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR)4744             VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
VALIDATORS.put(SHOW_BATTERY_PERCENT, SHOW_BATTERY_PERCENT_VALIDATOR)4745             VALIDATORS.put(SHOW_BATTERY_PERCENT, SHOW_BATTERY_PERCENT_VALIDATOR);
VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, BOOLEAN_VALIDATOR)4746             VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, BOOLEAN_VALIDATOR);
4747         }
4748 
4749         /**
4750          * These entries are considered common between the personal and the managed profile,
4751          * since the managed profile doesn't get to change them.
4752          */
4753         @UnsupportedAppUsage
4754         private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
4755         static {
4756             CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
4757             CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
4758             CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
4759             CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
4760             CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
4761         }
4762 
4763         /** @hide */
getCloneToManagedProfileSettings(Set<String> outKeySet)4764         public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
4765             outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
4766         }
4767 
4768         /**
4769          * These entries should be cloned from this profile's parent only if the dependency's
4770          * value is true ("1")
4771          *
4772          * Note: the dependencies must be Secure settings
4773          *
4774          * @hide
4775          */
4776         public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>();
4777         static {
CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS)4778             CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS);
CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS)4779             CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS);
CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS)4780             CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS);
4781         }
4782 
4783         /** @hide */
getCloneFromParentOnValueSettings(Map<String, String> outMap)4784         public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) {
4785             outMap.putAll(CLONE_FROM_PARENT_ON_VALUE);
4786         }
4787 
4788         /**
4789          * System settings which can be accessed by instant apps.
4790          * @hide
4791          */
4792         public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
4793         static {
4794             INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE);
4795             INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS);
4796             INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
4797             INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD);
4798             INSTANT_APP_SETTINGS.add(DATE_FORMAT);
4799             INSTANT_APP_SETTINGS.add(FONT_SCALE);
4800             INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
4801             INSTANT_APP_SETTINGS.add(TIME_12_24);
4802             INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED);
4803             INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION);
4804         }
4805 
4806         /**
4807          * When to use Wi-Fi calling
4808          *
4809          * @see android.telephony.TelephonyManager.WifiCallingChoices
4810          * @hide
4811          */
4812         public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
4813 
4814         // Settings moved to Settings.Secure
4815 
4816         /**
4817          * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
4818          * instead
4819          */
4820         @Deprecated
4821         public static final String ADB_ENABLED = Global.ADB_ENABLED;
4822 
4823         /**
4824          * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
4825          */
4826         @Deprecated
4827         public static final String ANDROID_ID = Secure.ANDROID_ID;
4828 
4829         /**
4830          * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
4831          */
4832         @Deprecated
4833         public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
4834 
4835         private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR;
4836 
4837         /**
4838          * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
4839          */
4840         @Deprecated
4841         public static final String DATA_ROAMING = Global.DATA_ROAMING;
4842 
4843         /**
4844          * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
4845          */
4846         @Deprecated
4847         public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
4848 
4849         /**
4850          * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
4851          */
4852         @Deprecated
4853         public static final String HTTP_PROXY = Global.HTTP_PROXY;
4854 
4855         /**
4856          * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
4857          */
4858         @Deprecated
4859         public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
4860 
4861         /**
4862          * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
4863          * instead
4864          */
4865         @Deprecated
4866         public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
4867 
4868         /**
4869          * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
4870          */
4871         @Deprecated
4872         public static final String LOGGING_ID = Secure.LOGGING_ID;
4873 
4874         /**
4875          * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
4876          */
4877         @Deprecated
4878         public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
4879 
4880         /**
4881          * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
4882          * instead
4883          */
4884         @Deprecated
4885         public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
4886 
4887         /**
4888          * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
4889          * instead
4890          */
4891         @Deprecated
4892         public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
4893 
4894         /**
4895          * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
4896          * instead
4897          */
4898         @Deprecated
4899         public static final String PARENTAL_CONTROL_REDIRECT_URL =
4900             Secure.PARENTAL_CONTROL_REDIRECT_URL;
4901 
4902         /**
4903          * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
4904          */
4905         @Deprecated
4906         public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
4907 
4908         /**
4909          * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
4910          */
4911         @Deprecated
4912         public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
4913 
4914         private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4915 
4916         /**
4917          * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
4918          */
4919         @Deprecated
4920         public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
4921 
4922        /**
4923          * @deprecated Use
4924          * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
4925          */
4926         @Deprecated
4927         public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
4928 
4929         /**
4930          * @deprecated Use
4931          * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
4932          */
4933         @Deprecated
4934         public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
4935                 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
4936 
4937         /**
4938          * @deprecated Use
4939          * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
4940          */
4941         @Deprecated
4942         public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
4943                 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
4944 
4945         private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
4946                 BOOLEAN_VALIDATOR;
4947 
4948         /**
4949          * @deprecated Use
4950          * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
4951          */
4952         @Deprecated
4953         public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
4954                 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
4955 
4956         private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR =
4957                 NON_NEGATIVE_INTEGER_VALIDATOR;
4958 
4959         /**
4960          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
4961          * instead
4962          */
4963         @Deprecated
4964         public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
4965 
4966         private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR =
4967                 NON_NEGATIVE_INTEGER_VALIDATOR;
4968 
4969         /**
4970          * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
4971          */
4972         @Deprecated
4973         public static final String WIFI_ON = Global.WIFI_ON;
4974 
4975         /**
4976          * @deprecated Use
4977          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
4978          * instead
4979          */
4980         @Deprecated
4981         public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4982                 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
4983 
4984         /**
4985          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
4986          */
4987         @Deprecated
4988         public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
4989 
4990         /**
4991          * @deprecated Use
4992          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
4993          */
4994         @Deprecated
4995         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4996                 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
4997 
4998         /**
4999          * @deprecated Use
5000          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
5001          */
5002         @Deprecated
5003         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
5004                 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
5005 
5006         /**
5007          * @deprecated Use
5008          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
5009          * instead
5010          */
5011         @Deprecated
5012         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
5013                 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
5014 
5015         /**
5016          * @deprecated Use
5017          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
5018          */
5019         @Deprecated
5020         public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
5021             Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
5022 
5023         /**
5024          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
5025          * instead
5026          */
5027         @Deprecated
5028         public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
5029 
5030         /**
5031          * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
5032          */
5033         @Deprecated
5034         public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
5035 
5036         /**
5037          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
5038          */
5039         @Deprecated
5040         public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
5041 
5042         /**
5043          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
5044          * instead
5045          */
5046         @Deprecated
5047         public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
5048 
5049         /**
5050          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
5051          * instead
5052          */
5053         @Deprecated
5054         public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
5055             Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
5056 
5057         /**
5058          * Checks if the specified app can modify system settings. As of API
5059          * level 23, an app cannot modify system settings unless it declares the
5060          * {@link android.Manifest.permission#WRITE_SETTINGS}
5061          * permission in its manifest, <em>and</em> the user specifically grants
5062          * the app this capability. To prompt the user to grant this approval,
5063          * the app must send an intent with the action {@link
5064          * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes
5065          * the system to display a permission management screen.
5066          *
5067          * @param context App context.
5068          * @return true if the calling app can write to system settings, false otherwise
5069          */
canWrite(Context context)5070         public static boolean canWrite(Context context) {
5071             return isCallingPackageAllowedToWriteSettings(context, Process.myUid(),
5072                     context.getOpPackageName(), false);
5073         }
5074     }
5075 
5076     /**
5077      * Secure system settings, containing system preferences that applications
5078      * can read but are not allowed to write.  These are for preferences that
5079      * the user must explicitly modify through the system UI or specialized
5080      * APIs for those values, not modified directly by applications.
5081      */
5082     public static final class Secure extends NameValueTable {
5083         // NOTE: If you add new settings here, be sure to add them to
5084         // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked.
5085 
5086         /**
5087          * The content:// style URL for this table
5088          */
5089         public static final Uri CONTENT_URI =
5090             Uri.parse("content://" + AUTHORITY + "/secure");
5091 
5092         @UnsupportedAppUsage
5093         private static final ContentProviderHolder sProviderHolder =
5094                 new ContentProviderHolder(CONTENT_URI);
5095 
5096         // Populated lazily, guarded by class object:
5097         @UnsupportedAppUsage
5098         private static final NameValueCache sNameValueCache = new NameValueCache(
5099                 CONTENT_URI,
5100                 CALL_METHOD_GET_SECURE,
5101                 CALL_METHOD_PUT_SECURE,
5102                 sProviderHolder);
5103 
5104         private static ILockSettings sLockSettings = null;
5105 
5106         private static boolean sIsSystemProcess;
5107         @UnsupportedAppUsage
5108         private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
5109         @UnsupportedAppUsage
5110         private static final HashSet<String> MOVED_TO_GLOBAL;
5111         static {
5112             MOVED_TO_LOCK_SETTINGS = new HashSet<>(3);
5113             MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
5114             MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
5115             MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
5116 
5117             MOVED_TO_GLOBAL = new HashSet<>();
5118             MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
5119             MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
5120             MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
5121             MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
5122             MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
5123             MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
5124             MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
5125             MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
5126             MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
5127             MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
5128             MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
5129             MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
5130             MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
5131             MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
5132             MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
5133             MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
5134             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
5135             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
5136             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
5137             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
5138             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
5139             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
5140             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
5141             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
5142             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
5143             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
5144             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
5145             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
5146             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
5147             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
5148             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
5149             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
5150             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
5151             MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
5152             MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
5153             MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
5154             MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
5155             MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
5156             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
5157             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
5158             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
5159             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
5160             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
5161             MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
5162             MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
5163             MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
5164             MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
5165             MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
5166             MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
5167             MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
5168             MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
5169             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
5170             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
5171             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
5172             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
5173             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
5174             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
5175             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
5176             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
5177             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
5178             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
5179             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
5180             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
5181             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
5182             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
5183             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED);
5184             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
5185             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
5186             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
5187             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
5188             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_PENDING_FACTORY_RESET);
5189             MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
5190             MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
5191             MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
5192             MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
5193             MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
5194             MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
5195             MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
5196             MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
5197             MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
5198             MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
5199             MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
5200             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
5201             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
5202             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
5203             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
5204             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
5205             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
5206             MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
5207             MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
5208             MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
5209             MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
5210             MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
5211             MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
5212             MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
5213             MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
5214             MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
5215             MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
5216             MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
5217             MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
5218             MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
5219             MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
5220             MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
5221             MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
5222             MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
5223             MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
5224             MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
5225             MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
5226             MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
5227             MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
5228             MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
5229             MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
5230         }
5231 
5232         /** @hide */
getMovedToGlobalSettings(Set<String> outKeySet)5233         public static void getMovedToGlobalSettings(Set<String> outKeySet) {
5234             outKeySet.addAll(MOVED_TO_GLOBAL);
5235         }
5236 
5237         /** @hide */
clearProviderForTest()5238         public static void clearProviderForTest() {
5239             sProviderHolder.clearProviderForTest();
5240             sNameValueCache.clearGenerationTrackerForTest();
5241         }
5242 
5243         /**
5244          * Look up a name in the database.
5245          * @param resolver to access the database with
5246          * @param name to look up in the table
5247          * @return the corresponding value, or null if not present
5248          */
getString(ContentResolver resolver, String name)5249         public static String getString(ContentResolver resolver, String name) {
5250             return getStringForUser(resolver, name, resolver.getUserId());
5251         }
5252 
5253         /** @hide */
5254         @UnsupportedAppUsage
getStringForUser(ContentResolver resolver, String name, int userHandle)5255         public static String getStringForUser(ContentResolver resolver, String name,
5256                 int userHandle) {
5257             if (MOVED_TO_GLOBAL.contains(name)) {
5258                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
5259                         + " to android.provider.Settings.Global.");
5260                 return Global.getStringForUser(resolver, name, userHandle);
5261             }
5262 
5263             if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
5264                 synchronized (Secure.class) {
5265                     if (sLockSettings == null) {
5266                         sLockSettings = ILockSettings.Stub.asInterface(
5267                                 (IBinder) ServiceManager.getService("lock_settings"));
5268                         sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
5269                     }
5270                 }
5271                 if (sLockSettings != null && !sIsSystemProcess) {
5272                     // No context; use the ActivityThread's context as an approximation for
5273                     // determining the target API level.
5274                     Application application = ActivityThread.currentApplication();
5275 
5276                     boolean isPreMnc = application != null
5277                             && application.getApplicationInfo() != null
5278                             && application.getApplicationInfo().targetSdkVersion
5279                             <= VERSION_CODES.LOLLIPOP_MR1;
5280                     if (isPreMnc) {
5281                         try {
5282                             return sLockSettings.getString(name, "0", userHandle);
5283                         } catch (RemoteException re) {
5284                             // Fall through
5285                         }
5286                     } else {
5287                         throw new SecurityException("Settings.Secure." + name
5288                                 + " is deprecated and no longer accessible."
5289                                 + " See API documentation for potential replacements.");
5290                     }
5291                 }
5292             }
5293 
5294             return sNameValueCache.getStringForUser(resolver, name, userHandle);
5295         }
5296 
5297         /**
5298          * Store a name/value pair into the database.
5299          * @param resolver to access the database with
5300          * @param name to store
5301          * @param value to associate with the name
5302          * @return true if the value was set, false on database errors
5303          */
putString(ContentResolver resolver, String name, String value)5304         public static boolean putString(ContentResolver resolver, String name, String value) {
5305             return putStringForUser(resolver, name, value, resolver.getUserId());
5306         }
5307 
5308         /** @hide */
5309         @UnsupportedAppUsage
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)5310         public static boolean putStringForUser(ContentResolver resolver, String name, String value,
5311                 int userHandle) {
5312             return putStringForUser(resolver, name, value, null, false, userHandle);
5313         }
5314 
5315         /** @hide */
5316         @UnsupportedAppUsage
putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle)5317         public static boolean putStringForUser(@NonNull ContentResolver resolver,
5318                 @NonNull String name, @Nullable String value, @Nullable String tag,
5319                 boolean makeDefault, @UserIdInt int userHandle) {
5320             if (MOVED_TO_GLOBAL.contains(name)) {
5321                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
5322                         + " to android.provider.Settings.Global");
5323                 return Global.putStringForUser(resolver, name, value,
5324                         tag, makeDefault, userHandle);
5325             }
5326             return sNameValueCache.putStringForUser(resolver, name, value, tag,
5327                     makeDefault, userHandle);
5328         }
5329 
5330         /**
5331          * Store a name/value pair into the database.
5332          * <p>
5333          * The method takes an optional tag to associate with the setting
5334          * which can be used to clear only settings made by your package and
5335          * associated with this tag by passing the tag to {@link
5336          * #resetToDefaults(ContentResolver, String)}. Anyone can override
5337          * the current tag. Also if another package changes the setting
5338          * then the tag will be set to the one specified in the set call
5339          * which can be null. Also any of the settings setters that do not
5340          * take a tag as an argument effectively clears the tag.
5341          * </p><p>
5342          * For example, if you set settings A and B with tags T1 and T2 and
5343          * another app changes setting A (potentially to the same value), it
5344          * can assign to it a tag T3 (note that now the package that changed
5345          * the setting is not yours). Now if you reset your changes for T1 and
5346          * T2 only setting B will be reset and A not (as it was changed by
5347          * another package) but since A did not change you are in the desired
5348          * initial state. Now if the other app changes the value of A (assuming
5349          * you registered an observer in the beginning) you would detect that
5350          * the setting was changed by another app and handle this appropriately
5351          * (ignore, set back to some value, etc).
5352          * </p><p>
5353          * Also the method takes an argument whether to make the value the
5354          * default for this setting. If the system already specified a default
5355          * value, then the one passed in here will <strong>not</strong>
5356          * be set as the default.
5357          * </p>
5358          *
5359          * @param resolver to access the database with.
5360          * @param name to store.
5361          * @param value to associate with the name.
5362          * @param tag to associate with the setting.
5363          * @param makeDefault whether to make the value the default one.
5364          * @return true if the value was set, false on database errors.
5365          *
5366          * @see #resetToDefaults(ContentResolver, String)
5367          *
5368          * @hide
5369          */
5370         @SystemApi
5371         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)5372         public static boolean putString(@NonNull ContentResolver resolver,
5373                 @NonNull String name, @Nullable String value, @Nullable String tag,
5374                 boolean makeDefault) {
5375             return putStringForUser(resolver, name, value, tag, makeDefault,
5376                     resolver.getUserId());
5377         }
5378 
5379         /**
5380          * Reset the settings to their defaults. This would reset <strong>only</strong>
5381          * settings set by the caller's package. Think of it of a way to undo your own
5382          * changes to the global settings. Passing in the optional tag will reset only
5383          * settings changed by your package and associated with this tag.
5384          *
5385          * @param resolver Handle to the content resolver.
5386          * @param tag Optional tag which should be associated with the settings to reset.
5387          *
5388          * @see #putString(ContentResolver, String, String, String, boolean)
5389          *
5390          * @hide
5391          */
5392         @SystemApi
5393         @TestApi
5394         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)5395         public static void resetToDefaults(@NonNull ContentResolver resolver,
5396                 @Nullable String tag) {
5397             resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
5398                     resolver.getUserId());
5399         }
5400 
5401         /**
5402          *
5403          * Reset the settings to their defaults for a given user with a specific mode. The
5404          * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
5405          * allowing resetting the settings made by a package and associated with the tag.
5406          *
5407          * @param resolver Handle to the content resolver.
5408          * @param tag Optional tag which should be associated with the settings to reset.
5409          * @param mode The reset mode.
5410          * @param userHandle The user for which to reset to defaults.
5411          *
5412          * @see #RESET_MODE_PACKAGE_DEFAULTS
5413          * @see #RESET_MODE_UNTRUSTED_DEFAULTS
5414          * @see #RESET_MODE_UNTRUSTED_CHANGES
5415          * @see #RESET_MODE_TRUSTED_DEFAULTS
5416          *
5417          * @hide
5418          */
resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)5419         public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
5420                 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
5421             try {
5422                 Bundle arg = new Bundle();
5423                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
5424                 if (tag != null) {
5425                     arg.putString(CALL_METHOD_TAG_KEY, tag);
5426                 }
5427                 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
5428                 IContentProvider cp = sProviderHolder.getProvider(resolver);
5429                 cp.call(resolver.getPackageName(), sProviderHolder.mUri.getAuthority(),
5430                         CALL_METHOD_RESET_SECURE, null, arg);
5431             } catch (RemoteException e) {
5432                 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
5433             }
5434         }
5435 
5436         /**
5437          * Construct the content URI for a particular name/value pair,
5438          * useful for monitoring changes with a ContentObserver.
5439          * @param name to look up in the table
5440          * @return the corresponding content URI, or null if not present
5441          */
getUriFor(String name)5442         public static Uri getUriFor(String name) {
5443             if (MOVED_TO_GLOBAL.contains(name)) {
5444                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
5445                         + " to android.provider.Settings.Global, returning global URI.");
5446                 return Global.getUriFor(Global.CONTENT_URI, name);
5447             }
5448             return getUriFor(CONTENT_URI, name);
5449         }
5450 
5451         /**
5452          * Convenience function for retrieving a single secure settings value
5453          * as an integer.  Note that internally setting values are always
5454          * stored as strings; this function converts the string to an integer
5455          * for you.  The default value will be returned if the setting is
5456          * not defined or not an integer.
5457          *
5458          * @param cr The ContentResolver to access.
5459          * @param name The name of the setting to retrieve.
5460          * @param def Value to return if the setting is not defined.
5461          *
5462          * @return The setting's current value, or 'def' if it is not defined
5463          * or not a valid integer.
5464          */
getInt(ContentResolver cr, String name, int def)5465         public static int getInt(ContentResolver cr, String name, int def) {
5466             return getIntForUser(cr, name, def, cr.getUserId());
5467         }
5468 
5469         /** @hide */
5470         @UnsupportedAppUsage
getIntForUser(ContentResolver cr, String name, int def, int userHandle)5471         public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
5472             String v = getStringForUser(cr, name, userHandle);
5473             try {
5474                 return v != null ? Integer.parseInt(v) : def;
5475             } catch (NumberFormatException e) {
5476                 return def;
5477             }
5478         }
5479 
5480         /**
5481          * Convenience function for retrieving a single secure settings value
5482          * as an integer.  Note that internally setting values are always
5483          * stored as strings; this function converts the string to an integer
5484          * for you.
5485          * <p>
5486          * This version does not take a default value.  If the setting has not
5487          * been set, or the string value is not a number,
5488          * it throws {@link SettingNotFoundException}.
5489          *
5490          * @param cr The ContentResolver to access.
5491          * @param name The name of the setting to retrieve.
5492          *
5493          * @throws SettingNotFoundException Thrown if a setting by the given
5494          * name can't be found or the setting value is not an integer.
5495          *
5496          * @return The setting's current value.
5497          */
getInt(ContentResolver cr, String name)5498         public static int getInt(ContentResolver cr, String name)
5499                 throws SettingNotFoundException {
5500             return getIntForUser(cr, name, cr.getUserId());
5501         }
5502 
5503         /** @hide */
getIntForUser(ContentResolver cr, String name, int userHandle)5504         public static int getIntForUser(ContentResolver cr, String name, int userHandle)
5505                 throws SettingNotFoundException {
5506             String v = getStringForUser(cr, name, userHandle);
5507             try {
5508                 return Integer.parseInt(v);
5509             } catch (NumberFormatException e) {
5510                 throw new SettingNotFoundException(name);
5511             }
5512         }
5513 
5514         /**
5515          * Convenience function for updating a single settings value as an
5516          * integer. This will either create a new entry in the table if the
5517          * given name does not exist, or modify the value of the existing row
5518          * with that name.  Note that internally setting values are always
5519          * stored as strings, so this function converts the given value to a
5520          * string before storing it.
5521          *
5522          * @param cr The ContentResolver to access.
5523          * @param name The name of the setting to modify.
5524          * @param value The new value for the setting.
5525          * @return true if the value was set, false on database errors
5526          */
putInt(ContentResolver cr, String name, int value)5527         public static boolean putInt(ContentResolver cr, String name, int value) {
5528             return putIntForUser(cr, name, value, cr.getUserId());
5529         }
5530 
5531         /** @hide */
5532         @UnsupportedAppUsage
putIntForUser(ContentResolver cr, String name, int value, int userHandle)5533         public static boolean putIntForUser(ContentResolver cr, String name, int value,
5534                 int userHandle) {
5535             return putStringForUser(cr, name, Integer.toString(value), userHandle);
5536         }
5537 
5538         /**
5539          * Convenience function for retrieving a single secure settings value
5540          * as a {@code long}.  Note that internally setting values are always
5541          * stored as strings; this function converts the string to a {@code long}
5542          * for you.  The default value will be returned if the setting is
5543          * not defined or not a {@code long}.
5544          *
5545          * @param cr The ContentResolver to access.
5546          * @param name The name of the setting to retrieve.
5547          * @param def Value to return if the setting is not defined.
5548          *
5549          * @return The setting's current value, or 'def' if it is not defined
5550          * or not a valid {@code long}.
5551          */
getLong(ContentResolver cr, String name, long def)5552         public static long getLong(ContentResolver cr, String name, long def) {
5553             return getLongForUser(cr, name, def, cr.getUserId());
5554         }
5555 
5556         /** @hide */
5557         @UnsupportedAppUsage
getLongForUser(ContentResolver cr, String name, long def, int userHandle)5558         public static long getLongForUser(ContentResolver cr, String name, long def,
5559                 int userHandle) {
5560             String valString = getStringForUser(cr, name, userHandle);
5561             long value;
5562             try {
5563                 value = valString != null ? Long.parseLong(valString) : def;
5564             } catch (NumberFormatException e) {
5565                 value = def;
5566             }
5567             return value;
5568         }
5569 
5570         /**
5571          * Convenience function for retrieving a single secure settings value
5572          * as a {@code long}.  Note that internally setting values are always
5573          * stored as strings; this function converts the string to a {@code long}
5574          * for you.
5575          * <p>
5576          * This version does not take a default value.  If the setting has not
5577          * been set, or the string value is not a number,
5578          * it throws {@link SettingNotFoundException}.
5579          *
5580          * @param cr The ContentResolver to access.
5581          * @param name The name of the setting to retrieve.
5582          *
5583          * @return The setting's current value.
5584          * @throws SettingNotFoundException Thrown if a setting by the given
5585          * name can't be found or the setting value is not an integer.
5586          */
getLong(ContentResolver cr, String name)5587         public static long getLong(ContentResolver cr, String name)
5588                 throws SettingNotFoundException {
5589             return getLongForUser(cr, name, cr.getUserId());
5590         }
5591 
5592         /** @hide */
getLongForUser(ContentResolver cr, String name, int userHandle)5593         public static long getLongForUser(ContentResolver cr, String name, int userHandle)
5594                 throws SettingNotFoundException {
5595             String valString = getStringForUser(cr, name, userHandle);
5596             try {
5597                 return Long.parseLong(valString);
5598             } catch (NumberFormatException e) {
5599                 throw new SettingNotFoundException(name);
5600             }
5601         }
5602 
5603         /**
5604          * Convenience function for updating a secure settings value as a long
5605          * integer. This will either create a new entry in the table if the
5606          * given name does not exist, or modify the value of the existing row
5607          * with that name.  Note that internally setting values are always
5608          * stored as strings, so this function converts the given value to a
5609          * string before storing it.
5610          *
5611          * @param cr The ContentResolver to access.
5612          * @param name The name of the setting to modify.
5613          * @param value The new value for the setting.
5614          * @return true if the value was set, false on database errors
5615          */
putLong(ContentResolver cr, String name, long value)5616         public static boolean putLong(ContentResolver cr, String name, long value) {
5617             return putLongForUser(cr, name, value, cr.getUserId());
5618         }
5619 
5620         /** @hide */
5621         @UnsupportedAppUsage
putLongForUser(ContentResolver cr, String name, long value, int userHandle)5622         public static boolean putLongForUser(ContentResolver cr, String name, long value,
5623                 int userHandle) {
5624             return putStringForUser(cr, name, Long.toString(value), userHandle);
5625         }
5626 
5627         /**
5628          * Convenience function for retrieving a single secure settings value
5629          * as a floating point number.  Note that internally setting values are
5630          * always stored as strings; this function converts the string to an
5631          * float for you. The default value will be returned if the setting
5632          * is not defined or not a valid float.
5633          *
5634          * @param cr The ContentResolver to access.
5635          * @param name The name of the setting to retrieve.
5636          * @param def Value to return if the setting is not defined.
5637          *
5638          * @return The setting's current value, or 'def' if it is not defined
5639          * or not a valid float.
5640          */
getFloat(ContentResolver cr, String name, float def)5641         public static float getFloat(ContentResolver cr, String name, float def) {
5642             return getFloatForUser(cr, name, def, cr.getUserId());
5643         }
5644 
5645         /** @hide */
getFloatForUser(ContentResolver cr, String name, float def, int userHandle)5646         public static float getFloatForUser(ContentResolver cr, String name, float def,
5647                 int userHandle) {
5648             String v = getStringForUser(cr, name, userHandle);
5649             try {
5650                 return v != null ? Float.parseFloat(v) : def;
5651             } catch (NumberFormatException e) {
5652                 return def;
5653             }
5654         }
5655 
5656         /**
5657          * Convenience function for retrieving a single secure settings value
5658          * as a float.  Note that internally setting values are always
5659          * stored as strings; this function converts the string to a float
5660          * for you.
5661          * <p>
5662          * This version does not take a default value.  If the setting has not
5663          * been set, or the string value is not a number,
5664          * it throws {@link SettingNotFoundException}.
5665          *
5666          * @param cr The ContentResolver to access.
5667          * @param name The name of the setting to retrieve.
5668          *
5669          * @throws SettingNotFoundException Thrown if a setting by the given
5670          * name can't be found or the setting value is not a float.
5671          *
5672          * @return The setting's current value.
5673          */
getFloat(ContentResolver cr, String name)5674         public static float getFloat(ContentResolver cr, String name)
5675                 throws SettingNotFoundException {
5676             return getFloatForUser(cr, name, cr.getUserId());
5677         }
5678 
5679         /** @hide */
getFloatForUser(ContentResolver cr, String name, int userHandle)5680         public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
5681                 throws SettingNotFoundException {
5682             String v = getStringForUser(cr, name, userHandle);
5683             if (v == null) {
5684                 throw new SettingNotFoundException(name);
5685             }
5686             try {
5687                 return Float.parseFloat(v);
5688             } catch (NumberFormatException e) {
5689                 throw new SettingNotFoundException(name);
5690             }
5691         }
5692 
5693         /**
5694          * Convenience function for updating a single settings value as a
5695          * floating point number. This will either create a new entry in the
5696          * table if the given name does not exist, or modify the value of the
5697          * existing row with that name.  Note that internally setting values
5698          * are always stored as strings, so this function converts the given
5699          * value to a string before storing it.
5700          *
5701          * @param cr The ContentResolver to access.
5702          * @param name The name of the setting to modify.
5703          * @param value The new value for the setting.
5704          * @return true if the value was set, false on database errors
5705          */
putFloat(ContentResolver cr, String name, float value)5706         public static boolean putFloat(ContentResolver cr, String name, float value) {
5707             return putFloatForUser(cr, name, value, cr.getUserId());
5708         }
5709 
5710         /** @hide */
putFloatForUser(ContentResolver cr, String name, float value, int userHandle)5711         public static boolean putFloatForUser(ContentResolver cr, String name, float value,
5712                 int userHandle) {
5713             return putStringForUser(cr, name, Float.toString(value), userHandle);
5714         }
5715 
5716         /**
5717          * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
5718          * instead
5719          */
5720         @Deprecated
5721         public static final String DEVELOPMENT_SETTINGS_ENABLED =
5722                 Global.DEVELOPMENT_SETTINGS_ENABLED;
5723 
5724         /**
5725          * When the user has enable the option to have a "bug report" command
5726          * in the power menu.
5727          * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
5728          * @hide
5729          */
5730         @Deprecated
5731         public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5732 
5733         private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR;
5734 
5735         /**
5736          * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
5737          */
5738         @Deprecated
5739         public static final String ADB_ENABLED = Global.ADB_ENABLED;
5740 
5741         /**
5742          * Setting to allow mock locations and location provider status to be injected into the
5743          * LocationManager service for testing purposes during application development.  These
5744          * locations and status values  override actual location and status information generated
5745          * by network, gps, or other location providers.
5746          *
5747          * @deprecated This settings is not used anymore.
5748          */
5749         @Deprecated
5750         public static final String ALLOW_MOCK_LOCATION = "mock_location";
5751 
5752         private static final Validator ALLOW_MOCK_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR;
5753 
5754         /**
5755          * Setting to indicate that on device captions are enabled.
5756          *
5757          * @hide
5758          */
5759         @SystemApi
5760         public static final String ODI_CAPTIONS_ENABLED = "odi_captions_enabled";
5761 
5762         private static final Validator ODI_CAPTIONS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
5763 
5764         /**
5765          * On Android 8.0 (API level 26) and higher versions of the platform,
5766          * a 64-bit number (expressed as a hexadecimal string), unique to
5767          * each combination of app-signing key, user, and device.
5768          * Values of {@code ANDROID_ID} are scoped by signing key and user.
5769          * The value may change if a factory reset is performed on the
5770          * device or if an APK signing key changes.
5771          *
5772          * For more information about how the platform handles {@code ANDROID_ID}
5773          * in Android 8.0 (API level 26) and higher, see <a
5774          * href="{@docRoot}about/versions/oreo/android-8.0-changes.html#privacy-all">
5775          * Android 8.0 Behavior Changes</a>.
5776          *
5777          * <p class="note"><strong>Note:</strong> For apps that were installed
5778          * prior to updating the device to a version of Android 8.0
5779          * (API level 26) or higher, the value of {@code ANDROID_ID} changes
5780          * if the app is uninstalled and then reinstalled after the OTA.
5781          * To preserve values across uninstalls after an OTA to Android 8.0
5782          * or higher, developers can use
5783          * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html">
5784          * Key/Value Backup</a>.</p>
5785          *
5786          * <p>In versions of the platform lower than Android 8.0 (API level 26),
5787          * a 64-bit number (expressed as a hexadecimal string) that is randomly
5788          * generated when the user first sets up the device and should remain
5789          * constant for the lifetime of the user's device.
5790          *
5791          * On devices that have
5792          * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">
5793          * multiple users</a>, each user appears as a
5794          * completely separate device, so the {@code ANDROID_ID} value is
5795          * unique to each user.</p>
5796          *
5797          * <p class="note"><strong>Note:</strong> If the caller is an Instant App the ID is scoped
5798          * to the Instant App, it is generated when the Instant App is first installed and reset if
5799          * the user clears the Instant App.
5800          */
5801         public static final String ANDROID_ID = "android_id";
5802 
5803         /**
5804          * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
5805          */
5806         @Deprecated
5807         public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
5808 
5809         private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR;
5810 
5811         /**
5812          * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
5813          */
5814         @Deprecated
5815         public static final String DATA_ROAMING = Global.DATA_ROAMING;
5816 
5817         /**
5818          * Setting to record the input method used by default, holding the ID
5819          * of the desired method.
5820          */
5821         public static final String DEFAULT_INPUT_METHOD = "default_input_method";
5822 
5823         /**
5824          * Setting to record the input method subtype used by default, holding the ID
5825          * of the desired method.
5826          */
5827         public static final String SELECTED_INPUT_METHOD_SUBTYPE =
5828                 "selected_input_method_subtype";
5829 
5830         /**
5831          * Setting to record the history of input method subtype, holding the pair of ID of IME
5832          * and its last used subtype.
5833          * @hide
5834          */
5835         public static final String INPUT_METHODS_SUBTYPE_HISTORY =
5836                 "input_methods_subtype_history";
5837 
5838         /**
5839          * Setting to record the visibility of input method selector
5840          */
5841         public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
5842                 "input_method_selector_visibility";
5843 
5844         /**
5845          * The currently selected voice interaction service flattened ComponentName.
5846          * @hide
5847          */
5848         @TestApi
5849         public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
5850 
5851         /**
5852          * The currently selected autofill service flattened ComponentName.
5853          * @hide
5854          */
5855         @TestApi
5856         public static final String AUTOFILL_SERVICE = "autofill_service";
5857 
5858         private static final Validator AUTOFILL_SERVICE_VALIDATOR =
5859                 NULLABLE_COMPONENT_NAME_VALIDATOR;
5860 
5861         /**
5862          * Boolean indicating if Autofill supports field classification.
5863          *
5864          * @see android.service.autofill.AutofillService
5865          *
5866          * @hide
5867          */
5868         @SystemApi
5869         @TestApi
5870         public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION =
5871                 "autofill_field_classification";
5872 
5873         /**
5874          * Boolean indicating if the dark mode dialog shown on first toggle has been seen.
5875          *
5876          * @hide
5877          */
5878         public static final String DARK_MODE_DIALOG_SEEN =
5879                 "dark_mode_dialog_seen";
5880 
5881         /**
5882          * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}.
5883          *
5884          * @hide
5885          */
5886         @SystemApi
5887         @TestApi
5888         public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE =
5889                 "autofill_user_data_max_user_data_size";
5890 
5891         /**
5892          * Defines value returned by
5893          * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}.
5894          *
5895          * @hide
5896          */
5897         @SystemApi
5898         @TestApi
5899         public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE =
5900                 "autofill_user_data_max_field_classification_size";
5901 
5902         /**
5903          * Defines value returned by
5904          * {@link android.service.autofill.UserData#getMaxCategoryCount()}.
5905          *
5906          * @hide
5907          */
5908         @SystemApi
5909         @TestApi
5910         public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT =
5911                 "autofill_user_data_max_category_count";
5912 
5913         /**
5914          * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}.
5915          *
5916          * @hide
5917          */
5918         @SystemApi
5919         @TestApi
5920         public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH =
5921                 "autofill_user_data_max_value_length";
5922 
5923         /**
5924          * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}.
5925          *
5926          * @hide
5927          */
5928         @SystemApi
5929         @TestApi
5930         public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH =
5931                 "autofill_user_data_min_value_length";
5932 
5933         /**
5934          * Defines whether Content Capture is enabled for the user.
5935          *
5936          * <p>Type: {@code int} ({@code 0} for disabled, {@code 1} for enabled).
5937          * <p>Default: enabled
5938          *
5939          * @hide
5940          */
5941         @TestApi
5942         public static final String CONTENT_CAPTURE_ENABLED = "content_capture_enabled";
5943 
5944         /**
5945          * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
5946          */
5947         @Deprecated
5948         public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
5949 
5950         /**
5951          * Indicates whether the current user has completed setup via the setup wizard.
5952          * <p>
5953          * Type: int (0 for false, 1 for true)
5954          *
5955          * @hide
5956          */
5957         @SystemApi
5958         @TestApi
5959         public static final String USER_SETUP_COMPLETE = "user_setup_complete";
5960 
5961         /**
5962          * Indicates that the user has not started setup personalization.
5963          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
5964          *
5965          * @hide
5966          */
5967         @SystemApi
5968         public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0;
5969 
5970         /**
5971          * Indicates that the user has not yet completed setup personalization.
5972          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
5973          *
5974          * @hide
5975          */
5976         @SystemApi
5977         public static final int USER_SETUP_PERSONALIZATION_STARTED = 1;
5978 
5979         /**
5980          * Indicates that the user has snoozed personalization and will complete it later.
5981          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
5982          *
5983          * @hide
5984          */
5985         @SystemApi
5986         public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2;
5987 
5988         /**
5989          * Indicates that the user has completed setup personalization.
5990          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
5991          *
5992          * @hide
5993          */
5994         @SystemApi
5995         public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10;
5996 
5997         /** @hide */
5998         @Retention(RetentionPolicy.SOURCE)
5999         @IntDef({
6000                 USER_SETUP_PERSONALIZATION_NOT_STARTED,
6001                 USER_SETUP_PERSONALIZATION_STARTED,
6002                 USER_SETUP_PERSONALIZATION_PAUSED,
6003                 USER_SETUP_PERSONALIZATION_COMPLETE
6004         })
6005         public @interface UserSetupPersonalization {}
6006 
6007         /**
6008          * Defines the user's current state of device personalization.
6009          * The possible states are defined in {@link UserSetupPersonalization}.
6010          *
6011          * @hide
6012          */
6013         @SystemApi
6014         public static final String USER_SETUP_PERSONALIZATION_STATE =
6015                 "user_setup_personalization_state";
6016 
6017         /**
6018          * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
6019          * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0
6020          * in case SetupWizard has been re-enabled on TV devices.
6021          *
6022          * @hide
6023          */
6024         public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete";
6025 
6026         /**
6027          * The prefix for a category name that indicates whether a suggested action from that
6028          * category was marked as completed.
6029          * <p>
6030          * Type: int (0 for false, 1 for true)
6031          *
6032          * @hide
6033          */
6034         @SystemApi
6035         public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
6036 
6037         /**
6038          * List of input methods that are currently enabled.  This is a string
6039          * containing the IDs of all enabled input methods, each ID separated
6040          * by ':'.
6041          *
6042          * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0"
6043          * where imeId is ComponentName and subtype is int32.
6044          */
6045         public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
6046 
6047         /**
6048          * List of system input methods that are currently disabled.  This is a string
6049          * containing the IDs of all disabled input methods, each ID separated
6050          * by ':'.
6051          * @hide
6052          */
6053         public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
6054 
6055         /**
6056          * Whether to show the IME when a hard keyboard is connected. This is a boolean that
6057          * determines if the IME should be shown when a hard keyboard is attached.
6058          * @hide
6059          */
6060         public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
6061 
6062         private static final Validator SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR = BOOLEAN_VALIDATOR;
6063 
6064         /**
6065          * Host name and port for global http proxy. Uses ':' seperator for
6066          * between host and port.
6067          *
6068          * @deprecated Use {@link Global#HTTP_PROXY}
6069          */
6070         @Deprecated
6071         public static final String HTTP_PROXY = Global.HTTP_PROXY;
6072 
6073         /**
6074          * Package designated as always-on VPN provider.
6075          *
6076          * @hide
6077          */
6078         public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app";
6079 
6080         /**
6081          * Whether to block networking outside of VPN connections while always-on is set.
6082          * @see #ALWAYS_ON_VPN_APP
6083          *
6084          * @hide
6085          */
6086         public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown";
6087 
6088         /**
6089          * Comma separated list of packages that are allowed to access the network when VPN is in
6090          * lockdown mode but not running.
6091          * @see #ALWAYS_ON_VPN_LOCKDOWN
6092          *
6093          * @hide
6094          */
6095         public static final String ALWAYS_ON_VPN_LOCKDOWN_WHITELIST =
6096                 "always_on_vpn_lockdown_whitelist";
6097 
6098         /**
6099          * Whether applications can be installed for this user via the system's
6100          * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
6101          *
6102          * <p>1 = permit app installation via the system package installer intent
6103          * <p>0 = do not allow use of the package installer
6104          * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use
6105          * {@link PackageManager#canRequestPackageInstalls()}
6106          * @see PackageManager#canRequestPackageInstalls()
6107          */
6108         public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
6109 
6110         /**
6111          * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that
6112          * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it
6113          * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES}
6114          * on behalf of the profile owner if needed to make the change transparent for profile
6115          * owners.
6116          *
6117          * @hide
6118          */
6119         public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED =
6120                 "unknown_sources_default_reversed";
6121 
6122         /**
6123          * Comma-separated list of location providers that are enabled. Do not rely on this value
6124          * being present or correct, or on ContentObserver notifications on the corresponding Uri.
6125          *
6126          * @deprecated The preferred methods for checking provider status and listening for changes
6127          * are via {@link LocationManager#isProviderEnabled(String)} and
6128          * {@link LocationManager#PROVIDERS_CHANGED_ACTION}.
6129          */
6130         @Deprecated
6131         public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
6132 
6133         /**
6134          * The current location mode of the device. Do not rely on this value being present or on
6135          * ContentObserver notifications on the corresponding Uri.
6136          *
6137          * @deprecated The preferred methods for checking location mode and listening for changes
6138          * are via {@link LocationManager#isLocationEnabled()} and
6139          * {@link LocationManager#MODE_CHANGED_ACTION}.
6140          */
6141         @Deprecated
6142         public static final String LOCATION_MODE = "location_mode";
6143 
6144         /**
6145          * The App or module that changes the location mode.
6146          * @hide
6147          */
6148         public static final String LOCATION_CHANGER = "location_changer";
6149         /**
6150          * The location changer is unknown or unable to detect.
6151          * @hide
6152          */
6153         public static final int LOCATION_CHANGER_UNKNOWN = 0;
6154         /**
6155          * Location settings in system settings.
6156          * @hide
6157          */
6158         public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1;
6159         /**
6160          * The location icon in drop down notification drawer.
6161          * @hide
6162          */
6163         public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2;
6164 
6165         /**
6166          * Location mode is off.
6167          */
6168         public static final int LOCATION_MODE_OFF = 0;
6169 
6170         /**
6171          * This mode no longer has any distinct meaning, but is interpreted as the location mode is
6172          * on.
6173          *
6174          * @deprecated See {@link #LOCATION_MODE}.
6175          */
6176         @Deprecated
6177         public static final int LOCATION_MODE_SENSORS_ONLY = 1;
6178 
6179         /**
6180          * This mode no longer has any distinct meaning, but is interpreted as the location mode is
6181          * on.
6182          *
6183          * @deprecated See {@link #LOCATION_MODE}.
6184          */
6185         @Deprecated
6186         public static final int LOCATION_MODE_BATTERY_SAVING = 2;
6187 
6188         /**
6189          * This mode no longer has any distinct meaning, but is interpreted as the location mode is
6190          * on.
6191          *
6192          * @deprecated See {@link #LOCATION_MODE}.
6193          */
6194         @Deprecated
6195         public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
6196 
6197         /**
6198          * Location mode is on.
6199          *
6200          * @hide
6201          */
6202         @SystemApi
6203         public static final int LOCATION_MODE_ON = LOCATION_MODE_HIGH_ACCURACY;
6204 
6205         /**
6206          * A flag containing settings used for biometric weak
6207          * @hide
6208          */
6209         @Deprecated
6210         public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
6211                 "lock_biometric_weak_flags";
6212 
6213         /**
6214          * Whether lock-to-app will lock the keyguard when exiting.
6215          * @hide
6216          */
6217         public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
6218 
6219         /**
6220          * Whether autolock is enabled (0 = false, 1 = true)
6221          *
6222          * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
6223          *             level of the keyguard. Accessing this setting from an app that is targeting
6224          *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
6225          */
6226         @Deprecated
6227         public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
6228 
6229         /**
6230          * Whether lock pattern is visible as user enters (0 = false, 1 = true)
6231          *
6232          * @deprecated Accessing this setting from an app that is targeting
6233          *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
6234          */
6235         @Deprecated
6236         public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
6237 
6238         /**
6239          * Whether lock pattern will vibrate as user enters (0 = false, 1 =
6240          * true)
6241          *
6242          * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
6243          *             lockscreen uses
6244          *             {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
6245          *             Accessing this setting from an app that is targeting
6246          *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
6247          */
6248         @Deprecated
6249         public static final String
6250                 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
6251 
6252         /**
6253          * This preference allows the device to be locked given time after screen goes off,
6254          * subject to current DeviceAdmin policy limits.
6255          * @hide
6256          */
6257         @UnsupportedAppUsage
6258         public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
6259 
6260 
6261         /**
6262          * This preference contains the string that shows for owner info on LockScreen.
6263          * @hide
6264          * @deprecated
6265          */
6266         @Deprecated
6267         public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
6268 
6269         /**
6270          * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
6271          * @hide
6272          */
6273         @Deprecated
6274         public static final String LOCK_SCREEN_APPWIDGET_IDS =
6275             "lock_screen_appwidget_ids";
6276 
6277         /**
6278          * Id of the appwidget shown on the lock screen when appwidgets are disabled.
6279          * @hide
6280          */
6281         @Deprecated
6282         public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
6283             "lock_screen_fallback_appwidget_id";
6284 
6285         /**
6286          * Index of the lockscreen appwidget to restore, -1 if none.
6287          * @hide
6288          */
6289         @Deprecated
6290         public static final String LOCK_SCREEN_STICKY_APPWIDGET =
6291             "lock_screen_sticky_appwidget";
6292 
6293         /**
6294          * This preference enables showing the owner info on LockScreen.
6295          * @hide
6296          * @deprecated
6297          */
6298         @Deprecated
6299         @UnsupportedAppUsage
6300         public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
6301             "lock_screen_owner_info_enabled";
6302 
6303         /**
6304          * Indicates whether the user has allowed notifications to be shown atop a securely locked
6305          * screen in their full "private" form (same as when the device is unlocked).
6306          * <p>
6307          * Type: int (0 for false, 1 for true)
6308          *
6309          * @hide
6310          */
6311         @SystemApi
6312         public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
6313                 "lock_screen_allow_private_notifications";
6314 
6315         /**
6316          * When set by a user, allows notification remote input atop a securely locked screen
6317          * without having to unlock
6318          * @hide
6319          */
6320         public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT =
6321                 "lock_screen_allow_remote_input";
6322 
6323         /**
6324          * Indicates which clock face to show on lock screen and AOD.
6325          * @hide
6326          */
6327         public static final String LOCK_SCREEN_CUSTOM_CLOCK_FACE = "lock_screen_custom_clock_face";
6328 
6329         private static final Validator LOCK_SCREEN_CUSTOM_CLOCK_FACE_VALIDATOR =
6330                 ANY_STRING_VALIDATOR;
6331 
6332         /**
6333          * Indicates which clock face to show on lock screen and AOD while docked.
6334          * @hide
6335          */
6336         public static final String DOCKED_CLOCK_FACE = "docked_clock_face";
6337 
6338         /**
6339          * Set by the system to track if the user needs to see the call to action for
6340          * the lockscreen notification policy.
6341          * @hide
6342          */
6343         public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
6344                 "show_note_about_notification_hiding";
6345 
6346         /**
6347          * Set to 1 by the system after trust agents have been initialized.
6348          * @hide
6349          */
6350         public static final String TRUST_AGENTS_INITIALIZED =
6351                 "trust_agents_initialized";
6352 
6353         /**
6354          * The Logging ID (a unique 64-bit value) as a hex string.
6355          * Used as a pseudonymous identifier for logging.
6356          * @deprecated This identifier is poorly initialized and has
6357          * many collisions.  It should not be used.
6358          */
6359         @Deprecated
6360         public static final String LOGGING_ID = "logging_id";
6361 
6362         /**
6363          * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
6364          */
6365         @Deprecated
6366         public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
6367 
6368         /**
6369          * No longer supported.
6370          */
6371         public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
6372 
6373         /**
6374          * No longer supported.
6375          */
6376         public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
6377 
6378         /**
6379          * No longer supported.
6380          */
6381         public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
6382 
6383         /**
6384          * Settings classname to launch when Settings is clicked from All
6385          * Applications.  Needed because of user testing between the old
6386          * and new Settings apps.
6387          */
6388         // TODO: 881807
6389         public static final String SETTINGS_CLASSNAME = "settings_classname";
6390 
6391         /**
6392          * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
6393          */
6394         @Deprecated
6395         public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
6396 
6397         private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6398 
6399         /**
6400          * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
6401          */
6402         @Deprecated
6403         public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
6404 
6405         /**
6406          * If accessibility is enabled.
6407          */
6408         public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
6409 
6410         private static final Validator ACCESSIBILITY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6411 
6412         /**
6413          * Setting specifying if the accessibility shortcut is enabled.
6414          * @hide
6415          */
6416         public static final String ACCESSIBILITY_SHORTCUT_ENABLED =
6417                 "accessibility_shortcut_enabled";
6418 
6419         private static final Validator ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6420 
6421         /**
6422          * Setting specifying if the accessibility shortcut is enabled.
6423          * @hide
6424          */
6425         public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN =
6426                 "accessibility_shortcut_on_lock_screen";
6427 
6428         private static final Validator ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR =
6429                 BOOLEAN_VALIDATOR;
6430 
6431         /**
6432          * Setting specifying if the accessibility shortcut dialog has been shown to this user.
6433          * @hide
6434          */
6435         public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN =
6436                 "accessibility_shortcut_dialog_shown";
6437 
6438         private static final Validator ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR =
6439                 BOOLEAN_VALIDATOR;
6440 
6441         /**
6442          * Setting specifying the accessibility service to be toggled via the accessibility
6443          * shortcut. Must be its flattened {@link ComponentName}.
6444          * @hide
6445          */
6446         @TestApi
6447         public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE =
6448                 "accessibility_shortcut_target_service";
6449 
6450         private static final Validator ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR =
6451                 NULLABLE_COMPONENT_NAME_VALIDATOR;
6452 
6453         /**
6454          * Setting specifying the accessibility service or feature to be toggled via the
6455          * accessibility button in the navigation bar. This is either a flattened
6456          * {@link ComponentName} or the class name of a system class implementing a supported
6457          * accessibility feature.
6458          * @hide
6459          */
6460         public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT =
6461                 "accessibility_button_target_component";
6462 
6463         private static final Validator ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR =
6464                 new Validator() {
6465                     @Override
6466                     public boolean validate(@Nullable String value) {
6467                         // technically either ComponentName or class name, but there's proper value
6468                         // validation at callsites, so allow any non-null string
6469                         return value != null;
6470                     }
6471                 };
6472 
6473         /**
6474          * If touch exploration is enabled.
6475          */
6476         public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
6477 
6478         private static final Validator TOUCH_EXPLORATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6479 
6480         /**
6481          * List of the enabled accessibility providers.
6482          */
6483         public static final String ENABLED_ACCESSIBILITY_SERVICES =
6484             "enabled_accessibility_services";
6485 
6486         private static final Validator ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR =
6487                 new SettingsValidators.ComponentNameListValidator(":");
6488 
6489         /**
6490          * List of the accessibility services to which the user has granted
6491          * permission to put the device into touch exploration mode.
6492          *
6493          * @hide
6494          */
6495         public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
6496             "touch_exploration_granted_accessibility_services";
6497 
6498         private static final Validator TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR =
6499                 new SettingsValidators.ComponentNameListValidator(":");
6500 
6501         /**
6502          * Whether the Global Actions Panel is enabled.
6503          * @hide
6504          */
6505         public static final String GLOBAL_ACTIONS_PANEL_ENABLED = "global_actions_panel_enabled";
6506 
6507         private static final Validator GLOBAL_ACTIONS_PANEL_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6508 
6509         /**
6510          * Whether the Global Actions Panel can be toggled on or off in Settings.
6511          * @hide
6512          */
6513         public static final String GLOBAL_ACTIONS_PANEL_AVAILABLE =
6514                 "global_actions_panel_available";
6515 
6516         /**
6517          * Enables debug mode for the Global Actions Panel.
6518          * @hide
6519          */
6520         public static final String GLOBAL_ACTIONS_PANEL_DEBUG_ENABLED =
6521                 "global_actions_panel_debug_enabled";
6522 
6523         /**
6524          * Whether the hush gesture has ever been used
6525          * @hide
6526          */
6527         @SystemApi
6528         public static final String HUSH_GESTURE_USED = "hush_gesture_used";
6529 
6530         private static final Validator HUSH_GESTURE_USED_VALIDATOR = BOOLEAN_VALIDATOR;
6531 
6532         /**
6533          * Number of times the user has manually clicked the ringer toggle
6534          * @hide
6535          */
6536         public static final String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count";
6537 
6538         private static final Validator MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR =
6539                 NON_NEGATIVE_INTEGER_VALIDATOR;
6540 
6541         /**
6542          * Whether to play a sound for charging events.
6543          * @hide
6544          */
6545         public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
6546 
6547         /**
6548          * Whether to vibrate for charging events.
6549          * @hide
6550          */
6551         public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled";
6552 
6553         /**
6554          * If 0, turning on dnd manually will last indefinitely.
6555          * Else if non-negative, turning on dnd manually will last for this many minutes.
6556          * Else (if negative), turning on dnd manually will surface a dialog that prompts
6557          * user to specify a duration.
6558          * @hide
6559          */
6560         public static final String ZEN_DURATION = "zen_duration";
6561 
6562         private static final Validator ZEN_DURATION_VALIDATOR = ANY_INTEGER_VALIDATOR;
6563 
6564         /** @hide */ public static final int ZEN_DURATION_PROMPT = -1;
6565         /** @hide */ public static final int ZEN_DURATION_FOREVER = 0;
6566 
6567         /**
6568          * If nonzero, will show the zen upgrade notification when the user toggles DND on/off.
6569          * @hide
6570          */
6571         public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";
6572 
6573         /**
6574          * If nonzero, will show the zen update settings suggestion.
6575          * @hide
6576          */
6577         public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion";
6578 
6579         /**
6580          * If nonzero, zen has not been updated to reflect new changes.
6581          * @hide
6582          */
6583         public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated";
6584 
6585         /**
6586          * If nonzero, zen setting suggestion has been viewed by user
6587          * @hide
6588          */
6589         public static final String ZEN_SETTINGS_SUGGESTION_VIEWED =
6590                 "zen_settings_suggestion_viewed";
6591 
6592         /**
6593          * Whether the in call notification is enabled to play sound during calls.  The value is
6594          * boolean (1 or 0).
6595          * @hide
6596          */
6597         public static final String IN_CALL_NOTIFICATION_ENABLED = "in_call_notification_enabled";
6598 
6599         private static final Validator IN_CALL_NOTIFICATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6600 
6601         /**
6602          * Uri of the slice that's presented on the keyguard.
6603          * Defaults to a slice with the date and next alarm.
6604          *
6605          * @hide
6606          */
6607         public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri";
6608 
6609         /**
6610          * Whether to speak passwords while in accessibility mode.
6611          *
6612          * @deprecated The speaking of passwords is controlled by individual accessibility services.
6613          * Apps should ignore this setting and provide complete information to accessibility
6614          * at all times, which was the behavior when this value was {@code true}.
6615          */
6616         @Deprecated
6617         public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
6618 
6619         /**
6620          * Whether to draw text with high contrast while in accessibility mode.
6621          *
6622          * @hide
6623          */
6624         public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
6625                 "high_text_contrast_enabled";
6626 
6627         private static final Validator ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR =
6628                 BOOLEAN_VALIDATOR;
6629 
6630         /**
6631          * Setting that specifies whether the display magnification is enabled via a system-wide
6632          * triple tap gesture. Display magnifications allows the user to zoom in the display content
6633          * and is targeted to low vision users. The current magnification scale is controlled by
6634          * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
6635          *
6636          * @hide
6637          */
6638         @TestApi
6639         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
6640                 "accessibility_display_magnification_enabled";
6641 
6642         private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR =
6643                 BOOLEAN_VALIDATOR;
6644 
6645         /**
6646          * Setting that specifies whether the display magnification is enabled via a shortcut
6647          * affordance within the system's navigation area. Display magnifications allows the user to
6648          * zoom in the display content and is targeted to low vision users. The current
6649          * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
6650          *
6651          * @hide
6652          */
6653         @SystemApi
6654         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED =
6655                 "accessibility_display_magnification_navbar_enabled";
6656 
6657         private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR
6658                 = BOOLEAN_VALIDATOR;
6659 
6660         /**
6661          * Setting that specifies what the display magnification scale is.
6662          * Display magnifications allows the user to zoom in the display
6663          * content and is targeted to low vision users. Whether a display
6664          * magnification is performed is controlled by
6665          * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and
6666          * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED}
6667          *
6668          * @hide
6669          */
6670         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
6671                 "accessibility_display_magnification_scale";
6672 
6673         private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR =
6674                 new SettingsValidators.InclusiveFloatRangeValidator(1.0f, Float.MAX_VALUE);
6675 
6676         /**
6677          * Unused mangnification setting
6678          *
6679          * @hide
6680          * @deprecated
6681          */
6682         @Deprecated
6683         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
6684                 "accessibility_display_magnification_auto_update";
6685 
6686         /**
6687          * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be
6688          * modified from an AccessibilityService using the SoftKeyboardController.
6689          *
6690          * @hide
6691          */
6692         public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE =
6693                 "accessibility_soft_keyboard_mode";
6694 
6695         /**
6696          * Default soft keyboard behavior.
6697          *
6698          * @hide
6699          */
6700         public static final int SHOW_MODE_AUTO = 0;
6701 
6702         /**
6703          * Soft keyboard is never shown.
6704          *
6705          * @hide
6706          */
6707         public static final int SHOW_MODE_HIDDEN = 1;
6708 
6709         /**
6710          * Setting that specifies whether timed text (captions) should be
6711          * displayed in video content. Text display properties are controlled by
6712          * the following settings:
6713          * <ul>
6714          * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
6715          * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
6716          * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
6717          * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
6718          * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
6719          * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
6720          * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
6721          * </ul>
6722          *
6723          * @hide
6724          */
6725         public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
6726                 "accessibility_captioning_enabled";
6727 
6728         private static final Validator ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR =
6729                 BOOLEAN_VALIDATOR;
6730 
6731         /**
6732          * Setting that specifies the language for captions as a locale string,
6733          * e.g. en_US.
6734          *
6735          * @see java.util.Locale#toString
6736          * @hide
6737          */
6738         public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
6739                 "accessibility_captioning_locale";
6740 
6741         private static final Validator ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR = LOCALE_VALIDATOR;
6742 
6743         /**
6744          * Integer property that specifies the preset style for captions, one
6745          * of:
6746          * <ul>
6747          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
6748          * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
6749          * </ul>
6750          *
6751          * @see java.util.Locale#toString
6752          * @hide
6753          */
6754         public static final String ACCESSIBILITY_CAPTIONING_PRESET =
6755                 "accessibility_captioning_preset";
6756 
6757         private static final Validator ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR =
6758                 new SettingsValidators.DiscreteValueValidator(new String[]{"-1", "0", "1", "2",
6759                         "3", "4"});
6760 
6761         /**
6762          * Integer property that specifes the background color for captions as a
6763          * packed 32-bit color.
6764          *
6765          * @see android.graphics.Color#argb
6766          * @hide
6767          */
6768         public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
6769                 "accessibility_captioning_background_color";
6770 
6771         private static final Validator ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR =
6772                 ANY_INTEGER_VALIDATOR;
6773 
6774         /**
6775          * Integer property that specifes the foreground color for captions as a
6776          * packed 32-bit color.
6777          *
6778          * @see android.graphics.Color#argb
6779          * @hide
6780          */
6781         public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
6782                 "accessibility_captioning_foreground_color";
6783 
6784         private static final Validator ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR =
6785                 ANY_INTEGER_VALIDATOR;
6786 
6787         /**
6788          * Integer property that specifes the edge type for captions, one of:
6789          * <ul>
6790          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
6791          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
6792          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
6793          * </ul>
6794          *
6795          * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
6796          * @hide
6797          */
6798         public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
6799                 "accessibility_captioning_edge_type";
6800 
6801         private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR =
6802                 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2"});
6803 
6804         /**
6805          * Integer property that specifes the edge color for captions as a
6806          * packed 32-bit color.
6807          *
6808          * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
6809          * @see android.graphics.Color#argb
6810          * @hide
6811          */
6812         public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
6813                 "accessibility_captioning_edge_color";
6814 
6815         private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR =
6816                 ANY_INTEGER_VALIDATOR;
6817 
6818         /**
6819          * Integer property that specifes the window color for captions as a
6820          * packed 32-bit color.
6821          *
6822          * @see android.graphics.Color#argb
6823          * @hide
6824          */
6825         public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
6826                 "accessibility_captioning_window_color";
6827 
6828         private static final Validator ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR =
6829                 ANY_INTEGER_VALIDATOR;
6830 
6831         /**
6832          * String property that specifies the typeface for captions, one of:
6833          * <ul>
6834          * <li>DEFAULT
6835          * <li>MONOSPACE
6836          * <li>SANS_SERIF
6837          * <li>SERIF
6838          * </ul>
6839          *
6840          * @see android.graphics.Typeface
6841          * @hide
6842          */
6843         @UnsupportedAppUsage
6844         public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
6845                 "accessibility_captioning_typeface";
6846 
6847         private static final Validator ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR =
6848                 new SettingsValidators.DiscreteValueValidator(new String[]{"DEFAULT",
6849                         "MONOSPACE", "SANS_SERIF", "SERIF"});
6850 
6851         /**
6852          * Floating point property that specifies font scaling for captions.
6853          *
6854          * @hide
6855          */
6856         public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
6857                 "accessibility_captioning_font_scale";
6858 
6859         private static final Validator ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR =
6860                 new SettingsValidators.InclusiveFloatRangeValidator(0.5f, 2.0f);
6861 
6862         /**
6863          * Setting that specifies whether display color inversion is enabled.
6864          */
6865         public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
6866                 "accessibility_display_inversion_enabled";
6867 
6868         private static final Validator ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR =
6869                 BOOLEAN_VALIDATOR;
6870 
6871         /**
6872          * Setting that specifies whether display color space adjustment is
6873          * enabled.
6874          *
6875          * @hide
6876          */
6877         @UnsupportedAppUsage
6878         public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
6879                 "accessibility_display_daltonizer_enabled";
6880 
6881         private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR =
6882                 BOOLEAN_VALIDATOR;
6883 
6884         /**
6885          * Integer property that specifies the type of color space adjustment to
6886          * perform. Valid values are defined in AccessibilityManager and Settings arrays.xml:
6887          * - AccessibilityManager.DALTONIZER_DISABLED = -1
6888          * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0
6889          * - <item>@string/daltonizer_mode_protanomaly</item> = 11
6890          * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY and
6891          *       <item>@string/daltonizer_mode_deuteranomaly</item> = 12
6892          * - <item>@string/daltonizer_mode_tritanomaly</item> = 13
6893          *
6894          * @hide
6895          */
6896         @UnsupportedAppUsage
6897         public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
6898                 "accessibility_display_daltonizer";
6899 
6900         private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR =
6901                 new SettingsValidators.DiscreteValueValidator(
6902                         new String[] {"-1", "0", "11", "12", "13"});
6903 
6904         /**
6905          * Setting that specifies whether automatic click when the mouse pointer stops moving is
6906          * enabled.
6907          *
6908          * @hide
6909          */
6910         @UnsupportedAppUsage
6911         public static final String ACCESSIBILITY_AUTOCLICK_ENABLED =
6912                 "accessibility_autoclick_enabled";
6913 
6914         private static final Validator ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR =
6915                 BOOLEAN_VALIDATOR;
6916 
6917         /**
6918          * Integer setting specifying amount of time in ms the mouse pointer has to stay still
6919          * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set.
6920          *
6921          * @see #ACCESSIBILITY_AUTOCLICK_ENABLED
6922          * @hide
6923          */
6924         public static final String ACCESSIBILITY_AUTOCLICK_DELAY =
6925                 "accessibility_autoclick_delay";
6926 
6927         private static final Validator ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR =
6928                 NON_NEGATIVE_INTEGER_VALIDATOR;
6929 
6930         /**
6931          * Whether or not larger size icons are used for the pointer of mouse/trackpad for
6932          * accessibility.
6933          * (0 = false, 1 = true)
6934          * @hide
6935          */
6936         @UnsupportedAppUsage
6937         public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
6938                 "accessibility_large_pointer_icon";
6939 
6940         private static final Validator ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR =
6941                 BOOLEAN_VALIDATOR;
6942 
6943         /**
6944          * The timeout for considering a press to be a long press in milliseconds.
6945          * @hide
6946          */
6947         @UnsupportedAppUsage
6948         public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
6949 
6950         private static final Validator LONG_PRESS_TIMEOUT_VALIDATOR =
6951                 NON_NEGATIVE_INTEGER_VALIDATOR;
6952 
6953         /**
6954          * The duration in milliseconds between the first tap's up event and the second tap's
6955          * down event for an interaction to be considered part of the same multi-press.
6956          * @hide
6957          */
6958         public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout";
6959 
6960         /**
6961          * Setting that specifies recommended timeout in milliseconds for controls
6962          * which don't need user's interactions.
6963          *
6964          * @hide
6965          */
6966         public static final String ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS =
6967                 "accessibility_non_interactive_ui_timeout_ms";
6968 
6969         /**
6970          * Setting that specifies recommended timeout in milliseconds for controls
6971          * which need user's interactions.
6972          *
6973          * @hide
6974          */
6975         public static final String ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS =
6976                 "accessibility_interactive_ui_timeout_ms";
6977 
6978         /**
6979          * List of the enabled print services.
6980          *
6981          * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade
6982          * from pre-N.
6983          *
6984          * @hide
6985          */
6986         @UnsupportedAppUsage
6987         public static final String ENABLED_PRINT_SERVICES =
6988             "enabled_print_services";
6989 
6990         /**
6991          * List of the disabled print services.
6992          *
6993          * @hide
6994          */
6995         @TestApi
6996         public static final String DISABLED_PRINT_SERVICES =
6997             "disabled_print_services";
6998 
6999         /**
7000          * The saved value for WindowManagerService.setForcedDisplayDensity()
7001          * formatted as a single integer representing DPI. If unset, then use
7002          * the real display density.
7003          *
7004          * @hide
7005          */
7006         public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
7007 
7008         /**
7009          * Setting to always use the default text-to-speech settings regardless
7010          * of the application settings.
7011          * 1 = override application settings,
7012          * 0 = use application settings (if specified).
7013          *
7014          * @deprecated  The value of this setting is no longer respected by
7015          * the framework text to speech APIs as of the Ice Cream Sandwich release.
7016          */
7017         @Deprecated
7018         public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
7019 
7020         /**
7021          * Default text-to-speech engine speech rate. 100 = 1x
7022          */
7023         public static final String TTS_DEFAULT_RATE = "tts_default_rate";
7024 
7025         private static final Validator TTS_DEFAULT_RATE_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR;
7026 
7027         /**
7028          * Default text-to-speech engine pitch. 100 = 1x
7029          */
7030         public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
7031 
7032         private static final Validator TTS_DEFAULT_PITCH_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR;
7033 
7034         /**
7035          * Default text-to-speech engine.
7036          */
7037         public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
7038 
7039         private static final Validator TTS_DEFAULT_SYNTH_VALIDATOR = PACKAGE_NAME_VALIDATOR;
7040 
7041         /**
7042          * Default text-to-speech language.
7043          *
7044          * @deprecated this setting is no longer in use, as of the Ice Cream
7045          * Sandwich release. Apps should never need to read this setting directly,
7046          * instead can query the TextToSpeech framework classes for the default
7047          * locale. {@link TextToSpeech#getLanguage()}.
7048          */
7049         @Deprecated
7050         public static final String TTS_DEFAULT_LANG = "tts_default_lang";
7051 
7052         /**
7053          * Default text-to-speech country.
7054          *
7055          * @deprecated this setting is no longer in use, as of the Ice Cream
7056          * Sandwich release. Apps should never need to read this setting directly,
7057          * instead can query the TextToSpeech framework classes for the default
7058          * locale. {@link TextToSpeech#getLanguage()}.
7059          */
7060         @Deprecated
7061         public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
7062 
7063         /**
7064          * Default text-to-speech locale variant.
7065          *
7066          * @deprecated this setting is no longer in use, as of the Ice Cream
7067          * Sandwich release. Apps should never need to read this setting directly,
7068          * instead can query the TextToSpeech framework classes for the
7069          * locale that is in use {@link TextToSpeech#getLanguage()}.
7070          */
7071         @Deprecated
7072         public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
7073 
7074         /**
7075          * Stores the default tts locales on a per engine basis. Stored as
7076          * a comma seperated list of values, each value being of the form
7077          * {@code engine_name:locale} for example,
7078          * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
7079          * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
7080          * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
7081          * setting directly, and can query the TextToSpeech framework classes
7082          * for the locale that is in use.
7083          *
7084          * @hide
7085          */
7086         public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
7087 
7088         private static final Validator TTS_DEFAULT_LOCALE_VALIDATOR = new Validator() {
7089             @Override
7090             public boolean validate(@Nullable String value) {
7091                 if (value == null || value.length() == 0) {
7092                     return false;
7093                 }
7094                 String[] ttsLocales = value.split(",");
7095                 boolean valid = true;
7096                 for (String ttsLocale : ttsLocales) {
7097                     String[] parts = ttsLocale.split(":");
7098                     valid |= ((parts.length == 2)
7099                             && (parts[0].length() > 0)
7100                             && ANY_STRING_VALIDATOR.validate(parts[0])
7101                             && LOCALE_VALIDATOR.validate(parts[1]));
7102                 }
7103                 return valid;
7104             }
7105         };
7106 
7107         /**
7108          * Space delimited list of plugin packages that are enabled.
7109          */
7110         public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
7111 
7112         private static final Validator TTS_ENABLED_PLUGINS_VALIDATOR =
7113                 new SettingsValidators.PackageNameListValidator(" ");
7114 
7115         /**
7116          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
7117          * instead.
7118          */
7119         @Deprecated
7120         public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
7121                 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
7122 
7123         private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
7124                 BOOLEAN_VALIDATOR;
7125 
7126         /**
7127          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
7128          * instead.
7129          */
7130         @Deprecated
7131         public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
7132                 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
7133 
7134         private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR =
7135                 NON_NEGATIVE_INTEGER_VALIDATOR;
7136 
7137         /**
7138          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
7139          * instead.
7140          */
7141         @Deprecated
7142         public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
7143                 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
7144 
7145         private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR =
7146                 NON_NEGATIVE_INTEGER_VALIDATOR;
7147 
7148         /**
7149          * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
7150          * instead.
7151          */
7152         @Deprecated
7153         public static final String WIFI_ON = Global.WIFI_ON;
7154 
7155         /**
7156          * The acceptable packet loss percentage (range 0 - 100) before trying
7157          * another AP on the same network.
7158          * @deprecated This setting is not used.
7159          */
7160         @Deprecated
7161         public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
7162                 "wifi_watchdog_acceptable_packet_loss_percentage";
7163 
7164         /**
7165          * The number of access points required for a network in order for the
7166          * watchdog to monitor it.
7167          * @deprecated This setting is not used.
7168          */
7169         @Deprecated
7170         public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
7171 
7172         /**
7173          * The delay between background checks.
7174          * @deprecated This setting is not used.
7175          */
7176         @Deprecated
7177         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
7178                 "wifi_watchdog_background_check_delay_ms";
7179 
7180         /**
7181          * Whether the Wi-Fi watchdog is enabled for background checking even
7182          * after it thinks the user has connected to a good access point.
7183          * @deprecated This setting is not used.
7184          */
7185         @Deprecated
7186         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
7187                 "wifi_watchdog_background_check_enabled";
7188 
7189         /**
7190          * The timeout for a background ping
7191          * @deprecated This setting is not used.
7192          */
7193         @Deprecated
7194         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
7195                 "wifi_watchdog_background_check_timeout_ms";
7196 
7197         /**
7198          * The number of initial pings to perform that *may* be ignored if they
7199          * fail. Again, if these fail, they will *not* be used in packet loss
7200          * calculation. For example, one network always seemed to time out for
7201          * the first couple pings, so this is set to 3 by default.
7202          * @deprecated This setting is not used.
7203          */
7204         @Deprecated
7205         public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
7206             "wifi_watchdog_initial_ignored_ping_count";
7207 
7208         /**
7209          * The maximum number of access points (per network) to attempt to test.
7210          * If this number is reached, the watchdog will no longer monitor the
7211          * initial connection state for the network. This is a safeguard for
7212          * networks containing multiple APs whose DNS does not respond to pings.
7213          * @deprecated This setting is not used.
7214          */
7215         @Deprecated
7216         public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
7217 
7218         /**
7219          * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
7220          */
7221         @Deprecated
7222         public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
7223 
7224         /**
7225          * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
7226          * @deprecated This setting is not used.
7227          */
7228         @Deprecated
7229         public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
7230 
7231         /**
7232          * The number of pings to test if an access point is a good connection.
7233          * @deprecated This setting is not used.
7234          */
7235         @Deprecated
7236         public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
7237 
7238         /**
7239          * The delay between pings.
7240          * @deprecated This setting is not used.
7241          */
7242         @Deprecated
7243         public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
7244 
7245         /**
7246          * The timeout per ping.
7247          * @deprecated This setting is not used.
7248          */
7249         @Deprecated
7250         public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
7251 
7252         /**
7253          * @deprecated Use
7254          * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
7255          */
7256         @Deprecated
7257         public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
7258 
7259         /**
7260          * @deprecated Use
7261          * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
7262          */
7263         @Deprecated
7264         public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
7265                 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
7266 
7267         /**
7268          * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
7269          * the receivers of the PendingIntent an opportunity to make a new network request before
7270          * the Network satisfying the request is potentially removed.
7271          *
7272          * @hide
7273          */
7274         public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
7275                 "connectivity_release_pending_intent_delay_ms";
7276 
7277         /**
7278          * Whether background data usage is allowed.
7279          *
7280          * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
7281          *             availability of background data depends on several
7282          *             combined factors. When background data is unavailable,
7283          *             {@link ConnectivityManager#getActiveNetworkInfo()} will
7284          *             now appear disconnected.
7285          */
7286         @Deprecated
7287         public static final String BACKGROUND_DATA = "background_data";
7288 
7289         /**
7290          * Origins for which browsers should allow geolocation by default.
7291          * The value is a space-separated list of origins.
7292          */
7293         public static final String ALLOWED_GEOLOCATION_ORIGINS
7294                 = "allowed_geolocation_origins";
7295 
7296         /**
7297          * The preferred TTY mode     0 = TTy Off, CDMA default
7298          *                            1 = TTY Full
7299          *                            2 = TTY HCO
7300          *                            3 = TTY VCO
7301          * @hide
7302          */
7303         public static final String PREFERRED_TTY_MODE =
7304                 "preferred_tty_mode";
7305 
7306         private static final Validator PREFERRED_TTY_MODE_VALIDATOR =
7307                 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2", "3"});
7308 
7309         /**
7310          * Whether the enhanced voice privacy mode is enabled.
7311          * 0 = normal voice privacy
7312          * 1 = enhanced voice privacy
7313          * @hide
7314          */
7315         public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
7316 
7317         private static final Validator ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7318 
7319         /**
7320          * Whether the TTY mode mode is enabled.
7321          * 0 = disabled
7322          * 1 = enabled
7323          * @hide
7324          */
7325         public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
7326 
7327         private static final Validator TTY_MODE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7328 
7329         /**
7330          * User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT
7331          * calls when supported by the device and carrier. Boolean value.
7332          * 0 = OFF
7333          * 1 = ON
7334          */
7335         public static final String RTT_CALLING_MODE = "rtt_calling_mode";
7336 
7337         private static final Validator RTT_CALLING_MODE_VALIDATOR = BOOLEAN_VALIDATOR;
7338 
7339         /**
7340         /**
7341          * Controls whether settings backup is enabled.
7342          * Type: int ( 0 = disabled, 1 = enabled )
7343          * @hide
7344          */
7345         @UnsupportedAppUsage
7346         public static final String BACKUP_ENABLED = "backup_enabled";
7347 
7348         /**
7349          * Controls whether application data is automatically restored from backup
7350          * at install time.
7351          * Type: int ( 0 = disabled, 1 = enabled )
7352          * @hide
7353          */
7354         @UnsupportedAppUsage
7355         public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
7356 
7357         /**
7358          * Indicates whether settings backup has been fully provisioned.
7359          * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
7360          * @hide
7361          */
7362         @UnsupportedAppUsage
7363         public static final String BACKUP_PROVISIONED = "backup_provisioned";
7364 
7365         /**
7366          * Component of the transport to use for backup/restore.
7367          * @hide
7368          */
7369         @UnsupportedAppUsage
7370         public static final String BACKUP_TRANSPORT = "backup_transport";
7371 
7372         /**
7373          * Indicates the version for which the setup wizard was last shown. The version gets
7374          * bumped for each release when there is new setup information to show.
7375          *
7376          * @hide
7377          */
7378         @SystemApi
7379         public static final String LAST_SETUP_SHOWN = "last_setup_shown";
7380 
7381         /**
7382          * The interval in milliseconds after which Wi-Fi is considered idle.
7383          * When idle, it is possible for the device to be switched from Wi-Fi to
7384          * the mobile data network.
7385          * @hide
7386          * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
7387          * instead.
7388          */
7389         @Deprecated
7390         public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
7391 
7392         /**
7393          * The global search provider chosen by the user (if multiple global
7394          * search providers are installed). This will be the provider returned
7395          * by {@link SearchManager#getGlobalSearchActivity()} if it's still
7396          * installed. This setting is stored as a flattened component name as
7397          * per {@link ComponentName#flattenToString()}.
7398          *
7399          * @hide
7400          */
7401         public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
7402                 "search_global_search_activity";
7403 
7404         /**
7405          * The number of promoted sources in GlobalSearch.
7406          * @hide
7407          */
7408         public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
7409         /**
7410          * The maximum number of suggestions returned by GlobalSearch.
7411          * @hide
7412          */
7413         public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
7414         /**
7415          * The number of suggestions GlobalSearch will ask each non-web search source for.
7416          * @hide
7417          */
7418         public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
7419         /**
7420          * The number of suggestions the GlobalSearch will ask the web search source for.
7421          * @hide
7422          */
7423         public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
7424                 "search_web_results_override_limit";
7425         /**
7426          * The number of milliseconds that GlobalSearch will wait for suggestions from
7427          * promoted sources before continuing with all other sources.
7428          * @hide
7429          */
7430         public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
7431                 "search_promoted_source_deadline_millis";
7432         /**
7433          * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
7434          * @hide
7435          */
7436         public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
7437         /**
7438          * The maximum number of milliseconds that GlobalSearch shows the previous results
7439          * after receiving a new query.
7440          * @hide
7441          */
7442         public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
7443         /**
7444          * The maximum age of log data used for shortcuts in GlobalSearch.
7445          * @hide
7446          */
7447         public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
7448         /**
7449          * The maximum age of log data used for source ranking in GlobalSearch.
7450          * @hide
7451          */
7452         public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
7453                 "search_max_source_event_age_millis";
7454         /**
7455          * The minimum number of impressions needed to rank a source in GlobalSearch.
7456          * @hide
7457          */
7458         public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
7459                 "search_min_impressions_for_source_ranking";
7460         /**
7461          * The minimum number of clicks needed to rank a source in GlobalSearch.
7462          * @hide
7463          */
7464         public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
7465                 "search_min_clicks_for_source_ranking";
7466         /**
7467          * The maximum number of shortcuts shown by GlobalSearch.
7468          * @hide
7469          */
7470         public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
7471         /**
7472          * The size of the core thread pool for suggestion queries in GlobalSearch.
7473          * @hide
7474          */
7475         public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
7476                 "search_query_thread_core_pool_size";
7477         /**
7478          * The maximum size of the thread pool for suggestion queries in GlobalSearch.
7479          * @hide
7480          */
7481         public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
7482                 "search_query_thread_max_pool_size";
7483         /**
7484          * The size of the core thread pool for shortcut refreshing in GlobalSearch.
7485          * @hide
7486          */
7487         public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
7488                 "search_shortcut_refresh_core_pool_size";
7489         /**
7490          * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
7491          * @hide
7492          */
7493         public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
7494                 "search_shortcut_refresh_max_pool_size";
7495         /**
7496          * The maximun time that excess threads in the GlobalSeach thread pools will
7497          * wait before terminating.
7498          * @hide
7499          */
7500         public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
7501                 "search_thread_keepalive_seconds";
7502         /**
7503          * The maximum number of concurrent suggestion queries to each source.
7504          * @hide
7505          */
7506         public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
7507                 "search_per_source_concurrent_query_limit";
7508 
7509         /**
7510          * Whether or not alert sounds are played on StorageManagerService events.
7511          * (0 = false, 1 = true)
7512          * @hide
7513          */
7514         public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
7515 
7516         private static final Validator MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR = BOOLEAN_VALIDATOR;
7517 
7518         /**
7519          * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
7520          * @hide
7521          */
7522         public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
7523 
7524         private static final Validator MOUNT_UMS_AUTOSTART_VALIDATOR = BOOLEAN_VALIDATOR;
7525 
7526         /**
7527          * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
7528          * @hide
7529          */
7530         public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
7531 
7532         private static final Validator MOUNT_UMS_PROMPT_VALIDATOR = BOOLEAN_VALIDATOR;
7533 
7534         /**
7535          * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
7536          * @hide
7537          */
7538         public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
7539 
7540         private static final Validator MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7541 
7542         /**
7543          * If nonzero, ANRs in invisible background processes bring up a dialog.
7544          * Otherwise, the process will be silently killed.
7545          *
7546          * Also prevents ANRs and crash dialogs from being suppressed.
7547          * @hide
7548          */
7549         @UnsupportedAppUsage
7550         public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
7551 
7552         /**
7553          * If nonzero, crashes in foreground processes will bring up a dialog.
7554          * Otherwise, the process will be silently killed.
7555          * @hide
7556          */
7557         public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION =
7558                 "show_first_crash_dialog_dev_option";
7559 
7560         private static final Validator SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR =
7561                 BOOLEAN_VALIDATOR;
7562 
7563         /**
7564          * The {@link ComponentName} string of the service to be used as the voice recognition
7565          * service.
7566          *
7567          * @hide
7568          */
7569         @UnsupportedAppUsage
7570         public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
7571 
7572         /**
7573          * Stores whether an user has consented to have apps verified through PAM.
7574          * The value is boolean (1 or 0).
7575          *
7576          * @hide
7577          */
7578         @UnsupportedAppUsage
7579         public static final String PACKAGE_VERIFIER_USER_CONSENT =
7580             "package_verifier_user_consent";
7581 
7582         /**
7583          * The {@link ComponentName} string of the selected spell checker service which is
7584          * one of the services managed by the text service manager.
7585          *
7586          * @hide
7587          */
7588         @UnsupportedAppUsage
7589         public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
7590 
7591         /**
7592          * {@link android.view.textservice.SpellCheckerSubtype#hashCode()} of the selected subtype
7593          * of the selected spell checker service which is one of the services managed by the text
7594          * service manager.
7595          *
7596          * @hide
7597          */
7598         @UnsupportedAppUsage
7599         public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
7600                 "selected_spell_checker_subtype";
7601 
7602         /**
7603          * Whether spell checker is enabled or not.
7604          *
7605          * @hide
7606          */
7607         public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
7608 
7609         /**
7610          * What happens when the user presses the Power button while in-call
7611          * and the screen is on.<br/>
7612          * <b>Values:</b><br/>
7613          * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
7614          * 2 - The Power button hangs up the current call.<br/>
7615          *
7616          * @hide
7617          */
7618         @UnsupportedAppUsage
7619         public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
7620 
7621         private static final Validator INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR =
7622                 new SettingsValidators.DiscreteValueValidator(new String[]{"1", "2"});
7623 
7624         /**
7625          * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
7626          * @hide
7627          */
7628         public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
7629 
7630         /**
7631          * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
7632          * @hide
7633          */
7634         public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
7635 
7636         /**
7637          * INCALL_POWER_BUTTON_BEHAVIOR default value.
7638          * @hide
7639          */
7640         public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
7641                 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
7642 
7643         /**
7644          * What happens when the user presses the Back button while in-call
7645          * and the screen is on.<br/>
7646          * <b>Values:</b><br/>
7647          * 0 - The Back buttons does nothing different.<br/>
7648          * 1 - The Back button hangs up the current call.<br/>
7649          *
7650          * @hide
7651          */
7652         public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior";
7653 
7654         /**
7655          * INCALL_BACK_BUTTON_BEHAVIOR value for no action.
7656          * @hide
7657          */
7658         public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0;
7659 
7660         /**
7661          * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up".
7662          * @hide
7663          */
7664         public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1;
7665 
7666         /**
7667          * INCALL_POWER_BUTTON_BEHAVIOR default value.
7668          * @hide
7669          */
7670         public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT =
7671                 INCALL_BACK_BUTTON_BEHAVIOR_NONE;
7672 
7673         /**
7674          * Whether the device should wake when the wake gesture sensor detects motion.
7675          * @hide
7676          */
7677         public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
7678 
7679         private static final Validator WAKE_GESTURE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7680 
7681         /**
7682          * Whether the device should doze if configured.
7683          * @hide
7684          */
7685         @UnsupportedAppUsage
7686         public static final String DOZE_ENABLED = "doze_enabled";
7687 
7688         private static final Validator DOZE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7689 
7690         /**
7691          * Indicates whether doze should be always on.
7692          * <p>
7693          * Type: int (0 for false, 1 for true)
7694          *
7695          * @hide
7696          */
7697         @SystemApi
7698         @TestApi
7699         public static final String DOZE_ALWAYS_ON = "doze_always_on";
7700 
7701         private static final Validator DOZE_ALWAYS_ON_VALIDATOR = BOOLEAN_VALIDATOR;
7702 
7703         /**
7704          * Whether the device should pulse on pick up gesture.
7705          * @hide
7706          */
7707         public static final String DOZE_PICK_UP_GESTURE = "doze_pulse_on_pick_up";
7708 
7709         private static final Validator DOZE_PICK_UP_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR;
7710 
7711         /**
7712          * Whether the device should pulse on long press gesture.
7713          * @hide
7714          */
7715         public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press";
7716 
7717         /**
7718          * Whether the device should pulse on double tap gesture.
7719          * @hide
7720          */
7721         public static final String DOZE_DOUBLE_TAP_GESTURE = "doze_pulse_on_double_tap";
7722 
7723         private static final Validator DOZE_DOUBLE_TAP_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR;
7724 
7725         /**
7726          * Whether the device should respond to the SLPI tap gesture.
7727          * @hide
7728          */
7729         public static final String DOZE_TAP_SCREEN_GESTURE = "doze_tap_gesture";
7730 
7731         private static final Validator DOZE_TAP_SCREEN_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR;
7732 
7733         /**
7734          * Gesture that wakes up the display, showing the ambient version of the status bar.
7735          * @hide
7736          */
7737         public static final String DOZE_WAKE_SCREEN_GESTURE = "doze_wake_screen_gesture";
7738 
7739         private static final Validator DOZE_WAKE_SCREEN_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR;
7740 
7741         /**
7742          * Gesture that skips media.
7743          * @hide
7744          */
7745         public static final String SKIP_GESTURE = "skip_gesture";
7746 
7747         private static final Validator SKIP_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR;
7748 
7749         /**
7750          * Count of successful gestures.
7751          * @hide
7752          */
7753         public static final String SKIP_GESTURE_COUNT = "skip_gesture_count";
7754 
7755         private static final Validator SKIP_GESTURE_COUNT_VALIDATOR =
7756                 NON_NEGATIVE_INTEGER_VALIDATOR;
7757 
7758         /**
7759          * Gesture that silences sound (alarms, notification, calls).
7760          * @hide
7761          */
7762         public static final String SILENCE_GESTURE = "silence_gesture";
7763 
7764         private static final Validator SILENCE_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR;
7765 
7766         /**
7767          * Count of successful silence alarms gestures.
7768          * @hide
7769          */
7770         public static final String SILENCE_ALARMS_GESTURE_COUNT = "silence_alarms_gesture_count";
7771 
7772         /**
7773          * Count of successful silence timer gestures.
7774          * @hide
7775          */
7776         public static final String SILENCE_TIMER_GESTURE_COUNT = "silence_timer_gesture_count";
7777 
7778         /**
7779          * Count of successful silence call gestures.
7780          * @hide
7781          */
7782         public static final String SILENCE_CALL_GESTURE_COUNT = "silence_call_gesture_count";
7783 
7784         /**
7785          * Count of successful silence notification gestures.
7786          * @hide
7787          */
7788         public static final String SILENCE_NOTIFICATION_GESTURE_COUNT =
7789                 "silence_notification_gesture_count";
7790 
7791         private static final Validator SILENCE_GESTURE_COUNT_VALIDATOR =
7792                 NON_NEGATIVE_INTEGER_VALIDATOR;
7793 
7794         /**
7795          * The current night mode that has been selected by the user.  Owned
7796          * and controlled by UiModeManagerService.  Constants are as per
7797          * UiModeManager.
7798          * @hide
7799          */
7800         public static final String UI_NIGHT_MODE = "ui_night_mode";
7801 
7802         private static final Validator UI_NIGHT_MODE_VALIDATOR =
7803                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 2);
7804 
7805         /**
7806          * Whether screensavers are enabled.
7807          * @hide
7808          */
7809         public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
7810 
7811         private static final Validator SCREENSAVER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7812 
7813         /**
7814          * The user's chosen screensaver components.
7815          *
7816          * These will be launched by the PhoneWindowManager after a timeout when not on
7817          * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
7818          * @hide
7819          */
7820         public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
7821 
7822         private static final Validator SCREENSAVER_COMPONENTS_VALIDATOR =
7823                 new SettingsValidators.ComponentNameListValidator(",");
7824 
7825         /**
7826          * If screensavers are enabled, whether the screensaver should be automatically launched
7827          * when the device is inserted into a (desk) dock.
7828          * @hide
7829          */
7830         public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
7831 
7832         private static final Validator SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR = BOOLEAN_VALIDATOR;
7833 
7834         /**
7835          * If screensavers are enabled, whether the screensaver should be automatically launched
7836          * when the screen times out when not on battery.
7837          * @hide
7838          */
7839         public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
7840 
7841         private static final Validator SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR = BOOLEAN_VALIDATOR;
7842 
7843         /**
7844          * If screensavers are enabled, the default screensaver component.
7845          * @hide
7846          */
7847         public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
7848 
7849         /**
7850          * The default NFC payment component
7851          * @hide
7852          */
7853         @UnsupportedAppUsage
7854         public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
7855 
7856         private static final Validator NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR =
7857                 COMPONENT_NAME_VALIDATOR;
7858 
7859         /**
7860          * Whether NFC payment is handled by the foreground application or a default.
7861          * @hide
7862          */
7863         public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
7864 
7865         /**
7866          * Specifies the package name currently configured to be the primary sms application
7867          * @hide
7868          */
7869         @UnsupportedAppUsage
7870         public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
7871 
7872         /**
7873          * Specifies the package name currently configured to be the default dialer application
7874          * @hide
7875          */
7876         @UnsupportedAppUsage
7877         public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
7878 
7879         /**
7880          * Specifies the component name currently configured to be the default call screening
7881          * application
7882          * @hide
7883          */
7884         public static final String CALL_SCREENING_DEFAULT_COMPONENT =
7885                 "call_screening_default_component";
7886 
7887         /**
7888          * Specifies the package name currently configured to be the emergency assistance application
7889          *
7890          * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
7891          *
7892          * @hide
7893          */
7894         public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
7895 
7896         /**
7897          * Specifies whether the current app context on scren (assist data) will be sent to the
7898          * assist application (active voice interaction service).
7899          *
7900          * @hide
7901          */
7902         public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
7903 
7904         /**
7905          * Specifies whether a screenshot of the screen contents will be sent to the assist
7906          * application (active voice interaction service).
7907          *
7908          * @hide
7909          */
7910         public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";
7911 
7912         /**
7913          * Specifies whether the screen will show an animation if screen contents are sent to the
7914          * assist application (active voice interaction service).
7915          *
7916          * Note that the disclosure will be forced for third-party assistants or if the device
7917          * does not support disabling it.
7918          *
7919          * @hide
7920          */
7921         public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled";
7922 
7923         /**
7924          * Control if rotation suggestions are sent to System UI when in rotation locked mode.
7925          * Done to enable screen rotation while the the screen rotation is locked. Enabling will
7926          * poll the accelerometer in rotation locked mode.
7927          *
7928          * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent.
7929          *
7930          * @hide
7931          */
7932 
7933         public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions";
7934 
7935         /**
7936          * The disabled state of SHOW_ROTATION_SUGGESTIONS.
7937          * @hide
7938          */
7939         public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0;
7940 
7941         /**
7942          * The enabled state of SHOW_ROTATION_SUGGESTIONS.
7943          * @hide
7944          */
7945         public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1;
7946 
7947         /**
7948          * The default state of SHOW_ROTATION_SUGGESTIONS.
7949          * @hide
7950          */
7951         public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT =
7952                 SHOW_ROTATION_SUGGESTIONS_ENABLED;
7953 
7954         /**
7955          * The number of accepted rotation suggestions. Used to determine if the user has been
7956          * introduced to rotation suggestions.
7957          * @hide
7958          */
7959         public static final String NUM_ROTATION_SUGGESTIONS_ACCEPTED =
7960                 "num_rotation_suggestions_accepted";
7961 
7962         /**
7963          * Read only list of the service components that the current user has explicitly allowed to
7964          * see and assist with all of the user's notifications.
7965          *
7966          * @deprecated Use
7967          * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}.
7968          * @hide
7969          */
7970         @Deprecated
7971         public static final String ENABLED_NOTIFICATION_ASSISTANT =
7972                 "enabled_notification_assistant";
7973 
7974         private static final Validator ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR =
7975                 new SettingsValidators.ComponentNameListValidator(":");
7976 
7977         /**
7978          * Read only list of the service components that the current user has explicitly allowed to
7979          * see all of the user's notifications, separated by ':'.
7980          *
7981          * @hide
7982          * @deprecated Use
7983          * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}.
7984          */
7985         @Deprecated
7986         @UnsupportedAppUsage
7987         public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
7988 
7989         private static final Validator ENABLED_NOTIFICATION_LISTENERS_VALIDATOR =
7990                 new SettingsValidators.ComponentNameListValidator(":");
7991 
7992         /**
7993          * Read only list of the packages that the current user has explicitly allowed to
7994          * manage do not disturb, separated by ':'.
7995          *
7996          * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}.
7997          * @hide
7998          */
7999         @Deprecated
8000         @TestApi
8001         public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES =
8002                 "enabled_notification_policy_access_packages";
8003 
8004         private static final Validator ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR =
8005                 new SettingsValidators.PackageNameListValidator(":");
8006 
8007         /**
8008          * Defines whether managed profile ringtones should be synced from it's parent profile
8009          * <p>
8010          * 0 = ringtones are not synced
8011          * 1 = ringtones are synced from the profile's parent (default)
8012          * <p>
8013          * This value is only used for managed profiles.
8014          * @hide
8015          */
8016         @TestApi
8017         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
8018         public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds";
8019 
8020         private static final Validator SYNC_PARENT_SOUNDS_VALIDATOR = BOOLEAN_VALIDATOR;
8021 
8022         /** @hide */
8023         @UnsupportedAppUsage
8024         public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
8025 
8026         /**
8027          * This is the query URI for finding a print service to install.
8028          *
8029          * @hide
8030          */
8031         public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
8032 
8033         /**
8034          * This is the query URI for finding a NFC payment service to install.
8035          *
8036          * @hide
8037          */
8038         public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
8039 
8040         /**
8041          * This is the query URI for finding a auto fill service to install.
8042          *
8043          * @hide
8044          */
8045         public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri";
8046 
8047         /**
8048          * If enabled, apps should try to skip any introductory hints on first launch. This might
8049          * apply to users that are already familiar with the environment or temporary users.
8050          * <p>
8051          * Type : int (0 to show hints, 1 to skip showing hints)
8052          */
8053         public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
8054 
8055         /**
8056          * Persisted playback time after a user confirmation of an unsafe volume level.
8057          *
8058          * @hide
8059          */
8060         public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
8061 
8062         /**
8063          * Indicates whether notification display on the lock screen is enabled.
8064          * <p>
8065          * Type: int (0 for false, 1 for true)
8066          *
8067          * @hide
8068          */
8069         @SystemApi
8070         public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
8071                 "lock_screen_show_notifications";
8072 
8073         /**
8074          * Indicates whether the lock screen should display silent notifications.
8075          * <p>
8076          * Type: int (0 for false, 1 for true)
8077          *
8078          * @hide
8079          */
8080         public static final String LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS =
8081                 "lock_screen_show_silent_notifications";
8082 
8083         /**
8084          * Indicates whether snooze options should be shown on notifications
8085          * <p>
8086          * Type: int (0 for false, 1 for true)
8087          *
8088          * @hide
8089          */
8090         public static final String SHOW_NOTIFICATION_SNOOZE = "show_notification_snooze";
8091 
8092         /**
8093          * List of TV inputs that are currently hidden. This is a string
8094          * containing the IDs of all hidden TV inputs. Each ID is encoded by
8095          * {@link android.net.Uri#encode(String)} and separated by ':'.
8096          * @hide
8097          */
8098         public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
8099 
8100         /**
8101          * List of custom TV input labels. This is a string containing <TV input id, custom name>
8102          * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
8103          * and separated by ','. Each pair is separated by ':'.
8104          * @hide
8105          */
8106         public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
8107 
8108         /**
8109          * Whether TV app uses non-system inputs.
8110          *
8111          * <p>
8112          * The value is boolean (1 or 0), where 1 means non-system TV inputs are allowed,
8113          * and 0 means non-system TV inputs are not allowed.
8114          *
8115          * <p>
8116          * Devices such as sound bars may have changed the system property allow_third_party_inputs
8117          * to false so the TV Application only uses HDMI and other built in inputs. This setting
8118          * allows user to override the default and have the TV Application use third party TV inputs
8119          * available on play store.
8120          *
8121          * @hide
8122          */
8123         public static final String TV_APP_USES_NON_SYSTEM_INPUTS = "tv_app_uses_non_system_inputs";
8124 
8125         /**
8126          * Whether automatic routing of system audio to USB audio peripheral is disabled.
8127          * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
8128          * and 0 means automatic routing is enabled.
8129          *
8130          * @hide
8131          */
8132         public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
8133                 "usb_audio_automatic_routing_disabled";
8134 
8135         /**
8136          * The timeout in milliseconds before the device fully goes to sleep after
8137          * a period of inactivity.  This value sets an upper bound on how long the device
8138          * will stay awake or dreaming without user activity.  It should generally
8139          * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
8140          * will sleep before it ever has a chance to dream.
8141          * <p>
8142          * Use -1 to disable this timeout.
8143          * </p>
8144          *
8145          * @hide
8146          */
8147         public static final String SLEEP_TIMEOUT = "sleep_timeout";
8148 
8149         /**
8150          * Controls whether double tap to wake is enabled.
8151          * @hide
8152          */
8153         public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
8154 
8155         private static final Validator DOUBLE_TAP_TO_WAKE_VALIDATOR = BOOLEAN_VALIDATOR;
8156 
8157         /**
8158          * The current assistant component. It could be a voice interaction service,
8159          * or an activity that handles ACTION_ASSIST, or empty which means using the default
8160          * handling.
8161          *
8162          * <p>This should be set indirectly by setting the {@link
8163          * android.app.role.RoleManager#ROLE_ASSISTANT assistant role}.
8164          *
8165          * @hide
8166          */
8167         @UnsupportedAppUsage
8168         public static final String ASSISTANT = "assistant";
8169 
8170         /**
8171          * Whether the camera launch gesture should be disabled.
8172          *
8173          * @hide
8174          */
8175         public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled";
8176 
8177         private static final Validator CAMERA_GESTURE_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8178 
8179         /**
8180          * Whether the camera launch gesture to double tap the power button when the screen is off
8181          * should be disabled.
8182          *
8183          * @hide
8184          */
8185         public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED =
8186                 "camera_double_tap_power_gesture_disabled";
8187 
8188         private static final Validator CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR =
8189                 BOOLEAN_VALIDATOR;
8190 
8191         /**
8192          * Whether the camera double twist gesture to flip between front and back mode should be
8193          * enabled.
8194          *
8195          * @hide
8196          */
8197         public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED =
8198                 "camera_double_twist_to_flip_enabled";
8199 
8200         private static final Validator CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR =
8201                 BOOLEAN_VALIDATOR;
8202 
8203         /**
8204          * Whether or not the smart camera lift trigger that launches the camera when the user moves
8205          * the phone into a position for taking photos should be enabled.
8206          *
8207          * @hide
8208          */
8209         public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled";
8210 
8211         /**
8212          * The default enable state of the camera lift trigger.
8213          *
8214          * @hide
8215          */
8216         public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1;
8217 
8218         /**
8219          * Whether or not the flashlight (camera torch mode) is available required to turn
8220          * on flashlight.
8221          *
8222          * @hide
8223          */
8224         public static final String FLASHLIGHT_AVAILABLE = "flashlight_available";
8225 
8226         /**
8227          * Whether or not flashlight is enabled.
8228          *
8229          * @hide
8230          */
8231         public static final String FLASHLIGHT_ENABLED = "flashlight_enabled";
8232 
8233         /**
8234          * Whether or not face unlock is allowed on Keyguard.
8235          * @hide
8236          */
8237         public static final String FACE_UNLOCK_KEYGUARD_ENABLED = "face_unlock_keyguard_enabled";
8238 
8239         private static final Validator FACE_UNLOCK_KEYGUARD_ENABLED_VALIDATOR =
8240                 BOOLEAN_VALIDATOR;
8241 
8242         /**
8243          * Whether or not face unlock dismisses the keyguard.
8244          * @hide
8245          */
8246         public static final String FACE_UNLOCK_DISMISSES_KEYGUARD =
8247                 "face_unlock_dismisses_keyguard";
8248 
8249         private static final Validator FACE_UNLOCK_DISMISSES_KEYGUARD_VALIDATOR =
8250                 BOOLEAN_VALIDATOR;
8251 
8252         /**
8253          * Whether or not face unlock requires attention. This is a cached value, the source of
8254          * truth is obtained through the HAL.
8255          * @hide
8256          */
8257         public static final String FACE_UNLOCK_ATTENTION_REQUIRED =
8258                 "face_unlock_attention_required";
8259 
8260         /**
8261          * Whether or not face unlock requires a diverse set of poses during enrollment. This is a
8262          * cached value, the source of truth is obtained through the HAL.
8263          * @hide
8264          */
8265         public static final String FACE_UNLOCK_DIVERSITY_REQUIRED =
8266                 "face_unlock_diversity_required";
8267 
8268 
8269         /**
8270          * Whether or not face unlock is allowed for apps (through BiometricPrompt).
8271          * @hide
8272          */
8273         public static final String FACE_UNLOCK_APP_ENABLED = "face_unlock_app_enabled";
8274 
8275         private static final Validator FACE_UNLOCK_APP_ENABLED_VALIDATOR =
8276                 BOOLEAN_VALIDATOR;
8277 
8278         /**
8279          * Whether or not face unlock always requires user confirmation, meaning {@link
8280          * android.hardware.biometrics.BiometricPrompt.Builder#setConfirmationRequired(boolean)}
8281          * is always 'true'. This overrides the behavior that apps choose in the
8282          * setConfirmationRequired API.
8283          * @hide
8284          */
8285         public static final String FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION =
8286                 "face_unlock_always_require_confirmation";
8287 
8288         private static final Validator FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION_VALIDATOR =
8289                 BOOLEAN_VALIDATOR;
8290 
8291         /**
8292          * Whether or not the face unlock education screen has been shown to the user.
8293          * @hide
8294          */
8295         public static final String FACE_UNLOCK_EDUCATION_INFO_DISPLAYED =
8296                 "face_unlock_education_info_displayed";
8297 
8298         private static final Validator FACE_UNLOCK_EDUCATION_INFO_DISPLAYED_VALIDATOR =
8299                 BOOLEAN_VALIDATOR;
8300 
8301         /**
8302          * Whether or not debugging is enabled.
8303          * @hide
8304          */
8305         public static final String BIOMETRIC_DEBUG_ENABLED =
8306                 "biometric_debug_enabled";
8307 
8308         /**
8309          * Whether the assist gesture should be enabled.
8310          *
8311          * @hide
8312          */
8313         public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled";
8314 
8315         private static final Validator ASSIST_GESTURE_ENABLED_VALIDATOR =
8316                 BOOLEAN_VALIDATOR;
8317 
8318         /**
8319          * Sensitivity control for the assist gesture.
8320          *
8321          * @hide
8322          */
8323         public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity";
8324 
8325         /**
8326          * Whether the assist gesture should silence alerts.
8327          *
8328          * @hide
8329          */
8330         public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED =
8331                 "assist_gesture_silence_alerts_enabled";
8332 
8333         private static final Validator ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR =
8334                 BOOLEAN_VALIDATOR;
8335 
8336         /**
8337          * Whether the assist gesture should wake the phone.
8338          *
8339          * @hide
8340          */
8341         public static final String ASSIST_GESTURE_WAKE_ENABLED =
8342                 "assist_gesture_wake_enabled";
8343 
8344         private static final Validator ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR =
8345                 BOOLEAN_VALIDATOR;
8346 
8347         /**
8348          * Indicates whether the Assist Gesture Deferred Setup has been completed.
8349          * <p>
8350          * Type: int (0 for false, 1 for true)
8351          *
8352          * @hide
8353          */
8354         @SystemApi
8355         public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
8356 
8357         /**
8358          * Control whether Trust Agents are in active unlock or extend unlock mode.
8359          * @hide
8360          */
8361         public static final String TRUST_AGENTS_EXTEND_UNLOCK = "trust_agents_extend_unlock";
8362 
8363         private static final Validator TRUST_AGENTS_EXTEND_UNLOCK_VALIDATOR =
8364                 BOOLEAN_VALIDATOR;
8365 
8366         /**
8367          * Control whether the screen locks when trust is lost.
8368          * @hide
8369          */
8370         public static final String LOCK_SCREEN_WHEN_TRUST_LOST = "lock_screen_when_trust_lost";
8371 
8372         private static final Validator LOCK_SCREEN_WHEN_TRUST_LOST_VALIDATOR =
8373                 BOOLEAN_VALIDATOR;
8374 
8375         /**
8376          * Control whether Night display is currently activated.
8377          * @hide
8378          */
8379         public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated";
8380 
8381         /**
8382          * Control whether Night display will automatically activate/deactivate.
8383          * @hide
8384          */
8385         public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode";
8386 
8387         private static final Validator NIGHT_DISPLAY_AUTO_MODE_VALIDATOR =
8388                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 2);
8389 
8390         /**
8391          * Control the color temperature of Night Display, represented in Kelvin.
8392          * @hide
8393          */
8394         public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE =
8395                 "night_display_color_temperature";
8396 
8397         private static final Validator NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR =
8398                 NON_NEGATIVE_INTEGER_VALIDATOR;
8399 
8400         /**
8401          * Custom time when Night display is scheduled to activate.
8402          * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
8403          * @hide
8404          */
8405         public static final String NIGHT_DISPLAY_CUSTOM_START_TIME =
8406                 "night_display_custom_start_time";
8407 
8408         private static final Validator NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR =
8409                 NON_NEGATIVE_INTEGER_VALIDATOR;
8410 
8411         /**
8412          * Custom time when Night display is scheduled to deactivate.
8413          * Represented as milliseconds from midnight (e.g. 21600000 == 6am).
8414          * @hide
8415          */
8416         public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time";
8417 
8418         private static final Validator NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR =
8419                 NON_NEGATIVE_INTEGER_VALIDATOR;
8420 
8421         /**
8422          * A String representing the LocalDateTime when Night display was last activated. Use to
8423          * decide whether to apply the current activated state after a reboot or user change. In
8424          * legacy cases, this is represented by the time in milliseconds (since epoch).
8425          * @hide
8426          */
8427         public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME =
8428                 "night_display_last_activated_time";
8429 
8430         /**
8431          * Control whether display white balance is currently enabled.
8432          * @hide
8433          */
8434         public static final String DISPLAY_WHITE_BALANCE_ENABLED = "display_white_balance_enabled";
8435 
8436         private static final Validator DISPLAY_WHITE_BALANCE_ENABLED_VALIDATOR =
8437                 BOOLEAN_VALIDATOR;
8438 
8439         /**
8440          * Names of the service components that the current user has explicitly allowed to
8441          * be a VR mode listener, separated by ':'.
8442          *
8443          * @hide
8444          */
8445         @TestApi
8446         public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners";
8447 
8448         private static final Validator ENABLED_VR_LISTENERS_VALIDATOR =
8449                 new SettingsValidators.ComponentNameListValidator(":");
8450 
8451         /**
8452          * Behavior of the display while in VR mode.
8453          *
8454          * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}.
8455          *
8456          * @hide
8457          */
8458         public static final String VR_DISPLAY_MODE = "vr_display_mode";
8459 
8460         private static final Validator VR_DISPLAY_MODE_VALIDATOR =
8461                 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1"});
8462 
8463         /**
8464          * Lower the display persistence while the system is in VR mode.
8465          *
8466          * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
8467          *
8468          * @hide.
8469          */
8470         public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0;
8471 
8472         /**
8473          * Do not alter the display persistence while the system is in VR mode.
8474          *
8475          * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
8476          *
8477          * @hide.
8478          */
8479         public static final int VR_DISPLAY_MODE_OFF = 1;
8480 
8481         /**
8482          * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least
8483          * once.
8484          *
8485          * <p>This is used to ensure that we only take one pass which will disable apps that are not
8486          * privileged (if any). From then on, we only want to enable apps (when a matching SIM is
8487          * inserted), to avoid disabling an app that the user might actively be using.
8488          *
8489          * <p>Will be set to 1 once executed.
8490          *
8491          * @hide
8492          */
8493         public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled";
8494 
8495         /**
8496          * Whether parent user can access remote contact in managed profile.
8497          *
8498          * @hide
8499          */
8500         public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH =
8501                 "managed_profile_contact_remote_search";
8502 
8503         /**
8504          * Whether parent profile can access remote calendar data in managed profile.
8505          *
8506          * @hide
8507          */
8508         public static final String CROSS_PROFILE_CALENDAR_ENABLED =
8509                 "cross_profile_calendar_enabled";
8510 
8511         /**
8512          * Whether or not the automatic storage manager is enabled and should run on the device.
8513          *
8514          * @hide
8515          */
8516         public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED =
8517                 "automatic_storage_manager_enabled";
8518 
8519         /**
8520          * How many days of information for the automatic storage manager to retain on the device.
8521          *
8522          * @hide
8523          */
8524         public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN =
8525                 "automatic_storage_manager_days_to_retain";
8526 
8527         private static final Validator AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR =
8528                 NON_NEGATIVE_INTEGER_VALIDATOR;
8529 
8530         /**
8531          * Default number of days of information for the automatic storage manager to retain.
8532          *
8533          * @hide
8534          */
8535         public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90;
8536 
8537         /**
8538          * How many bytes the automatic storage manager has cleared out.
8539          *
8540          * @hide
8541          */
8542         public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED =
8543                 "automatic_storage_manager_bytes_cleared";
8544 
8545 
8546         /**
8547          * Last run time for the automatic storage manager.
8548          *
8549          * @hide
8550          */
8551         public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN =
8552                 "automatic_storage_manager_last_run";
8553 
8554         /**
8555          * If the automatic storage manager has been disabled by policy. Note that this doesn't
8556          * mean that the automatic storage manager is prevented from being re-enabled -- this only
8557          * means that it was turned off by policy at least once.
8558          *
8559          * @hide
8560          */
8561         public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY =
8562                 "automatic_storage_manager_turned_off_by_policy";
8563 
8564         /**
8565          * Whether SystemUI navigation keys is enabled.
8566          * @hide
8567          */
8568         public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
8569                 "system_navigation_keys_enabled";
8570 
8571         private static final Validator SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8572 
8573         /**
8574          * Holds comma separated list of ordering of QS tiles.
8575          * @hide
8576          */
8577         public static final String QS_TILES = "sysui_qs_tiles";
8578 
8579         private static final Validator QS_TILES_VALIDATOR = new Validator() {
8580             @Override
8581             public boolean validate(@Nullable String value) {
8582                 if (value == null) {
8583                     return false;
8584                 }
8585                 String[] tiles = value.split(",");
8586                 boolean valid = true;
8587                 for (String tile : tiles) {
8588                     // tile can be any non-empty string as specified by OEM
8589                     valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile));
8590                 }
8591                 return valid;
8592             }
8593         };
8594 
8595         /**
8596          * Specifies whether the web action API is enabled.
8597          *
8598          * @hide
8599          */
8600         @SystemApi
8601         public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled";
8602 
8603         /**
8604          * Has this pairable device been paired or upgraded from a previously paired system.
8605          * @hide
8606          */
8607         public static final String DEVICE_PAIRED = "device_paired";
8608 
8609         /**
8610          * Integer state indicating whether package verifier is enabled.
8611          * TODO(b/34259924): Remove this setting.
8612          *
8613          * @hide
8614          */
8615         public static final String PACKAGE_VERIFIER_STATE = "package_verifier_state";
8616 
8617         /**
8618          * Specifies additional package name for broadcasting the CMAS messages.
8619          * @hide
8620          */
8621         public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg";
8622 
8623         /**
8624          * Whether the launcher should show any notification badges.
8625          * The value is boolean (1 or 0).
8626          * @hide
8627          */
8628         @TestApi
8629         public static final String NOTIFICATION_BADGING = "notification_badging";
8630 
8631         private static final Validator NOTIFICATION_BADGING_VALIDATOR = BOOLEAN_VALIDATOR;
8632 
8633         /**
8634          * Whether the notification bubbles are globally enabled
8635          * The value is boolean (1 or 0).
8636          * @hide
8637          */
8638         @TestApi
8639         public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
8640 
8641         private static final Validator NOTIFICATION_BUBBLES_VALIDATOR = BOOLEAN_VALIDATOR;
8642 
8643         /**
8644          * Whether notifications are dismissed by a right-to-left swipe (instead of a left-to-right
8645          * swipe).
8646          *
8647          * @hide
8648          */
8649         public static final String NOTIFICATION_DISMISS_RTL = "notification_dismiss_rtl";
8650 
8651         private static final Validator NOTIFICATION_DISMISS_RTL_VALIDATOR = BOOLEAN_VALIDATOR;
8652 
8653         /**
8654          * Comma separated list of QS tiles that have been auto-added already.
8655          * @hide
8656          */
8657         public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles";
8658 
8659         private static final Validator QS_AUTO_ADDED_TILES_VALIDATOR = new Validator() {
8660             @Override
8661             public boolean validate(@Nullable String value) {
8662                 if (value == null) {
8663                     return false;
8664                 }
8665                 String[] tiles = value.split(",");
8666                 boolean valid = true;
8667                 for (String tile : tiles) {
8668                     // tile can be any non-empty string as specified by OEM
8669                     valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile));
8670                 }
8671                 return valid;
8672             }
8673         };
8674 
8675         /**
8676          * Whether the Lockdown button should be shown in the power menu.
8677          * @hide
8678          */
8679         public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu";
8680 
8681         private static final Validator LOCKDOWN_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR;
8682 
8683         /**
8684          * Backup manager behavioral parameters.
8685          * This is encoded as a key=value list, separated by commas. Ex:
8686          *
8687          * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true"
8688          *
8689          * The following keys are supported:
8690          *
8691          * <pre>
8692          * key_value_backup_interval_milliseconds  (long)
8693          * key_value_backup_fuzz_milliseconds      (long)
8694          * key_value_backup_require_charging       (boolean)
8695          * key_value_backup_required_network_type  (int)
8696          * full_backup_interval_milliseconds       (long)
8697          * full_backup_require_charging            (boolean)
8698          * full_backup_required_network_type       (int)
8699          * backup_finished_notification_receivers  (String[])
8700          * </pre>
8701          *
8702          * backup_finished_notification_receivers uses ":" as delimeter for values.
8703          *
8704          * <p>
8705          * Type: string
8706          * @hide
8707          */
8708         public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants";
8709 
8710 
8711         /**
8712          * Local transport parameters so we can configure it for tests.
8713          * This is encoded as a key=value list, separated by commas.
8714          *
8715          * The following keys are supported:
8716          *
8717          * <pre>
8718          * fake_encryption_flag  (boolean)
8719          * </pre>
8720          *
8721          * <p>
8722          * Type: string
8723          * @hide
8724          */
8725         public static final String BACKUP_LOCAL_TRANSPORT_PARAMETERS =
8726                 "backup_local_transport_parameters";
8727 
8728         /**
8729          * Flag to set if the system should predictively attempt to re-enable Bluetooth while
8730          * the user is driving.
8731          * @hide
8732          */
8733         public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving";
8734 
8735         /**
8736          * What behavior should be invoked when the volume hush gesture is triggered
8737          * One of VOLUME_HUSH_OFF, VOLUME_HUSH_VIBRATE, VOLUME_HUSH_MUTE.
8738          *
8739          * @hide
8740          */
8741         @SystemApi
8742         public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture";
8743 
8744         /** @hide */
8745         @SystemApi
8746         public static final int VOLUME_HUSH_OFF = 0;
8747         /** @hide */
8748         @SystemApi
8749         public static final int VOLUME_HUSH_VIBRATE = 1;
8750         /** @hide */
8751         @SystemApi
8752         public static final int VOLUME_HUSH_MUTE = 2;
8753 
8754         private static final Validator VOLUME_HUSH_GESTURE_VALIDATOR =
8755                 NON_NEGATIVE_INTEGER_VALIDATOR;
8756 
8757         /**
8758          * The number of times (integer) the user has manually enabled battery saver.
8759          * @hide
8760          */
8761         public static final String LOW_POWER_MANUAL_ACTIVATION_COUNT =
8762                 "low_power_manual_activation_count";
8763 
8764         /**
8765          * Whether the "first time battery saver warning" dialog needs to be shown (0: default)
8766          * or not (1).
8767          *
8768          * @hide
8769          */
8770         public static final String LOW_POWER_WARNING_ACKNOWLEDGED =
8771                 "low_power_warning_acknowledged";
8772 
8773         /**
8774          * 0 (default) Auto battery saver suggestion has not been suppressed. 1) it has been
8775          * suppressed.
8776          * @hide
8777          */
8778         public static final String SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION =
8779                 "suppress_auto_battery_saver_suggestion";
8780 
8781         /**
8782          * List of packages, which data need to be unconditionally cleared before full restore.
8783          * Type: string
8784          * @hide
8785          */
8786         public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE =
8787                 "packages_to_clear_data_before_full_restore";
8788 
8789         /**
8790          * Setting to determine whether to use the new notification priority handling features.
8791          * @hide
8792          */
8793         public static final String NOTIFICATION_NEW_INTERRUPTION_MODEL = "new_interruption_model";
8794 
8795         /**
8796          * How often to check for location access.
8797          * @hide
8798          */
8799         @SystemApi
8800         @TestApi
8801         public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS =
8802                 "location_access_check_interval_millis";
8803 
8804         /**
8805          * Delay between granting location access and checking it.
8806          * @hide
8807          */
8808         @SystemApi
8809         @TestApi
8810         public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS =
8811                 "location_access_check_delay_millis";
8812 
8813         /**
8814          * What should happen to the location permissions when upgraded to Android Q.
8815          *
8816          * <ul>
8817          *     <li>0/unset == revoke permissions</li>
8818          *     <li>anything else == Don't do anything</li>
8819          * </ul>
8820          *
8821          * @hide
8822          */
8823         @SystemApi
8824         public static final String LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE =
8825                 "location_permissions_upgrade_to_q_mode";
8826 
8827         /**
8828          * Map of android.theme.customization.* categories to the enabled overlay package for that
8829          * category, formatted as a serialized {@link org.json.JSONObject}. If there is no
8830          * corresponding package included for a category, then all overlay packages in that
8831          * category must be disabled.
8832          * @hide
8833          */
8834         @SystemApi
8835         public static final String THEME_CUSTOMIZATION_OVERLAY_PACKAGES =
8836                 "theme_customization_overlay_packages";
8837 
8838         private static final Validator THEME_CUSTOMIZATION_OVERLAY_PACKAGES_VALIDATOR =
8839                 SettingsValidators.JSON_OBJECT_VALIDATOR;
8840 
8841         /**
8842          * Navigation bar mode.
8843          *  0 = 3 button
8844          *  1 = 2 button
8845          *  2 = fully gestural
8846          * @hide
8847          */
8848         public static final String NAVIGATION_MODE =
8849                 "navigation_mode";
8850         private static final Validator NAVIGATION_MODE_VALIDATOR =
8851                 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"});
8852 
8853         /**
8854          * Controls whether aware is enabled.
8855          * @hide
8856          */
8857         public static final String AWARE_ENABLED = "aware_enabled";
8858 
8859         private static final Validator AWARE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8860 
8861         /**
8862          * Controls whether aware_lock is enabled.
8863          * @hide
8864          */
8865         public static final String AWARE_LOCK_ENABLED = "aware_lock_enabled";
8866 
8867         private static final Validator AWARE_LOCK_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8868 
8869         /**
8870          * This are the settings to be backed up.
8871          *
8872          * NOTE: Settings are backed up and restored in the order they appear
8873          *       in this array. If you have one setting depending on another,
8874          *       make sure that they are ordered appropriately.
8875          *
8876          * @hide
8877          */
8878         @UnsupportedAppUsage
8879         public static final String[] SETTINGS_TO_BACKUP = {
8880             BUGREPORT_IN_POWER_MENU,                            // moved to global
8881             ALLOW_MOCK_LOCATION,
8882             USB_MASS_STORAGE_ENABLED,                           // moved to global
8883             ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
8884             ACCESSIBILITY_DISPLAY_DALTONIZER,
8885             ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
8886             ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
8887             ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED,
8888             AUTOFILL_SERVICE,
8889             ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
8890             ENABLED_ACCESSIBILITY_SERVICES,
8891             ENABLED_VR_LISTENERS,
8892             TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
8893             TOUCH_EXPLORATION_ENABLED,
8894             ACCESSIBILITY_ENABLED,
8895             ACCESSIBILITY_SHORTCUT_TARGET_SERVICE,
8896             ACCESSIBILITY_BUTTON_TARGET_COMPONENT,
8897             ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN,
8898             ACCESSIBILITY_SHORTCUT_ENABLED,
8899             ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN,
8900             ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
8901             ACCESSIBILITY_CAPTIONING_PRESET,
8902             ACCESSIBILITY_CAPTIONING_ENABLED,
8903             ACCESSIBILITY_CAPTIONING_LOCALE,
8904             ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
8905             ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
8906             ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
8907             ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
8908             ACCESSIBILITY_CAPTIONING_TYPEFACE,
8909             ACCESSIBILITY_CAPTIONING_FONT_SCALE,
8910             ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
8911             TTS_DEFAULT_RATE,
8912             TTS_DEFAULT_PITCH,
8913             TTS_DEFAULT_SYNTH,
8914             TTS_ENABLED_PLUGINS,
8915             TTS_DEFAULT_LOCALE,
8916             SHOW_IME_WITH_HARD_KEYBOARD,
8917             WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,            // moved to global
8918             WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,               // moved to global
8919             WIFI_NUM_OPEN_NETWORKS_KEPT,                        // moved to global
8920             MOUNT_PLAY_NOTIFICATION_SND,
8921             MOUNT_UMS_AUTOSTART,
8922             MOUNT_UMS_PROMPT,
8923             MOUNT_UMS_NOTIFY_ENABLED,
8924             DOUBLE_TAP_TO_WAKE,
8925             WAKE_GESTURE_ENABLED,
8926             LONG_PRESS_TIMEOUT,
8927             CAMERA_GESTURE_DISABLED,
8928             ACCESSIBILITY_AUTOCLICK_ENABLED,
8929             ACCESSIBILITY_AUTOCLICK_DELAY,
8930             ACCESSIBILITY_LARGE_POINTER_ICON,
8931             PREFERRED_TTY_MODE,
8932             ENHANCED_VOICE_PRIVACY_ENABLED,
8933             TTY_MODE_ENABLED,
8934             RTT_CALLING_MODE,
8935             INCALL_POWER_BUTTON_BEHAVIOR,
8936             NIGHT_DISPLAY_CUSTOM_START_TIME,
8937             NIGHT_DISPLAY_CUSTOM_END_TIME,
8938             NIGHT_DISPLAY_COLOR_TEMPERATURE,
8939             NIGHT_DISPLAY_AUTO_MODE,
8940             DISPLAY_WHITE_BALANCE_ENABLED,
8941             SYNC_PARENT_SOUNDS,
8942             CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
8943             CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
8944             SYSTEM_NAVIGATION_KEYS_ENABLED,
8945             QS_TILES,
8946             DOZE_ENABLED,
8947             DOZE_ALWAYS_ON,
8948             DOZE_PICK_UP_GESTURE,
8949             DOZE_DOUBLE_TAP_GESTURE,
8950             DOZE_TAP_SCREEN_GESTURE,
8951             DOZE_WAKE_SCREEN_GESTURE,
8952             NFC_PAYMENT_DEFAULT_COMPONENT,
8953             AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN,
8954             FACE_UNLOCK_KEYGUARD_ENABLED,
8955             FACE_UNLOCK_DISMISSES_KEYGUARD,
8956             FACE_UNLOCK_APP_ENABLED,
8957             FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION,
8958             ASSIST_GESTURE_ENABLED,
8959             ASSIST_GESTURE_SILENCE_ALERTS_ENABLED,
8960             ASSIST_GESTURE_WAKE_ENABLED,
8961             VR_DISPLAY_MODE,
8962             NOTIFICATION_BADGING,
8963             NOTIFICATION_BUBBLES,
8964             NOTIFICATION_DISMISS_RTL,
8965             QS_AUTO_ADDED_TILES,
8966             SCREENSAVER_ENABLED,
8967             SCREENSAVER_COMPONENTS,
8968             SCREENSAVER_ACTIVATE_ON_DOCK,
8969             SCREENSAVER_ACTIVATE_ON_SLEEP,
8970             LOCKDOWN_IN_POWER_MENU,
8971             SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
8972             VOLUME_HUSH_GESTURE,
8973             MANUAL_RINGER_TOGGLE_COUNT,
8974             HUSH_GESTURE_USED,
8975             IN_CALL_NOTIFICATION_ENABLED,
8976             LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS,
8977             LOCK_SCREEN_CUSTOM_CLOCK_FACE,
8978             LOCK_SCREEN_SHOW_NOTIFICATIONS,
8979             LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS,
8980             SHOW_NOTIFICATION_SNOOZE,
8981             ZEN_DURATION,
8982             SHOW_ZEN_UPGRADE_NOTIFICATION,
8983             SHOW_ZEN_SETTINGS_SUGGESTION,
8984             ZEN_SETTINGS_UPDATED,
8985             ZEN_SETTINGS_SUGGESTION_VIEWED,
8986             CHARGING_SOUNDS_ENABLED,
8987             CHARGING_VIBRATION_ENABLED,
8988             ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS,
8989             ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS,
8990             NOTIFICATION_NEW_INTERRUPTION_MODEL,
8991             TRUST_AGENTS_EXTEND_UNLOCK,
8992             UI_NIGHT_MODE,
8993             LOCK_SCREEN_WHEN_TRUST_LOST,
8994             SKIP_GESTURE,
8995             SILENCE_GESTURE,
8996             THEME_CUSTOMIZATION_OVERLAY_PACKAGES,
8997             NAVIGATION_MODE,
8998             AWARE_ENABLED,
8999             SKIP_GESTURE_COUNT,
9000             SILENCE_ALARMS_GESTURE_COUNT,
9001             SILENCE_NOTIFICATION_GESTURE_COUNT,
9002             SILENCE_CALL_GESTURE_COUNT,
9003             SILENCE_TIMER_GESTURE_COUNT,
9004             DARK_MODE_DIALOG_SEEN,
9005             GLOBAL_ACTIONS_PANEL_ENABLED,
9006             AWARE_LOCK_ENABLED
9007         };
9008 
9009         /**
9010          * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator,
9011          * otherwise they won't be restored.
9012          *
9013          * @hide
9014          */
9015         public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
9016         static {
VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR)9017             VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR);
VALIDATORS.put(ALLOW_MOCK_LOCATION, ALLOW_MOCK_LOCATION_VALIDATOR)9018             VALIDATORS.put(ALLOW_MOCK_LOCATION, ALLOW_MOCK_LOCATION_VALIDATOR);
VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR)9019             VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR)9020             VALIDATORS.put(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
9021                     ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER, ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR)9022             VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER,
9023                     ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR)9024             VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
9025                     ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR)9026             VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
9027                     ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR)9028             VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED,
9029                     ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR);
VALIDATORS.put(AUTOFILL_SERVICE, AUTOFILL_SERVICE_VALIDATOR)9030             VALIDATORS.put(AUTOFILL_SERVICE, AUTOFILL_SERVICE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR)9031             VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
9032                     ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR);
VALIDATORS.put(ENABLED_ACCESSIBILITY_SERVICES, ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR)9033             VALIDATORS.put(ENABLED_ACCESSIBILITY_SERVICES,
9034                     ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR);
VALIDATORS.put(ENABLED_VR_LISTENERS, ENABLED_VR_LISTENERS_VALIDATOR)9035             VALIDATORS.put(ENABLED_VR_LISTENERS, ENABLED_VR_LISTENERS_VALIDATOR);
VALIDATORS.put(TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES, TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR)9036             VALIDATORS.put(TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
9037                     TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR);
VALIDATORS.put(TOUCH_EXPLORATION_ENABLED, TOUCH_EXPLORATION_ENABLED_VALIDATOR)9038             VALIDATORS.put(TOUCH_EXPLORATION_ENABLED, TOUCH_EXPLORATION_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_ENABLED, ACCESSIBILITY_ENABLED_VALIDATOR)9039             VALIDATORS.put(ACCESSIBILITY_ENABLED, ACCESSIBILITY_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR)9040             VALIDATORS.put(ACCESSIBILITY_SHORTCUT_TARGET_SERVICE,
9041                     ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_BUTTON_TARGET_COMPONENT, ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR)9042             VALIDATORS.put(ACCESSIBILITY_BUTTON_TARGET_COMPONENT,
9043                     ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR)9044             VALIDATORS.put(ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN,
9045                     ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ENABLED, ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR)9046             VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ENABLED,
9047                     ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN, ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR)9048             VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN,
9049                     ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR)9050             VALIDATORS.put(ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
9051                     ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_PRESET, ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR)9052             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_PRESET,
9053                     ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_ENABLED, ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR)9054             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_ENABLED,
9055                     ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_LOCALE, ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR)9056             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_LOCALE,
9057                     ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR, ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR)9058             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
9059                     ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR, ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR)9060             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
9061                     ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_TYPE, ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR)9062             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
9063                     ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_COLOR, ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR)9064             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
9065                     ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_TYPEFACE, ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR)9066             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_TYPEFACE,
9067                     ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FONT_SCALE, ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR)9068             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FONT_SCALE,
9069                     ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR)9070             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
9071                     ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR);
VALIDATORS.put(TTS_DEFAULT_RATE, TTS_DEFAULT_RATE_VALIDATOR)9072             VALIDATORS.put(TTS_DEFAULT_RATE, TTS_DEFAULT_RATE_VALIDATOR);
VALIDATORS.put(TTS_DEFAULT_PITCH, TTS_DEFAULT_PITCH_VALIDATOR)9073             VALIDATORS.put(TTS_DEFAULT_PITCH, TTS_DEFAULT_PITCH_VALIDATOR);
VALIDATORS.put(TTS_DEFAULT_SYNTH, TTS_DEFAULT_SYNTH_VALIDATOR)9074             VALIDATORS.put(TTS_DEFAULT_SYNTH, TTS_DEFAULT_SYNTH_VALIDATOR);
VALIDATORS.put(TTS_ENABLED_PLUGINS, TTS_ENABLED_PLUGINS_VALIDATOR)9075             VALIDATORS.put(TTS_ENABLED_PLUGINS, TTS_ENABLED_PLUGINS_VALIDATOR);
VALIDATORS.put(TTS_DEFAULT_LOCALE, TTS_DEFAULT_LOCALE_VALIDATOR)9076             VALIDATORS.put(TTS_DEFAULT_LOCALE, TTS_DEFAULT_LOCALE_VALIDATOR);
VALIDATORS.put(SHOW_IME_WITH_HARD_KEYBOARD, SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR)9077             VALIDATORS.put(SHOW_IME_WITH_HARD_KEYBOARD, SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR);
VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR)9078             VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
9079                     WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR)9080             VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
9081                     WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR);
VALIDATORS.put(WIFI_NUM_OPEN_NETWORKS_KEPT, WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR)9082             VALIDATORS.put(WIFI_NUM_OPEN_NETWORKS_KEPT, WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR);
VALIDATORS.put(MOUNT_PLAY_NOTIFICATION_SND, MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR)9083             VALIDATORS.put(MOUNT_PLAY_NOTIFICATION_SND, MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR);
VALIDATORS.put(MOUNT_UMS_AUTOSTART, MOUNT_UMS_AUTOSTART_VALIDATOR)9084             VALIDATORS.put(MOUNT_UMS_AUTOSTART, MOUNT_UMS_AUTOSTART_VALIDATOR);
VALIDATORS.put(MOUNT_UMS_PROMPT, MOUNT_UMS_PROMPT_VALIDATOR)9085             VALIDATORS.put(MOUNT_UMS_PROMPT, MOUNT_UMS_PROMPT_VALIDATOR);
VALIDATORS.put(MOUNT_UMS_NOTIFY_ENABLED, MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR)9086             VALIDATORS.put(MOUNT_UMS_NOTIFY_ENABLED, MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR);
VALIDATORS.put(DOUBLE_TAP_TO_WAKE, DOUBLE_TAP_TO_WAKE_VALIDATOR)9087             VALIDATORS.put(DOUBLE_TAP_TO_WAKE, DOUBLE_TAP_TO_WAKE_VALIDATOR);
VALIDATORS.put(WAKE_GESTURE_ENABLED, WAKE_GESTURE_ENABLED_VALIDATOR)9088             VALIDATORS.put(WAKE_GESTURE_ENABLED, WAKE_GESTURE_ENABLED_VALIDATOR);
VALIDATORS.put(LONG_PRESS_TIMEOUT, LONG_PRESS_TIMEOUT_VALIDATOR)9089             VALIDATORS.put(LONG_PRESS_TIMEOUT, LONG_PRESS_TIMEOUT_VALIDATOR);
VALIDATORS.put(CAMERA_GESTURE_DISABLED, CAMERA_GESTURE_DISABLED_VALIDATOR)9090             VALIDATORS.put(CAMERA_GESTURE_DISABLED, CAMERA_GESTURE_DISABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_ENABLED, ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR)9091             VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_ENABLED,
9092                     ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_DELAY, ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR)9093             VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_DELAY, ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_LARGE_POINTER_ICON, ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR)9094             VALIDATORS.put(ACCESSIBILITY_LARGE_POINTER_ICON,
9095                     ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR);
VALIDATORS.put(PREFERRED_TTY_MODE, PREFERRED_TTY_MODE_VALIDATOR)9096             VALIDATORS.put(PREFERRED_TTY_MODE, PREFERRED_TTY_MODE_VALIDATOR);
VALIDATORS.put(ENHANCED_VOICE_PRIVACY_ENABLED, ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR)9097             VALIDATORS.put(ENHANCED_VOICE_PRIVACY_ENABLED,
9098                     ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR);
VALIDATORS.put(TTY_MODE_ENABLED, TTY_MODE_ENABLED_VALIDATOR)9099             VALIDATORS.put(TTY_MODE_ENABLED, TTY_MODE_ENABLED_VALIDATOR);
VALIDATORS.put(RTT_CALLING_MODE, RTT_CALLING_MODE_VALIDATOR)9100             VALIDATORS.put(RTT_CALLING_MODE, RTT_CALLING_MODE_VALIDATOR);
VALIDATORS.put(INCALL_POWER_BUTTON_BEHAVIOR, INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR)9101             VALIDATORS.put(INCALL_POWER_BUTTON_BEHAVIOR, INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR);
VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_START_TIME, NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR)9102             VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_START_TIME,
9103                     NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR);
VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_END_TIME, NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR)9104             VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_END_TIME, NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR);
VALIDATORS.put(NIGHT_DISPLAY_COLOR_TEMPERATURE, NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR)9105             VALIDATORS.put(NIGHT_DISPLAY_COLOR_TEMPERATURE,
9106                     NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR);
VALIDATORS.put(NIGHT_DISPLAY_AUTO_MODE, NIGHT_DISPLAY_AUTO_MODE_VALIDATOR)9107             VALIDATORS.put(NIGHT_DISPLAY_AUTO_MODE, NIGHT_DISPLAY_AUTO_MODE_VALIDATOR);
VALIDATORS.put(DISPLAY_WHITE_BALANCE_ENABLED, DISPLAY_WHITE_BALANCE_ENABLED_VALIDATOR)9108             VALIDATORS.put(DISPLAY_WHITE_BALANCE_ENABLED, DISPLAY_WHITE_BALANCE_ENABLED_VALIDATOR);
VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR)9109             VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR);
VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR)9110             VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
9111                     CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR);
VALIDATORS.put(CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR)9112             VALIDATORS.put(CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
9113                     CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR);
VALIDATORS.put(SYSTEM_NAVIGATION_KEYS_ENABLED, SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR)9114             VALIDATORS.put(SYSTEM_NAVIGATION_KEYS_ENABLED,
9115                     SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR);
VALIDATORS.put(QS_TILES, QS_TILES_VALIDATOR)9116             VALIDATORS.put(QS_TILES, QS_TILES_VALIDATOR);
VALIDATORS.put(DOZE_ENABLED, DOZE_ENABLED_VALIDATOR)9117             VALIDATORS.put(DOZE_ENABLED, DOZE_ENABLED_VALIDATOR);
VALIDATORS.put(DOZE_ALWAYS_ON, DOZE_ALWAYS_ON_VALIDATOR)9118             VALIDATORS.put(DOZE_ALWAYS_ON, DOZE_ALWAYS_ON_VALIDATOR);
VALIDATORS.put(DOZE_PICK_UP_GESTURE, DOZE_PICK_UP_GESTURE_VALIDATOR)9119             VALIDATORS.put(DOZE_PICK_UP_GESTURE, DOZE_PICK_UP_GESTURE_VALIDATOR);
VALIDATORS.put(DOZE_DOUBLE_TAP_GESTURE, DOZE_DOUBLE_TAP_GESTURE_VALIDATOR)9120             VALIDATORS.put(DOZE_DOUBLE_TAP_GESTURE, DOZE_DOUBLE_TAP_GESTURE_VALIDATOR);
VALIDATORS.put(DOZE_TAP_SCREEN_GESTURE, DOZE_TAP_SCREEN_GESTURE_VALIDATOR)9121             VALIDATORS.put(DOZE_TAP_SCREEN_GESTURE, DOZE_TAP_SCREEN_GESTURE_VALIDATOR);
VALIDATORS.put(DOZE_WAKE_SCREEN_GESTURE, DOZE_WAKE_SCREEN_GESTURE_VALIDATOR)9122             VALIDATORS.put(DOZE_WAKE_SCREEN_GESTURE, DOZE_WAKE_SCREEN_GESTURE_VALIDATOR);
VALIDATORS.put(NFC_PAYMENT_DEFAULT_COMPONENT, NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR)9123             VALIDATORS.put(NFC_PAYMENT_DEFAULT_COMPONENT, NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR);
VALIDATORS.put(AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN, AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR)9124             VALIDATORS.put(AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN,
9125                     AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR);
VALIDATORS.put(FACE_UNLOCK_KEYGUARD_ENABLED, FACE_UNLOCK_KEYGUARD_ENABLED_VALIDATOR)9126             VALIDATORS.put(FACE_UNLOCK_KEYGUARD_ENABLED, FACE_UNLOCK_KEYGUARD_ENABLED_VALIDATOR);
VALIDATORS.put(FACE_UNLOCK_DISMISSES_KEYGUARD, FACE_UNLOCK_DISMISSES_KEYGUARD_VALIDATOR)9127             VALIDATORS.put(FACE_UNLOCK_DISMISSES_KEYGUARD,
9128                     FACE_UNLOCK_DISMISSES_KEYGUARD_VALIDATOR);
VALIDATORS.put(FACE_UNLOCK_APP_ENABLED, FACE_UNLOCK_APP_ENABLED_VALIDATOR)9129             VALIDATORS.put(FACE_UNLOCK_APP_ENABLED, FACE_UNLOCK_APP_ENABLED_VALIDATOR);
VALIDATORS.put(FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION, FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION_VALIDATOR)9130             VALIDATORS.put(FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION,
9131                     FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION_VALIDATOR);
VALIDATORS.put(FACE_UNLOCK_EDUCATION_INFO_DISPLAYED, FACE_UNLOCK_EDUCATION_INFO_DISPLAYED_VALIDATOR)9132             VALIDATORS.put(FACE_UNLOCK_EDUCATION_INFO_DISPLAYED,
9133                     FACE_UNLOCK_EDUCATION_INFO_DISPLAYED_VALIDATOR);
VALIDATORS.put(ASSIST_GESTURE_ENABLED, ASSIST_GESTURE_ENABLED_VALIDATOR)9134             VALIDATORS.put(ASSIST_GESTURE_ENABLED, ASSIST_GESTURE_ENABLED_VALIDATOR);
VALIDATORS.put(ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR)9135             VALIDATORS.put(ASSIST_GESTURE_SILENCE_ALERTS_ENABLED,
9136                     ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR);
VALIDATORS.put(ASSIST_GESTURE_WAKE_ENABLED, ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR)9137             VALIDATORS.put(ASSIST_GESTURE_WAKE_ENABLED, ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR);
VALIDATORS.put(VR_DISPLAY_MODE, VR_DISPLAY_MODE_VALIDATOR)9138             VALIDATORS.put(VR_DISPLAY_MODE, VR_DISPLAY_MODE_VALIDATOR);
VALIDATORS.put(NOTIFICATION_BADGING, NOTIFICATION_BADGING_VALIDATOR)9139             VALIDATORS.put(NOTIFICATION_BADGING, NOTIFICATION_BADGING_VALIDATOR);
VALIDATORS.put(NOTIFICATION_BUBBLES, NOTIFICATION_BUBBLES_VALIDATOR)9140             VALIDATORS.put(NOTIFICATION_BUBBLES, NOTIFICATION_BUBBLES_VALIDATOR);
VALIDATORS.put(NOTIFICATION_DISMISS_RTL, NOTIFICATION_DISMISS_RTL_VALIDATOR)9141             VALIDATORS.put(NOTIFICATION_DISMISS_RTL, NOTIFICATION_DISMISS_RTL_VALIDATOR);
VALIDATORS.put(QS_AUTO_ADDED_TILES, QS_AUTO_ADDED_TILES_VALIDATOR)9142             VALIDATORS.put(QS_AUTO_ADDED_TILES, QS_AUTO_ADDED_TILES_VALIDATOR);
VALIDATORS.put(SCREENSAVER_ENABLED, SCREENSAVER_ENABLED_VALIDATOR)9143             VALIDATORS.put(SCREENSAVER_ENABLED, SCREENSAVER_ENABLED_VALIDATOR);
VALIDATORS.put(SCREENSAVER_COMPONENTS, SCREENSAVER_COMPONENTS_VALIDATOR)9144             VALIDATORS.put(SCREENSAVER_COMPONENTS, SCREENSAVER_COMPONENTS_VALIDATOR);
VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_DOCK, SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR)9145             VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_DOCK, SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR);
VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_SLEEP, SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR)9146             VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_SLEEP, SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR);
VALIDATORS.put(LOCKDOWN_IN_POWER_MENU, LOCKDOWN_IN_POWER_MENU_VALIDATOR)9147             VALIDATORS.put(LOCKDOWN_IN_POWER_MENU, LOCKDOWN_IN_POWER_MENU_VALIDATOR);
VALIDATORS.put(SHOW_FIRST_CRASH_DIALOG_DEV_OPTION, SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR)9148             VALIDATORS.put(SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
9149                     SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR);
VALIDATORS.put(VOLUME_HUSH_GESTURE, VOLUME_HUSH_GESTURE_VALIDATOR)9150             VALIDATORS.put(VOLUME_HUSH_GESTURE, VOLUME_HUSH_GESTURE_VALIDATOR);
VALIDATORS.put(ENABLED_NOTIFICATION_LISTENERS, ENABLED_NOTIFICATION_LISTENERS_VALIDATOR)9151             VALIDATORS.put(ENABLED_NOTIFICATION_LISTENERS,
9152                     ENABLED_NOTIFICATION_LISTENERS_VALIDATOR); //legacy restore setting
VALIDATORS.put(ENABLED_NOTIFICATION_ASSISTANT, ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR)9153             VALIDATORS.put(ENABLED_NOTIFICATION_ASSISTANT,
9154                     ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR); //legacy restore setting
VALIDATORS.put(ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES, ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR)9155             VALIDATORS.put(ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES,
9156                     ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR); //legacy restore setting
VALIDATORS.put(HUSH_GESTURE_USED, HUSH_GESTURE_USED_VALIDATOR)9157             VALIDATORS.put(HUSH_GESTURE_USED, HUSH_GESTURE_USED_VALIDATOR);
VALIDATORS.put(MANUAL_RINGER_TOGGLE_COUNT, MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR)9158             VALIDATORS.put(MANUAL_RINGER_TOGGLE_COUNT, MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR);
VALIDATORS.put(IN_CALL_NOTIFICATION_ENABLED, IN_CALL_NOTIFICATION_ENABLED_VALIDATOR)9159             VALIDATORS.put(IN_CALL_NOTIFICATION_ENABLED, IN_CALL_NOTIFICATION_ENABLED_VALIDATOR);
VALIDATORS.put(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, BOOLEAN_VALIDATOR)9160             VALIDATORS.put(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, BOOLEAN_VALIDATOR);
VALIDATORS.put(LOCK_SCREEN_SHOW_NOTIFICATIONS, BOOLEAN_VALIDATOR)9161             VALIDATORS.put(LOCK_SCREEN_SHOW_NOTIFICATIONS, BOOLEAN_VALIDATOR);
VALIDATORS.put(LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, BOOLEAN_VALIDATOR)9162             VALIDATORS.put(LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, BOOLEAN_VALIDATOR);
VALIDATORS.put(SHOW_NOTIFICATION_SNOOZE, BOOLEAN_VALIDATOR)9163             VALIDATORS.put(SHOW_NOTIFICATION_SNOOZE, BOOLEAN_VALIDATOR);
VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR)9164             VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR);
VALIDATORS.put(SHOW_ZEN_UPGRADE_NOTIFICATION, BOOLEAN_VALIDATOR)9165             VALIDATORS.put(SHOW_ZEN_UPGRADE_NOTIFICATION, BOOLEAN_VALIDATOR);
VALIDATORS.put(SHOW_ZEN_SETTINGS_SUGGESTION, BOOLEAN_VALIDATOR)9166             VALIDATORS.put(SHOW_ZEN_SETTINGS_SUGGESTION, BOOLEAN_VALIDATOR);
VALIDATORS.put(ZEN_SETTINGS_UPDATED, BOOLEAN_VALIDATOR)9167             VALIDATORS.put(ZEN_SETTINGS_UPDATED, BOOLEAN_VALIDATOR);
VALIDATORS.put(ZEN_SETTINGS_SUGGESTION_VIEWED, BOOLEAN_VALIDATOR)9168             VALIDATORS.put(ZEN_SETTINGS_SUGGESTION_VIEWED, BOOLEAN_VALIDATOR);
VALIDATORS.put(CHARGING_SOUNDS_ENABLED, BOOLEAN_VALIDATOR)9169             VALIDATORS.put(CHARGING_SOUNDS_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(CHARGING_VIBRATION_ENABLED, BOOLEAN_VALIDATOR)9170             VALIDATORS.put(CHARGING_VIBRATION_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS, NON_NEGATIVE_INTEGER_VALIDATOR)9171             VALIDATORS.put(ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS,
9172                     NON_NEGATIVE_INTEGER_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS, NON_NEGATIVE_INTEGER_VALIDATOR)9173             VALIDATORS.put(ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS, NON_NEGATIVE_INTEGER_VALIDATOR);
VALIDATORS.put(USER_SETUP_COMPLETE, BOOLEAN_VALIDATOR)9174             VALIDATORS.put(USER_SETUP_COMPLETE, BOOLEAN_VALIDATOR);
VALIDATORS.put(ASSIST_GESTURE_SETUP_COMPLETE, BOOLEAN_VALIDATOR)9175             VALIDATORS.put(ASSIST_GESTURE_SETUP_COMPLETE, BOOLEAN_VALIDATOR);
VALIDATORS.put(NOTIFICATION_NEW_INTERRUPTION_MODEL, BOOLEAN_VALIDATOR)9176             VALIDATORS.put(NOTIFICATION_NEW_INTERRUPTION_MODEL, BOOLEAN_VALIDATOR);
VALIDATORS.put(TRUST_AGENTS_EXTEND_UNLOCK, TRUST_AGENTS_EXTEND_UNLOCK_VALIDATOR)9177             VALIDATORS.put(TRUST_AGENTS_EXTEND_UNLOCK, TRUST_AGENTS_EXTEND_UNLOCK_VALIDATOR);
VALIDATORS.put(LOCK_SCREEN_CUSTOM_CLOCK_FACE, LOCK_SCREEN_CUSTOM_CLOCK_FACE_VALIDATOR)9178             VALIDATORS.put(LOCK_SCREEN_CUSTOM_CLOCK_FACE, LOCK_SCREEN_CUSTOM_CLOCK_FACE_VALIDATOR);
VALIDATORS.put(LOCK_SCREEN_WHEN_TRUST_LOST, LOCK_SCREEN_WHEN_TRUST_LOST_VALIDATOR)9179             VALIDATORS.put(LOCK_SCREEN_WHEN_TRUST_LOST, LOCK_SCREEN_WHEN_TRUST_LOST_VALIDATOR);
VALIDATORS.put(SKIP_GESTURE, SKIP_GESTURE_VALIDATOR)9180             VALIDATORS.put(SKIP_GESTURE, SKIP_GESTURE_VALIDATOR);
VALIDATORS.put(SILENCE_GESTURE, SILENCE_GESTURE_VALIDATOR)9181             VALIDATORS.put(SILENCE_GESTURE, SILENCE_GESTURE_VALIDATOR);
VALIDATORS.put(THEME_CUSTOMIZATION_OVERLAY_PACKAGES, THEME_CUSTOMIZATION_OVERLAY_PACKAGES_VALIDATOR)9182             VALIDATORS.put(THEME_CUSTOMIZATION_OVERLAY_PACKAGES,
9183                     THEME_CUSTOMIZATION_OVERLAY_PACKAGES_VALIDATOR);
VALIDATORS.put(NAVIGATION_MODE, NAVIGATION_MODE_VALIDATOR)9184             VALIDATORS.put(NAVIGATION_MODE, NAVIGATION_MODE_VALIDATOR);
VALIDATORS.put(AWARE_ENABLED, AWARE_ENABLED_VALIDATOR)9185             VALIDATORS.put(AWARE_ENABLED, AWARE_ENABLED_VALIDATOR);
VALIDATORS.put(SKIP_GESTURE_COUNT, SKIP_GESTURE_COUNT_VALIDATOR)9186             VALIDATORS.put(SKIP_GESTURE_COUNT, SKIP_GESTURE_COUNT_VALIDATOR);
VALIDATORS.put(SILENCE_ALARMS_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR)9187             VALIDATORS.put(SILENCE_ALARMS_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
VALIDATORS.put(SILENCE_TIMER_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR)9188             VALIDATORS.put(SILENCE_TIMER_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
VALIDATORS.put(SILENCE_CALL_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR)9189             VALIDATORS.put(SILENCE_CALL_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
VALIDATORS.put(SILENCE_NOTIFICATION_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR)9190             VALIDATORS.put(SILENCE_NOTIFICATION_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
VALIDATORS.put(ODI_CAPTIONS_ENABLED, ODI_CAPTIONS_ENABLED_VALIDATOR)9191             VALIDATORS.put(ODI_CAPTIONS_ENABLED, ODI_CAPTIONS_ENABLED_VALIDATOR);
VALIDATORS.put(DARK_MODE_DIALOG_SEEN, BOOLEAN_VALIDATOR)9192             VALIDATORS.put(DARK_MODE_DIALOG_SEEN, BOOLEAN_VALIDATOR);
VALIDATORS.put(UI_NIGHT_MODE, UI_NIGHT_MODE_VALIDATOR)9193             VALIDATORS.put(UI_NIGHT_MODE, UI_NIGHT_MODE_VALIDATOR);
VALIDATORS.put(GLOBAL_ACTIONS_PANEL_ENABLED, GLOBAL_ACTIONS_PANEL_ENABLED_VALIDATOR)9194             VALIDATORS.put(GLOBAL_ACTIONS_PANEL_ENABLED, GLOBAL_ACTIONS_PANEL_ENABLED_VALIDATOR);
VALIDATORS.put(AWARE_LOCK_ENABLED, AWARE_LOCK_ENABLED_VALIDATOR)9195             VALIDATORS.put(AWARE_LOCK_ENABLED, AWARE_LOCK_ENABLED_VALIDATOR);
9196         }
9197 
9198         /**
9199          * Keys we no longer back up under the current schema, but want to continue to
9200          * process when restoring historical backup datasets.
9201          *
9202          * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
9203          * otherwise they won't be restored.
9204          *
9205          * @hide
9206          */
9207         public static final String[] LEGACY_RESTORE_SETTINGS = {
9208                 ENABLED_NOTIFICATION_LISTENERS,
9209                 ENABLED_NOTIFICATION_ASSISTANT,
9210                 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES
9211         };
9212 
9213         /**
9214          * These entries are considered common between the personal and the managed profile,
9215          * since the managed profile doesn't get to change them.
9216          */
9217         private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
9218 
9219         static {
9220             CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
9221             CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
9222             CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
9223             CLONE_TO_MANAGED_PROFILE.add(CONTENT_CAPTURE_ENABLED);
9224             CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
9225             CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER);
9226             CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
9227             CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
9228             CLONE_TO_MANAGED_PROFILE.add(SHOW_IME_WITH_HARD_KEYBOARD);
9229             if (!InputMethodSystemProperty.PER_PROFILE_IME_ENABLED) {
9230                 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
9231                 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
9232                 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
9233                 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
9234                 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
9235             }
9236         }
9237 
9238         /** @hide */
getCloneToManagedProfileSettings(Set<String> outKeySet)9239         public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
9240             outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
9241         }
9242 
9243         /**
9244          * Secure settings which can be accessed by instant apps.
9245          * @hide
9246          */
9247         public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
9248         static {
9249             INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES);
9250             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD);
9251             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED);
9252             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED);
9253             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET);
9254             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE);
9255             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR);
9256             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE);
9257             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR);
9258             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR);
9259             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE);
9260             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE);
9261             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR);
9262             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED);
9263             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER);
9264             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY);
9265             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED);
9266             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON);
9267 
9268             INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD);
9269             INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS);
9270 
9271             INSTANT_APP_SETTINGS.add(ANDROID_ID);
9272 
9273             INSTANT_APP_SETTINGS.add(PACKAGE_VERIFIER_USER_CONSENT);
9274             INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION);
9275         }
9276 
9277         /**
9278          * Helper method for determining if a location provider is enabled.
9279          *
9280          * @param cr the content resolver to use
9281          * @param provider the location provider to query
9282          * @return true if the provider is enabled
9283          *
9284          * @deprecated use {@link LocationManager#isProviderEnabled(String)}
9285          */
9286         @Deprecated
isLocationProviderEnabled(ContentResolver cr, String provider)9287         public static boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
9288             String allowedProviders = Settings.Secure.getStringForUser(cr,
9289                     LOCATION_PROVIDERS_ALLOWED, cr.getUserId());
9290             return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
9291         }
9292 
9293         /**
9294          * Thread-safe method for enabling or disabling a single location provider. This will have
9295          * no effect on Android Q and above.
9296          * @param cr the content resolver to use
9297          * @param provider the location provider to enable or disable
9298          * @param enabled true if the provider should be enabled
9299          * @deprecated This API is deprecated
9300          */
9301         @Deprecated
setLocationProviderEnabled(ContentResolver cr, String provider, boolean enabled)9302         public static void setLocationProviderEnabled(ContentResolver cr,
9303                 String provider, boolean enabled) {
9304         }
9305     }
9306 
9307     /**
9308      * Global system settings, containing preferences that always apply identically
9309      * to all defined users.  Applications can read these but are not allowed to write;
9310      * like the "Secure" settings, these are for preferences that the user must
9311      * explicitly modify through the system UI or specialized APIs for those values.
9312      */
9313     public static final class Global extends NameValueTable {
9314         // NOTE: If you add new settings here, be sure to add them to
9315         // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked.
9316 
9317         /**
9318          * The content:// style URL for global secure settings items.  Not public.
9319          */
9320         public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
9321 
9322         /**
9323          * Whether users are allowed to add more users or guest from lockscreen.
9324          * <p>
9325          * Type: int
9326          * @hide
9327          */
9328         public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
9329 
9330         /**
9331          * Whether applying ramping ringer on incoming phone call ringtone.
9332          * <p>1 = apply ramping ringer
9333          * <p>0 = do not apply ramping ringer
9334          */
9335         public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer";
9336 
9337         private static final Validator APPLY_RAMPING_RINGER_VALIDATOR = BOOLEAN_VALIDATOR;
9338 
9339         /**
9340          * Setting whether the global gesture for enabling accessibility is enabled.
9341          * If this gesture is enabled the user will be able to perfrom it to enable
9342          * the accessibility state without visiting the settings app.
9343          *
9344          * @hide
9345          * No longer used. Should be removed once all dependencies have been updated.
9346          */
9347         @UnsupportedAppUsage
9348         public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
9349                 "enable_accessibility_global_gesture_enabled";
9350 
9351         /**
9352          * Whether Airplane Mode is on.
9353          */
9354         public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
9355 
9356         /**
9357          * Whether Theater Mode is on.
9358          * {@hide}
9359          */
9360         @SystemApi
9361         public static final String THEATER_MODE_ON = "theater_mode_on";
9362 
9363         /**
9364          * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
9365          */
9366         public static final String RADIO_BLUETOOTH = "bluetooth";
9367 
9368         /**
9369          * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
9370          */
9371         public static final String RADIO_WIFI = "wifi";
9372 
9373         /**
9374          * {@hide}
9375          */
9376         public static final String RADIO_WIMAX = "wimax";
9377         /**
9378          * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
9379          */
9380         public static final String RADIO_CELL = "cell";
9381 
9382         /**
9383          * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
9384          */
9385         public static final String RADIO_NFC = "nfc";
9386 
9387         /**
9388          * A comma separated list of radios that need to be disabled when airplane mode
9389          * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
9390          * included in the comma separated list.
9391          */
9392         public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
9393 
9394         /**
9395          * A comma separated list of radios that should to be disabled when airplane mode
9396          * is on, but can be manually reenabled by the user.  For example, if RADIO_WIFI is
9397          * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
9398          * will be turned off when entering airplane mode, but the user will be able to reenable
9399          * Wifi in the Settings app.
9400          *
9401          * {@hide}
9402          */
9403         public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
9404 
9405         /**
9406          * An integer representing the Bluetooth Class of Device (CoD).
9407          *
9408          * @hide
9409          */
9410         public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device";
9411 
9412         /**
9413          * A Long representing a bitmap of profiles that should be disabled when bluetooth starts.
9414          * See {@link android.bluetooth.BluetoothProfile}.
9415          * {@hide}
9416          */
9417         public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";
9418 
9419         /**
9420          * A semi-colon separated list of Bluetooth interoperability workarounds.
9421          * Each entry is a partial Bluetooth device address string and an integer representing
9422          * the feature to be disabled, separated by a comma. The integer must correspond
9423          * to a interoperability feature as defined in "interop.h" in /system/bt.
9424          * <p>
9425          * Example: <br/>
9426          *   "00:11:22,0;01:02:03:04,2"
9427          * @hide
9428          */
9429        public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";
9430 
9431         /**
9432          * The policy for deciding when Wi-Fi should go to sleep (which will in
9433          * turn switch to using the mobile data as an Internet connection).
9434          * <p>
9435          * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
9436          * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
9437          * {@link #WIFI_SLEEP_POLICY_NEVER}.
9438          */
9439         public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
9440 
9441         /**
9442          * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
9443          * policy, which is to sleep shortly after the turning off
9444          * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
9445          */
9446         public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
9447 
9448         /**
9449          * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
9450          * the device is on battery, and never go to sleep when the device is
9451          * plugged in.
9452          */
9453         public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
9454 
9455         /**
9456          * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
9457          */
9458         public static final int WIFI_SLEEP_POLICY_NEVER = 2;
9459 
9460         /**
9461          * Value to specify if the user prefers the date, time and time zone
9462          * to be automatically fetched from the network (NITZ). 1=yes, 0=no
9463          */
9464         public static final String AUTO_TIME = "auto_time";
9465 
9466         private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR;
9467 
9468         /**
9469          * Value to specify if the user prefers the time zone
9470          * to be automatically fetched from the network (NITZ). 1=yes, 0=no
9471          */
9472         public static final String AUTO_TIME_ZONE = "auto_time_zone";
9473 
9474         private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR;
9475 
9476         /**
9477          * URI for the car dock "in" event sound.
9478          * @hide
9479          */
9480         public static final String CAR_DOCK_SOUND = "car_dock_sound";
9481 
9482         /**
9483          * URI for the car dock "out" event sound.
9484          * @hide
9485          */
9486         public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
9487 
9488         /**
9489          * URI for the desk dock "in" event sound.
9490          * @hide
9491          */
9492         public static final String DESK_DOCK_SOUND = "desk_dock_sound";
9493 
9494         /**
9495          * URI for the desk dock "out" event sound.
9496          * @hide
9497          */
9498         public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
9499 
9500         /**
9501          * Whether to play a sound for dock events.
9502          * @hide
9503          */
9504         public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
9505 
9506         private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9507 
9508         /**
9509          * Whether to play a sound for dock events, only when an accessibility service is on.
9510          * @hide
9511          */
9512         public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility";
9513 
9514         /**
9515          * URI for the "device locked" (keyguard shown) sound.
9516          * @hide
9517          */
9518         public static final String LOCK_SOUND = "lock_sound";
9519 
9520         /**
9521          * URI for the "device unlocked" sound.
9522          * @hide
9523          */
9524         public static final String UNLOCK_SOUND = "unlock_sound";
9525 
9526         /**
9527          * URI for the "device is trusted" sound, which is played when the device enters the trusted
9528          * state without unlocking.
9529          * @hide
9530          */
9531         public static final String TRUSTED_SOUND = "trusted_sound";
9532 
9533         /**
9534          * URI for the low battery sound file.
9535          * @hide
9536          */
9537         public static final String LOW_BATTERY_SOUND = "low_battery_sound";
9538 
9539         /**
9540          * Whether to play a sound for low-battery alerts.
9541          * @hide
9542          */
9543         public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
9544 
9545         private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9546 
9547         /**
9548          * URI for the "wireless charging started" and "wired charging started" sound.
9549          * @hide
9550          */
9551         public static final String CHARGING_STARTED_SOUND =
9552                 "wireless_charging_started_sound";
9553 
9554         /**
9555          * Whether to play a sound for charging events.
9556          * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_SOUNDS_ENABLED} instead
9557          * @hide
9558          */
9559         @Deprecated
9560         public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
9561 
9562         private static final Validator CHARGING_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9563 
9564         /**
9565          * Whether to vibrate for wireless charging events.
9566          * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_VIBRATION_ENABLED}
9567          * @hide
9568          */
9569         @Deprecated
9570         public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled";
9571 
9572         private static final Validator CHARGING_VIBRATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9573 
9574         /**
9575          * Whether we keep the device on while the device is plugged in.
9576          * Supported values are:
9577          * <ul>
9578          * <li>{@code 0} to never stay on while plugged in</li>
9579          * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
9580          * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
9581          * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
9582          * </ul>
9583          * These values can be OR-ed together.
9584          */
9585         public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
9586 
9587         private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() {
9588             @Override
9589             public boolean validate(@Nullable String value) {
9590                 try {
9591                     int val = Integer.parseInt(value);
9592                     return (val == 0)
9593                             || (val == BatteryManager.BATTERY_PLUGGED_AC)
9594                             || (val == BatteryManager.BATTERY_PLUGGED_USB)
9595                             || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS)
9596                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
9597                                     | BatteryManager.BATTERY_PLUGGED_USB))
9598                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
9599                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS))
9600                             || (val == (BatteryManager.BATTERY_PLUGGED_USB
9601                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS))
9602                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
9603                                     | BatteryManager.BATTERY_PLUGGED_USB
9604                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS));
9605                 } catch (NumberFormatException e) {
9606                     return false;
9607                 }
9608             }
9609         };
9610 
9611         /**
9612          * When the user has enable the option to have a "bug report" command
9613          * in the power menu.
9614          * @hide
9615          */
9616         public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
9617 
9618         private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR;
9619 
9620         /**
9621          * Whether ADB is enabled.
9622          */
9623         public static final String ADB_ENABLED = "adb_enabled";
9624 
9625         /**
9626          * Whether Views are allowed to save their attribute data.
9627          * @hide
9628          */
9629         public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
9630 
9631         /**
9632          * Which application package is allowed to save View attribute data.
9633          * @hide
9634          */
9635         public static final String DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE =
9636                 "debug_view_attributes_application_package";
9637 
9638         /**
9639          * Whether assisted GPS should be enabled or not.
9640          * @hide
9641          */
9642         public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
9643 
9644         /**
9645          * Whether bluetooth is enabled/disabled
9646          * 0=disabled. 1=enabled.
9647          */
9648         public static final String BLUETOOTH_ON = "bluetooth_on";
9649 
9650         private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR;
9651 
9652         /**
9653          * CDMA Cell Broadcast SMS
9654          *                            0 = CDMA Cell Broadcast SMS disabled
9655          *                            1 = CDMA Cell Broadcast SMS enabled
9656          * @hide
9657          */
9658         public static final String CDMA_CELL_BROADCAST_SMS =
9659                 "cdma_cell_broadcast_sms";
9660 
9661         /**
9662          * The CDMA roaming mode 0 = Home Networks, CDMA default
9663          *                       1 = Roaming on Affiliated networks
9664          *                       2 = Roaming on any networks
9665          * @hide
9666          */
9667         public static final String CDMA_ROAMING_MODE = "roaming_settings";
9668 
9669         /**
9670          * The CDMA subscription mode 0 = RUIM/SIM (default)
9671          *                                1 = NV
9672          * @hide
9673          */
9674         public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
9675 
9676         /**
9677          * The default value for whether background data is enabled or not.
9678          *
9679          * Used by {@code NetworkPolicyManagerService}.
9680          *
9681          * @hide
9682          */
9683         public static final String DEFAULT_RESTRICT_BACKGROUND_DATA =
9684                 "default_restrict_background_data";
9685 
9686         /** Inactivity timeout to track mobile data activity.
9687         *
9688         * If set to a positive integer, it indicates the inactivity timeout value in seconds to
9689         * infer the data activity of mobile network. After a period of no activity on mobile
9690         * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
9691         * intent is fired to indicate a transition of network status from "active" to "idle". Any
9692         * subsequent activity on mobile networks triggers the firing of {@code
9693         * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
9694         *
9695         * Network activity refers to transmitting or receiving data on the network interfaces.
9696         *
9697         * Tracking is disabled if set to zero or negative value.
9698         *
9699         * @hide
9700         */
9701        public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
9702 
9703        /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
9704         * but for Wifi network.
9705         * @hide
9706         */
9707        public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
9708 
9709        /**
9710         * Whether or not data roaming is enabled. (0 = false, 1 = true)
9711         */
9712        public static final String DATA_ROAMING = "data_roaming";
9713 
9714        /**
9715         * The value passed to a Mobile DataConnection via bringUp which defines the
9716         * number of retries to preform when setting up the initial connection. The default
9717         * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
9718         * @hide
9719         */
9720        public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
9721 
9722        /**
9723         * Whether any package can be on external storage. When this is true, any
9724         * package, regardless of manifest values, is a candidate for installing
9725         * or moving onto external storage. (0 = false, 1 = true)
9726         * @hide
9727         */
9728        public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external";
9729 
9730         /**
9731          * The default SM-DP+ configured for this device.
9732          *
9733          * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to
9734          * download profiles. If this value is set, the LPA will query this server for any profiles
9735          * available to this device. If any are available, they may be downloaded during device
9736          * provisioning or in settings without needing the user to enter an activation code.
9737          *
9738          * @see android.service.euicc.EuiccService
9739          * @hide
9740          */
9741         @SystemApi
9742         public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
9743 
9744         /**
9745          * Whether any profile has ever been downloaded onto a eUICC on the device.
9746          *
9747          * <p>Used to hide eUICC UI from users who have never made use of it and would only be
9748          * confused by seeing references to it in settings.
9749          * (0 = false, 1 = true)
9750          * @hide
9751          */
9752         @SystemApi
9753         public static final String EUICC_PROVISIONED = "euicc_provisioned";
9754 
9755         /**
9756          * List of ISO country codes in which eUICC UI is shown. Country codes should be separated
9757          * by comma.
9758          *
9759          * <p>Used to hide eUICC UI from users who are currently in countries no carriers support
9760          * eUICC.
9761          * @hide
9762          */
9763         //TODO(b/77914569) Changes this to System Api.
9764         public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries";
9765 
9766         /**
9767          * Whether any activity can be resized. When this is true, any
9768          * activity, regardless of manifest values, can be resized for multi-window.
9769          * (0 = false, 1 = true)
9770          * @hide
9771          */
9772         public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES
9773                 = "force_resizable_activities";
9774 
9775         /**
9776          * Whether to enable experimental freeform support for windows.
9777          * @hide
9778          */
9779         public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT
9780                 = "enable_freeform_support";
9781 
9782         /**
9783          * Whether to enable experimental desktop mode on secondary displays.
9784          * @hide
9785          */
9786         public static final String DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS =
9787                 "force_desktop_mode_on_external_displays";
9788 
9789        /**
9790         * Whether user has enabled development settings.
9791         */
9792        public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
9793 
9794        /**
9795         * Whether the device has been provisioned (0 = false, 1 = true).
9796         * <p>On a multiuser device with a separate system user, the screen may be locked
9797         * as soon as this is set to true and further activities cannot be launched on the
9798         * system user unless they are marked to show over keyguard.
9799         */
9800        public static final String DEVICE_PROVISIONED = "device_provisioned";
9801 
9802         /**
9803          * Indicates whether mobile data should be allowed while the device is being provisioned.
9804          * This allows the provisioning process to turn off mobile data before the user
9805          * has an opportunity to set things up, preventing other processes from burning
9806          * precious bytes before wifi is setup.
9807          * <p>
9808          * Type: int (0 for false, 1 for true)
9809          *
9810          * @hide
9811          */
9812         @SystemApi
9813         public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED =
9814                 "device_provisioning_mobile_data";
9815 
9816        /**
9817         * The saved value for WindowManagerService.setForcedDisplaySize().
9818         * Two integers separated by a comma.  If unset, then use the real display size.
9819         * @hide
9820         */
9821        public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
9822 
9823        /**
9824         * The saved value for WindowManagerService.setForcedDisplayScalingMode().
9825         * 0 or unset if scaling is automatic, 1 if scaling is disabled.
9826         * @hide
9827         */
9828        public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
9829 
9830        /**
9831         * The maximum size, in bytes, of a download that the download manager will transfer over
9832         * a non-wifi connection.
9833         * @hide
9834         */
9835        public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
9836                "download_manager_max_bytes_over_mobile";
9837 
9838        /**
9839         * The recommended maximum size, in bytes, of a download that the download manager should
9840         * transfer over a non-wifi connection. Over this size, the use will be warned, but will
9841         * have the option to start the download over the mobile connection anyway.
9842         * @hide
9843         */
9844        public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
9845                "download_manager_recommended_max_bytes_over_mobile";
9846 
9847        /**
9848         * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
9849         */
9850        @Deprecated
9851        public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
9852 
9853        /**
9854         * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
9855         * sent or processed. (0 = false, 1 = true)
9856         * @hide
9857         */
9858        public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
9859 
9860        /**
9861         * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on
9862         * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will
9863         * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be
9864         * activated.
9865         * @hide
9866         */
9867         public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED =
9868                 "hdmi_system_audio_control_enabled";
9869 
9870         /**
9871          * Whether HDMI Routing Control feature is enabled. If enabled, the switch device will
9872          * route to the correct input source on receiving Routing Control related messages. If
9873          * disabled, you can only switch the input via controls on this device.
9874          * @hide
9875          */
9876         public static final String HDMI_CEC_SWITCH_ENABLED =
9877                 "hdmi_cec_switch_enabled";
9878 
9879         /**
9880          * Whether TV will automatically turn on upon reception of the CEC command
9881          * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
9882          *
9883          * @hide
9884          */
9885         public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
9886                 "hdmi_control_auto_wakeup_enabled";
9887 
9888         /**
9889          * Whether TV will also turn off other CEC devices when it goes to standby mode.
9890          * (0 = false, 1 = true)
9891          *
9892          * @hide
9893          */
9894         public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
9895                 "hdmi_control_auto_device_off_enabled";
9896 
9897         /**
9898          * The interval in milliseconds at which location requests will be throttled when they are
9899          * coming from the background.
9900          *
9901          * @hide
9902          */
9903         public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS =
9904                 "location_background_throttle_interval_ms";
9905 
9906         /**
9907          * Most frequent location update interval in milliseconds that proximity alert is allowed
9908          * to request.
9909          * @hide
9910          */
9911         public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS =
9912                 "location_background_throttle_proximity_alert_interval_ms";
9913 
9914         /**
9915          * Packages that are whitelisted for background throttling (throttling will not be applied).
9916          * @hide
9917          */
9918         public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST =
9919             "location_background_throttle_package_whitelist";
9920 
9921         /**
9922          * Packages that are whitelisted for ignoring location settings (may retrieve location even
9923          * when user location settings are off), for emergency purposes.
9924          * @hide
9925          */
9926         @TestApi
9927         public static final String LOCATION_IGNORE_SETTINGS_PACKAGE_WHITELIST =
9928                 "location_ignore_settings_package_whitelist";
9929 
9930         /**
9931          * Whether to disable location status callbacks in preparation for deprecation.
9932          * @hide
9933          */
9934         public static final String LOCATION_DISABLE_STATUS_CALLBACKS =
9935                 "location_disable_status_callbacks";
9936 
9937         /**
9938          * Maximum staleness allowed for last location when returned to clients with only foreground
9939          * location permissions.
9940          * @hide
9941          */
9942         public static final String LOCATION_LAST_LOCATION_MAX_AGE_MILLIS =
9943                 "location_last_location_max_age_millis";
9944 
9945         /**
9946         * Whether TV will switch to MHL port when a mobile device is plugged in.
9947         * (0 = false, 1 = true)
9948         * @hide
9949         */
9950        public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
9951 
9952        /**
9953         * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
9954         * @hide
9955         */
9956        public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
9957 
9958        /**
9959         * Whether mobile data connections are allowed by the user.  See
9960         * ConnectivityManager for more info.
9961         * @hide
9962         */
9963        @UnsupportedAppUsage
9964        public static final String MOBILE_DATA = "mobile_data";
9965 
9966        /**
9967         * Whether the mobile data connection should remain active even when higher
9968         * priority networks like WiFi are active, to help make network switching faster.
9969         *
9970         * See ConnectivityService for more info.
9971         *
9972         * (0 = disabled, 1 = enabled)
9973         * @hide
9974         */
9975        public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
9976 
9977         /**
9978          * Whether the wifi data connection should remain active even when higher
9979          * priority networks like Ethernet are active, to keep both networks.
9980          * In the case where higher priority networks are connected, wifi will be
9981          * unused unless an application explicitly requests to use it.
9982          *
9983          * See ConnectivityService for more info.
9984          *
9985          * (0 = disabled, 1 = enabled)
9986          * @hide
9987          */
9988         public static final String WIFI_ALWAYS_REQUESTED = "wifi_always_requested";
9989 
9990         /**
9991          * Size of the event buffer for IP connectivity metrics.
9992          * @hide
9993          */
9994         public static final String CONNECTIVITY_METRICS_BUFFER_SIZE =
9995               "connectivity_metrics_buffer_size";
9996 
9997        /** {@hide} */
9998        public static final String NETSTATS_ENABLED = "netstats_enabled";
9999        /** {@hide} */
10000        public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
10001        /** {@hide} */
10002        @Deprecated
10003        public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
10004        /** {@hide} */
10005        public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
10006        /** {@hide} */
10007        public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
10008        /** {@hide} */
10009        public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled";
10010 
10011        /** {@hide} */
10012        public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
10013        /** {@hide} */
10014        public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
10015        /** {@hide} */
10016        public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
10017        /** {@hide} */
10018        public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
10019 
10020        /** {@hide} */
10021        public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
10022        /** {@hide} */
10023        public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
10024        /** {@hide} */
10025        public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
10026        /** {@hide} */
10027        public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
10028 
10029        /** {@hide} */
10030        public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
10031        /** {@hide} */
10032        public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
10033        /** {@hide} */
10034        public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
10035        /** {@hide} */
10036        public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
10037 
10038        /** {@hide} */
10039        public static final String NETPOLICY_QUOTA_ENABLED = "netpolicy_quota_enabled";
10040        /** {@hide} */
10041        public static final String NETPOLICY_QUOTA_UNLIMITED = "netpolicy_quota_unlimited";
10042        /** {@hide} */
10043        public static final String NETPOLICY_QUOTA_LIMITED = "netpolicy_quota_limited";
10044        /** {@hide} */
10045        public static final String NETPOLICY_QUOTA_FRAC_JOBS = "netpolicy_quota_frac_jobs";
10046        /** {@hide} */
10047        public static final String NETPOLICY_QUOTA_FRAC_MULTIPATH = "netpolicy_quota_frac_multipath";
10048 
10049        /** {@hide} */
10050        public static final String NETPOLICY_OVERRIDE_ENABLED = "netpolicy_override_enabled";
10051 
10052        /**
10053         * User preference for which network(s) should be used. Only the
10054         * connectivity service should touch this.
10055         */
10056        public static final String NETWORK_PREFERENCE = "network_preference";
10057 
10058        /**
10059         * Which package name to use for network scoring. If null, or if the package is not a valid
10060         * scorer app, external network scores will neither be requested nor accepted.
10061         * @hide
10062         */
10063        @UnsupportedAppUsage
10064        public static final String NETWORK_SCORER_APP = "network_scorer_app";
10065 
10066         /**
10067          * Whether night display forced auto mode is available.
10068          * 0 = unavailable, 1 = available.
10069          * @hide
10070          */
10071         public static final String NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE =
10072                 "night_display_forced_auto_mode_available";
10073 
10074        /**
10075         * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
10076         * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
10077         * exceeded.
10078         * @hide
10079         */
10080        public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
10081 
10082        /**
10083         * The length of time in milli-seconds that automatic small adjustments to
10084         * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
10085         * @hide
10086         */
10087        public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
10088 
10089        /** Preferred NTP server. {@hide} */
10090        public static final String NTP_SERVER = "ntp_server";
10091        /** Timeout in milliseconds to wait for NTP server. {@hide} */
10092        public static final String NTP_TIMEOUT = "ntp_timeout";
10093 
10094        /** {@hide} */
10095        public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval";
10096 
10097         /**
10098          * Whether or not Settings should enable psd API.
10099          * {@hide}
10100          */
10101         public static final String SETTINGS_USE_PSD_API = "settings_use_psd_api";
10102 
10103         /**
10104          * Whether or not Settings should enable external provider API.
10105          * {@hide}
10106          */
10107         public static final String SETTINGS_USE_EXTERNAL_PROVIDER_API =
10108                 "settings_use_external_provider_api";
10109 
10110        /**
10111         * Sample validity in seconds to configure for the system DNS resolver.
10112         * {@hide}
10113         */
10114        public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS =
10115                "dns_resolver_sample_validity_seconds";
10116 
10117        /**
10118         * Success threshold in percent for use with the system DNS resolver.
10119         * {@hide}
10120         */
10121        public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT =
10122                 "dns_resolver_success_threshold_percent";
10123 
10124        /**
10125         * Minimum number of samples needed for statistics to be considered meaningful in the
10126         * system DNS resolver.
10127         * {@hide}
10128         */
10129        public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples";
10130 
10131        /**
10132         * Maximum number taken into account for statistics purposes in the system DNS resolver.
10133         * {@hide}
10134         */
10135        public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples";
10136 
10137        /**
10138         * Whether to disable the automatic scheduling of system updates.
10139         * 1 = system updates won't be automatically scheduled (will always
10140         * present notification instead).
10141         * 0 = system updates will be automatically scheduled. (default)
10142         * @hide
10143         */
10144        @SystemApi
10145        public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
10146 
10147        /**
10148         * Whether the package manager should send package verification broadcasts for verifiers to
10149         * review apps prior to installation.
10150         * 1 = request apps to be verified prior to installation, if a verifier exists.
10151         * 0 = do not verify apps before installation
10152         * @hide
10153         */
10154        @UnsupportedAppUsage
10155        public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
10156 
10157        /** Timeout for package verification.
10158         * @hide */
10159        public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
10160 
10161        /** Default response code for package verification.
10162         * @hide */
10163        public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
10164 
10165        /**
10166         * Show package verification setting in the Settings app.
10167         * 1 = show (default)
10168         * 0 = hide
10169         * @hide
10170         */
10171        public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
10172 
10173        /**
10174         * Run package verification on apps installed through ADB/ADT/USB
10175         * 1 = perform package verification on ADB installs (default)
10176         * 0 = bypass package verification on ADB installs
10177         * @hide
10178         */
10179        public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
10180 
10181        /**
10182         * Time since last fstrim (milliseconds) after which we force one to happen
10183         * during device startup.  If unset, the default is 3 days.
10184         * @hide
10185         */
10186        public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
10187 
10188        /**
10189         * The interval in milliseconds at which to check packet counts on the
10190         * mobile data interface when screen is on, to detect possible data
10191         * connection problems.
10192         * @hide
10193         */
10194        public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
10195                "pdp_watchdog_poll_interval_ms";
10196 
10197        /**
10198         * The interval in milliseconds at which to check packet counts on the
10199         * mobile data interface when screen is off, to detect possible data
10200         * connection problems.
10201         * @hide
10202         */
10203        public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
10204                "pdp_watchdog_long_poll_interval_ms";
10205 
10206        /**
10207         * The interval in milliseconds at which to check packet counts on the
10208         * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
10209         * outgoing packets has been reached without incoming packets.
10210         * @hide
10211         */
10212        public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
10213                "pdp_watchdog_error_poll_interval_ms";
10214 
10215        /**
10216         * The number of outgoing packets sent without seeing an incoming packet
10217         * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
10218         * device is logged to the event log
10219         * @hide
10220         */
10221        public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
10222                "pdp_watchdog_trigger_packet_count";
10223 
10224        /**
10225         * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
10226         * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
10227         * attempting data connection recovery.
10228         * @hide
10229         */
10230        public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
10231                "pdp_watchdog_error_poll_count";
10232 
10233        /**
10234         * The number of failed PDP reset attempts before moving to something more
10235         * drastic: re-registering to the network.
10236         * @hide
10237         */
10238        public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
10239                "pdp_watchdog_max_pdp_reset_fail_count";
10240 
10241        /**
10242         * URL to open browser on to allow user to manage a prepay account
10243         * @hide
10244         */
10245        public static final String SETUP_PREPAID_DATA_SERVICE_URL =
10246                "setup_prepaid_data_service_url";
10247 
10248        /**
10249         * URL to attempt a GET on to see if this is a prepay device
10250         * @hide
10251         */
10252        public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
10253                "setup_prepaid_detection_target_url";
10254 
10255        /**
10256         * Host to check for a redirect to after an attempt to GET
10257         * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
10258         * this is a prepaid device with zero balance.)
10259         * @hide
10260         */
10261        public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
10262                "setup_prepaid_detection_redir_host";
10263 
10264        /**
10265         * The interval in milliseconds at which to check the number of SMS sent out without asking
10266         * for use permit, to limit the un-authorized SMS usage.
10267         *
10268         * @hide
10269         */
10270        public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
10271                "sms_outgoing_check_interval_ms";
10272 
10273        /**
10274         * The number of outgoing SMS sent without asking for user permit (of {@link
10275         * #SMS_OUTGOING_CHECK_INTERVAL_MS}
10276         *
10277         * @hide
10278         */
10279        public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
10280                "sms_outgoing_check_max_count";
10281 
10282        /**
10283         * Used to disable SMS short code confirmation - defaults to true.
10284         * True indcates we will do the check, etc.  Set to false to disable.
10285         * @see com.android.internal.telephony.SmsUsageMonitor
10286         * @hide
10287         */
10288        public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
10289 
10290         /**
10291          * Used to select which country we use to determine premium sms codes.
10292          * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
10293          * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
10294          * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
10295          * @hide
10296          */
10297         public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
10298 
10299        /**
10300         * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
10301         * @hide
10302         */
10303        public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
10304 
10305        /**
10306         * Used to disable Tethering on a device - defaults to true
10307         * @hide
10308         */
10309        public static final String TETHER_SUPPORTED = "tether_supported";
10310 
10311        /**
10312         * Used to require DUN APN on the device or not - defaults to a build config value
10313         * which defaults to false
10314         * @hide
10315         */
10316        public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
10317 
10318        /**
10319         * Used to hold a gservices-provisioned apn value for DUN.  If set, or the
10320         * corresponding build config values are set it will override the APN DB
10321         * values.
10322         * Consists of a comma seperated list of strings:
10323         * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
10324         * note that empty fields can be omitted: "name,apn,,,,,,,,,310,260,,DUN"
10325         * @hide
10326         */
10327        public static final String TETHER_DUN_APN = "tether_dun_apn";
10328 
10329         /**
10330          * Used to disable trying to talk to any available tethering offload HAL.
10331          *
10332          * Integer values are interpreted as boolean, and the absence of an explicit setting
10333          * is interpreted as |false|.
10334          * @hide
10335          */
10336         public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled";
10337 
10338         /**
10339          * Use the old dnsmasq DHCP server for tethering instead of the framework implementation.
10340          *
10341          * Integer values are interpreted as boolean, and the absence of an explicit setting
10342          * is interpreted as |false|.
10343          * @hide
10344          */
10345         public static final String TETHER_ENABLE_LEGACY_DHCP_SERVER =
10346                 "tether_enable_legacy_dhcp_server";
10347 
10348         /**
10349          * List of certificate (hex string representation of the application's certificate - SHA-1
10350          * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for
10351          * install when a sim card with matching UICC carrier privilege rules is inserted.  The
10352          * certificate is used as a key, so the certificate encoding here must be the same as the
10353          * certificate encoding used on the SIM.
10354          *
10355          * The value is "cert1:package1;cert2:package2;..."
10356          * @hide
10357          */
10358         @SystemApi
10359         public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
10360 
10361         /**
10362          * Map of package name to application names. The application names cannot and will not be
10363          * localized. App names may not contain colons or semicolons.
10364          *
10365          * The value is "packageName1:appName1;packageName2:appName2;..."
10366          * @hide
10367          */
10368         @SystemApi
10369         public static final String CARRIER_APP_NAMES = "carrier_app_names";
10370 
10371        /**
10372         * USB Mass Storage Enabled
10373         */
10374        public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
10375 
10376        private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
10377 
10378        /**
10379         * If this setting is set (to anything), then all references
10380         * to Gmail on the device must change to Google Mail.
10381         */
10382        public static final String USE_GOOGLE_MAIL = "use_google_mail";
10383 
10384         /**
10385          * Whether or not switching/creating users is enabled by user.
10386          * @hide
10387          */
10388         public static final String USER_SWITCHER_ENABLED = "user_switcher_enabled";
10389 
10390         /**
10391          * Webview Data reduction proxy key.
10392          * @hide
10393          */
10394         public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
10395                 "webview_data_reduction_proxy_key";
10396 
10397        /**
10398         * Whether or not the WebView fallback mechanism should be enabled.
10399         * 0=disabled, 1=enabled.
10400         * @hide
10401         */
10402        public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED =
10403                "webview_fallback_logic_enabled";
10404 
10405        /**
10406         * Name of the package used as WebView provider (if unset the provider is instead determined
10407         * by the system).
10408         * @hide
10409         */
10410        @UnsupportedAppUsage
10411        public static final String WEBVIEW_PROVIDER = "webview_provider";
10412 
10413        /**
10414         * Developer setting to enable WebView multiprocess rendering.
10415         * @hide
10416         */
10417        @SystemApi
10418        public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
10419 
10420        /**
10421         * The maximum number of notifications shown in 24 hours when switching networks.
10422         * @hide
10423         */
10424        public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT =
10425               "network_switch_notification_daily_limit";
10426 
10427        /**
10428         * The minimum time in milliseconds between notifications when switching networks.
10429         * @hide
10430         */
10431        public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS =
10432               "network_switch_notification_rate_limit_millis";
10433 
10434        /**
10435         * Whether to automatically switch away from wifi networks that lose Internet access.
10436         * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always
10437         * avoids such networks. Valid values are:
10438         *
10439         * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013.
10440         * null: Ask the user whether to switch away from bad wifi.
10441         * 1: Avoid bad wifi.
10442         *
10443         * @hide
10444         */
10445        public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi";
10446 
10447        /**
10448         * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be
10449         * overridden by the system based on device or application state. If null, the value
10450         * specified by config_networkMeteredMultipathPreference is used.
10451         *
10452         * @hide
10453         */
10454        public static final String NETWORK_METERED_MULTIPATH_PREFERENCE =
10455                "network_metered_multipath_preference";
10456 
10457         /**
10458          * Default daily multipath budget used by ConnectivityManager.getMultipathPreference()
10459          * on metered networks. This default quota is only used if quota could not be determined
10460          * from data plan or data limit/warning set by the user.
10461          * @hide
10462          */
10463         public static final String NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES =
10464                 "network_default_daily_multipath_quota_bytes";
10465 
10466         /**
10467          * Network watchlist last report time.
10468          * @hide
10469          */
10470         public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME =
10471                 "network_watchlist_last_report_time";
10472 
10473        /**
10474         * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of
10475         * colon-delimited key-value pairs. The key is the badging enum value defined in
10476         * android.net.ScoredNetwork and the value is the minimum sustained network throughput in
10477         * kbps required for the badge. For example: "10:3000,20:5000,30:25000"
10478         *
10479         * @hide
10480         */
10481        @SystemApi
10482        public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds";
10483 
10484        /**
10485         * Whether Wifi display is enabled/disabled
10486         * 0=disabled. 1=enabled.
10487         * @hide
10488         */
10489        public static final String WIFI_DISPLAY_ON = "wifi_display_on";
10490 
10491        /**
10492         * Whether Wifi display certification mode is enabled/disabled
10493         * 0=disabled. 1=enabled.
10494         * @hide
10495         */
10496        public static final String WIFI_DISPLAY_CERTIFICATION_ON =
10497                "wifi_display_certification_on";
10498 
10499        /**
10500         * WPS Configuration method used by Wifi display, this setting only
10501         * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
10502         *
10503         * Possible values are:
10504         *
10505         * WpsInfo.INVALID: use default WPS method chosen by framework
10506         * WpsInfo.PBC    : use Push button
10507         * WpsInfo.KEYPAD : use Keypad
10508         * WpsInfo.DISPLAY: use Display
10509         * @hide
10510         */
10511        public static final String WIFI_DISPLAY_WPS_CONFIG =
10512            "wifi_display_wps_config";
10513 
10514        /**
10515         * Whether to notify the user of open networks.
10516         * <p>
10517         * If not connected and the scan results have an open network, we will
10518         * put this notification up. If we attempt to connect to a network or
10519         * the open network(s) disappear, we remove the notification. When we
10520         * show the notification, we will not show it again for
10521         * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
10522         *
10523         * @deprecated This feature is no longer controlled by this setting in
10524         * {@link android.os.Build.VERSION_CODES#O}.
10525         */
10526        @Deprecated
10527        public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
10528                "wifi_networks_available_notification_on";
10529 
10530        private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
10531                BOOLEAN_VALIDATOR;
10532 
10533        /**
10534         * Whether to notify the user of carrier networks.
10535         * <p>
10536         * If not connected and the scan results have a carrier network, we will
10537         * put this notification up. If we attempt to connect to a network or
10538         * the carrier network(s) disappear, we remove the notification. When we
10539         * show the notification, we will not show it again for
10540         * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
10541         * @hide
10542         */
10543        public static final String WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON =
10544                "wifi_carrier_networks_available_notification_on";
10545 
10546        private static final Validator WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
10547                BOOLEAN_VALIDATOR;
10548 
10549        /**
10550         * {@hide}
10551         */
10552        public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
10553                "wimax_networks_available_notification_on";
10554 
10555        /**
10556         * Delay (in seconds) before repeating the Wi-Fi networks available notification.
10557         * Connecting to a network will reset the timer.
10558         */
10559        public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
10560                "wifi_networks_available_repeat_delay";
10561 
10562        private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR =
10563                NON_NEGATIVE_INTEGER_VALIDATOR;
10564 
10565        /**
10566         * 802.11 country code in ISO 3166 format
10567         * @hide
10568         */
10569        public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
10570 
10571        /**
10572         * The interval in milliseconds to issue wake up scans when wifi needs
10573         * to connect. This is necessary to connect to an access point when
10574         * device is on the move and the screen is off.
10575         * @hide
10576         */
10577        public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
10578                "wifi_framework_scan_interval_ms";
10579 
10580        /**
10581         * The interval in milliseconds after which Wi-Fi is considered idle.
10582         * When idle, it is possible for the device to be switched from Wi-Fi to
10583         * the mobile data network.
10584         * @hide
10585         */
10586        public static final String WIFI_IDLE_MS = "wifi_idle_ms";
10587 
10588        /**
10589         * When the number of open networks exceeds this number, the
10590         * least-recently-used excess networks will be removed.
10591         */
10592        public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
10593 
10594        private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR =
10595                NON_NEGATIVE_INTEGER_VALIDATOR;
10596 
10597        /**
10598         * Whether the Wi-Fi should be on.  Only the Wi-Fi service should touch this.
10599         */
10600        public static final String WIFI_ON = "wifi_on";
10601 
10602        /**
10603         * Setting to allow scans to be enabled even wifi is turned off for connectivity.
10604         * @hide
10605         */
10606        public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
10607                 "wifi_scan_always_enabled";
10608 
10609         /**
10610          * The interval in milliseconds at which wifi rtt ranging requests will be throttled when
10611          * they are coming from the background.
10612          *
10613          * @hide
10614          */
10615         public static final String WIFI_RTT_BACKGROUND_EXEC_GAP_MS =
10616                 "wifi_rtt_background_exec_gap_ms";
10617 
10618         /**
10619          * Indicate whether factory reset request is pending.
10620          *
10621          * Type: int (0 for false, 1 for true)
10622          * @hide
10623          */
10624         public static final String WIFI_P2P_PENDING_FACTORY_RESET =
10625                 "wifi_p2p_pending_factory_reset";
10626 
10627         /**
10628          * Whether soft AP will shut down after a timeout period when no devices are connected.
10629          *
10630          * Type: int (0 for false, 1 for true)
10631          * @hide
10632          */
10633         public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled";
10634 
10635         private static final Validator SOFT_AP_TIMEOUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
10636 
10637         /**
10638          * Value to specify if Wi-Fi Wakeup feature is enabled.
10639          *
10640          * Type: int (0 for false, 1 for true)
10641          * @hide
10642          */
10643         @SystemApi
10644         public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
10645 
10646         private static final Validator WIFI_WAKEUP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
10647 
10648         /**
10649          * Value to specify whether network quality scores and badging should be shown in the UI.
10650          *
10651          * Type: int (0 for false, 1 for true)
10652          * @hide
10653          */
10654         public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled";
10655 
10656         /**
10657          * Value to specify how long in milliseconds to retain seen score cache curves to be used
10658          * when generating SSID only bases score curves.
10659          *
10660          * Type: long
10661          * @hide
10662          */
10663         public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS =
10664                 "speed_label_cache_eviction_age_millis";
10665 
10666         /**
10667          * Value to specify if network recommendations from
10668          * {@link com.android.server.NetworkScoreService} are enabled.
10669          *
10670          * Type: int
10671          * Valid values:
10672          *   -1 = Forced off
10673          *    0 = Disabled
10674          *    1 = Enabled
10675          *
10676          * Most readers of this setting should simply check if value == 1 to determined the
10677          * enabled state.
10678          * @hide
10679          */
10680         public static final String NETWORK_RECOMMENDATIONS_ENABLED =
10681                 "network_recommendations_enabled";
10682 
10683         private static final Validator NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR =
10684                 new SettingsValidators.DiscreteValueValidator(new String[] {"-1", "0", "1"});
10685 
10686         /**
10687          * Which package name to use for network recommendations. If null, network recommendations
10688          * will neither be requested nor accepted.
10689          *
10690          * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and
10691          * {@link NetworkScoreManager#setActiveScorer(String)} to write it.
10692          *
10693          * Type: string - package name
10694          * @hide
10695          */
10696         public static final String NETWORK_RECOMMENDATIONS_PACKAGE =
10697                 "network_recommendations_package";
10698 
10699         /**
10700          * The package name of the application that connect and secures high quality open wifi
10701          * networks automatically.
10702          *
10703          * Type: string package name or null if the feature is either not provided or disabled.
10704          * @hide
10705          */
10706         @TestApi
10707         public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package";
10708 
10709         private static final Validator USE_OPEN_WIFI_PACKAGE_VALIDATOR = new Validator() {
10710             @Override
10711             public boolean validate(@Nullable String value) {
10712                 return (value == null) || PACKAGE_NAME_VALIDATOR.validate(value);
10713             }
10714         };
10715 
10716         /**
10717          * The number of milliseconds the {@link com.android.server.NetworkScoreService}
10718          * will give a recommendation request to complete before returning a default response.
10719          *
10720          * Type: long
10721          * @hide
10722          * @deprecated to be removed
10723          */
10724         public static final String NETWORK_RECOMMENDATION_REQUEST_TIMEOUT_MS =
10725                 "network_recommendation_request_timeout_ms";
10726 
10727         /**
10728          * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in
10729          * {@link com.android.server.wifi.RecommendedNetworkEvaluator}.
10730          *
10731          * Type: long
10732          * @hide
10733          */
10734         public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS =
10735                 "recommended_network_evaluator_cache_expiry_ms";
10736 
10737         /**
10738          * Whether wifi scan throttle is enabled or not.
10739          * This is intended to be used via adb commands or a menu in developer option to turn off
10740          * the default wifi scan throttling mechanism for apps.
10741          *
10742          * Type: int (0 for false, 1 for true)
10743          * @hide
10744          */
10745         public static final String WIFI_SCAN_THROTTLE_ENABLED = "wifi_scan_throttle_enabled";
10746 
10747         private static final Validator WIFI_SCAN_THROTTLE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
10748 
10749         /**
10750         * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
10751         * connectivity.
10752         * @hide
10753         */
10754         public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled";
10755 
10756         /**
10757          * The length in milliseconds of a BLE scan window in a low-power scan mode.
10758          * @hide
10759          */
10760         public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms";
10761 
10762         /**
10763          * The length in milliseconds of a BLE scan window in a balanced scan mode.
10764          * @hide
10765          */
10766         public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms";
10767 
10768         /**
10769          * The length in milliseconds of a BLE scan window in a low-latency scan mode.
10770          * @hide
10771          */
10772         public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS =
10773                 "ble_scan_low_latency_window_ms";
10774 
10775         /**
10776          * The length in milliseconds of a BLE scan interval in a low-power scan mode.
10777          * @hide
10778          */
10779         public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS =
10780                 "ble_scan_low_power_interval_ms";
10781 
10782         /**
10783          * The length in milliseconds of a BLE scan interval in a balanced scan mode.
10784          * @hide
10785          */
10786         public static final String BLE_SCAN_BALANCED_INTERVAL_MS =
10787                 "ble_scan_balanced_interval_ms";
10788 
10789         /**
10790          * The length in milliseconds of a BLE scan interval in a low-latency scan mode.
10791          * @hide
10792          */
10793         public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS =
10794                 "ble_scan_low_latency_interval_ms";
10795 
10796         /**
10797          * The mode that BLE scanning clients will be moved to when in the background.
10798          * @hide
10799          */
10800         public static final String BLE_SCAN_BACKGROUND_MODE = "ble_scan_background_mode";
10801 
10802        /**
10803         * Used to save the Wifi_ON state prior to tethering.
10804         * This state will be checked to restore Wifi after
10805         * the user turns off tethering.
10806         *
10807         * @hide
10808         */
10809        @UnsupportedAppUsage
10810        public static final String WIFI_SAVED_STATE = "wifi_saved_state";
10811 
10812        /**
10813         * The interval in milliseconds to scan as used by the wifi supplicant
10814         * @hide
10815         */
10816        public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
10817                "wifi_supplicant_scan_interval_ms";
10818 
10819         /**
10820          * whether frameworks handles wifi auto-join
10821          * @hide
10822          */
10823        public static final String WIFI_ENHANCED_AUTO_JOIN =
10824                 "wifi_enhanced_auto_join";
10825 
10826         /**
10827          * whether settings show RSSI
10828          * @hide
10829          */
10830         public static final String WIFI_NETWORK_SHOW_RSSI =
10831                 "wifi_network_show_rssi";
10832 
10833         /**
10834         * The interval in milliseconds to scan at supplicant when p2p is connected
10835         * @hide
10836         */
10837        public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
10838                "wifi_scan_interval_p2p_connected_ms";
10839 
10840        /**
10841         * Whether the Wi-Fi watchdog is enabled.
10842         */
10843        public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
10844 
10845        /**
10846         * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
10847         * the setting needs to be set to 0 to disable it.
10848         * @hide
10849         */
10850        @UnsupportedAppUsage
10851        public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
10852                "wifi_watchdog_poor_network_test_enabled";
10853 
10854        private static final Validator WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR =
10855                ANY_STRING_VALIDATOR;
10856 
10857        /**
10858         * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
10859         * needs to be set to 0 to disable it.
10860         * @hide
10861         */
10862        public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
10863                "wifi_suspend_optimizations_enabled";
10864 
10865        /**
10866         * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1
10867         * will enable it. In the future, additional values may be supported.
10868         * @hide
10869         */
10870        public static final String WIFI_VERBOSE_LOGGING_ENABLED =
10871                "wifi_verbose_logging_enabled";
10872 
10873         /**
10874          * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and
10875          * setting to 1 will enable it. In the future, additional values may be supported.
10876          * @deprecated MAC randomization is now a per-network setting
10877          * @hide
10878          */
10879         @Deprecated
10880         public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED =
10881                 "wifi_connected_mac_randomization_enabled";
10882 
10883         /**
10884          * Parameters to adjust the performance of framework wifi scoring methods.
10885          * <p>
10886          * Encoded as a comma-separated key=value list, for example:
10887          *   "rssi5=-80:-77:-70:-57,rssi2=-83:-80:-73:-60,horizon=15"
10888          * This is intended for experimenting with new parameter values,
10889          * and is normally unset or empty. The example does not include all
10890          * parameters that may be honored.
10891          * Default values are provided by code or device configurations.
10892          * Errors in the parameters will cause the entire setting to be ignored.
10893          * @hide
10894          */
10895         public static final String WIFI_SCORE_PARAMS =
10896                 "wifi_score_params";
10897 
10898         /**
10899          * Setting to enable logging WifiIsUnusableEvent in metrics
10900          * which gets triggered when wifi becomes unusable.
10901          * Disabled by default, and setting it to 1 will enable it.
10902          * @hide
10903          */
10904         public static final String WIFI_IS_UNUSABLE_EVENT_METRICS_ENABLED =
10905                 "wifi_is_unusable_event_metrics_enabled";
10906 
10907         /**
10908          * The minimum number of txBad the framework has to observe
10909          * to trigger a wifi data stall.
10910          * @hide
10911          */
10912         public static final String WIFI_DATA_STALL_MIN_TX_BAD =
10913                 "wifi_data_stall_min_tx_bad";
10914 
10915         /**
10916          * The minimum number of txSuccess the framework has to observe
10917          * to trigger a wifi data stall when rxSuccess is 0.
10918          * @hide
10919          */
10920         public static final String WIFI_DATA_STALL_MIN_TX_SUCCESS_WITHOUT_RX =
10921                 "wifi_data_stall_min_tx_success_without_rx";
10922 
10923         /**
10924          * Setting to enable logging Wifi LinkSpeedCounts in metrics.
10925          * Disabled by default, and setting it to 1 will enable it.
10926          * @hide
10927          */
10928         public static final String WIFI_LINK_SPEED_METRICS_ENABLED =
10929                 "wifi_link_speed_metrics_enabled";
10930 
10931         /**
10932          * Setting to enable the PNO frequency culling optimization.
10933          * Disabled by default, and setting it to 1 will enable it.
10934          * The value is boolean (0 or 1).
10935          * @hide
10936          */
10937         public static final String WIFI_PNO_FREQUENCY_CULLING_ENABLED =
10938                 "wifi_pno_frequency_culling_enabled";
10939 
10940         private static final Validator WIFI_PNO_FREQUENCY_CULLING_ENABLED_VALIDATOR =
10941                 BOOLEAN_VALIDATOR;
10942 
10943         /**
10944          * Setting to enable including recency information when determining pno network priorities.
10945          * Disabled by default, and setting it to 1 will enable it.
10946          * The value is boolean (0 or 1).
10947          * @hide
10948          */
10949         public static final String WIFI_PNO_RECENCY_SORTING_ENABLED =
10950                 "wifi_pno_recency_sorting_enabled";
10951 
10952         private static final Validator WIFI_PNO_RECENCY_SORTING_ENABLED_VALIDATOR =
10953                 BOOLEAN_VALIDATOR;
10954 
10955         /**
10956          * Setting to enable the Wi-Fi link probing.
10957          * Enabled by default, and setting it to 0 will disable it.
10958          * The value is boolean (0 or 1).
10959          * @hide
10960          */
10961         public static final String WIFI_LINK_PROBING_ENABLED =
10962                 "wifi_link_probing_enabled";
10963 
10964         private static final Validator WIFI_LINK_PROBING_ENABLED_VALIDATOR =
10965                 BOOLEAN_VALIDATOR;
10966 
10967        /**
10968         * The maximum number of times we will retry a connection to an access
10969         * point for which we have failed in acquiring an IP address from DHCP.
10970         * A value of N means that we will make N+1 connection attempts in all.
10971         */
10972        public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
10973 
10974        /**
10975         * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
10976         * data connectivity to be established after a disconnect from Wi-Fi.
10977         */
10978        public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
10979            "wifi_mobile_data_transition_wakelock_timeout_ms";
10980 
10981        /**
10982         * This setting controls whether WiFi configurations created by a Device Owner app
10983         * should be locked down (that is, be editable or removable only by the Device Owner App,
10984         * not even by Settings app).
10985         * This setting takes integer values. Non-zero values mean DO created configurations
10986         * are locked down. Value of zero means they are not. Default value in the absence of
10987         * actual value to this setting is 0.
10988         */
10989        public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN =
10990                "wifi_device_owner_configs_lockdown";
10991 
10992        /**
10993         * The operational wifi frequency band
10994         * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
10995         * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
10996         * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
10997         *
10998         * @hide
10999         */
11000        public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
11001 
11002        /**
11003         * The Wi-Fi peer-to-peer device name
11004         * @hide
11005         */
11006        public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
11007 
11008        /**
11009         * The min time between wifi disable and wifi enable
11010         * @hide
11011         */
11012        public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
11013 
11014        /**
11015         * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
11016         * from an ephemeral network if there is no BSSID for that network with a non-null score that
11017         * has been seen in this time period.
11018         *
11019         * If this is less than or equal to zero, we use a more conservative behavior and only check
11020         * for a non-null score from the currently connected or target BSSID.
11021         * @hide
11022         */
11023        public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
11024                "wifi_ephemeral_out_of_range_timeout_ms";
11025 
11026        /**
11027         * The number of milliseconds to delay when checking for data stalls during
11028         * non-aggressive detection. (screen is turned off.)
11029         * @hide
11030         */
11031        public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
11032                "data_stall_alarm_non_aggressive_delay_in_ms";
11033 
11034        /**
11035         * The number of milliseconds to delay when checking for data stalls during
11036         * aggressive detection. (screen on or suspected data stall)
11037         * @hide
11038         */
11039        public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
11040                "data_stall_alarm_aggressive_delay_in_ms";
11041 
11042        /**
11043         * The number of milliseconds to allow the provisioning apn to remain active
11044         * @hide
11045         */
11046        public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
11047                "provisioning_apn_alarm_delay_in_ms";
11048 
11049        /**
11050         * The interval in milliseconds at which to check gprs registration
11051         * after the first registration mismatch of gprs and voice service,
11052         * to detect possible data network registration problems.
11053         *
11054         * @hide
11055         */
11056        public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
11057                "gprs_register_check_period_ms";
11058 
11059        /**
11060         * Nonzero causes Log.wtf() to crash.
11061         * @hide
11062         */
11063        public static final String WTF_IS_FATAL = "wtf_is_fatal";
11064 
11065        /**
11066         * Ringer mode. This is used internally, changing this value will not
11067         * change the ringer mode. See AudioManager.
11068         */
11069        public static final String MODE_RINGER = "mode_ringer";
11070 
11071        /**
11072         * Overlay display devices setting.
11073         * The associated value is a specially formatted string that describes the
11074         * size and density of simulated secondary display devices.
11075         * <p>
11076         * Format: {width}x{height}/{dpi};...
11077         * </p><p>
11078         * Example:
11079         * <ul>
11080         * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
11081         * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
11082         * at 1080p and the second at 720p.</li>
11083         * <li>If the value is empty, then no overlay display devices are created.</li>
11084         * </ul></p>
11085         *
11086         * @hide
11087         */
11088        @TestApi
11089        public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
11090 
11091         /**
11092          * Threshold values for the duration and level of a discharge cycle,
11093          * under which we log discharge cycle info.
11094          *
11095          * @hide
11096          */
11097         public static final String
11098                 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
11099 
11100         /** @hide */
11101         public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
11102 
11103         /**
11104          * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
11105          * intents on application crashes and ANRs. If this is disabled, the
11106          * crash/ANR dialog will never display the "Report" button.
11107          * <p>
11108          * Type: int (0 = disallow, 1 = allow)
11109          *
11110          * @hide
11111          */
11112         public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
11113 
11114         /**
11115          * Maximum age of entries kept by {@link DropBoxManager}.
11116          *
11117          * @hide
11118          */
11119         public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
11120 
11121         /**
11122          * Maximum number of entry files which {@link DropBoxManager} will keep
11123          * around.
11124          *
11125          * @hide
11126          */
11127         public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
11128 
11129         /**
11130          * Maximum amount of disk space used by {@link DropBoxManager} no matter
11131          * what.
11132          *
11133          * @hide
11134          */
11135         public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
11136 
11137         /**
11138          * Percent of free disk (excluding reserve) which {@link DropBoxManager}
11139          * will use.
11140          *
11141          * @hide
11142          */
11143         public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
11144 
11145         /**
11146          * Percent of total disk which {@link DropBoxManager} will never dip
11147          * into.
11148          *
11149          * @hide
11150          */
11151         public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
11152 
11153         /**
11154          * Prefix for per-tag dropbox disable/enable settings.
11155          *
11156          * @hide
11157          */
11158         public static final String DROPBOX_TAG_PREFIX = "dropbox:";
11159 
11160         /**
11161          * Lines of logcat to include with system crash/ANR/etc. reports, as a
11162          * prefix of the dropbox tag of the report type. For example,
11163          * "logcat_for_system_server_anr" controls the lines of logcat captured
11164          * with system server ANR reports. 0 to disable.
11165          *
11166          * @hide
11167          */
11168         public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
11169 
11170         /**
11171          * The interval in minutes after which the amount of free storage left
11172          * on the device is logged to the event log
11173          *
11174          * @hide
11175          */
11176         public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
11177 
11178         /**
11179          * Threshold for the amount of change in disk free space required to
11180          * report the amount of free space. Used to prevent spamming the logs
11181          * when the disk free space isn't changing frequently.
11182          *
11183          * @hide
11184          */
11185         public static final String
11186                 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
11187 
11188         /**
11189          * Minimum percentage of free storage on the device that is used to
11190          * determine if the device is running low on storage. The default is 10.
11191          * <p>
11192          * Say this value is set to 10, the device is considered running low on
11193          * storage if 90% or more of the device storage is filled up.
11194          *
11195          * @hide
11196          */
11197         public static final String
11198                 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
11199 
11200         /**
11201          * Maximum byte size of the low storage threshold. This is to ensure
11202          * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
11203          * overly large threshold for large storage devices. Currently this must
11204          * be less than 2GB. This default is 500MB.
11205          *
11206          * @hide
11207          */
11208         public static final String
11209                 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
11210 
11211         /**
11212          * Minimum bytes of free storage on the device before the data partition
11213          * is considered full. By default, 1 MB is reserved to avoid system-wide
11214          * SQLite disk full exceptions.
11215          *
11216          * @hide
11217          */
11218         public static final String
11219                 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
11220 
11221         /**
11222          * Minimum percentage of storage on the device that is reserved for
11223          * cached data.
11224          *
11225          * @hide
11226          */
11227         public static final String
11228                 SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage";
11229 
11230         /**
11231          * Maximum bytes of storage on the device that is reserved for cached
11232          * data.
11233          *
11234          * @hide
11235          */
11236         public static final String
11237                 SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes";
11238 
11239         /**
11240          * The maximum reconnect delay for short network outages or when the
11241          * network is suspended due to phone use.
11242          *
11243          * @hide
11244          */
11245         public static final String
11246                 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
11247 
11248         /**
11249          * The number of milliseconds to delay before sending out
11250          * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
11251          *
11252          * @hide
11253          */
11254         public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
11255 
11256 
11257         /**
11258          * Network sampling interval, in seconds. We'll generate link information
11259          * about bytes/packets sent and error rates based on data sampled in this interval
11260          *
11261          * @hide
11262          */
11263 
11264         public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
11265                 "connectivity_sampling_interval_in_seconds";
11266 
11267         /**
11268          * The series of successively longer delays used in retrying to download PAC file.
11269          * Last delay is used between successful PAC downloads.
11270          *
11271          * @hide
11272          */
11273         public static final String PAC_CHANGE_DELAY = "pac_change_delay";
11274 
11275         /**
11276          * Don't attempt to detect captive portals.
11277          *
11278          * @hide
11279          */
11280         public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0;
11281 
11282         /**
11283          * When detecting a captive portal, display a notification that
11284          * prompts the user to sign in.
11285          *
11286          * @hide
11287          */
11288         public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1;
11289 
11290         /**
11291          * When detecting a captive portal, immediately disconnect from the
11292          * network and do not reconnect to that network in the future.
11293          *
11294          * @hide
11295          */
11296         public static final int CAPTIVE_PORTAL_MODE_AVOID = 2;
11297 
11298         /**
11299          * What to do when connecting a network that presents a captive portal.
11300          * Must be one of the CAPTIVE_PORTAL_MODE_* constants above.
11301          *
11302          * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT.
11303          * @hide
11304          */
11305         public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
11306 
11307         /**
11308          * Setting to turn off captive portal detection. Feature is enabled by
11309          * default and the setting needs to be set to 0 to disable it.
11310          *
11311          * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection
11312          * @hide
11313          */
11314         @Deprecated
11315         public static final String
11316                 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
11317 
11318         /**
11319          * The server used for captive portal detection upon a new conection. A
11320          * 204 response code from the server is used for validation.
11321          * TODO: remove this deprecated symbol.
11322          *
11323          * @hide
11324          */
11325         public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
11326 
11327         /**
11328          * The URL used for HTTPS captive portal detection upon a new connection.
11329          * A 204 response code from the server is used for validation.
11330          *
11331          * @hide
11332          */
11333         public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
11334 
11335         /**
11336          * The URL used for HTTP captive portal detection upon a new connection.
11337          * A 204 response code from the server is used for validation.
11338          *
11339          * @hide
11340          */
11341         public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
11342 
11343         /**
11344          * The URL used for fallback HTTP captive portal detection when previous HTTP
11345          * and HTTPS captive portal detection attemps did not return a conclusive answer.
11346          *
11347          * @hide
11348          */
11349         public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
11350 
11351         /**
11352          * A comma separated list of URLs used for captive portal detection in addition to the
11353          * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings.
11354          *
11355          * @hide
11356          */
11357         public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS =
11358                 "captive_portal_other_fallback_urls";
11359 
11360         /**
11361          * A list of captive portal detection specifications used in addition to the fallback URLs.
11362          * Each spec has the format url@@/@@statusCodeRegex@@/@@contentRegex. Specs are separated
11363          * by "@@,@@".
11364          * @hide
11365          */
11366         public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS =
11367                 "captive_portal_fallback_probe_specs";
11368 
11369         /**
11370          * Whether to use HTTPS for network validation. This is enabled by default and the setting
11371          * needs to be set to 0 to disable it. This setting is a misnomer because captive portals
11372          * don't actually use HTTPS, but it's consistent with the other settings.
11373          *
11374          * @hide
11375          */
11376         public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
11377 
11378         /**
11379          * Which User-Agent string to use in the header of the captive portal detection probes.
11380          * The User-Agent field is unset when this setting has no value (HttpUrlConnection default).
11381          *
11382          * @hide
11383          */
11384         public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
11385 
11386         /**
11387          * Whether to try cellular data recovery when a bad network is reported.
11388          *
11389          * @hide
11390          */
11391         public static final String DATA_STALL_RECOVERY_ON_BAD_NETWORK =
11392                 "data_stall_recovery_on_bad_network";
11393 
11394         /**
11395          * Minumim duration in millisecodns between cellular data recovery attempts
11396          *
11397          * @hide
11398          */
11399         public static final String MIN_DURATION_BETWEEN_RECOVERY_STEPS_IN_MS =
11400                 "min_duration_between_recovery_steps";
11401         /**
11402          * Whether network service discovery is enabled.
11403          *
11404          * @hide
11405          */
11406         public static final String NSD_ON = "nsd_on";
11407 
11408         /**
11409          * Let user pick default install location.
11410          *
11411          * @hide
11412          */
11413         public static final String SET_INSTALL_LOCATION = "set_install_location";
11414 
11415         /**
11416          * Default install location value.
11417          * 0 = auto, let system decide
11418          * 1 = internal
11419          * 2 = sdcard
11420          * @hide
11421          */
11422         public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
11423 
11424         /**
11425          * ms during which to consume extra events related to Inet connection
11426          * condition after a transtion to fully-connected
11427          *
11428          * @hide
11429          */
11430         public static final String
11431                 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
11432 
11433         /**
11434          * ms during which to consume extra events related to Inet connection
11435          * condtion after a transtion to partly-connected
11436          *
11437          * @hide
11438          */
11439         public static final String
11440                 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
11441 
11442         /** {@hide} */
11443         public static final String
11444                 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
11445 
11446         /**
11447          * Host name and port for global http proxy. Uses ':' seperator for
11448          * between host and port.
11449          */
11450         public static final String HTTP_PROXY = "http_proxy";
11451 
11452         /**
11453          * Host name for global http proxy. Set via ConnectivityManager.
11454          *
11455          * @hide
11456          */
11457         public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
11458 
11459         /**
11460          * Integer host port for global http proxy. Set via ConnectivityManager.
11461          *
11462          * @hide
11463          */
11464         public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
11465 
11466         /**
11467          * Exclusion list for global proxy. This string contains a list of
11468          * comma-separated domains where the global proxy does not apply.
11469          * Domains should be listed in a comma- separated list. Example of
11470          * acceptable formats: ".domain1.com,my.domain2.com" Use
11471          * ConnectivityManager to set/get.
11472          *
11473          * @hide
11474          */
11475         public static final String
11476                 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
11477 
11478         /**
11479          * The location PAC File for the proxy.
11480          * @hide
11481          */
11482         public static final String
11483                 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
11484 
11485         /**
11486          * Enables the UI setting to allow the user to specify the global HTTP
11487          * proxy and associated exclusion list.
11488          *
11489          * @hide
11490          */
11491         public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
11492 
11493         /**
11494          * Setting for default DNS in case nobody suggests one
11495          *
11496          * @hide
11497          */
11498         public static final String DEFAULT_DNS_SERVER = "default_dns_server";
11499 
11500         /**
11501          * The requested Private DNS mode (string), and an accompanying specifier (string).
11502          *
11503          * Currently, the specifier holds the chosen provider name when the mode requests
11504          * a specific provider. It may be used to store the provider name even when the
11505          * mode changes so that temporarily disabling and re-enabling the specific
11506          * provider mode does not necessitate retyping the provider hostname.
11507          *
11508          * @hide
11509          */
11510         public static final String PRIVATE_DNS_MODE = "private_dns_mode";
11511 
11512         private static final Validator PRIVATE_DNS_MODE_VALIDATOR = ANY_STRING_VALIDATOR;
11513 
11514         /**
11515          * @hide
11516          */
11517         public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier";
11518 
11519         private static final Validator PRIVATE_DNS_SPECIFIER_VALIDATOR = ANY_STRING_VALIDATOR;
11520 
11521         /**
11522           * Forced override of the default mode (hardcoded as "automatic", nee "opportunistic").
11523           * This allows changing the default mode without effectively disabling other modes,
11524           * all of which require explicit user action to enable/configure. See also b/79719289.
11525           *
11526           * Value is a string, suitable for assignment to PRIVATE_DNS_MODE above.
11527           *
11528           * {@hide}
11529           */
11530         public static final String PRIVATE_DNS_DEFAULT_MODE = "private_dns_default_mode";
11531 
11532 
11533         /** {@hide} */
11534         public static final String
11535                 BLUETOOTH_BTSNOOP_DEFAULT_MODE = "bluetooth_btsnoop_default_mode";
11536         /** {@hide} */
11537         public static final String
11538                 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
11539         /** {@hide} */
11540         public static final String
11541                 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
11542         /** {@hide} */
11543         public static final String
11544                 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_";
11545         /** {@hide} */
11546         public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX =
11547                 "bluetooth_a2dp_supports_optional_codecs_";
11548         /** {@hide} */
11549         public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX =
11550                 "bluetooth_a2dp_optional_codecs_enabled_";
11551         /** {@hide} */
11552         public static final String
11553                 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
11554         /** {@hide} */
11555         public static final String
11556                 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
11557         /** {@hide} */
11558         public static final String
11559                 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_";
11560         /** {@hide} */
11561         public static final String
11562                 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_";
11563         /** {@hide} */
11564         public static final String
11565                 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
11566         /** {@hide} */
11567         public static final String
11568                 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_";
11569         /** {@hide} */
11570         public static final String
11571                 BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_";
11572         /**
11573          * Enable/disable radio bug detection
11574          *
11575          * {@hide}
11576          */
11577         public static final String
11578                 ENABLE_RADIO_BUG_DETECTION = "enable_radio_bug_detection";
11579 
11580         /**
11581          * Count threshold of RIL wakelock timeout for radio bug detection
11582          *
11583          * {@hide}
11584          */
11585         public static final String
11586                 RADIO_BUG_WAKELOCK_TIMEOUT_COUNT_THRESHOLD =
11587                 "radio_bug_wakelock_timeout_count_threshold";
11588 
11589         /**
11590          * Count threshold of RIL system error for radio bug detection
11591          *
11592          * {@hide}
11593          */
11594         public static final String
11595                 RADIO_BUG_SYSTEM_ERROR_COUNT_THRESHOLD =
11596                 "radio_bug_system_error_count_threshold";
11597 
11598         /**
11599          * Activity manager specific settings.
11600          * This is encoded as a key=value list, separated by commas. Ex:
11601          *
11602          * "gc_timeout=5000,max_cached_processes=24"
11603          *
11604          * The following keys are supported:
11605          *
11606          * <pre>
11607          * max_cached_processes                 (int)
11608          * background_settle_time               (long)
11609          * fgservice_min_shown_time             (long)
11610          * fgservice_min_report_time            (long)
11611          * fgservice_screen_on_before_time      (long)
11612          * fgservice_screen_on_after_time       (long)
11613          * content_provider_retain_time         (long)
11614          * gc_timeout                           (long)
11615          * gc_min_interval                      (long)
11616          * full_pss_min_interval                (long)
11617          * full_pss_lowered_interval            (long)
11618          * power_check_interval                 (long)
11619          * power_check_max_cpu_1                (int)
11620          * power_check_max_cpu_2                (int)
11621          * power_check_max_cpu_3                (int)
11622          * power_check_max_cpu_4                (int)
11623          * service_usage_interaction_time       (long)
11624          * usage_stats_interaction_interval     (long)
11625          * service_restart_duration             (long)
11626          * service_reset_run_duration           (long)
11627          * service_restart_duration_factor      (int)
11628          * service_min_restart_time_between     (long)
11629          * service_max_inactivity               (long)
11630          * service_bg_start_timeout             (long)
11631          * service_bg_activity_start_timeout    (long)
11632          * process_start_async                  (boolean)
11633          * </pre>
11634          *
11635          * <p>
11636          * Type: string
11637          * @hide
11638          * @see com.android.server.am.ActivityManagerConstants
11639          */
11640         public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants";
11641 
11642         /**
11643          * Feature flag to enable or disable the activity starts logging feature.
11644          * Type: int (0 for false, 1 for true)
11645          * Default: 1
11646          * @hide
11647          */
11648         public static final String ACTIVITY_STARTS_LOGGING_ENABLED
11649                 = "activity_starts_logging_enabled";
11650 
11651         /**
11652          * @hide
11653          * @see com.android.server.appbinding.AppBindingConstants
11654          */
11655         public static final String APP_BINDING_CONSTANTS = "app_binding_constants";
11656 
11657         /**
11658          * App ops specific settings.
11659          * This is encoded as a key=value list, separated by commas. Ex:
11660          *
11661          * "state_settle_time=10000"
11662          *
11663          * The following keys are supported:
11664          *
11665          * <pre>
11666          * top_state_settle_time                (long)
11667          * fg_service_state_settle_time         (long)
11668          * bg_state_settle_time                 (long)
11669          * </pre>
11670          *
11671          * <p>
11672          * Type: string
11673          * @hide
11674          * @see com.android.server.AppOpsService.Constants
11675          */
11676         public static final String APP_OPS_CONSTANTS = "app_ops_constants";
11677 
11678         /**
11679          * Device Idle (Doze) specific settings.
11680          * This is encoded as a key=value list, separated by commas. Ex:
11681          *
11682          * "inactive_to=60000,sensing_to=400000"
11683          *
11684          * The following keys are supported:
11685          *
11686          * <pre>
11687          * inactive_to                      (long)
11688          * sensing_to                       (long)
11689          * motion_inactive_to               (long)
11690          * idle_after_inactive_to           (long)
11691          * idle_pending_to                  (long)
11692          * max_idle_pending_to              (long)
11693          * idle_pending_factor              (float)
11694          * quick_doze_delay_to              (long)
11695          * idle_to                          (long)
11696          * max_idle_to                      (long)
11697          * idle_factor                      (float)
11698          * min_time_to_alarm                (long)
11699          * max_temp_app_whitelist_duration  (long)
11700          * notification_whitelist_duration  (long)
11701          * </pre>
11702          *
11703          * <p>
11704          * Type: string
11705          * @hide
11706          * @see com.android.server.DeviceIdleController.Constants
11707          */
11708         public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants";
11709 
11710         /**
11711          * Battery Saver specific settings
11712          * This is encoded as a key=value list, separated by commas. Ex:
11713          *
11714          * "vibration_disabled=true,adjust_brightness_factor=0.5"
11715          *
11716          * The following keys are supported:
11717          *
11718          * <pre>
11719          * advertise_is_enabled              (boolean)
11720          * datasaver_disabled                (boolean)
11721          * enable_night_mode                 (boolean)
11722          * launch_boost_disabled             (boolean)
11723          * vibration_disabled                (boolean)
11724          * animation_disabled                (boolean)
11725          * soundtrigger_disabled             (boolean)
11726          * fullbackup_deferred               (boolean)
11727          * keyvaluebackup_deferred           (boolean)
11728          * firewall_disabled                 (boolean)
11729          * gps_mode                          (int)
11730          * adjust_brightness_disabled        (boolean)
11731          * adjust_brightness_factor          (float)
11732          * force_all_apps_standby            (boolean)
11733          * force_background_check            (boolean)
11734          * optional_sensors_disabled         (boolean)
11735          * aod_disabled                      (boolean)
11736          * quick_doze_enabled                (boolean)
11737          * </pre>
11738          * @hide
11739          * @see com.android.server.power.batterysaver.BatterySaverPolicy
11740          */
11741         @TestApi
11742         public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants";
11743 
11744         /**
11745          * Battery Saver device specific settings
11746          * This is encoded as a key=value list, separated by commas.
11747          *
11748          * The following keys are supported:
11749          *
11750          * <pre>
11751          *     cpufreq-i (list of "core-number:frequency" pairs concatenated with /)
11752          *     cpufreq-n (list of "core-number:frequency" pairs concatenated with /)
11753          * </pre>
11754          *
11755          * See {@link com.android.server.power.batterysaver.BatterySaverPolicy} for the details.
11756          *
11757          * @hide
11758          */
11759         public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS =
11760                 "battery_saver_device_specific_constants";
11761 
11762         /**
11763          * Settings for adaptive Battery Saver mode. Uses the same flags as
11764          * {@link #BATTERY_SAVER_CONSTANTS}.
11765          *
11766          * @hide
11767          */
11768         public static final String BATTERY_SAVER_ADAPTIVE_CONSTANTS =
11769                 "battery_saver_adaptive_constants";
11770 
11771         /**
11772          * Device specific settings for adaptive Battery Saver mode. Uses the same flags as
11773          * {@link #BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS}.
11774          *
11775          * @hide
11776          */
11777         public static final String BATTERY_SAVER_ADAPTIVE_DEVICE_SPECIFIC_CONSTANTS =
11778                 "battery_saver_adaptive_device_specific_constants";
11779 
11780         /**
11781          * Battery tip specific settings
11782          * This is encoded as a key=value list, separated by commas. Ex:
11783          *
11784          * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true,"
11785          * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50,"
11786          * "high_usage_battery_draining=25,high_usage_period_ms=3000"
11787          *
11788          * The following keys are supported:
11789          *
11790          * <pre>
11791          * battery_tip_enabled              (boolean)
11792          * summary_enabled                  (boolean)
11793          * battery_saver_tip_enabled        (boolean)
11794          * high_usage_enabled               (boolean)
11795          * high_usage_app_count             (int)
11796          * high_usage_period_ms             (long)
11797          * high_usage_battery_draining      (int)
11798          * app_restriction_enabled          (boolean)
11799          * reduced_battery_enabled          (boolean)
11800          * reduced_battery_percent          (int)
11801          * low_battery_enabled              (boolean)
11802          * low_battery_hour                 (int)
11803          * </pre>
11804          * @hide
11805          */
11806         public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants";
11807 
11808         /**
11809          * Battery anomaly detection specific settings
11810          * This is encoded as a key=value list, separated by commas.
11811          * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via
11812          * {@link Uri#encode(String)}, separated by colons. Ex:
11813          *
11814          * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true,"
11815          * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon"
11816          *
11817          * The following keys are supported:
11818          *
11819          * <pre>
11820          * anomaly_detection_enabled       (boolean)
11821          * wakelock_enabled                (boolean)
11822          * wakelock_threshold              (long)
11823          * wakeup_alarm_enabled            (boolean)
11824          * wakeup_alarm_threshold          (long)
11825          * wakeup_blacklisted_tags         (string)
11826          * bluetooth_scan_enabled          (boolean)
11827          * bluetooth_scan_threshold        (long)
11828          * </pre>
11829          * @hide
11830          */
11831         public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants";
11832 
11833         /**
11834          * An integer to show the version of the anomaly config. Ex: 1, which means
11835          * current version is 1.
11836          * @hide
11837          */
11838         public static final String ANOMALY_CONFIG_VERSION = "anomaly_config_version";
11839 
11840         /**
11841          * A base64-encoded string represents anomaly stats config, used for
11842          * {@link android.app.StatsManager}.
11843          * @hide
11844          */
11845         public static final String ANOMALY_CONFIG = "anomaly_config";
11846 
11847         /**
11848          * Always on display(AOD) specific settings
11849          * This is encoded as a key=value list, separated by commas. Ex:
11850          *
11851          * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4"
11852          *
11853          * The following keys are supported:
11854          *
11855          * <pre>
11856          * screen_brightness_array         (int[])
11857          * dimming_scrim_array             (int[])
11858          * prox_screen_off_delay           (long)
11859          * prox_cooldown_trigger           (long)
11860          * prox_cooldown_period            (long)
11861          * </pre>
11862          * @hide
11863          */
11864         public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants";
11865 
11866         /**
11867         * System VDSO global setting. This links to the "sys.vdso" system property.
11868         * The following values are supported:
11869         * false  -> both 32 and 64 bit vdso disabled
11870         * 32     -> 32 bit vdso enabled
11871         * 64     -> 64 bit vdso enabled
11872         * Any other value defaults to both 32 bit and 64 bit true.
11873         * @hide
11874         */
11875         public static final String SYS_VDSO = "sys_vdso";
11876 
11877         /**
11878         * UidCpuPower global setting. This links the sys.uidcpupower system property.
11879         * The following values are supported:
11880         * 0 -> /proc/uid_cpupower/* are disabled
11881         * 1 -> /proc/uid_cpupower/* are enabled
11882         * Any other value defaults to enabled.
11883         * @hide
11884         */
11885         public static final String SYS_UIDCPUPOWER = "sys_uidcpupower";
11886 
11887         /**
11888         * traced global setting. This controls weather the deamons: traced and
11889         * traced_probes run. This links the sys.traced system property.
11890         * The following values are supported:
11891         * 0 -> traced and traced_probes are disabled
11892         * 1 -> traced and traced_probes are enabled
11893         * Any other value defaults to disabled.
11894         * @hide
11895         */
11896         public static final String SYS_TRACED = "sys_traced";
11897 
11898         /**
11899          * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the
11900          * device for this setting to take full effect.
11901          *
11902          * @hide
11903          */
11904         public static final String FPS_DEVISOR = "fps_divisor";
11905 
11906         /**
11907          * Flag to enable or disable display panel low power mode (lpm)
11908          * false -> Display panel power saving mode is disabled.
11909          * true  -> Display panel power saving mode is enabled.
11910          *
11911          * @hide
11912          */
11913         public static final String DISPLAY_PANEL_LPM = "display_panel_lpm";
11914 
11915         /**
11916          * App time limit usage source setting.
11917          * This controls which app in a task will be considered the source of usage when
11918          * calculating app usage time limits.
11919          *
11920          * 1 -> task root app
11921          * 2 -> current app
11922          * Any other value defaults to task root app.
11923          *
11924          * Need to reboot the device for this setting to take effect.
11925          * @hide
11926          */
11927         public static final String APP_TIME_LIMIT_USAGE_SOURCE = "app_time_limit_usage_source";
11928 
11929         /**
11930          * App standby (app idle) specific settings.
11931          * This is encoded as a key=value list, separated by commas. Ex:
11932          * <p>
11933          * "idle_duration=5000,parole_interval=4500,screen_thresholds=0/0/60000/120000"
11934          * <p>
11935          * All durations are in millis.
11936          * Array values are separated by forward slashes
11937          * The following keys are supported:
11938          *
11939          * <pre>
11940          * parole_interval                  (long)
11941          * parole_window                    (long)
11942          * parole_duration                  (long)
11943          * screen_thresholds                (long[4])
11944          * elapsed_thresholds               (long[4])
11945          * strong_usage_duration            (long)
11946          * notification_seen_duration       (long)
11947          * system_update_usage_duration     (long)
11948          * prediction_timeout               (long)
11949          * sync_adapter_duration            (long)
11950          * exempted_sync_duration           (long)
11951          * system_interaction_duration      (long)
11952          * initial_foreground_service_start_duration (long)
11953          * stable_charging_threshold        (long)
11954          *
11955          * idle_duration        (long) // This is deprecated and used to circumvent b/26355386.
11956          * idle_duration2       (long) // deprecated
11957          * wallclock_threshold  (long) // deprecated
11958          * </pre>
11959          *
11960          * <p>
11961          * Type: string
11962          * @hide
11963          * @see com.android.server.usage.UsageStatsService.SettingsObserver
11964          */
11965         public static final String APP_IDLE_CONSTANTS = "app_idle_constants";
11966 
11967         /**
11968          * Enable ART bytecode verification verifications for debuggable apps.
11969          * 0 = disable, 1 = enable.
11970          * @hide
11971          */
11972         public static final String ART_VERIFIER_VERIFY_DEBUGGABLE =
11973                 "art_verifier_verify_debuggable";
11974 
11975         /**
11976          * Power manager specific settings.
11977          * This is encoded as a key=value list, separated by commas. Ex:
11978          *
11979          * "no_cached_wake_locks=1"
11980          *
11981          * The following keys are supported:
11982          *
11983          * <pre>
11984          * no_cached_wake_locks                 (boolean)
11985          * </pre>
11986          *
11987          * <p>
11988          * Type: string
11989          * @hide
11990          * @see com.android.server.power.PowerManagerConstants
11991          */
11992         public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants";
11993 
11994         /**
11995          * Alarm manager specific settings.
11996          * This is encoded as a key=value list, separated by commas. Ex:
11997          *
11998          * "min_futurity=5000,allow_while_idle_short_time=4500"
11999          *
12000          * The following keys are supported:
12001          *
12002          * <pre>
12003          * min_futurity                         (long)
12004          * min_interval                         (long)
12005          * allow_while_idle_short_time          (long)
12006          * allow_while_idle_long_time           (long)
12007          * allow_while_idle_whitelist_duration  (long)
12008          * </pre>
12009          *
12010          * <p>
12011          * Type: string
12012          * @hide
12013          * @see com.android.server.AlarmManagerService.Constants
12014          */
12015         public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants";
12016 
12017         /**
12018          * Job scheduler specific settings.
12019          * This is encoded as a key=value list, separated by commas. Ex:
12020          *
12021          * "min_ready_jobs_count=2,moderate_use_factor=.5"
12022          *
12023          * The following keys are supported:
12024          *
12025          * <pre>
12026          * min_idle_count                       (int)
12027          * min_charging_count                   (int)
12028          * min_connectivity_count               (int)
12029          * min_content_count                    (int)
12030          * min_ready_jobs_count                 (int)
12031          * heavy_use_factor                     (float)
12032          * moderate_use_factor                  (float)
12033          * fg_job_count                         (int)
12034          * bg_normal_job_count                  (int)
12035          * bg_moderate_job_count                (int)
12036          * bg_low_job_count                     (int)
12037          * bg_critical_job_count                (int)
12038          * </pre>
12039          *
12040          * <p>
12041          * Type: string
12042          * @hide
12043          * @see com.android.server.job.JobSchedulerService.Constants
12044          */
12045         public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants";
12046 
12047         /**
12048          * Job scheduler QuotaController specific settings.
12049          * This is encoded as a key=value list, separated by commas. Ex:
12050          *
12051          * "max_job_count_working=5,max_job_count_rare=2"
12052          *
12053          * <p>
12054          * Type: string
12055          *
12056          * @hide
12057          * @see com.android.server.job.JobSchedulerService.Constants
12058          */
12059         public static final String JOB_SCHEDULER_QUOTA_CONTROLLER_CONSTANTS =
12060                 "job_scheduler_quota_controller_constants";
12061 
12062         /**
12063          * Job scheduler TimeController specific settings.
12064          * This is encoded as a key=value list, separated by commas. Ex:
12065          *
12066          * "skip_not_ready_jobs=true5,other_key=2"
12067          *
12068          * <p>
12069          * Type: string
12070          *
12071          * @hide
12072          * @see com.android.server.job.JobSchedulerService.Constants
12073          */
12074         public static final String JOB_SCHEDULER_TIME_CONTROLLER_CONSTANTS =
12075                 "job_scheduler_time_controller_constants";
12076 
12077         /**
12078          * ShortcutManager specific settings.
12079          * This is encoded as a key=value list, separated by commas. Ex:
12080          *
12081          * "reset_interval_sec=86400,max_updates_per_interval=1"
12082          *
12083          * The following keys are supported:
12084          *
12085          * <pre>
12086          * reset_interval_sec              (long)
12087          * max_updates_per_interval        (int)
12088          * max_icon_dimension_dp           (int, DP)
12089          * max_icon_dimension_dp_lowram    (int, DP)
12090          * max_shortcuts                   (int)
12091          * icon_quality                    (int, 0-100)
12092          * icon_format                     (String)
12093          * </pre>
12094          *
12095          * <p>
12096          * Type: string
12097          * @hide
12098          * @see com.android.server.pm.ShortcutService.ConfigConstants
12099          */
12100         public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants";
12101 
12102         /**
12103          * DevicePolicyManager specific settings.
12104          * This is encoded as a key=value list, separated by commas. Ex:
12105          *
12106          * <pre>
12107          * das_died_service_reconnect_backoff_sec       (long)
12108          * das_died_service_reconnect_backoff_increase  (float)
12109          * das_died_service_reconnect_max_backoff_sec   (long)
12110          * </pre>
12111          *
12112          * <p>
12113          * Type: string
12114          * @hide
12115          * see also com.android.server.devicepolicy.DevicePolicyConstants
12116          */
12117         public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants";
12118 
12119         /**
12120          * TextClassifier specific settings.
12121          * This is encoded as a key=value list, separated by commas. String[] types like
12122          * entity_list_default use ":" as delimiter for values. Ex:
12123          *
12124          * <pre>
12125          * classify_text_max_range_length                   (int)
12126          * detect_language_from_text_enabled                (boolean)
12127          * entity_list_default                              (String[])
12128          * entity_list_editable                             (String[])
12129          * entity_list_not_editable                         (String[])
12130          * generate_links_log_sample_rate                   (int)
12131          * generate_links_max_text_length                   (int)
12132          * in_app_conversation_action_types_default         (String[])
12133          * lang_id_context_settings                         (float[])
12134          * lang_id_threshold_override                       (float)
12135          * local_textclassifier_enabled                     (boolean)
12136          * model_dark_launch_enabled                        (boolean)
12137          * notification_conversation_action_types_default   (String[])
12138          * smart_linkify_enabled                            (boolean)
12139          * smart_select_animation_enabled                   (boolean)
12140          * smart_selection_enabled                          (boolean)
12141          * smart_text_share_enabled                         (boolean)
12142          * suggest_selection_max_range_length               (int)
12143          * system_textclassifier_enabled                    (boolean)
12144          * template_intent_factory_enabled                  (boolean)
12145          * translate_in_classification_enabled              (boolean)
12146          * </pre>
12147          *
12148          * <p>
12149          * Type: string
12150          * @hide
12151          * see also android.view.textclassifier.TextClassificationConstants
12152          */
12153         public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants";
12154 
12155         /**
12156          * BatteryStats specific settings.
12157          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
12158          *
12159          * The following keys are supported:
12160          * <pre>
12161          * track_cpu_times_by_proc_state (boolean)
12162          * track_cpu_active_cluster_time (boolean)
12163          * read_binary_cpu_time          (boolean)
12164          * proc_state_cpu_times_read_delay_ms (long)
12165          * external_stats_collection_rate_limit_ms (long)
12166          * battery_level_collection_delay_ms (long)
12167          * max_history_files (int)
12168          * max_history_buffer_kb (int)
12169          * battery_charged_delay_ms (int)
12170          * </pre>
12171          *
12172          * <p>
12173          * Type: string
12174          * @hide
12175          * see also com.android.internal.os.BatteryStatsImpl.Constants
12176          */
12177         public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants";
12178 
12179         /**
12180          * SyncManager specific settings.
12181          *
12182          * <p>
12183          * Type: string
12184          * @hide
12185          * @see com.android.server.content.SyncManagerConstants
12186          */
12187         public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants";
12188 
12189         /**
12190          * Broadcast dispatch tuning parameters specific to foreground broadcasts.
12191          *
12192          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
12193          *
12194          * The following keys are supported:
12195          * <pre>
12196          * bcast_timeout                (long)
12197          * bcast_slow_time              (long)
12198          * bcast_deferral               (long)
12199          * bcast_deferral_decay_factor  (float)
12200          * bcast_deferral_floor         (long)
12201          * bcast_allow_bg_activity_start_timeout    (long)
12202          * </pre>
12203          *
12204          * @hide
12205          */
12206         public static final String BROADCAST_FG_CONSTANTS = "bcast_fg_constants";
12207 
12208         /**
12209          * Broadcast dispatch tuning parameters specific to background broadcasts.
12210          *
12211          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true".
12212          * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys.
12213          *
12214          * @hide
12215          */
12216         public static final String BROADCAST_BG_CONSTANTS = "bcast_bg_constants";
12217 
12218         /**
12219          * Broadcast dispatch tuning parameters specific to specific "offline" broadcasts.
12220          *
12221          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true".
12222          * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys.
12223          *
12224          * @hide
12225          */
12226         public static final String BROADCAST_OFFLOAD_CONSTANTS = "bcast_offload_constants";
12227 
12228         /**
12229          * Whether or not App Standby feature is enabled by system. This controls throttling of apps
12230          * based on usage patterns and predictions. Platform will turn on this feature if both this
12231          * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on.
12232          * Type: int (0 for false, 1 for true)
12233          * Default: 1
12234          * @hide
12235          * @see #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED
12236          */
12237         @SystemApi
12238         public static final String APP_STANDBY_ENABLED = "app_standby_enabled";
12239 
12240         /**
12241          * Whether or not adaptive battery feature is enabled by user. Platform will turn on this
12242          * feature if both this flag and {@link #APP_STANDBY_ENABLED} is on.
12243          * Type: int (0 for false, 1 for true)
12244          * Default: 1
12245          * @hide
12246          * @see #APP_STANDBY_ENABLED
12247          */
12248         public static final String ADAPTIVE_BATTERY_MANAGEMENT_ENABLED =
12249                 "adaptive_battery_management_enabled";
12250 
12251         /**
12252          * Whether or not app auto restriction is enabled. When it is enabled, settings app will
12253          * auto restrict the app if it has bad behavior(e.g. hold wakelock for long time).
12254          *
12255          * Type: boolean (0 for false, 1 for true)
12256          * Default: 1
12257          *
12258          * @hide
12259          */
12260         public static final String APP_AUTO_RESTRICTION_ENABLED =
12261                 "app_auto_restriction_enabled";
12262 
12263         private static final Validator APP_AUTO_RESTRICTION_ENABLED_VALIDATOR =
12264                 BOOLEAN_VALIDATOR;
12265 
12266         /**
12267          * Feature flag to enable or disable the Forced App Standby feature.
12268          * Type: int (0 for false, 1 for true)
12269          * Default: 1
12270          * @hide
12271          */
12272         public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled";
12273 
12274         /**
12275          * Whether or not to enable Forced App Standby on small battery devices.
12276          * Type: int (0 for false, 1 for true)
12277          * Default: 0
12278          * @hide
12279          */
12280         public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED
12281                 = "forced_app_standby_for_small_battery_enabled";
12282 
12283         /**
12284          * Whether or not to enable the User Absent, Radios Off feature on small battery devices.
12285          * Type: int (0 for false, 1 for true)
12286          * Default: 0
12287          * @hide
12288          */
12289         public static final String USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED
12290                 = "user_absent_radios_off_for_small_battery_enabled";
12291 
12292         /**
12293          * Whether or not to enable the User Absent, Touch Off feature on small battery devices.
12294          * Type: int (0 for false, 1 for true)
12295          * Default: 0
12296          * @hide
12297          */
12298         public static final String USER_ABSENT_TOUCH_OFF_FOR_SMALL_BATTERY_ENABLED
12299                 = "user_absent_touch_off_for_small_battery_enabled";
12300 
12301         /**
12302          * Whether or not to turn on Wifi when proxy is disconnected.
12303          * Type: int (0 for false, 1 for true)
12304          * Default: 1
12305          * @hide
12306          */
12307         public static final String WIFI_ON_WHEN_PROXY_DISCONNECTED
12308                 = "wifi_on_when_proxy_disconnected";
12309 
12310         /**
12311          * Time Only Mode specific settings.
12312          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
12313          *
12314          * The following keys are supported:
12315          *
12316          * <pre>
12317          * enabled                  (boolean)
12318          * disable_home             (boolean)
12319          * disable_tilt_to_wake     (boolean)
12320          * disable_touch_to_wake    (boolean)
12321          * </pre>
12322          * Type: string
12323          * @hide
12324          */
12325         public static final String TIME_ONLY_MODE_CONSTANTS
12326                 = "time_only_mode_constants";
12327 
12328         /**
12329          * Whether of not to send keycode sleep for ungaze when Home is the foreground activity on
12330          * watch type devices.
12331          * Type: int (0 for false, 1 for true)
12332          * Default: 0
12333          * @hide
12334          */
12335         public static final String UNGAZE_SLEEP_ENABLED = "ungaze_sleep_enabled";
12336 
12337         /**
12338          * Whether or not Network Watchlist feature is enabled.
12339          * Type: int (0 for false, 1 for true)
12340          * Default: 0
12341          * @hide
12342          */
12343         public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled";
12344 
12345         /**
12346          * Whether or not show hidden launcher icon apps feature is enabled.
12347          * Type: int (0 for false, 1 for true)
12348          * Default: 1
12349          * @hide
12350          */
12351         public static final String SHOW_HIDDEN_LAUNCHER_ICON_APPS_ENABLED =
12352                 "show_hidden_icon_apps_enabled";
12353 
12354         /**
12355          * Whether or not show new app installed notification is enabled.
12356          * Type: int (0 for false, 1 for true)
12357          * Default: 0
12358          * @hide
12359          */
12360         public static final String SHOW_NEW_APP_INSTALLED_NOTIFICATION_ENABLED =
12361                 "show_new_app_installed_notification_enabled";
12362 
12363         /**
12364          * Flag to keep background restricted profiles running after exiting. If disabled,
12365          * the restricted profile can be put into stopped state as soon as the user leaves it.
12366          * Type: int (0 for false, 1 for true)
12367          *
12368          * Overridden by the system based on device information. If null, the value specified
12369          * by {@code config_keepRestrictedProfilesInBackground} is used.
12370          *
12371          * @hide
12372          */
12373         public static final String KEEP_PROFILE_IN_BACKGROUND = "keep_profile_in_background";
12374 
12375         /**
12376          * The default time in ms within which a subsequent connection from an always allowed system
12377          * is allowed to reconnect without user interaction.
12378          *
12379          * @hide
12380          */
12381         public static final long DEFAULT_ADB_ALLOWED_CONNECTION_TIME = 604800000;
12382 
12383         /**
12384          * When the user first connects their device to a system a prompt is displayed to allow
12385          * the adb connection with an option to 'Always allow' connections from this system. If the
12386          * user selects this always allow option then the connection time is stored for the system.
12387          * This setting is the time in ms within which a subsequent connection from an always
12388          * allowed system is allowed to reconnect without user interaction.
12389          *
12390          * Type: long
12391          *
12392          * @hide
12393          */
12394         public static final String ADB_ALLOWED_CONNECTION_TIME =
12395                 "adb_allowed_connection_time";
12396 
12397         /**
12398          * Get the key that retrieves a bluetooth headset's priority.
12399          * @hide
12400          */
getBluetoothHeadsetPriorityKey(String address)12401         public static final String getBluetoothHeadsetPriorityKey(String address) {
12402             return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12403         }
12404 
12405         /**
12406          * Get the key that retrieves a bluetooth a2dp sink's priority.
12407          * @hide
12408          */
getBluetoothA2dpSinkPriorityKey(String address)12409         public static final String getBluetoothA2dpSinkPriorityKey(String address) {
12410             return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12411         }
12412 
12413         /**
12414          * Get the key that retrieves a bluetooth a2dp src's priority.
12415          * @hide
12416          */
getBluetoothA2dpSrcPriorityKey(String address)12417         public static final String getBluetoothA2dpSrcPriorityKey(String address) {
12418             return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12419         }
12420 
12421         /**
12422          * Get the key that retrieves a bluetooth a2dp device's ability to support optional codecs.
12423          * @hide
12424          */
getBluetoothA2dpSupportsOptionalCodecsKey(String address)12425         public static final String getBluetoothA2dpSupportsOptionalCodecsKey(String address) {
12426             return BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX +
12427                     address.toUpperCase(Locale.ROOT);
12428         }
12429 
12430         /**
12431          * Get the key that retrieves whether a bluetooth a2dp device should have optional codecs
12432          * enabled.
12433          * @hide
12434          */
getBluetoothA2dpOptionalCodecsEnabledKey(String address)12435         public static final String getBluetoothA2dpOptionalCodecsEnabledKey(String address) {
12436             return BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX +
12437                     address.toUpperCase(Locale.ROOT);
12438         }
12439 
12440         /**
12441          * Get the key that retrieves a bluetooth Input Device's priority.
12442          * @hide
12443          */
getBluetoothHidHostPriorityKey(String address)12444         public static final String getBluetoothHidHostPriorityKey(String address) {
12445             return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12446         }
12447 
12448         /**
12449          * Get the key that retrieves a bluetooth pan client priority.
12450          * @hide
12451          */
getBluetoothPanPriorityKey(String address)12452         public static final String getBluetoothPanPriorityKey(String address) {
12453             return BLUETOOTH_PAN_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12454         }
12455 
12456         /**
12457          * Get the key that retrieves a bluetooth hearing aid priority.
12458          * @hide
12459          */
getBluetoothHearingAidPriorityKey(String address)12460         public static final String getBluetoothHearingAidPriorityKey(String address) {
12461             return BLUETOOTH_HEARING_AID_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12462         }
12463 
12464         /**
12465          * Get the key that retrieves a bluetooth map priority.
12466          * @hide
12467          */
getBluetoothMapPriorityKey(String address)12468         public static final String getBluetoothMapPriorityKey(String address) {
12469             return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12470         }
12471 
12472         /**
12473          * Get the key that retrieves a bluetooth map client priority.
12474          * @hide
12475          */
getBluetoothMapClientPriorityKey(String address)12476         public static final String getBluetoothMapClientPriorityKey(String address) {
12477             return BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12478         }
12479 
12480         /**
12481          * Get the key that retrieves a bluetooth pbap client priority.
12482          * @hide
12483          */
getBluetoothPbapClientPriorityKey(String address)12484         public static final String getBluetoothPbapClientPriorityKey(String address) {
12485             return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12486         }
12487 
12488         /**
12489          * Get the key that retrieves a bluetooth sap priority.
12490          * @hide
12491          */
getBluetoothSapPriorityKey(String address)12492         public static final String getBluetoothSapPriorityKey(String address) {
12493             return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12494         }
12495 
12496         /**
12497          * Scaling factor for normal window animations. Setting to 0 will
12498          * disable window animations.
12499          */
12500         public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
12501 
12502         /**
12503          * Scaling factor for activity transition animations. Setting to 0 will
12504          * disable window animations.
12505          */
12506         public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
12507 
12508         /**
12509          * Scaling factor for Animator-based animations. This affects both the
12510          * start delay and duration of all such animations. Setting to 0 will
12511          * cause animations to end immediately. The default value is 1.
12512          */
12513         public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
12514 
12515         /**
12516          * Scaling factor for normal window animations. Setting to 0 will
12517          * disable window animations.
12518          *
12519          * @hide
12520          */
12521         public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
12522 
12523         /**
12524          * If 0, the compatibility mode is off for all applications.
12525          * If 1, older applications run under compatibility mode.
12526          * TODO: remove this settings before code freeze (bug/1907571)
12527          * @hide
12528          */
12529         public static final String COMPATIBILITY_MODE = "compatibility_mode";
12530 
12531         /**
12532          * CDMA only settings
12533          * Emergency Tone  0 = Off
12534          *                 1 = Alert
12535          *                 2 = Vibrate
12536          * @hide
12537          */
12538         public static final String EMERGENCY_TONE = "emergency_tone";
12539 
12540         private static final Validator EMERGENCY_TONE_VALIDATOR =
12541                 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"});
12542 
12543         /**
12544          * CDMA only settings
12545          * Whether the auto retry is enabled. The value is
12546          * boolean (1 or 0).
12547          * @hide
12548          */
12549         public static final String CALL_AUTO_RETRY = "call_auto_retry";
12550 
12551         private static final Validator CALL_AUTO_RETRY_VALIDATOR = BOOLEAN_VALIDATOR;
12552 
12553         /**
12554          * A setting that can be read whether the emergency affordance is currently needed.
12555          * The value is a boolean (1 or 0).
12556          * @hide
12557          */
12558         public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed";
12559 
12560         /**
12561          * Whether to enable automatic system server heap dumps. This only works on userdebug or
12562          * eng builds, not on user builds. This is set by the user and overrides the config value.
12563          * 1 means enable, 0 means disable.
12564          *
12565          * @hide
12566          */
12567         public static final String ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS =
12568                 "enable_automatic_system_server_heap_dumps";
12569 
12570         private static final Validator ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS_VALIDATOR =
12571                 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1"});
12572 
12573         /**
12574          * See RIL_PreferredNetworkType in ril.h
12575          * @hide
12576          */
12577         @UnsupportedAppUsage
12578         public static final String PREFERRED_NETWORK_MODE =
12579                 "preferred_network_mode";
12580 
12581         /**
12582          * Name of an application package to be debugged.
12583          */
12584         public static final String DEBUG_APP = "debug_app";
12585 
12586         /**
12587          * If 1, when launching DEBUG_APP it will wait for the debugger before
12588          * starting user code.  If 0, it will run normally.
12589          */
12590         public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
12591 
12592         /**
12593          * Allow GPU debug layers?
12594          * 0 = no
12595          * 1 = yes
12596          * @hide
12597          */
12598         public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers";
12599 
12600         /**
12601          * App allowed to load GPU debug layers
12602          * @hide
12603          */
12604         public static final String GPU_DEBUG_APP = "gpu_debug_app";
12605 
12606         /**
12607          * Package containing ANGLE libraries other than system, which are only available
12608          * to dumpable apps that opt-in.
12609          * @hide
12610          */
12611         public static final String GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE =
12612                 "angle_debug_package";
12613 
12614         /**
12615          * Force all PKGs to use ANGLE, regardless of any other settings
12616          * The value is a boolean (1 or 0).
12617          * @hide
12618          */
12619         public static final String GLOBAL_SETTINGS_ANGLE_GL_DRIVER_ALL_ANGLE =
12620                 "angle_gl_driver_all_angle";
12621 
12622         /**
12623          * List of PKGs that have an OpenGL driver selected
12624          * @hide
12625          */
12626         public static final String GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_PKGS =
12627                 "angle_gl_driver_selection_pkgs";
12628 
12629         /**
12630          * List of selected OpenGL drivers, corresponding to the PKGs in GLOBAL_SETTINGS_DRIVER_PKGS
12631          * @hide
12632          */
12633         public static final String GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_VALUES =
12634                 "angle_gl_driver_selection_values";
12635 
12636         /**
12637          * List of package names that should check ANGLE rules
12638          * @hide
12639          */
12640         public static final String GLOBAL_SETTINGS_ANGLE_WHITELIST =
12641                 "angle_whitelist";
12642 
12643         /**
12644          * Show the "ANGLE In Use" dialog box to the user when ANGLE is the OpenGL driver.
12645          * The value is a boolean (1 or 0).
12646          * @hide
12647          */
12648         public static final String GLOBAL_SETTINGS_SHOW_ANGLE_IN_USE_DIALOG_BOX =
12649                 "show_angle_in_use_dialog_box";
12650 
12651         /**
12652          * Game Driver global preference for all Apps.
12653          * 0 = Default
12654          * 1 = All Apps use Game Driver
12655          * 2 = All Apps use system graphics driver
12656          * @hide
12657          */
12658         public static final String GAME_DRIVER_ALL_APPS = "game_driver_all_apps";
12659 
12660         /**
12661          * List of Apps selected to use Game Driver.
12662          * i.e. <pkg1>,<pkg2>,...,<pkgN>
12663          * @hide
12664          */
12665         public static final String GAME_DRIVER_OPT_IN_APPS = "game_driver_opt_in_apps";
12666 
12667         /**
12668          * List of Apps selected to use prerelease Game Driver.
12669          * i.e. <pkg1>,<pkg2>,...,<pkgN>
12670          * @hide
12671          */
12672         public static final String GAME_DRIVER_PRERELEASE_OPT_IN_APPS =
12673                 "game_driver_prerelease_opt_in_apps";
12674 
12675         /**
12676          * List of Apps selected not to use Game Driver.
12677          * i.e. <pkg1>,<pkg2>,...,<pkgN>
12678          * @hide
12679          */
12680         public static final String GAME_DRIVER_OPT_OUT_APPS = "game_driver_opt_out_apps";
12681 
12682         /**
12683          * Apps on the blacklist that are forbidden to use Game Driver.
12684          * @hide
12685          */
12686         public static final String GAME_DRIVER_BLACKLIST = "game_driver_blacklist";
12687 
12688         /**
12689          * List of blacklists, each blacklist is a blacklist for a specific version of Game Driver.
12690          * @hide
12691          */
12692         public static final String GAME_DRIVER_BLACKLISTS = "game_driver_blacklists";
12693 
12694         /**
12695          * Apps on the whitelist that are allowed to use Game Driver.
12696          * The string is a list of application package names, seperated by comma.
12697          * i.e. <apk1>,<apk2>,...,<apkN>
12698          * @hide
12699          */
12700         public static final String GAME_DRIVER_WHITELIST = "game_driver_whitelist";
12701 
12702         /**
12703          * List of libraries in sphal accessible by Game Driver
12704          * The string is a list of library names, separated by colon.
12705          * i.e. <lib1>:<lib2>:...:<libN>
12706          * @hide
12707          */
12708         public static final String GAME_DRIVER_SPHAL_LIBRARIES = "game_driver_sphal_libraries";
12709 
12710         /**
12711          * Ordered GPU debug layer list for Vulkan
12712          * i.e. <layer1>:<layer2>:...:<layerN>
12713          * @hide
12714          */
12715         public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers";
12716 
12717         /**
12718          * Ordered GPU debug layer list for GLES
12719          * i.e. <layer1>:<layer2>:...:<layerN>
12720          * @hide
12721          */
12722         public static final String GPU_DEBUG_LAYERS_GLES = "gpu_debug_layers_gles";
12723 
12724         /**
12725          * Addition app for GPU layer discovery
12726          * @hide
12727          */
12728         public static final String GPU_DEBUG_LAYER_APP = "gpu_debug_layer_app";
12729 
12730         /**
12731          * Control whether the process CPU usage meter should be shown.
12732          *
12733          * @deprecated This functionality is no longer available as of
12734          * {@link android.os.Build.VERSION_CODES#N_MR1}.
12735          */
12736         @Deprecated
12737         public static final String SHOW_PROCESSES = "show_processes";
12738 
12739         /**
12740          * If 1 low power mode (aka battery saver) is enabled.
12741          * @hide
12742          */
12743         @TestApi
12744         public static final String LOW_POWER_MODE = "low_power";
12745 
12746         /**
12747          * If 1, battery saver ({@link #LOW_POWER_MODE}) will be re-activated after the device
12748          * is unplugged from a charger or rebooted.
12749          * @hide
12750          */
12751         @TestApi
12752         public static final String LOW_POWER_MODE_STICKY = "low_power_sticky";
12753 
12754         /**
12755          * When a device is unplugged from a changer (or is rebooted), do not re-activate battery
12756          * saver even if {@link #LOW_POWER_MODE_STICKY} is 1, if the battery level is equal to or
12757          * above this threshold.
12758          *
12759          * @hide
12760          */
12761         public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL =
12762                 "low_power_sticky_auto_disable_level";
12763 
12764         private static final Validator LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL_VALIDATOR =
12765                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 100);
12766 
12767         /**
12768          * Whether sticky battery saver should be deactivated once the battery level has reached the
12769          * threshold specified by {@link #LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL}.
12770          *
12771          * @hide
12772          */
12773         public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED =
12774                 "low_power_sticky_auto_disable_enabled";
12775 
12776         private static final Validator LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED_VALIDATOR =
12777                 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1"});
12778 
12779         /**
12780          * Battery level [1-100] at which low power mode automatically turns on.
12781          * If 0, it will not automatically turn on. For Q and newer, it will only automatically
12782          * turn on if the value is greater than 0 and the {@link #AUTOMATIC_POWER_SAVE_MODE}
12783          * setting is also set to
12784          * {@link android.os.PowerManager.AutoPowerSaveMode#POWER_SAVE_MODE_TRIGGER_PERCENTAGE}.
12785          * @see #AUTOMATIC_POWER_SAVE_MODE
12786          * @see android.os.PowerManager#getPowerSaveModeTrigger()
12787          * @hide
12788          */
12789         public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
12790 
12791         private static final Validator LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR =
12792                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 100);
12793 
12794         /**
12795          * Whether battery saver is currently set to trigger based on percentage, dynamic power
12796          * savings trigger, or none. See {@link AutoPowerSaveModeTriggers} for
12797          * accepted values.
12798          *
12799          *  @hide
12800          */
12801         @TestApi
12802         public static final String AUTOMATIC_POWER_SAVE_MODE = "automatic_power_save_mode";
12803 
12804         private static final Validator AUTOMATIC_POWER_SAVE_MODE_VALIDATOR =
12805                 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1"});
12806 
12807         /**
12808          * The setting that backs the disable threshold for the setPowerSavingsWarning api in
12809          * PowerManager
12810          *
12811          * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int)
12812          * @hide
12813          */
12814         @TestApi
12815         public static final String DYNAMIC_POWER_SAVINGS_DISABLE_THRESHOLD =
12816                 "dynamic_power_savings_disable_threshold";
12817         private static final Validator DYNAMIC_POWER_SAVINGS_VALIDATOR =
12818                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 100);
12819 
12820         /**
12821          * The setting which backs the setDynamicPowerSaveHint api in PowerManager.
12822          *
12823          * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int)
12824          * @hide
12825          */
12826         @TestApi
12827         public static final String DYNAMIC_POWER_SAVINGS_ENABLED = "dynamic_power_savings_enabled";
12828 
12829         /**
12830          * A long value indicating how much longer the system battery is estimated to last in
12831          * millis. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value
12832          * was updated.
12833          *
12834          * @hide
12835          */
12836         public static final String TIME_REMAINING_ESTIMATE_MILLIS =
12837                 "time_remaining_estimate_millis";
12838 
12839         /**
12840          * A boolean indicating whether {@link #TIME_REMAINING_ESTIMATE_MILLIS} is based customized
12841          * to the devices usage or using global models. See
12842          * {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value was updated.
12843          *
12844          * @hide
12845          */
12846         public static final String TIME_REMAINING_ESTIMATE_BASED_ON_USAGE =
12847                 "time_remaining_estimate_based_on_usage";
12848 
12849         /**
12850          * A long value indicating how long the system battery takes to deplete from 100% to 0% on
12851          * average based on historical drain rates. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME}
12852          * for the last time this value was updated.
12853          *
12854          * @hide
12855          */
12856         public static final String AVERAGE_TIME_TO_DISCHARGE = "average_time_to_discharge";
12857 
12858         /**
12859          * A long indicating the epoch time in milliseconds when
12860          * {@link #TIME_REMAINING_ESTIMATE_MILLIS}, {@link #TIME_REMAINING_ESTIMATE_BASED_ON_USAGE},
12861          * and {@link #AVERAGE_TIME_TO_DISCHARGE} were last updated.
12862          *
12863          * @hide
12864          */
12865         public static final String BATTERY_ESTIMATES_LAST_UPDATE_TIME =
12866                 "battery_estimates_last_update_time";
12867 
12868         /**
12869          * The max value for {@link #LOW_POWER_MODE_TRIGGER_LEVEL}. If this setting is not set
12870          * or the value is 0, the default max will be used.
12871          *
12872          * @hide
12873          */
12874         public static final String LOW_POWER_MODE_TRIGGER_LEVEL_MAX = "low_power_trigger_level_max";
12875 
12876         /**
12877          * See com.android.settingslib.fuelgauge.BatterySaverUtils.
12878          * @hide
12879          */
12880         public static final String LOW_POWER_MODE_SUGGESTION_PARAMS =
12881                 "low_power_mode_suggestion_params";
12882 
12883         /**
12884          * If not 0, the activity manager will aggressively finish activities and
12885          * processes as soon as they are no longer needed.  If 0, the normal
12886          * extended lifetime is used.
12887          */
12888         public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
12889 
12890         /**
12891          * If nonzero, all system error dialogs will be hidden.  For example, the
12892          * crash and ANR dialogs will not be shown, and the system will just proceed
12893          * as if they had been accepted by the user.
12894          * @hide
12895          */
12896         public static final String HIDE_ERROR_DIALOGS = "hide_error_dialogs";
12897 
12898         /**
12899          * Use Dock audio output for media:
12900          *      0 = disabled
12901          *      1 = enabled
12902          * @hide
12903          */
12904         public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
12905 
12906         private static final Validator DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
12907 
12908         /**
12909          * The surround sound formats AC3, DTS or IEC61937 are
12910          * available for use if they are detected.
12911          * This is the default mode.
12912          *
12913          * Note that AUTO is equivalent to ALWAYS for Android TVs and other
12914          * devices that have an S/PDIF output. This is because S/PDIF
12915          * is unidirectional and the TV cannot know if a decoder is
12916          * connected. So it assumes they are always available.
12917          * @hide
12918          */
12919          public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0;
12920 
12921         /**
12922          * AC3, DTS or IEC61937 are NEVER available, even if they
12923          * are detected by the hardware. Those formats will not be
12924          * reported.
12925          *
12926          * An example use case would be an AVR reports that it is capable of
12927          * surround sound decoding but is broken. If NEVER is chosen
12928          * then apps must use PCM output instead of encoded output.
12929          * @hide
12930          */
12931          public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1;
12932 
12933         /**
12934          * AC3, DTS or IEC61937 are ALWAYS available, even if they
12935          * are not detected by the hardware. Those formats will be
12936          * reported as part of the HDMI output capability. Applications
12937          * are then free to use either PCM or encoded output.
12938          *
12939          * An example use case would be a when TV was connected over
12940          * TOS-link to an AVR. But the TV could not see it because TOS-link
12941          * is unidirectional.
12942          * @hide
12943          */
12944          public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2;
12945 
12946         /**
12947          * Surround sound formats are available according to the choice
12948          * of user, even if they are not detected by the hardware. Those
12949          * formats will be reported as part of the HDMI output capability.
12950          * Applications are then free to use either PCM or encoded output.
12951          *
12952          * An example use case would be an AVR that doesn't report a surround
12953          * format while the user knows the AVR does support it.
12954          * @hide
12955          */
12956         public static final int ENCODED_SURROUND_OUTPUT_MANUAL = 3;
12957 
12958         /**
12959          * Set to ENCODED_SURROUND_OUTPUT_AUTO,
12960          * ENCODED_SURROUND_OUTPUT_NEVER,
12961          * ENCODED_SURROUND_OUTPUT_ALWAYS or
12962          * ENCODED_SURROUND_OUTPUT_MANUAL
12963          * @hide
12964          */
12965         public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output";
12966 
12967         private static final Validator ENCODED_SURROUND_OUTPUT_VALIDATOR =
12968                 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2", "3"});
12969 
12970         /**
12971          * Surround sounds formats that are enabled when ENCODED_SURROUND_OUTPUT is set to
12972          * ENCODED_SURROUND_OUTPUT_MANUAL. Encoded as comma separated list. Allowed values
12973          * are the format constants defined in AudioFormat.java. Ex:
12974          *
12975          * "5,6"
12976          *
12977          * @hide
12978          */
12979         public static final String ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS =
12980                 "encoded_surround_output_enabled_formats";
12981 
12982         private static final Validator ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS_VALIDATOR =
12983                 new Validator() {
12984             @Override
12985             public boolean validate(@Nullable String value) {
12986                 try {
12987                     String[] surroundFormats = TextUtils.split(value, ",");
12988                     for (String format : surroundFormats) {
12989                         int audioFormat = Integer.valueOf(format);
12990                         boolean isSurroundFormat = false;
12991                         for (int sf : AudioFormat.SURROUND_SOUND_ENCODING) {
12992                             if (sf == audioFormat) {
12993                                 isSurroundFormat = true;
12994                                 break;
12995                             }
12996                         }
12997                         if (!isSurroundFormat) {
12998                             return false;
12999                         }
13000                     }
13001                     return true;
13002                 } catch (NumberFormatException e) {
13003                     return false;
13004                 }
13005             }
13006         };
13007 
13008         /**
13009          * Persisted safe headphone volume management state by AudioService
13010          * @hide
13011          */
13012         public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
13013 
13014         /**
13015          * URL for tzinfo (time zone) updates
13016          * @hide
13017          */
13018         public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
13019 
13020         /**
13021          * URL for tzinfo (time zone) update metadata
13022          * @hide
13023          */
13024         public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
13025 
13026         /**
13027          * URL for selinux (mandatory access control) updates
13028          * @hide
13029          */
13030         public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
13031 
13032         /**
13033          * URL for selinux (mandatory access control) update metadata
13034          * @hide
13035          */
13036         public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
13037 
13038         /**
13039          * URL for sms short code updates
13040          * @hide
13041          */
13042         public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
13043                 "sms_short_codes_content_url";
13044 
13045         /**
13046          * URL for sms short code update metadata
13047          * @hide
13048          */
13049         public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
13050                 "sms_short_codes_metadata_url";
13051 
13052         /**
13053          * URL for apn_db updates
13054          * @hide
13055          */
13056         public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url";
13057 
13058         /**
13059          * URL for apn_db update metadata
13060          * @hide
13061          */
13062         public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url";
13063 
13064         /**
13065          * URL for cert pinlist updates
13066          * @hide
13067          */
13068         public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
13069 
13070         /**
13071          * URL for cert pinlist updates
13072          * @hide
13073          */
13074         public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
13075 
13076         /**
13077          * URL for intent firewall updates
13078          * @hide
13079          */
13080         public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
13081                 "intent_firewall_content_url";
13082 
13083         /**
13084          * URL for intent firewall update metadata
13085          * @hide
13086          */
13087         public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
13088                 "intent_firewall_metadata_url";
13089 
13090         /**
13091          * URL for lang id model updates
13092          * @hide
13093          */
13094         public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url";
13095 
13096         /**
13097          * URL for lang id model update metadata
13098          * @hide
13099          */
13100         public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url";
13101 
13102         /**
13103          * URL for smart selection model updates
13104          * @hide
13105          */
13106         public static final String SMART_SELECTION_UPDATE_CONTENT_URL =
13107                 "smart_selection_content_url";
13108 
13109         /**
13110          * URL for smart selection model update metadata
13111          * @hide
13112          */
13113         public static final String SMART_SELECTION_UPDATE_METADATA_URL =
13114                 "smart_selection_metadata_url";
13115 
13116         /**
13117          * URL for conversation actions model updates
13118          * @hide
13119          */
13120         public static final String CONVERSATION_ACTIONS_UPDATE_CONTENT_URL =
13121                 "conversation_actions_content_url";
13122 
13123         /**
13124          * URL for conversation actions model update metadata
13125          * @hide
13126          */
13127         public static final String CONVERSATION_ACTIONS_UPDATE_METADATA_URL =
13128                 "conversation_actions_metadata_url";
13129 
13130         /**
13131          * SELinux enforcement status. If 0, permissive; if 1, enforcing.
13132          * @hide
13133          */
13134         public static final String SELINUX_STATUS = "selinux_status";
13135 
13136         /**
13137          * Developer setting to force RTL layout.
13138          * @hide
13139          */
13140         public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
13141 
13142         /**
13143          * Milliseconds after screen-off after which low battery sounds will be silenced.
13144          *
13145          * If zero, battery sounds will always play.
13146          * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
13147          *
13148          * @hide
13149          */
13150         public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
13151 
13152         /**
13153          * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
13154          * the caller is done with this, they should call {@link ContentResolver#delete} to
13155          * clean up any value that they may have written.
13156          *
13157          * @hide
13158          */
13159         public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
13160 
13161         /**
13162          * Defines global runtime overrides to window policy.
13163          *
13164          * See {@link com.android.server.wm.PolicyControl} for value format.
13165          *
13166          * @hide
13167          */
13168         public static final String POLICY_CONTROL = "policy_control";
13169 
13170         /**
13171          * {@link android.view.DisplayCutout DisplayCutout} emulation mode.
13172          *
13173          * @hide
13174          */
13175         public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout";
13176 
13177         /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0;
13178         /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1;
13179 
13180         /**
13181          * A colon separated list of keys for Settings Slices.
13182          *
13183          * @hide
13184          */
13185         public static final String BLOCKED_SLICES = "blocked_slices";
13186 
13187         /**
13188          * Defines global zen mode.  ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
13189          * or ZEN_MODE_NO_INTERRUPTIONS.
13190          *
13191          * @hide
13192          */
13193         @UnsupportedAppUsage
13194         public static final String ZEN_MODE = "zen_mode";
13195 
13196         /** @hide */
13197         @UnsupportedAppUsage
13198         public static final int ZEN_MODE_OFF = 0;
13199         /** @hide */
13200         @UnsupportedAppUsage
13201         public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
13202         /** @hide */
13203         @UnsupportedAppUsage
13204         public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
13205         /** @hide */
13206         @UnsupportedAppUsage
13207         public static final int ZEN_MODE_ALARMS = 3;
13208 
zenModeToString(int mode)13209         /** @hide */ public static String zenModeToString(int mode) {
13210             if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
13211             if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
13212             if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
13213             return "ZEN_MODE_OFF";
13214         }
13215 
isValidZenMode(int value)13216         /** @hide */ public static boolean isValidZenMode(int value) {
13217             switch (value) {
13218                 case Global.ZEN_MODE_OFF:
13219                 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
13220                 case Global.ZEN_MODE_ALARMS:
13221                 case Global.ZEN_MODE_NO_INTERRUPTIONS:
13222                     return true;
13223                 default:
13224                     return false;
13225             }
13226         }
13227 
13228         /**
13229          * Value of the ringer before entering zen mode.
13230          *
13231          * @hide
13232          */
13233         public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level";
13234 
13235         /**
13236          * Opaque value, changes when persisted zen mode configuration changes.
13237          *
13238          * @hide
13239          */
13240         @UnsupportedAppUsage
13241         public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
13242 
13243         /**
13244          * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION} instead
13245          * @hide
13246          */
13247         @Deprecated
13248         public static final String ZEN_DURATION = "zen_duration";
13249 
13250         private static final Validator ZEN_DURATION_VALIDATOR = ANY_INTEGER_VALIDATOR;
13251 
13252         /**
13253          * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_PROMPT} instead
13254          * @hide
13255          */
13256         @Deprecated
13257         public static final int ZEN_DURATION_PROMPT = -1;
13258 
13259         /**
13260          * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_FOREVER} instead
13261          * @hide
13262          */
13263         @Deprecated
13264         public static final int ZEN_DURATION_FOREVER = 0;
13265 
13266         /**
13267          * Defines global heads up toggle.  One of HEADS_UP_OFF, HEADS_UP_ON.
13268          *
13269          * @hide
13270          */
13271         @UnsupportedAppUsage
13272         public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
13273                 "heads_up_notifications_enabled";
13274 
13275         /** @hide */
13276         @UnsupportedAppUsage
13277         public static final int HEADS_UP_OFF = 0;
13278         /** @hide */
13279         @UnsupportedAppUsage
13280         public static final int HEADS_UP_ON = 1;
13281 
13282         /**
13283          * The name of the device
13284          */
13285         public static final String DEVICE_NAME = "device_name";
13286 
13287         /**
13288          * Whether the NetworkScoringService has been first initialized.
13289          * <p>
13290          * Type: int (0 for false, 1 for true)
13291          * @hide
13292          */
13293         public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
13294 
13295         /**
13296          * Indicates whether the user wants to be prompted for password to decrypt the device on
13297          * boot. This only matters if the storage is encrypted.
13298          * <p>
13299          * Type: int (0 for false, 1 for true)
13300          *
13301          * @hide
13302          */
13303         @SystemApi
13304         public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
13305 
13306         /**
13307          * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config
13308          * value {@link CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL}.
13309          * <p>
13310          * Type: int (0 for false, 1 for true)
13311          * @hide
13312          * @deprecated Use {@link android.telephony.SubscriptionManager#ENHANCED_4G_MODE_ENABLED}
13313          * instead.
13314          */
13315         @Deprecated
13316         public static final String ENHANCED_4G_MODE_ENABLED =
13317                 SubscriptionManager.ENHANCED_4G_MODE_ENABLED;
13318 
13319         /**
13320          * Whether VT (Video Telephony over IMS) is enabled
13321          * <p>
13322          * Type: int (0 for false, 1 for true)
13323          *
13324          * @hide
13325          * @deprecated Use {@link android.telephony.SubscriptionManager#VT_IMS_ENABLED} instead.
13326          */
13327         @Deprecated
13328         public static final String VT_IMS_ENABLED = SubscriptionManager.VT_IMS_ENABLED;
13329 
13330         /**
13331          * Whether WFC is enabled
13332          * <p>
13333          * Type: int (0 for false, 1 for true)
13334          *
13335          * @hide
13336          * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ENABLED} instead.
13337          */
13338         @Deprecated
13339         public static final String WFC_IMS_ENABLED = SubscriptionManager.WFC_IMS_ENABLED;
13340 
13341         /**
13342          * WFC mode on home/non-roaming network.
13343          * <p>
13344          * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
13345          *
13346          * @hide
13347          * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_MODE} instead.
13348          */
13349         @Deprecated
13350         public static final String WFC_IMS_MODE = SubscriptionManager.WFC_IMS_MODE;
13351 
13352         /**
13353          * WFC mode on roaming network.
13354          * <p>
13355          * Type: int - see {@link #WFC_IMS_MODE} for values
13356          *
13357          * @hide
13358          * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_MODE}
13359          * instead.
13360          */
13361         @Deprecated
13362         public static final String WFC_IMS_ROAMING_MODE = SubscriptionManager.WFC_IMS_ROAMING_MODE;
13363 
13364         /**
13365          * Whether WFC roaming is enabled
13366          * <p>
13367          * Type: int (0 for false, 1 for true)
13368          *
13369          * @hide
13370          * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_ENABLED}
13371          * instead
13372          */
13373         @Deprecated
13374         public static final String WFC_IMS_ROAMING_ENABLED =
13375                 SubscriptionManager.WFC_IMS_ROAMING_ENABLED;
13376 
13377         /**
13378          * Whether user can enable/disable LTE as a preferred network. A carrier might control
13379          * this via gservices, OMA-DM, carrier app, etc.
13380          * <p>
13381          * Type: int (0 for false, 1 for true)
13382          * @hide
13383          */
13384         public static final String LTE_SERVICE_FORCED = "lte_service_forced";
13385 
13386 
13387         /**
13388          * Specifies the behaviour the lid triggers when closed
13389          * <p>
13390          * See WindowManagerPolicy.WindowManagerFuncs
13391          * @hide
13392          */
13393         public static final String LID_BEHAVIOR = "lid_behavior";
13394 
13395         /**
13396          * Ephemeral app cookie max size in bytes.
13397          * <p>
13398          * Type: int
13399          * @hide
13400          */
13401         public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES =
13402                 "ephemeral_cookie_max_size_bytes";
13403 
13404         /**
13405          * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is
13406          * enabled. Set to zero to disable.
13407          * <p>
13408          * Type: int (0 for false, 1 for true)
13409          *
13410          * @hide
13411          */
13412         public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature";
13413 
13414         /**
13415          * Toggle to enable/disable dexopt for instant applications. The default is for dexopt
13416          * to be disabled.
13417          * <p>
13418          * Type: int (0 to disable, 1 to enable)
13419          *
13420          * @hide
13421          */
13422         public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled";
13423 
13424         /**
13425          * The min period for caching installed instant apps in milliseconds.
13426          * <p>
13427          * Type: long
13428          * @hide
13429          */
13430         public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
13431                 "installed_instant_app_min_cache_period";
13432 
13433         /**
13434          * The max period for caching installed instant apps in milliseconds.
13435          * <p>
13436          * Type: long
13437          * @hide
13438          */
13439         public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
13440                 "installed_instant_app_max_cache_period";
13441 
13442         /**
13443          * The min period for caching uninstalled instant apps in milliseconds.
13444          * <p>
13445          * Type: long
13446          * @hide
13447          */
13448         public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
13449                 "uninstalled_instant_app_min_cache_period";
13450 
13451         /**
13452          * The max period for caching uninstalled instant apps in milliseconds.
13453          * <p>
13454          * Type: long
13455          * @hide
13456          */
13457         public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
13458                 "uninstalled_instant_app_max_cache_period";
13459 
13460         /**
13461          * The min period for caching unused static shared libs in milliseconds.
13462          * <p>
13463          * Type: long
13464          * @hide
13465          */
13466         public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD =
13467                 "unused_static_shared_lib_min_cache_period";
13468 
13469         /**
13470          * Allows switching users when system user is locked.
13471          * <p>
13472          * Type: int
13473          * @hide
13474          */
13475         public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED =
13476                 "allow_user_switching_when_system_user_locked";
13477 
13478         /**
13479          * Boot count since the device starts running API level 24.
13480          * <p>
13481          * Type: int
13482          */
13483         public static final String BOOT_COUNT = "boot_count";
13484 
13485         /**
13486          * Whether the safe boot is disallowed.
13487          *
13488          * <p>This setting should have the identical value as the corresponding user restriction.
13489          * The purpose of the setting is to make the restriction available in early boot stages
13490          * before the user restrictions are loaded.
13491          * @hide
13492          */
13493         public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed";
13494 
13495         /**
13496          * Indicates whether this device is currently in retail demo mode. If true, the device
13497          * usage is severely limited.
13498          * <p>
13499          * Type: int (0 for false, 1 for true)
13500          *
13501          * @hide
13502          */
13503         @SystemApi
13504         public static final String DEVICE_DEMO_MODE = "device_demo_mode";
13505 
13506         /**
13507          * Indicates the maximum time that an app is blocked for the network rules to get updated.
13508          *
13509          * Type: long
13510          *
13511          * @hide
13512          */
13513         public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms";
13514 
13515         /**
13516          * The reason for the settings database being downgraded. This is only for
13517          * troubleshooting purposes and its value should not be interpreted in any way.
13518          *
13519          * Type: string
13520          *
13521          * @hide
13522          */
13523         public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason";
13524 
13525         /**
13526          * The build id of when the settings database was first created (or re-created due it
13527          * being missing).
13528          *
13529          * Type: string
13530          *
13531          * @hide
13532          */
13533         public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid";
13534 
13535         /**
13536          * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by
13537          * default. Set to 0 to disable.
13538          *
13539          * @hide
13540          */
13541         public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled";
13542 
13543         /**
13544          * Flag to enable the link to location permissions in location setting. Set to 0 to disable.
13545          *
13546          * @hide
13547          */
13548         public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED =
13549                 "location_settings_link_to_permissions_enabled";
13550 
13551         /**
13552          * Flag to set the waiting time for euicc factory reset inside System > Settings
13553          * Type: long
13554          *
13555          * @hide
13556          */
13557         public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS =
13558                 "euicc_factory_reset_timeout_millis";
13559 
13560         /**
13561          * Flag to set the timeout for when to refresh the storage settings cached data.
13562          * Type: long
13563          *
13564          * @hide
13565          */
13566         public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD =
13567                 "storage_settings_clobber_threshold";
13568 
13569         /**
13570          * If set to 1, {@link Secure#LOCATION_MODE} will be set to {@link Secure#LOCATION_MODE_OFF}
13571          * temporarily for all users.
13572          *
13573          * @hide
13574          */
13575         @TestApi
13576         public static final String LOCATION_GLOBAL_KILL_SWITCH =
13577                 "location_global_kill_switch";
13578 
13579         /**
13580          * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored
13581          * and restoring to lower version of platform API will be skipped.
13582          *
13583          * @hide
13584          */
13585         public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION =
13586                 "override_settings_provider_restore_any_version";
13587         /**
13588          * Flag to toggle whether system services report attribution chains when they attribute
13589          * battery use via a {@code WorkSource}.
13590          *
13591          * Type: int (0 to disable, 1 to enable)
13592          *
13593          * @hide
13594          */
13595         public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED =
13596                 "chained_battery_attribution_enabled";
13597 
13598         /**
13599          * The packages whitelisted to be run in autofill compatibility mode. The list
13600          * of packages is {@code ":"} colon delimited, and each entry has the name of the
13601          * package and an optional list of url bar resource ids (the list is delimited by
13602          * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited).
13603          *
13604          * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where
13605          * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 }
13606          * have 2 ids {@code url_foo} and {@code url_bas}) would be
13607          * {@code p1[url_bar]:p2:p3[url_foo,url_bas]}
13608          *
13609          * @hide
13610          */
13611         @SystemApi
13612         @TestApi
13613         public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES =
13614                 "autofill_compat_mode_allowed_packages";
13615 
13616         /**
13617          * Level of autofill logging.
13618          *
13619          * <p>Valid values are
13620          * {@link android.view.autofill.AutofillManager#NO_LOGGING},
13621          * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_DEBUG}, or
13622          * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_VERBOSE}.
13623          *
13624          * @hide
13625          */
13626         public static final String AUTOFILL_LOGGING_LEVEL = "autofill_logging_level";
13627 
13628         /**
13629          * Maximum number of partitions that can be allowed in an autofill session.
13630          *
13631          * @hide
13632          */
13633         public static final String AUTOFILL_MAX_PARTITIONS_SIZE = "autofill_max_partitions_size";
13634 
13635         /**
13636          * Maximum number of visible datasets in the Autofill dataset picker UI, or {@code 0} to use
13637          * the default value from resources.
13638          *
13639          * @hide
13640          */
13641         public static final String AUTOFILL_MAX_VISIBLE_DATASETS = "autofill_max_visible_datasets";
13642 
13643         /**
13644          * Exemptions to the hidden API blacklist.
13645          *
13646          * @hide
13647          */
13648         @TestApi
13649         public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS =
13650                 "hidden_api_blacklist_exemptions";
13651 
13652         /**
13653          * Hidden API enforcement policy for apps.
13654          *
13655          * Values correspond to @{@link
13656          * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy}
13657          *
13658          * @hide
13659          */
13660         public static final String HIDDEN_API_POLICY = "hidden_api_policy";
13661 
13662         /**
13663          * Current version of signed configuration applied.
13664          *
13665          * @hide
13666          */
13667         public static final String SIGNED_CONFIG_VERSION = "signed_config_version";
13668 
13669         /**
13670          * Timeout for a single {@link android.media.soundtrigger.SoundTriggerDetectionService}
13671          * operation (in ms).
13672          *
13673          * @hide
13674          */
13675         public static final String SOUND_TRIGGER_DETECTION_SERVICE_OP_TIMEOUT =
13676                 "sound_trigger_detection_service_op_timeout";
13677 
13678         /**
13679          * Maximum number of {@link android.media.soundtrigger.SoundTriggerDetectionService}
13680          * operations per day.
13681          *
13682          * @hide
13683          */
13684         public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY =
13685                 "max_sound_trigger_detection_service_ops_per_day";
13686 
13687         /** {@hide} */
13688         public static final String ISOLATED_STORAGE_LOCAL = "isolated_storage_local";
13689         /** {@hide} */
13690         public static final String ISOLATED_STORAGE_REMOTE = "isolated_storage_remote";
13691 
13692         /**
13693          * Indicates whether aware is available in the current location.
13694          * @hide
13695          */
13696         public static final String AWARE_ALLOWED = "aware_allowed";
13697 
13698         private static final Validator AWARE_ALLOWED_VALIDATOR = BOOLEAN_VALIDATOR;
13699 
13700         /**
13701          * Overrides internal R.integer.config_longPressOnPowerBehavior.
13702          * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
13703          * Used by PhoneWindowManager.
13704          * @hide
13705          */
13706         public static final String POWER_BUTTON_LONG_PRESS =
13707                 "power_button_long_press";
13708         private static final Validator POWER_BUTTON_LONG_PRESS_VALIDATOR =
13709                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 5);
13710 
13711         /**
13712          * Overrides internal R.integer.config_veryLongPressOnPowerBehavior.
13713          * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
13714          * Used by PhoneWindowManager.
13715          * @hide
13716          */
13717         public static final String POWER_BUTTON_VERY_LONG_PRESS =
13718                 "power_button_very_long_press";
13719         private static final Validator POWER_BUTTON_VERY_LONG_PRESS_VALIDATOR =
13720                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 1);
13721 
13722         /**
13723          * Settings to backup. This is here so that it's in the same place as the settings
13724          * keys and easy to update.
13725          *
13726          * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
13727          * and Secure as well.  This is because those tables drive both backup and
13728          * restore, and restore needs to properly whitelist keys that used to live
13729          * in those namespaces.  The keys will only actually be backed up / restored
13730          * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
13731          *
13732          * NOTE: Settings are backed up and restored in the order they appear
13733          *       in this array. If you have one setting depending on another,
13734          *       make sure that they are ordered appropriately.
13735          *
13736          * @hide
13737          */
13738         public static final String[] SETTINGS_TO_BACKUP = {
13739             APPLY_RAMPING_RINGER,
13740             BUGREPORT_IN_POWER_MENU,
13741             STAY_ON_WHILE_PLUGGED_IN,
13742             APP_AUTO_RESTRICTION_ENABLED,
13743             AUTO_TIME,
13744             AUTO_TIME_ZONE,
13745             POWER_SOUNDS_ENABLED,
13746             DOCK_SOUNDS_ENABLED,
13747             CHARGING_SOUNDS_ENABLED,
13748             USB_MASS_STORAGE_ENABLED,
13749             NETWORK_RECOMMENDATIONS_ENABLED,
13750             WIFI_WAKEUP_ENABLED,
13751             WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
13752             WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON,
13753             USE_OPEN_WIFI_PACKAGE,
13754             WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
13755             EMERGENCY_TONE,
13756             CALL_AUTO_RETRY,
13757             DOCK_AUDIO_MEDIA_ENABLED,
13758             ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS,
13759             ENCODED_SURROUND_OUTPUT,
13760             ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS,
13761             LOW_POWER_MODE_TRIGGER_LEVEL,
13762             LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED,
13763             LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL,
13764             BLUETOOTH_ON,
13765             PRIVATE_DNS_MODE,
13766             PRIVATE_DNS_SPECIFIER,
13767             SOFT_AP_TIMEOUT_ENABLED,
13768             ZEN_DURATION,
13769             CHARGING_VIBRATION_ENABLED,
13770             AWARE_ALLOWED,
13771         };
13772 
13773         /**
13774          * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator,
13775          * otherwise they won't be restored.
13776          *
13777          * @hide
13778          */
13779         public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
13780         static {
VALIDATORS.put(APPLY_RAMPING_RINGER, APPLY_RAMPING_RINGER_VALIDATOR)13781             VALIDATORS.put(APPLY_RAMPING_RINGER, APPLY_RAMPING_RINGER_VALIDATOR);
VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR)13782             VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR);
VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR)13783             VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR);
VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR)13784             VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR);
VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR)13785             VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR);
VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR)13786             VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR)13787             VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(CHARGING_SOUNDS_ENABLED, CHARGING_SOUNDS_ENABLED_VALIDATOR)13788             VALIDATORS.put(CHARGING_SOUNDS_ENABLED, CHARGING_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR)13789             VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR);
VALIDATORS.put(NETWORK_RECOMMENDATIONS_ENABLED, NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR)13790             VALIDATORS.put(NETWORK_RECOMMENDATIONS_ENABLED,
13791                     NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR);
VALIDATORS.put(WIFI_WAKEUP_ENABLED, WIFI_WAKEUP_ENABLED_VALIDATOR)13792             VALIDATORS.put(WIFI_WAKEUP_ENABLED, WIFI_WAKEUP_ENABLED_VALIDATOR);
VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR)13793             VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
13794                     WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
VALIDATORS.put(USE_OPEN_WIFI_PACKAGE, USE_OPEN_WIFI_PACKAGE_VALIDATOR)13795             VALIDATORS.put(USE_OPEN_WIFI_PACKAGE, USE_OPEN_WIFI_PACKAGE_VALIDATOR);
VALIDATORS.put(WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR)13796             VALIDATORS.put(WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
13797                     WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR);
VALIDATORS.put(EMERGENCY_TONE, EMERGENCY_TONE_VALIDATOR)13798             VALIDATORS.put(EMERGENCY_TONE, EMERGENCY_TONE_VALIDATOR);
VALIDATORS.put(CALL_AUTO_RETRY, CALL_AUTO_RETRY_VALIDATOR)13799             VALIDATORS.put(CALL_AUTO_RETRY, CALL_AUTO_RETRY_VALIDATOR);
VALIDATORS.put(DOCK_AUDIO_MEDIA_ENABLED, DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR)13800             VALIDATORS.put(DOCK_AUDIO_MEDIA_ENABLED, DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR);
VALIDATORS.put(ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS, ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS_VALIDATOR)13801             VALIDATORS.put(ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS,
13802                     ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS_VALIDATOR);
VALIDATORS.put(ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_VALIDATOR)13803             VALIDATORS.put(ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_VALIDATOR);
VALIDATORS.put(ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS, ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS_VALIDATOR)13804             VALIDATORS.put(ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS,
13805                     ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS_VALIDATOR);
VALIDATORS.put(LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL, LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL_VALIDATOR)13806             VALIDATORS.put(LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL,
13807                     LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL_VALIDATOR);
VALIDATORS.put(LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED, LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED_VALIDATOR)13808             VALIDATORS.put(LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED,
13809                     LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED_VALIDATOR);
VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL, LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR)13810             VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL, LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR);
VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL_MAX, LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR)13811             VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL_MAX,
13812                     LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR);
VALIDATORS.put(AUTOMATIC_POWER_SAVE_MODE, AUTOMATIC_POWER_SAVE_MODE_VALIDATOR)13813             VALIDATORS.put(AUTOMATIC_POWER_SAVE_MODE, AUTOMATIC_POWER_SAVE_MODE_VALIDATOR);
VALIDATORS.put(DYNAMIC_POWER_SAVINGS_DISABLE_THRESHOLD, DYNAMIC_POWER_SAVINGS_VALIDATOR)13814             VALIDATORS.put(DYNAMIC_POWER_SAVINGS_DISABLE_THRESHOLD,
13815                     DYNAMIC_POWER_SAVINGS_VALIDATOR);
VALIDATORS.put(BLUETOOTH_ON, BLUETOOTH_ON_VALIDATOR)13816             VALIDATORS.put(BLUETOOTH_ON, BLUETOOTH_ON_VALIDATOR);
VALIDATORS.put(PRIVATE_DNS_MODE, PRIVATE_DNS_MODE_VALIDATOR)13817             VALIDATORS.put(PRIVATE_DNS_MODE, PRIVATE_DNS_MODE_VALIDATOR);
VALIDATORS.put(PRIVATE_DNS_SPECIFIER, PRIVATE_DNS_SPECIFIER_VALIDATOR)13818             VALIDATORS.put(PRIVATE_DNS_SPECIFIER, PRIVATE_DNS_SPECIFIER_VALIDATOR);
VALIDATORS.put(SOFT_AP_TIMEOUT_ENABLED, SOFT_AP_TIMEOUT_ENABLED_VALIDATOR)13819             VALIDATORS.put(SOFT_AP_TIMEOUT_ENABLED, SOFT_AP_TIMEOUT_ENABLED_VALIDATOR);
VALIDATORS.put(WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON, WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR)13820             VALIDATORS.put(WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON,
13821                     WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
VALIDATORS.put(WIFI_SCAN_THROTTLE_ENABLED, WIFI_SCAN_THROTTLE_ENABLED_VALIDATOR)13822             VALIDATORS.put(WIFI_SCAN_THROTTLE_ENABLED, WIFI_SCAN_THROTTLE_ENABLED_VALIDATOR);
VALIDATORS.put(APP_AUTO_RESTRICTION_ENABLED, APP_AUTO_RESTRICTION_ENABLED_VALIDATOR)13823             VALIDATORS.put(APP_AUTO_RESTRICTION_ENABLED, APP_AUTO_RESTRICTION_ENABLED_VALIDATOR);
VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR)13824             VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR);
VALIDATORS.put(CHARGING_VIBRATION_ENABLED, CHARGING_VIBRATION_ENABLED_VALIDATOR)13825             VALIDATORS.put(CHARGING_VIBRATION_ENABLED, CHARGING_VIBRATION_ENABLED_VALIDATOR);
VALIDATORS.put(DEVICE_PROVISIONING_MOBILE_DATA_ENABLED, BOOLEAN_VALIDATOR)13826             VALIDATORS.put(DEVICE_PROVISIONING_MOBILE_DATA_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(REQUIRE_PASSWORD_TO_DECRYPT, BOOLEAN_VALIDATOR)13827             VALIDATORS.put(REQUIRE_PASSWORD_TO_DECRYPT, BOOLEAN_VALIDATOR);
VALIDATORS.put(DEVICE_DEMO_MODE, BOOLEAN_VALIDATOR)13828             VALIDATORS.put(DEVICE_DEMO_MODE, BOOLEAN_VALIDATOR);
VALIDATORS.put(WIFI_PNO_FREQUENCY_CULLING_ENABLED, WIFI_PNO_FREQUENCY_CULLING_ENABLED_VALIDATOR)13829             VALIDATORS.put(WIFI_PNO_FREQUENCY_CULLING_ENABLED,
13830                     WIFI_PNO_FREQUENCY_CULLING_ENABLED_VALIDATOR);
VALIDATORS.put(WIFI_PNO_RECENCY_SORTING_ENABLED, WIFI_PNO_RECENCY_SORTING_ENABLED_VALIDATOR)13831             VALIDATORS.put(WIFI_PNO_RECENCY_SORTING_ENABLED,
13832                     WIFI_PNO_RECENCY_SORTING_ENABLED_VALIDATOR);
VALIDATORS.put(WIFI_LINK_PROBING_ENABLED, WIFI_LINK_PROBING_ENABLED_VALIDATOR)13833             VALIDATORS.put(WIFI_LINK_PROBING_ENABLED, WIFI_LINK_PROBING_ENABLED_VALIDATOR);
VALIDATORS.put(AWARE_ALLOWED, AWARE_ALLOWED_VALIDATOR)13834             VALIDATORS.put(AWARE_ALLOWED, AWARE_ALLOWED_VALIDATOR);
VALIDATORS.put(POWER_BUTTON_LONG_PRESS, POWER_BUTTON_LONG_PRESS_VALIDATOR)13835             VALIDATORS.put(POWER_BUTTON_LONG_PRESS, POWER_BUTTON_LONG_PRESS_VALIDATOR);
VALIDATORS.put(POWER_BUTTON_VERY_LONG_PRESS, POWER_BUTTON_VERY_LONG_PRESS_VALIDATOR)13836             VALIDATORS.put(POWER_BUTTON_VERY_LONG_PRESS, POWER_BUTTON_VERY_LONG_PRESS_VALIDATOR);
13837         }
13838 
13839         /**
13840          * Global settings that shouldn't be persisted.
13841          *
13842          * @hide
13843          */
13844         public static final String[] TRANSIENT_SETTINGS = {
13845                 LOCATION_GLOBAL_KILL_SWITCH,
13846         };
13847 
13848         /**
13849          * Keys we no longer back up under the current schema, but want to continue to
13850          * process when restoring historical backup datasets.
13851          *
13852          * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
13853          * otherwise they won't be restored.
13854          *
13855          * @hide
13856          */
13857         public static final String[] LEGACY_RESTORE_SETTINGS = {
13858         };
13859 
13860         @UnsupportedAppUsage
13861         private static final ContentProviderHolder sProviderHolder =
13862                 new ContentProviderHolder(CONTENT_URI);
13863 
13864         // Populated lazily, guarded by class object:
13865         @UnsupportedAppUsage
13866         private static final NameValueCache sNameValueCache = new NameValueCache(
13867                     CONTENT_URI,
13868                     CALL_METHOD_GET_GLOBAL,
13869                     CALL_METHOD_PUT_GLOBAL,
13870                     sProviderHolder);
13871 
13872         // Certain settings have been moved from global to the per-user secure namespace
13873         @UnsupportedAppUsage
13874         private static final HashSet<String> MOVED_TO_SECURE;
13875         static {
13876             MOVED_TO_SECURE = new HashSet<>(8);
13877             MOVED_TO_SECURE.add(Global.INSTALL_NON_MARKET_APPS);
13878             MOVED_TO_SECURE.add(Global.ZEN_DURATION);
13879             MOVED_TO_SECURE.add(Global.SHOW_ZEN_UPGRADE_NOTIFICATION);
13880             MOVED_TO_SECURE.add(Global.SHOW_ZEN_SETTINGS_SUGGESTION);
13881             MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_UPDATED);
13882             MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_SUGGESTION_VIEWED);
13883             MOVED_TO_SECURE.add(Global.CHARGING_SOUNDS_ENABLED);
13884             MOVED_TO_SECURE.add(Global.CHARGING_VIBRATION_ENABLED);
13885 
13886         }
13887 
13888         /** @hide */
getMovedToSecureSettings(Set<String> outKeySet)13889         public static void getMovedToSecureSettings(Set<String> outKeySet) {
13890             outKeySet.addAll(MOVED_TO_SECURE);
13891         }
13892 
13893         /** @hide */
clearProviderForTest()13894         public static void clearProviderForTest() {
13895             sProviderHolder.clearProviderForTest();
13896             sNameValueCache.clearGenerationTrackerForTest();
13897         }
13898 
13899         /**
13900          * Look up a name in the database.
13901          * @param resolver to access the database with
13902          * @param name to look up in the table
13903          * @return the corresponding value, or null if not present
13904          */
getString(ContentResolver resolver, String name)13905         public static String getString(ContentResolver resolver, String name) {
13906             return getStringForUser(resolver, name, resolver.getUserId());
13907         }
13908 
13909         /** @hide */
13910         @UnsupportedAppUsage
getStringForUser(ContentResolver resolver, String name, int userHandle)13911         public static String getStringForUser(ContentResolver resolver, String name,
13912                 int userHandle) {
13913             if (MOVED_TO_SECURE.contains(name)) {
13914                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
13915                         + " to android.provider.Settings.Secure, returning read-only value.");
13916                 return Secure.getStringForUser(resolver, name, userHandle);
13917             }
13918             return sNameValueCache.getStringForUser(resolver, name, userHandle);
13919         }
13920 
13921         /**
13922          * Store a name/value pair into the database.
13923          * @param resolver to access the database with
13924          * @param name to store
13925          * @param value to associate with the name
13926          * @return true if the value was set, false on database errors
13927          */
putString(ContentResolver resolver, String name, String value)13928         public static boolean putString(ContentResolver resolver,
13929                 String name, String value) {
13930             return putStringForUser(resolver, name, value, null, false, resolver.getUserId());
13931         }
13932 
13933         /**
13934          * Store a name/value pair into the database.
13935          * <p>
13936          * The method takes an optional tag to associate with the setting
13937          * which can be used to clear only settings made by your package and
13938          * associated with this tag by passing the tag to {@link
13939          * #resetToDefaults(ContentResolver, String)}. Anyone can override
13940          * the current tag. Also if another package changes the setting
13941          * then the tag will be set to the one specified in the set call
13942          * which can be null. Also any of the settings setters that do not
13943          * take a tag as an argument effectively clears the tag.
13944          * </p><p>
13945          * For example, if you set settings A and B with tags T1 and T2 and
13946          * another app changes setting A (potentially to the same value), it
13947          * can assign to it a tag T3 (note that now the package that changed
13948          * the setting is not yours). Now if you reset your changes for T1 and
13949          * T2 only setting B will be reset and A not (as it was changed by
13950          * another package) but since A did not change you are in the desired
13951          * initial state. Now if the other app changes the value of A (assuming
13952          * you registered an observer in the beginning) you would detect that
13953          * the setting was changed by another app and handle this appropriately
13954          * (ignore, set back to some value, etc).
13955          * </p><p>
13956          * Also the method takes an argument whether to make the value the
13957          * default for this setting. If the system already specified a default
13958          * value, then the one passed in here will <strong>not</strong>
13959          * be set as the default.
13960          * </p>
13961          *
13962          * @param resolver to access the database with.
13963          * @param name to store.
13964          * @param value to associate with the name.
13965          * @param tag to associated with the setting.
13966          * @param makeDefault whether to make the value the default one.
13967          * @return true if the value was set, false on database errors.
13968          *
13969          * @see #resetToDefaults(ContentResolver, String)
13970          *
13971          * @hide
13972          */
13973         @SystemApi
13974         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)13975         public static boolean putString(@NonNull ContentResolver resolver,
13976                 @NonNull String name, @Nullable String value, @Nullable String tag,
13977                 boolean makeDefault) {
13978             return putStringForUser(resolver, name, value, tag, makeDefault,
13979                     resolver.getUserId());
13980         }
13981 
13982         /**
13983          * Reset the settings to their defaults. This would reset <strong>only</strong>
13984          * settings set by the caller's package. Think of it of a way to undo your own
13985          * changes to the secure settings. Passing in the optional tag will reset only
13986          * settings changed by your package and associated with this tag.
13987          *
13988          * @param resolver Handle to the content resolver.
13989          * @param tag Optional tag which should be associated with the settings to reset.
13990          *
13991          * @see #putString(ContentResolver, String, String, String, boolean)
13992          *
13993          * @hide
13994          */
13995         @SystemApi
13996         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)13997         public static void resetToDefaults(@NonNull ContentResolver resolver,
13998                 @Nullable String tag) {
13999             resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
14000                     resolver.getUserId());
14001         }
14002 
14003         /**
14004          * Reset the settings to their defaults for a given user with a specific mode. The
14005          * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
14006          * allowing resetting the settings made by a package and associated with the tag.
14007          *
14008          * @param resolver Handle to the content resolver.
14009          * @param tag Optional tag which should be associated with the settings to reset.
14010          * @param mode The reset mode.
14011          * @param userHandle The user for which to reset to defaults.
14012          *
14013          * @see #RESET_MODE_PACKAGE_DEFAULTS
14014          * @see #RESET_MODE_UNTRUSTED_DEFAULTS
14015          * @see #RESET_MODE_UNTRUSTED_CHANGES
14016          * @see #RESET_MODE_TRUSTED_DEFAULTS
14017          *
14018          * @hide
14019          */
resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)14020         public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
14021                 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
14022             try {
14023                 Bundle arg = new Bundle();
14024                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
14025                 if (tag != null) {
14026                     arg.putString(CALL_METHOD_TAG_KEY, tag);
14027                 }
14028                 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
14029                 IContentProvider cp = sProviderHolder.getProvider(resolver);
14030                 cp.call(resolver.getPackageName(), sProviderHolder.mUri.getAuthority(),
14031                         CALL_METHOD_RESET_GLOBAL, null, arg);
14032             } catch (RemoteException e) {
14033                 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
14034             }
14035         }
14036 
14037         /** @hide */
14038         @UnsupportedAppUsage
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)14039         public static boolean putStringForUser(ContentResolver resolver,
14040                 String name, String value, int userHandle) {
14041             return putStringForUser(resolver, name, value, null, false, userHandle);
14042         }
14043 
14044         /** @hide */
putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle)14045         public static boolean putStringForUser(@NonNull ContentResolver resolver,
14046                 @NonNull String name, @Nullable String value, @Nullable String tag,
14047                 boolean makeDefault, @UserIdInt int userHandle) {
14048             if (LOCAL_LOGV) {
14049                 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
14050                         + " for " + userHandle);
14051             }
14052             // Global and Secure have the same access policy so we can forward writes
14053             if (MOVED_TO_SECURE.contains(name)) {
14054                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
14055                         + " to android.provider.Settings.Secure, value is unchanged.");
14056                 return Secure.putStringForUser(resolver, name, value, tag,
14057                         makeDefault, userHandle);
14058             }
14059             return sNameValueCache.putStringForUser(resolver, name, value, tag,
14060                     makeDefault, userHandle);
14061         }
14062 
14063         /**
14064          * Construct the content URI for a particular name/value pair,
14065          * useful for monitoring changes with a ContentObserver.
14066          * @param name to look up in the table
14067          * @return the corresponding content URI, or null if not present
14068          */
getUriFor(String name)14069         public static Uri getUriFor(String name) {
14070             return getUriFor(CONTENT_URI, name);
14071         }
14072 
14073         /**
14074          * Convenience function for retrieving a single secure settings value
14075          * as an integer.  Note that internally setting values are always
14076          * stored as strings; this function converts the string to an integer
14077          * for you.  The default value will be returned if the setting is
14078          * not defined or not an integer.
14079          *
14080          * @param cr The ContentResolver to access.
14081          * @param name The name of the setting to retrieve.
14082          * @param def Value to return if the setting is not defined.
14083          *
14084          * @return The setting's current value, or 'def' if it is not defined
14085          * or not a valid integer.
14086          */
getInt(ContentResolver cr, String name, int def)14087         public static int getInt(ContentResolver cr, String name, int def) {
14088             String v = getString(cr, name);
14089             try {
14090                 return v != null ? Integer.parseInt(v) : def;
14091             } catch (NumberFormatException e) {
14092                 return def;
14093             }
14094         }
14095 
14096         /**
14097          * Convenience function for retrieving a single secure settings value
14098          * as an integer.  Note that internally setting values are always
14099          * stored as strings; this function converts the string to an integer
14100          * for you.
14101          * <p>
14102          * This version does not take a default value.  If the setting has not
14103          * been set, or the string value is not a number,
14104          * it throws {@link SettingNotFoundException}.
14105          *
14106          * @param cr The ContentResolver to access.
14107          * @param name The name of the setting to retrieve.
14108          *
14109          * @throws SettingNotFoundException Thrown if a setting by the given
14110          * name can't be found or the setting value is not an integer.
14111          *
14112          * @return The setting's current value.
14113          */
getInt(ContentResolver cr, String name)14114         public static int getInt(ContentResolver cr, String name)
14115                 throws SettingNotFoundException {
14116             String v = getString(cr, name);
14117             try {
14118                 return Integer.parseInt(v);
14119             } catch (NumberFormatException e) {
14120                 throw new SettingNotFoundException(name);
14121             }
14122         }
14123 
14124         /**
14125          * Convenience function for updating a single settings value as an
14126          * integer. This will either create a new entry in the table if the
14127          * given name does not exist, or modify the value of the existing row
14128          * with that name.  Note that internally setting values are always
14129          * stored as strings, so this function converts the given value to a
14130          * string before storing it.
14131          *
14132          * @param cr The ContentResolver to access.
14133          * @param name The name of the setting to modify.
14134          * @param value The new value for the setting.
14135          * @return true if the value was set, false on database errors
14136          */
putInt(ContentResolver cr, String name, int value)14137         public static boolean putInt(ContentResolver cr, String name, int value) {
14138             return putString(cr, name, Integer.toString(value));
14139         }
14140 
14141         /**
14142          * Convenience function for retrieving a single secure settings value
14143          * as a {@code long}.  Note that internally setting values are always
14144          * stored as strings; this function converts the string to a {@code long}
14145          * for you.  The default value will be returned if the setting is
14146          * not defined or not a {@code long}.
14147          *
14148          * @param cr The ContentResolver to access.
14149          * @param name The name of the setting to retrieve.
14150          * @param def Value to return if the setting is not defined.
14151          *
14152          * @return The setting's current value, or 'def' if it is not defined
14153          * or not a valid {@code long}.
14154          */
getLong(ContentResolver cr, String name, long def)14155         public static long getLong(ContentResolver cr, String name, long def) {
14156             String valString = getString(cr, name);
14157             long value;
14158             try {
14159                 value = valString != null ? Long.parseLong(valString) : def;
14160             } catch (NumberFormatException e) {
14161                 value = def;
14162             }
14163             return value;
14164         }
14165 
14166         /**
14167          * Convenience function for retrieving a single secure settings value
14168          * as a {@code long}.  Note that internally setting values are always
14169          * stored as strings; this function converts the string to a {@code long}
14170          * for you.
14171          * <p>
14172          * This version does not take a default value.  If the setting has not
14173          * been set, or the string value is not a number,
14174          * it throws {@link SettingNotFoundException}.
14175          *
14176          * @param cr The ContentResolver to access.
14177          * @param name The name of the setting to retrieve.
14178          *
14179          * @return The setting's current value.
14180          * @throws SettingNotFoundException Thrown if a setting by the given
14181          * name can't be found or the setting value is not an integer.
14182          */
getLong(ContentResolver cr, String name)14183         public static long getLong(ContentResolver cr, String name)
14184                 throws SettingNotFoundException {
14185             String valString = getString(cr, name);
14186             try {
14187                 return Long.parseLong(valString);
14188             } catch (NumberFormatException e) {
14189                 throw new SettingNotFoundException(name);
14190             }
14191         }
14192 
14193         /**
14194          * Convenience function for updating a secure settings value as a long
14195          * integer. This will either create a new entry in the table if the
14196          * given name does not exist, or modify the value of the existing row
14197          * with that name.  Note that internally setting values are always
14198          * stored as strings, so this function converts the given value to a
14199          * string before storing it.
14200          *
14201          * @param cr The ContentResolver to access.
14202          * @param name The name of the setting to modify.
14203          * @param value The new value for the setting.
14204          * @return true if the value was set, false on database errors
14205          */
putLong(ContentResolver cr, String name, long value)14206         public static boolean putLong(ContentResolver cr, String name, long value) {
14207             return putString(cr, name, Long.toString(value));
14208         }
14209 
14210         /**
14211          * Convenience function for retrieving a single secure settings value
14212          * as a floating point number.  Note that internally setting values are
14213          * always stored as strings; this function converts the string to an
14214          * float for you. The default value will be returned if the setting
14215          * is not defined or not a valid float.
14216          *
14217          * @param cr The ContentResolver to access.
14218          * @param name The name of the setting to retrieve.
14219          * @param def Value to return if the setting is not defined.
14220          *
14221          * @return The setting's current value, or 'def' if it is not defined
14222          * or not a valid float.
14223          */
getFloat(ContentResolver cr, String name, float def)14224         public static float getFloat(ContentResolver cr, String name, float def) {
14225             String v = getString(cr, name);
14226             try {
14227                 return v != null ? Float.parseFloat(v) : def;
14228             } catch (NumberFormatException e) {
14229                 return def;
14230             }
14231         }
14232 
14233         /**
14234          * Convenience function for retrieving a single secure settings value
14235          * as a float.  Note that internally setting values are always
14236          * stored as strings; this function converts the string to a float
14237          * for you.
14238          * <p>
14239          * This version does not take a default value.  If the setting has not
14240          * been set, or the string value is not a number,
14241          * it throws {@link SettingNotFoundException}.
14242          *
14243          * @param cr The ContentResolver to access.
14244          * @param name The name of the setting to retrieve.
14245          *
14246          * @throws SettingNotFoundException Thrown if a setting by the given
14247          * name can't be found or the setting value is not a float.
14248          *
14249          * @return The setting's current value.
14250          */
getFloat(ContentResolver cr, String name)14251         public static float getFloat(ContentResolver cr, String name)
14252                 throws SettingNotFoundException {
14253             String v = getString(cr, name);
14254             if (v == null) {
14255                 throw new SettingNotFoundException(name);
14256             }
14257             try {
14258                 return Float.parseFloat(v);
14259             } catch (NumberFormatException e) {
14260                 throw new SettingNotFoundException(name);
14261             }
14262         }
14263 
14264         /**
14265          * Convenience function for updating a single settings value as a
14266          * floating point number. This will either create a new entry in the
14267          * table if the given name does not exist, or modify the value of the
14268          * existing row with that name.  Note that internally setting values
14269          * are always stored as strings, so this function converts the given
14270          * value to a string before storing it.
14271          *
14272          * @param cr The ContentResolver to access.
14273          * @param name The name of the setting to modify.
14274          * @param value The new value for the setting.
14275          * @return true if the value was set, false on database errors
14276          */
putFloat(ContentResolver cr, String name, float value)14277         public static boolean putFloat(ContentResolver cr, String name, float value) {
14278             return putString(cr, name, Float.toString(value));
14279         }
14280 
14281         /**
14282           * Subscription to be used for voice call on a multi sim device. The supported values
14283           * are 0 = SUB1, 1 = SUB2 and etc.
14284           * @hide
14285           */
14286         public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
14287 
14288         /**
14289           * Used to provide option to user to select subscription during dial.
14290           * The supported values are 0 = disable or 1 = enable prompt.
14291           * @hide
14292           */
14293         @UnsupportedAppUsage
14294         public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
14295 
14296         /**
14297           * Subscription to be used for data call on a multi sim device. The supported values
14298           * are 0 = SUB1, 1 = SUB2 and etc.
14299           * @hide
14300           */
14301         public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
14302 
14303         /**
14304           * Subscription to be used for SMS on a multi sim device. The supported values
14305           * are 0 = SUB1, 1 = SUB2 and etc.
14306           * @hide
14307           */
14308         public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
14309 
14310         /**
14311           * Used to provide option to user to select subscription during send SMS.
14312           * The value 1 - enable, 0 - disable
14313           * @hide
14314           */
14315         public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
14316 
14317         /** User preferred subscriptions setting.
14318           * This holds the details of the user selected subscription from the card and
14319           * the activation status. Each settings string have the comma separated values
14320           * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
14321           * @hide
14322          */
14323         @UnsupportedAppUsage
14324         public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
14325                 "user_preferred_sub2","user_preferred_sub3"};
14326 
14327         /**
14328          * Which subscription is enabled for a physical slot.
14329          * @hide
14330          */
14331         public static final String ENABLED_SUBSCRIPTION_FOR_SLOT = "enabled_subscription_for_slot";
14332 
14333         /**
14334          * Whether corresponding logical modem is enabled for a physical slot.
14335          * The value 1 - enable, 0 - disable
14336          * @hide
14337          */
14338         public static final String MODEM_STACK_ENABLED_FOR_SLOT = "modem_stack_enabled_for_slot";
14339 
14340         /**
14341          * Whether to enable new contacts aggregator or not.
14342          * The value 1 - enable, 0 - disable
14343          * @hide
14344          */
14345         public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
14346 
14347         /**
14348          * Whether to enable contacts metadata syncing or not
14349          * The value 1 - enable, 0 - disable
14350          *
14351          * @removed
14352          */
14353         @Deprecated
14354         public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
14355 
14356         /**
14357          * Whether to enable contacts metadata syncing or not
14358          * The value 1 - enable, 0 - disable
14359          */
14360         public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled";
14361 
14362         /**
14363          * Whether to enable cellular on boot.
14364          * The value 1 - enable, 0 - disable
14365          * @hide
14366          */
14367         public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot";
14368 
14369         /**
14370          * The maximum allowed notification enqueue rate in Hertz.
14371          *
14372          * Should be a float, and includes updates only.
14373          * @hide
14374          */
14375         public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate";
14376 
14377         /**
14378          * Displays toasts when an app posts a notification that does not specify a valid channel.
14379          *
14380          * The value 1 - enable, 0 - disable
14381          * @hide
14382          */
14383         public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS =
14384                 "show_notification_channel_warnings";
14385 
14386         /**
14387          * Whether cell is enabled/disabled
14388          * @hide
14389          */
14390         public static final String CELL_ON = "cell_on";
14391 
14392         /**
14393          * Global settings which can be accessed by instant apps.
14394          * @hide
14395          */
14396         public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
14397         static {
14398             INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER);
14399             INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED);
14400             INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES);
14401             INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL);
14402             INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES);
14403             INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON);
14404             INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE);
14405             INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE);
14406             INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE);
14407             INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES);
14408             INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE);
14409             INSTANT_APP_SETTINGS.add(WTF_IS_FATAL);
14410             INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR);
14411             INSTANT_APP_SETTINGS.add(ZEN_MODE);
14412         }
14413 
14414         /**
14415          * Whether to show the high temperature warning notification.
14416          * @hide
14417          */
14418         public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning";
14419 
14420         /**
14421          * Whether to show the usb high temperature alarm notification.
14422          * @hide
14423          */
14424         public static final String SHOW_USB_TEMPERATURE_ALARM = "show_usb_temperature_alarm";
14425 
14426         /**
14427          * Temperature at which the high temperature warning notification should be shown.
14428          * @hide
14429          */
14430         public static final String WARNING_TEMPERATURE = "warning_temperature";
14431 
14432         /**
14433          * Whether the diskstats logging task is enabled/disabled.
14434          * @hide
14435          */
14436         public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging";
14437 
14438         /**
14439          * Whether the cache quota calculation task is enabled/disabled.
14440          * @hide
14441          */
14442         public static final String ENABLE_CACHE_QUOTA_CALCULATION =
14443                 "enable_cache_quota_calculation";
14444 
14445         /**
14446          * Whether the Deletion Helper no threshold toggle is available.
14447          * @hide
14448          */
14449         public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE =
14450                 "enable_deletion_helper_no_threshold_toggle";
14451 
14452         /**
14453          * The list of snooze options for notifications
14454          * This is encoded as a key=value list, separated by commas. Ex:
14455          *
14456          * "default=60,options_array=15:30:60:120"
14457          *
14458          * The following keys are supported:
14459          *
14460          * <pre>
14461          * default               (int)
14462          * options_array         (int[])
14463          * </pre>
14464          *
14465          * All delays in integer minutes. Array order is respected.
14466          * Options will be used in order up to the maximum allowed by the UI.
14467          * @hide
14468          */
14469         public static final String NOTIFICATION_SNOOZE_OPTIONS =
14470                 "notification_snooze_options";
14471 
14472         /**
14473          * Settings key for the ratio of notification dismissals to notification views - one of the
14474          * criteria for showing the notification blocking helper.
14475          *
14476          * <p>The value is a float ranging from 0.0 to 1.0 (the closer to 0.0, the more intrusive
14477          * the blocking helper will be).
14478          *
14479          * @hide
14480          */
14481         public static final String BLOCKING_HELPER_DISMISS_TO_VIEW_RATIO_LIMIT =
14482                 "blocking_helper_dismiss_to_view_ratio";
14483 
14484         /**
14485          * Settings key for the longest streak of dismissals  - one of the criteria for showing the
14486          * notification blocking helper.
14487          *
14488          * <p>The value is an integer greater than 0.
14489          *
14490          * @hide
14491          */
14492         public static final String BLOCKING_HELPER_STREAK_LIMIT = "blocking_helper_streak_limit";
14493 
14494         /**
14495          * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated
14496          * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF
14497          *
14498          * Supported keys:<br/>
14499          * <li>
14500          * <ul> {@code legacy_compatibility_wal_enabled} : A {code boolean} flag that determines
14501          * whether or not "compatibility WAL" mode is enabled by default. This is a legacy flag
14502          * and is honoured on Android Q and higher. This flag will be removed in a future release.
14503          * </ul>
14504          * <ul> {@code wal_syncmode} : A {@code String} representing the synchronization mode to use
14505          * when WAL is enabled, either via {@code legacy_compatibility_wal_enabled} or using the
14506          * obsolete {@code compatibility_wal_supported} flag.
14507          * </ul>
14508          * <ul> {@code truncate_size} : A {@code int} flag that specifies the truncate size of the
14509          * WAL journal.
14510          * </ul>
14511          * <ul> {@code compatibility_wal_supported} : A {code boolean} flag that specifies whether
14512          * the legacy "compatibility WAL" mode is enabled by default. This flag is obsolete and is
14513          * only supported on Android Pie.
14514          * </ul>
14515          * </li>
14516          *
14517          * @hide
14518          */
14519         public static final String SQLITE_COMPATIBILITY_WAL_FLAGS =
14520                 "sqlite_compatibility_wal_flags";
14521 
14522         /**
14523          * Enable GNSS Raw Measurements Full Tracking?
14524          * 0 = no
14525          * 1 = yes
14526          * @hide
14527          */
14528         public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING =
14529                 "enable_gnss_raw_meas_full_tracking";
14530 
14531         /**
14532          * Whether the notification should be ongoing (persistent) when a carrier app install is
14533          * required.
14534          *
14535          * The value is a boolean (1 or 0).
14536          * @hide
14537          */
14538         @SystemApi
14539         public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT =
14540                 "install_carrier_app_notification_persistent";
14541 
14542         /**
14543          * The amount of time (ms) to hide the install carrier app notification after the user has
14544          * ignored it. After this time passes, the notification will be shown again
14545          *
14546          * The value is a long
14547          * @hide
14548          */
14549         @SystemApi
14550         public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS =
14551                 "install_carrier_app_notification_sleep_millis";
14552 
14553         /**
14554          * Whether we've enabled zram on this device. Takes effect on
14555          * reboot. The value "1" enables zram; "0" disables it, and
14556          * everything else is unspecified.
14557          * @hide
14558          */
14559         public static final String ZRAM_ENABLED =
14560                 "zram_enabled";
14561 
14562         /**
14563          * Configuration flags for smart replies in notifications.
14564          * This is encoded as a key=value list, separated by commas. Ex:
14565          *
14566          * "enabled=1,max_squeeze_remeasure_count=3"
14567          *
14568          * The following keys are supported:
14569          *
14570          * <pre>
14571          * enabled                           (boolean)
14572          * requires_targeting_p              (boolean)
14573          * max_squeeze_remeasure_attempts    (int)
14574          * edit_choices_before_sending       (boolean)
14575          * show_in_heads_up                  (boolean)
14576          * min_num_system_generated_replies  (int)
14577          * max_num_actions                   (int)
14578          * </pre>
14579          * @see com.android.systemui.statusbar.policy.SmartReplyConstants
14580          * @hide
14581          */
14582         public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS =
14583                 "smart_replies_in_notifications_flags";
14584 
14585         /**
14586          * Configuration flags for the automatic generation of smart replies and smart actions in
14587          * notifications. This is encoded as a key=value list, separated by commas. Ex:
14588          * "generate_replies=false,generate_actions=true".
14589          *
14590          * The following keys are supported:
14591          *
14592          * <pre>
14593          * generate_replies                 (boolean)
14594          * generate_actions                 (boolean)
14595          * </pre>
14596          * @hide
14597          */
14598         public static final String SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS =
14599                 "smart_suggestions_in_notifications_flags";
14600 
14601         /**
14602          * If nonzero, crashes in foreground processes will bring up a dialog.
14603          * Otherwise, the process will be silently killed.
14604          * @hide
14605          */
14606         public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog";
14607 
14608         /**
14609          * If nonzero, crash dialogs will show an option to restart the app.
14610          * @hide
14611          */
14612         public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog";
14613 
14614         /**
14615          * If nonzero, crash dialogs will show an option to mute all future crash dialogs for
14616          * this app.
14617          * @hide
14618          */
14619         public static final String SHOW_MUTE_IN_CRASH_DIALOG = "show_mute_in_crash_dialog";
14620 
14621 
14622         /**
14623          * If nonzero, will show the zen upgrade notification when the user toggles DND on/off.
14624          * @hide
14625          * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_UPGRADE_NOTIFICATION}
14626          */
14627         @Deprecated
14628         public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";
14629 
14630         /**
14631          * If nonzero, will show the zen update settings suggestion.
14632          * @hide
14633          * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_SETTINGS_SUGGESTION}
14634          */
14635         @Deprecated
14636         public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion";
14637 
14638         /**
14639          * If nonzero, zen has not been updated to reflect new changes.
14640          * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_UPDATED}
14641          * @hide
14642          */
14643         @Deprecated
14644         public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated";
14645 
14646         /**
14647          * If nonzero, zen setting suggestion has been viewed by user
14648          * @hide
14649          * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_SUGGESTION_VIEWED}
14650          */
14651         @Deprecated
14652         public static final String ZEN_SETTINGS_SUGGESTION_VIEWED =
14653                 "zen_settings_suggestion_viewed";
14654 
14655         /**
14656          * Backup and restore agent timeout parameters.
14657          * These parameters are represented by a comma-delimited key-value list.
14658          *
14659          * The following strings are supported as keys:
14660          * <pre>
14661          *     kv_backup_agent_timeout_millis         (long)
14662          *     full_backup_agent_timeout_millis       (long)
14663          *     shared_backup_agent_timeout_millis     (long)
14664          *     restore_agent_timeout_millis           (long)
14665          *     restore_agent_finished_timeout_millis  (long)
14666          * </pre>
14667          *
14668          * They map to milliseconds represented as longs.
14669          *
14670          * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000"
14671          *
14672          * @hide
14673          */
14674         public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS =
14675                 "backup_agent_timeout_parameters";
14676 
14677         /**
14678          * Whether the backup system service supports multiple users (0 = disabled, 1 = enabled). If
14679          * disabled, the service will only be active for the system user.
14680          *
14681          * @hide
14682          */
14683         public static final String BACKUP_MULTI_USER_ENABLED = "backup_multi_user_enabled";
14684 
14685         /**
14686          * Blacklist of GNSS satellites.
14687          *
14688          * This is a list of integers separated by commas to represent pairs of (constellation,
14689          * svid). Thus, the number of integers should be even.
14690          *
14691          * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are
14692          * blacklisted. Note that svid=0 denotes all svids in the
14693          * constellation are blacklisted.
14694          *
14695          * @hide
14696          */
14697         public static final String GNSS_SATELLITE_BLACKLIST = "gnss_satellite_blacklist";
14698 
14699         /**
14700          * Duration of updates in millisecond for GNSS location request from HAL to framework.
14701          *
14702          * If zero, the GNSS location request feature is disabled.
14703          *
14704          * The value is a non-negative long.
14705          *
14706          * @hide
14707          */
14708         public static final String GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS =
14709                 "gnss_hal_location_request_duration_millis";
14710 
14711         /**
14712          * Binder call stats settings.
14713          *
14714          * The following strings are supported as keys:
14715          * <pre>
14716          *     enabled              (boolean)
14717          *     detailed_tracking    (boolean)
14718          *     upload_data          (boolean)
14719          *     sampling_interval    (int)
14720          * </pre>
14721          *
14722          * @hide
14723          */
14724         public static final String BINDER_CALLS_STATS = "binder_calls_stats";
14725 
14726         /**
14727          * Looper stats settings.
14728          *
14729          * The following strings are supported as keys:
14730          * <pre>
14731          *     enabled              (boolean)
14732          *     sampling_interval    (int)
14733          * </pre>
14734          *
14735          * @hide
14736          */
14737         public static final String LOOPER_STATS = "looper_stats";
14738 
14739         /**
14740          * Settings for collecting statistics on CPU usage per thread
14741          *
14742          * The following strings are supported as keys:
14743          * <pre>
14744          *     num_buckets          (int)
14745          *     collected_uids       (string)
14746          *     minimum_total_cpu_usage_millis (int)
14747          * </pre>
14748          *
14749          * @hide
14750          */
14751         public static final String KERNEL_CPU_THREAD_READER = "kernel_cpu_thread_reader";
14752 
14753         /**
14754          * Default user id to boot into. They map to user ids, for example, 10, 11, 12.
14755          *
14756          * @hide
14757          */
14758         public static final String DEFAULT_USER_ID_TO_BOOT_INTO = "default_boot_into_user_id";
14759 
14760         /**
14761          * Persistent user id that is last logged in to.
14762          *
14763          * They map to user ids, for example, 10, 11, 12.
14764          *
14765          * @hide
14766          */
14767         public static final String LAST_ACTIVE_USER_ID = "last_active_persistent_user_id";
14768 
14769         /**
14770          * Whether we've enabled native flags health check on this device. Takes effect on
14771          * reboot. The value "1" enables native flags health check; otherwise it's disabled.
14772          * @hide
14773          */
14774         public static final String NATIVE_FLAGS_HEALTH_CHECK_ENABLED =
14775                 "native_flags_health_check_enabled";
14776 
14777         /**
14778          * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the mode
14779          * in which the historical registry operates.
14780          *
14781          * @hide
14782          */
14783         public static final String APPOP_HISTORY_MODE = "mode";
14784 
14785         /**
14786          * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls how long
14787          * is the interval between snapshots in the base case i.e. the most recent
14788          * part of the history.
14789          *
14790          * @hide
14791          */
14792         public static final String APPOP_HISTORY_BASE_INTERVAL_MILLIS = "baseIntervalMillis";
14793 
14794         /**
14795          * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the base
14796          * for the logarithmic step when building app op history.
14797          *
14798          * @hide
14799          */
14800         public static final String APPOP_HISTORY_INTERVAL_MULTIPLIER = "intervalMultiplier";
14801 
14802         /**
14803          * Appop history parameters. These parameters are represented by
14804          * a comma-delimited key-value list.
14805          *
14806          * The following strings are supported as keys:
14807          * <pre>
14808          *     mode                  (int)
14809          *     baseIntervalMillis    (long)
14810          *     intervalMultiplier    (int)
14811          * </pre>
14812          *
14813          * Ex: "mode=HISTORICAL_MODE_ENABLED_ACTIVE,baseIntervalMillis=1000,intervalMultiplier=10"
14814          *
14815          * @see #APPOP_HISTORY_MODE
14816          * @see #APPOP_HISTORY_BASE_INTERVAL_MILLIS
14817          * @see #APPOP_HISTORY_INTERVAL_MULTIPLIER
14818          *
14819          * @hide
14820          */
14821         public static final String APPOP_HISTORY_PARAMETERS =
14822                 "appop_history_parameters";
14823 
14824         /**
14825          * Delay for sending ACTION_CHARGING after device is plugged in.
14826          * This is used as an override for constants defined in BatteryStatsImpl for
14827          * ease of experimentation.
14828          *
14829          * @see com.android.internal.os.BatteryStatsImpl.Constants.KEY_BATTERY_CHARGED_DELAY_MS
14830          * @hide
14831          */
14832         public static final String BATTERY_CHARGING_STATE_UPDATE_DELAY =
14833                 "battery_charging_state_update_delay";
14834 
14835         /**
14836          * A serialized string of params that will be loaded into a text classifier action model.
14837          *
14838          * @hide
14839          */
14840         public static final String TEXT_CLASSIFIER_ACTION_MODEL_PARAMS =
14841                 "text_classifier_action_model_params";
14842 
14843         /**
14844          * The amount of time to suppress "power-off" from the power button after the device has
14845          * woken due to a gesture (lifting the phone).  Since users have learned to hit the power
14846          * button immediately when lifting their device, it can cause the device to turn off if a
14847          * gesture has just woken the device. This value tells us the milliseconds to wait after
14848          * a gesture before "power-off" via power-button is functional again. A value of 0 is no
14849          * delay, and reverts to the old behavior.
14850          *
14851          * @hide
14852          */
14853         public static final String POWER_BUTTON_SUPPRESSION_DELAY_AFTER_GESTURE_WAKE =
14854                 "power_button_suppression_delay_after_gesture_wake";
14855     }
14856 
14857     /**
14858      * Configuration system settings, containing settings which are applied identically for all
14859      * defined users. Only Android can read these and only a specific configuration service can
14860      * write these.
14861      *
14862      * @hide
14863      */
14864     public static final class Config extends NameValueTable {
14865         private static final ContentProviderHolder sProviderHolder =
14866                 new ContentProviderHolder(DeviceConfig.CONTENT_URI);
14867 
14868         // Populated lazily, guarded by class object:
14869         private static final NameValueCache sNameValueCache = new NameValueCache(
14870                 DeviceConfig.CONTENT_URI,
14871                 CALL_METHOD_GET_CONFIG,
14872                 CALL_METHOD_PUT_CONFIG,
14873                 sProviderHolder);
14874 
14875         /**
14876          * Look up a name in the database.
14877          * @param resolver to access the database with
14878          * @param name to look up in the table
14879          * @return the corresponding value, or null if not present
14880          *
14881          * @hide
14882          */
14883         @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG)
getString(ContentResolver resolver, String name)14884         static String getString(ContentResolver resolver, String name) {
14885             return sNameValueCache.getStringForUser(resolver, name, resolver.getUserId());
14886         }
14887 
14888         /**
14889          * Store a name/value pair into the database.
14890          * <p>
14891          * Also the method takes an argument whether to make the value the default for this setting.
14892          * If the system already specified a default value, then the one passed in here will
14893          * <strong>not</strong> be set as the default.
14894          * </p>
14895          *
14896          * @param resolver to access the database with.
14897          * @param name to store.
14898          * @param value to associate with the name.
14899          * @param makeDefault whether to make the value the default one.
14900          * @return true if the value was set, false on database errors.
14901          *
14902          * @see #resetToDefaults(ContentResolver, int, String)
14903          *
14904          * @hide
14905          */
14906         @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, boolean makeDefault)14907         static boolean putString(@NonNull ContentResolver resolver, @NonNull String name,
14908                 @Nullable String value, boolean makeDefault) {
14909             return sNameValueCache.putStringForUser(resolver, name, value, null, makeDefault,
14910                     resolver.getUserId());
14911         }
14912 
14913         /**
14914          * Reset the values to their defaults.
14915          * <p>
14916          * The method accepts an optional prefix parameter. If provided, only pairs with a name that
14917          * starts with the exact prefix will be reset. Otherwise all will be reset.
14918          *
14919          * @param resolver Handle to the content resolver.
14920          * @param resetMode The reset mode to use.
14921          * @param prefix Optionally, to limit which which pairs are reset.
14922          *
14923          * @see #putString(ContentResolver, String, String, boolean)
14924          *
14925          * @hide
14926          */
14927         @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
resetToDefaults(@onNull ContentResolver resolver, @ResetMode int resetMode, @Nullable String prefix)14928         static void resetToDefaults(@NonNull ContentResolver resolver, @ResetMode int resetMode,
14929                 @Nullable String prefix) {
14930             try {
14931                 Bundle arg = new Bundle();
14932                 arg.putInt(CALL_METHOD_USER_KEY, resolver.getUserId());
14933                 arg.putInt(CALL_METHOD_RESET_MODE_KEY, resetMode);
14934                 if (prefix != null) {
14935                     arg.putString(Settings.CALL_METHOD_PREFIX_KEY, prefix);
14936                 }
14937                 IContentProvider cp = sProviderHolder.getProvider(resolver);
14938                 cp.call(resolver.getPackageName(), sProviderHolder.mUri.getAuthority(),
14939                         CALL_METHOD_RESET_CONFIG, null, arg);
14940             } catch (RemoteException e) {
14941                 Log.w(TAG, "Can't reset to defaults for " + DeviceConfig.CONTENT_URI, e);
14942             }
14943         }
14944     }
14945 
14946     /**
14947      * User-defined bookmarks and shortcuts.  The target of each bookmark is an
14948      * Intent URL, allowing it to be either a web page or a particular
14949      * application activity.
14950      *
14951      * @hide
14952      */
14953     public static final class Bookmarks implements BaseColumns
14954     {
14955         private static final String TAG = "Bookmarks";
14956 
14957         /**
14958          * The content:// style URL for this table
14959          */
14960         @UnsupportedAppUsage
14961         public static final Uri CONTENT_URI =
14962             Uri.parse("content://" + AUTHORITY + "/bookmarks");
14963 
14964         /**
14965          * The row ID.
14966          * <p>Type: INTEGER</p>
14967          */
14968         public static final String ID = "_id";
14969 
14970         /**
14971          * Descriptive name of the bookmark that can be displayed to the user.
14972          * If this is empty, the title should be resolved at display time (use
14973          * {@link #getTitle(Context, Cursor)} any time you want to display the
14974          * title of a bookmark.)
14975          * <P>
14976          * Type: TEXT
14977          * </P>
14978          */
14979         public static final String TITLE = "title";
14980 
14981         /**
14982          * Arbitrary string (displayed to the user) that allows bookmarks to be
14983          * organized into categories.  There are some special names for
14984          * standard folders, which all start with '@'.  The label displayed for
14985          * the folder changes with the locale (via {@link #getLabelForFolder}) but
14986          * the folder name does not change so you can consistently query for
14987          * the folder regardless of the current locale.
14988          *
14989          * <P>Type: TEXT</P>
14990          *
14991          */
14992         public static final String FOLDER = "folder";
14993 
14994         /**
14995          * The Intent URL of the bookmark, describing what it points to.  This
14996          * value is given to {@link android.content.Intent#getIntent} to create
14997          * an Intent that can be launched.
14998          * <P>Type: TEXT</P>
14999          */
15000         public static final String INTENT = "intent";
15001 
15002         /**
15003          * Optional shortcut character associated with this bookmark.
15004          * <P>Type: INTEGER</P>
15005          */
15006         public static final String SHORTCUT = "shortcut";
15007 
15008         /**
15009          * The order in which the bookmark should be displayed
15010          * <P>Type: INTEGER</P>
15011          */
15012         public static final String ORDERING = "ordering";
15013 
15014         private static final String[] sIntentProjection = { INTENT };
15015         private static final String[] sShortcutProjection = { ID, SHORTCUT };
15016         private static final String sShortcutSelection = SHORTCUT + "=?";
15017 
15018         /**
15019          * Convenience function to retrieve the bookmarked Intent for a
15020          * particular shortcut key.
15021          *
15022          * @param cr The ContentResolver to query.
15023          * @param shortcut The shortcut key.
15024          *
15025          * @return Intent The bookmarked URL, or null if there is no bookmark
15026          *         matching the given shortcut.
15027          */
getIntentForShortcut(ContentResolver cr, char shortcut)15028         public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
15029         {
15030             Intent intent = null;
15031 
15032             Cursor c = cr.query(CONTENT_URI,
15033                     sIntentProjection, sShortcutSelection,
15034                     new String[] { String.valueOf((int) shortcut) }, ORDERING);
15035             // Keep trying until we find a valid shortcut
15036             try {
15037                 while (intent == null && c.moveToNext()) {
15038                     try {
15039                         String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
15040                         intent = Intent.parseUri(intentURI, 0);
15041                     } catch (java.net.URISyntaxException e) {
15042                         // The stored URL is bad...  ignore it.
15043                     } catch (IllegalArgumentException e) {
15044                         // Column not found
15045                         Log.w(TAG, "Intent column not found", e);
15046                     }
15047                 }
15048             } finally {
15049                 if (c != null) c.close();
15050             }
15051 
15052             return intent;
15053         }
15054 
15055         /**
15056          * Add a new bookmark to the system.
15057          *
15058          * @param cr The ContentResolver to query.
15059          * @param intent The desired target of the bookmark.
15060          * @param title Bookmark title that is shown to the user; null if none
15061          *            or it should be resolved to the intent's title.
15062          * @param folder Folder in which to place the bookmark; null if none.
15063          * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
15064          *            this is non-zero and there is an existing bookmark entry
15065          *            with this same shortcut, then that existing shortcut is
15066          *            cleared (the bookmark is not removed).
15067          * @return The unique content URL for the new bookmark entry.
15068          */
15069         @UnsupportedAppUsage
add(ContentResolver cr, Intent intent, String title, String folder, char shortcut, int ordering)15070         public static Uri add(ContentResolver cr,
15071                                            Intent intent,
15072                                            String title,
15073                                            String folder,
15074                                            char shortcut,
15075                                            int ordering)
15076         {
15077             // If a shortcut is supplied, and it is already defined for
15078             // another bookmark, then remove the old definition.
15079             if (shortcut != 0) {
15080                 cr.delete(CONTENT_URI, sShortcutSelection,
15081                         new String[] { String.valueOf((int) shortcut) });
15082             }
15083 
15084             ContentValues values = new ContentValues();
15085             if (title != null) values.put(TITLE, title);
15086             if (folder != null) values.put(FOLDER, folder);
15087             values.put(INTENT, intent.toUri(0));
15088             if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
15089             values.put(ORDERING, ordering);
15090             return cr.insert(CONTENT_URI, values);
15091         }
15092 
15093         /**
15094          * Return the folder name as it should be displayed to the user.  This
15095          * takes care of localizing special folders.
15096          *
15097          * @param r Resources object for current locale; only need access to
15098          *          system resources.
15099          * @param folder The value found in the {@link #FOLDER} column.
15100          *
15101          * @return CharSequence The label for this folder that should be shown
15102          *         to the user.
15103          */
getLabelForFolder(Resources r, String folder)15104         public static CharSequence getLabelForFolder(Resources r, String folder) {
15105             return folder;
15106         }
15107 
15108         /**
15109          * Return the title as it should be displayed to the user. This takes
15110          * care of localizing bookmarks that point to activities.
15111          *
15112          * @param context A context.
15113          * @param cursor A cursor pointing to the row whose title should be
15114          *        returned. The cursor must contain at least the {@link #TITLE}
15115          *        and {@link #INTENT} columns.
15116          * @return A title that is localized and can be displayed to the user,
15117          *         or the empty string if one could not be found.
15118          */
getTitle(Context context, Cursor cursor)15119         public static CharSequence getTitle(Context context, Cursor cursor) {
15120             int titleColumn = cursor.getColumnIndex(TITLE);
15121             int intentColumn = cursor.getColumnIndex(INTENT);
15122             if (titleColumn == -1 || intentColumn == -1) {
15123                 throw new IllegalArgumentException(
15124                         "The cursor must contain the TITLE and INTENT columns.");
15125             }
15126 
15127             String title = cursor.getString(titleColumn);
15128             if (!TextUtils.isEmpty(title)) {
15129                 return title;
15130             }
15131 
15132             String intentUri = cursor.getString(intentColumn);
15133             if (TextUtils.isEmpty(intentUri)) {
15134                 return "";
15135             }
15136 
15137             Intent intent;
15138             try {
15139                 intent = Intent.parseUri(intentUri, 0);
15140             } catch (URISyntaxException e) {
15141                 return "";
15142             }
15143 
15144             PackageManager packageManager = context.getPackageManager();
15145             ResolveInfo info = packageManager.resolveActivity(intent, 0);
15146             return info != null ? info.loadLabel(packageManager) : "";
15147         }
15148     }
15149 
15150     /**
15151      * <p>
15152      *     A Settings panel is floating UI that contains a fixed subset of settings to address a
15153      *     particular user problem. For example, the
15154      *     {@link #ACTION_INTERNET_CONNECTIVITY Internet Panel} surfaces settings related to
15155      *     connecting to the internet.
15156      * <p>
15157      *     Settings panels appear above the calling app to address the problem without
15158      *     the user needing to open Settings and thus leave their current screen.
15159      */
15160     public static final class Panel {
Panel()15161         private Panel() {
15162         }
15163 
15164         /**
15165          * Activity Action: Show a settings dialog containing settings to enable internet
15166          * connection.
15167          * <p>
15168          * Input: Nothing.
15169          * <p>
15170          * Output: Nothing.
15171          */
15172         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
15173         public static final String ACTION_INTERNET_CONNECTIVITY =
15174                 "android.settings.panel.action.INTERNET_CONNECTIVITY";
15175 
15176         /**
15177          * Activity Action: Show a settings dialog containing NFC-related settings.
15178          * <p>
15179          * Input: Nothing.
15180          * <p>
15181          * Output: Nothing.
15182          */
15183         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
15184         public static final String ACTION_NFC =
15185                 "android.settings.panel.action.NFC";
15186 
15187         /**
15188          * Activity Action: Show a settings dialog containing controls for Wifi.
15189          * <p>
15190          * Input: Nothing.
15191          * <p>
15192          * Output: Nothing.
15193          */
15194         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
15195         public static final String ACTION_WIFI =
15196                 "android.settings.panel.action.WIFI";
15197 
15198         /**
15199          * Activity Action: Show a settings dialog containing all volume streams.
15200          * <p>
15201          * Input: Nothing.
15202          * <p>
15203          * Output: Nothing.
15204          */
15205         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
15206         public static final String ACTION_VOLUME =
15207                 "android.settings.panel.action.VOLUME";
15208     }
15209 
15210     private static final String[] PM_WRITE_SETTINGS = {
15211         android.Manifest.permission.WRITE_SETTINGS
15212     };
15213     private static final String[] PM_CHANGE_NETWORK_STATE = {
15214         android.Manifest.permission.CHANGE_NETWORK_STATE,
15215         android.Manifest.permission.WRITE_SETTINGS
15216     };
15217     private static final String[] PM_SYSTEM_ALERT_WINDOW = {
15218         android.Manifest.permission.SYSTEM_ALERT_WINDOW
15219     };
15220 
15221     /**
15222      * Performs a strict and comprehensive check of whether a calling package is allowed to
15223      * write/modify system settings, as the condition differs for pre-M, M+, and
15224      * privileged/preinstalled apps. If the provided uid does not match the
15225      * callingPackage, a negative result will be returned.
15226      * @hide
15227      */
15228     @UnsupportedAppUsage
isCallingPackageAllowedToWriteSettings(Context context, int uid, String callingPackage, boolean throwException)15229     public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid,
15230             String callingPackage, boolean throwException) {
15231         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
15232                 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
15233                 PM_WRITE_SETTINGS, false);
15234     }
15235 
15236     /**
15237      * Performs a strict and comprehensive check of whether a calling package is allowed to
15238      * write/modify system settings, as the condition differs for pre-M, M+, and
15239      * privileged/preinstalled apps. If the provided uid does not match the
15240      * callingPackage, a negative result will be returned. The caller is expected to have
15241      * the WRITE_SETTINGS permission declared.
15242      *
15243      * Note: if the check is successful, the operation of this app will be updated to the
15244      * current time.
15245      * @hide
15246      */
checkAndNoteWriteSettingsOperation(Context context, int uid, String callingPackage, boolean throwException)15247     public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid,
15248             String callingPackage, boolean throwException) {
15249         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
15250                 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
15251                 PM_WRITE_SETTINGS, true);
15252     }
15253 
15254     /**
15255      * Performs a strict and comprehensive check of whether a calling package is allowed to
15256      * change the state of network, as the condition differs for pre-M, M+, and
15257      * privileged/preinstalled apps. The caller is expected to have either the
15258      * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these
15259      * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and
15260      * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal
15261      * permission and cannot be revoked. See http://b/23597341
15262      *
15263      * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation
15264      * of this app will be updated to the current time.
15265      * @hide
15266      */
checkAndNoteChangeNetworkStateOperation(Context context, int uid, String callingPackage, boolean throwException)15267     public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid,
15268             String callingPackage, boolean throwException) {
15269         if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE)
15270                 == PackageManager.PERMISSION_GRANTED) {
15271             return true;
15272         }
15273         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
15274                 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
15275                 PM_CHANGE_NETWORK_STATE, true);
15276     }
15277 
15278     /**
15279      * Performs a strict and comprehensive check of whether a calling package is allowed to
15280      * draw on top of other apps, as the conditions differs for pre-M, M+, and
15281      * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
15282      * a negative result will be returned.
15283      * @hide
15284      */
15285     @UnsupportedAppUsage
isCallingPackageAllowedToDrawOverlays(Context context, int uid, String callingPackage, boolean throwException)15286     public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid,
15287             String callingPackage, boolean throwException) {
15288         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
15289                 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
15290                 PM_SYSTEM_ALERT_WINDOW, false);
15291     }
15292 
15293     /**
15294      * Performs a strict and comprehensive check of whether a calling package is allowed to
15295      * draw on top of other apps, as the conditions differs for pre-M, M+, and
15296      * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
15297      * a negative result will be returned.
15298      *
15299      * Note: if the check is successful, the operation of this app will be updated to the
15300      * current time.
15301      * @hide
15302      */
checkAndNoteDrawOverlaysOperation(Context context, int uid, String callingPackage, boolean throwException)15303     public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String
15304             callingPackage, boolean throwException) {
15305         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
15306                 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
15307                 PM_SYSTEM_ALERT_WINDOW, true);
15308     }
15309 
15310     /**
15311      * Helper method to perform a general and comprehensive check of whether an operation that is
15312      * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and
15313      * OP_WRITE_SETTINGS
15314      * @hide
15315      */
15316     @UnsupportedAppUsage
isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] permissions, boolean makeNote)15317     public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
15318             int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[]
15319             permissions, boolean makeNote) {
15320         if (callingPackage == null) {
15321             return false;
15322         }
15323 
15324         AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE);
15325         int mode = AppOpsManager.MODE_DEFAULT;
15326         if (makeNote) {
15327             mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage);
15328         } else {
15329             mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage);
15330         }
15331 
15332         switch (mode) {
15333             case AppOpsManager.MODE_ALLOWED:
15334                 return true;
15335 
15336             case AppOpsManager.MODE_DEFAULT:
15337                 // this is the default operating mode after an app's installation
15338                 // In this case we will check all associated static permission to see
15339                 // if it is granted during install time.
15340                 for (String permission : permissions) {
15341                     if (context.checkCallingOrSelfPermission(permission) == PackageManager
15342                             .PERMISSION_GRANTED) {
15343                         // if either of the permissions are granted, we will allow it
15344                         return true;
15345                     }
15346                 }
15347 
15348             default:
15349                 // this is for all other cases trickled down here...
15350                 if (!throwException) {
15351                     return false;
15352                 }
15353         }
15354 
15355         // prepare string to throw SecurityException
15356         StringBuilder exceptionMessage = new StringBuilder();
15357         exceptionMessage.append(callingPackage);
15358         exceptionMessage.append(" was not granted ");
15359         if (permissions.length > 1) {
15360             exceptionMessage.append(" either of these permissions: ");
15361         } else {
15362             exceptionMessage.append(" this permission: ");
15363         }
15364         for (int i = 0; i < permissions.length; i++) {
15365             exceptionMessage.append(permissions[i]);
15366             exceptionMessage.append((i == permissions.length - 1) ? "." : ", ");
15367         }
15368 
15369         throw new SecurityException(exceptionMessage.toString());
15370     }
15371 
15372     /**
15373      * Retrieves a correponding package name for a given uid. It will query all
15374      * packages that are associated with the given uid, but it will return only
15375      * the zeroth result.
15376      * Note: If package could not be found, a null is returned.
15377      * @hide
15378      */
getPackageNameForUid(Context context, int uid)15379     public static String getPackageNameForUid(Context context, int uid) {
15380         String[] packages = context.getPackageManager().getPackagesForUid(uid);
15381         if (packages == null) {
15382             return null;
15383         }
15384         return packages[0];
15385     }
15386 }
15387