• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2006 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.provider;
18 
19 import 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.UserIdInt;
41 import android.app.ActivityThread;
42 import android.app.AppOpsManager;
43 import android.app.Application;
44 import android.app.NotificationChannel;
45 import android.app.NotificationManager;
46 import android.app.SearchManager;
47 import android.app.WallpaperManager;
48 import android.content.ComponentName;
49 import android.content.ContentResolver;
50 import android.content.ContentValues;
51 import android.content.Context;
52 import android.content.IContentProvider;
53 import android.content.Intent;
54 import android.content.pm.ActivityInfo;
55 import android.content.pm.PackageManager;
56 import android.content.pm.ResolveInfo;
57 import android.content.res.Configuration;
58 import android.content.res.Resources;
59 import android.database.Cursor;
60 import android.database.SQLException;
61 import android.location.LocationManager;
62 import android.media.AudioFormat;
63 import android.net.ConnectivityManager;
64 import android.net.NetworkScoreManager;
65 import android.net.Uri;
66 import android.net.wifi.WifiManager;
67 import android.os.BatteryManager;
68 import android.os.Binder;
69 import android.os.Build.VERSION_CODES;
70 import android.os.Bundle;
71 import android.os.DropBoxManager;
72 import android.os.IBinder;
73 import android.os.LocaleList;
74 import android.os.Process;
75 import android.os.RemoteException;
76 import android.os.ResultReceiver;
77 import android.os.ServiceManager;
78 import android.os.UserHandle;
79 import android.provider.SettingsValidators.Validator;
80 import android.speech.tts.TextToSpeech;
81 import android.telephony.SubscriptionManager;
82 import android.text.TextUtils;
83 import android.util.AndroidException;
84 import android.util.ArrayMap;
85 import android.util.ArraySet;
86 import android.util.Log;
87 import android.util.MemoryIntArray;
88 import android.view.textservice.TextServicesManager;
89 
90 import com.android.internal.annotations.GuardedBy;
91 import com.android.internal.app.ColorDisplayController;
92 import com.android.internal.widget.ILockSettings;
93 
94 import java.io.IOException;
95 import java.lang.annotation.Retention;
96 import java.lang.annotation.RetentionPolicy;
97 import java.net.URISyntaxException;
98 import java.text.SimpleDateFormat;
99 import java.util.HashMap;
100 import java.util.HashSet;
101 import java.util.Locale;
102 import java.util.Map;
103 import java.util.Set;
104 
105 /**
106  * The Settings provider contains global system-level device preferences.
107  */
108 public final class Settings {
109 
110     // Intent actions for Settings
111 
112     /**
113      * Activity Action: Show system settings.
114      * <p>
115      * Input: Nothing.
116      * <p>
117      * Output: Nothing.
118      */
119     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
120     public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
121 
122     /**
123      * Activity Action: Show settings to allow configuration of APNs.
124      * <p>
125      * Input: Nothing.
126      * <p>
127      * Output: Nothing.
128      *
129      * <p class="note">
130      * In some cases, a matching Activity may not exist, so ensure you
131      * safeguard against this.
132      */
133     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
134     public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
135 
136     /**
137      * Activity Action: Show settings to allow configuration of current location
138      * sources.
139      * <p>
140      * In some cases, a matching Activity may not exist, so ensure you
141      * safeguard against this.
142      * <p>
143      * Input: Nothing.
144      * <p>
145      * Output: Nothing.
146      */
147     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
148     public static final String ACTION_LOCATION_SOURCE_SETTINGS =
149             "android.settings.LOCATION_SOURCE_SETTINGS";
150 
151     /**
152      * Activity Action: Show scanning settings to allow configuration of Wi-Fi
153      * and Bluetooth scanning settings.
154      * <p>
155      * In some cases, a matching Activity may not exist, so ensure you
156      * safeguard against this.
157      * <p>
158      * Input: Nothing.
159      * <p>
160      * Output: Nothing.
161      * @hide
162      */
163     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
164     public static final String ACTION_LOCATION_SCANNING_SETTINGS =
165             "android.settings.LOCATION_SCANNING_SETTINGS";
166 
167     /**
168      * Activity Action: Show settings to allow configuration of users.
169      * <p>
170      * In some cases, a matching Activity may not exist, so ensure you
171      * safeguard against this.
172      * <p>
173      * Input: Nothing.
174      * <p>
175      * Output: Nothing.
176      * @hide
177      */
178     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
179     public static final String ACTION_USER_SETTINGS =
180             "android.settings.USER_SETTINGS";
181 
182     /**
183      * Activity Action: Show settings to allow configuration of wireless controls
184      * such as Wi-Fi, Bluetooth and Mobile networks.
185      * <p>
186      * In some cases, a matching Activity may not exist, so ensure you
187      * safeguard against this.
188      * <p>
189      * Input: Nothing.
190      * <p>
191      * Output: Nothing.
192      */
193     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
194     public static final String ACTION_WIRELESS_SETTINGS =
195             "android.settings.WIRELESS_SETTINGS";
196 
197     /**
198      * Activity Action: Show tether provisioning activity.
199      *
200      * <p>
201      * In some cases, a matching Activity may not exist, so ensure you
202      * safeguard against this.
203      * <p>
204      * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type
205      * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should
206      * contain a {@link ResultReceiver} which will be called back with a tether result code.
207      * <p>
208      * Output: The result of the provisioning check.
209      * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful,
210      * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure.
211      *
212      * @hide
213      */
214     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
215     public static final String ACTION_TETHER_PROVISIONING =
216             "android.settings.TETHER_PROVISIONING_UI";
217 
218     /**
219      * Activity Action: Show settings to allow entering/exiting airplane mode.
220      * <p>
221      * In some cases, a matching Activity may not exist, so ensure you
222      * safeguard against this.
223      * <p>
224      * Input: Nothing.
225      * <p>
226      * Output: Nothing.
227      */
228     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
229     public static final String ACTION_AIRPLANE_MODE_SETTINGS =
230             "android.settings.AIRPLANE_MODE_SETTINGS";
231 
232     /**
233      * Activity Action: Show mobile data usage list.
234      * <p>
235      * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify
236      * how and what mobile data statistics should be collected.
237      * <p>
238      * Output: Nothing
239      * @hide
240      */
241     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
242     public static final String ACTION_MOBILE_DATA_USAGE =
243             "android.settings.MOBILE_DATA_USAGE";
244 
245     /** @hide */
246     public static final String EXTRA_NETWORK_TEMPLATE = "network_template";
247 
248     /**
249      * An int extra specifying a subscription ID.
250      *
251      * @see android.telephony.SubscriptionInfo#getSubscriptionId
252      */
253     public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID";
254 
255     /**
256      * Activity Action: Modify Airplane mode settings using a voice command.
257      * <p>
258      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
259      * <p>
260      * This intent MUST be started using
261      * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
262      * startVoiceActivity}.
263      * <p>
264      * Note: The activity implementing this intent MUST verify that
265      * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
266      * modifying the setting.
267      * <p>
268      * Input: To tell which state airplane mode should be set to, add the
269      * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
270      * If the extra is not included, no changes will be made.
271      * <p>
272      * Output: Nothing.
273      */
274     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
275     public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
276             "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
277 
278     /**
279      * Activity Action: Show settings for accessibility modules.
280      * <p>
281      * In some cases, a matching Activity may not exist, so ensure you
282      * safeguard against this.
283      * <p>
284      * Input: Nothing.
285      * <p>
286      * Output: Nothing.
287      */
288     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
289     public static final String ACTION_ACCESSIBILITY_SETTINGS =
290             "android.settings.ACCESSIBILITY_SETTINGS";
291 
292     /**
293      * Activity Action: Show settings to control access to usage information.
294      * <p>
295      * In some cases, a matching Activity may not exist, so ensure you
296      * safeguard against this.
297      * <p>
298      * Input: Nothing.
299      * <p>
300      * Output: Nothing.
301      */
302     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
303     public static final String ACTION_USAGE_ACCESS_SETTINGS =
304             "android.settings.USAGE_ACCESS_SETTINGS";
305 
306     /**
307      * Activity Category: Show application settings related to usage access.
308      * <p>
309      * An activity that provides a user interface for adjusting usage access related
310      * preferences for its containing application. Optional but recommended for apps that
311      * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}.
312      * <p>
313      * The activity may define meta-data to describe what usage access is
314      * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which
315      * will be displayed in Settings.
316      * <p>
317      * Input: Nothing.
318      * <p>
319      * Output: Nothing.
320      */
321     @SdkConstant(SdkConstantType.INTENT_CATEGORY)
322     public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG =
323             "android.intent.category.USAGE_ACCESS_CONFIG";
324 
325     /**
326      * Metadata key: Reason for needing usage access.
327      * <p>
328      * A key for metadata attached to an activity that receives action
329      * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the
330      * user as description of how the app uses usage access.
331      * <p>
332      */
333     public static final String METADATA_USAGE_ACCESS_REASON =
334             "android.settings.metadata.USAGE_ACCESS_REASON";
335 
336     /**
337      * Activity Action: Show settings to allow configuration of security and
338      * location privacy.
339      * <p>
340      * In some cases, a matching Activity may not exist, so ensure you
341      * safeguard against this.
342      * <p>
343      * Input: Nothing.
344      * <p>
345      * Output: Nothing.
346      */
347     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
348     public static final String ACTION_SECURITY_SETTINGS =
349             "android.settings.SECURITY_SETTINGS";
350 
351     /**
352      * Activity Action: Show settings to allow configuration of trusted external sources
353      *
354      * Input: Optionally, the Intent's data URI can specify the application package name to
355      * directly invoke the management GUI specific to the package name. For example
356      * "package:com.my.app".
357      * <p>
358      * Output: Nothing.
359      */
360     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
361     public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES =
362             "android.settings.MANAGE_UNKNOWN_APP_SOURCES";
363 
364     /**
365      * Activity Action: Show trusted credentials settings, opening to the user tab,
366      * to allow management of installed credentials.
367      * <p>
368      * In some cases, a matching Activity may not exist, so ensure you
369      * safeguard against this.
370      * <p>
371      * Input: Nothing.
372      * <p>
373      * Output: Nothing.
374      * @hide
375      */
376     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
377     public static final String ACTION_TRUSTED_CREDENTIALS_USER =
378             "com.android.settings.TRUSTED_CREDENTIALS_USER";
379 
380     /**
381      * Activity Action: Show dialog explaining that an installed CA cert may enable
382      * monitoring of encrypted network traffic.
383      * <p>
384      * In some cases, a matching Activity may not exist, so ensure you
385      * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the
386      * number of certificates.
387      * <p>
388      * Input: Nothing.
389      * <p>
390      * Output: Nothing.
391      * @hide
392      */
393     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
394     public static final String ACTION_MONITORING_CERT_INFO =
395             "com.android.settings.MONITORING_CERT_INFO";
396 
397     /**
398      * Activity Action: Show settings to allow configuration of privacy options.
399      * <p>
400      * In some cases, a matching Activity may not exist, so ensure you
401      * safeguard against this.
402      * <p>
403      * Input: Nothing.
404      * <p>
405      * Output: Nothing.
406      */
407     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
408     public static final String ACTION_PRIVACY_SETTINGS =
409             "android.settings.PRIVACY_SETTINGS";
410 
411     /**
412      * Activity Action: Show settings to allow configuration of VPN.
413      * <p>
414      * In some cases, a matching Activity may not exist, so ensure you
415      * safeguard against this.
416      * <p>
417      * Input: Nothing.
418      * <p>
419      * Output: Nothing.
420      */
421     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
422     public static final String ACTION_VPN_SETTINGS =
423             "android.settings.VPN_SETTINGS";
424 
425     /**
426      * Activity Action: Show settings to allow configuration of Wi-Fi.
427      * <p>
428      * In some cases, a matching Activity may not exist, so ensure you
429      * safeguard against this.
430      * <p>
431      * Input: Nothing.
432      * <p>
433      * Output: Nothing.
434      */
435     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
436     public static final String ACTION_WIFI_SETTINGS =
437             "android.settings.WIFI_SETTINGS";
438 
439     /**
440      * Activity Action: Show settings to allow configuration of a static IP
441      * address for Wi-Fi.
442      * <p>
443      * In some cases, a matching Activity may not exist, so ensure you safeguard
444      * against this.
445      * <p>
446      * Input: Nothing.
447      * <p>
448      * Output: Nothing.
449      */
450     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
451     public static final String ACTION_WIFI_IP_SETTINGS =
452             "android.settings.WIFI_IP_SETTINGS";
453 
454     /**
455      * Activity Action: Show settings to allow configuration of data and view data usage.
456      * <p>
457      * In some cases, a matching Activity may not exist, so ensure you
458      * safeguard against this.
459      * <p>
460      * Input: Nothing.
461      * <p>
462      * Output: Nothing.
463      */
464     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
465     public static final String ACTION_DATA_USAGE_SETTINGS =
466             "android.settings.DATA_USAGE_SETTINGS";
467 
468     /**
469      * Activity Action: Show settings to allow configuration of Bluetooth.
470      * <p>
471      * In some cases, a matching Activity may not exist, so ensure you
472      * safeguard against this.
473      * <p>
474      * Input: Nothing.
475      * <p>
476      * Output: Nothing.
477      */
478     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
479     public static final String ACTION_BLUETOOTH_SETTINGS =
480             "android.settings.BLUETOOTH_SETTINGS";
481 
482     /**
483      * Activity Action: Show settings to allow configuration of Assist Gesture.
484      * <p>
485      * In some cases, a matching Activity may not exist, so ensure you
486      * safeguard against this.
487      * <p>
488      * Input: Nothing.
489      * <p>
490      * Output: Nothing.
491      * @hide
492      */
493     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
494     public static final String ACTION_ASSIST_GESTURE_SETTINGS =
495             "android.settings.ASSIST_GESTURE_SETTINGS";
496 
497     /**
498      * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if
499      * necessary.
500      * <p>
501      * Input: Nothing.
502      * <p>
503      * Output: Nothing.
504      */
505     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
506     public static final String ACTION_FINGERPRINT_ENROLL =
507             "android.settings.FINGERPRINT_ENROLL";
508 
509     /**
510      * Activity Action: Show settings to allow configuration of cast endpoints.
511      * <p>
512      * In some cases, a matching Activity may not exist, so ensure you
513      * safeguard against this.
514      * <p>
515      * Input: Nothing.
516      * <p>
517      * Output: Nothing.
518      */
519     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
520     public static final String ACTION_CAST_SETTINGS =
521             "android.settings.CAST_SETTINGS";
522 
523     /**
524      * Activity Action: Show settings to allow configuration of date and time.
525      * <p>
526      * In some cases, a matching Activity may not exist, so ensure you
527      * safeguard against this.
528      * <p>
529      * Input: Nothing.
530      * <p>
531      * Output: Nothing.
532      */
533     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
534     public static final String ACTION_DATE_SETTINGS =
535             "android.settings.DATE_SETTINGS";
536 
537     /**
538      * Activity Action: Show settings to allow configuration of sound and volume.
539      * <p>
540      * In some cases, a matching Activity may not exist, so ensure you
541      * safeguard against this.
542      * <p>
543      * Input: Nothing.
544      * <p>
545      * Output: Nothing.
546      */
547     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
548     public static final String ACTION_SOUND_SETTINGS =
549             "android.settings.SOUND_SETTINGS";
550 
551     /**
552      * Activity Action: Show settings to allow configuration of display.
553      * <p>
554      * In some cases, a matching Activity may not exist, so ensure you
555      * safeguard against this.
556      * <p>
557      * Input: Nothing.
558      * <p>
559      * Output: Nothing.
560      */
561     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
562     public static final String ACTION_DISPLAY_SETTINGS =
563             "android.settings.DISPLAY_SETTINGS";
564 
565     /**
566      * Activity Action: Show settings to allow configuration of Night display.
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      */
575     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
576     public static final String ACTION_NIGHT_DISPLAY_SETTINGS =
577             "android.settings.NIGHT_DISPLAY_SETTINGS";
578 
579     /**
580      * Activity Action: Show settings to allow configuration of locale.
581      * <p>
582      * In some cases, a matching Activity may not exist, so ensure you
583      * safeguard against this.
584      * <p>
585      * Input: Nothing.
586      * <p>
587      * Output: Nothing.
588      */
589     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
590     public static final String ACTION_LOCALE_SETTINGS =
591             "android.settings.LOCALE_SETTINGS";
592 
593     /**
594      * Activity Action: Show settings to configure input methods, in particular
595      * allowing the user to enable input methods.
596      * <p>
597      * In some cases, a matching Activity may not exist, so ensure you
598      * safeguard against this.
599      * <p>
600      * Input: Nothing.
601      * <p>
602      * Output: Nothing.
603      */
604     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
605     public static final String ACTION_VOICE_INPUT_SETTINGS =
606             "android.settings.VOICE_INPUT_SETTINGS";
607 
608     /**
609      * Activity Action: Show settings to configure input methods, in particular
610      * allowing the user to enable input methods.
611      * <p>
612      * In some cases, a matching Activity may not exist, so ensure you
613      * safeguard against this.
614      * <p>
615      * Input: Nothing.
616      * <p>
617      * Output: Nothing.
618      */
619     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
620     public static final String ACTION_INPUT_METHOD_SETTINGS =
621             "android.settings.INPUT_METHOD_SETTINGS";
622 
623     /**
624      * Activity Action: Show settings to enable/disable input method subtypes.
625      * <p>
626      * In some cases, a matching Activity may not exist, so ensure you
627      * safeguard against this.
628      * <p>
629      * To tell which input method's subtypes are displayed in the settings, add
630      * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
631      * If there is no extra in this Intent, subtypes from all installed input methods
632      * will be displayed in the settings.
633      *
634      * @see android.view.inputmethod.InputMethodInfo#getId
635      * <p>
636      * Input: Nothing.
637      * <p>
638      * Output: Nothing.
639      */
640     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
641     public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
642             "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
643 
644     /**
645      * Activity Action: Show settings to manage the user input dictionary.
646      * <p>
647      * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
648      * it is guaranteed there will always be an appropriate implementation for this Intent action.
649      * In prior releases of the platform this was optional, so ensure you safeguard against it.
650      * <p>
651      * Input: Nothing.
652      * <p>
653      * Output: Nothing.
654      */
655     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
656     public static final String ACTION_USER_DICTIONARY_SETTINGS =
657             "android.settings.USER_DICTIONARY_SETTINGS";
658 
659     /**
660      * Activity Action: Show settings to configure the hardware keyboard.
661      * <p>
662      * In some cases, a matching Activity may not exist, so ensure you
663      * safeguard against this.
664      * <p>
665      * Input: Nothing.
666      * <p>
667      * Output: Nothing.
668      */
669     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
670     public static final String ACTION_HARD_KEYBOARD_SETTINGS =
671             "android.settings.HARD_KEYBOARD_SETTINGS";
672 
673     /**
674      * Activity Action: Adds a word to the user dictionary.
675      * <p>
676      * In some cases, a matching Activity may not exist, so ensure you
677      * safeguard against this.
678      * <p>
679      * Input: An extra with key <code>word</code> that contains the word
680      * that should be added to the dictionary.
681      * <p>
682      * Output: Nothing.
683      *
684      * @hide
685      */
686     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
687     public static final String ACTION_USER_DICTIONARY_INSERT =
688             "com.android.settings.USER_DICTIONARY_INSERT";
689 
690     /**
691      * Activity Action: Show settings to allow configuration of application-related settings.
692      * <p>
693      * In some cases, a matching Activity may not exist, so ensure you
694      * safeguard against this.
695      * <p>
696      * Input: Nothing.
697      * <p>
698      * Output: Nothing.
699      */
700     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
701     public static final String ACTION_APPLICATION_SETTINGS =
702             "android.settings.APPLICATION_SETTINGS";
703 
704     /**
705      * Activity Action: Show settings to allow configuration of application
706      * development-related settings.  As of
707      * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
708      * a required part of the platform.
709      * <p>
710      * Input: Nothing.
711      * <p>
712      * Output: Nothing.
713      */
714     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
715     public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
716             "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
717 
718     /**
719      * Activity Action: Show settings to allow configuration of quick launch shortcuts.
720      * <p>
721      * In some cases, a matching Activity may not exist, so ensure you
722      * safeguard against this.
723      * <p>
724      * Input: Nothing.
725      * <p>
726      * Output: Nothing.
727      */
728     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
729     public static final String ACTION_QUICK_LAUNCH_SETTINGS =
730             "android.settings.QUICK_LAUNCH_SETTINGS";
731 
732     /**
733      * Activity Action: Show settings to manage installed applications.
734      * <p>
735      * In some cases, a matching Activity may not exist, so ensure you
736      * safeguard against this.
737      * <p>
738      * Input: Nothing.
739      * <p>
740      * Output: Nothing.
741      */
742     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
743     public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
744             "android.settings.MANAGE_APPLICATIONS_SETTINGS";
745 
746     /**
747      * Activity Action: Show settings to manage all applications.
748      * <p>
749      * In some cases, a matching Activity may not exist, so ensure you
750      * safeguard against this.
751      * <p>
752      * Input: Nothing.
753      * <p>
754      * Output: Nothing.
755      */
756     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
757     public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
758             "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
759 
760     /**
761      * Activity Action: Show screen for controlling which apps can draw on top of other apps.
762      * <p>
763      * In some cases, a matching Activity may not exist, so ensure you
764      * safeguard against this.
765      * <p>
766      * Input: Optionally, the Intent's data URI can specify the application package name to
767      * directly invoke the management GUI specific to the package name. For example
768      * "package:com.my.app".
769      * <p>
770      * Output: Nothing.
771      */
772     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
773     public static final String ACTION_MANAGE_OVERLAY_PERMISSION =
774             "android.settings.action.MANAGE_OVERLAY_PERMISSION";
775 
776     /**
777      * Activity Action: Show screen for controlling which apps are allowed to write/modify
778      * system settings.
779      * <p>
780      * In some cases, a matching Activity may not exist, so ensure you
781      * safeguard against this.
782      * <p>
783      * Input: Optionally, the Intent's data URI can specify the application package name to
784      * directly invoke the management GUI specific to the package name. For example
785      * "package:com.my.app".
786      * <p>
787      * Output: Nothing.
788      */
789     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
790     public static final String ACTION_MANAGE_WRITE_SETTINGS =
791             "android.settings.action.MANAGE_WRITE_SETTINGS";
792 
793     /**
794      * Activity Action: Show screen of details about a particular application.
795      * <p>
796      * In some cases, a matching Activity may not exist, so ensure you
797      * safeguard against this.
798      * <p>
799      * Input: The Intent's data URI specifies the application package name
800      * to be shown, with the "package" scheme.  That is "package:com.my.app".
801      * <p>
802      * Output: Nothing.
803      */
804     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
805     public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
806             "android.settings.APPLICATION_DETAILS_SETTINGS";
807 
808     /**
809      * Activity Action: Show the "Open by Default" page in a particular application's details page.
810      * <p>
811      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
812      * <p>
813      * Input: The Intent's data URI specifies the application package name
814      * to be shown, with the "package" scheme. That is "package:com.my.app".
815      * <p>
816      * Output: Nothing.
817      * @hide
818      */
819     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
820     public static final String ACTION_APPLICATION_DETAILS_SETTINGS_OPEN_BY_DEFAULT_PAGE =
821             "android.settings.APPLICATION_DETAILS_SETTINGS_OPEN_BY_DEFAULT_PAGE";
822 
823     /**
824      * Activity Action: Show list of applications that have been running
825      * foreground services (to the user "running in the background").
826      * <p>
827      * Input: Extras "packages" is a string array of package names.
828      * <p>
829      * Output: Nothing.
830      * @hide
831      */
832     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
833     public static final String ACTION_FOREGROUND_SERVICES_SETTINGS =
834             "android.settings.FOREGROUND_SERVICES_SETTINGS";
835 
836     /**
837      * Activity Action: Show screen for controlling which apps can ignore battery optimizations.
838      * <p>
839      * Input: Nothing.
840      * <p>
841      * Output: Nothing.
842      * <p>
843      * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
844      * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
845      * already ignoring optimizations.  You can use
846      * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you
847      * on this list.
848      */
849     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
850     public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS =
851             "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS";
852 
853     /**
854      * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is,
855      * put them on the whitelist of apps shown by
856      * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}).  For an app to use this, it also
857      * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}
858      * permission.
859      * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities
860      * provided by the platform for applications to operate correctly in the various power
861      * saving modes.  This is only for unusual applications that need to deeply control their own
862      * execution, at the potential expense of the user's battery life.  Note that these applications
863      * greatly run the risk of showing to the user as high power consumers on their device.</p>
864      * <p>
865      * Input: The Intent's data URI must specify the application package name
866      * to be shown, with the "package" scheme.  That is "package:com.my.app".
867      * <p>
868      * Output: Nothing.
869      * <p>
870      * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
871      * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
872      * already ignoring optimizations.
873      */
874     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
875     public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS =
876             "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
877 
878     /**
879      * Activity Action: Show screen for controlling background data
880      * restrictions for a particular application.
881      * <p>
882      * Input: Intent's data URI set with an application name, using the
883      * "package" schema (like "package:com.my.app").
884      *
885      * <p>
886      * Output: Nothing.
887      * <p>
888      * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus
889      * ConnectivityManager#getRestrictBackgroundStatus()} to determine the
890      * status of the background data restrictions for them.
891      *
892      * <p class="note">
893      * In some cases, a matching Activity may not exist, so ensure you
894      * safeguard against this.
895      */
896     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
897     public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS =
898             "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS";
899 
900     /**
901      * @hide
902      * Activity Action: Show the "app ops" settings screen.
903      * <p>
904      * Input: Nothing.
905      * <p>
906      * Output: Nothing.
907      */
908     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
909     public static final String ACTION_APP_OPS_SETTINGS =
910             "android.settings.APP_OPS_SETTINGS";
911 
912     /**
913      * Activity Action: Show settings for system update functionality.
914      * <p>
915      * In some cases, a matching Activity may not exist, so ensure you
916      * safeguard against this.
917      * <p>
918      * Input: Nothing.
919      * <p>
920      * Output: Nothing.
921      *
922      * @hide
923      */
924     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
925     public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
926             "android.settings.SYSTEM_UPDATE_SETTINGS";
927 
928     /**
929      * Activity Action: Show settings for managed profile settings.
930      * <p>
931      * In some cases, a matching Activity may not exist, so ensure you
932      * safeguard against this.
933      * <p>
934      * Input: Nothing.
935      * <p>
936      * Output: Nothing.
937      *
938      * @hide
939      */
940     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
941     public static final String ACTION_MANAGED_PROFILE_SETTINGS =
942             "android.settings.MANAGED_PROFILE_SETTINGS";
943 
944     /**
945      * Activity Action: Show settings to allow configuration of sync settings.
946      * <p>
947      * In some cases, a matching Activity may not exist, so ensure you
948      * safeguard against this.
949      * <p>
950      * The account types available to add via the add account button may be restricted by adding an
951      * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
952      * authorities. Only account types which can sync with that content provider will be offered to
953      * the user.
954      * <p>
955      * Input: Nothing.
956      * <p>
957      * Output: Nothing.
958      */
959     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
960     public static final String ACTION_SYNC_SETTINGS =
961             "android.settings.SYNC_SETTINGS";
962 
963     /**
964      * Activity Action: Show add account screen for creating a new account.
965      * <p>
966      * In some cases, a matching Activity may not exist, so ensure you
967      * safeguard against this.
968      * <p>
969      * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
970      * extra to the Intent with one or more syncable content provider's authorities.  Only account
971      * types which can sync with that content provider will be offered to the user.
972      * <p>
973      * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
974      * Intent with one or more account types.
975      * <p>
976      * Input: Nothing.
977      * <p>
978      * Output: Nothing.
979      */
980     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
981     public static final String ACTION_ADD_ACCOUNT =
982             "android.settings.ADD_ACCOUNT_SETTINGS";
983 
984     /**
985      * Activity Action: Show settings for selecting the network operator.
986      * <p>
987      * In some cases, a matching Activity may not exist, so ensure you
988      * safeguard against this.
989      * <p>
990      * The subscription ID of the subscription for which available network operators should be
991      * displayed may be optionally specified with {@link #EXTRA_SUB_ID}.
992      * <p>
993      * Input: Nothing.
994      * <p>
995      * Output: Nothing.
996      */
997     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
998     public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
999             "android.settings.NETWORK_OPERATOR_SETTINGS";
1000 
1001     /**
1002      * Activity Action: Show settings for selection of 2G/3G.
1003      * <p>
1004      * In some cases, a matching Activity may not exist, so ensure you
1005      * safeguard against this.
1006      * <p>
1007      * Input: Nothing.
1008      * <p>
1009      * Output: Nothing.
1010      */
1011     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1012     public static final String ACTION_DATA_ROAMING_SETTINGS =
1013             "android.settings.DATA_ROAMING_SETTINGS";
1014 
1015     /**
1016      * Activity Action: Show settings for internal storage.
1017      * <p>
1018      * In some cases, a matching Activity may not exist, so ensure you
1019      * safeguard against this.
1020      * <p>
1021      * Input: Nothing.
1022      * <p>
1023      * Output: Nothing.
1024      */
1025     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1026     public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
1027             "android.settings.INTERNAL_STORAGE_SETTINGS";
1028     /**
1029      * Activity Action: Show settings for memory card storage.
1030      * <p>
1031      * In some cases, a matching Activity may not exist, so ensure you
1032      * safeguard against this.
1033      * <p>
1034      * Input: Nothing.
1035      * <p>
1036      * Output: Nothing.
1037      */
1038     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1039     public static final String ACTION_MEMORY_CARD_SETTINGS =
1040             "android.settings.MEMORY_CARD_SETTINGS";
1041 
1042     /**
1043      * Activity Action: Show settings for global search.
1044      * <p>
1045      * In some cases, a matching Activity may not exist, so ensure you
1046      * safeguard against this.
1047      * <p>
1048      * Input: Nothing.
1049      * <p>
1050      * Output: Nothing
1051      */
1052     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1053     public static final String ACTION_SEARCH_SETTINGS =
1054         "android.search.action.SEARCH_SETTINGS";
1055 
1056     /**
1057      * Activity Action: Show general device information settings (serial
1058      * number, software version, phone number, etc.).
1059      * <p>
1060      * In some cases, a matching Activity may not exist, so ensure you
1061      * safeguard against this.
1062      * <p>
1063      * Input: Nothing.
1064      * <p>
1065      * Output: Nothing
1066      */
1067     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1068     public static final String ACTION_DEVICE_INFO_SETTINGS =
1069         "android.settings.DEVICE_INFO_SETTINGS";
1070 
1071     /**
1072      * Activity Action: Show NFC settings.
1073      * <p>
1074      * This shows UI that allows NFC to be turned on or off.
1075      * <p>
1076      * In some cases, a matching Activity may not exist, so ensure you
1077      * safeguard against this.
1078      * <p>
1079      * Input: Nothing.
1080      * <p>
1081      * Output: Nothing
1082      * @see android.nfc.NfcAdapter#isEnabled()
1083      */
1084     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1085     public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
1086 
1087     /**
1088      * Activity Action: Show NFC Sharing settings.
1089      * <p>
1090      * This shows UI that allows NDEF Push (Android Beam) to be turned on or
1091      * off.
1092      * <p>
1093      * In some cases, a matching Activity may not exist, so ensure you
1094      * safeguard against this.
1095      * <p>
1096      * Input: Nothing.
1097      * <p>
1098      * Output: Nothing
1099      * @see android.nfc.NfcAdapter#isNdefPushEnabled()
1100      */
1101     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1102     public static final String ACTION_NFCSHARING_SETTINGS =
1103         "android.settings.NFCSHARING_SETTINGS";
1104 
1105     /**
1106      * Activity Action: Show NFC Tap & Pay settings
1107      * <p>
1108      * This shows UI that allows the user to configure Tap&Pay
1109      * settings.
1110      * <p>
1111      * In some cases, a matching Activity may not exist, so ensure you
1112      * safeguard against this.
1113      * <p>
1114      * Input: Nothing.
1115      * <p>
1116      * Output: Nothing
1117      */
1118     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1119     public static final String ACTION_NFC_PAYMENT_SETTINGS =
1120         "android.settings.NFC_PAYMENT_SETTINGS";
1121 
1122     /**
1123      * Activity Action: Show Daydream settings.
1124      * <p>
1125      * In some cases, a matching Activity may not exist, so ensure you
1126      * safeguard against this.
1127      * <p>
1128      * Input: Nothing.
1129      * <p>
1130      * Output: Nothing.
1131      * @see android.service.dreams.DreamService
1132      */
1133     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1134     public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
1135 
1136     /**
1137      * Activity Action: Show Notification listener settings.
1138      * <p>
1139      * In some cases, a matching Activity may not exist, so ensure you
1140      * safeguard against this.
1141      * <p>
1142      * Input: Nothing.
1143      * <p>
1144      * Output: Nothing.
1145      * @see android.service.notification.NotificationListenerService
1146      */
1147     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1148     public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
1149             = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
1150 
1151     /**
1152      * Activity Action: Show Do Not Disturb access settings.
1153      * <p>
1154      * Users can grant and deny access to Do Not Disturb configuration from here.
1155      * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1156      * details.
1157      * <p>
1158      * Input: Nothing.
1159      * <p>
1160      * Output: Nothing.
1161      *
1162      * <p class="note">
1163      * In some cases, a matching Activity may not exist, so ensure you
1164      * safeguard against this.
1165      */
1166     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1167     public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
1168             = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
1169 
1170     /**
1171      * @hide
1172      */
1173     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1174     public static final String ACTION_CONDITION_PROVIDER_SETTINGS
1175             = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
1176 
1177     /**
1178      * Activity Action: Show settings for video captioning.
1179      * <p>
1180      * In some cases, a matching Activity may not exist, so ensure you safeguard
1181      * against this.
1182      * <p>
1183      * Input: Nothing.
1184      * <p>
1185      * Output: Nothing.
1186      */
1187     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1188     public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
1189 
1190     /**
1191      * Activity Action: Show the top level print settings.
1192      * <p>
1193      * In some cases, a matching Activity may not exist, so ensure you
1194      * safeguard against this.
1195      * <p>
1196      * Input: Nothing.
1197      * <p>
1198      * Output: Nothing.
1199      */
1200     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1201     public static final String ACTION_PRINT_SETTINGS =
1202             "android.settings.ACTION_PRINT_SETTINGS";
1203 
1204     /**
1205      * Activity Action: Show Zen Mode configuration settings.
1206      *
1207      * @hide
1208      */
1209     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1210     public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
1211 
1212     /**
1213      * Activity Action: Show Zen Mode visual effects configuration settings.
1214      *
1215      * @hide
1216      */
1217     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1218     public static final String ZEN_MODE_BLOCKED_EFFECTS_SETTINGS =
1219             "android.settings.ZEN_MODE_BLOCKED_EFFECTS_SETTINGS";
1220 
1221     /**
1222      * Activity Action: Show Zen Mode onboarding activity.
1223      *
1224      * @hide
1225      */
1226     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1227     public static final String ZEN_MODE_ONBOARDING = "android.settings.ZEN_MODE_ONBOARDING";
1228 
1229     /**
1230      * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings.
1231      */
1232     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1233     public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
1234             = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
1235 
1236     /**
1237      * Activity Action: Show Zen Mode automation configuration settings.
1238      *
1239      * @hide
1240      */
1241     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1242     public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
1243             = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
1244 
1245     /**
1246      * Activity Action: Modify do not disturb mode settings.
1247      * <p>
1248      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1249      * <p>
1250      * This intent MUST be started using
1251      * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1252      * startVoiceActivity}.
1253      * <p>
1254      * Note: The Activity implementing this intent MUST verify that
1255      * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
1256      * returns true before modifying the setting.
1257      * <p>
1258      * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
1259      * how long the user wishes to avoid interruptions for. The optional
1260      * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
1261      * enabling or disabling do not disturb mode. If either extra is not included, the
1262      * user maybe asked to provide the value.
1263      * <p>
1264      * Output: Nothing.
1265      */
1266     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1267     public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
1268             "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
1269 
1270     /**
1271      * Activity Action: Show Zen Mode schedule rule configuration settings.
1272      *
1273      * @hide
1274      */
1275     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1276     public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
1277             = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
1278 
1279     /**
1280      * Activity Action: Show Zen Mode event rule configuration settings.
1281      *
1282      * @hide
1283      */
1284     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1285     public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
1286             = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
1287 
1288     /**
1289      * Activity Action: Show Zen Mode external rule configuration settings.
1290      *
1291      * @hide
1292      */
1293     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1294     public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
1295             = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
1296 
1297     /**
1298      * Activity Action: Show the regulatory information screen for the device.
1299      * <p>
1300      * In some cases, a matching Activity may not exist, so ensure you safeguard
1301      * against this.
1302      * <p>
1303      * Input: Nothing.
1304      * <p>
1305      * Output: Nothing.
1306      */
1307     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1308     public static final String
1309             ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
1310 
1311     /**
1312      * Activity Action: Show Device Name Settings.
1313      * <p>
1314      * In some cases, a matching Activity may not exist, so ensure you safeguard
1315      * against this.
1316      *
1317      * @hide
1318      */
1319     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1320     public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
1321 
1322     /**
1323      * Activity Action: Show pairing settings.
1324      * <p>
1325      * In some cases, a matching Activity may not exist, so ensure you safeguard
1326      * against this.
1327      *
1328      * @hide
1329      */
1330     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1331     public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
1332 
1333     /**
1334      * Activity Action: Show battery saver settings.
1335      * <p>
1336      * In some cases, a matching Activity may not exist, so ensure you safeguard
1337      * against this.
1338      */
1339     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1340     public static final String ACTION_BATTERY_SAVER_SETTINGS
1341             = "android.settings.BATTERY_SAVER_SETTINGS";
1342 
1343     /**
1344      * Activity Action: Modify Battery Saver mode setting using a voice command.
1345      * <p>
1346      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1347      * <p>
1348      * This intent MUST be started using
1349      * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1350      * startVoiceActivity}.
1351      * <p>
1352      * Note: The activity implementing this intent MUST verify that
1353      * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
1354      * modifying the setting.
1355      * <p>
1356      * Input: To tell which state batter saver mode should be set to, add the
1357      * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
1358      * If the extra is not included, no changes will be made.
1359      * <p>
1360      * Output: Nothing.
1361      */
1362     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1363     public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
1364             "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
1365 
1366     /**
1367      * Activity Action: Show Home selection settings. If there are multiple activities
1368      * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
1369      * to pick your preferred activity.
1370      */
1371     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1372     public static final String ACTION_HOME_SETTINGS
1373             = "android.settings.HOME_SETTINGS";
1374 
1375     /**
1376      * Activity Action: Show Default apps settings.
1377      * <p>
1378      * In some cases, a matching Activity may not exist, so ensure you
1379      * safeguard against this.
1380      * <p>
1381      * Input: Nothing.
1382      * <p>
1383      * Output: Nothing.
1384      */
1385     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1386     public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS
1387             = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS";
1388 
1389     /**
1390      * Activity Action: Show notification settings.
1391      *
1392      * @hide
1393      */
1394     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1395     public static final String ACTION_NOTIFICATION_SETTINGS
1396             = "android.settings.NOTIFICATION_SETTINGS";
1397 
1398     /**
1399      * Activity Action: Show app listing settings, filtered by those that send notifications.
1400      *
1401      * @hide
1402      */
1403     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1404     public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS =
1405             "android.settings.ALL_APPS_NOTIFICATION_SETTINGS";
1406 
1407     /**
1408      * Activity Action: Show notification settings for a single app.
1409      * <p>
1410      *     Input: {@link #EXTRA_APP_PACKAGE}, the package to display.
1411      * <p>
1412      * Output: Nothing.
1413      */
1414     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1415     public static final String ACTION_APP_NOTIFICATION_SETTINGS
1416             = "android.settings.APP_NOTIFICATION_SETTINGS";
1417 
1418     /**
1419      * Activity Action: Show notification settings for a single {@link NotificationChannel}.
1420      * <p>
1421      *     Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display.
1422      *     Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display.
1423      * <p>
1424      * Output: Nothing.
1425      */
1426     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1427     public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS
1428             = "android.settings.CHANNEL_NOTIFICATION_SETTINGS";
1429 
1430     /**
1431      * Activity Extra: The package owner of the notification channel settings to display.
1432      * <p>
1433      * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
1434      */
1435     public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE";
1436 
1437     /**
1438      * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings
1439      * to display.
1440      * <p>
1441      * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
1442      */
1443     public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID";
1444 
1445     /**
1446      * Activity Action: Show notification redaction settings.
1447      *
1448      * @hide
1449      */
1450     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1451     public static final String ACTION_APP_NOTIFICATION_REDACTION
1452             = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
1453 
1454     /** @hide */ public static final String EXTRA_APP_UID = "app_uid";
1455 
1456     /**
1457      * Activity Action: Show a dialog with disabled by policy message.
1458      * <p> If an user action is disabled by policy, this dialog can be triggered to let
1459      * the user know about this.
1460      * <p>
1461      * Input: Nothing.
1462      * <p>
1463      * Output: Nothing.
1464      *
1465      * @hide
1466      */
1467     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1468     public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS
1469             = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
1470 
1471     /**
1472      * Activity Action: Show a dialog for remote bugreport flow.
1473      * <p>
1474      * Input: Nothing.
1475      * <p>
1476      * Output: Nothing.
1477      *
1478      * @hide
1479      */
1480     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1481     public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG
1482             = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG";
1483 
1484     /**
1485      * Activity Action: Show VR listener settings.
1486      * <p>
1487      * Input: Nothing.
1488      * <p>
1489      * Output: Nothing.
1490      *
1491      * @see android.service.vr.VrListenerService
1492      */
1493     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1494     public static final String ACTION_VR_LISTENER_SETTINGS
1495             = "android.settings.VR_LISTENER_SETTINGS";
1496 
1497     /**
1498      * Activity Action: Show Picture-in-picture settings.
1499      * <p>
1500      * Input: Nothing.
1501      * <p>
1502      * Output: Nothing.
1503      *
1504      * @hide
1505      */
1506     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1507     public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS
1508             = "android.settings.PICTURE_IN_PICTURE_SETTINGS";
1509 
1510     /**
1511      * Activity Action: Show Storage Manager settings.
1512      * <p>
1513      * Input: Nothing.
1514      * <p>
1515      * Output: Nothing.
1516      *
1517      * @hide
1518      */
1519     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1520     public static final String ACTION_STORAGE_MANAGER_SETTINGS
1521             = "android.settings.STORAGE_MANAGER_SETTINGS";
1522 
1523     /**
1524      * Activity Action: Allows user to select current webview implementation.
1525      * <p>
1526      * Input: Nothing.
1527      * <p>
1528      * Output: Nothing.
1529      */
1530     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1531     public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS";
1532 
1533     /**
1534      * Activity Action: Show enterprise privacy section.
1535      * <p>
1536      * Input: Nothing.
1537      * <p>
1538      * Output: Nothing.
1539      * @hide
1540      */
1541     @SystemApi
1542     @TestApi
1543     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1544     public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS
1545             = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
1546 
1547     /**
1548      * Activity Action: Show screen that let user select its Autofill Service.
1549      * <p>
1550      * Input: Intent's data URI set with an application name, using the
1551      * "package" schema (like "package:com.my.app").
1552      *
1553      * <p>
1554      * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging
1555      * to the caller package.
1556      *
1557      * <p>
1558      * <b>NOTE: </b> Applications should call
1559      * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and
1560      * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action
1561      * to start an activity if they return {@code false} and {@code true} respectively.
1562      */
1563     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1564     public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE =
1565             "android.settings.REQUEST_SET_AUTOFILL_SERVICE";
1566 
1567     /**
1568      * Activity Action: Show screen for controlling which apps have access on volume directories.
1569      * <p>
1570      * Input: Nothing.
1571      * <p>
1572      * Output: Nothing.
1573      * <p>
1574      * Applications typically use this action to ask the user to revert the "Do not ask again"
1575      * status of directory access requests made by
1576      * {@link android.os.storage.StorageVolume#createAccessIntent(String)}.
1577      */
1578     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1579     public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS =
1580             "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS";
1581 
1582     // End of Intent actions for Settings
1583 
1584     /**
1585      * @hide - Private call() method on SettingsProvider to read from 'system' table.
1586      */
1587     public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
1588 
1589     /**
1590      * @hide - Private call() method on SettingsProvider to read from 'secure' table.
1591      */
1592     public static final String CALL_METHOD_GET_SECURE = "GET_secure";
1593 
1594     /**
1595      * @hide - Private call() method on SettingsProvider to read from 'global' table.
1596      */
1597     public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
1598 
1599     /**
1600      * @hide - Specifies that the caller of the fast-path call()-based flow tracks
1601      * the settings generation in order to cache values locally. If this key is
1602      * mapped to a <code>null</code> string extra in the request bundle, the response
1603      * bundle will contain the same key mapped to a parcelable extra which would be
1604      * an {@link android.util.MemoryIntArray}. The response will also contain an
1605      * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the
1606      * index in the array clients should use to lookup the generation. For efficiency
1607      * the caller should request the generation tracking memory array only if it
1608      * doesn't already have it.
1609      *
1610      * @see #CALL_METHOD_GENERATION_INDEX_KEY
1611      */
1612     public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation";
1613 
1614     /**
1615      * @hide Key with the location in the {@link android.util.MemoryIntArray} where
1616      * to look up the generation id of the backing table. The value is an integer.
1617      *
1618      * @see #CALL_METHOD_TRACK_GENERATION_KEY
1619      */
1620     public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index";
1621 
1622     /**
1623      * @hide Key with the settings table generation. The value is an integer.
1624      *
1625      * @see #CALL_METHOD_TRACK_GENERATION_KEY
1626      */
1627     public static final String CALL_METHOD_GENERATION_KEY = "_generation";
1628 
1629     /**
1630      * @hide - User handle argument extra to the fast-path call()-based requests
1631      */
1632     public static final String CALL_METHOD_USER_KEY = "_user";
1633 
1634     /**
1635      * @hide - Boolean argument extra to the fast-path call()-based requests
1636      */
1637     public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default";
1638 
1639     /**
1640      * @hide - User handle argument extra to the fast-path call()-based requests
1641      */
1642     public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode";
1643 
1644     /**
1645      * @hide - String argument extra to the fast-path call()-based requests
1646      */
1647     public static final String CALL_METHOD_TAG_KEY = "_tag";
1648 
1649     /** @hide - Private call() method to write to 'system' table */
1650     public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
1651 
1652     /** @hide - Private call() method to write to 'secure' table */
1653     public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
1654 
1655     /** @hide - Private call() method to write to 'global' table */
1656     public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
1657 
1658     /** @hide - Private call() method to reset to defaults the 'global' table */
1659     public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global";
1660 
1661     /** @hide - Private call() method to reset to defaults the 'secure' table */
1662     public static final String CALL_METHOD_RESET_SECURE = "RESET_secure";
1663 
1664     /**
1665      * Activity Extra: Limit available options in launched activity based on the given authority.
1666      * <p>
1667      * This can be passed as an extra field in an Activity Intent with one or more syncable content
1668      * provider's authorities as a String[]. This field is used by some intents to alter the
1669      * behavior of the called activity.
1670      * <p>
1671      * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
1672      * on the authority given.
1673      */
1674     public static final String EXTRA_AUTHORITIES = "authorities";
1675 
1676     /**
1677      * Activity Extra: Limit available options in launched activity based on the given account
1678      * types.
1679      * <p>
1680      * This can be passed as an extra field in an Activity Intent with one or more account types
1681      * as a String[]. This field is used by some intents to alter the behavior of the called
1682      * activity.
1683      * <p>
1684      * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
1685      * list.
1686      */
1687     public static final String EXTRA_ACCOUNT_TYPES = "account_types";
1688 
1689     public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
1690 
1691     /**
1692      * Activity Extra: The device identifier to act upon.
1693      * <p>
1694      * This can be passed as an extra field in an Activity Intent with a single
1695      * InputDeviceIdentifier. This field is used by some activities to jump straight into the
1696      * settings for the given device.
1697      * <p>
1698      * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
1699      * dialog for the given device.
1700      * @hide
1701      */
1702     public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
1703 
1704     /**
1705      * Activity Extra: Enable or disable Airplane Mode.
1706      * <p>
1707      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
1708      * intent as a boolean to indicate if it should be enabled.
1709      */
1710     public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
1711 
1712     /**
1713      * Activity Extra: Enable or disable Battery saver mode.
1714      * <p>
1715      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
1716      * intent as a boolean to indicate if it should be enabled.
1717      */
1718     public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
1719             "android.settings.extra.battery_saver_mode_enabled";
1720 
1721     /**
1722      * Activity Extra: Enable or disable Do Not Disturb mode.
1723      * <p>
1724      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1725      * intent as a boolean to indicate if it should be enabled.
1726      */
1727     public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
1728             "android.settings.extra.do_not_disturb_mode_enabled";
1729 
1730     /**
1731      * Activity Extra: How many minutes to enable do not disturb mode for.
1732      * <p>
1733      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1734      * intent to indicate how long do not disturb mode should be enabled for.
1735      */
1736     public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
1737             "android.settings.extra.do_not_disturb_mode_minutes";
1738 
1739     /**
1740      * Reset mode: reset to defaults only settings changed by the
1741      * calling package. If there is a default set the setting
1742      * will be set to it, otherwise the setting will be deleted.
1743      * This is the only type of reset available to non-system clients.
1744      * @hide
1745      */
1746     public static final int RESET_MODE_PACKAGE_DEFAULTS = 1;
1747 
1748     /**
1749      * Reset mode: reset all settings set by untrusted packages, which is
1750      * packages that aren't a part of the system, to the current defaults.
1751      * If there is a default set the setting will be set to it, otherwise
1752      * the setting will be deleted. This mode is only available to the system.
1753      * @hide
1754      */
1755     public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2;
1756 
1757     /**
1758      * Reset mode: delete all settings set by untrusted packages, which is
1759      * packages that aren't a part of the system. If a setting is set by an
1760      * untrusted package it will be deleted if its default is not provided
1761      * by the system, otherwise the setting will be set to its default.
1762      * This mode is only available to the system.
1763      * @hide
1764      */
1765     public static final int RESET_MODE_UNTRUSTED_CHANGES = 3;
1766 
1767     /**
1768      * Reset mode: reset all settings to defaults specified by trusted
1769      * packages, which is packages that are a part of the system, and
1770      * delete all settings set by untrusted packages. If a setting has
1771      * a default set by a system package it will be set to the default,
1772      * otherwise the setting will be deleted. This mode is only available
1773      * to the system.
1774      * @hide
1775      */
1776     public static final int RESET_MODE_TRUSTED_DEFAULTS = 4;
1777 
1778     /** @hide */
1779     @Retention(RetentionPolicy.SOURCE)
1780     @IntDef(prefix = { "RESET_MODE_" }, value = {
1781             RESET_MODE_PACKAGE_DEFAULTS,
1782             RESET_MODE_UNTRUSTED_DEFAULTS,
1783             RESET_MODE_UNTRUSTED_CHANGES,
1784             RESET_MODE_TRUSTED_DEFAULTS
1785     })
1786     public @interface ResetMode{}
1787 
1788 
1789     /**
1790      * User has not started setup personalization.
1791      * @hide
1792      */
1793     public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0;
1794 
1795     /**
1796      * User has not yet completed setup personalization.
1797      * @hide
1798      */
1799     public static final int USER_SETUP_PERSONALIZATION_STARTED = 1;
1800 
1801     /**
1802      * User has snoozed personalization and will complete it later.
1803      * @hide
1804      */
1805     public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2;
1806 
1807     /**
1808      * User has completed setup personalization.
1809      * @hide
1810      */
1811     public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10;
1812 
1813     /** @hide */
1814     @Retention(RetentionPolicy.SOURCE)
1815     @IntDef({
1816             USER_SETUP_PERSONALIZATION_NOT_STARTED,
1817             USER_SETUP_PERSONALIZATION_STARTED,
1818             USER_SETUP_PERSONALIZATION_PAUSED,
1819             USER_SETUP_PERSONALIZATION_COMPLETE
1820     })
1821     public @interface UserSetupPersonalization {}
1822 
1823     /**
1824      * Activity Extra: Number of certificates
1825      * <p>
1826      * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO}
1827      * intent to indicate the number of certificates
1828      * @hide
1829      */
1830     public static final String EXTRA_NUMBER_OF_CERTIFICATES =
1831             "android.settings.extra.number_of_certificates";
1832 
1833     private static final String JID_RESOURCE_PREFIX = "android";
1834 
1835     public static final String AUTHORITY = "settings";
1836 
1837     private static final String TAG = "Settings";
1838     private static final boolean LOCAL_LOGV = false;
1839 
1840     // Lock ensures that when enabling/disabling the master location switch, we don't end up
1841     // with a partial enable/disable state in multi-threaded situations.
1842     private static final Object mLocationSettingsLock = new Object();
1843 
1844     // Used in system server calling uid workaround in call()
1845     private static boolean sInSystemServer = false;
1846     private static final Object sInSystemServerLock = new Object();
1847 
1848     /** @hide */
setInSystemServer()1849     public static void setInSystemServer() {
1850         synchronized (sInSystemServerLock) {
1851             sInSystemServer = true;
1852         }
1853     }
1854 
1855     /** @hide */
isInSystemServer()1856     public static boolean isInSystemServer() {
1857         synchronized (sInSystemServerLock) {
1858             return sInSystemServer;
1859         }
1860     }
1861 
1862     public static class SettingNotFoundException extends AndroidException {
SettingNotFoundException(String msg)1863         public SettingNotFoundException(String msg) {
1864             super(msg);
1865         }
1866     }
1867 
1868     /**
1869      * Common base for tables of name/value settings.
1870      */
1871     public static class NameValueTable implements BaseColumns {
1872         public static final String NAME = "name";
1873         public static final String VALUE = "value";
1874 
putString(ContentResolver resolver, Uri uri, String name, String value)1875         protected static boolean putString(ContentResolver resolver, Uri uri,
1876                 String name, String value) {
1877             // The database will take care of replacing duplicates.
1878             try {
1879                 ContentValues values = new ContentValues();
1880                 values.put(NAME, name);
1881                 values.put(VALUE, value);
1882                 resolver.insert(uri, values);
1883                 return true;
1884             } catch (SQLException e) {
1885                 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
1886                 return false;
1887             }
1888         }
1889 
getUriFor(Uri uri, String name)1890         public static Uri getUriFor(Uri uri, String name) {
1891             return Uri.withAppendedPath(uri, name);
1892         }
1893     }
1894 
1895     private static final class GenerationTracker {
1896         private final MemoryIntArray mArray;
1897         private final Runnable mErrorHandler;
1898         private final int mIndex;
1899         private int mCurrentGeneration;
1900 
GenerationTracker(@onNull MemoryIntArray array, int index, int generation, Runnable errorHandler)1901         public GenerationTracker(@NonNull MemoryIntArray array, int index,
1902                 int generation, Runnable errorHandler) {
1903             mArray = array;
1904             mIndex = index;
1905             mErrorHandler = errorHandler;
1906             mCurrentGeneration = generation;
1907         }
1908 
isGenerationChanged()1909         public boolean isGenerationChanged() {
1910             final int currentGeneration = readCurrentGeneration();
1911             if (currentGeneration >= 0) {
1912                 if (currentGeneration == mCurrentGeneration) {
1913                     return false;
1914                 }
1915                 mCurrentGeneration = currentGeneration;
1916             }
1917             return true;
1918         }
1919 
getCurrentGeneration()1920         public int getCurrentGeneration() {
1921             return mCurrentGeneration;
1922         }
1923 
readCurrentGeneration()1924         private int readCurrentGeneration() {
1925             try {
1926                 return mArray.get(mIndex);
1927             } catch (IOException e) {
1928                 Log.e(TAG, "Error getting current generation", e);
1929                 if (mErrorHandler != null) {
1930                     mErrorHandler.run();
1931                 }
1932             }
1933             return -1;
1934         }
1935 
destroy()1936         public void destroy() {
1937             try {
1938                 mArray.close();
1939             } catch (IOException e) {
1940                 Log.e(TAG, "Error closing backing array", e);
1941                 if (mErrorHandler != null) {
1942                     mErrorHandler.run();
1943                 }
1944             }
1945         }
1946     }
1947 
1948     private static final class ContentProviderHolder {
1949         private final Object mLock = new Object();
1950 
1951         @GuardedBy("mLock")
1952         private final Uri mUri;
1953         @GuardedBy("mLock")
1954         private IContentProvider mContentProvider;
1955 
ContentProviderHolder(Uri uri)1956         public ContentProviderHolder(Uri uri) {
1957             mUri = uri;
1958         }
1959 
getProvider(ContentResolver contentResolver)1960         public IContentProvider getProvider(ContentResolver contentResolver) {
1961             synchronized (mLock) {
1962                 if (mContentProvider == null) {
1963                     mContentProvider = contentResolver
1964                             .acquireProvider(mUri.getAuthority());
1965                 }
1966                 return mContentProvider;
1967             }
1968         }
1969 
clearProviderForTest()1970         public void clearProviderForTest() {
1971             synchronized (mLock) {
1972                 mContentProvider = null;
1973             }
1974         }
1975     }
1976 
1977     // Thread-safe.
1978     private static class NameValueCache {
1979         private static final boolean DEBUG = false;
1980 
1981         private static final String[] SELECT_VALUE_PROJECTION = new String[] {
1982                 Settings.NameValueTable.VALUE
1983         };
1984 
1985         private static final String NAME_EQ_PLACEHOLDER = "name=?";
1986 
1987         // Must synchronize on 'this' to access mValues and mValuesVersion.
1988         private final HashMap<String, String> mValues = new HashMap<>();
1989 
1990         private final Uri mUri;
1991         private final ContentProviderHolder mProviderHolder;
1992 
1993         // The method we'll call (or null, to not use) on the provider
1994         // for the fast path of retrieving settings.
1995         private final String mCallGetCommand;
1996         private final String mCallSetCommand;
1997 
1998         @GuardedBy("this")
1999         private GenerationTracker mGenerationTracker;
2000 
NameValueCache(Uri uri, String getCommand, String setCommand, ContentProviderHolder providerHolder)2001         public NameValueCache(Uri uri, String getCommand, String setCommand,
2002                 ContentProviderHolder providerHolder) {
2003             mUri = uri;
2004             mCallGetCommand = getCommand;
2005             mCallSetCommand = setCommand;
2006             mProviderHolder = providerHolder;
2007         }
2008 
putStringForUser(ContentResolver cr, String name, String value, String tag, boolean makeDefault, final int userHandle)2009         public boolean putStringForUser(ContentResolver cr, String name, String value,
2010                 String tag, boolean makeDefault, final int userHandle) {
2011             try {
2012                 Bundle arg = new Bundle();
2013                 arg.putString(Settings.NameValueTable.VALUE, value);
2014                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
2015                 if (tag != null) {
2016                     arg.putString(CALL_METHOD_TAG_KEY, tag);
2017                 }
2018                 if (makeDefault) {
2019                     arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true);
2020                 }
2021                 IContentProvider cp = mProviderHolder.getProvider(cr);
2022                 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
2023             } catch (RemoteException e) {
2024                 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
2025                 return false;
2026             }
2027             return true;
2028         }
2029 
getStringForUser(ContentResolver cr, String name, final int userHandle)2030         public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
2031             final boolean isSelf = (userHandle == UserHandle.myUserId());
2032             int currentGeneration = -1;
2033             if (isSelf) {
2034                 synchronized (NameValueCache.this) {
2035                     if (mGenerationTracker != null) {
2036                         if (mGenerationTracker.isGenerationChanged()) {
2037                             if (DEBUG) {
2038                                 Log.i(TAG, "Generation changed for type:"
2039                                         + mUri.getPath() + " in package:"
2040                                         + cr.getPackageName() +" and user:" + userHandle);
2041                             }
2042                             mValues.clear();
2043                         } else if (mValues.containsKey(name)) {
2044                             return mValues.get(name);
2045                         }
2046                         if (mGenerationTracker != null) {
2047                             currentGeneration = mGenerationTracker.getCurrentGeneration();
2048                         }
2049                     }
2050                 }
2051             } else {
2052                 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
2053                         + " by user " + UserHandle.myUserId() + " so skipping cache");
2054             }
2055 
2056             IContentProvider cp = mProviderHolder.getProvider(cr);
2057 
2058             // Try the fast path first, not using query().  If this
2059             // fails (alternate Settings provider that doesn't support
2060             // this interface?) then we fall back to the query/table
2061             // interface.
2062             if (mCallGetCommand != null) {
2063                 try {
2064                     Bundle args = null;
2065                     if (!isSelf) {
2066                         args = new Bundle();
2067                         args.putInt(CALL_METHOD_USER_KEY, userHandle);
2068                     }
2069                     boolean needsGenerationTracker = false;
2070                     synchronized (NameValueCache.this) {
2071                         if (isSelf && mGenerationTracker == null) {
2072                             needsGenerationTracker = true;
2073                             if (args == null) {
2074                                 args = new Bundle();
2075                             }
2076                             args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
2077                             if (DEBUG) {
2078                                 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath()
2079                                         + " in package:" + cr.getPackageName() +" and user:"
2080                                         + userHandle);
2081                             }
2082                         }
2083                     }
2084                     Bundle b;
2085                     // If we're in system server and in a binder transaction we need to clear the
2086                     // calling uid. This works around code in system server that did not call
2087                     // clearCallingIdentity, previously this wasn't needed because reading settings
2088                     // did not do permission checking but thats no longer the case.
2089                     // Long term this should be removed and callers should properly call
2090                     // clearCallingIdentity or use a ContentResolver from the caller as needed.
2091                     if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
2092                         final long token = Binder.clearCallingIdentity();
2093                         try {
2094                             b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
2095                         } finally {
2096                             Binder.restoreCallingIdentity(token);
2097                         }
2098                     } else {
2099                         b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
2100                     }
2101                     if (b != null) {
2102                         String value = b.getString(Settings.NameValueTable.VALUE);
2103                         // Don't update our cache for reads of other users' data
2104                         if (isSelf) {
2105                             synchronized (NameValueCache.this) {
2106                                 if (needsGenerationTracker) {
2107                                     MemoryIntArray array = b.getParcelable(
2108                                             CALL_METHOD_TRACK_GENERATION_KEY);
2109                                     final int index = b.getInt(
2110                                             CALL_METHOD_GENERATION_INDEX_KEY, -1);
2111                                     if (array != null && index >= 0) {
2112                                         final int generation = b.getInt(
2113                                                 CALL_METHOD_GENERATION_KEY, 0);
2114                                         if (DEBUG) {
2115                                             Log.i(TAG, "Received generation tracker for type:"
2116                                                     + mUri.getPath() + " in package:"
2117                                                     + cr.getPackageName() + " and user:"
2118                                                     + userHandle + " with index:" + index);
2119                                         }
2120                                         if (mGenerationTracker != null) {
2121                                             mGenerationTracker.destroy();
2122                                         }
2123                                         mGenerationTracker = new GenerationTracker(array, index,
2124                                                 generation, () -> {
2125                                             synchronized (NameValueCache.this) {
2126                                                 Log.e(TAG, "Error accessing generation"
2127                                                         + " tracker - removing");
2128                                                 if (mGenerationTracker != null) {
2129                                                     GenerationTracker generationTracker =
2130                                                             mGenerationTracker;
2131                                                     mGenerationTracker = null;
2132                                                     generationTracker.destroy();
2133                                                     mValues.clear();
2134                                                 }
2135                                             }
2136                                         });
2137                                     }
2138                                 }
2139                                 if (mGenerationTracker != null && currentGeneration ==
2140                                         mGenerationTracker.getCurrentGeneration()) {
2141                                     mValues.put(name, value);
2142                                 }
2143                             }
2144                         } else {
2145                             if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
2146                                     + " by " + UserHandle.myUserId()
2147                                     + " so not updating cache");
2148                         }
2149                         return value;
2150                     }
2151                     // If the response Bundle is null, we fall through
2152                     // to the query interface below.
2153                 } catch (RemoteException e) {
2154                     // Not supported by the remote side?  Fall through
2155                     // to query().
2156                 }
2157             }
2158 
2159             Cursor c = null;
2160             try {
2161                 Bundle queryArgs = ContentResolver.createSqlQueryBundle(
2162                         NAME_EQ_PLACEHOLDER, new String[]{name}, null);
2163                 // Same workaround as above.
2164                 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
2165                     final long token = Binder.clearCallingIdentity();
2166                     try {
2167                         c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs,
2168                                 null);
2169                     } finally {
2170                         Binder.restoreCallingIdentity(token);
2171                     }
2172                 } else {
2173                     c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs,
2174                             null);
2175                 }
2176                 if (c == null) {
2177                     Log.w(TAG, "Can't get key " + name + " from " + mUri);
2178                     return null;
2179                 }
2180 
2181                 String value = c.moveToNext() ? c.getString(0) : null;
2182                 synchronized (NameValueCache.this) {
2183                     if(mGenerationTracker != null &&
2184                             currentGeneration == mGenerationTracker.getCurrentGeneration()) {
2185                         mValues.put(name, value);
2186                     }
2187                 }
2188                 if (LOCAL_LOGV) {
2189                     Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
2190                             name + " = " + (value == null ? "(null)" : value));
2191                 }
2192                 return value;
2193             } catch (RemoteException e) {
2194                 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
2195                 return null;  // Return null, but don't cache it.
2196             } finally {
2197                 if (c != null) c.close();
2198             }
2199         }
2200 
clearGenerationTrackerForTest()2201         public void clearGenerationTrackerForTest() {
2202             synchronized (NameValueCache.this) {
2203                 if (mGenerationTracker != null) {
2204                     mGenerationTracker.destroy();
2205                 }
2206                 mValues.clear();
2207                 mGenerationTracker = null;
2208             }
2209         }
2210     }
2211 
2212     /**
2213      * Checks if the specified context can draw on top of other apps. As of API
2214      * level 23, an app cannot draw on top of other apps unless it declares the
2215      * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its
2216      * manifest, <em>and</em> the user specifically grants the app this
2217      * capability. To prompt the user to grant this approval, the app must send an
2218      * intent with the action
2219      * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which
2220      * causes the system to display a permission management screen.
2221      *
2222      * @param context App context.
2223      * @return true if the specified context can draw on top of other apps, false otherwise
2224      */
canDrawOverlays(Context context)2225     public static boolean canDrawOverlays(Context context) {
2226         return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(),
2227                 context.getOpPackageName(), false);
2228     }
2229 
2230     /**
2231      * System settings, containing miscellaneous system preferences.  This
2232      * table holds simple name/value pairs.  There are convenience
2233      * functions for accessing individual settings entries.
2234      */
2235     public static final class System extends NameValueTable {
2236         // NOTE: If you add new settings here, be sure to add them to
2237         // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked.
2238 
2239         private static final float DEFAULT_FONT_SCALE = 1.0f;
2240 
2241         /**
2242          * The content:// style URL for this table
2243          */
2244         public static final Uri CONTENT_URI =
2245             Uri.parse("content://" + AUTHORITY + "/system");
2246 
2247         private static final ContentProviderHolder sProviderHolder =
2248                 new ContentProviderHolder(CONTENT_URI);
2249 
2250         private static final NameValueCache sNameValueCache = new NameValueCache(
2251                 CONTENT_URI,
2252                 CALL_METHOD_GET_SYSTEM,
2253                 CALL_METHOD_PUT_SYSTEM,
2254                 sProviderHolder);
2255 
2256         private static final HashSet<String> MOVED_TO_SECURE;
2257         static {
2258             MOVED_TO_SECURE = new HashSet<>(30);
2259             MOVED_TO_SECURE.add(Secure.ANDROID_ID);
2260             MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
2261             MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
2262             MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
2263             MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
2264             MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
2265             MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
2266             MOVED_TO_SECURE.add(Secure.LOGGING_ID);
2267             MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
2268             MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
2269             MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
2270             MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
2271             MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
2272             MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
2273             MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
2274             MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
2275             MOVED_TO_SECURE.add(Secure.WIFI_ON);
2276             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
2277             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
2278             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
2279             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
2280             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
2281             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
2282             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
2283             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
2284             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
2285             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
2286             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
2287 
2288             // At one time in System, then Global, but now back in Secure
2289             MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
2290         }
2291 
2292         private static final HashSet<String> MOVED_TO_GLOBAL;
2293         private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
2294         static {
2295             MOVED_TO_GLOBAL = new HashSet<>();
2296             MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>();
2297 
2298             // these were originally in system but migrated to secure in the past,
2299             // so are duplicated in the Secure.* namespace
2300             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
2301             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
2302             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
2303             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
2304             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
2305             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
2306 
2307             // these are moving directly from system to global
2308             MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
2309             MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
2310             MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
2311             MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
2312             MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
2313             MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
2314             MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
2315             MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
2316             MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
2317             MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
2318             MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
2319             MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
2320             MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
2321             MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
2322             MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
2323             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
2324             MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
2325             MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
2326             MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
2327             MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
2328             MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
2329             MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
2330             MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
2331             MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
2332             MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
2333             MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
2334             MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
2335             MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
2336             MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
2337             MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
2338             MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
2339             MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
2340             MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
2341             MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
2342             MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
2343         }
2344 
2345         /** @hide */
getMovedToGlobalSettings(Set<String> outKeySet)2346         public static void getMovedToGlobalSettings(Set<String> outKeySet) {
2347             outKeySet.addAll(MOVED_TO_GLOBAL);
2348             outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
2349         }
2350 
2351         /** @hide */
getMovedToSecureSettings(Set<String> outKeySet)2352         public static void getMovedToSecureSettings(Set<String> outKeySet) {
2353             outKeySet.addAll(MOVED_TO_SECURE);
2354         }
2355 
2356         /** @hide */
getNonLegacyMovedKeys(HashSet<String> outKeySet)2357         public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
2358             outKeySet.addAll(MOVED_TO_GLOBAL);
2359         }
2360 
2361         /** @hide */
clearProviderForTest()2362         public static void clearProviderForTest() {
2363             sProviderHolder.clearProviderForTest();
2364             sNameValueCache.clearGenerationTrackerForTest();
2365         }
2366 
2367         /**
2368          * Look up a name in the database.
2369          * @param resolver to access the database with
2370          * @param name to look up in the table
2371          * @return the corresponding value, or null if not present
2372          */
getString(ContentResolver resolver, String name)2373         public static String getString(ContentResolver resolver, String name) {
2374             return getStringForUser(resolver, name, resolver.getUserId());
2375         }
2376 
2377         /** @hide */
getStringForUser(ContentResolver resolver, String name, int userHandle)2378         public static String getStringForUser(ContentResolver resolver, String name,
2379                 int userHandle) {
2380             if (MOVED_TO_SECURE.contains(name)) {
2381                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2382                         + " to android.provider.Settings.Secure, returning read-only value.");
2383                 return Secure.getStringForUser(resolver, name, userHandle);
2384             }
2385             if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
2386                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2387                         + " to android.provider.Settings.Global, returning read-only value.");
2388                 return Global.getStringForUser(resolver, name, userHandle);
2389             }
2390             return sNameValueCache.getStringForUser(resolver, name, userHandle);
2391         }
2392 
2393         /**
2394          * Store a name/value pair into the database.
2395          * @param resolver to access the database with
2396          * @param name to store
2397          * @param value to associate with the name
2398          * @return true if the value was set, false on database errors
2399          */
putString(ContentResolver resolver, String name, String value)2400         public static boolean putString(ContentResolver resolver, String name, String value) {
2401             return putStringForUser(resolver, name, value, resolver.getUserId());
2402         }
2403 
2404         /** @hide */
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)2405         public static boolean putStringForUser(ContentResolver resolver, String name, String value,
2406                 int userHandle) {
2407             if (MOVED_TO_SECURE.contains(name)) {
2408                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2409                         + " to android.provider.Settings.Secure, value is unchanged.");
2410                 return false;
2411             }
2412             if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
2413                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2414                         + " to android.provider.Settings.Global, value is unchanged.");
2415                 return false;
2416             }
2417             return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle);
2418         }
2419 
2420         /**
2421          * Construct the content URI for a particular name/value pair,
2422          * useful for monitoring changes with a ContentObserver.
2423          * @param name to look up in the table
2424          * @return the corresponding content URI, or null if not present
2425          */
getUriFor(String name)2426         public static Uri getUriFor(String name) {
2427             if (MOVED_TO_SECURE.contains(name)) {
2428                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2429                     + " to android.provider.Settings.Secure, returning Secure URI.");
2430                 return Secure.getUriFor(Secure.CONTENT_URI, name);
2431             }
2432             if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
2433                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2434                         + " to android.provider.Settings.Global, returning read-only global URI.");
2435                 return Global.getUriFor(Global.CONTENT_URI, name);
2436             }
2437             return getUriFor(CONTENT_URI, name);
2438         }
2439 
2440         /**
2441          * Convenience function for retrieving a single system settings value
2442          * as an integer.  Note that internally setting values are always
2443          * stored as strings; this function converts the string to an integer
2444          * for you.  The default value will be returned if the setting is
2445          * not defined or not an integer.
2446          *
2447          * @param cr The ContentResolver to access.
2448          * @param name The name of the setting to retrieve.
2449          * @param def Value to return if the setting is not defined.
2450          *
2451          * @return The setting's current value, or 'def' if it is not defined
2452          * or not a valid integer.
2453          */
getInt(ContentResolver cr, String name, int def)2454         public static int getInt(ContentResolver cr, String name, int def) {
2455             return getIntForUser(cr, name, def, cr.getUserId());
2456         }
2457 
2458         /** @hide */
getIntForUser(ContentResolver cr, String name, int def, int userHandle)2459         public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
2460             String v = getStringForUser(cr, name, userHandle);
2461             try {
2462                 return v != null ? Integer.parseInt(v) : def;
2463             } catch (NumberFormatException e) {
2464                 return def;
2465             }
2466         }
2467 
2468         /**
2469          * Convenience function for retrieving a single system settings value
2470          * as an integer.  Note that internally setting values are always
2471          * stored as strings; this function converts the string to an integer
2472          * for you.
2473          * <p>
2474          * This version does not take a default value.  If the setting has not
2475          * been set, or the string value is not a number,
2476          * it throws {@link SettingNotFoundException}.
2477          *
2478          * @param cr The ContentResolver to access.
2479          * @param name The name of the setting to retrieve.
2480          *
2481          * @throws SettingNotFoundException Thrown if a setting by the given
2482          * name can't be found or the setting value is not an integer.
2483          *
2484          * @return The setting's current value.
2485          */
getInt(ContentResolver cr, String name)2486         public static int getInt(ContentResolver cr, String name)
2487                 throws SettingNotFoundException {
2488             return getIntForUser(cr, name, cr.getUserId());
2489         }
2490 
2491         /** @hide */
getIntForUser(ContentResolver cr, String name, int userHandle)2492         public static int getIntForUser(ContentResolver cr, String name, int userHandle)
2493                 throws SettingNotFoundException {
2494             String v = getStringForUser(cr, name, userHandle);
2495             try {
2496                 return Integer.parseInt(v);
2497             } catch (NumberFormatException e) {
2498                 throw new SettingNotFoundException(name);
2499             }
2500         }
2501 
2502         /**
2503          * Convenience function for updating a single settings value as an
2504          * integer. This will either create a new entry in the table if the
2505          * given name does not exist, or modify the value of the existing row
2506          * with that name.  Note that internally setting values are always
2507          * stored as strings, so this function converts the given value to a
2508          * string before storing it.
2509          *
2510          * @param cr The ContentResolver to access.
2511          * @param name The name of the setting to modify.
2512          * @param value The new value for the setting.
2513          * @return true if the value was set, false on database errors
2514          */
putInt(ContentResolver cr, String name, int value)2515         public static boolean putInt(ContentResolver cr, String name, int value) {
2516             return putIntForUser(cr, name, value, cr.getUserId());
2517         }
2518 
2519         /** @hide */
putIntForUser(ContentResolver cr, String name, int value, int userHandle)2520         public static boolean putIntForUser(ContentResolver cr, String name, int value,
2521                 int userHandle) {
2522             return putStringForUser(cr, name, Integer.toString(value), userHandle);
2523         }
2524 
2525         /**
2526          * Convenience function for retrieving a single system settings value
2527          * as a {@code long}.  Note that internally setting values are always
2528          * stored as strings; this function converts the string to a {@code long}
2529          * for you.  The default value will be returned if the setting is
2530          * not defined or not a {@code long}.
2531          *
2532          * @param cr The ContentResolver to access.
2533          * @param name The name of the setting to retrieve.
2534          * @param def Value to return if the setting is not defined.
2535          *
2536          * @return The setting's current value, or 'def' if it is not defined
2537          * or not a valid {@code long}.
2538          */
getLong(ContentResolver cr, String name, long def)2539         public static long getLong(ContentResolver cr, String name, long def) {
2540             return getLongForUser(cr, name, def, cr.getUserId());
2541         }
2542 
2543         /** @hide */
getLongForUser(ContentResolver cr, String name, long def, int userHandle)2544         public static long getLongForUser(ContentResolver cr, String name, long def,
2545                 int userHandle) {
2546             String valString = getStringForUser(cr, name, userHandle);
2547             long value;
2548             try {
2549                 value = valString != null ? Long.parseLong(valString) : def;
2550             } catch (NumberFormatException e) {
2551                 value = def;
2552             }
2553             return value;
2554         }
2555 
2556         /**
2557          * Convenience function for retrieving a single system settings value
2558          * as a {@code long}.  Note that internally setting values are always
2559          * stored as strings; this function converts the string to a {@code long}
2560          * for you.
2561          * <p>
2562          * This version does not take a default value.  If the setting has not
2563          * been set, or the string value is not a number,
2564          * it throws {@link SettingNotFoundException}.
2565          *
2566          * @param cr The ContentResolver to access.
2567          * @param name The name of the setting to retrieve.
2568          *
2569          * @return The setting's current value.
2570          * @throws SettingNotFoundException Thrown if a setting by the given
2571          * name can't be found or the setting value is not an integer.
2572          */
getLong(ContentResolver cr, String name)2573         public static long getLong(ContentResolver cr, String name)
2574                 throws SettingNotFoundException {
2575             return getLongForUser(cr, name, cr.getUserId());
2576         }
2577 
2578         /** @hide */
getLongForUser(ContentResolver cr, String name, int userHandle)2579         public static long getLongForUser(ContentResolver cr, String name, int userHandle)
2580                 throws SettingNotFoundException {
2581             String valString = getStringForUser(cr, name, userHandle);
2582             try {
2583                 return Long.parseLong(valString);
2584             } catch (NumberFormatException e) {
2585                 throw new SettingNotFoundException(name);
2586             }
2587         }
2588 
2589         /**
2590          * Convenience function for updating a single settings value as a long
2591          * integer. This will either create a new entry in the table if the
2592          * given name does not exist, or modify the value of the existing row
2593          * with that name.  Note that internally setting values are always
2594          * stored as strings, so this function converts the given value to a
2595          * string before storing it.
2596          *
2597          * @param cr The ContentResolver to access.
2598          * @param name The name of the setting to modify.
2599          * @param value The new value for the setting.
2600          * @return true if the value was set, false on database errors
2601          */
putLong(ContentResolver cr, String name, long value)2602         public static boolean putLong(ContentResolver cr, String name, long value) {
2603             return putLongForUser(cr, name, value, cr.getUserId());
2604         }
2605 
2606         /** @hide */
putLongForUser(ContentResolver cr, String name, long value, int userHandle)2607         public static boolean putLongForUser(ContentResolver cr, String name, long value,
2608                 int userHandle) {
2609             return putStringForUser(cr, name, Long.toString(value), userHandle);
2610         }
2611 
2612         /**
2613          * Convenience function for retrieving a single system settings value
2614          * as a floating point number.  Note that internally setting values are
2615          * always stored as strings; this function converts the string to an
2616          * float for you. The default value will be returned if the setting
2617          * is not defined or not a valid float.
2618          *
2619          * @param cr The ContentResolver to access.
2620          * @param name The name of the setting to retrieve.
2621          * @param def Value to return if the setting is not defined.
2622          *
2623          * @return The setting's current value, or 'def' if it is not defined
2624          * or not a valid float.
2625          */
getFloat(ContentResolver cr, String name, float def)2626         public static float getFloat(ContentResolver cr, String name, float def) {
2627             return getFloatForUser(cr, name, def, cr.getUserId());
2628         }
2629 
2630         /** @hide */
getFloatForUser(ContentResolver cr, String name, float def, int userHandle)2631         public static float getFloatForUser(ContentResolver cr, String name, float def,
2632                 int userHandle) {
2633             String v = getStringForUser(cr, name, userHandle);
2634             try {
2635                 return v != null ? Float.parseFloat(v) : def;
2636             } catch (NumberFormatException e) {
2637                 return def;
2638             }
2639         }
2640 
2641         /**
2642          * Convenience function for retrieving a single system settings value
2643          * as a float.  Note that internally setting values are always
2644          * stored as strings; this function converts the string to a float
2645          * for you.
2646          * <p>
2647          * This version does not take a default value.  If the setting has not
2648          * been set, or the string value is not a number,
2649          * it throws {@link SettingNotFoundException}.
2650          *
2651          * @param cr The ContentResolver to access.
2652          * @param name The name of the setting to retrieve.
2653          *
2654          * @throws SettingNotFoundException Thrown if a setting by the given
2655          * name can't be found or the setting value is not a float.
2656          *
2657          * @return The setting's current value.
2658          */
getFloat(ContentResolver cr, String name)2659         public static float getFloat(ContentResolver cr, String name)
2660                 throws SettingNotFoundException {
2661             return getFloatForUser(cr, name, cr.getUserId());
2662         }
2663 
2664         /** @hide */
getFloatForUser(ContentResolver cr, String name, int userHandle)2665         public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
2666                 throws SettingNotFoundException {
2667             String v = getStringForUser(cr, name, userHandle);
2668             if (v == null) {
2669                 throw new SettingNotFoundException(name);
2670             }
2671             try {
2672                 return Float.parseFloat(v);
2673             } catch (NumberFormatException e) {
2674                 throw new SettingNotFoundException(name);
2675             }
2676         }
2677 
2678         /**
2679          * Convenience function for updating a single settings value as a
2680          * floating point number. This will either create a new entry in the
2681          * table if the given name does not exist, or modify the value of the
2682          * existing row with that name.  Note that internally setting values
2683          * are always stored as strings, so this function converts the given
2684          * value to a string before storing it.
2685          *
2686          * @param cr The ContentResolver to access.
2687          * @param name The name of the setting to modify.
2688          * @param value The new value for the setting.
2689          * @return true if the value was set, false on database errors
2690          */
putFloat(ContentResolver cr, String name, float value)2691         public static boolean putFloat(ContentResolver cr, String name, float value) {
2692             return putFloatForUser(cr, name, value, cr.getUserId());
2693         }
2694 
2695         /** @hide */
putFloatForUser(ContentResolver cr, String name, float value, int userHandle)2696         public static boolean putFloatForUser(ContentResolver cr, String name, float value,
2697                 int userHandle) {
2698             return putStringForUser(cr, name, Float.toString(value), userHandle);
2699         }
2700 
2701         /**
2702          * Convenience function to read all of the current
2703          * configuration-related settings into a
2704          * {@link Configuration} object.
2705          *
2706          * @param cr The ContentResolver to access.
2707          * @param outConfig Where to place the configuration settings.
2708          */
getConfiguration(ContentResolver cr, Configuration outConfig)2709         public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
2710             adjustConfigurationForUser(cr, outConfig, cr.getUserId(),
2711                     false /* updateSettingsIfEmpty */);
2712         }
2713 
2714         /** @hide */
adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, int userHandle, boolean updateSettingsIfEmpty)2715         public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig,
2716                 int userHandle, boolean updateSettingsIfEmpty) {
2717             outConfig.fontScale = Settings.System.getFloatForUser(
2718                     cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle);
2719             if (outConfig.fontScale < 0) {
2720                 outConfig.fontScale = DEFAULT_FONT_SCALE;
2721             }
2722 
2723             final String localeValue =
2724                     Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle);
2725             if (localeValue != null) {
2726                 outConfig.setLocales(LocaleList.forLanguageTags(localeValue));
2727             } else {
2728                 // Do not update configuration with emtpy settings since we need to take over the
2729                 // locale list of previous user if the settings value is empty. This happens when a
2730                 // new user is created.
2731 
2732                 if (updateSettingsIfEmpty) {
2733                     // Make current configuration persistent. This is necessary the first time a
2734                     // user log in. At the first login, the configuration settings are empty, so we
2735                     // need to store the adjusted configuration as the initial settings.
2736                     Settings.System.putStringForUser(
2737                             cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(),
2738                             userHandle);
2739                 }
2740             }
2741         }
2742 
2743         /**
2744          * @hide Erase the fields in the Configuration that should be applied
2745          * by the settings.
2746          */
clearConfiguration(Configuration inoutConfig)2747         public static void clearConfiguration(Configuration inoutConfig) {
2748             inoutConfig.fontScale = 0;
2749             if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) {
2750                 inoutConfig.clearLocales();
2751             }
2752         }
2753 
2754         /**
2755          * Convenience function to write a batch of configuration-related
2756          * settings from a {@link Configuration} object.
2757          *
2758          * @param cr The ContentResolver to access.
2759          * @param config The settings to write.
2760          * @return true if the values were set, false on database errors
2761          */
putConfiguration(ContentResolver cr, Configuration config)2762         public static boolean putConfiguration(ContentResolver cr, Configuration config) {
2763             return putConfigurationForUser(cr, config, cr.getUserId());
2764         }
2765 
2766         /** @hide */
putConfigurationForUser(ContentResolver cr, Configuration config, int userHandle)2767         public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
2768                 int userHandle) {
2769             return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) &&
2770                     Settings.System.putStringForUser(
2771                             cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle);
2772         }
2773 
2774         /** @hide */
hasInterestingConfigurationChanges(int changes)2775         public static boolean hasInterestingConfigurationChanges(int changes) {
2776             return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 ||
2777                     (changes & ActivityInfo.CONFIG_LOCALE) != 0;
2778         }
2779 
2780         /** @deprecated - Do not use */
2781         @Deprecated
getShowGTalkServiceStatus(ContentResolver cr)2782         public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
2783             return getShowGTalkServiceStatusForUser(cr, cr.getUserId());
2784         }
2785 
2786         /**
2787          * @hide
2788          * @deprecated - Do not use
2789          */
2790         @Deprecated
getShowGTalkServiceStatusForUser(ContentResolver cr, int userHandle)2791         public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
2792                 int userHandle) {
2793             return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
2794         }
2795 
2796         /** @deprecated - Do not use */
2797         @Deprecated
setShowGTalkServiceStatus(ContentResolver cr, boolean flag)2798         public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
2799             setShowGTalkServiceStatusForUser(cr, flag, cr.getUserId());
2800         }
2801 
2802         /**
2803          * @hide
2804          * @deprecated - Do not use
2805          */
2806         @Deprecated
setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, int userHandle)2807         public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
2808                 int userHandle) {
2809             putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
2810         }
2811 
2812         /**
2813          * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
2814          */
2815         @Deprecated
2816         public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN;
2817 
2818         private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() {
2819             @Override
2820             public boolean validate(String value) {
2821                 try {
2822                     int val = Integer.parseInt(value);
2823                     return (val == 0)
2824                             || (val == BatteryManager.BATTERY_PLUGGED_AC)
2825                             || (val == BatteryManager.BATTERY_PLUGGED_USB)
2826                             || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS)
2827                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
2828                                     | BatteryManager.BATTERY_PLUGGED_USB))
2829                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
2830                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS))
2831                             || (val == (BatteryManager.BATTERY_PLUGGED_USB
2832                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS))
2833                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
2834                                     | BatteryManager.BATTERY_PLUGGED_USB
2835                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS));
2836                 } catch (NumberFormatException e) {
2837                     return false;
2838                 }
2839             }
2840         };
2841 
2842         /**
2843          * What happens when the user presses the end call button if they're not
2844          * on a call.<br/>
2845          * <b>Values:</b><br/>
2846          * 0 - The end button does nothing.<br/>
2847          * 1 - The end button goes to the home screen.<br/>
2848          * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
2849          * 3 - The end button goes to the home screen.  If the user is already on the
2850          * home screen, it puts the device to sleep.
2851          */
2852         public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
2853 
2854         private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
2855                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
2856 
2857         /**
2858          * END_BUTTON_BEHAVIOR value for "go home".
2859          * @hide
2860          */
2861         public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
2862 
2863         /**
2864          * END_BUTTON_BEHAVIOR value for "go to sleep".
2865          * @hide
2866          */
2867         public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
2868 
2869         /**
2870          * END_BUTTON_BEHAVIOR default value.
2871          * @hide
2872          */
2873         public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
2874 
2875         /**
2876          * Is advanced settings mode turned on. 0 == no, 1 == yes
2877          * @hide
2878          */
2879         public static final String ADVANCED_SETTINGS = "advanced_settings";
2880 
2881         private static final Validator ADVANCED_SETTINGS_VALIDATOR = BOOLEAN_VALIDATOR;
2882 
2883         /**
2884          * ADVANCED_SETTINGS default value.
2885          * @hide
2886          */
2887         public static final int ADVANCED_SETTINGS_DEFAULT = 0;
2888 
2889         /**
2890          * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
2891          */
2892         @Deprecated
2893         public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
2894 
2895         /**
2896          * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
2897          */
2898         @Deprecated
2899         public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
2900 
2901         /**
2902          * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
2903          */
2904         @Deprecated
2905         public static final String RADIO_WIFI = Global.RADIO_WIFI;
2906 
2907         /**
2908          * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
2909          * {@hide}
2910          */
2911         @Deprecated
2912         public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
2913 
2914         /**
2915          * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
2916          */
2917         @Deprecated
2918         public static final String RADIO_CELL = Global.RADIO_CELL;
2919 
2920         /**
2921          * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
2922          */
2923         @Deprecated
2924         public static final String RADIO_NFC = Global.RADIO_NFC;
2925 
2926         /**
2927          * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
2928          */
2929         @Deprecated
2930         public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
2931 
2932         /**
2933          * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
2934          *
2935          * {@hide}
2936          */
2937         @Deprecated
2938         public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
2939                 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
2940 
2941         /**
2942          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
2943          */
2944         @Deprecated
2945         public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
2946 
2947         /**
2948          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
2949          */
2950         @Deprecated
2951         public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
2952 
2953         /**
2954          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
2955          */
2956         @Deprecated
2957         public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
2958                 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
2959 
2960         /**
2961          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
2962          */
2963         @Deprecated
2964         public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
2965 
2966         /**
2967          * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
2968          */
2969         @Deprecated
2970         public static final String MODE_RINGER = Global.MODE_RINGER;
2971 
2972         /**
2973          * Whether to use static IP and other static network attributes.
2974          * <p>
2975          * Set to 1 for true and 0 for false.
2976          *
2977          * @deprecated Use {@link WifiManager} instead
2978          */
2979         @Deprecated
2980         public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
2981 
2982         private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = BOOLEAN_VALIDATOR;
2983 
2984         /**
2985          * The static IP address.
2986          * <p>
2987          * Example: "192.168.1.51"
2988          *
2989          * @deprecated Use {@link WifiManager} instead
2990          */
2991         @Deprecated
2992         public static final String WIFI_STATIC_IP = "wifi_static_ip";
2993 
2994         private static final Validator WIFI_STATIC_IP_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
2995 
2996         /**
2997          * If using static IP, the gateway's IP address.
2998          * <p>
2999          * Example: "192.168.1.1"
3000          *
3001          * @deprecated Use {@link WifiManager} instead
3002          */
3003         @Deprecated
3004         public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
3005 
3006         private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
3007 
3008         /**
3009          * If using static IP, the net mask.
3010          * <p>
3011          * Example: "255.255.255.0"
3012          *
3013          * @deprecated Use {@link WifiManager} instead
3014          */
3015         @Deprecated
3016         public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
3017 
3018         private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
3019 
3020         /**
3021          * If using static IP, the primary DNS's IP address.
3022          * <p>
3023          * Example: "192.168.1.1"
3024          *
3025          * @deprecated Use {@link WifiManager} instead
3026          */
3027         @Deprecated
3028         public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
3029 
3030         private static final Validator WIFI_STATIC_DNS1_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
3031 
3032         /**
3033          * If using static IP, the secondary DNS's IP address.
3034          * <p>
3035          * Example: "192.168.1.2"
3036          *
3037          * @deprecated Use {@link WifiManager} instead
3038          */
3039         @Deprecated
3040         public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
3041 
3042         private static final Validator WIFI_STATIC_DNS2_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
3043 
3044         /**
3045          * Determines whether remote devices may discover and/or connect to
3046          * this device.
3047          * <P>Type: INT</P>
3048          * 2 -- discoverable and connectable
3049          * 1 -- connectable but not discoverable
3050          * 0 -- neither connectable nor discoverable
3051          */
3052         public static final String BLUETOOTH_DISCOVERABILITY =
3053             "bluetooth_discoverability";
3054 
3055         private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
3056                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 2);
3057 
3058         /**
3059          * Bluetooth discoverability timeout.  If this value is nonzero, then
3060          * Bluetooth becomes discoverable for a certain number of seconds,
3061          * after which is becomes simply connectable.  The value is in seconds.
3062          */
3063         public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
3064             "bluetooth_discoverability_timeout";
3065 
3066         private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
3067                 NON_NEGATIVE_INTEGER_VALIDATOR;
3068 
3069         /**
3070          * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
3071          * instead
3072          */
3073         @Deprecated
3074         public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
3075 
3076         /**
3077          * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
3078          * instead
3079          */
3080         @Deprecated
3081         public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
3082 
3083         /**
3084          * @deprecated Use
3085          * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
3086          * instead
3087          */
3088         @Deprecated
3089         public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
3090             "lock_pattern_tactile_feedback_enabled";
3091 
3092         /**
3093          * A formatted string of the next alarm that is set, or the empty string
3094          * if there is no alarm set.
3095          *
3096          * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
3097          */
3098         @Deprecated
3099         public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
3100 
3101         private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
3102             private static final int MAX_LENGTH = 1000;
3103 
3104             @Override
3105             public boolean validate(String value) {
3106                 // TODO: No idea what the correct format is.
3107                 return value == null || value.length() < MAX_LENGTH;
3108             }
3109         };
3110 
3111         /**
3112          * Scaling factor for fonts, float.
3113          */
3114         public static final String FONT_SCALE = "font_scale";
3115 
3116         private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
3117             @Override
3118             public boolean validate(@Nullable String value) {
3119                 try {
3120                     return Float.parseFloat(value) >= 0;
3121                 } catch (NumberFormatException | NullPointerException e) {
3122                     return false;
3123                 }
3124             }
3125         };
3126 
3127         /**
3128          * The serialized system locale value.
3129          *
3130          * Do not use this value directory.
3131          * To get system locale, use {@link LocaleList#getDefault} instead.
3132          * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales}
3133          * instead.
3134          * @hide
3135          */
3136         public static final String SYSTEM_LOCALES = "system_locales";
3137 
3138 
3139         /**
3140          * Name of an application package to be debugged.
3141          *
3142          * @deprecated Use {@link Global#DEBUG_APP} instead
3143          */
3144         @Deprecated
3145         public static final String DEBUG_APP = Global.DEBUG_APP;
3146 
3147         /**
3148          * If 1, when launching DEBUG_APP it will wait for the debugger before
3149          * starting user code.  If 0, it will run normally.
3150          *
3151          * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
3152          */
3153         @Deprecated
3154         public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
3155 
3156         /**
3157          * Whether or not to dim the screen. 0=no  1=yes
3158          * @deprecated This setting is no longer used.
3159          */
3160         @Deprecated
3161         public static final String DIM_SCREEN = "dim_screen";
3162 
3163         private static final Validator DIM_SCREEN_VALIDATOR = BOOLEAN_VALIDATOR;
3164 
3165         /**
3166          * The display color mode.
3167          * @hide
3168          */
3169         public static final String DISPLAY_COLOR_MODE = "display_color_mode";
3170 
3171         private static final Validator DISPLAY_COLOR_MODE_VALIDATOR =
3172                 new SettingsValidators.InclusiveIntegerRangeValidator(
3173                         ColorDisplayController.COLOR_MODE_NATURAL,
3174                         ColorDisplayController.COLOR_MODE_AUTOMATIC);
3175 
3176         /**
3177          * The amount of time in milliseconds before the device goes to sleep or begins
3178          * to dream after a period of inactivity.  This value is also known as the
3179          * user activity timeout period since the screen isn't necessarily turned off
3180          * when it expires.
3181          *
3182          * <p>
3183          * This value is bounded by maximum timeout set by
3184          * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}.
3185          */
3186         public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
3187 
3188         private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR =
3189                 NON_NEGATIVE_INTEGER_VALIDATOR;
3190 
3191         /**
3192          * The screen backlight brightness between 0 and 255.
3193          */
3194         public static final String SCREEN_BRIGHTNESS = "screen_brightness";
3195 
3196         /**
3197          * The screen backlight brightness between 0 and 255.
3198          * @hide
3199          */
3200         public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr";
3201 
3202         private static final Validator SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR =
3203                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 255);
3204 
3205         /**
3206          * Control whether to enable automatic brightness mode.
3207          */
3208         public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
3209 
3210         private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = BOOLEAN_VALIDATOR;
3211 
3212         /**
3213          * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
3214          * or less (<0.0 >-1.0) bright.
3215          * @hide
3216          */
3217         public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
3218 
3219         private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
3220                 new SettingsValidators.InclusiveFloatRangeValidator(-1, 1);
3221 
3222         /**
3223          * SCREEN_BRIGHTNESS_MODE value for manual mode.
3224          */
3225         public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
3226 
3227         /**
3228          * SCREEN_BRIGHTNESS_MODE value for automatic mode.
3229          */
3230         public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
3231 
3232         /**
3233          * Control whether the process CPU usage meter should be shown.
3234          *
3235          * @deprecated This functionality is no longer available as of
3236          * {@link android.os.Build.VERSION_CODES#N_MR1}.
3237          */
3238         @Deprecated
3239         public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
3240 
3241         /**
3242          * If 1, the activity manager will aggressively finish activities and
3243          * processes as soon as they are no longer needed.  If 0, the normal
3244          * extended lifetime is used.
3245          *
3246          * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
3247          */
3248         @Deprecated
3249         public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
3250 
3251         /**
3252          * Determines which streams are affected by ringer and zen mode changes. The
3253          * stream type's bit should be set to 1 if it should be muted when going
3254          * into an inaudible ringer mode.
3255          */
3256         public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
3257 
3258         private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
3259                 NON_NEGATIVE_INTEGER_VALIDATOR;
3260 
3261         /**
3262           * Determines which streams are affected by mute. The
3263           * stream type's bit should be set to 1 if it should be muted when a mute request
3264           * is received.
3265           */
3266         public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
3267 
3268         private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
3269                 NON_NEGATIVE_INTEGER_VALIDATOR;
3270 
3271         /**
3272          * Whether vibrate is on for different events. This is used internally,
3273          * changing this value will not change the vibrate. See AudioManager.
3274          */
3275         public static final String VIBRATE_ON = "vibrate_on";
3276 
3277         private static final Validator VIBRATE_ON_VALIDATOR = BOOLEAN_VALIDATOR;
3278 
3279         /**
3280          * If 1, redirects the system vibrator to all currently attached input devices
3281          * that support vibration.  If there are no such input devices, then the system
3282          * vibrator is used instead.
3283          * If 0, does not register the system vibrator.
3284          *
3285          * This setting is mainly intended to provide a compatibility mechanism for
3286          * applications that only know about the system vibrator and do not use the
3287          * input device vibrator API.
3288          *
3289          * @hide
3290          */
3291         public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
3292 
3293         private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = BOOLEAN_VALIDATOR;
3294 
3295         /**
3296          * The intensity of notification vibrations, if configurable.
3297          *
3298          * Not all devices are capable of changing their vibration intensity; on these devices
3299          * there will likely be no difference between the various vibration intensities except for
3300          * intensity 0 (off) and the rest.
3301          *
3302          * <b>Values:</b><br/>
3303          * 0 - Vibration is disabled<br/>
3304          * 1 - Weak vibrations<br/>
3305          * 2 - Medium vibrations<br/>
3306          * 3 - Strong vibrations
3307          * @hide
3308          */
3309         public static final String NOTIFICATION_VIBRATION_INTENSITY =
3310                 "notification_vibration_intensity";
3311 
3312         /**
3313          * The intensity of haptic feedback vibrations, if configurable.
3314          *
3315          * Not all devices are capable of changing their feedback intensity; on these devices
3316          * there will likely be no difference between the various vibration intensities except for
3317          * intensity 0 (off) and the rest.
3318          *
3319          * <b>Values:</b><br/>
3320          * 0 - Vibration is disabled<br/>
3321          * 1 - Weak vibrations<br/>
3322          * 2 - Medium vibrations<br/>
3323          * 3 - Strong vibrations
3324          * @hide
3325          */
3326         public static final String HAPTIC_FEEDBACK_INTENSITY =
3327                 "haptic_feedback_intensity";
3328 
3329         private static final Validator VIBRATION_INTENSITY_VALIDATOR =
3330                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
3331 
3332         /**
3333          * Ringer volume. This is used internally, changing this value will not
3334          * change the volume. See AudioManager.
3335          *
3336          * @removed Not used by anything since API 2.
3337          */
3338         public static final String VOLUME_RING = "volume_ring";
3339 
3340         /**
3341          * System/notifications volume. This is used internally, changing this
3342          * value will not change the volume. See AudioManager.
3343          *
3344          * @removed Not used by anything since API 2.
3345          */
3346         public static final String VOLUME_SYSTEM = "volume_system";
3347 
3348         /**
3349          * Voice call volume. This is used internally, changing this value will
3350          * not change the volume. See AudioManager.
3351          *
3352          * @removed Not used by anything since API 2.
3353          */
3354         public static final String VOLUME_VOICE = "volume_voice";
3355 
3356         /**
3357          * Music/media/gaming volume. This is used internally, changing this
3358          * value will not change the volume. See AudioManager.
3359          *
3360          * @removed Not used by anything since API 2.
3361          */
3362         public static final String VOLUME_MUSIC = "volume_music";
3363 
3364         /**
3365          * Alarm volume. This is used internally, changing this
3366          * value will not change the volume. See AudioManager.
3367          *
3368          * @removed Not used by anything since API 2.
3369          */
3370         public static final String VOLUME_ALARM = "volume_alarm";
3371 
3372         /**
3373          * Notification volume. This is used internally, changing this
3374          * value will not change the volume. See AudioManager.
3375          *
3376          * @removed Not used by anything since API 2.
3377          */
3378         public static final String VOLUME_NOTIFICATION = "volume_notification";
3379 
3380         /**
3381          * Bluetooth Headset volume. This is used internally, changing this value will
3382          * not change the volume. See AudioManager.
3383          *
3384          * @removed Not used by anything since API 2.
3385          */
3386         public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
3387 
3388         /**
3389          * @hide
3390          * Acessibility volume. This is used internally, changing this
3391          * value will not change the volume.
3392          */
3393         public static final String VOLUME_ACCESSIBILITY = "volume_a11y";
3394 
3395         /**
3396          * Master volume (float in the range 0.0f to 1.0f).
3397          *
3398          * @hide
3399          */
3400         public static final String VOLUME_MASTER = "volume_master";
3401 
3402         /**
3403          * Master mono (int 1 = mono, 0 = normal).
3404          *
3405          * @hide
3406          */
3407         public static final String MASTER_MONO = "master_mono";
3408 
3409         private static final Validator MASTER_MONO_VALIDATOR = BOOLEAN_VALIDATOR;
3410 
3411         /**
3412          * Whether the notifications should use the ring volume (value of 1) or
3413          * a separate notification volume (value of 0). In most cases, users
3414          * will have this enabled so the notification and ringer volumes will be
3415          * the same. However, power users can disable this and use the separate
3416          * notification volume control.
3417          * <p>
3418          * Note: This is a one-off setting that will be removed in the future
3419          * when there is profile support. For this reason, it is kept hidden
3420          * from the public APIs.
3421          *
3422          * @hide
3423          * @deprecated
3424          */
3425         @Deprecated
3426         public static final String NOTIFICATIONS_USE_RING_VOLUME =
3427             "notifications_use_ring_volume";
3428 
3429         private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = BOOLEAN_VALIDATOR;
3430 
3431         /**
3432          * Whether silent mode should allow vibration feedback. This is used
3433          * internally in AudioService and the Sound settings activity to
3434          * coordinate decoupling of vibrate and silent modes. This setting
3435          * will likely be removed in a future release with support for
3436          * audio/vibe feedback profiles.
3437          *
3438          * Not used anymore. On devices with vibrator, the user explicitly selects
3439          * silent or vibrate mode.
3440          * Kept for use by legacy database upgrade code in DatabaseHelper.
3441          * @hide
3442          */
3443         public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
3444 
3445         private static final Validator VIBRATE_IN_SILENT_VALIDATOR = BOOLEAN_VALIDATOR;
3446 
3447         /**
3448          * The mapping of stream type (integer) to its setting.
3449          *
3450          * @removed  Not used by anything since API 2.
3451          */
3452         public static final String[] VOLUME_SETTINGS = {
3453             VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
3454             VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
3455         };
3456 
3457         /**
3458          * @hide
3459          * The mapping of stream type (integer) to its setting.
3460          * Unlike the VOLUME_SETTINGS array, this one contains as many entries as
3461          * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes
3462          * are never persisted.
3463          */
3464         public static final String[] VOLUME_SETTINGS_INT = {
3465                 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
3466                 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO,
3467                 "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/,
3468                 "" /*STREAM_DTMF, no setting for this stream*/,
3469                 "" /*STREAM_TTS, no setting for this stream*/,
3470                 VOLUME_ACCESSIBILITY
3471             };
3472 
3473         /**
3474          * Appended to various volume related settings to record the previous
3475          * values before they the settings were affected by a silent/vibrate
3476          * ringer mode change.
3477          *
3478          * @removed  Not used by anything since API 2.
3479          */
3480         public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
3481 
3482         /**
3483          * Persistent store for the system-wide default ringtone URI.
3484          * <p>
3485          * If you need to play the default ringtone at any given time, it is recommended
3486          * you give {@link #DEFAULT_RINGTONE_URI} to the media player.  It will resolve
3487          * to the set default ringtone at the time of playing.
3488          *
3489          * @see #DEFAULT_RINGTONE_URI
3490          */
3491         public static final String RINGTONE = "ringtone";
3492 
3493         private static final Validator RINGTONE_VALIDATOR = URI_VALIDATOR;
3494 
3495         /**
3496          * A {@link Uri} that will point to the current default ringtone at any
3497          * given time.
3498          * <p>
3499          * If the current default ringtone is in the DRM provider and the caller
3500          * does not have permission, the exception will be a
3501          * FileNotFoundException.
3502          */
3503         public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
3504 
3505         /** {@hide} */
3506         public static final String RINGTONE_CACHE = "ringtone_cache";
3507         /** {@hide} */
3508         public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE);
3509 
3510         /**
3511          * Persistent store for the system-wide default notification sound.
3512          *
3513          * @see #RINGTONE
3514          * @see #DEFAULT_NOTIFICATION_URI
3515          */
3516         public static final String NOTIFICATION_SOUND = "notification_sound";
3517 
3518         private static final Validator NOTIFICATION_SOUND_VALIDATOR = URI_VALIDATOR;
3519 
3520         /**
3521          * A {@link Uri} that will point to the current default notification
3522          * sound at any given time.
3523          *
3524          * @see #DEFAULT_RINGTONE_URI
3525          */
3526         public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
3527 
3528         /** {@hide} */
3529         public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache";
3530         /** {@hide} */
3531         public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE);
3532 
3533         /**
3534          * Persistent store for the system-wide default alarm alert.
3535          *
3536          * @see #RINGTONE
3537          * @see #DEFAULT_ALARM_ALERT_URI
3538          */
3539         public static final String ALARM_ALERT = "alarm_alert";
3540 
3541         private static final Validator ALARM_ALERT_VALIDATOR = URI_VALIDATOR;
3542 
3543         /**
3544          * A {@link Uri} that will point to the current default alarm alert at
3545          * any given time.
3546          *
3547          * @see #DEFAULT_ALARM_ALERT_URI
3548          */
3549         public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
3550 
3551         /** {@hide} */
3552         public static final String ALARM_ALERT_CACHE = "alarm_alert_cache";
3553         /** {@hide} */
3554         public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE);
3555 
3556         /**
3557          * Persistent store for the system default media button event receiver.
3558          *
3559          * @hide
3560          */
3561         public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
3562 
3563         private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = COMPONENT_NAME_VALIDATOR;
3564 
3565         /**
3566          * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
3567          */
3568         public static final String TEXT_AUTO_REPLACE = "auto_replace";
3569 
3570         private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = BOOLEAN_VALIDATOR;
3571 
3572         /**
3573          * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
3574          */
3575         public static final String TEXT_AUTO_CAPS = "auto_caps";
3576 
3577         private static final Validator TEXT_AUTO_CAPS_VALIDATOR = BOOLEAN_VALIDATOR;
3578 
3579         /**
3580          * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
3581          * feature converts two spaces to a "." and space.
3582          */
3583         public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
3584 
3585         private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = BOOLEAN_VALIDATOR;
3586 
3587         /**
3588          * Setting to showing password characters in text editors. 1 = On, 0 = Off
3589          */
3590         public static final String TEXT_SHOW_PASSWORD = "show_password";
3591 
3592         private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = BOOLEAN_VALIDATOR;
3593 
3594         public static final String SHOW_GTALK_SERVICE_STATUS =
3595                 "SHOW_GTALK_SERVICE_STATUS";
3596 
3597         private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = BOOLEAN_VALIDATOR;
3598 
3599         /**
3600          * Name of activity to use for wallpaper on the home screen.
3601          *
3602          * @deprecated Use {@link WallpaperManager} instead.
3603          */
3604         @Deprecated
3605         public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
3606 
3607         private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
3608             private static final int MAX_LENGTH = 1000;
3609 
3610             @Override
3611             public boolean validate(String value) {
3612                 if (value != null && value.length() > MAX_LENGTH) {
3613                     return false;
3614                 }
3615                 return ComponentName.unflattenFromString(value) != null;
3616             }
3617         };
3618 
3619         /**
3620          * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
3621          * instead
3622          */
3623         @Deprecated
3624         public static final String AUTO_TIME = Global.AUTO_TIME;
3625 
3626         private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR;
3627 
3628         /**
3629          * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
3630          * instead
3631          */
3632         @Deprecated
3633         public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
3634 
3635         private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR;
3636 
3637         /**
3638          * Display times as 12 or 24 hours
3639          *   12
3640          *   24
3641          */
3642         public static final String TIME_12_24 = "time_12_24";
3643 
3644         /** @hide */
3645         public static final Validator TIME_12_24_VALIDATOR =
3646                 new SettingsValidators.DiscreteValueValidator(new String[] {"12", "24", null});
3647 
3648         /**
3649          * Date format string
3650          *   mm/dd/yyyy
3651          *   dd/mm/yyyy
3652          *   yyyy/mm/dd
3653          */
3654         public static final String DATE_FORMAT = "date_format";
3655 
3656         /** @hide */
3657         public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
3658             @Override
3659             public boolean validate(@Nullable String value) {
3660                 try {
3661                     new SimpleDateFormat(value);
3662                     return true;
3663                 } catch (IllegalArgumentException | NullPointerException e) {
3664                     return false;
3665                 }
3666             }
3667         };
3668 
3669         /**
3670          * Whether the setup wizard has been run before (on first boot), or if
3671          * it still needs to be run.
3672          *
3673          * nonzero = it has been run in the past
3674          * 0 = it has not been run in the past
3675          */
3676         public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
3677 
3678         /** @hide */
3679         public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = BOOLEAN_VALIDATOR;
3680 
3681         /**
3682          * Scaling factor for normal window animations. Setting to 0 will disable window
3683          * animations.
3684          *
3685          * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
3686          */
3687         @Deprecated
3688         public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
3689 
3690         /**
3691          * Scaling factor for activity transition animations. Setting to 0 will disable window
3692          * animations.
3693          *
3694          * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
3695          */
3696         @Deprecated
3697         public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
3698 
3699         /**
3700          * Scaling factor for Animator-based animations. This affects both the start delay and
3701          * duration of all such animations. Setting to 0 will cause animations to end immediately.
3702          * The default value is 1.
3703          *
3704          * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
3705          */
3706         @Deprecated
3707         public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
3708 
3709         /**
3710          * Control whether the accelerometer will be used to change screen
3711          * orientation.  If 0, it will not be used unless explicitly requested
3712          * by the application; if 1, it will be used by default unless explicitly
3713          * disabled by the application.
3714          */
3715         public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
3716 
3717         /** @hide */
3718         public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = BOOLEAN_VALIDATOR;
3719 
3720         /**
3721          * Default screen rotation when no other policy applies.
3722          * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
3723          * preference, this rotation value will be used. Must be one of the
3724          * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
3725          *
3726          * @see android.view.Display#getRotation
3727          */
3728         public static final String USER_ROTATION = "user_rotation";
3729 
3730         /** @hide */
3731         public static final Validator USER_ROTATION_VALIDATOR =
3732                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
3733 
3734         /**
3735          * Control whether the rotation lock toggle in the System UI should be hidden.
3736          * Typically this is done for accessibility purposes to make it harder for
3737          * the user to accidentally toggle the rotation lock while the display rotation
3738          * has been locked for accessibility.
3739          *
3740          * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
3741          * unavailable for other reasons).  If 1, then the rotation lock toggle is hidden.
3742          *
3743          * @hide
3744          */
3745         public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
3746                 "hide_rotation_lock_toggle_for_accessibility";
3747 
3748         /** @hide */
3749         public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
3750                 BOOLEAN_VALIDATOR;
3751 
3752         /**
3753          * Whether the phone vibrates when it is ringing due to an incoming call. This will
3754          * be used by Phone and Setting apps; it shouldn't affect other apps.
3755          * The value is boolean (1 or 0).
3756          *
3757          * Note: this is not same as "vibrate on ring", which had been available until ICS.
3758          * It was about AudioManager's setting and thus affected all the applications which
3759          * relied on the setting, while this is purely about the vibration setting for incoming
3760          * calls.
3761          */
3762         public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
3763 
3764         /** @hide */
3765         public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = BOOLEAN_VALIDATOR;
3766 
3767         /**
3768          * Whether the audible DTMF tones are played by the dialer when dialing. The value is
3769          * boolean (1 or 0).
3770          */
3771         public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
3772 
3773         /** @hide */
3774         public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR;
3775 
3776         /**
3777          * CDMA only settings
3778          * DTMF tone type played by the dialer when dialing.
3779          *                 0 = Normal
3780          *                 1 = Long
3781          */
3782         public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
3783 
3784         /** @hide */
3785         public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR;
3786 
3787         /**
3788          * Whether the hearing aid is enabled. The value is
3789          * boolean (1 or 0).
3790          * @hide
3791          */
3792         public static final String HEARING_AID = "hearing_aid";
3793 
3794         /** @hide */
3795         public static final Validator HEARING_AID_VALIDATOR = BOOLEAN_VALIDATOR;
3796 
3797         /**
3798          * CDMA only settings
3799          * TTY Mode
3800          * 0 = OFF
3801          * 1 = FULL
3802          * 2 = VCO
3803          * 3 = HCO
3804          * @hide
3805          */
3806         public static final String TTY_MODE = "tty_mode";
3807 
3808         /** @hide */
3809         public static final Validator TTY_MODE_VALIDATOR =
3810                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
3811 
3812         /**
3813          * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
3814          * boolean (1 or 0).
3815          */
3816         public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
3817 
3818         /** @hide */
3819         public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
3820 
3821         /**
3822          * Whether haptic feedback (Vibrate on tap) is enabled. The value is
3823          * boolean (1 or 0).
3824          */
3825         public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
3826 
3827         /** @hide */
3828         public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
3829 
3830         /**
3831          * @deprecated Each application that shows web suggestions should have its own
3832          * setting for this.
3833          */
3834         @Deprecated
3835         public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
3836 
3837         /** @hide */
3838         public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = BOOLEAN_VALIDATOR;
3839 
3840         /**
3841          * Whether the notification LED should repeatedly flash when a notification is
3842          * pending. The value is boolean (1 or 0).
3843          * @hide
3844          */
3845         public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
3846 
3847         /** @hide */
3848         public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = BOOLEAN_VALIDATOR;
3849 
3850         /**
3851          * Show pointer location on screen?
3852          * 0 = no
3853          * 1 = yes
3854          * @hide
3855          */
3856         public static final String POINTER_LOCATION = "pointer_location";
3857 
3858         /** @hide */
3859         public static final Validator POINTER_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR;
3860 
3861         /**
3862          * Show touch positions on screen?
3863          * 0 = no
3864          * 1 = yes
3865          * @hide
3866          */
3867         public static final String SHOW_TOUCHES = "show_touches";
3868 
3869         /** @hide */
3870         public static final Validator SHOW_TOUCHES_VALIDATOR = BOOLEAN_VALIDATOR;
3871 
3872         /**
3873          * Log raw orientation data from
3874          * {@link com.android.server.policy.WindowOrientationListener} for use with the
3875          * orientationplot.py tool.
3876          * 0 = no
3877          * 1 = yes
3878          * @hide
3879          */
3880         public static final String WINDOW_ORIENTATION_LISTENER_LOG =
3881                 "window_orientation_listener_log";
3882 
3883         /** @hide */
3884         public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = BOOLEAN_VALIDATOR;
3885 
3886         /**
3887          * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
3888          * instead
3889          * @hide
3890          */
3891         @Deprecated
3892         public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
3893 
3894         private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
3895 
3896         /**
3897          * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
3898          * instead
3899          * @hide
3900          */
3901         @Deprecated
3902         public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
3903 
3904         private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
3905 
3906         /**
3907          * Whether to play sounds when the keyguard is shown and dismissed.
3908          * @hide
3909          */
3910         public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
3911 
3912         /** @hide */
3913         public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
3914 
3915         /**
3916          * Whether the lockscreen should be completely disabled.
3917          * @hide
3918          */
3919         public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
3920 
3921         /** @hide */
3922         public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR;
3923 
3924         /**
3925          * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
3926          * instead
3927          * @hide
3928          */
3929         @Deprecated
3930         public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
3931 
3932         /**
3933          * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
3934          * instead
3935          * @hide
3936          */
3937         @Deprecated
3938         public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
3939 
3940         /**
3941          * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
3942          * instead
3943          * @hide
3944          */
3945         @Deprecated
3946         public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
3947 
3948         /**
3949          * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
3950          * instead
3951          * @hide
3952          */
3953         @Deprecated
3954         public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
3955 
3956         /**
3957          * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
3958          * instead
3959          * @hide
3960          */
3961         @Deprecated
3962         public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
3963 
3964         /**
3965          * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
3966          * instead
3967          * @hide
3968          */
3969         @Deprecated
3970         public static final String LOCK_SOUND = Global.LOCK_SOUND;
3971 
3972         /**
3973          * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
3974          * instead
3975          * @hide
3976          */
3977         @Deprecated
3978         public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
3979 
3980         /**
3981          * Receive incoming SIP calls?
3982          * 0 = no
3983          * 1 = yes
3984          * @hide
3985          */
3986         public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
3987 
3988         /** @hide */
3989         public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = BOOLEAN_VALIDATOR;
3990 
3991         /**
3992          * Call Preference String.
3993          * "SIP_ALWAYS" : Always use SIP with network access
3994          * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
3995          * @hide
3996          */
3997         public static final String SIP_CALL_OPTIONS = "sip_call_options";
3998 
3999         /** @hide */
4000         public static final Validator SIP_CALL_OPTIONS_VALIDATOR =
4001                 new SettingsValidators.DiscreteValueValidator(
4002                         new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
4003 
4004         /**
4005          * One of the sip call options: Always use SIP with network access.
4006          * @hide
4007          */
4008         public static final String SIP_ALWAYS = "SIP_ALWAYS";
4009 
4010         /** @hide */
4011         public static final Validator SIP_ALWAYS_VALIDATOR = BOOLEAN_VALIDATOR;
4012 
4013         /**
4014          * One of the sip call options: Only if destination is a SIP address.
4015          * @hide
4016          */
4017         public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
4018 
4019         /** @hide */
4020         public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = BOOLEAN_VALIDATOR;
4021 
4022         /**
4023          * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead.  Formerly used to indicate that
4024          * the user should be prompted each time a call is made whether it should be placed using
4025          * SIP.  The {@link com.android.providers.settings.DatabaseHelper} replaces this with
4026          * SIP_ADDRESS_ONLY.
4027          * @hide
4028          */
4029         @Deprecated
4030         public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
4031 
4032         /** @hide */
4033         public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = BOOLEAN_VALIDATOR;
4034 
4035         /**
4036          * Pointer speed setting.
4037          * This is an integer value in a range between -7 and +7, so there are 15 possible values.
4038          *   -7 = slowest
4039          *    0 = default speed
4040          *   +7 = fastest
4041          * @hide
4042          */
4043         public static final String POINTER_SPEED = "pointer_speed";
4044 
4045         /** @hide */
4046         public static final Validator POINTER_SPEED_VALIDATOR =
4047                 new SettingsValidators.InclusiveFloatRangeValidator(-7, 7);
4048 
4049         /**
4050          * Whether lock-to-app will be triggered by long-press on recents.
4051          * @hide
4052          */
4053         public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
4054 
4055         /** @hide */
4056         public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4057 
4058         /**
4059          * I am the lolrus.
4060          * <p>
4061          * Nonzero values indicate that the user has a bukkit.
4062          * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
4063          * @hide
4064          */
4065         public static final String EGG_MODE = "egg_mode";
4066 
4067         /** @hide */
4068         public static final Validator EGG_MODE_VALIDATOR = new Validator() {
4069             @Override
4070             public boolean validate(@Nullable String value) {
4071                 try {
4072                     return Long.parseLong(value) >= 0;
4073                 } catch (NumberFormatException e) {
4074                     return false;
4075                 }
4076             }
4077         };
4078 
4079         /**
4080          * Setting to determine whether or not to show the battery percentage in the status bar.
4081          *    0 - Don't show percentage
4082          *    1 - Show percentage
4083          * @hide
4084          */
4085         public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent";
4086 
4087         /** @hide */
4088         private static final Validator SHOW_BATTERY_PERCENT_VALIDATOR = BOOLEAN_VALIDATOR;
4089 
4090         /**
4091          * IMPORTANT: If you add a new public settings you also have to add it to
4092          * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
4093          * it to PRIVATE_SETTINGS below. Also add a validator that can validate
4094          * the setting value. See an example above.
4095          */
4096 
4097         /**
4098          * Settings to backup. This is here so that it's in the same place as the settings
4099          * keys and easy to update.
4100          *
4101          * NOTE: Settings are backed up and restored in the order they appear
4102          *       in this array. If you have one setting depending on another,
4103          *       make sure that they are ordered appropriately.
4104          *
4105          * @hide
4106          */
4107         public static final String[] SETTINGS_TO_BACKUP = {
4108             STAY_ON_WHILE_PLUGGED_IN,   // moved to global
4109             WIFI_USE_STATIC_IP,
4110             WIFI_STATIC_IP,
4111             WIFI_STATIC_GATEWAY,
4112             WIFI_STATIC_NETMASK,
4113             WIFI_STATIC_DNS1,
4114             WIFI_STATIC_DNS2,
4115             BLUETOOTH_DISCOVERABILITY,
4116             BLUETOOTH_DISCOVERABILITY_TIMEOUT,
4117             FONT_SCALE,
4118             DIM_SCREEN,
4119             SCREEN_OFF_TIMEOUT,
4120             SCREEN_BRIGHTNESS_MODE,
4121             SCREEN_AUTO_BRIGHTNESS_ADJ,
4122             SCREEN_BRIGHTNESS_FOR_VR,
4123             VIBRATE_INPUT_DEVICES,
4124             MODE_RINGER_STREAMS_AFFECTED,
4125             TEXT_AUTO_REPLACE,
4126             TEXT_AUTO_CAPS,
4127             TEXT_AUTO_PUNCTUATE,
4128             TEXT_SHOW_PASSWORD,
4129             AUTO_TIME,                  // moved to global
4130             AUTO_TIME_ZONE,             // moved to global
4131             TIME_12_24,
4132             DATE_FORMAT,
4133             DTMF_TONE_WHEN_DIALING,
4134             DTMF_TONE_TYPE_WHEN_DIALING,
4135             HEARING_AID,
4136             TTY_MODE,
4137             MASTER_MONO,
4138             SOUND_EFFECTS_ENABLED,
4139             HAPTIC_FEEDBACK_ENABLED,
4140             POWER_SOUNDS_ENABLED,       // moved to global
4141             DOCK_SOUNDS_ENABLED,        // moved to global
4142             LOCKSCREEN_SOUNDS_ENABLED,
4143             SHOW_WEB_SUGGESTIONS,
4144             SIP_CALL_OPTIONS,
4145             SIP_RECEIVE_CALLS,
4146             POINTER_SPEED,
4147             VIBRATE_WHEN_RINGING,
4148             RINGTONE,
4149             LOCK_TO_APP_ENABLED,
4150             NOTIFICATION_SOUND,
4151             ACCELEROMETER_ROTATION,
4152             SHOW_BATTERY_PERCENT,
4153             NOTIFICATION_VIBRATION_INTENSITY,
4154             HAPTIC_FEEDBACK_INTENSITY,
4155             DISPLAY_COLOR_MODE
4156         };
4157 
4158         /**
4159          * Keys we no longer back up under the current schema, but want to continue to
4160          * process when restoring historical backup datasets.
4161          *
4162          * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
4163          * otherwise they won't be restored.
4164          *
4165          * @hide
4166          */
4167         public static final String[] LEGACY_RESTORE_SETTINGS = {
4168         };
4169 
4170         /**
4171          * These are all public system settings
4172          *
4173          * @hide
4174          */
4175         public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
4176         static {
4177             PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
4178             PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
4179             PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
4180             PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
4181             PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
4182             PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
4183             PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
4184             PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
4185             PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
4186             PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
4187             PUBLIC_SETTINGS.add(FONT_SCALE);
4188             PUBLIC_SETTINGS.add(DIM_SCREEN);
4189             PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
4190             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
4191             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR);
4192             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
4193             PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
4194             PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
4195             PUBLIC_SETTINGS.add(VIBRATE_ON);
4196             PUBLIC_SETTINGS.add(VOLUME_RING);
4197             PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
4198             PUBLIC_SETTINGS.add(VOLUME_VOICE);
4199             PUBLIC_SETTINGS.add(VOLUME_MUSIC);
4200             PUBLIC_SETTINGS.add(VOLUME_ALARM);
4201             PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
4202             PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
4203             PUBLIC_SETTINGS.add(RINGTONE);
4204             PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
4205             PUBLIC_SETTINGS.add(ALARM_ALERT);
4206             PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
4207             PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
4208             PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
4209             PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
4210             PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
4211             PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
4212             PUBLIC_SETTINGS.add(TIME_12_24);
4213             PUBLIC_SETTINGS.add(DATE_FORMAT);
4214             PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
4215             PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
4216             PUBLIC_SETTINGS.add(USER_ROTATION);
4217             PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
4218             PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
4219             PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
4220             PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
4221             PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING);
4222         }
4223 
4224         /**
4225          * These are all hidden system settings.
4226          *
4227          * @hide
4228          */
4229         public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
4230         static {
4231             PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
4232             PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
4233             PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
4234             PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
4235             PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
4236             PRIVATE_SETTINGS.add(VOLUME_MASTER);
4237             PRIVATE_SETTINGS.add(MASTER_MONO);
4238             PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
4239             PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
4240             PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
4241             PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
4242             PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
4243             PRIVATE_SETTINGS.add(HEARING_AID);
4244             PRIVATE_SETTINGS.add(TTY_MODE);
4245             PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
4246             PRIVATE_SETTINGS.add(POINTER_LOCATION);
4247             PRIVATE_SETTINGS.add(SHOW_TOUCHES);
4248             PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
4249             PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
4250             PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
4251             PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
4252             PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
4253             PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
4254             PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
4255             PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
4256             PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
4257             PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
4258             PRIVATE_SETTINGS.add(LOCK_SOUND);
4259             PRIVATE_SETTINGS.add(UNLOCK_SOUND);
4260             PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
4261             PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
4262             PRIVATE_SETTINGS.add(SIP_ALWAYS);
4263             PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
4264             PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
4265             PRIVATE_SETTINGS.add(POINTER_SPEED);
4266             PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
4267             PRIVATE_SETTINGS.add(EGG_MODE);
4268             PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT);
4269             PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE);
4270         }
4271 
4272         /**
4273          * These are all public system settings
4274          *
4275          * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator,
4276          * otherwise they won't be restored.
4277          *
4278          * @hide
4279          */
4280         public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
4281         static {
VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR)4282             VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR);
VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR)4283             VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR)4284             VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR)4285             VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT, BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR)4286             VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
4287                     BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR)4288             VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR)4289             VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR)4290             VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
VALIDATORS.put(DISPLAY_COLOR_MODE, DISPLAY_COLOR_MODE_VALIDATOR)4291             VALIDATORS.put(DISPLAY_COLOR_MODE, DISPLAY_COLOR_MODE_VALIDATOR);
VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR)4292             VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR)4293             VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR);
VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR)4294             VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR)4295             VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR)4296             VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR)4297             VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
VALIDATORS.put(NOTIFICATION_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR)4298             VALIDATORS.put(NOTIFICATION_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR);
VALIDATORS.put(HAPTIC_FEEDBACK_INTENSITY, VIBRATION_INTENSITY_VALIDATOR)4299             VALIDATORS.put(HAPTIC_FEEDBACK_INTENSITY, VIBRATION_INTENSITY_VALIDATOR);
VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR)4300             VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR)4301             VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR)4302             VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR)4303             VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR)4304             VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR)4305             VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR)4306             VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR)4307             VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR);
VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR)4308             VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR);
VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR)4309             VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR)4310             VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR)4311             VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR)4312             VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR)4313             VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR)4314             VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR)4315             VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR)4316             VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR)4317             VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR)4318             VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR)4319             VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR)4320             VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR)4321             VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR)4322             VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR)4323             VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR)4324             VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR)4325             VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR)4326             VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR)4327             VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR);
VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR)4328             VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR)4329             VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR)4330             VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR)4331             VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
4332                     HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR)4333             VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR)4334             VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR)4335             VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR)4336             VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR)4337             VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR)4338             VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR)4339             VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG, WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR)4340             VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
4341                     WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR)4342             VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR)4343             VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR)4344             VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR)4345             VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR)4346             VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR)4347             VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR)4348             VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR)4349             VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR)4350             VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR)4351             VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR)4352             VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR)4353             VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR)4354             VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR)4355             VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR)4356             VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
VALIDATORS.put(SHOW_BATTERY_PERCENT, SHOW_BATTERY_PERCENT_VALIDATOR)4357             VALIDATORS.put(SHOW_BATTERY_PERCENT, SHOW_BATTERY_PERCENT_VALIDATOR);
4358         }
4359 
4360         /**
4361          * These entries are considered common between the personal and the managed profile,
4362          * since the managed profile doesn't get to change them.
4363          */
4364         private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
4365         static {
4366             CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
4367             CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
4368             CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
4369             CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
4370             CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
4371         }
4372 
4373         /** @hide */
getCloneToManagedProfileSettings(Set<String> outKeySet)4374         public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
4375             outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
4376         }
4377 
4378         /**
4379          * These entries should be cloned from this profile's parent only if the dependency's
4380          * value is true ("1")
4381          *
4382          * Note: the dependencies must be Secure settings
4383          *
4384          * @hide
4385          */
4386         public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>();
4387         static {
CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS)4388             CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS);
CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS)4389             CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS);
CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS)4390             CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS);
4391         }
4392 
4393         /** @hide */
getCloneFromParentOnValueSettings(Map<String, String> outMap)4394         public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) {
4395             outMap.putAll(CLONE_FROM_PARENT_ON_VALUE);
4396         }
4397 
4398         /**
4399          * System settings which can be accessed by instant apps.
4400          * @hide
4401          */
4402         public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
4403         static {
4404             INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE);
4405             INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS);
4406             INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
4407             INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD);
4408             INSTANT_APP_SETTINGS.add(DATE_FORMAT);
4409             INSTANT_APP_SETTINGS.add(FONT_SCALE);
4410             INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
4411             INSTANT_APP_SETTINGS.add(TIME_12_24);
4412             INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED);
4413             INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION);
4414         }
4415 
4416         /**
4417          * When to use Wi-Fi calling
4418          *
4419          * @see android.telephony.TelephonyManager.WifiCallingChoices
4420          * @hide
4421          */
4422         public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
4423 
4424         // Settings moved to Settings.Secure
4425 
4426         /**
4427          * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
4428          * instead
4429          */
4430         @Deprecated
4431         public static final String ADB_ENABLED = Global.ADB_ENABLED;
4432 
4433         /**
4434          * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
4435          */
4436         @Deprecated
4437         public static final String ANDROID_ID = Secure.ANDROID_ID;
4438 
4439         /**
4440          * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
4441          */
4442         @Deprecated
4443         public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
4444 
4445         private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR;
4446 
4447         /**
4448          * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
4449          */
4450         @Deprecated
4451         public static final String DATA_ROAMING = Global.DATA_ROAMING;
4452 
4453         /**
4454          * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
4455          */
4456         @Deprecated
4457         public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
4458 
4459         /**
4460          * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
4461          */
4462         @Deprecated
4463         public static final String HTTP_PROXY = Global.HTTP_PROXY;
4464 
4465         /**
4466          * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
4467          */
4468         @Deprecated
4469         public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
4470 
4471         /**
4472          * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
4473          * instead
4474          */
4475         @Deprecated
4476         public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
4477 
4478         /**
4479          * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
4480          */
4481         @Deprecated
4482         public static final String LOGGING_ID = Secure.LOGGING_ID;
4483 
4484         /**
4485          * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
4486          */
4487         @Deprecated
4488         public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
4489 
4490         /**
4491          * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
4492          * instead
4493          */
4494         @Deprecated
4495         public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
4496 
4497         /**
4498          * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
4499          * instead
4500          */
4501         @Deprecated
4502         public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
4503 
4504         /**
4505          * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
4506          * instead
4507          */
4508         @Deprecated
4509         public static final String PARENTAL_CONTROL_REDIRECT_URL =
4510             Secure.PARENTAL_CONTROL_REDIRECT_URL;
4511 
4512         /**
4513          * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
4514          */
4515         @Deprecated
4516         public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
4517 
4518         /**
4519          * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
4520          */
4521         @Deprecated
4522         public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
4523 
4524         private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4525 
4526         /**
4527          * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
4528          */
4529         @Deprecated
4530         public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
4531 
4532        /**
4533          * @deprecated Use
4534          * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
4535          */
4536         @Deprecated
4537         public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
4538 
4539         /**
4540          * @deprecated Use
4541          * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
4542          */
4543         @Deprecated
4544         public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
4545                 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
4546 
4547         /**
4548          * @deprecated Use
4549          * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
4550          */
4551         @Deprecated
4552         public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
4553                 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
4554 
4555         private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
4556                 BOOLEAN_VALIDATOR;
4557 
4558         /**
4559          * @deprecated Use
4560          * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
4561          */
4562         @Deprecated
4563         public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
4564                 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
4565 
4566         private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR =
4567                 NON_NEGATIVE_INTEGER_VALIDATOR;
4568 
4569         /**
4570          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
4571          * instead
4572          */
4573         @Deprecated
4574         public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
4575 
4576         private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR =
4577                 NON_NEGATIVE_INTEGER_VALIDATOR;
4578 
4579         /**
4580          * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
4581          */
4582         @Deprecated
4583         public static final String WIFI_ON = Global.WIFI_ON;
4584 
4585         /**
4586          * @deprecated Use
4587          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
4588          * instead
4589          */
4590         @Deprecated
4591         public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4592                 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
4593 
4594         /**
4595          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
4596          */
4597         @Deprecated
4598         public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
4599 
4600         /**
4601          * @deprecated Use
4602          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
4603          */
4604         @Deprecated
4605         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4606                 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
4607 
4608         /**
4609          * @deprecated Use
4610          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
4611          */
4612         @Deprecated
4613         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
4614                 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
4615 
4616         /**
4617          * @deprecated Use
4618          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
4619          * instead
4620          */
4621         @Deprecated
4622         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
4623                 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
4624 
4625         /**
4626          * @deprecated Use
4627          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
4628          */
4629         @Deprecated
4630         public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
4631             Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
4632 
4633         /**
4634          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
4635          * instead
4636          */
4637         @Deprecated
4638         public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
4639 
4640         /**
4641          * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
4642          */
4643         @Deprecated
4644         public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
4645 
4646         /**
4647          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
4648          */
4649         @Deprecated
4650         public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
4651 
4652         /**
4653          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
4654          * instead
4655          */
4656         @Deprecated
4657         public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
4658 
4659         /**
4660          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
4661          * instead
4662          */
4663         @Deprecated
4664         public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
4665             Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
4666 
4667         /**
4668          * Checks if the specified app can modify system settings. As of API
4669          * level 23, an app cannot modify system settings unless it declares the
4670          * {@link android.Manifest.permission#WRITE_SETTINGS}
4671          * permission in its manifest, <em>and</em> the user specifically grants
4672          * the app this capability. To prompt the user to grant this approval,
4673          * the app must send an intent with the action {@link
4674          * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes
4675          * the system to display a permission management screen.
4676          *
4677          * @param context App context.
4678          * @return true if the calling app can write to system settings, false otherwise
4679          */
canWrite(Context context)4680         public static boolean canWrite(Context context) {
4681             return isCallingPackageAllowedToWriteSettings(context, Process.myUid(),
4682                     context.getOpPackageName(), false);
4683         }
4684     }
4685 
4686     /**
4687      * Secure system settings, containing system preferences that applications
4688      * can read but are not allowed to write.  These are for preferences that
4689      * the user must explicitly modify through the system UI or specialized
4690      * APIs for those values, not modified directly by applications.
4691      */
4692     public static final class Secure extends NameValueTable {
4693         // NOTE: If you add new settings here, be sure to add them to
4694         // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked.
4695 
4696         /**
4697          * The content:// style URL for this table
4698          */
4699         public static final Uri CONTENT_URI =
4700             Uri.parse("content://" + AUTHORITY + "/secure");
4701 
4702         private static final ContentProviderHolder sProviderHolder =
4703                 new ContentProviderHolder(CONTENT_URI);
4704 
4705         // Populated lazily, guarded by class object:
4706         private static final NameValueCache sNameValueCache = new NameValueCache(
4707                 CONTENT_URI,
4708                 CALL_METHOD_GET_SECURE,
4709                 CALL_METHOD_PUT_SECURE,
4710                 sProviderHolder);
4711 
4712         private static ILockSettings sLockSettings = null;
4713 
4714         private static boolean sIsSystemProcess;
4715         private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
4716         private static final HashSet<String> MOVED_TO_GLOBAL;
4717         static {
4718             MOVED_TO_LOCK_SETTINGS = new HashSet<>(3);
4719             MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
4720             MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
4721             MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
4722 
4723             MOVED_TO_GLOBAL = new HashSet<>();
4724             MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
4725             MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
4726             MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
4727             MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
4728             MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
4729             MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
4730             MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
4731             MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
4732             MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
4733             MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
4734             MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
4735             MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
4736             MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
4737             MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
4738             MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
4739             MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
4740             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
4741             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
4742             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
4743             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
4744             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
4745             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
4746             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
4747             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
4748             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
4749             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
4750             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
4751             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
4752             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
4753             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
4754             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
4755             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
4756             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
4757             MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
4758             MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
4759             MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
4760             MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
4761             MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
4762             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
4763             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
4764             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
4765             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
4766             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
4767             MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
4768             MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
4769             MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
4770             MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
4771             MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
4772             MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
4773             MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
4774             MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
4775             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
4776             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
4777             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
4778             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
4779             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
4780             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
4781             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
4782             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
4783             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
4784             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
4785             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
4786             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
4787             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
4788             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
4789             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED);
4790             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
4791             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
4792             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
4793             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
4794             MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
4795             MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
4796             MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
4797             MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
4798             MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
4799             MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
4800             MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
4801             MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
4802             MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
4803             MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
4804             MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
4805             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
4806             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
4807             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
4808             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
4809             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
4810             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
4811             MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
4812             MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
4813             MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
4814             MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
4815             MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
4816             MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
4817             MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
4818             MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
4819             MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
4820             MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
4821             MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
4822             MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
4823             MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
4824             MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
4825             MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
4826             MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
4827             MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
4828             MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
4829             MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
4830             MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
4831             MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
4832             MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
4833             MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
4834             MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
4835         }
4836 
4837         /** @hide */
getMovedToGlobalSettings(Set<String> outKeySet)4838         public static void getMovedToGlobalSettings(Set<String> outKeySet) {
4839             outKeySet.addAll(MOVED_TO_GLOBAL);
4840         }
4841 
4842         /** @hide */
clearProviderForTest()4843         public static void clearProviderForTest() {
4844             sProviderHolder.clearProviderForTest();
4845             sNameValueCache.clearGenerationTrackerForTest();
4846         }
4847 
4848         /**
4849          * Look up a name in the database.
4850          * @param resolver to access the database with
4851          * @param name to look up in the table
4852          * @return the corresponding value, or null if not present
4853          */
getString(ContentResolver resolver, String name)4854         public static String getString(ContentResolver resolver, String name) {
4855             return getStringForUser(resolver, name, resolver.getUserId());
4856         }
4857 
4858         /** @hide */
getStringForUser(ContentResolver resolver, String name, int userHandle)4859         public static String getStringForUser(ContentResolver resolver, String name,
4860                 int userHandle) {
4861             if (MOVED_TO_GLOBAL.contains(name)) {
4862                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4863                         + " to android.provider.Settings.Global.");
4864                 return Global.getStringForUser(resolver, name, userHandle);
4865             }
4866 
4867             if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
4868                 synchronized (Secure.class) {
4869                     if (sLockSettings == null) {
4870                         sLockSettings = ILockSettings.Stub.asInterface(
4871                                 (IBinder) ServiceManager.getService("lock_settings"));
4872                         sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
4873                     }
4874                 }
4875                 if (sLockSettings != null && !sIsSystemProcess) {
4876                     // No context; use the ActivityThread's context as an approximation for
4877                     // determining the target API level.
4878                     Application application = ActivityThread.currentApplication();
4879 
4880                     boolean isPreMnc = application != null
4881                             && application.getApplicationInfo() != null
4882                             && application.getApplicationInfo().targetSdkVersion
4883                             <= VERSION_CODES.LOLLIPOP_MR1;
4884                     if (isPreMnc) {
4885                         try {
4886                             return sLockSettings.getString(name, "0", userHandle);
4887                         } catch (RemoteException re) {
4888                             // Fall through
4889                         }
4890                     } else {
4891                         throw new SecurityException("Settings.Secure." + name
4892                                 + " is deprecated and no longer accessible."
4893                                 + " See API documentation for potential replacements.");
4894                     }
4895                 }
4896             }
4897 
4898             return sNameValueCache.getStringForUser(resolver, name, userHandle);
4899         }
4900 
4901         /**
4902          * Store a name/value pair into the database.
4903          * @param resolver to access the database with
4904          * @param name to store
4905          * @param value to associate with the name
4906          * @return true if the value was set, false on database errors
4907          */
putString(ContentResolver resolver, String name, String value)4908         public static boolean putString(ContentResolver resolver, String name, String value) {
4909             return putStringForUser(resolver, name, value, resolver.getUserId());
4910         }
4911 
4912         /** @hide */
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)4913         public static boolean putStringForUser(ContentResolver resolver, String name, String value,
4914                 int userHandle) {
4915             return putStringForUser(resolver, name, value, null, false, userHandle);
4916         }
4917 
4918         /** @hide */
putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle)4919         public static boolean putStringForUser(@NonNull ContentResolver resolver,
4920                 @NonNull String name, @Nullable String value, @Nullable String tag,
4921                 boolean makeDefault, @UserIdInt int userHandle) {
4922             if (LOCATION_MODE.equals(name)) {
4923                 // Map LOCATION_MODE to underlying location provider storage API
4924                 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle);
4925             }
4926             if (MOVED_TO_GLOBAL.contains(name)) {
4927                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4928                         + " to android.provider.Settings.Global");
4929                 return Global.putStringForUser(resolver, name, value,
4930                         tag, makeDefault, userHandle);
4931             }
4932             return sNameValueCache.putStringForUser(resolver, name, value, tag,
4933                     makeDefault, userHandle);
4934         }
4935 
4936         /**
4937          * Store a name/value pair into the database.
4938          * <p>
4939          * The method takes an optional tag to associate with the setting
4940          * which can be used to clear only settings made by your package and
4941          * associated with this tag by passing the tag to {@link
4942          * #resetToDefaults(ContentResolver, String)}. Anyone can override
4943          * the current tag. Also if another package changes the setting
4944          * then the tag will be set to the one specified in the set call
4945          * which can be null. Also any of the settings setters that do not
4946          * take a tag as an argument effectively clears the tag.
4947          * </p><p>
4948          * For example, if you set settings A and B with tags T1 and T2 and
4949          * another app changes setting A (potentially to the same value), it
4950          * can assign to it a tag T3 (note that now the package that changed
4951          * the setting is not yours). Now if you reset your changes for T1 and
4952          * T2 only setting B will be reset and A not (as it was changed by
4953          * another package) but since A did not change you are in the desired
4954          * initial state. Now if the other app changes the value of A (assuming
4955          * you registered an observer in the beginning) you would detect that
4956          * the setting was changed by another app and handle this appropriately
4957          * (ignore, set back to some value, etc).
4958          * </p><p>
4959          * Also the method takes an argument whether to make the value the
4960          * default for this setting. If the system already specified a default
4961          * value, then the one passed in here will <strong>not</strong>
4962          * be set as the default.
4963          * </p>
4964          *
4965          * @param resolver to access the database with.
4966          * @param name to store.
4967          * @param value to associate with the name.
4968          * @param tag to associate with the setting.
4969          * @param makeDefault whether to make the value the default one.
4970          * @return true if the value was set, false on database errors.
4971          *
4972          * @see #resetToDefaults(ContentResolver, String)
4973          *
4974          * @hide
4975          */
4976         @SystemApi
4977         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)4978         public static boolean putString(@NonNull ContentResolver resolver,
4979                 @NonNull String name, @Nullable String value, @Nullable String tag,
4980                 boolean makeDefault) {
4981             return putStringForUser(resolver, name, value, tag, makeDefault,
4982                     resolver.getUserId());
4983         }
4984 
4985         /**
4986          * Reset the settings to their defaults. This would reset <strong>only</strong>
4987          * settings set by the caller's package. Think of it of a way to undo your own
4988          * changes to the global settings. Passing in the optional tag will reset only
4989          * settings changed by your package and associated with this tag.
4990          *
4991          * @param resolver Handle to the content resolver.
4992          * @param tag Optional tag which should be associated with the settings to reset.
4993          *
4994          * @see #putString(ContentResolver, String, String, String, boolean)
4995          *
4996          * @hide
4997          */
4998         @SystemApi
4999         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)5000         public static void resetToDefaults(@NonNull ContentResolver resolver,
5001                 @Nullable String tag) {
5002             resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
5003                     resolver.getUserId());
5004         }
5005 
5006         /**
5007          *
5008          * Reset the settings to their defaults for a given user with a specific mode. The
5009          * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
5010          * allowing resetting the settings made by a package and associated with the tag.
5011          *
5012          * @param resolver Handle to the content resolver.
5013          * @param tag Optional tag which should be associated with the settings to reset.
5014          * @param mode The reset mode.
5015          * @param userHandle The user for which to reset to defaults.
5016          *
5017          * @see #RESET_MODE_PACKAGE_DEFAULTS
5018          * @see #RESET_MODE_UNTRUSTED_DEFAULTS
5019          * @see #RESET_MODE_UNTRUSTED_CHANGES
5020          * @see #RESET_MODE_TRUSTED_DEFAULTS
5021          *
5022          * @hide
5023          */
resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)5024         public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
5025                 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
5026             try {
5027                 Bundle arg = new Bundle();
5028                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
5029                 if (tag != null) {
5030                     arg.putString(CALL_METHOD_TAG_KEY, tag);
5031                 }
5032                 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
5033                 IContentProvider cp = sProviderHolder.getProvider(resolver);
5034                 cp.call(resolver.getPackageName(), CALL_METHOD_RESET_SECURE, null, arg);
5035             } catch (RemoteException e) {
5036                 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
5037             }
5038         }
5039 
5040         /**
5041          * Construct the content URI for a particular name/value pair,
5042          * useful for monitoring changes with a ContentObserver.
5043          * @param name to look up in the table
5044          * @return the corresponding content URI, or null if not present
5045          */
getUriFor(String name)5046         public static Uri getUriFor(String name) {
5047             if (MOVED_TO_GLOBAL.contains(name)) {
5048                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
5049                         + " to android.provider.Settings.Global, returning global URI.");
5050                 return Global.getUriFor(Global.CONTENT_URI, name);
5051             }
5052             return getUriFor(CONTENT_URI, name);
5053         }
5054 
5055         /**
5056          * Convenience function for retrieving a single secure settings value
5057          * as an integer.  Note that internally setting values are always
5058          * stored as strings; this function converts the string to an integer
5059          * for you.  The default value will be returned if the setting is
5060          * not defined or not an integer.
5061          *
5062          * @param cr The ContentResolver to access.
5063          * @param name The name of the setting to retrieve.
5064          * @param def Value to return if the setting is not defined.
5065          *
5066          * @return The setting's current value, or 'def' if it is not defined
5067          * or not a valid integer.
5068          */
getInt(ContentResolver cr, String name, int def)5069         public static int getInt(ContentResolver cr, String name, int def) {
5070             return getIntForUser(cr, name, def, cr.getUserId());
5071         }
5072 
5073         /** @hide */
getIntForUser(ContentResolver cr, String name, int def, int userHandle)5074         public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
5075             if (LOCATION_MODE.equals(name)) {
5076                 // Map from to underlying location provider storage API to location mode
5077                 return getLocationModeForUser(cr, userHandle);
5078             }
5079             String v = getStringForUser(cr, name, userHandle);
5080             try {
5081                 return v != null ? Integer.parseInt(v) : def;
5082             } catch (NumberFormatException e) {
5083                 return def;
5084             }
5085         }
5086 
5087         /**
5088          * Convenience function for retrieving a single secure settings value
5089          * as an integer.  Note that internally setting values are always
5090          * stored as strings; this function converts the string to an integer
5091          * for you.
5092          * <p>
5093          * This version does not take a default value.  If the setting has not
5094          * been set, or the string value is not a number,
5095          * it throws {@link SettingNotFoundException}.
5096          *
5097          * @param cr The ContentResolver to access.
5098          * @param name The name of the setting to retrieve.
5099          *
5100          * @throws SettingNotFoundException Thrown if a setting by the given
5101          * name can't be found or the setting value is not an integer.
5102          *
5103          * @return The setting's current value.
5104          */
getInt(ContentResolver cr, String name)5105         public static int getInt(ContentResolver cr, String name)
5106                 throws SettingNotFoundException {
5107             return getIntForUser(cr, name, cr.getUserId());
5108         }
5109 
5110         /** @hide */
getIntForUser(ContentResolver cr, String name, int userHandle)5111         public static int getIntForUser(ContentResolver cr, String name, int userHandle)
5112                 throws SettingNotFoundException {
5113             if (LOCATION_MODE.equals(name)) {
5114                 // Map from to underlying location provider storage API to location mode
5115                 return getLocationModeForUser(cr, userHandle);
5116             }
5117             String v = getStringForUser(cr, name, userHandle);
5118             try {
5119                 return Integer.parseInt(v);
5120             } catch (NumberFormatException e) {
5121                 throw new SettingNotFoundException(name);
5122             }
5123         }
5124 
5125         /**
5126          * Convenience function for updating a single settings value as an
5127          * integer. This will either create a new entry in the table if the
5128          * given name does not exist, or modify the value of the existing row
5129          * with that name.  Note that internally setting values are always
5130          * stored as strings, so this function converts the given value to a
5131          * string before storing it.
5132          *
5133          * @param cr The ContentResolver to access.
5134          * @param name The name of the setting to modify.
5135          * @param value The new value for the setting.
5136          * @return true if the value was set, false on database errors
5137          */
putInt(ContentResolver cr, String name, int value)5138         public static boolean putInt(ContentResolver cr, String name, int value) {
5139             return putIntForUser(cr, name, value, cr.getUserId());
5140         }
5141 
5142         /** @hide */
putIntForUser(ContentResolver cr, String name, int value, int userHandle)5143         public static boolean putIntForUser(ContentResolver cr, String name, int value,
5144                 int userHandle) {
5145             return putStringForUser(cr, name, Integer.toString(value), userHandle);
5146         }
5147 
5148         /**
5149          * Convenience function for retrieving a single secure settings value
5150          * as a {@code long}.  Note that internally setting values are always
5151          * stored as strings; this function converts the string to a {@code long}
5152          * for you.  The default value will be returned if the setting is
5153          * not defined or not a {@code long}.
5154          *
5155          * @param cr The ContentResolver to access.
5156          * @param name The name of the setting to retrieve.
5157          * @param def Value to return if the setting is not defined.
5158          *
5159          * @return The setting's current value, or 'def' if it is not defined
5160          * or not a valid {@code long}.
5161          */
getLong(ContentResolver cr, String name, long def)5162         public static long getLong(ContentResolver cr, String name, long def) {
5163             return getLongForUser(cr, name, def, cr.getUserId());
5164         }
5165 
5166         /** @hide */
getLongForUser(ContentResolver cr, String name, long def, int userHandle)5167         public static long getLongForUser(ContentResolver cr, String name, long def,
5168                 int userHandle) {
5169             String valString = getStringForUser(cr, name, userHandle);
5170             long value;
5171             try {
5172                 value = valString != null ? Long.parseLong(valString) : def;
5173             } catch (NumberFormatException e) {
5174                 value = def;
5175             }
5176             return value;
5177         }
5178 
5179         /**
5180          * Convenience function for retrieving a single secure settings value
5181          * as a {@code long}.  Note that internally setting values are always
5182          * stored as strings; this function converts the string to a {@code long}
5183          * for you.
5184          * <p>
5185          * This version does not take a default value.  If the setting has not
5186          * been set, or the string value is not a number,
5187          * it throws {@link SettingNotFoundException}.
5188          *
5189          * @param cr The ContentResolver to access.
5190          * @param name The name of the setting to retrieve.
5191          *
5192          * @return The setting's current value.
5193          * @throws SettingNotFoundException Thrown if a setting by the given
5194          * name can't be found or the setting value is not an integer.
5195          */
getLong(ContentResolver cr, String name)5196         public static long getLong(ContentResolver cr, String name)
5197                 throws SettingNotFoundException {
5198             return getLongForUser(cr, name, cr.getUserId());
5199         }
5200 
5201         /** @hide */
getLongForUser(ContentResolver cr, String name, int userHandle)5202         public static long getLongForUser(ContentResolver cr, String name, int userHandle)
5203                 throws SettingNotFoundException {
5204             String valString = getStringForUser(cr, name, userHandle);
5205             try {
5206                 return Long.parseLong(valString);
5207             } catch (NumberFormatException e) {
5208                 throw new SettingNotFoundException(name);
5209             }
5210         }
5211 
5212         /**
5213          * Convenience function for updating a secure settings value as a long
5214          * integer. This will either create a new entry in the table if the
5215          * given name does not exist, or modify the value of the existing row
5216          * with that name.  Note that internally setting values are always
5217          * stored as strings, so this function converts the given value to a
5218          * string before storing it.
5219          *
5220          * @param cr The ContentResolver to access.
5221          * @param name The name of the setting to modify.
5222          * @param value The new value for the setting.
5223          * @return true if the value was set, false on database errors
5224          */
putLong(ContentResolver cr, String name, long value)5225         public static boolean putLong(ContentResolver cr, String name, long value) {
5226             return putLongForUser(cr, name, value, cr.getUserId());
5227         }
5228 
5229         /** @hide */
putLongForUser(ContentResolver cr, String name, long value, int userHandle)5230         public static boolean putLongForUser(ContentResolver cr, String name, long value,
5231                 int userHandle) {
5232             return putStringForUser(cr, name, Long.toString(value), userHandle);
5233         }
5234 
5235         /**
5236          * Convenience function for retrieving a single secure settings value
5237          * as a floating point number.  Note that internally setting values are
5238          * always stored as strings; this function converts the string to an
5239          * float for you. The default value will be returned if the setting
5240          * is not defined or not a valid float.
5241          *
5242          * @param cr The ContentResolver to access.
5243          * @param name The name of the setting to retrieve.
5244          * @param def Value to return if the setting is not defined.
5245          *
5246          * @return The setting's current value, or 'def' if it is not defined
5247          * or not a valid float.
5248          */
getFloat(ContentResolver cr, String name, float def)5249         public static float getFloat(ContentResolver cr, String name, float def) {
5250             return getFloatForUser(cr, name, def, cr.getUserId());
5251         }
5252 
5253         /** @hide */
getFloatForUser(ContentResolver cr, String name, float def, int userHandle)5254         public static float getFloatForUser(ContentResolver cr, String name, float def,
5255                 int userHandle) {
5256             String v = getStringForUser(cr, name, userHandle);
5257             try {
5258                 return v != null ? Float.parseFloat(v) : def;
5259             } catch (NumberFormatException e) {
5260                 return def;
5261             }
5262         }
5263 
5264         /**
5265          * Convenience function for retrieving a single secure settings value
5266          * as a float.  Note that internally setting values are always
5267          * stored as strings; this function converts the string to a float
5268          * for you.
5269          * <p>
5270          * This version does not take a default value.  If the setting has not
5271          * been set, or the string value is not a number,
5272          * it throws {@link SettingNotFoundException}.
5273          *
5274          * @param cr The ContentResolver to access.
5275          * @param name The name of the setting to retrieve.
5276          *
5277          * @throws SettingNotFoundException Thrown if a setting by the given
5278          * name can't be found or the setting value is not a float.
5279          *
5280          * @return The setting's current value.
5281          */
getFloat(ContentResolver cr, String name)5282         public static float getFloat(ContentResolver cr, String name)
5283                 throws SettingNotFoundException {
5284             return getFloatForUser(cr, name, cr.getUserId());
5285         }
5286 
5287         /** @hide */
getFloatForUser(ContentResolver cr, String name, int userHandle)5288         public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
5289                 throws SettingNotFoundException {
5290             String v = getStringForUser(cr, name, userHandle);
5291             if (v == null) {
5292                 throw new SettingNotFoundException(name);
5293             }
5294             try {
5295                 return Float.parseFloat(v);
5296             } catch (NumberFormatException e) {
5297                 throw new SettingNotFoundException(name);
5298             }
5299         }
5300 
5301         /**
5302          * Convenience function for updating a single settings value as a
5303          * floating point number. This will either create a new entry in the
5304          * table if the given name does not exist, or modify the value of the
5305          * existing row with that name.  Note that internally setting values
5306          * are always stored as strings, so this function converts the given
5307          * value to a string before storing it.
5308          *
5309          * @param cr The ContentResolver to access.
5310          * @param name The name of the setting to modify.
5311          * @param value The new value for the setting.
5312          * @return true if the value was set, false on database errors
5313          */
putFloat(ContentResolver cr, String name, float value)5314         public static boolean putFloat(ContentResolver cr, String name, float value) {
5315             return putFloatForUser(cr, name, value, cr.getUserId());
5316         }
5317 
5318         /** @hide */
putFloatForUser(ContentResolver cr, String name, float value, int userHandle)5319         public static boolean putFloatForUser(ContentResolver cr, String name, float value,
5320                 int userHandle) {
5321             return putStringForUser(cr, name, Float.toString(value), userHandle);
5322         }
5323 
5324         /**
5325          * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
5326          * instead
5327          */
5328         @Deprecated
5329         public static final String DEVELOPMENT_SETTINGS_ENABLED =
5330                 Global.DEVELOPMENT_SETTINGS_ENABLED;
5331 
5332         /**
5333          * When the user has enable the option to have a "bug report" command
5334          * in the power menu.
5335          * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
5336          * @hide
5337          */
5338         @Deprecated
5339         public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5340 
5341         private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR;
5342 
5343         /**
5344          * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
5345          */
5346         @Deprecated
5347         public static final String ADB_ENABLED = Global.ADB_ENABLED;
5348 
5349         /**
5350          * Setting to allow mock locations and location provider status to be injected into the
5351          * LocationManager service for testing purposes during application development.  These
5352          * locations and status values  override actual location and status information generated
5353          * by network, gps, or other location providers.
5354          *
5355          * @deprecated This settings is not used anymore.
5356          */
5357         @Deprecated
5358         public static final String ALLOW_MOCK_LOCATION = "mock_location";
5359 
5360         private static final Validator ALLOW_MOCK_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR;
5361 
5362         /**
5363          * On Android 8.0 (API level 26) and higher versions of the platform,
5364          * a 64-bit number (expressed as a hexadecimal string), unique to
5365          * each combination of app-signing key, user, and device.
5366          * Values of {@code ANDROID_ID} are scoped by signing key and user.
5367          * The value may change if a factory reset is performed on the
5368          * device or if an APK signing key changes.
5369          *
5370          * For more information about how the platform handles {@code ANDROID_ID}
5371          * in Android 8.0 (API level 26) and higher, see <a
5372          * href="{@docRoot}preview/behavior-changes.html#privacy-all">
5373          * Android 8.0 Behavior Changes</a>.
5374          *
5375          * <p class="note"><strong>Note:</strong> For apps that were installed
5376          * prior to updating the device to a version of Android 8.0
5377          * (API level 26) or higher, the value of {@code ANDROID_ID} changes
5378          * if the app is uninstalled and then reinstalled after the OTA.
5379          * To preserve values across uninstalls after an OTA to Android 8.0
5380          * or higher, developers can use
5381          * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html">
5382          * Key/Value Backup</a>.</p>
5383          *
5384          * <p>In versions of the platform lower than Android 8.0 (API level 26),
5385          * a 64-bit number (expressed as a hexadecimal string) that is randomly
5386          * generated when the user first sets up the device and should remain
5387          * constant for the lifetime of the user's device.
5388          *
5389          * On devices that have
5390          * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">
5391          * multiple users</a>, each user appears as a
5392          * completely separate device, so the {@code ANDROID_ID} value is
5393          * unique to each user.</p>
5394          *
5395          * <p class="note"><strong>Note:</strong> If the caller is an Instant App the ID is scoped
5396          * to the Instant App, it is generated when the Instant App is first installed and reset if
5397          * the user clears the Instant App.
5398          */
5399         public static final String ANDROID_ID = "android_id";
5400 
5401         /**
5402          * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
5403          */
5404         @Deprecated
5405         public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
5406 
5407         private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR;
5408 
5409         /**
5410          * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
5411          */
5412         @Deprecated
5413         public static final String DATA_ROAMING = Global.DATA_ROAMING;
5414 
5415         /**
5416          * Setting to record the input method used by default, holding the ID
5417          * of the desired method.
5418          */
5419         public static final String DEFAULT_INPUT_METHOD = "default_input_method";
5420 
5421         /**
5422          * Setting to record the input method subtype used by default, holding the ID
5423          * of the desired method.
5424          */
5425         public static final String SELECTED_INPUT_METHOD_SUBTYPE =
5426                 "selected_input_method_subtype";
5427 
5428         /**
5429          * Setting to record the history of input method subtype, holding the pair of ID of IME
5430          * and its last used subtype.
5431          * @hide
5432          */
5433         public static final String INPUT_METHODS_SUBTYPE_HISTORY =
5434                 "input_methods_subtype_history";
5435 
5436         /**
5437          * Setting to record the visibility of input method selector
5438          */
5439         public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
5440                 "input_method_selector_visibility";
5441 
5442         /**
5443          * The currently selected voice interaction service flattened ComponentName.
5444          * @hide
5445          */
5446         @TestApi
5447         public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
5448 
5449         /**
5450          * The currently selected autofill service flattened ComponentName.
5451          * @hide
5452          */
5453         @TestApi
5454         public static final String AUTOFILL_SERVICE = "autofill_service";
5455 
5456         private static final Validator AUTOFILL_SERVICE_VALIDATOR =
5457                 NULLABLE_COMPONENT_NAME_VALIDATOR;
5458 
5459         /**
5460          * Boolean indicating if Autofill supports field classification.
5461          *
5462          * @see android.service.autofill.AutofillService
5463          *
5464          * @hide
5465          */
5466         @SystemApi
5467         @TestApi
5468         public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION =
5469                 "autofill_field_classification";
5470 
5471         /**
5472          * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}.
5473          *
5474          * @hide
5475          */
5476         @SystemApi
5477         @TestApi
5478         public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE =
5479                 "autofill_user_data_max_user_data_size";
5480 
5481         /**
5482          * Defines value returned by
5483          * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}.
5484          *
5485          * @hide
5486          */
5487         @SystemApi
5488         @TestApi
5489         public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE =
5490                 "autofill_user_data_max_field_classification_size";
5491 
5492         /**
5493          * Defines value returned by
5494          * {@link android.service.autofill.UserData#getMaxCategoryCount()}.
5495          *
5496          * @hide
5497          */
5498         @SystemApi
5499         @TestApi
5500         public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT =
5501                 "autofill_user_data_max_category_count";
5502 
5503         /**
5504          * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}.
5505          *
5506          * @hide
5507          */
5508         @SystemApi
5509         @TestApi
5510         public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH =
5511                 "autofill_user_data_max_value_length";
5512 
5513         /**
5514          * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}.
5515          *
5516          * @hide
5517          */
5518         @SystemApi
5519         @TestApi
5520         public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH =
5521                 "autofill_user_data_min_value_length";
5522 
5523         /**
5524          * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
5525          */
5526         @Deprecated
5527         public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
5528 
5529         /**
5530          * Indicates whether a DPC has been downloaded during provisioning.
5531          *
5532          * <p>Type: int (0 for false, 1 for true)
5533          *
5534          * <p>If this is true, then any attempts to begin setup again should result in factory reset
5535          *
5536          * @hide
5537          */
5538         public static final String MANAGED_PROVISIONING_DPC_DOWNLOADED =
5539                 "managed_provisioning_dpc_downloaded";
5540 
5541         /**
5542          * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
5543          * @hide
5544          */
5545         @TestApi
5546         public static final String USER_SETUP_COMPLETE = "user_setup_complete";
5547 
5548         /**
5549          * The current state of device personalization.
5550          *
5551          * @hide
5552          * @see UserSetupPersonalization
5553          */
5554         public static final String USER_SETUP_PERSONALIZATION_STATE =
5555                 "user_setup_personalization_state";
5556 
5557         /**
5558          * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
5559          * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0
5560          * in case SetupWizard has been re-enabled on TV devices.
5561          *
5562          * @hide
5563          */
5564         public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete";
5565 
5566         /**
5567          * Prefix for category name that marks whether a suggested action from that category was
5568          * completed.
5569          * @hide
5570          */
5571         public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
5572 
5573         /**
5574          * List of input methods that are currently enabled.  This is a string
5575          * containing the IDs of all enabled input methods, each ID separated
5576          * by ':'.
5577          *
5578          * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0"
5579          * where imeId is ComponentName and subtype is int32.
5580          */
5581         public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
5582 
5583         /**
5584          * List of system input methods that are currently disabled.  This is a string
5585          * containing the IDs of all disabled input methods, each ID separated
5586          * by ':'.
5587          * @hide
5588          */
5589         public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
5590 
5591         /**
5592          * Whether to show the IME when a hard keyboard is connected. This is a boolean that
5593          * determines if the IME should be shown when a hard keyboard is attached.
5594          * @hide
5595          */
5596         public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
5597 
5598         private static final Validator SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR = BOOLEAN_VALIDATOR;
5599 
5600         /**
5601          * Host name and port for global http proxy. Uses ':' seperator for
5602          * between host and port.
5603          *
5604          * @deprecated Use {@link Global#HTTP_PROXY}
5605          */
5606         @Deprecated
5607         public static final String HTTP_PROXY = Global.HTTP_PROXY;
5608 
5609         /**
5610          * Package designated as always-on VPN provider.
5611          *
5612          * @hide
5613          */
5614         public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app";
5615 
5616         /**
5617          * Whether to block networking outside of VPN connections while always-on is set.
5618          * @see #ALWAYS_ON_VPN_APP
5619          *
5620          * @hide
5621          */
5622         public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown";
5623 
5624         /**
5625          * Whether applications can be installed for this user via the system's
5626          * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
5627          *
5628          * <p>1 = permit app installation via the system package installer intent
5629          * <p>0 = do not allow use of the package installer
5630          * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use
5631          * {@link PackageManager#canRequestPackageInstalls()}
5632          * @see PackageManager#canRequestPackageInstalls()
5633          */
5634         public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
5635 
5636         /**
5637          * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that
5638          * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it
5639          * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES}
5640          * on behalf of the profile owner if needed to make the change transparent for profile
5641          * owners.
5642          *
5643          * @hide
5644          */
5645         public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED =
5646                 "unknown_sources_default_reversed";
5647 
5648         /**
5649          * Comma-separated list of location providers that activities may access. Do not rely on
5650          * this value being present in settings.db or on ContentObserver notifications on the
5651          * corresponding Uri.
5652          *
5653          * @deprecated use {@link #LOCATION_MODE} and
5654          * {@link LocationManager#MODE_CHANGED_ACTION} (or
5655          * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
5656          */
5657         @Deprecated
5658         public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
5659 
5660         /**
5661          * The degree of location access enabled by the user.
5662          * <p>
5663          * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
5664          * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
5665          * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
5666          * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
5667          * modes that might be added in the future.
5668          * <p>
5669          * Note: do not rely on this value being present in settings.db or on ContentObserver
5670          * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
5671          * to receive changes in this value.
5672          *
5673          * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To
5674          *             get the status of a location provider, use
5675          *             {@link LocationManager#isProviderEnabled(String)}.
5676          */
5677         @Deprecated
5678         public static final String LOCATION_MODE = "location_mode";
5679 
5680         /**
5681          * The App or module that changes the location mode.
5682          * @hide
5683          */
5684         public static final String LOCATION_CHANGER = "location_changer";
5685         /**
5686          * The location changer is unknown or unable to detect.
5687          * @hide
5688          */
5689         public static final int LOCATION_CHANGER_UNKNOWN = 0;
5690         /**
5691          * Location settings in system settings.
5692          * @hide
5693          */
5694         public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1;
5695         /**
5696          * The location icon in drop down notification drawer.
5697          * @hide
5698          */
5699         public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2;
5700 
5701         /**
5702          * Location access disabled.
5703          *
5704          * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To
5705          *             get the status of a location provider, use
5706          *             {@link LocationManager#isProviderEnabled(String)}.
5707          */
5708         @Deprecated
5709         public static final int LOCATION_MODE_OFF = 0;
5710 
5711         /**
5712          * Network Location Provider disabled, but GPS and other sensors enabled.
5713          *
5714          * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To
5715          *             get the status of a location provider, use
5716          *             {@link LocationManager#isProviderEnabled(String)}.
5717          */
5718         @Deprecated
5719         public static final int LOCATION_MODE_SENSORS_ONLY = 1;
5720 
5721         /**
5722          * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
5723          * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
5724          * {@link android.location.Criteria#POWER_MEDIUM}.
5725          *
5726          * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To
5727          *             get the status of a location provider, use
5728          *             {@link LocationManager#isProviderEnabled(String)}.
5729          */
5730         @Deprecated
5731         public static final int LOCATION_MODE_BATTERY_SAVING = 2;
5732 
5733         /**
5734          * Best-effort location computation allowed.
5735          *
5736          * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To
5737          *             get the status of a location provider, use
5738          *             {@link LocationManager#isProviderEnabled(String)}.
5739          */
5740         @Deprecated
5741         public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
5742 
5743         /**
5744          * A flag containing settings used for biometric weak
5745          * @hide
5746          */
5747         @Deprecated
5748         public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
5749                 "lock_biometric_weak_flags";
5750 
5751         /**
5752          * Whether lock-to-app will lock the keyguard when exiting.
5753          * @hide
5754          */
5755         public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
5756 
5757         /**
5758          * Whether autolock is enabled (0 = false, 1 = true)
5759          *
5760          * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
5761          *             level of the keyguard. Accessing this setting from an app that is targeting
5762          *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
5763          */
5764         @Deprecated
5765         public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
5766 
5767         /**
5768          * Whether lock pattern is visible as user enters (0 = false, 1 = true)
5769          *
5770          * @deprecated Accessing this setting from an app that is targeting
5771          *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
5772          */
5773         @Deprecated
5774         public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
5775 
5776         /**
5777          * Whether lock pattern will vibrate as user enters (0 = false, 1 =
5778          * true)
5779          *
5780          * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
5781          *             lockscreen uses
5782          *             {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
5783          *             Accessing this setting from an app that is targeting
5784          *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
5785          */
5786         @Deprecated
5787         public static final String
5788                 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
5789 
5790         /**
5791          * This preference allows the device to be locked given time after screen goes off,
5792          * subject to current DeviceAdmin policy limits.
5793          * @hide
5794          */
5795         public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
5796 
5797 
5798         /**
5799          * This preference contains the string that shows for owner info on LockScreen.
5800          * @hide
5801          * @deprecated
5802          */
5803         @Deprecated
5804         public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
5805 
5806         /**
5807          * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
5808          * @hide
5809          */
5810         @Deprecated
5811         public static final String LOCK_SCREEN_APPWIDGET_IDS =
5812             "lock_screen_appwidget_ids";
5813 
5814         /**
5815          * Id of the appwidget shown on the lock screen when appwidgets are disabled.
5816          * @hide
5817          */
5818         @Deprecated
5819         public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
5820             "lock_screen_fallback_appwidget_id";
5821 
5822         /**
5823          * Index of the lockscreen appwidget to restore, -1 if none.
5824          * @hide
5825          */
5826         @Deprecated
5827         public static final String LOCK_SCREEN_STICKY_APPWIDGET =
5828             "lock_screen_sticky_appwidget";
5829 
5830         /**
5831          * This preference enables showing the owner info on LockScreen.
5832          * @hide
5833          * @deprecated
5834          */
5835         @Deprecated
5836         public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
5837             "lock_screen_owner_info_enabled";
5838 
5839         /**
5840          * When set by a user, allows notifications to be shown atop a securely locked screen
5841          * in their full "private" form (same as when the device is unlocked).
5842          * @hide
5843          */
5844         public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
5845                 "lock_screen_allow_private_notifications";
5846 
5847         /**
5848          * When set by a user, allows notification remote input atop a securely locked screen
5849          * without having to unlock
5850          * @hide
5851          */
5852         public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT =
5853                 "lock_screen_allow_remote_input";
5854 
5855         /**
5856          * Set by the system to track if the user needs to see the call to action for
5857          * the lockscreen notification policy.
5858          * @hide
5859          */
5860         public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
5861                 "show_note_about_notification_hiding";
5862 
5863         /**
5864          * Set to 1 by the system after trust agents have been initialized.
5865          * @hide
5866          */
5867         public static final String TRUST_AGENTS_INITIALIZED =
5868                 "trust_agents_initialized";
5869 
5870         /**
5871          * The Logging ID (a unique 64-bit value) as a hex string.
5872          * Used as a pseudonymous identifier for logging.
5873          * @deprecated This identifier is poorly initialized and has
5874          * many collisions.  It should not be used.
5875          */
5876         @Deprecated
5877         public static final String LOGGING_ID = "logging_id";
5878 
5879         /**
5880          * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
5881          */
5882         @Deprecated
5883         public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
5884 
5885         /**
5886          * No longer supported.
5887          */
5888         public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
5889 
5890         /**
5891          * No longer supported.
5892          */
5893         public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
5894 
5895         /**
5896          * No longer supported.
5897          */
5898         public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
5899 
5900         /**
5901          * Settings classname to launch when Settings is clicked from All
5902          * Applications.  Needed because of user testing between the old
5903          * and new Settings apps.
5904          */
5905         // TODO: 881807
5906         public static final String SETTINGS_CLASSNAME = "settings_classname";
5907 
5908         /**
5909          * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
5910          */
5911         @Deprecated
5912         public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
5913 
5914         private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
5915 
5916         /**
5917          * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
5918          */
5919         @Deprecated
5920         public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
5921 
5922         /**
5923          * If accessibility is enabled.
5924          */
5925         public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
5926 
5927         private static final Validator ACCESSIBILITY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
5928 
5929         /**
5930          * Setting specifying if the accessibility shortcut is enabled.
5931          * @hide
5932          */
5933         public static final String ACCESSIBILITY_SHORTCUT_ENABLED =
5934                 "accessibility_shortcut_enabled";
5935 
5936         private static final Validator ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
5937 
5938         /**
5939          * Setting specifying if the accessibility shortcut is enabled.
5940          * @hide
5941          */
5942         public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN =
5943                 "accessibility_shortcut_on_lock_screen";
5944 
5945         private static final Validator ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR =
5946                 BOOLEAN_VALIDATOR;
5947 
5948         /**
5949          * Setting specifying if the accessibility shortcut dialog has been shown to this user.
5950          * @hide
5951          */
5952         public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN =
5953                 "accessibility_shortcut_dialog_shown";
5954 
5955         private static final Validator ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR =
5956                 BOOLEAN_VALIDATOR;
5957 
5958         /**
5959          * Setting specifying the accessibility service to be toggled via the accessibility
5960          * shortcut. Must be its flattened {@link ComponentName}.
5961          * @hide
5962          */
5963         public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE =
5964                 "accessibility_shortcut_target_service";
5965 
5966         private static final Validator ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR =
5967                 NULLABLE_COMPONENT_NAME_VALIDATOR;
5968 
5969         /**
5970          * Setting specifying the accessibility service or feature to be toggled via the
5971          * accessibility button in the navigation bar. This is either a flattened
5972          * {@link ComponentName} or the class name of a system class implementing a supported
5973          * accessibility feature.
5974          * @hide
5975          */
5976         public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT =
5977                 "accessibility_button_target_component";
5978 
5979         private static final Validator ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR =
5980                 new Validator() {
5981                     @Override
5982                     public boolean validate(@Nullable String value) {
5983                         // technically either ComponentName or class name, but there's proper value
5984                         // validation at callsites, so allow any non-null string
5985                         return value != null;
5986                     }
5987                 };
5988 
5989         /**
5990          * If touch exploration is enabled.
5991          */
5992         public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
5993 
5994         private static final Validator TOUCH_EXPLORATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
5995 
5996         /**
5997          * List of the enabled accessibility providers.
5998          */
5999         public static final String ENABLED_ACCESSIBILITY_SERVICES =
6000             "enabled_accessibility_services";
6001 
6002         private static final Validator ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR =
6003                 new SettingsValidators.ComponentNameListValidator(":");
6004 
6005         /**
6006          * List of the accessibility services to which the user has granted
6007          * permission to put the device into touch exploration mode.
6008          *
6009          * @hide
6010          */
6011         public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
6012             "touch_exploration_granted_accessibility_services";
6013 
6014         private static final Validator TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR =
6015                 new SettingsValidators.ComponentNameListValidator(":");
6016 
6017         /**
6018          * Whether the hush gesture has ever been used // TODO: beverlyt
6019          * @hide
6020          */
6021         public static final String HUSH_GESTURE_USED = "hush_gesture_used";
6022 
6023         private static final Validator HUSH_GESTURE_USED_VALIDATOR = BOOLEAN_VALIDATOR;
6024 
6025         /**
6026          * Number of times the user has manually clicked the ringer toggle
6027          * @hide
6028          */
6029         public static final String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count";
6030 
6031         private static final Validator MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR =
6032                 NON_NEGATIVE_INTEGER_VALIDATOR;
6033 
6034         /**
6035          * Uri of the slice that's presented on the keyguard.
6036          * Defaults to a slice with the date and next alarm.
6037          *
6038          * @hide
6039          */
6040         public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri";
6041 
6042         /**
6043          * Whether to speak passwords while in accessibility mode.
6044          *
6045          * @deprecated The speaking of passwords is controlled by individual accessibility services.
6046          * Apps should ignore this setting and provide complete information to accessibility
6047          * at all times, which was the behavior when this value was {@code true}.
6048          */
6049         @Deprecated
6050         public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
6051 
6052         private static final Validator ACCESSIBILITY_SPEAK_PASSWORD_VALIDATOR = BOOLEAN_VALIDATOR;
6053 
6054         /**
6055          * Whether to draw text with high contrast while in accessibility mode.
6056          *
6057          * @hide
6058          */
6059         public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
6060                 "high_text_contrast_enabled";
6061 
6062         private static final Validator ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR =
6063                 BOOLEAN_VALIDATOR;
6064 
6065         /**
6066          * Setting that specifies whether the display magnification is enabled via a system-wide
6067          * triple tap gesture. Display magnifications allows the user to zoom in the display content
6068          * and is targeted to low vision users. The current magnification scale is controlled by
6069          * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
6070          *
6071          * @hide
6072          */
6073         @TestApi
6074         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
6075                 "accessibility_display_magnification_enabled";
6076 
6077         private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR =
6078                 BOOLEAN_VALIDATOR;
6079 
6080         /**
6081          * Setting that specifies whether the display magnification is enabled via a shortcut
6082          * affordance within the system's navigation area. Display magnifications allows the user to
6083          * zoom in the display content and is targeted to low vision users. The current
6084          * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
6085          *
6086          * @hide
6087          */
6088         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED =
6089                 "accessibility_display_magnification_navbar_enabled";
6090 
6091         private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR
6092                 = BOOLEAN_VALIDATOR;
6093 
6094         /**
6095          * Setting that specifies what the display magnification scale is.
6096          * Display magnifications allows the user to zoom in the display
6097          * content and is targeted to low vision users. Whether a display
6098          * magnification is performed is controlled by
6099          * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and
6100          * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED}
6101          *
6102          * @hide
6103          */
6104         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
6105                 "accessibility_display_magnification_scale";
6106 
6107         private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR =
6108                 new SettingsValidators.InclusiveFloatRangeValidator(1.0f, Float.MAX_VALUE);
6109 
6110         /**
6111          * Unused mangnification setting
6112          *
6113          * @hide
6114          * @deprecated
6115          */
6116         @Deprecated
6117         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
6118                 "accessibility_display_magnification_auto_update";
6119 
6120         /**
6121          * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be
6122          * modified from an AccessibilityService using the SoftKeyboardController.
6123          *
6124          * @hide
6125          */
6126         public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE =
6127                 "accessibility_soft_keyboard_mode";
6128 
6129         /**
6130          * Default soft keyboard behavior.
6131          *
6132          * @hide
6133          */
6134         public static final int SHOW_MODE_AUTO = 0;
6135 
6136         /**
6137          * Soft keyboard is never shown.
6138          *
6139          * @hide
6140          */
6141         public static final int SHOW_MODE_HIDDEN = 1;
6142 
6143         /**
6144          * Setting that specifies whether timed text (captions) should be
6145          * displayed in video content. Text display properties are controlled by
6146          * the following settings:
6147          * <ul>
6148          * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
6149          * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
6150          * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
6151          * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
6152          * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
6153          * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
6154          * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
6155          * </ul>
6156          *
6157          * @hide
6158          */
6159         public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
6160                 "accessibility_captioning_enabled";
6161 
6162         private static final Validator ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR =
6163                 BOOLEAN_VALIDATOR;
6164 
6165         /**
6166          * Setting that specifies the language for captions as a locale string,
6167          * e.g. en_US.
6168          *
6169          * @see java.util.Locale#toString
6170          * @hide
6171          */
6172         public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
6173                 "accessibility_captioning_locale";
6174 
6175         private static final Validator ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR = LOCALE_VALIDATOR;
6176 
6177         /**
6178          * Integer property that specifies the preset style for captions, one
6179          * of:
6180          * <ul>
6181          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
6182          * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
6183          * </ul>
6184          *
6185          * @see java.util.Locale#toString
6186          * @hide
6187          */
6188         public static final String ACCESSIBILITY_CAPTIONING_PRESET =
6189                 "accessibility_captioning_preset";
6190 
6191         private static final Validator ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR =
6192                 new SettingsValidators.DiscreteValueValidator(new String[]{"-1", "0", "1", "2",
6193                         "3", "4"});
6194 
6195         /**
6196          * Integer property that specifes the background color for captions as a
6197          * packed 32-bit color.
6198          *
6199          * @see android.graphics.Color#argb
6200          * @hide
6201          */
6202         public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
6203                 "accessibility_captioning_background_color";
6204 
6205         private static final Validator ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR =
6206                 ANY_INTEGER_VALIDATOR;
6207 
6208         /**
6209          * Integer property that specifes the foreground color for captions as a
6210          * packed 32-bit color.
6211          *
6212          * @see android.graphics.Color#argb
6213          * @hide
6214          */
6215         public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
6216                 "accessibility_captioning_foreground_color";
6217 
6218         private static final Validator ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR =
6219                 ANY_INTEGER_VALIDATOR;
6220 
6221         /**
6222          * Integer property that specifes the edge type for captions, one of:
6223          * <ul>
6224          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
6225          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
6226          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
6227          * </ul>
6228          *
6229          * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
6230          * @hide
6231          */
6232         public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
6233                 "accessibility_captioning_edge_type";
6234 
6235         private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR =
6236                 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2"});
6237 
6238         /**
6239          * Integer property that specifes the edge color for captions as a
6240          * packed 32-bit color.
6241          *
6242          * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
6243          * @see android.graphics.Color#argb
6244          * @hide
6245          */
6246         public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
6247                 "accessibility_captioning_edge_color";
6248 
6249         private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR =
6250                 ANY_INTEGER_VALIDATOR;
6251 
6252         /**
6253          * Integer property that specifes the window color for captions as a
6254          * packed 32-bit color.
6255          *
6256          * @see android.graphics.Color#argb
6257          * @hide
6258          */
6259         public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
6260                 "accessibility_captioning_window_color";
6261 
6262         private static final Validator ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR =
6263                 ANY_INTEGER_VALIDATOR;
6264 
6265         /**
6266          * String property that specifies the typeface for captions, one of:
6267          * <ul>
6268          * <li>DEFAULT
6269          * <li>MONOSPACE
6270          * <li>SANS_SERIF
6271          * <li>SERIF
6272          * </ul>
6273          *
6274          * @see android.graphics.Typeface
6275          * @hide
6276          */
6277         public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
6278                 "accessibility_captioning_typeface";
6279 
6280         private static final Validator ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR =
6281                 new SettingsValidators.DiscreteValueValidator(new String[]{"DEFAULT",
6282                         "MONOSPACE", "SANS_SERIF", "SERIF"});
6283 
6284         /**
6285          * Floating point property that specifies font scaling for captions.
6286          *
6287          * @hide
6288          */
6289         public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
6290                 "accessibility_captioning_font_scale";
6291 
6292         private static final Validator ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR =
6293                 new SettingsValidators.InclusiveFloatRangeValidator(0.5f, 2.0f);
6294 
6295         /**
6296          * Setting that specifies whether display color inversion is enabled.
6297          */
6298         public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
6299                 "accessibility_display_inversion_enabled";
6300 
6301         private static final Validator ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR =
6302                 BOOLEAN_VALIDATOR;
6303 
6304         /**
6305          * Setting that specifies whether display color space adjustment is
6306          * enabled.
6307          *
6308          * @hide
6309          */
6310         public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
6311                 "accessibility_display_daltonizer_enabled";
6312 
6313         private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR =
6314                 BOOLEAN_VALIDATOR;
6315 
6316         /**
6317          * Integer property that specifies the type of color space adjustment to
6318          * perform. Valid values are defined in AccessibilityManager and Settings arrays.xml:
6319          * - AccessibilityManager.DALTONIZER_DISABLED = -1
6320          * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0
6321          * - <item>@string/daltonizer_mode_protanomaly</item> = 11
6322          * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY and
6323          *       <item>@string/daltonizer_mode_deuteranomaly</item> = 12
6324          * - <item>@string/daltonizer_mode_tritanomaly</item> = 13
6325          *
6326          * @hide
6327          */
6328         public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
6329                 "accessibility_display_daltonizer";
6330 
6331         private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR =
6332                 new SettingsValidators.DiscreteValueValidator(
6333                         new String[] {"-1", "0", "11", "12", "13"});
6334 
6335         /**
6336          * Setting that specifies whether automatic click when the mouse pointer stops moving is
6337          * enabled.
6338          *
6339          * @hide
6340          */
6341         public static final String ACCESSIBILITY_AUTOCLICK_ENABLED =
6342                 "accessibility_autoclick_enabled";
6343 
6344         private static final Validator ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR =
6345                 BOOLEAN_VALIDATOR;
6346 
6347         /**
6348          * Integer setting specifying amount of time in ms the mouse pointer has to stay still
6349          * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set.
6350          *
6351          * @see #ACCESSIBILITY_AUTOCLICK_ENABLED
6352          * @hide
6353          */
6354         public static final String ACCESSIBILITY_AUTOCLICK_DELAY =
6355                 "accessibility_autoclick_delay";
6356 
6357         private static final Validator ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR =
6358                 NON_NEGATIVE_INTEGER_VALIDATOR;
6359 
6360         /**
6361          * Whether or not larger size icons are used for the pointer of mouse/trackpad for
6362          * accessibility.
6363          * (0 = false, 1 = true)
6364          * @hide
6365          */
6366         public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
6367                 "accessibility_large_pointer_icon";
6368 
6369         private static final Validator ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR =
6370                 BOOLEAN_VALIDATOR;
6371 
6372         /**
6373          * The timeout for considering a press to be a long press in milliseconds.
6374          * @hide
6375          */
6376         public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
6377 
6378         private static final Validator LONG_PRESS_TIMEOUT_VALIDATOR =
6379                 NON_NEGATIVE_INTEGER_VALIDATOR;
6380 
6381         /**
6382          * The duration in milliseconds between the first tap's up event and the second tap's
6383          * down event for an interaction to be considered part of the same multi-press.
6384          * @hide
6385          */
6386         public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout";
6387 
6388         /**
6389          * List of the enabled print services.
6390          *
6391          * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade
6392          * from pre-N.
6393          *
6394          * @hide
6395          */
6396         public static final String ENABLED_PRINT_SERVICES =
6397             "enabled_print_services";
6398 
6399         /**
6400          * List of the disabled print services.
6401          *
6402          * @hide
6403          */
6404         @TestApi
6405         public static final String DISABLED_PRINT_SERVICES =
6406             "disabled_print_services";
6407 
6408         /**
6409          * The saved value for WindowManagerService.setForcedDisplayDensity()
6410          * formatted as a single integer representing DPI. If unset, then use
6411          * the real display density.
6412          *
6413          * @hide
6414          */
6415         public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
6416 
6417         /**
6418          * Setting to always use the default text-to-speech settings regardless
6419          * of the application settings.
6420          * 1 = override application settings,
6421          * 0 = use application settings (if specified).
6422          *
6423          * @deprecated  The value of this setting is no longer respected by
6424          * the framework text to speech APIs as of the Ice Cream Sandwich release.
6425          */
6426         @Deprecated
6427         public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
6428 
6429         /**
6430          * Default text-to-speech engine speech rate. 100 = 1x
6431          */
6432         public static final String TTS_DEFAULT_RATE = "tts_default_rate";
6433 
6434         private static final Validator TTS_DEFAULT_RATE_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR;
6435 
6436         /**
6437          * Default text-to-speech engine pitch. 100 = 1x
6438          */
6439         public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
6440 
6441         private static final Validator TTS_DEFAULT_PITCH_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR;
6442 
6443         /**
6444          * Default text-to-speech engine.
6445          */
6446         public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
6447 
6448         private static final Validator TTS_DEFAULT_SYNTH_VALIDATOR = PACKAGE_NAME_VALIDATOR;
6449 
6450         /**
6451          * Default text-to-speech language.
6452          *
6453          * @deprecated this setting is no longer in use, as of the Ice Cream
6454          * Sandwich release. Apps should never need to read this setting directly,
6455          * instead can query the TextToSpeech framework classes for the default
6456          * locale. {@link TextToSpeech#getLanguage()}.
6457          */
6458         @Deprecated
6459         public static final String TTS_DEFAULT_LANG = "tts_default_lang";
6460 
6461         /**
6462          * Default text-to-speech country.
6463          *
6464          * @deprecated this setting is no longer in use, as of the Ice Cream
6465          * Sandwich release. Apps should never need to read this setting directly,
6466          * instead can query the TextToSpeech framework classes for the default
6467          * locale. {@link TextToSpeech#getLanguage()}.
6468          */
6469         @Deprecated
6470         public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
6471 
6472         /**
6473          * Default text-to-speech locale variant.
6474          *
6475          * @deprecated this setting is no longer in use, as of the Ice Cream
6476          * Sandwich release. Apps should never need to read this setting directly,
6477          * instead can query the TextToSpeech framework classes for the
6478          * locale that is in use {@link TextToSpeech#getLanguage()}.
6479          */
6480         @Deprecated
6481         public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
6482 
6483         /**
6484          * Stores the default tts locales on a per engine basis. Stored as
6485          * a comma seperated list of values, each value being of the form
6486          * {@code engine_name:locale} for example,
6487          * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
6488          * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
6489          * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
6490          * setting directly, and can query the TextToSpeech framework classes
6491          * for the locale that is in use.
6492          *
6493          * @hide
6494          */
6495         public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
6496 
6497         private static final Validator TTS_DEFAULT_LOCALE_VALIDATOR = new Validator() {
6498             @Override
6499             public boolean validate(@Nullable String value) {
6500                 if (value == null || value.length() == 0) {
6501                     return false;
6502                 }
6503                 String[] ttsLocales = value.split(",");
6504                 boolean valid = true;
6505                 for (String ttsLocale : ttsLocales) {
6506                     String[] parts = ttsLocale.split(":");
6507                     valid |= ((parts.length == 2)
6508                             && (parts[0].length() > 0)
6509                             && ANY_STRING_VALIDATOR.validate(parts[0])
6510                             && LOCALE_VALIDATOR.validate(parts[1]));
6511                 }
6512                 return valid;
6513             }
6514         };
6515 
6516         /**
6517          * Space delimited list of plugin packages that are enabled.
6518          */
6519         public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
6520 
6521         private static final Validator TTS_ENABLED_PLUGINS_VALIDATOR =
6522                 new SettingsValidators.PackageNameListValidator(" ");
6523 
6524         /**
6525          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
6526          * instead.
6527          */
6528         @Deprecated
6529         public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6530                 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
6531 
6532         private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
6533                 BOOLEAN_VALIDATOR;
6534 
6535         /**
6536          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
6537          * instead.
6538          */
6539         @Deprecated
6540         public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
6541                 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
6542 
6543         private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR =
6544                 NON_NEGATIVE_INTEGER_VALIDATOR;
6545 
6546         /**
6547          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
6548          * instead.
6549          */
6550         @Deprecated
6551         public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
6552                 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
6553 
6554         private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR =
6555                 NON_NEGATIVE_INTEGER_VALIDATOR;
6556 
6557         /**
6558          * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
6559          * instead.
6560          */
6561         @Deprecated
6562         public static final String WIFI_ON = Global.WIFI_ON;
6563 
6564         /**
6565          * The acceptable packet loss percentage (range 0 - 100) before trying
6566          * another AP on the same network.
6567          * @deprecated This setting is not used.
6568          */
6569         @Deprecated
6570         public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
6571                 "wifi_watchdog_acceptable_packet_loss_percentage";
6572 
6573         /**
6574          * The number of access points required for a network in order for the
6575          * watchdog to monitor it.
6576          * @deprecated This setting is not used.
6577          */
6578         @Deprecated
6579         public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
6580 
6581         /**
6582          * The delay between background checks.
6583          * @deprecated This setting is not used.
6584          */
6585         @Deprecated
6586         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
6587                 "wifi_watchdog_background_check_delay_ms";
6588 
6589         /**
6590          * Whether the Wi-Fi watchdog is enabled for background checking even
6591          * after it thinks the user has connected to a good access point.
6592          * @deprecated This setting is not used.
6593          */
6594         @Deprecated
6595         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
6596                 "wifi_watchdog_background_check_enabled";
6597 
6598         /**
6599          * The timeout for a background ping
6600          * @deprecated This setting is not used.
6601          */
6602         @Deprecated
6603         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
6604                 "wifi_watchdog_background_check_timeout_ms";
6605 
6606         /**
6607          * The number of initial pings to perform that *may* be ignored if they
6608          * fail. Again, if these fail, they will *not* be used in packet loss
6609          * calculation. For example, one network always seemed to time out for
6610          * the first couple pings, so this is set to 3 by default.
6611          * @deprecated This setting is not used.
6612          */
6613         @Deprecated
6614         public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
6615             "wifi_watchdog_initial_ignored_ping_count";
6616 
6617         /**
6618          * The maximum number of access points (per network) to attempt to test.
6619          * If this number is reached, the watchdog will no longer monitor the
6620          * initial connection state for the network. This is a safeguard for
6621          * networks containing multiple APs whose DNS does not respond to pings.
6622          * @deprecated This setting is not used.
6623          */
6624         @Deprecated
6625         public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
6626 
6627         /**
6628          * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
6629          */
6630         @Deprecated
6631         public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
6632 
6633         /**
6634          * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
6635          * @deprecated This setting is not used.
6636          */
6637         @Deprecated
6638         public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
6639 
6640         /**
6641          * The number of pings to test if an access point is a good connection.
6642          * @deprecated This setting is not used.
6643          */
6644         @Deprecated
6645         public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
6646 
6647         /**
6648          * The delay between pings.
6649          * @deprecated This setting is not used.
6650          */
6651         @Deprecated
6652         public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
6653 
6654         /**
6655          * The timeout per ping.
6656          * @deprecated This setting is not used.
6657          */
6658         @Deprecated
6659         public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
6660 
6661         /**
6662          * @deprecated Use
6663          * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
6664          */
6665         @Deprecated
6666         public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
6667 
6668         /**
6669          * @deprecated Use
6670          * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
6671          */
6672         @Deprecated
6673         public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
6674                 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
6675 
6676         /**
6677          * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
6678          * the receivers of the PendingIntent an opportunity to make a new network request before
6679          * the Network satisfying the request is potentially removed.
6680          *
6681          * @hide
6682          */
6683         public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
6684                 "connectivity_release_pending_intent_delay_ms";
6685 
6686         /**
6687          * Whether background data usage is allowed.
6688          *
6689          * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
6690          *             availability of background data depends on several
6691          *             combined factors. When background data is unavailable,
6692          *             {@link ConnectivityManager#getActiveNetworkInfo()} will
6693          *             now appear disconnected.
6694          */
6695         @Deprecated
6696         public static final String BACKGROUND_DATA = "background_data";
6697 
6698         /**
6699          * Origins for which browsers should allow geolocation by default.
6700          * The value is a space-separated list of origins.
6701          */
6702         public static final String ALLOWED_GEOLOCATION_ORIGINS
6703                 = "allowed_geolocation_origins";
6704 
6705         /**
6706          * The preferred TTY mode     0 = TTy Off, CDMA default
6707          *                            1 = TTY Full
6708          *                            2 = TTY HCO
6709          *                            3 = TTY VCO
6710          * @hide
6711          */
6712         public static final String PREFERRED_TTY_MODE =
6713                 "preferred_tty_mode";
6714 
6715         private static final Validator PREFERRED_TTY_MODE_VALIDATOR =
6716                 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2", "3"});
6717 
6718         /**
6719          * Whether the enhanced voice privacy mode is enabled.
6720          * 0 = normal voice privacy
6721          * 1 = enhanced voice privacy
6722          * @hide
6723          */
6724         public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
6725 
6726         private static final Validator ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6727 
6728         /**
6729          * Whether the TTY mode mode is enabled.
6730          * 0 = disabled
6731          * 1 = enabled
6732          * @hide
6733          */
6734         public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
6735 
6736         private static final Validator TTY_MODE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6737 
6738         /**
6739          * User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT
6740          * calls when supported by the device and carrier. Boolean value.
6741          * 0 = OFF
6742          * 1 = ON
6743          */
6744         public static final String RTT_CALLING_MODE = "rtt_calling_mode";
6745 
6746         private static final Validator RTT_CALLING_MODE_VALIDATOR = BOOLEAN_VALIDATOR;
6747 
6748         /**
6749         /**
6750          * Controls whether settings backup is enabled.
6751          * Type: int ( 0 = disabled, 1 = enabled )
6752          * @hide
6753          */
6754         public static final String BACKUP_ENABLED = "backup_enabled";
6755 
6756         /**
6757          * Controls whether application data is automatically restored from backup
6758          * at install time.
6759          * Type: int ( 0 = disabled, 1 = enabled )
6760          * @hide
6761          */
6762         public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
6763 
6764         /**
6765          * Indicates whether settings backup has been fully provisioned.
6766          * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
6767          * @hide
6768          */
6769         public static final String BACKUP_PROVISIONED = "backup_provisioned";
6770 
6771         /**
6772          * Component of the transport to use for backup/restore.
6773          * @hide
6774          */
6775         public static final String BACKUP_TRANSPORT = "backup_transport";
6776 
6777         /**
6778          * Version for which the setup wizard was last shown.  Bumped for
6779          * each release when there is new setup information to show.
6780          * @hide
6781          */
6782         public static final String LAST_SETUP_SHOWN = "last_setup_shown";
6783 
6784         /**
6785          * The interval in milliseconds after which Wi-Fi is considered idle.
6786          * When idle, it is possible for the device to be switched from Wi-Fi to
6787          * the mobile data network.
6788          * @hide
6789          * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
6790          * instead.
6791          */
6792         @Deprecated
6793         public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
6794 
6795         /**
6796          * The global search provider chosen by the user (if multiple global
6797          * search providers are installed). This will be the provider returned
6798          * by {@link SearchManager#getGlobalSearchActivity()} if it's still
6799          * installed. This setting is stored as a flattened component name as
6800          * per {@link ComponentName#flattenToString()}.
6801          *
6802          * @hide
6803          */
6804         public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
6805                 "search_global_search_activity";
6806 
6807         /**
6808          * The number of promoted sources in GlobalSearch.
6809          * @hide
6810          */
6811         public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
6812         /**
6813          * The maximum number of suggestions returned by GlobalSearch.
6814          * @hide
6815          */
6816         public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
6817         /**
6818          * The number of suggestions GlobalSearch will ask each non-web search source for.
6819          * @hide
6820          */
6821         public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
6822         /**
6823          * The number of suggestions the GlobalSearch will ask the web search source for.
6824          * @hide
6825          */
6826         public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
6827                 "search_web_results_override_limit";
6828         /**
6829          * The number of milliseconds that GlobalSearch will wait for suggestions from
6830          * promoted sources before continuing with all other sources.
6831          * @hide
6832          */
6833         public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
6834                 "search_promoted_source_deadline_millis";
6835         /**
6836          * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
6837          * @hide
6838          */
6839         public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
6840         /**
6841          * The maximum number of milliseconds that GlobalSearch shows the previous results
6842          * after receiving a new query.
6843          * @hide
6844          */
6845         public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
6846         /**
6847          * The maximum age of log data used for shortcuts in GlobalSearch.
6848          * @hide
6849          */
6850         public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
6851         /**
6852          * The maximum age of log data used for source ranking in GlobalSearch.
6853          * @hide
6854          */
6855         public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
6856                 "search_max_source_event_age_millis";
6857         /**
6858          * The minimum number of impressions needed to rank a source in GlobalSearch.
6859          * @hide
6860          */
6861         public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
6862                 "search_min_impressions_for_source_ranking";
6863         /**
6864          * The minimum number of clicks needed to rank a source in GlobalSearch.
6865          * @hide
6866          */
6867         public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
6868                 "search_min_clicks_for_source_ranking";
6869         /**
6870          * The maximum number of shortcuts shown by GlobalSearch.
6871          * @hide
6872          */
6873         public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
6874         /**
6875          * The size of the core thread pool for suggestion queries in GlobalSearch.
6876          * @hide
6877          */
6878         public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
6879                 "search_query_thread_core_pool_size";
6880         /**
6881          * The maximum size of the thread pool for suggestion queries in GlobalSearch.
6882          * @hide
6883          */
6884         public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
6885                 "search_query_thread_max_pool_size";
6886         /**
6887          * The size of the core thread pool for shortcut refreshing in GlobalSearch.
6888          * @hide
6889          */
6890         public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
6891                 "search_shortcut_refresh_core_pool_size";
6892         /**
6893          * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
6894          * @hide
6895          */
6896         public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
6897                 "search_shortcut_refresh_max_pool_size";
6898         /**
6899          * The maximun time that excess threads in the GlobalSeach thread pools will
6900          * wait before terminating.
6901          * @hide
6902          */
6903         public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
6904                 "search_thread_keepalive_seconds";
6905         /**
6906          * The maximum number of concurrent suggestion queries to each source.
6907          * @hide
6908          */
6909         public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
6910                 "search_per_source_concurrent_query_limit";
6911 
6912         /**
6913          * Whether or not alert sounds are played on StorageManagerService events.
6914          * (0 = false, 1 = true)
6915          * @hide
6916          */
6917         public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
6918 
6919         private static final Validator MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR = BOOLEAN_VALIDATOR;
6920 
6921         /**
6922          * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
6923          * @hide
6924          */
6925         public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
6926 
6927         private static final Validator MOUNT_UMS_AUTOSTART_VALIDATOR = BOOLEAN_VALIDATOR;
6928 
6929         /**
6930          * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
6931          * @hide
6932          */
6933         public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
6934 
6935         private static final Validator MOUNT_UMS_PROMPT_VALIDATOR = BOOLEAN_VALIDATOR;
6936 
6937         /**
6938          * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
6939          * @hide
6940          */
6941         public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
6942 
6943         private static final Validator MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6944 
6945         /**
6946          * If nonzero, ANRs in invisible background processes bring up a dialog.
6947          * Otherwise, the process will be silently killed.
6948          *
6949          * Also prevents ANRs and crash dialogs from being suppressed.
6950          * @hide
6951          */
6952         public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
6953 
6954         /**
6955          * If nonzero, crashes in foreground processes will bring up a dialog.
6956          * Otherwise, the process will be silently killed.
6957          * @hide
6958          */
6959         public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION =
6960                 "show_first_crash_dialog_dev_option";
6961 
6962         private static final Validator SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR =
6963                 BOOLEAN_VALIDATOR;
6964 
6965         /**
6966          * The {@link ComponentName} string of the service to be used as the voice recognition
6967          * service.
6968          *
6969          * @hide
6970          */
6971         public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
6972 
6973         /**
6974          * Stores whether an user has consented to have apps verified through PAM.
6975          * The value is boolean (1 or 0).
6976          *
6977          * @hide
6978          */
6979         public static final String PACKAGE_VERIFIER_USER_CONSENT =
6980             "package_verifier_user_consent";
6981 
6982         /**
6983          * The {@link ComponentName} string of the selected spell checker service which is
6984          * one of the services managed by the text service manager.
6985          *
6986          * @hide
6987          */
6988         public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
6989 
6990         private static final Validator SELECTED_SPELL_CHECKER_VALIDATOR = COMPONENT_NAME_VALIDATOR;
6991 
6992         /**
6993          * The {@link ComponentName} string of the selected subtype of the selected spell checker
6994          * service which is one of the services managed by the text service manager.
6995          *
6996          * @hide
6997          */
6998         public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
6999                 "selected_spell_checker_subtype";
7000 
7001         private static final Validator SELECTED_SPELL_CHECKER_SUBTYPE_VALIDATOR =
7002                 COMPONENT_NAME_VALIDATOR;
7003 
7004         /**
7005          * Whether spell checker is enabled or not.
7006          *
7007          * @hide
7008          */
7009         public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
7010 
7011         private static final Validator SPELL_CHECKER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7012 
7013         /**
7014          * What happens when the user presses the Power button while in-call
7015          * and the screen is on.<br/>
7016          * <b>Values:</b><br/>
7017          * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
7018          * 2 - The Power button hangs up the current call.<br/>
7019          *
7020          * @hide
7021          */
7022         public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
7023 
7024         private static final Validator INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR =
7025                 new SettingsValidators.DiscreteValueValidator(new String[]{"1", "2"});
7026 
7027         /**
7028          * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
7029          * @hide
7030          */
7031         public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
7032 
7033         /**
7034          * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
7035          * @hide
7036          */
7037         public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
7038 
7039         /**
7040          * INCALL_POWER_BUTTON_BEHAVIOR default value.
7041          * @hide
7042          */
7043         public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
7044                 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
7045 
7046         /**
7047          * What happens when the user presses the Back button while in-call
7048          * and the screen is on.<br/>
7049          * <b>Values:</b><br/>
7050          * 0 - The Back buttons does nothing different.<br/>
7051          * 1 - The Back button hangs up the current call.<br/>
7052          *
7053          * @hide
7054          */
7055         public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior";
7056 
7057         /**
7058          * INCALL_BACK_BUTTON_BEHAVIOR value for no action.
7059          * @hide
7060          */
7061         public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0;
7062 
7063         /**
7064          * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up".
7065          * @hide
7066          */
7067         public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1;
7068 
7069         /**
7070          * INCALL_POWER_BUTTON_BEHAVIOR default value.
7071          * @hide
7072          */
7073         public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT =
7074                 INCALL_BACK_BUTTON_BEHAVIOR_NONE;
7075 
7076         /**
7077          * Whether the device should wake when the wake gesture sensor detects motion.
7078          * @hide
7079          */
7080         public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
7081 
7082         private static final Validator WAKE_GESTURE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7083 
7084         /**
7085          * Whether the device should doze if configured.
7086          * @hide
7087          */
7088         public static final String DOZE_ENABLED = "doze_enabled";
7089 
7090         private static final Validator DOZE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7091 
7092         /**
7093          * Whether doze should be always on.
7094          * @hide
7095          */
7096         public static final String DOZE_ALWAYS_ON = "doze_always_on";
7097 
7098         /**
7099          * Whether the device should pulse on pick up gesture.
7100          * @hide
7101          */
7102         public static final String DOZE_PULSE_ON_PICK_UP = "doze_pulse_on_pick_up";
7103 
7104         private static final Validator DOZE_PULSE_ON_PICK_UP_VALIDATOR = BOOLEAN_VALIDATOR;
7105 
7106         /**
7107          * Whether the device should pulse on long press gesture.
7108          * @hide
7109          */
7110         public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press";
7111 
7112         /**
7113          * Whether the device should pulse on double tap gesture.
7114          * @hide
7115          */
7116         public static final String DOZE_PULSE_ON_DOUBLE_TAP = "doze_pulse_on_double_tap";
7117 
7118         private static final Validator DOZE_PULSE_ON_DOUBLE_TAP_VALIDATOR = BOOLEAN_VALIDATOR;
7119 
7120         /**
7121          * The current night mode that has been selected by the user.  Owned
7122          * and controlled by UiModeManagerService.  Constants are as per
7123          * UiModeManager.
7124          * @hide
7125          */
7126         public static final String UI_NIGHT_MODE = "ui_night_mode";
7127 
7128         /**
7129          * The current device UI theme mode effect SystemUI and Launcher.<br/>
7130          * <b>Values:</b><br/>
7131          * 0 - The mode that theme will controlled by wallpaper color.<br/>
7132          * 1 - The mode that will always light theme.<br/>
7133          * 2 - The mode that will always dark theme.<br/>
7134          *
7135          * @hide
7136          */
7137         public static final String THEME_MODE = "theme_mode";
7138 
7139         /**
7140          * THEME_MODE value for wallpaper mode.
7141          * @hide
7142          */
7143         public static final int THEME_MODE_WALLPAPER = 0;
7144 
7145         /**
7146          * THEME_MODE value for light theme mode.
7147          * @hide
7148          */
7149         public static final int THEME_MODE_LIGHT = 1;
7150 
7151         /**
7152          * THEME_MODE value for dark theme mode.
7153          * @hide
7154          */
7155         public static final int THEME_MODE_DARK = 2;
7156 
7157         /**
7158          * Whether screensavers are enabled.
7159          * @hide
7160          */
7161         public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
7162 
7163         private static final Validator SCREENSAVER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7164 
7165         /**
7166          * The user's chosen screensaver components.
7167          *
7168          * These will be launched by the PhoneWindowManager after a timeout when not on
7169          * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
7170          * @hide
7171          */
7172         public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
7173 
7174         private static final Validator SCREENSAVER_COMPONENTS_VALIDATOR =
7175                 new SettingsValidators.ComponentNameListValidator(",");
7176 
7177         /**
7178          * If screensavers are enabled, whether the screensaver should be automatically launched
7179          * when the device is inserted into a (desk) dock.
7180          * @hide
7181          */
7182         public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
7183 
7184         private static final Validator SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR = BOOLEAN_VALIDATOR;
7185 
7186         /**
7187          * If screensavers are enabled, whether the screensaver should be automatically launched
7188          * when the screen times out when not on battery.
7189          * @hide
7190          */
7191         public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
7192 
7193         private static final Validator SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR = BOOLEAN_VALIDATOR;
7194 
7195         /**
7196          * If screensavers are enabled, the default screensaver component.
7197          * @hide
7198          */
7199         public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
7200 
7201         /**
7202          * The default NFC payment component
7203          * @hide
7204          */
7205         public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
7206 
7207         private static final Validator NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR =
7208                 COMPONENT_NAME_VALIDATOR;
7209 
7210         /**
7211          * Whether NFC payment is handled by the foreground application or a default.
7212          * @hide
7213          */
7214         public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
7215 
7216         /**
7217          * Specifies the package name currently configured to be the primary sms application
7218          * @hide
7219          */
7220         public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
7221 
7222         /**
7223          * Specifies the package name currently configured to be the default dialer application
7224          * @hide
7225          */
7226         public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
7227 
7228         /**
7229          * Specifies the package name currently configured to be the emergency assistance application
7230          *
7231          * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
7232          *
7233          * @hide
7234          */
7235         public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
7236 
7237         /**
7238          * Specifies whether the current app context on scren (assist data) will be sent to the
7239          * assist application (active voice interaction service).
7240          *
7241          * @hide
7242          */
7243         public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
7244 
7245         /**
7246          * Specifies whether a screenshot of the screen contents will be sent to the assist
7247          * application (active voice interaction service).
7248          *
7249          * @hide
7250          */
7251         public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";
7252 
7253         /**
7254          * Specifies whether the screen will show an animation if screen contents are sent to the
7255          * assist application (active voice interaction service).
7256          *
7257          * Note that the disclosure will be forced for third-party assistants or if the device
7258          * does not support disabling it.
7259          *
7260          * @hide
7261          */
7262         public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled";
7263 
7264         /**
7265          * Control if rotation suggestions are sent to System UI when in rotation locked mode.
7266          * Done to enable screen rotation while the the screen rotation is locked. Enabling will
7267          * poll the accelerometer in rotation locked mode.
7268          *
7269          * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent.
7270          *
7271          * @hide
7272          */
7273 
7274         public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions";
7275 
7276         /**
7277          * The disabled state of SHOW_ROTATION_SUGGESTIONS.
7278          * @hide
7279          */
7280         public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0;
7281 
7282         /**
7283          * The enabled state of SHOW_ROTATION_SUGGESTIONS.
7284          * @hide
7285          */
7286         public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1;
7287 
7288         /**
7289          * The default state of SHOW_ROTATION_SUGGESTIONS.
7290          * @hide
7291          */
7292         public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT =
7293                 SHOW_ROTATION_SUGGESTIONS_ENABLED;
7294 
7295         /**
7296          * The number of accepted rotation suggestions. Used to determine if the user has been
7297          * introduced to rotation suggestions.
7298          * @hide
7299          */
7300         public static final String NUM_ROTATION_SUGGESTIONS_ACCEPTED =
7301                 "num_rotation_suggestions_accepted";
7302 
7303         /**
7304          * Read only list of the service components that the current user has explicitly allowed to
7305          * see and assist with all of the user's notifications.
7306          *
7307          * @deprecated Use
7308          * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}.
7309          * @hide
7310          */
7311         @Deprecated
7312         public static final String ENABLED_NOTIFICATION_ASSISTANT =
7313                 "enabled_notification_assistant";
7314 
7315         private static final Validator ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR =
7316                 new SettingsValidators.ComponentNameListValidator(":");
7317 
7318         /**
7319          * Read only list of the service components that the current user has explicitly allowed to
7320          * see all of the user's notifications, separated by ':'.
7321          *
7322          * @hide
7323          * @deprecated Use
7324          * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}.
7325          */
7326         @Deprecated
7327         public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
7328 
7329         private static final Validator ENABLED_NOTIFICATION_LISTENERS_VALIDATOR =
7330                 new SettingsValidators.ComponentNameListValidator(":");
7331 
7332         /**
7333          * Read only list of the packages that the current user has explicitly allowed to
7334          * manage do not disturb, separated by ':'.
7335          *
7336          * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}.
7337          * @hide
7338          */
7339         @Deprecated
7340         @TestApi
7341         public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES =
7342                 "enabled_notification_policy_access_packages";
7343 
7344         private static final Validator ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR =
7345                 new SettingsValidators.PackageNameListValidator(":");
7346 
7347         /**
7348          * Defines whether managed profile ringtones should be synced from it's parent profile
7349          * <p>
7350          * 0 = ringtones are not synced
7351          * 1 = ringtones are synced from the profile's parent (default)
7352          * <p>
7353          * This value is only used for managed profiles.
7354          * @hide
7355          */
7356         @TestApi
7357         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
7358         public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds";
7359 
7360         private static final Validator SYNC_PARENT_SOUNDS_VALIDATOR = BOOLEAN_VALIDATOR;
7361 
7362         /** @hide */
7363         public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
7364 
7365         /**
7366          * This is the query URI for finding a print service to install.
7367          *
7368          * @hide
7369          */
7370         public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
7371 
7372         /**
7373          * This is the query URI for finding a NFC payment service to install.
7374          *
7375          * @hide
7376          */
7377         public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
7378 
7379         /**
7380          * This is the query URI for finding a auto fill service to install.
7381          *
7382          * @hide
7383          */
7384         public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri";
7385 
7386         /**
7387          * If enabled, apps should try to skip any introductory hints on first launch. This might
7388          * apply to users that are already familiar with the environment or temporary users.
7389          * <p>
7390          * Type : int (0 to show hints, 1 to skip showing hints)
7391          */
7392         public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
7393 
7394         /**
7395          * Persisted playback time after a user confirmation of an unsafe volume level.
7396          *
7397          * @hide
7398          */
7399         public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
7400 
7401         /**
7402          * This preference enables notification display on the lockscreen.
7403          * @hide
7404          */
7405         public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
7406                 "lock_screen_show_notifications";
7407 
7408         /**
7409          * List of TV inputs that are currently hidden. This is a string
7410          * containing the IDs of all hidden TV inputs. Each ID is encoded by
7411          * {@link android.net.Uri#encode(String)} and separated by ':'.
7412          * @hide
7413          */
7414         public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
7415 
7416         /**
7417          * List of custom TV input labels. This is a string containing <TV input id, custom name>
7418          * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
7419          * and separated by ','. Each pair is separated by ':'.
7420          * @hide
7421          */
7422         public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
7423 
7424         /**
7425          * Whether automatic routing of system audio to USB audio peripheral is disabled.
7426          * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
7427          * and 0 means automatic routing is enabled.
7428          *
7429          * @hide
7430          */
7431         public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
7432                 "usb_audio_automatic_routing_disabled";
7433 
7434         /**
7435          * The timeout in milliseconds before the device fully goes to sleep after
7436          * a period of inactivity.  This value sets an upper bound on how long the device
7437          * will stay awake or dreaming without user activity.  It should generally
7438          * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
7439          * will sleep before it ever has a chance to dream.
7440          * <p>
7441          * Use -1 to disable this timeout.
7442          * </p>
7443          *
7444          * @hide
7445          */
7446         public static final String SLEEP_TIMEOUT = "sleep_timeout";
7447 
7448         private static final Validator SLEEP_TIMEOUT_VALIDATOR =
7449                 new SettingsValidators.InclusiveIntegerRangeValidator(-1, Integer.MAX_VALUE);
7450 
7451         /**
7452          * Controls whether double tap to wake is enabled.
7453          * @hide
7454          */
7455         public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
7456 
7457         private static final Validator DOUBLE_TAP_TO_WAKE_VALIDATOR = BOOLEAN_VALIDATOR;
7458 
7459         /**
7460          * The current assistant component. It could be a voice interaction service,
7461          * or an activity that handles ACTION_ASSIST, or empty which means using the default
7462          * handling.
7463          *
7464          * @hide
7465          */
7466         public static final String ASSISTANT = "assistant";
7467 
7468         /**
7469          * Whether the camera launch gesture should be disabled.
7470          *
7471          * @hide
7472          */
7473         public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled";
7474 
7475         private static final Validator CAMERA_GESTURE_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7476 
7477         /**
7478          * Whether the camera launch gesture to double tap the power button when the screen is off
7479          * should be disabled.
7480          *
7481          * @hide
7482          */
7483         public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED =
7484                 "camera_double_tap_power_gesture_disabled";
7485 
7486         private static final Validator CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR =
7487                 BOOLEAN_VALIDATOR;
7488 
7489         /**
7490          * Whether the camera double twist gesture to flip between front and back mode should be
7491          * enabled.
7492          *
7493          * @hide
7494          */
7495         public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED =
7496                 "camera_double_twist_to_flip_enabled";
7497 
7498         private static final Validator CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR =
7499                 BOOLEAN_VALIDATOR;
7500 
7501         /**
7502          * Whether the swipe up gesture to switch apps should be enabled.
7503          *
7504          * @hide
7505          */
7506         public static final String SWIPE_UP_TO_SWITCH_APPS_ENABLED =
7507                 "swipe_up_to_switch_apps_enabled";
7508 
7509         private static final Validator SWIPE_UP_TO_SWITCH_APPS_ENABLED_VALIDATOR =
7510                 BOOLEAN_VALIDATOR;
7511 
7512         /**
7513          * Whether or not the smart camera lift trigger that launches the camera when the user moves
7514          * the phone into a position for taking photos should be enabled.
7515          *
7516          * @hide
7517          */
7518         public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled";
7519 
7520         /**
7521          * The default enable state of the camera lift trigger.
7522          *
7523          * @hide
7524          */
7525         public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1;
7526 
7527         /**
7528          * Whether the assist gesture should be enabled.
7529          *
7530          * @hide
7531          */
7532         public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled";
7533 
7534         private static final Validator ASSIST_GESTURE_ENABLED_VALIDATOR =
7535                 BOOLEAN_VALIDATOR;
7536 
7537         /**
7538          * Sensitivity control for the assist gesture.
7539          *
7540          * @hide
7541          */
7542         public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity";
7543 
7544         private static final Validator ASSIST_GESTURE_SENSITIVITY_VALIDATOR =
7545                 new SettingsValidators.InclusiveFloatRangeValidator(0.0f, 1.0f);
7546 
7547         /**
7548          * Whether the assist gesture should silence alerts.
7549          *
7550          * @hide
7551          */
7552         public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED =
7553                 "assist_gesture_silence_alerts_enabled";
7554 
7555         private static final Validator ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR =
7556                 BOOLEAN_VALIDATOR;
7557 
7558         /**
7559          * Whether the assist gesture should wake the phone.
7560          *
7561          * @hide
7562          */
7563         public static final String ASSIST_GESTURE_WAKE_ENABLED =
7564                 "assist_gesture_wake_enabled";
7565 
7566         private static final Validator ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR =
7567                 BOOLEAN_VALIDATOR;
7568 
7569         /**
7570          * Whether Assist Gesture Deferred Setup has been completed
7571          *
7572          * @hide
7573          */
7574         public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
7575 
7576         private static final Validator ASSIST_GESTURE_SETUP_COMPLETE_VALIDATOR = BOOLEAN_VALIDATOR;
7577 
7578         /**
7579          * Control whether Night display is currently activated.
7580          * @hide
7581          */
7582         public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated";
7583 
7584         /**
7585          * Control whether Night display will automatically activate/deactivate.
7586          * @hide
7587          */
7588         public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode";
7589 
7590         private static final Validator NIGHT_DISPLAY_AUTO_MODE_VALIDATOR =
7591                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 2);
7592 
7593         /**
7594          * Control the color temperature of Night Display, represented in Kelvin.
7595          * @hide
7596          */
7597         public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE =
7598                 "night_display_color_temperature";
7599 
7600         private static final Validator NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR =
7601                 NON_NEGATIVE_INTEGER_VALIDATOR;
7602 
7603         /**
7604          * Custom time when Night display is scheduled to activate.
7605          * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
7606          * @hide
7607          */
7608         public static final String NIGHT_DISPLAY_CUSTOM_START_TIME =
7609                 "night_display_custom_start_time";
7610 
7611         private static final Validator NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR =
7612                 NON_NEGATIVE_INTEGER_VALIDATOR;
7613 
7614         /**
7615          * Custom time when Night display is scheduled to deactivate.
7616          * Represented as milliseconds from midnight (e.g. 21600000 == 6am).
7617          * @hide
7618          */
7619         public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time";
7620 
7621         private static final Validator NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR =
7622                 NON_NEGATIVE_INTEGER_VALIDATOR;
7623 
7624         /**
7625          * A String representing the LocalDateTime when Night display was last activated. Use to
7626          * decide whether to apply the current activated state after a reboot or user change. In
7627          * legacy cases, this is represented by the time in milliseconds (since epoch).
7628          * @hide
7629          */
7630         public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME =
7631                 "night_display_last_activated_time";
7632 
7633         /**
7634          * Names of the service components that the current user has explicitly allowed to
7635          * be a VR mode listener, separated by ':'.
7636          *
7637          * @hide
7638          */
7639         public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners";
7640 
7641         private static final Validator ENABLED_VR_LISTENERS_VALIDATOR =
7642                 new SettingsValidators.ComponentNameListValidator(":");
7643 
7644         /**
7645          * Behavior of the display while in VR mode.
7646          *
7647          * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}.
7648          *
7649          * @hide
7650          */
7651         public static final String VR_DISPLAY_MODE = "vr_display_mode";
7652 
7653         private static final Validator VR_DISPLAY_MODE_VALIDATOR =
7654                 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1"});
7655 
7656         /**
7657          * Lower the display persistence while the system is in VR mode.
7658          *
7659          * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
7660          *
7661          * @hide.
7662          */
7663         public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0;
7664 
7665         /**
7666          * Do not alter the display persistence while the system is in VR mode.
7667          *
7668          * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
7669          *
7670          * @hide.
7671          */
7672         public static final int VR_DISPLAY_MODE_OFF = 1;
7673 
7674         /**
7675          * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least
7676          * once.
7677          *
7678          * <p>This is used to ensure that we only take one pass which will disable apps that are not
7679          * privileged (if any). From then on, we only want to enable apps (when a matching SIM is
7680          * inserted), to avoid disabling an app that the user might actively be using.
7681          *
7682          * <p>Will be set to 1 once executed.
7683          *
7684          * @hide
7685          */
7686         public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled";
7687 
7688         /**
7689          * Whether parent user can access remote contact in managed profile.
7690          *
7691          * @hide
7692          */
7693         public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH =
7694                 "managed_profile_contact_remote_search";
7695 
7696         /**
7697          * Whether or not the automatic storage manager is enabled and should run on the device.
7698          *
7699          * @hide
7700          */
7701         public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED =
7702                 "automatic_storage_manager_enabled";
7703 
7704         /**
7705          * How many days of information for the automatic storage manager to retain on the device.
7706          *
7707          * @hide
7708          */
7709         public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN =
7710                 "automatic_storage_manager_days_to_retain";
7711 
7712         private static final Validator AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR =
7713                 NON_NEGATIVE_INTEGER_VALIDATOR;
7714 
7715         /**
7716          * Default number of days of information for the automatic storage manager to retain.
7717          *
7718          * @hide
7719          */
7720         public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90;
7721 
7722         /**
7723          * How many bytes the automatic storage manager has cleared out.
7724          *
7725          * @hide
7726          */
7727         public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED =
7728                 "automatic_storage_manager_bytes_cleared";
7729 
7730 
7731         /**
7732          * Last run time for the automatic storage manager.
7733          *
7734          * @hide
7735          */
7736         public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN =
7737                 "automatic_storage_manager_last_run";
7738 
7739         /**
7740          * If the automatic storage manager has been disabled by policy. Note that this doesn't
7741          * mean that the automatic storage manager is prevented from being re-enabled -- this only
7742          * means that it was turned off by policy at least once.
7743          *
7744          * @hide
7745          */
7746         public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY =
7747                 "automatic_storage_manager_turned_off_by_policy";
7748 
7749         /**
7750          * Whether SystemUI navigation keys is enabled.
7751          * @hide
7752          */
7753         public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
7754                 "system_navigation_keys_enabled";
7755 
7756         private static final Validator SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7757 
7758         /**
7759          * Holds comma separated list of ordering of QS tiles.
7760          * @hide
7761          */
7762         public static final String QS_TILES = "sysui_qs_tiles";
7763 
7764         private static final Validator QS_TILES_VALIDATOR = new Validator() {
7765             @Override
7766             public boolean validate(@Nullable String value) {
7767                 if (value == null) {
7768                     return false;
7769                 }
7770                 String[] tiles = value.split(",");
7771                 boolean valid = true;
7772                 for (String tile : tiles) {
7773                     // tile can be any non-empty string as specified by OEM
7774                     valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile));
7775                 }
7776                 return valid;
7777             }
7778         };
7779 
7780         /**
7781          * Specifies whether the web action API is enabled.
7782          *
7783          * @hide
7784          */
7785         @SystemApi
7786         public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled";
7787 
7788         /**
7789          * Has this pairable device been paired or upgraded from a previously paired system.
7790          * @hide
7791          */
7792         public static final String DEVICE_PAIRED = "device_paired";
7793 
7794         /**
7795          * Integer state indicating whether package verifier is enabled.
7796          * TODO(b/34259924): Remove this setting.
7797          *
7798          * @hide
7799          */
7800         public static final String PACKAGE_VERIFIER_STATE = "package_verifier_state";
7801 
7802         /**
7803          * Specifies additional package name for broadcasting the CMAS messages.
7804          * @hide
7805          */
7806         public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg";
7807 
7808         /**
7809          * Whether the launcher should show any notification badges.
7810          * The value is boolean (1 or 0).
7811          * @hide
7812          */
7813         public static final String NOTIFICATION_BADGING = "notification_badging";
7814 
7815         private static final Validator NOTIFICATION_BADGING_VALIDATOR = BOOLEAN_VALIDATOR;
7816 
7817         /**
7818          * Comma separated list of QS tiles that have been auto-added already.
7819          * @hide
7820          */
7821         public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles";
7822 
7823         private static final Validator QS_AUTO_ADDED_TILES_VALIDATOR = new Validator() {
7824             @Override
7825             public boolean validate(@Nullable String value) {
7826                 if (value == null) {
7827                     return false;
7828                 }
7829                 String[] tiles = value.split(",");
7830                 boolean valid = true;
7831                 for (String tile : tiles) {
7832                     // tile can be any non-empty string as specified by OEM
7833                     valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile));
7834                 }
7835                 return valid;
7836             }
7837         };
7838 
7839         /**
7840          * Whether the Lockdown button should be shown in the power menu.
7841          * @hide
7842          */
7843         public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu";
7844 
7845         private static final Validator LOCKDOWN_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR;
7846 
7847         /**
7848          * Backup manager behavioral parameters.
7849          * This is encoded as a key=value list, separated by commas. Ex:
7850          *
7851          * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true"
7852          *
7853          * The following keys are supported:
7854          *
7855          * <pre>
7856          * key_value_backup_interval_milliseconds  (long)
7857          * key_value_backup_fuzz_milliseconds      (long)
7858          * key_value_backup_require_charging       (boolean)
7859          * key_value_backup_required_network_type  (int)
7860          * full_backup_interval_milliseconds       (long)
7861          * full_backup_require_charging            (boolean)
7862          * full_backup_required_network_type       (int)
7863          * backup_finished_notification_receivers  (String[])
7864          * </pre>
7865          *
7866          * backup_finished_notification_receivers uses ":" as delimeter for values.
7867          *
7868          * <p>
7869          * Type: string
7870          * @hide
7871          */
7872         public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants";
7873 
7874 
7875         /**
7876          * Local transport parameters so we can configure it for tests.
7877          * This is encoded as a key=value list, separated by commas.
7878          *
7879          * The following keys are supported:
7880          *
7881          * <pre>
7882          * fake_encryption_flag  (boolean)
7883          * </pre>
7884          *
7885          * <p>
7886          * Type: string
7887          * @hide
7888          */
7889         public static final String BACKUP_LOCAL_TRANSPORT_PARAMETERS =
7890                 "backup_local_transport_parameters";
7891 
7892         /**
7893          * Flag to set if the system should predictively attempt to re-enable Bluetooth while
7894          * the user is driving.
7895          * @hide
7896          */
7897         public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving";
7898 
7899         /**
7900          * What behavior should be invoked when the volume hush gesture is triggered
7901          * One of VOLUME_HUSH_OFF, VOLUME_HUSH_VIBRATE, VOLUME_HUSH_MUTE.
7902          *
7903          * @hide
7904          */
7905         public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture";
7906 
7907         /** @hide */ public static final int VOLUME_HUSH_OFF = 0;
7908         /** @hide */ public static final int VOLUME_HUSH_VIBRATE = 1;
7909         /** @hide */ public static final int VOLUME_HUSH_MUTE = 2;
7910 
7911         private static final Validator VOLUME_HUSH_GESTURE_VALIDATOR =
7912                 NON_NEGATIVE_INTEGER_VALIDATOR;
7913 
7914         /**
7915          * The number of times (integer) the user has manually enabled battery saver.
7916          * @hide
7917          */
7918         public static final String LOW_POWER_MANUAL_ACTIVATION_COUNT =
7919                 "low_power_manual_activation_count";
7920 
7921         /**
7922          * Whether the "first time battery saver warning" dialog needs to be shown (0: default)
7923          * or not (1).
7924          *
7925          * @hide
7926          */
7927         public static final String LOW_POWER_WARNING_ACKNOWLEDGED =
7928                 "low_power_warning_acknowledged";
7929 
7930         /**
7931          * 0 (default) Auto battery saver suggestion has not been suppressed. 1) it has been
7932          * suppressed.
7933          * @hide
7934          */
7935         public static final String SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION =
7936                 "suppress_auto_battery_saver_suggestion";
7937 
7938         /**
7939          * List of packages, which data need to be unconditionally cleared before full restore.
7940          * Type: string
7941          * @hide
7942          */
7943         public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE =
7944                 "packages_to_clear_data_before_full_restore";
7945 
7946         /**
7947          * This are the settings to be backed up.
7948          *
7949          * NOTE: Settings are backed up and restored in the order they appear
7950          *       in this array. If you have one setting depending on another,
7951          *       make sure that they are ordered appropriately.
7952          *
7953          * @hide
7954          */
7955         public static final String[] SETTINGS_TO_BACKUP = {
7956             BUGREPORT_IN_POWER_MENU,                            // moved to global
7957             ALLOW_MOCK_LOCATION,
7958             USB_MASS_STORAGE_ENABLED,                           // moved to global
7959             ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
7960             ACCESSIBILITY_DISPLAY_DALTONIZER,
7961             ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
7962             ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
7963             ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED,
7964             AUTOFILL_SERVICE,
7965             ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
7966             ENABLED_ACCESSIBILITY_SERVICES,
7967             ENABLED_VR_LISTENERS,
7968             TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
7969             TOUCH_EXPLORATION_ENABLED,
7970             ACCESSIBILITY_ENABLED,
7971             ACCESSIBILITY_SHORTCUT_TARGET_SERVICE,
7972             ACCESSIBILITY_BUTTON_TARGET_COMPONENT,
7973             ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN,
7974             ACCESSIBILITY_SHORTCUT_ENABLED,
7975             ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN,
7976             ACCESSIBILITY_SPEAK_PASSWORD,
7977             ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
7978             ACCESSIBILITY_CAPTIONING_PRESET,
7979             ACCESSIBILITY_CAPTIONING_ENABLED,
7980             ACCESSIBILITY_CAPTIONING_LOCALE,
7981             ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
7982             ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
7983             ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
7984             ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
7985             ACCESSIBILITY_CAPTIONING_TYPEFACE,
7986             ACCESSIBILITY_CAPTIONING_FONT_SCALE,
7987             ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
7988             TTS_DEFAULT_RATE,
7989             TTS_DEFAULT_PITCH,
7990             TTS_DEFAULT_SYNTH,
7991             TTS_ENABLED_PLUGINS,
7992             TTS_DEFAULT_LOCALE,
7993             SHOW_IME_WITH_HARD_KEYBOARD,
7994             WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,            // moved to global
7995             WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,               // moved to global
7996             WIFI_NUM_OPEN_NETWORKS_KEPT,                        // moved to global
7997             SELECTED_SPELL_CHECKER,
7998             SELECTED_SPELL_CHECKER_SUBTYPE,
7999             SPELL_CHECKER_ENABLED,
8000             MOUNT_PLAY_NOTIFICATION_SND,
8001             MOUNT_UMS_AUTOSTART,
8002             MOUNT_UMS_PROMPT,
8003             MOUNT_UMS_NOTIFY_ENABLED,
8004             SLEEP_TIMEOUT,
8005             DOUBLE_TAP_TO_WAKE,
8006             WAKE_GESTURE_ENABLED,
8007             LONG_PRESS_TIMEOUT,
8008             CAMERA_GESTURE_DISABLED,
8009             ACCESSIBILITY_AUTOCLICK_ENABLED,
8010             ACCESSIBILITY_AUTOCLICK_DELAY,
8011             ACCESSIBILITY_LARGE_POINTER_ICON,
8012             PREFERRED_TTY_MODE,
8013             ENHANCED_VOICE_PRIVACY_ENABLED,
8014             TTY_MODE_ENABLED,
8015             RTT_CALLING_MODE,
8016             INCALL_POWER_BUTTON_BEHAVIOR,
8017             NIGHT_DISPLAY_CUSTOM_START_TIME,
8018             NIGHT_DISPLAY_CUSTOM_END_TIME,
8019             NIGHT_DISPLAY_COLOR_TEMPERATURE,
8020             NIGHT_DISPLAY_AUTO_MODE,
8021             SYNC_PARENT_SOUNDS,
8022             CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
8023             SWIPE_UP_TO_SWITCH_APPS_ENABLED,
8024             CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
8025             SYSTEM_NAVIGATION_KEYS_ENABLED,
8026             QS_TILES,
8027             DOZE_ENABLED,
8028             DOZE_PULSE_ON_PICK_UP,
8029             DOZE_PULSE_ON_DOUBLE_TAP,
8030             NFC_PAYMENT_DEFAULT_COMPONENT,
8031             AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN,
8032             ASSIST_GESTURE_ENABLED,
8033             ASSIST_GESTURE_SENSITIVITY,
8034             ASSIST_GESTURE_SETUP_COMPLETE,
8035             ASSIST_GESTURE_SILENCE_ALERTS_ENABLED,
8036             ASSIST_GESTURE_WAKE_ENABLED,
8037             VR_DISPLAY_MODE,
8038             NOTIFICATION_BADGING,
8039             QS_AUTO_ADDED_TILES,
8040             SCREENSAVER_ENABLED,
8041             SCREENSAVER_COMPONENTS,
8042             SCREENSAVER_ACTIVATE_ON_DOCK,
8043             SCREENSAVER_ACTIVATE_ON_SLEEP,
8044             LOCKDOWN_IN_POWER_MENU,
8045             SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
8046             VOLUME_HUSH_GESTURE,
8047             MANUAL_RINGER_TOGGLE_COUNT,
8048             HUSH_GESTURE_USED,
8049         };
8050 
8051         /**
8052          * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator,
8053          * otherwise they won't be restored.
8054          *
8055          * @hide
8056          */
8057         public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
8058         static {
VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR)8059             VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR);
VALIDATORS.put(ALLOW_MOCK_LOCATION, ALLOW_MOCK_LOCATION_VALIDATOR)8060             VALIDATORS.put(ALLOW_MOCK_LOCATION, ALLOW_MOCK_LOCATION_VALIDATOR);
VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR)8061             VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR)8062             VALIDATORS.put(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
8063                     ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER, ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR)8064             VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER,
8065                     ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR)8066             VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
8067                     ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR)8068             VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
8069                     ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR)8070             VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED,
8071                     ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR);
VALIDATORS.put(AUTOFILL_SERVICE, AUTOFILL_SERVICE_VALIDATOR)8072             VALIDATORS.put(AUTOFILL_SERVICE, AUTOFILL_SERVICE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR)8073             VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
8074                     ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR);
VALIDATORS.put(ENABLED_ACCESSIBILITY_SERVICES, ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR)8075             VALIDATORS.put(ENABLED_ACCESSIBILITY_SERVICES,
8076                     ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR);
VALIDATORS.put(ENABLED_VR_LISTENERS, ENABLED_VR_LISTENERS_VALIDATOR)8077             VALIDATORS.put(ENABLED_VR_LISTENERS, ENABLED_VR_LISTENERS_VALIDATOR);
VALIDATORS.put(TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES, TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR)8078             VALIDATORS.put(TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
8079                     TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR);
VALIDATORS.put(TOUCH_EXPLORATION_ENABLED, TOUCH_EXPLORATION_ENABLED_VALIDATOR)8080             VALIDATORS.put(TOUCH_EXPLORATION_ENABLED, TOUCH_EXPLORATION_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_ENABLED, ACCESSIBILITY_ENABLED_VALIDATOR)8081             VALIDATORS.put(ACCESSIBILITY_ENABLED, ACCESSIBILITY_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR)8082             VALIDATORS.put(ACCESSIBILITY_SHORTCUT_TARGET_SERVICE,
8083                     ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_BUTTON_TARGET_COMPONENT, ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR)8084             VALIDATORS.put(ACCESSIBILITY_BUTTON_TARGET_COMPONENT,
8085                     ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR)8086             VALIDATORS.put(ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN,
8087                     ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ENABLED, ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR)8088             VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ENABLED,
8089                     ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN, ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR)8090             VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN,
8091                     ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_SPEAK_PASSWORD, ACCESSIBILITY_SPEAK_PASSWORD_VALIDATOR)8092             VALIDATORS.put(ACCESSIBILITY_SPEAK_PASSWORD, ACCESSIBILITY_SPEAK_PASSWORD_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR)8093             VALIDATORS.put(ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
8094                     ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_PRESET, ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR)8095             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_PRESET,
8096                     ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_ENABLED, ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR)8097             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_ENABLED,
8098                     ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_LOCALE, ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR)8099             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_LOCALE,
8100                     ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR, ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR)8101             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
8102                     ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR, ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR)8103             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
8104                     ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_TYPE, ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR)8105             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
8106                     ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_COLOR, ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR)8107             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
8108                     ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_TYPEFACE, ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR)8109             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_TYPEFACE,
8110                     ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FONT_SCALE, ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR)8111             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FONT_SCALE,
8112                     ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR)8113             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
8114                     ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR);
VALIDATORS.put(TTS_DEFAULT_RATE, TTS_DEFAULT_RATE_VALIDATOR)8115             VALIDATORS.put(TTS_DEFAULT_RATE, TTS_DEFAULT_RATE_VALIDATOR);
VALIDATORS.put(TTS_DEFAULT_PITCH, TTS_DEFAULT_PITCH_VALIDATOR)8116             VALIDATORS.put(TTS_DEFAULT_PITCH, TTS_DEFAULT_PITCH_VALIDATOR);
VALIDATORS.put(TTS_DEFAULT_SYNTH, TTS_DEFAULT_SYNTH_VALIDATOR)8117             VALIDATORS.put(TTS_DEFAULT_SYNTH, TTS_DEFAULT_SYNTH_VALIDATOR);
VALIDATORS.put(TTS_ENABLED_PLUGINS, TTS_ENABLED_PLUGINS_VALIDATOR)8118             VALIDATORS.put(TTS_ENABLED_PLUGINS, TTS_ENABLED_PLUGINS_VALIDATOR);
VALIDATORS.put(TTS_DEFAULT_LOCALE, TTS_DEFAULT_LOCALE_VALIDATOR)8119             VALIDATORS.put(TTS_DEFAULT_LOCALE, TTS_DEFAULT_LOCALE_VALIDATOR);
VALIDATORS.put(SHOW_IME_WITH_HARD_KEYBOARD, SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR)8120             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)8121             VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
8122                     WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR)8123             VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
8124                     WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR);
VALIDATORS.put(WIFI_NUM_OPEN_NETWORKS_KEPT, WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR)8125             VALIDATORS.put(WIFI_NUM_OPEN_NETWORKS_KEPT, WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR);
VALIDATORS.put(SELECTED_SPELL_CHECKER, SELECTED_SPELL_CHECKER_VALIDATOR)8126             VALIDATORS.put(SELECTED_SPELL_CHECKER, SELECTED_SPELL_CHECKER_VALIDATOR);
VALIDATORS.put(SELECTED_SPELL_CHECKER_SUBTYPE, SELECTED_SPELL_CHECKER_SUBTYPE_VALIDATOR)8127             VALIDATORS.put(SELECTED_SPELL_CHECKER_SUBTYPE,
8128                     SELECTED_SPELL_CHECKER_SUBTYPE_VALIDATOR);
VALIDATORS.put(SPELL_CHECKER_ENABLED, SPELL_CHECKER_ENABLED_VALIDATOR)8129             VALIDATORS.put(SPELL_CHECKER_ENABLED, SPELL_CHECKER_ENABLED_VALIDATOR);
VALIDATORS.put(MOUNT_PLAY_NOTIFICATION_SND, MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR)8130             VALIDATORS.put(MOUNT_PLAY_NOTIFICATION_SND, MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR);
VALIDATORS.put(MOUNT_UMS_AUTOSTART, MOUNT_UMS_AUTOSTART_VALIDATOR)8131             VALIDATORS.put(MOUNT_UMS_AUTOSTART, MOUNT_UMS_AUTOSTART_VALIDATOR);
VALIDATORS.put(MOUNT_UMS_PROMPT, MOUNT_UMS_PROMPT_VALIDATOR)8132             VALIDATORS.put(MOUNT_UMS_PROMPT, MOUNT_UMS_PROMPT_VALIDATOR);
VALIDATORS.put(MOUNT_UMS_NOTIFY_ENABLED, MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR)8133             VALIDATORS.put(MOUNT_UMS_NOTIFY_ENABLED, MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR);
VALIDATORS.put(SLEEP_TIMEOUT, SLEEP_TIMEOUT_VALIDATOR)8134             VALIDATORS.put(SLEEP_TIMEOUT, SLEEP_TIMEOUT_VALIDATOR);
VALIDATORS.put(DOUBLE_TAP_TO_WAKE, DOUBLE_TAP_TO_WAKE_VALIDATOR)8135             VALIDATORS.put(DOUBLE_TAP_TO_WAKE, DOUBLE_TAP_TO_WAKE_VALIDATOR);
VALIDATORS.put(WAKE_GESTURE_ENABLED, WAKE_GESTURE_ENABLED_VALIDATOR)8136             VALIDATORS.put(WAKE_GESTURE_ENABLED, WAKE_GESTURE_ENABLED_VALIDATOR);
VALIDATORS.put(LONG_PRESS_TIMEOUT, LONG_PRESS_TIMEOUT_VALIDATOR)8137             VALIDATORS.put(LONG_PRESS_TIMEOUT, LONG_PRESS_TIMEOUT_VALIDATOR);
VALIDATORS.put(CAMERA_GESTURE_DISABLED, CAMERA_GESTURE_DISABLED_VALIDATOR)8138             VALIDATORS.put(CAMERA_GESTURE_DISABLED, CAMERA_GESTURE_DISABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_ENABLED, ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR)8139             VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_ENABLED,
8140                     ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_DELAY, ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR)8141             VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_DELAY, ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_LARGE_POINTER_ICON, ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR)8142             VALIDATORS.put(ACCESSIBILITY_LARGE_POINTER_ICON,
8143                     ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR);
VALIDATORS.put(PREFERRED_TTY_MODE, PREFERRED_TTY_MODE_VALIDATOR)8144             VALIDATORS.put(PREFERRED_TTY_MODE, PREFERRED_TTY_MODE_VALIDATOR);
VALIDATORS.put(ENHANCED_VOICE_PRIVACY_ENABLED, ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR)8145             VALIDATORS.put(ENHANCED_VOICE_PRIVACY_ENABLED,
8146                     ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR);
VALIDATORS.put(TTY_MODE_ENABLED, TTY_MODE_ENABLED_VALIDATOR)8147             VALIDATORS.put(TTY_MODE_ENABLED, TTY_MODE_ENABLED_VALIDATOR);
VALIDATORS.put(RTT_CALLING_MODE, RTT_CALLING_MODE_VALIDATOR)8148             VALIDATORS.put(RTT_CALLING_MODE, RTT_CALLING_MODE_VALIDATOR);
VALIDATORS.put(INCALL_POWER_BUTTON_BEHAVIOR, INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR)8149             VALIDATORS.put(INCALL_POWER_BUTTON_BEHAVIOR, INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR);
VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_START_TIME, NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR)8150             VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_START_TIME,
8151                     NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR);
VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_END_TIME, NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR)8152             VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_END_TIME, NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR);
VALIDATORS.put(NIGHT_DISPLAY_COLOR_TEMPERATURE, NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR)8153             VALIDATORS.put(NIGHT_DISPLAY_COLOR_TEMPERATURE,
8154                     NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR);
VALIDATORS.put(NIGHT_DISPLAY_AUTO_MODE, NIGHT_DISPLAY_AUTO_MODE_VALIDATOR)8155             VALIDATORS.put(NIGHT_DISPLAY_AUTO_MODE, NIGHT_DISPLAY_AUTO_MODE_VALIDATOR);
VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR)8156             VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR);
VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR)8157             VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
8158                     CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR);
VALIDATORS.put(SWIPE_UP_TO_SWITCH_APPS_ENABLED, SWIPE_UP_TO_SWITCH_APPS_ENABLED_VALIDATOR)8159             VALIDATORS.put(SWIPE_UP_TO_SWITCH_APPS_ENABLED,
8160                     SWIPE_UP_TO_SWITCH_APPS_ENABLED_VALIDATOR);
VALIDATORS.put(CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR)8161             VALIDATORS.put(CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
8162                     CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR);
VALIDATORS.put(SYSTEM_NAVIGATION_KEYS_ENABLED, SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR)8163             VALIDATORS.put(SYSTEM_NAVIGATION_KEYS_ENABLED,
8164                     SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR);
VALIDATORS.put(QS_TILES, QS_TILES_VALIDATOR)8165             VALIDATORS.put(QS_TILES, QS_TILES_VALIDATOR);
VALIDATORS.put(DOZE_ENABLED, DOZE_ENABLED_VALIDATOR)8166             VALIDATORS.put(DOZE_ENABLED, DOZE_ENABLED_VALIDATOR);
VALIDATORS.put(DOZE_PULSE_ON_PICK_UP, DOZE_PULSE_ON_PICK_UP_VALIDATOR)8167             VALIDATORS.put(DOZE_PULSE_ON_PICK_UP, DOZE_PULSE_ON_PICK_UP_VALIDATOR);
VALIDATORS.put(DOZE_PULSE_ON_DOUBLE_TAP, DOZE_PULSE_ON_DOUBLE_TAP_VALIDATOR)8168             VALIDATORS.put(DOZE_PULSE_ON_DOUBLE_TAP, DOZE_PULSE_ON_DOUBLE_TAP_VALIDATOR);
VALIDATORS.put(NFC_PAYMENT_DEFAULT_COMPONENT, NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR)8169             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)8170             VALIDATORS.put(AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN,
8171                     AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR);
VALIDATORS.put(ASSIST_GESTURE_ENABLED, ASSIST_GESTURE_ENABLED_VALIDATOR)8172             VALIDATORS.put(ASSIST_GESTURE_ENABLED, ASSIST_GESTURE_ENABLED_VALIDATOR);
VALIDATORS.put(ASSIST_GESTURE_SENSITIVITY, ASSIST_GESTURE_SENSITIVITY_VALIDATOR)8173             VALIDATORS.put(ASSIST_GESTURE_SENSITIVITY, ASSIST_GESTURE_SENSITIVITY_VALIDATOR);
VALIDATORS.put(ASSIST_GESTURE_SETUP_COMPLETE, ASSIST_GESTURE_SETUP_COMPLETE_VALIDATOR)8174             VALIDATORS.put(ASSIST_GESTURE_SETUP_COMPLETE, ASSIST_GESTURE_SETUP_COMPLETE_VALIDATOR);
VALIDATORS.put(ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR)8175             VALIDATORS.put(ASSIST_GESTURE_SILENCE_ALERTS_ENABLED,
8176                     ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR);
VALIDATORS.put(ASSIST_GESTURE_WAKE_ENABLED, ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR)8177             VALIDATORS.put(ASSIST_GESTURE_WAKE_ENABLED, ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR);
VALIDATORS.put(VR_DISPLAY_MODE, VR_DISPLAY_MODE_VALIDATOR)8178             VALIDATORS.put(VR_DISPLAY_MODE, VR_DISPLAY_MODE_VALIDATOR);
VALIDATORS.put(NOTIFICATION_BADGING, NOTIFICATION_BADGING_VALIDATOR)8179             VALIDATORS.put(NOTIFICATION_BADGING, NOTIFICATION_BADGING_VALIDATOR);
VALIDATORS.put(QS_AUTO_ADDED_TILES, QS_AUTO_ADDED_TILES_VALIDATOR)8180             VALIDATORS.put(QS_AUTO_ADDED_TILES, QS_AUTO_ADDED_TILES_VALIDATOR);
VALIDATORS.put(SCREENSAVER_ENABLED, SCREENSAVER_ENABLED_VALIDATOR)8181             VALIDATORS.put(SCREENSAVER_ENABLED, SCREENSAVER_ENABLED_VALIDATOR);
VALIDATORS.put(SCREENSAVER_COMPONENTS, SCREENSAVER_COMPONENTS_VALIDATOR)8182             VALIDATORS.put(SCREENSAVER_COMPONENTS, SCREENSAVER_COMPONENTS_VALIDATOR);
VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_DOCK, SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR)8183             VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_DOCK, SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR);
VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_SLEEP, SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR)8184             VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_SLEEP, SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR);
VALIDATORS.put(LOCKDOWN_IN_POWER_MENU, LOCKDOWN_IN_POWER_MENU_VALIDATOR)8185             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)8186             VALIDATORS.put(SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
8187                     SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR);
VALIDATORS.put(VOLUME_HUSH_GESTURE, VOLUME_HUSH_GESTURE_VALIDATOR)8188             VALIDATORS.put(VOLUME_HUSH_GESTURE, VOLUME_HUSH_GESTURE_VALIDATOR);
VALIDATORS.put(ENABLED_NOTIFICATION_LISTENERS, ENABLED_NOTIFICATION_LISTENERS_VALIDATOR)8189             VALIDATORS.put(ENABLED_NOTIFICATION_LISTENERS,
8190                     ENABLED_NOTIFICATION_LISTENERS_VALIDATOR); //legacy restore setting
VALIDATORS.put(ENABLED_NOTIFICATION_ASSISTANT, ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR)8191             VALIDATORS.put(ENABLED_NOTIFICATION_ASSISTANT,
8192                     ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR); //legacy restore setting
VALIDATORS.put(ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES, ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR)8193             VALIDATORS.put(ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES,
8194                     ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR); //legacy restore setting
VALIDATORS.put(HUSH_GESTURE_USED, HUSH_GESTURE_USED_VALIDATOR)8195             VALIDATORS.put(HUSH_GESTURE_USED, HUSH_GESTURE_USED_VALIDATOR);
VALIDATORS.put(MANUAL_RINGER_TOGGLE_COUNT, MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR)8196             VALIDATORS.put(MANUAL_RINGER_TOGGLE_COUNT, MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR);
8197         }
8198 
8199         /**
8200          * Keys we no longer back up under the current schema, but want to continue to
8201          * process when restoring historical backup datasets.
8202          *
8203          * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
8204          * otherwise they won't be restored.
8205          *
8206          * @hide
8207          */
8208         public static final String[] LEGACY_RESTORE_SETTINGS = {
8209                 ENABLED_NOTIFICATION_LISTENERS,
8210                 ENABLED_NOTIFICATION_ASSISTANT,
8211                 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES
8212         };
8213 
8214         /**
8215          * These entries are considered common between the personal and the managed profile,
8216          * since the managed profile doesn't get to change them.
8217          */
8218         private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
8219 
8220         static {
8221             CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
8222             CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
8223             CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
8224             CLONE_TO_MANAGED_PROFILE.add(AUTOFILL_SERVICE);
8225             CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
8226             CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
8227             CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
8228             CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER);
8229             CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
8230             CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
8231             CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
8232             if (TextServicesManager.DISABLE_PER_PROFILE_SPELL_CHECKER) {
8233                 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
8234                 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
8235             }
8236         }
8237 
8238         /** @hide */
getCloneToManagedProfileSettings(Set<String> outKeySet)8239         public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
8240             outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
8241         }
8242 
8243         /**
8244          * Secure settings which can be accessed by instant apps.
8245          * @hide
8246          */
8247         public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
8248         static {
8249             INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES);
8250             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD);
8251             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED);
8252             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED);
8253             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET);
8254             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE);
8255             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR);
8256             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE);
8257             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR);
8258             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR);
8259             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE);
8260             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE);
8261             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR);
8262             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED);
8263             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER);
8264             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY);
8265             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED);
8266             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON);
8267 
8268             INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD);
8269             INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS);
8270 
8271             INSTANT_APP_SETTINGS.add(ANDROID_ID);
8272 
8273             INSTANT_APP_SETTINGS.add(PACKAGE_VERIFIER_USER_CONSENT);
8274             INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION);
8275         }
8276 
8277         /**
8278          * Helper method for determining if a location provider is enabled.
8279          *
8280          * @param cr the content resolver to use
8281          * @param provider the location provider to query
8282          * @return true if the provider is enabled
8283          *
8284          * @deprecated use {@link LocationManager#isProviderEnabled(String)}
8285          */
8286         @Deprecated
isLocationProviderEnabled(ContentResolver cr, String provider)8287         public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
8288             return isLocationProviderEnabledForUser(cr, provider, cr.getUserId());
8289         }
8290 
8291         /**
8292          * Helper method for determining if a location provider is enabled.
8293          * @param cr the content resolver to use
8294          * @param provider the location provider to query
8295          * @param userId the userId to query
8296          * @return true if the provider is enabled
8297          *
8298          * @deprecated use {@link LocationManager#isProviderEnabled(String)}
8299          * @hide
8300          */
8301         @Deprecated
isLocationProviderEnabledForUser( ContentResolver cr, String provider, int userId)8302         public static final boolean isLocationProviderEnabledForUser(
8303                 ContentResolver cr, String provider, int userId) {
8304             String allowedProviders = Settings.Secure.getStringForUser(cr,
8305                     LOCATION_PROVIDERS_ALLOWED, userId);
8306             return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
8307         }
8308 
8309         /**
8310          * Thread-safe method for enabling or disabling a single location provider.
8311          * @param cr the content resolver to use
8312          * @param provider the location provider to enable or disable
8313          * @param enabled true if the provider should be enabled
8314          * @deprecated This API is deprecated. It requires WRITE_SECURE_SETTINGS permission to
8315          *             change location settings.
8316          */
8317         @Deprecated
setLocationProviderEnabled(ContentResolver cr, String provider, boolean enabled)8318         public static final void setLocationProviderEnabled(ContentResolver cr,
8319                 String provider, boolean enabled) {
8320             setLocationProviderEnabledForUser(cr, provider, enabled, cr.getUserId());
8321         }
8322 
8323         /**
8324          * Thread-safe method for enabling or disabling a single location provider.
8325          *
8326          * @param cr the content resolver to use
8327          * @param provider the location provider to enable or disable
8328          * @param enabled true if the provider should be enabled
8329          * @param userId the userId for which to enable/disable providers
8330          * @return true if the value was set, false on database errors
8331          *
8332          * @deprecated use {@link LocationManager#setProviderEnabledForUser(String, boolean, int)}
8333          * @hide
8334          */
8335         @Deprecated
setLocationProviderEnabledForUser(ContentResolver cr, String provider, boolean enabled, int userId)8336         public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
8337                 String provider, boolean enabled, int userId) {
8338             synchronized (mLocationSettingsLock) {
8339                 // to ensure thread safety, we write the provider name with a '+' or '-'
8340                 // and let the SettingsProvider handle it rather than reading and modifying
8341                 // the list of enabled providers.
8342                 if (enabled) {
8343                     provider = "+" + provider;
8344                 } else {
8345                     provider = "-" + provider;
8346                 }
8347                 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
8348                         userId);
8349             }
8350         }
8351 
8352         /**
8353          * Thread-safe method for setting the location mode to one of
8354          * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
8355          * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
8356          * Necessary because the mode is a composite of the underlying location provider
8357          * settings.
8358          *
8359          * @param cr the content resolver to use
8360          * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
8361          * @param userId the userId for which to change mode
8362          * @return true if the value was set, false on database errors
8363          *
8364          * @throws IllegalArgumentException if mode is not one of the supported values
8365          *
8366          * @deprecated To enable/disable location, use
8367          *             {@link LocationManager#setLocationEnabledForUser(boolean, int)}.
8368          *             To enable/disable a specific location provider, use
8369          *             {@link LocationManager#setProviderEnabledForUser(String, boolean, int)}.
8370          */
8371         @Deprecated
setLocationModeForUser( ContentResolver cr, int mode, int userId)8372         private static boolean setLocationModeForUser(
8373                 ContentResolver cr, int mode, int userId) {
8374             synchronized (mLocationSettingsLock) {
8375                 boolean gps = false;
8376                 boolean network = false;
8377                 switch (mode) {
8378                     case LOCATION_MODE_OFF:
8379                         break;
8380                     case LOCATION_MODE_SENSORS_ONLY:
8381                         gps = true;
8382                         break;
8383                     case LOCATION_MODE_BATTERY_SAVING:
8384                         network = true;
8385                         break;
8386                     case LOCATION_MODE_HIGH_ACCURACY:
8387                         gps = true;
8388                         network = true;
8389                         break;
8390                     default:
8391                         throw new IllegalArgumentException("Invalid location mode: " + mode);
8392                 }
8393 
8394                 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
8395                         cr, LocationManager.NETWORK_PROVIDER, network, userId);
8396                 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
8397                         cr, LocationManager.GPS_PROVIDER, gps, userId);
8398                 return gpsSuccess && nlpSuccess;
8399             }
8400         }
8401 
8402         /**
8403          * Thread-safe method for reading the location mode, returns one of
8404          * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
8405          * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. Necessary
8406          * because the mode is a composite of the underlying location provider settings.
8407          *
8408          * @param cr the content resolver to use
8409          * @param userId the userId for which to read the mode
8410          * @return the location mode
8411          */
getLocationModeForUser(ContentResolver cr, int userId)8412         private static final int getLocationModeForUser(ContentResolver cr, int userId) {
8413             synchronized (mLocationSettingsLock) {
8414                 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
8415                         cr, LocationManager.GPS_PROVIDER, userId);
8416                 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
8417                         cr, LocationManager.NETWORK_PROVIDER, userId);
8418                 if (gpsEnabled && networkEnabled) {
8419                     return LOCATION_MODE_HIGH_ACCURACY;
8420                 } else if (gpsEnabled) {
8421                     return LOCATION_MODE_SENSORS_ONLY;
8422                 } else if (networkEnabled) {
8423                     return LOCATION_MODE_BATTERY_SAVING;
8424                 } else {
8425                     return LOCATION_MODE_OFF;
8426                 }
8427             }
8428         }
8429     }
8430 
8431     /**
8432      * Global system settings, containing preferences that always apply identically
8433      * to all defined users.  Applications can read these but are not allowed to write;
8434      * like the "Secure" settings, these are for preferences that the user must
8435      * explicitly modify through the system UI or specialized APIs for those values.
8436      */
8437     public static final class Global extends NameValueTable {
8438         // NOTE: If you add new settings here, be sure to add them to
8439         // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked.
8440 
8441         /**
8442          * The content:// style URL for global secure settings items.  Not public.
8443          */
8444         public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
8445 
8446         /**
8447          * Whether users are allowed to add more users or guest from lockscreen.
8448          * <p>
8449          * Type: int
8450          * @hide
8451          */
8452         public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
8453 
8454         /**
8455          * Setting whether the global gesture for enabling accessibility is enabled.
8456          * If this gesture is enabled the user will be able to perfrom it to enable
8457          * the accessibility state without visiting the settings app.
8458          *
8459          * @hide
8460          * No longer used. Should be removed once all dependencies have been updated.
8461          */
8462         public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
8463                 "enable_accessibility_global_gesture_enabled";
8464 
8465         /**
8466          * Whether Airplane Mode is on.
8467          */
8468         public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
8469 
8470         /**
8471          * Whether Theater Mode is on.
8472          * {@hide}
8473          */
8474         @SystemApi
8475         public static final String THEATER_MODE_ON = "theater_mode_on";
8476 
8477         /**
8478          * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
8479          */
8480         public static final String RADIO_BLUETOOTH = "bluetooth";
8481 
8482         /**
8483          * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
8484          */
8485         public static final String RADIO_WIFI = "wifi";
8486 
8487         /**
8488          * {@hide}
8489          */
8490         public static final String RADIO_WIMAX = "wimax";
8491         /**
8492          * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
8493          */
8494         public static final String RADIO_CELL = "cell";
8495 
8496         /**
8497          * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
8498          */
8499         public static final String RADIO_NFC = "nfc";
8500 
8501         /**
8502          * A comma separated list of radios that need to be disabled when airplane mode
8503          * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
8504          * included in the comma separated list.
8505          */
8506         public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
8507 
8508         /**
8509          * A comma separated list of radios that should to be disabled when airplane mode
8510          * is on, but can be manually reenabled by the user.  For example, if RADIO_WIFI is
8511          * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
8512          * will be turned off when entering airplane mode, but the user will be able to reenable
8513          * Wifi in the Settings app.
8514          *
8515          * {@hide}
8516          */
8517         public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
8518 
8519         /**
8520          * An integer representing the Bluetooth Class of Device (CoD).
8521          *
8522          * @hide
8523          */
8524         public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device";
8525 
8526         /**
8527          * A Long representing a bitmap of profiles that should be disabled when bluetooth starts.
8528          * See {@link android.bluetooth.BluetoothProfile}.
8529          * {@hide}
8530          */
8531         public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";
8532 
8533         /**
8534          * A semi-colon separated list of Bluetooth interoperability workarounds.
8535          * Each entry is a partial Bluetooth device address string and an integer representing
8536          * the feature to be disabled, separated by a comma. The integer must correspond
8537          * to a interoperability feature as defined in "interop.h" in /system/bt.
8538          * <p>
8539          * Example: <br/>
8540          *   "00:11:22,0;01:02:03:04,2"
8541          * @hide
8542          */
8543        public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";
8544 
8545         /**
8546          * The policy for deciding when Wi-Fi should go to sleep (which will in
8547          * turn switch to using the mobile data as an Internet connection).
8548          * <p>
8549          * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
8550          * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
8551          * {@link #WIFI_SLEEP_POLICY_NEVER}.
8552          */
8553         public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
8554 
8555         /**
8556          * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
8557          * policy, which is to sleep shortly after the turning off
8558          * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
8559          */
8560         public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
8561 
8562         /**
8563          * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
8564          * the device is on battery, and never go to sleep when the device is
8565          * plugged in.
8566          */
8567         public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
8568 
8569         /**
8570          * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
8571          */
8572         public static final int WIFI_SLEEP_POLICY_NEVER = 2;
8573 
8574         /**
8575          * Value to specify if the user prefers the date, time and time zone
8576          * to be automatically fetched from the network (NITZ). 1=yes, 0=no
8577          */
8578         public static final String AUTO_TIME = "auto_time";
8579 
8580         private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR;
8581 
8582         /**
8583          * Value to specify if the user prefers the time zone
8584          * to be automatically fetched from the network (NITZ). 1=yes, 0=no
8585          */
8586         public static final String AUTO_TIME_ZONE = "auto_time_zone";
8587 
8588         private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR;
8589 
8590         /**
8591          * URI for the car dock "in" event sound.
8592          * @hide
8593          */
8594         public static final String CAR_DOCK_SOUND = "car_dock_sound";
8595 
8596         /**
8597          * URI for the car dock "out" event sound.
8598          * @hide
8599          */
8600         public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
8601 
8602         /**
8603          * URI for the desk dock "in" event sound.
8604          * @hide
8605          */
8606         public static final String DESK_DOCK_SOUND = "desk_dock_sound";
8607 
8608         /**
8609          * URI for the desk dock "out" event sound.
8610          * @hide
8611          */
8612         public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
8613 
8614         /**
8615          * Whether to play a sound for dock events.
8616          * @hide
8617          */
8618         public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
8619 
8620         private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8621 
8622         /**
8623          * Whether to play a sound for dock events, only when an accessibility service is on.
8624          * @hide
8625          */
8626         public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility";
8627 
8628         /**
8629          * URI for the "device locked" (keyguard shown) sound.
8630          * @hide
8631          */
8632         public static final String LOCK_SOUND = "lock_sound";
8633 
8634         /**
8635          * URI for the "device unlocked" sound.
8636          * @hide
8637          */
8638         public static final String UNLOCK_SOUND = "unlock_sound";
8639 
8640         /**
8641          * URI for the "device is trusted" sound, which is played when the device enters the trusted
8642          * state without unlocking.
8643          * @hide
8644          */
8645         public static final String TRUSTED_SOUND = "trusted_sound";
8646 
8647         /**
8648          * URI for the low battery sound file.
8649          * @hide
8650          */
8651         public static final String LOW_BATTERY_SOUND = "low_battery_sound";
8652 
8653         /**
8654          * Whether to play a sound for low-battery alerts.
8655          * @hide
8656          */
8657         public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
8658 
8659         private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8660 
8661         /**
8662          * URI for the "wireless charging started" and "wired charging started" sound.
8663          * @hide
8664          */
8665         public static final String CHARGING_STARTED_SOUND =
8666                 "wireless_charging_started_sound";
8667 
8668         /**
8669          * Whether to play a sound for charging events.
8670          * @hide
8671          */
8672         public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
8673 
8674         private static final Validator CHARGING_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8675 
8676         /**
8677          * Whether to vibrate for wireless charging events.
8678          * @hide
8679          */
8680         public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled";
8681 
8682         private static final Validator CHARGING_VIBRATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8683 
8684         /**
8685          * Whether we keep the device on while the device is plugged in.
8686          * Supported values are:
8687          * <ul>
8688          * <li>{@code 0} to never stay on while plugged in</li>
8689          * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
8690          * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
8691          * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
8692          * </ul>
8693          * These values can be OR-ed together.
8694          */
8695         public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
8696 
8697         private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() {
8698             @Override
8699             public boolean validate(@Nullable String value) {
8700                 try {
8701                     int val = Integer.parseInt(value);
8702                     return (val == 0)
8703                             || (val == BatteryManager.BATTERY_PLUGGED_AC)
8704                             || (val == BatteryManager.BATTERY_PLUGGED_USB)
8705                             || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS)
8706                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
8707                                     | BatteryManager.BATTERY_PLUGGED_USB))
8708                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
8709                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS))
8710                             || (val == (BatteryManager.BATTERY_PLUGGED_USB
8711                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS))
8712                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
8713                                     | BatteryManager.BATTERY_PLUGGED_USB
8714                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS));
8715                 } catch (NumberFormatException e) {
8716                     return false;
8717                 }
8718             }
8719         };
8720 
8721         /**
8722          * When the user has enable the option to have a "bug report" command
8723          * in the power menu.
8724          * @hide
8725          */
8726         public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
8727 
8728         private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR;
8729 
8730         /**
8731          * Whether ADB is enabled.
8732          */
8733         public static final String ADB_ENABLED = "adb_enabled";
8734 
8735         /**
8736          * Whether Views are allowed to save their attribute data.
8737          * @hide
8738          */
8739         public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
8740 
8741         /**
8742          * Whether assisted GPS should be enabled or not.
8743          * @hide
8744          */
8745         public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
8746 
8747         /**
8748          * Whether bluetooth is enabled/disabled
8749          * 0=disabled. 1=enabled.
8750          */
8751         public static final String BLUETOOTH_ON = "bluetooth_on";
8752 
8753         private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR;
8754 
8755         /**
8756          * CDMA Cell Broadcast SMS
8757          *                            0 = CDMA Cell Broadcast SMS disabled
8758          *                            1 = CDMA Cell Broadcast SMS enabled
8759          * @hide
8760          */
8761         public static final String CDMA_CELL_BROADCAST_SMS =
8762                 "cdma_cell_broadcast_sms";
8763 
8764         /**
8765          * The CDMA roaming mode 0 = Home Networks, CDMA default
8766          *                       1 = Roaming on Affiliated networks
8767          *                       2 = Roaming on any networks
8768          * @hide
8769          */
8770         public static final String CDMA_ROAMING_MODE = "roaming_settings";
8771 
8772         /**
8773          * The CDMA subscription mode 0 = RUIM/SIM (default)
8774          *                                1 = NV
8775          * @hide
8776          */
8777         public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
8778 
8779         /**
8780          * The default value for whether background data is enabled or not.
8781          *
8782          * Used by {@code NetworkPolicyManagerService}.
8783          *
8784          * @hide
8785          */
8786         public static final String DEFAULT_RESTRICT_BACKGROUND_DATA =
8787                 "default_restrict_background_data";
8788 
8789         /** Inactivity timeout to track mobile data activity.
8790         *
8791         * If set to a positive integer, it indicates the inactivity timeout value in seconds to
8792         * infer the data activity of mobile network. After a period of no activity on mobile
8793         * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
8794         * intent is fired to indicate a transition of network status from "active" to "idle". Any
8795         * subsequent activity on mobile networks triggers the firing of {@code
8796         * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
8797         *
8798         * Network activity refers to transmitting or receiving data on the network interfaces.
8799         *
8800         * Tracking is disabled if set to zero or negative value.
8801         *
8802         * @hide
8803         */
8804        public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
8805 
8806        /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
8807         * but for Wifi network.
8808         * @hide
8809         */
8810        public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
8811 
8812        /**
8813         * Whether or not data roaming is enabled. (0 = false, 1 = true)
8814         */
8815        public static final String DATA_ROAMING = "data_roaming";
8816 
8817        /**
8818         * The value passed to a Mobile DataConnection via bringUp which defines the
8819         * number of retries to preform when setting up the initial connection. The default
8820         * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
8821         * @hide
8822         */
8823        public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
8824 
8825        /**
8826         * Whether any package can be on external storage. When this is true, any
8827         * package, regardless of manifest values, is a candidate for installing
8828         * or moving onto external storage. (0 = false, 1 = true)
8829         * @hide
8830         */
8831        public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external";
8832 
8833         /**
8834          * The default SM-DP+ configured for this device.
8835          *
8836          * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to
8837          * download profiles. If this value is set, the LPA will query this server for any profiles
8838          * available to this device. If any are available, they may be downloaded during device
8839          * provisioning or in settings without needing the user to enter an activation code.
8840          *
8841          * @see android.service.euicc.EuiccService
8842          * @hide
8843          */
8844         @SystemApi
8845         public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
8846 
8847         /**
8848          * Whether any profile has ever been downloaded onto a eUICC on the device.
8849          *
8850          * <p>Used to hide eUICC UI from users who have never made use of it and would only be
8851          * confused by seeing references to it in settings.
8852          * (0 = false, 1 = true)
8853          * @hide
8854          */
8855         @SystemApi
8856         public static final String EUICC_PROVISIONED = "euicc_provisioned";
8857 
8858         /**
8859          * List of ISO country codes in which eUICC UI is shown. Country codes should be separated
8860          * by comma.
8861          *
8862          * <p>Used to hide eUICC UI from users who are currently in countries no carriers support
8863          * eUICC.
8864          * @hide
8865          */
8866         //TODO(b/77914569) Changes this to System Api.
8867         public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries";
8868 
8869         /**
8870          * Whether any activity can be resized. When this is true, any
8871          * activity, regardless of manifest values, can be resized for multi-window.
8872          * (0 = false, 1 = true)
8873          * @hide
8874          */
8875         public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES
8876                 = "force_resizable_activities";
8877 
8878         /**
8879          * Whether to enable experimental freeform support for windows.
8880          * @hide
8881          */
8882         public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT
8883                 = "enable_freeform_support";
8884 
8885        /**
8886         * Whether user has enabled development settings.
8887         */
8888        public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
8889 
8890        /**
8891         * Whether the device has been provisioned (0 = false, 1 = true).
8892         * <p>On a multiuser device with a separate system user, the screen may be locked
8893         * as soon as this is set to true and further activities cannot be launched on the
8894         * system user unless they are marked to show over keyguard.
8895         */
8896        public static final String DEVICE_PROVISIONED = "device_provisioned";
8897 
8898        /**
8899         * Whether mobile data should be allowed while the device is being provisioned.
8900         * This allows the provisioning process to turn off mobile data before the user
8901         * has an opportunity to set things up, preventing other processes from burning
8902         * precious bytes before wifi is setup.
8903         * (0 = false, 1 = true)
8904         * @hide
8905         */
8906        public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED =
8907                "device_provisioning_mobile_data";
8908 
8909        /**
8910         * The saved value for WindowManagerService.setForcedDisplaySize().
8911         * Two integers separated by a comma.  If unset, then use the real display size.
8912         * @hide
8913         */
8914        public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
8915 
8916        /**
8917         * The saved value for WindowManagerService.setForcedDisplayScalingMode().
8918         * 0 or unset if scaling is automatic, 1 if scaling is disabled.
8919         * @hide
8920         */
8921        public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
8922 
8923        /**
8924         * The maximum size, in bytes, of a download that the download manager will transfer over
8925         * a non-wifi connection.
8926         * @hide
8927         */
8928        public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
8929                "download_manager_max_bytes_over_mobile";
8930 
8931        /**
8932         * The recommended maximum size, in bytes, of a download that the download manager should
8933         * transfer over a non-wifi connection. Over this size, the use will be warned, but will
8934         * have the option to start the download over the mobile connection anyway.
8935         * @hide
8936         */
8937        public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
8938                "download_manager_recommended_max_bytes_over_mobile";
8939 
8940        /**
8941         * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
8942         */
8943        @Deprecated
8944        public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
8945 
8946        /**
8947         * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
8948         * sent or processed. (0 = false, 1 = true)
8949         * @hide
8950         */
8951        public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
8952 
8953        /**
8954         * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on
8955         * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will
8956         * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be
8957         * activated.
8958         * @hide
8959         */
8960         public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED =
8961                 "hdmi_system_audio_control_enabled";
8962 
8963         /**
8964          * Whether TV will automatically turn on upon reception of the CEC command
8965          * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
8966          *
8967          * @hide
8968          */
8969         public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
8970                 "hdmi_control_auto_wakeup_enabled";
8971 
8972         /**
8973          * Whether TV will also turn off other CEC devices when it goes to standby mode.
8974          * (0 = false, 1 = true)
8975          *
8976          * @hide
8977          */
8978         public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
8979                 "hdmi_control_auto_device_off_enabled";
8980 
8981         /**
8982          * If <b>true</b>, enables out-of-the-box execution for priv apps.
8983          * Default: false
8984          * Values: 0 = false, 1 = true
8985          *
8986          * @hide
8987          */
8988         public static final String PRIV_APP_OOB_ENABLED = "priv_app_oob_enabled";
8989 
8990         /**
8991          * Comma separated list of privileged package names, which will be running out-of-box APK.
8992          * Default: "ALL"
8993          *
8994          * @hide
8995          */
8996         public static final String PRIV_APP_OOB_LIST = "priv_app_oob_list";
8997 
8998         /**
8999          * The interval in milliseconds at which location requests will be throttled when they are
9000          * coming from the background.
9001          *
9002          * @hide
9003          */
9004         public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS =
9005                 "location_background_throttle_interval_ms";
9006 
9007         /**
9008          * Most frequent location update interval in milliseconds that proximity alert is allowed
9009          * to request.
9010          * @hide
9011          */
9012         public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS =
9013                 "location_background_throttle_proximity_alert_interval_ms";
9014 
9015         /**
9016          * Packages that are whitelisted for background throttling (throttling will not be applied).
9017          * @hide
9018          */
9019         public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST =
9020             "location_background_throttle_package_whitelist";
9021 
9022         /**
9023         * Whether TV will switch to MHL port when a mobile device is plugged in.
9024         * (0 = false, 1 = true)
9025         * @hide
9026         */
9027        public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
9028 
9029        /**
9030         * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
9031         * @hide
9032         */
9033        public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
9034 
9035        /**
9036         * Whether mobile data connections are allowed by the user.  See
9037         * ConnectivityManager for more info.
9038         * @hide
9039         */
9040        public static final String MOBILE_DATA = "mobile_data";
9041 
9042        /**
9043         * Whether the mobile data connection should remain active even when higher
9044         * priority networks like WiFi are active, to help make network switching faster.
9045         *
9046         * See ConnectivityService for more info.
9047         *
9048         * (0 = disabled, 1 = enabled)
9049         * @hide
9050         */
9051        public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
9052 
9053         /**
9054          * Size of the event buffer for IP connectivity metrics.
9055          * @hide
9056          */
9057         public static final String CONNECTIVITY_METRICS_BUFFER_SIZE =
9058               "connectivity_metrics_buffer_size";
9059 
9060        /** {@hide} */
9061        public static final String NETSTATS_ENABLED = "netstats_enabled";
9062        /** {@hide} */
9063        public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
9064        /** {@hide} */
9065        @Deprecated
9066        public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
9067        /** {@hide} */
9068        public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
9069        /** {@hide} */
9070        public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
9071        /** {@hide} */
9072        public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled";
9073 
9074        /** {@hide} */
9075        public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
9076        /** {@hide} */
9077        public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
9078        /** {@hide} */
9079        public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
9080        /** {@hide} */
9081        public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
9082 
9083        /** {@hide} */
9084        public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
9085        /** {@hide} */
9086        public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
9087        /** {@hide} */
9088        public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
9089        /** {@hide} */
9090        public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
9091 
9092        /** {@hide} */
9093        public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
9094        /** {@hide} */
9095        public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
9096        /** {@hide} */
9097        public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
9098        /** {@hide} */
9099        public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
9100 
9101        /** {@hide} */
9102        public static final String NETPOLICY_QUOTA_ENABLED = "netpolicy_quota_enabled";
9103        /** {@hide} */
9104        public static final String NETPOLICY_QUOTA_UNLIMITED = "netpolicy_quota_unlimited";
9105        /** {@hide} */
9106        public static final String NETPOLICY_QUOTA_LIMITED = "netpolicy_quota_limited";
9107        /** {@hide} */
9108        public static final String NETPOLICY_QUOTA_FRAC_JOBS = "netpolicy_quota_frac_jobs";
9109        /** {@hide} */
9110        public static final String NETPOLICY_QUOTA_FRAC_MULTIPATH = "netpolicy_quota_frac_multipath";
9111 
9112        /** {@hide} */
9113        public static final String NETPOLICY_OVERRIDE_ENABLED = "netpolicy_override_enabled";
9114 
9115        /**
9116         * User preference for which network(s) should be used. Only the
9117         * connectivity service should touch this.
9118         */
9119        public static final String NETWORK_PREFERENCE = "network_preference";
9120 
9121        /**
9122         * Which package name to use for network scoring. If null, or if the package is not a valid
9123         * scorer app, external network scores will neither be requested nor accepted.
9124         * @hide
9125         */
9126        public static final String NETWORK_SCORER_APP = "network_scorer_app";
9127 
9128         /**
9129          * Whether night display forced auto mode is available.
9130          * 0 = unavailable, 1 = available.
9131          * @hide
9132          */
9133         public static final String NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE =
9134                 "night_display_forced_auto_mode_available";
9135 
9136        /**
9137         * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
9138         * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
9139         * exceeded.
9140         * @hide
9141         */
9142        public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
9143 
9144        /**
9145         * The length of time in milli-seconds that automatic small adjustments to
9146         * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
9147         * @hide
9148         */
9149        public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
9150 
9151        /** Preferred NTP server. {@hide} */
9152        public static final String NTP_SERVER = "ntp_server";
9153        /** Timeout in milliseconds to wait for NTP server. {@hide} */
9154        public static final String NTP_TIMEOUT = "ntp_timeout";
9155 
9156        /** {@hide} */
9157        public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval";
9158 
9159        /**
9160         * Sample validity in seconds to configure for the system DNS resolver.
9161         * {@hide}
9162         */
9163        public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS =
9164                "dns_resolver_sample_validity_seconds";
9165 
9166        /**
9167         * Success threshold in percent for use with the system DNS resolver.
9168         * {@hide}
9169         */
9170        public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT =
9171                 "dns_resolver_success_threshold_percent";
9172 
9173        /**
9174         * Minimum number of samples needed for statistics to be considered meaningful in the
9175         * system DNS resolver.
9176         * {@hide}
9177         */
9178        public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples";
9179 
9180        /**
9181         * Maximum number taken into account for statistics purposes in the system DNS resolver.
9182         * {@hide}
9183         */
9184        public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples";
9185 
9186        /**
9187         * Whether to disable the automatic scheduling of system updates.
9188         * 1 = system updates won't be automatically scheduled (will always
9189         * present notification instead).
9190         * 0 = system updates will be automatically scheduled. (default)
9191         * @hide
9192         */
9193        @SystemApi
9194        public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
9195 
9196        /**
9197         * Whether the package manager should send package verification broadcasts for verifiers to
9198         * review apps prior to installation.
9199         * 1 = request apps to be verified prior to installation, if a verifier exists.
9200         * 0 = do not verify apps before installation
9201         * @hide
9202         */
9203        public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
9204 
9205        /** Timeout for package verification.
9206         * @hide */
9207        public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
9208 
9209        /** Default response code for package verification.
9210         * @hide */
9211        public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
9212 
9213        /**
9214         * Show package verification setting in the Settings app.
9215         * 1 = show (default)
9216         * 0 = hide
9217         * @hide
9218         */
9219        public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
9220 
9221        /**
9222         * Run package verification on apps installed through ADB/ADT/USB
9223         * 1 = perform package verification on ADB installs (default)
9224         * 0 = bypass package verification on ADB installs
9225         * @hide
9226         */
9227        public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
9228 
9229        /**
9230         * Time since last fstrim (milliseconds) after which we force one to happen
9231         * during device startup.  If unset, the default is 3 days.
9232         * @hide
9233         */
9234        public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
9235 
9236        /**
9237         * The interval in milliseconds at which to check packet counts on the
9238         * mobile data interface when screen is on, to detect possible data
9239         * connection problems.
9240         * @hide
9241         */
9242        public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
9243                "pdp_watchdog_poll_interval_ms";
9244 
9245        /**
9246         * The interval in milliseconds at which to check packet counts on the
9247         * mobile data interface when screen is off, to detect possible data
9248         * connection problems.
9249         * @hide
9250         */
9251        public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
9252                "pdp_watchdog_long_poll_interval_ms";
9253 
9254        /**
9255         * The interval in milliseconds at which to check packet counts on the
9256         * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
9257         * outgoing packets has been reached without incoming packets.
9258         * @hide
9259         */
9260        public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
9261                "pdp_watchdog_error_poll_interval_ms";
9262 
9263        /**
9264         * The number of outgoing packets sent without seeing an incoming packet
9265         * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
9266         * device is logged to the event log
9267         * @hide
9268         */
9269        public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
9270                "pdp_watchdog_trigger_packet_count";
9271 
9272        /**
9273         * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
9274         * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
9275         * attempting data connection recovery.
9276         * @hide
9277         */
9278        public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
9279                "pdp_watchdog_error_poll_count";
9280 
9281        /**
9282         * The number of failed PDP reset attempts before moving to something more
9283         * drastic: re-registering to the network.
9284         * @hide
9285         */
9286        public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
9287                "pdp_watchdog_max_pdp_reset_fail_count";
9288 
9289        /**
9290         * URL to open browser on to allow user to manage a prepay account
9291         * @hide
9292         */
9293        public static final String SETUP_PREPAID_DATA_SERVICE_URL =
9294                "setup_prepaid_data_service_url";
9295 
9296        /**
9297         * URL to attempt a GET on to see if this is a prepay device
9298         * @hide
9299         */
9300        public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
9301                "setup_prepaid_detection_target_url";
9302 
9303        /**
9304         * Host to check for a redirect to after an attempt to GET
9305         * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
9306         * this is a prepaid device with zero balance.)
9307         * @hide
9308         */
9309        public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
9310                "setup_prepaid_detection_redir_host";
9311 
9312        /**
9313         * The interval in milliseconds at which to check the number of SMS sent out without asking
9314         * for use permit, to limit the un-authorized SMS usage.
9315         *
9316         * @hide
9317         */
9318        public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
9319                "sms_outgoing_check_interval_ms";
9320 
9321        /**
9322         * The number of outgoing SMS sent without asking for user permit (of {@link
9323         * #SMS_OUTGOING_CHECK_INTERVAL_MS}
9324         *
9325         * @hide
9326         */
9327        public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
9328                "sms_outgoing_check_max_count";
9329 
9330        /**
9331         * Used to disable SMS short code confirmation - defaults to true.
9332         * True indcates we will do the check, etc.  Set to false to disable.
9333         * @see com.android.internal.telephony.SmsUsageMonitor
9334         * @hide
9335         */
9336        public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
9337 
9338         /**
9339          * Used to select which country we use to determine premium sms codes.
9340          * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
9341          * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
9342          * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
9343          * @hide
9344          */
9345         public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
9346 
9347        /**
9348         * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
9349         * @hide
9350         */
9351        public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
9352 
9353        /**
9354         * Used to disable Tethering on a device - defaults to true
9355         * @hide
9356         */
9357        public static final String TETHER_SUPPORTED = "tether_supported";
9358 
9359        /**
9360         * Used to require DUN APN on the device or not - defaults to a build config value
9361         * which defaults to false
9362         * @hide
9363         */
9364        public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
9365 
9366        /**
9367         * Used to hold a gservices-provisioned apn value for DUN.  If set, or the
9368         * corresponding build config values are set it will override the APN DB
9369         * values.
9370         * Consists of a comma seperated list of strings:
9371         * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
9372         * note that empty fields can be omitted: "name,apn,,,,,,,,,310,260,,DUN"
9373         * @hide
9374         */
9375        public static final String TETHER_DUN_APN = "tether_dun_apn";
9376 
9377         /**
9378          * Used to disable trying to talk to any available tethering offload HAL.
9379          *
9380          * Integer values are interpreted as boolean, and the absence of an explicit setting
9381          * is interpreted as |false|.
9382          * @hide
9383          */
9384         public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled";
9385 
9386         /**
9387          * List of certificate (hex string representation of the application's certificate - SHA-1
9388          * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for
9389          * install when a sim card with matching UICC carrier privilege rules is inserted.  The
9390          * certificate is used as a key, so the certificate encoding here must be the same as the
9391          * certificate encoding used on the SIM.
9392          *
9393          * The value is "cert1:package1;cert2:package2;..."
9394          * @hide
9395          */
9396         @SystemApi
9397         public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
9398 
9399         /**
9400          * Map of package name to application names. The application names cannot and will not be
9401          * localized. App names may not contain colons or semicolons.
9402          *
9403          * The value is "packageName1:appName1;packageName2:appName2;..."
9404          * @hide
9405          */
9406         @SystemApi
9407         public static final String CARRIER_APP_NAMES = "carrier_app_names";
9408 
9409        /**
9410         * USB Mass Storage Enabled
9411         */
9412        public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
9413 
9414        private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9415 
9416        /**
9417         * If this setting is set (to anything), then all references
9418         * to Gmail on the device must change to Google Mail.
9419         */
9420        public static final String USE_GOOGLE_MAIL = "use_google_mail";
9421 
9422         /**
9423          * Webview Data reduction proxy key.
9424          * @hide
9425          */
9426         public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
9427                 "webview_data_reduction_proxy_key";
9428 
9429        /**
9430         * Whether or not the WebView fallback mechanism should be enabled.
9431         * 0=disabled, 1=enabled.
9432         * @hide
9433         */
9434        public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED =
9435                "webview_fallback_logic_enabled";
9436 
9437        /**
9438         * Name of the package used as WebView provider (if unset the provider is instead determined
9439         * by the system).
9440         * @hide
9441         */
9442        public static final String WEBVIEW_PROVIDER = "webview_provider";
9443 
9444        /**
9445         * Developer setting to enable WebView multiprocess rendering.
9446         * @hide
9447         */
9448        @SystemApi
9449        public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
9450 
9451        /**
9452         * The maximum number of notifications shown in 24 hours when switching networks.
9453         * @hide
9454         */
9455        public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT =
9456               "network_switch_notification_daily_limit";
9457 
9458        /**
9459         * The minimum time in milliseconds between notifications when switching networks.
9460         * @hide
9461         */
9462        public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS =
9463               "network_switch_notification_rate_limit_millis";
9464 
9465        /**
9466         * Whether to automatically switch away from wifi networks that lose Internet access.
9467         * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always
9468         * avoids such networks. Valid values are:
9469         *
9470         * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013.
9471         * null: Ask the user whether to switch away from bad wifi.
9472         * 1: Avoid bad wifi.
9473         *
9474         * @hide
9475         */
9476        public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi";
9477 
9478        /**
9479         * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be
9480         * overridden by the system based on device or application state. If null, the value
9481         * specified by config_networkMeteredMultipathPreference is used.
9482         *
9483         * @hide
9484         */
9485        public static final String NETWORK_METERED_MULTIPATH_PREFERENCE =
9486                "network_metered_multipath_preference";
9487 
9488         /**
9489          * Default daily multipath budget used by ConnectivityManager.getMultipathPreference()
9490          * on metered networks. This default quota is only used if quota could not be determined
9491          * from data plan or data limit/warning set by the user.
9492          * @hide
9493          */
9494         public static final String NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES =
9495                 "network_default_daily_multipath_quota_bytes";
9496 
9497         /**
9498          * Network watchlist last report time.
9499          * @hide
9500          */
9501         public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME =
9502                 "network_watchlist_last_report_time";
9503 
9504        /**
9505         * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of
9506         * colon-delimited key-value pairs. The key is the badging enum value defined in
9507         * android.net.ScoredNetwork and the value is the minimum sustained network throughput in
9508         * kbps required for the badge. For example: "10:3000,20:5000,30:25000"
9509         *
9510         * @hide
9511         */
9512        @SystemApi
9513        public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds";
9514 
9515        /**
9516         * Whether Wifi display is enabled/disabled
9517         * 0=disabled. 1=enabled.
9518         * @hide
9519         */
9520        public static final String WIFI_DISPLAY_ON = "wifi_display_on";
9521 
9522        /**
9523         * Whether Wifi display certification mode is enabled/disabled
9524         * 0=disabled. 1=enabled.
9525         * @hide
9526         */
9527        public static final String WIFI_DISPLAY_CERTIFICATION_ON =
9528                "wifi_display_certification_on";
9529 
9530        /**
9531         * WPS Configuration method used by Wifi display, this setting only
9532         * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
9533         *
9534         * Possible values are:
9535         *
9536         * WpsInfo.INVALID: use default WPS method chosen by framework
9537         * WpsInfo.PBC    : use Push button
9538         * WpsInfo.KEYPAD : use Keypad
9539         * WpsInfo.DISPLAY: use Display
9540         * @hide
9541         */
9542        public static final String WIFI_DISPLAY_WPS_CONFIG =
9543            "wifi_display_wps_config";
9544 
9545        /**
9546         * Whether to notify the user of open networks.
9547         * <p>
9548         * If not connected and the scan results have an open network, we will
9549         * put this notification up. If we attempt to connect to a network or
9550         * the open network(s) disappear, we remove the notification. When we
9551         * show the notification, we will not show it again for
9552         * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
9553         *
9554         * @deprecated This feature is no longer controlled by this setting in
9555         * {@link android.os.Build.VERSION_CODES#O}.
9556         */
9557        @Deprecated
9558        public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
9559                "wifi_networks_available_notification_on";
9560 
9561        private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
9562                BOOLEAN_VALIDATOR;
9563 
9564        /**
9565         * Whether to notify the user of carrier networks.
9566         * <p>
9567         * If not connected and the scan results have a carrier network, we will
9568         * put this notification up. If we attempt to connect to a network or
9569         * the carrier network(s) disappear, we remove the notification. When we
9570         * show the notification, we will not show it again for
9571         * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
9572         * @hide
9573         */
9574        public static final String WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON =
9575                "wifi_carrier_networks_available_notification_on";
9576 
9577        private static final Validator WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
9578                BOOLEAN_VALIDATOR;
9579 
9580        /**
9581         * {@hide}
9582         */
9583        public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
9584                "wimax_networks_available_notification_on";
9585 
9586        /**
9587         * Delay (in seconds) before repeating the Wi-Fi networks available notification.
9588         * Connecting to a network will reset the timer.
9589         */
9590        public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
9591                "wifi_networks_available_repeat_delay";
9592 
9593        private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR =
9594                NON_NEGATIVE_INTEGER_VALIDATOR;
9595 
9596        /**
9597         * 802.11 country code in ISO 3166 format
9598         * @hide
9599         */
9600        public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
9601 
9602        /**
9603         * The interval in milliseconds to issue wake up scans when wifi needs
9604         * to connect. This is necessary to connect to an access point when
9605         * device is on the move and the screen is off.
9606         * @hide
9607         */
9608        public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
9609                "wifi_framework_scan_interval_ms";
9610 
9611        /**
9612         * The interval in milliseconds after which Wi-Fi is considered idle.
9613         * When idle, it is possible for the device to be switched from Wi-Fi to
9614         * the mobile data network.
9615         * @hide
9616         */
9617        public static final String WIFI_IDLE_MS = "wifi_idle_ms";
9618 
9619        /**
9620         * When the number of open networks exceeds this number, the
9621         * least-recently-used excess networks will be removed.
9622         */
9623        public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
9624 
9625        private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR =
9626                NON_NEGATIVE_INTEGER_VALIDATOR;
9627 
9628        /**
9629         * Whether the Wi-Fi should be on.  Only the Wi-Fi service should touch this.
9630         */
9631        public static final String WIFI_ON = "wifi_on";
9632 
9633        /**
9634         * Setting to allow scans to be enabled even wifi is turned off for connectivity.
9635         * @hide
9636         */
9637        public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
9638                 "wifi_scan_always_enabled";
9639 
9640         /**
9641          * The interval in milliseconds at which wifi rtt ranging requests will be throttled when
9642          * they are coming from the background.
9643          *
9644          * @hide
9645          */
9646         public static final String WIFI_RTT_BACKGROUND_EXEC_GAP_MS =
9647                 "wifi_rtt_background_exec_gap_ms";
9648 
9649         /**
9650          * Whether soft AP will shut down after a timeout period when no devices are connected.
9651          *
9652          * Type: int (0 for false, 1 for true)
9653          * @hide
9654          */
9655         public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled";
9656 
9657         private static final Validator SOFT_AP_TIMEOUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9658 
9659         /**
9660          * Value to specify if Wi-Fi Wakeup feature is enabled.
9661          *
9662          * Type: int (0 for false, 1 for true)
9663          * @hide
9664          */
9665         @SystemApi
9666         public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
9667 
9668         private static final Validator WIFI_WAKEUP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9669 
9670         /**
9671          * Value to specify whether network quality scores and badging should be shown in the UI.
9672          *
9673          * Type: int (0 for false, 1 for true)
9674          * @hide
9675          */
9676         public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled";
9677 
9678         /**
9679          * Value to specify how long in milliseconds to retain seen score cache curves to be used
9680          * when generating SSID only bases score curves.
9681          *
9682          * Type: long
9683          * @hide
9684          */
9685         public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS =
9686                 "speed_label_cache_eviction_age_millis";
9687 
9688         /**
9689          * Value to specify if network recommendations from
9690          * {@link com.android.server.NetworkScoreService} are enabled.
9691          *
9692          * Type: int
9693          * Valid values:
9694          *   -1 = Forced off
9695          *    0 = Disabled
9696          *    1 = Enabled
9697          *
9698          * Most readers of this setting should simply check if value == 1 to determined the
9699          * enabled state.
9700          * @hide
9701          */
9702         public static final String NETWORK_RECOMMENDATIONS_ENABLED =
9703                 "network_recommendations_enabled";
9704 
9705         private static final Validator NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR =
9706                 new SettingsValidators.DiscreteValueValidator(new String[] {"-1", "0", "1"});
9707 
9708         /**
9709          * Which package name to use for network recommendations. If null, network recommendations
9710          * will neither be requested nor accepted.
9711          *
9712          * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and
9713          * {@link NetworkScoreManager#setActiveScorer(String)} to write it.
9714          *
9715          * Type: string - package name
9716          * @hide
9717          */
9718         public static final String NETWORK_RECOMMENDATIONS_PACKAGE =
9719                 "network_recommendations_package";
9720 
9721         /**
9722          * The package name of the application that connect and secures high quality open wifi
9723          * networks automatically.
9724          *
9725          * Type: string package name or null if the feature is either not provided or disabled.
9726          * @hide
9727          */
9728         @TestApi
9729         public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package";
9730 
9731         private static final Validator USE_OPEN_WIFI_PACKAGE_VALIDATOR = new Validator() {
9732             @Override
9733             public boolean validate(@Nullable String value) {
9734                 return (value == null) || PACKAGE_NAME_VALIDATOR.validate(value);
9735             }
9736         };
9737 
9738         /**
9739          * The number of milliseconds the {@link com.android.server.NetworkScoreService}
9740          * will give a recommendation request to complete before returning a default response.
9741          *
9742          * Type: long
9743          * @hide
9744          * @deprecated to be removed
9745          */
9746         public static final String NETWORK_RECOMMENDATION_REQUEST_TIMEOUT_MS =
9747                 "network_recommendation_request_timeout_ms";
9748 
9749         /**
9750          * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in
9751          * {@link com.android.server.wifi.RecommendedNetworkEvaluator}.
9752          *
9753          * Type: long
9754          * @hide
9755          */
9756         public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS =
9757                 "recommended_network_evaluator_cache_expiry_ms";
9758 
9759         /**
9760         * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
9761         * connectivity.
9762         * @hide
9763         */
9764         public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled";
9765 
9766         /**
9767          * The length in milliseconds of a BLE scan window in a low-power scan mode.
9768          * @hide
9769          */
9770         public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms";
9771 
9772         /**
9773          * The length in milliseconds of a BLE scan window in a balanced scan mode.
9774          * @hide
9775          */
9776         public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms";
9777 
9778         /**
9779          * The length in milliseconds of a BLE scan window in a low-latency scan mode.
9780          * @hide
9781          */
9782         public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS =
9783                 "ble_scan_low_latency_window_ms";
9784 
9785         /**
9786          * The length in milliseconds of a BLE scan interval in a low-power scan mode.
9787          * @hide
9788          */
9789         public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS =
9790                 "ble_scan_low_power_interval_ms";
9791 
9792         /**
9793          * The length in milliseconds of a BLE scan interval in a balanced scan mode.
9794          * @hide
9795          */
9796         public static final String BLE_SCAN_BALANCED_INTERVAL_MS =
9797                 "ble_scan_balanced_interval_ms";
9798 
9799         /**
9800          * The length in milliseconds of a BLE scan interval in a low-latency scan mode.
9801          * @hide
9802          */
9803         public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS =
9804                 "ble_scan_low_latency_interval_ms";
9805 
9806         /**
9807          * The mode that BLE scanning clients will be moved to when in the background.
9808          * @hide
9809          */
9810         public static final String BLE_SCAN_BACKGROUND_MODE = "ble_scan_background_mode";
9811 
9812        /**
9813         * Used to save the Wifi_ON state prior to tethering.
9814         * This state will be checked to restore Wifi after
9815         * the user turns off tethering.
9816         *
9817         * @hide
9818         */
9819        public static final String WIFI_SAVED_STATE = "wifi_saved_state";
9820 
9821        /**
9822         * The interval in milliseconds to scan as used by the wifi supplicant
9823         * @hide
9824         */
9825        public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
9826                "wifi_supplicant_scan_interval_ms";
9827 
9828         /**
9829          * whether frameworks handles wifi auto-join
9830          * @hide
9831          */
9832        public static final String WIFI_ENHANCED_AUTO_JOIN =
9833                 "wifi_enhanced_auto_join";
9834 
9835         /**
9836          * whether settings show RSSI
9837          * @hide
9838          */
9839         public static final String WIFI_NETWORK_SHOW_RSSI =
9840                 "wifi_network_show_rssi";
9841 
9842         /**
9843         * The interval in milliseconds to scan at supplicant when p2p is connected
9844         * @hide
9845         */
9846        public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
9847                "wifi_scan_interval_p2p_connected_ms";
9848 
9849        /**
9850         * Whether the Wi-Fi watchdog is enabled.
9851         */
9852        public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
9853 
9854        /**
9855         * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
9856         * the setting needs to be set to 0 to disable it.
9857         * @hide
9858         */
9859        public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
9860                "wifi_watchdog_poor_network_test_enabled";
9861 
9862        private static final Validator WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR =
9863                ANY_STRING_VALIDATOR;
9864 
9865        /**
9866         * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
9867         * needs to be set to 0 to disable it.
9868         * @hide
9869         */
9870        public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
9871                "wifi_suspend_optimizations_enabled";
9872 
9873        /**
9874         * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1
9875         * will enable it. In the future, additional values may be supported.
9876         * @hide
9877         */
9878        public static final String WIFI_VERBOSE_LOGGING_ENABLED =
9879                "wifi_verbose_logging_enabled";
9880 
9881         /**
9882          * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and
9883          * setting to 1 will enable it. In the future, additional values may be supported.
9884          * @hide
9885          */
9886         public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED =
9887                 "wifi_connected_mac_randomization_enabled";
9888 
9889         /**
9890          * Parameters to adjust the performance of framework wifi scoring methods.
9891          * <p>
9892          * Encoded as a comma-separated key=value list, for example:
9893          *   "rssi5=-80:-77:-70:-57,rssi2=-83:-80:-73:-60,horizon=15"
9894          * This is intended for experimenting with new parameter values,
9895          * and is normally unset or empty. The example does not include all
9896          * parameters that may be honored.
9897          * Default values are provided by code or device configurations.
9898          * Errors in the parameters will cause the entire setting to be ignored.
9899          * @hide
9900          */
9901         public static final String WIFI_SCORE_PARAMS =
9902                 "wifi_score_params";
9903 
9904        /**
9905         * The maximum number of times we will retry a connection to an access
9906         * point for which we have failed in acquiring an IP address from DHCP.
9907         * A value of N means that we will make N+1 connection attempts in all.
9908         */
9909        public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
9910 
9911        /**
9912         * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
9913         * data connectivity to be established after a disconnect from Wi-Fi.
9914         */
9915        public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
9916            "wifi_mobile_data_transition_wakelock_timeout_ms";
9917 
9918        /**
9919         * This setting controls whether WiFi configurations created by a Device Owner app
9920         * should be locked down (that is, be editable or removable only by the Device Owner App,
9921         * not even by Settings app).
9922         * This setting takes integer values. Non-zero values mean DO created configurations
9923         * are locked down. Value of zero means they are not. Default value in the absence of
9924         * actual value to this setting is 0.
9925         */
9926        public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN =
9927                "wifi_device_owner_configs_lockdown";
9928 
9929        /**
9930         * The operational wifi frequency band
9931         * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
9932         * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
9933         * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
9934         *
9935         * @hide
9936         */
9937        public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
9938 
9939        /**
9940         * The Wi-Fi peer-to-peer device name
9941         * @hide
9942         */
9943        public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
9944 
9945        /**
9946         * The min time between wifi disable and wifi enable
9947         * @hide
9948         */
9949        public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
9950 
9951        /**
9952         * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
9953         * from an ephemeral network if there is no BSSID for that network with a non-null score that
9954         * has been seen in this time period.
9955         *
9956         * If this is less than or equal to zero, we use a more conservative behavior and only check
9957         * for a non-null score from the currently connected or target BSSID.
9958         * @hide
9959         */
9960        public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
9961                "wifi_ephemeral_out_of_range_timeout_ms";
9962 
9963        /**
9964         * The number of milliseconds to delay when checking for data stalls during
9965         * non-aggressive detection. (screen is turned off.)
9966         * @hide
9967         */
9968        public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
9969                "data_stall_alarm_non_aggressive_delay_in_ms";
9970 
9971        /**
9972         * The number of milliseconds to delay when checking for data stalls during
9973         * aggressive detection. (screen on or suspected data stall)
9974         * @hide
9975         */
9976        public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
9977                "data_stall_alarm_aggressive_delay_in_ms";
9978 
9979        /**
9980         * The number of milliseconds to allow the provisioning apn to remain active
9981         * @hide
9982         */
9983        public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
9984                "provisioning_apn_alarm_delay_in_ms";
9985 
9986        /**
9987         * The interval in milliseconds at which to check gprs registration
9988         * after the first registration mismatch of gprs and voice service,
9989         * to detect possible data network registration problems.
9990         *
9991         * @hide
9992         */
9993        public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
9994                "gprs_register_check_period_ms";
9995 
9996        /**
9997         * Nonzero causes Log.wtf() to crash.
9998         * @hide
9999         */
10000        public static final String WTF_IS_FATAL = "wtf_is_fatal";
10001 
10002        /**
10003         * Ringer mode. This is used internally, changing this value will not
10004         * change the ringer mode. See AudioManager.
10005         */
10006        public static final String MODE_RINGER = "mode_ringer";
10007 
10008        /**
10009         * Overlay display devices setting.
10010         * The associated value is a specially formatted string that describes the
10011         * size and density of simulated secondary display devices.
10012         * <p>
10013         * Format: {width}x{height}/{dpi};...
10014         * </p><p>
10015         * Example:
10016         * <ul>
10017         * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
10018         * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
10019         * at 1080p and the second at 720p.</li>
10020         * <li>If the value is empty, then no overlay display devices are created.</li>
10021         * </ul></p>
10022         *
10023         * @hide
10024         */
10025        public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
10026 
10027         /**
10028          * Threshold values for the duration and level of a discharge cycle,
10029          * under which we log discharge cycle info.
10030          *
10031          * @hide
10032          */
10033         public static final String
10034                 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
10035 
10036         /** @hide */
10037         public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
10038 
10039         /**
10040          * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
10041          * intents on application crashes and ANRs. If this is disabled, the
10042          * crash/ANR dialog will never display the "Report" button.
10043          * <p>
10044          * Type: int (0 = disallow, 1 = allow)
10045          *
10046          * @hide
10047          */
10048         public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
10049 
10050         /**
10051          * Maximum age of entries kept by {@link DropBoxManager}.
10052          *
10053          * @hide
10054          */
10055         public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
10056 
10057         /**
10058          * Maximum number of entry files which {@link DropBoxManager} will keep
10059          * around.
10060          *
10061          * @hide
10062          */
10063         public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
10064 
10065         /**
10066          * Maximum amount of disk space used by {@link DropBoxManager} no matter
10067          * what.
10068          *
10069          * @hide
10070          */
10071         public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
10072 
10073         /**
10074          * Percent of free disk (excluding reserve) which {@link DropBoxManager}
10075          * will use.
10076          *
10077          * @hide
10078          */
10079         public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
10080 
10081         /**
10082          * Percent of total disk which {@link DropBoxManager} will never dip
10083          * into.
10084          *
10085          * @hide
10086          */
10087         public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
10088 
10089         /**
10090          * Prefix for per-tag dropbox disable/enable settings.
10091          *
10092          * @hide
10093          */
10094         public static final String DROPBOX_TAG_PREFIX = "dropbox:";
10095 
10096         /**
10097          * Lines of logcat to include with system crash/ANR/etc. reports, as a
10098          * prefix of the dropbox tag of the report type. For example,
10099          * "logcat_for_system_server_anr" controls the lines of logcat captured
10100          * with system server ANR reports. 0 to disable.
10101          *
10102          * @hide
10103          */
10104         public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
10105 
10106         /**
10107          * The interval in minutes after which the amount of free storage left
10108          * on the device is logged to the event log
10109          *
10110          * @hide
10111          */
10112         public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
10113 
10114         /**
10115          * Threshold for the amount of change in disk free space required to
10116          * report the amount of free space. Used to prevent spamming the logs
10117          * when the disk free space isn't changing frequently.
10118          *
10119          * @hide
10120          */
10121         public static final String
10122                 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
10123 
10124         /**
10125          * Minimum percentage of free storage on the device that is used to
10126          * determine if the device is running low on storage. The default is 10.
10127          * <p>
10128          * Say this value is set to 10, the device is considered running low on
10129          * storage if 90% or more of the device storage is filled up.
10130          *
10131          * @hide
10132          */
10133         public static final String
10134                 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
10135 
10136         /**
10137          * Maximum byte size of the low storage threshold. This is to ensure
10138          * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
10139          * overly large threshold for large storage devices. Currently this must
10140          * be less than 2GB. This default is 500MB.
10141          *
10142          * @hide
10143          */
10144         public static final String
10145                 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
10146 
10147         /**
10148          * Minimum bytes of free storage on the device before the data partition
10149          * is considered full. By default, 1 MB is reserved to avoid system-wide
10150          * SQLite disk full exceptions.
10151          *
10152          * @hide
10153          */
10154         public static final String
10155                 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
10156 
10157         /**
10158          * Minimum percentage of storage on the device that is reserved for
10159          * cached data.
10160          *
10161          * @hide
10162          */
10163         public static final String
10164                 SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage";
10165 
10166         /**
10167          * Maximum bytes of storage on the device that is reserved for cached
10168          * data.
10169          *
10170          * @hide
10171          */
10172         public static final String
10173                 SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes";
10174 
10175         /**
10176          * The maximum reconnect delay for short network outages or when the
10177          * network is suspended due to phone use.
10178          *
10179          * @hide
10180          */
10181         public static final String
10182                 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
10183 
10184         /**
10185          * The number of milliseconds to delay before sending out
10186          * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
10187          *
10188          * @hide
10189          */
10190         public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
10191 
10192 
10193         /**
10194          * Network sampling interval, in seconds. We'll generate link information
10195          * about bytes/packets sent and error rates based on data sampled in this interval
10196          *
10197          * @hide
10198          */
10199 
10200         public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
10201                 "connectivity_sampling_interval_in_seconds";
10202 
10203         /**
10204          * The series of successively longer delays used in retrying to download PAC file.
10205          * Last delay is used between successful PAC downloads.
10206          *
10207          * @hide
10208          */
10209         public static final String PAC_CHANGE_DELAY = "pac_change_delay";
10210 
10211         /**
10212          * Don't attempt to detect captive portals.
10213          *
10214          * @hide
10215          */
10216         public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0;
10217 
10218         /**
10219          * When detecting a captive portal, display a notification that
10220          * prompts the user to sign in.
10221          *
10222          * @hide
10223          */
10224         public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1;
10225 
10226         /**
10227          * When detecting a captive portal, immediately disconnect from the
10228          * network and do not reconnect to that network in the future.
10229          *
10230          * @hide
10231          */
10232         public static final int CAPTIVE_PORTAL_MODE_AVOID = 2;
10233 
10234         /**
10235          * What to do when connecting a network that presents a captive portal.
10236          * Must be one of the CAPTIVE_PORTAL_MODE_* constants above.
10237          *
10238          * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT.
10239          * @hide
10240          */
10241         public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
10242 
10243         /**
10244          * Setting to turn off captive portal detection. Feature is enabled by
10245          * default and the setting needs to be set to 0 to disable it.
10246          *
10247          * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection
10248          * @hide
10249          */
10250         @Deprecated
10251         public static final String
10252                 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
10253 
10254         /**
10255          * The server used for captive portal detection upon a new conection. A
10256          * 204 response code from the server is used for validation.
10257          * TODO: remove this deprecated symbol.
10258          *
10259          * @hide
10260          */
10261         public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
10262 
10263         /**
10264          * The URL used for HTTPS captive portal detection upon a new connection.
10265          * A 204 response code from the server is used for validation.
10266          *
10267          * @hide
10268          */
10269         public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
10270 
10271         /**
10272          * The URL used for HTTP captive portal detection upon a new connection.
10273          * A 204 response code from the server is used for validation.
10274          *
10275          * @hide
10276          */
10277         public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
10278 
10279         /**
10280          * The URL used for fallback HTTP captive portal detection when previous HTTP
10281          * and HTTPS captive portal detection attemps did not return a conclusive answer.
10282          *
10283          * @hide
10284          */
10285         public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
10286 
10287         /**
10288          * A comma separated list of URLs used for captive portal detection in addition to the
10289          * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings.
10290          *
10291          * @hide
10292          */
10293         public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS =
10294                 "captive_portal_other_fallback_urls";
10295 
10296         /**
10297          * A list of captive portal detection specifications used in addition to the fallback URLs.
10298          * Each spec has the format url@@/@@statusCodeRegex@@/@@contentRegex. Specs are separated
10299          * by "@@,@@".
10300          * @hide
10301          */
10302         public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS =
10303                 "captive_portal_fallback_probe_specs";
10304 
10305         /**
10306          * Whether to use HTTPS for network validation. This is enabled by default and the setting
10307          * needs to be set to 0 to disable it. This setting is a misnomer because captive portals
10308          * don't actually use HTTPS, but it's consistent with the other settings.
10309          *
10310          * @hide
10311          */
10312         public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
10313 
10314         /**
10315          * Which User-Agent string to use in the header of the captive portal detection probes.
10316          * The User-Agent field is unset when this setting has no value (HttpUrlConnection default).
10317          *
10318          * @hide
10319          */
10320         public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
10321 
10322         /**
10323          * Whether network service discovery is enabled.
10324          *
10325          * @hide
10326          */
10327         public static final String NSD_ON = "nsd_on";
10328 
10329         /**
10330          * Let user pick default install location.
10331          *
10332          * @hide
10333          */
10334         public static final String SET_INSTALL_LOCATION = "set_install_location";
10335 
10336         /**
10337          * Default install location value.
10338          * 0 = auto, let system decide
10339          * 1 = internal
10340          * 2 = sdcard
10341          * @hide
10342          */
10343         public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
10344 
10345         /**
10346          * ms during which to consume extra events related to Inet connection
10347          * condition after a transtion to fully-connected
10348          *
10349          * @hide
10350          */
10351         public static final String
10352                 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
10353 
10354         /**
10355          * ms during which to consume extra events related to Inet connection
10356          * condtion after a transtion to partly-connected
10357          *
10358          * @hide
10359          */
10360         public static final String
10361                 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
10362 
10363         /** {@hide} */
10364         public static final String
10365                 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
10366 
10367         /**
10368          * Host name and port for global http proxy. Uses ':' seperator for
10369          * between host and port.
10370          */
10371         public static final String HTTP_PROXY = "http_proxy";
10372 
10373         /**
10374          * Host name for global http proxy. Set via ConnectivityManager.
10375          *
10376          * @hide
10377          */
10378         public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
10379 
10380         /**
10381          * Integer host port for global http proxy. Set via ConnectivityManager.
10382          *
10383          * @hide
10384          */
10385         public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
10386 
10387         /**
10388          * Exclusion list for global proxy. This string contains a list of
10389          * comma-separated domains where the global proxy does not apply.
10390          * Domains should be listed in a comma- separated list. Example of
10391          * acceptable formats: ".domain1.com,my.domain2.com" Use
10392          * ConnectivityManager to set/get.
10393          *
10394          * @hide
10395          */
10396         public static final String
10397                 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
10398 
10399         /**
10400          * The location PAC File for the proxy.
10401          * @hide
10402          */
10403         public static final String
10404                 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
10405 
10406         /**
10407          * Enables the UI setting to allow the user to specify the global HTTP
10408          * proxy and associated exclusion list.
10409          *
10410          * @hide
10411          */
10412         public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
10413 
10414         /**
10415          * Setting for default DNS in case nobody suggests one
10416          *
10417          * @hide
10418          */
10419         public static final String DEFAULT_DNS_SERVER = "default_dns_server";
10420 
10421         /**
10422          * The requested Private DNS mode (string), and an accompanying specifier (string).
10423          *
10424          * Currently, the specifier holds the chosen provider name when the mode requests
10425          * a specific provider. It may be used to store the provider name even when the
10426          * mode changes so that temporarily disabling and re-enabling the specific
10427          * provider mode does not necessitate retyping the provider hostname.
10428          *
10429          * @hide
10430          */
10431         public static final String PRIVATE_DNS_MODE = "private_dns_mode";
10432 
10433         private static final Validator PRIVATE_DNS_MODE_VALIDATOR = ANY_STRING_VALIDATOR;
10434 
10435         /**
10436          * @hide
10437          */
10438         public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier";
10439 
10440         private static final Validator PRIVATE_DNS_SPECIFIER_VALIDATOR = ANY_STRING_VALIDATOR;
10441 
10442         /**
10443           * Forced override of the default mode (hardcoded as "automatic", nee "opportunistic").
10444           * This allows changing the default mode without effectively disabling other modes,
10445           * all of which require explicit user action to enable/configure. See also b/79719289.
10446           *
10447           * Value is a string, suitable for assignment to PRIVATE_DNS_MODE above.
10448           *
10449           * {@hide}
10450           */
10451         public static final String PRIVATE_DNS_DEFAULT_MODE = "private_dns_default_mode";
10452 
10453         /** {@hide} */
10454         public static final String
10455                 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
10456         /** {@hide} */
10457         public static final String
10458                 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
10459         /** {@hide} */
10460         public static final String
10461                 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_";
10462         /** {@hide} */
10463         public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX =
10464                 "bluetooth_a2dp_supports_optional_codecs_";
10465         /** {@hide} */
10466         public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX =
10467                 "bluetooth_a2dp_optional_codecs_enabled_";
10468         /** {@hide} */
10469         public static final String
10470                 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
10471         /** {@hide} */
10472         public static final String
10473                 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
10474         /** {@hide} */
10475         public static final String
10476                 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_";
10477         /** {@hide} */
10478         public static final String
10479                 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_";
10480         /** {@hide} */
10481         public static final String
10482                 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
10483         /** {@hide} */
10484         public static final String
10485                 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_";
10486         /** {@hide} */
10487         public static final String
10488                 BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_";
10489 
10490         /**
10491          * Activity manager specific settings.
10492          * This is encoded as a key=value list, separated by commas. Ex:
10493          *
10494          * "gc_timeout=5000,max_cached_processes=24"
10495          *
10496          * The following keys are supported:
10497          *
10498          * <pre>
10499          * max_cached_processes                 (int)
10500          * background_settle_time               (long)
10501          * fgservice_min_shown_time             (long)
10502          * fgservice_min_report_time            (long)
10503          * fgservice_screen_on_before_time      (long)
10504          * fgservice_screen_on_after_time       (long)
10505          * content_provider_retain_time         (long)
10506          * gc_timeout                           (long)
10507          * gc_min_interval                      (long)
10508          * full_pss_min_interval                (long)
10509          * full_pss_lowered_interval            (long)
10510          * power_check_interval                 (long)
10511          * power_check_max_cpu_1                (int)
10512          * power_check_max_cpu_2                (int)
10513          * power_check_max_cpu_3                (int)
10514          * power_check_max_cpu_4                (int)
10515          * service_usage_interaction_time       (long)
10516          * usage_stats_interaction_interval     (long)
10517          * service_restart_duration             (long)
10518          * service_reset_run_duration           (long)
10519          * service_restart_duration_factor      (int)
10520          * service_min_restart_time_between     (long)
10521          * service_max_inactivity               (long)
10522          * service_bg_start_timeout             (long)
10523          * process_start_async                  (boolean)
10524          * </pre>
10525          *
10526          * <p>
10527          * Type: string
10528          * @hide
10529          * @see com.android.server.am.ActivityManagerConstants
10530          */
10531         public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants";
10532 
10533         /**
10534          * App ops specific settings.
10535          * This is encoded as a key=value list, separated by commas. Ex:
10536          *
10537          * "state_settle_time=10000"
10538          *
10539          * The following keys are supported:
10540          *
10541          * <pre>
10542          * top_state_settle_time                (long)
10543          * fg_service_state_settle_time         (long)
10544          * bg_state_settle_time                 (long)
10545          * </pre>
10546          *
10547          * <p>
10548          * Type: string
10549          * @hide
10550          * @see com.android.server.AppOpsService.Constants
10551          */
10552         public static final String APP_OPS_CONSTANTS = "app_ops_constants";
10553 
10554         /**
10555          * Device Idle (Doze) specific settings.
10556          * This is encoded as a key=value list, separated by commas. Ex:
10557          *
10558          * "inactive_to=60000,sensing_to=400000"
10559          *
10560          * The following keys are supported:
10561          *
10562          * <pre>
10563          * inactive_to                      (long)
10564          * sensing_to                       (long)
10565          * motion_inactive_to               (long)
10566          * idle_after_inactive_to           (long)
10567          * idle_pending_to                  (long)
10568          * max_idle_pending_to              (long)
10569          * idle_pending_factor              (float)
10570          * idle_to                          (long)
10571          * max_idle_to                      (long)
10572          * idle_factor                      (float)
10573          * min_time_to_alarm                (long)
10574          * max_temp_app_whitelist_duration  (long)
10575          * notification_whitelist_duration  (long)
10576          * </pre>
10577          *
10578          * <p>
10579          * Type: string
10580          * @hide
10581          * @see com.android.server.DeviceIdleController.Constants
10582          */
10583         public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants";
10584 
10585         /**
10586          * Battery Saver specific settings
10587          * This is encoded as a key=value list, separated by commas. Ex:
10588          *
10589          * "vibration_disabled=true,adjust_brightness_factor=0.5"
10590          *
10591          * The following keys are supported:
10592          *
10593          * <pre>
10594          * vibration_disabled                (boolean)
10595          * animation_disabled                (boolean)
10596          * soundtrigger_disabled             (boolean)
10597          * fullbackup_deferred               (boolean)
10598          * keyvaluebackup_deferred           (boolean)
10599          * firewall_disabled                 (boolean)
10600          * gps_mode                          (int)
10601          * adjust_brightness_disabled        (boolean)
10602          * adjust_brightness_factor          (float)
10603          * </pre>
10604          * @hide
10605          * @see com.android.server.power.BatterySaverPolicy
10606          */
10607         public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants";
10608 
10609         /**
10610          * Battery Saver device specific settings
10611          * This is encoded as a key=value list, separated by commas.
10612          * See {@link com.android.server.power.BatterySaverPolicy} for the details.
10613          *
10614          * @hide
10615          */
10616         public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS =
10617                 "battery_saver_device_specific_constants";
10618 
10619         /**
10620          * Battery tip specific settings
10621          * This is encoded as a key=value list, separated by commas. Ex:
10622          *
10623          * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true,"
10624          * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50,"
10625          * "high_usage_battery_draining=25,high_usage_period_ms=3000"
10626          *
10627          * The following keys are supported:
10628          *
10629          * <pre>
10630          * battery_tip_enabled              (boolean)
10631          * summary_enabled                  (boolean)
10632          * battery_saver_tip_enabled        (boolean)
10633          * high_usage_enabled               (boolean)
10634          * high_usage_app_count             (int)
10635          * high_usage_period_ms             (long)
10636          * high_usage_battery_draining      (int)
10637          * app_restriction_enabled          (boolean)
10638          * reduced_battery_enabled          (boolean)
10639          * reduced_battery_percent          (int)
10640          * low_battery_enabled              (boolean)
10641          * low_battery_hour                 (int)
10642          * </pre>
10643          * @hide
10644          */
10645         public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants";
10646 
10647         /**
10648          * Battery anomaly detection specific settings
10649          * This is encoded as a key=value list, separated by commas.
10650          * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via
10651          * {@link Uri#encode(String)}, separated by colons. Ex:
10652          *
10653          * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true,"
10654          * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon"
10655          *
10656          * The following keys are supported:
10657          *
10658          * <pre>
10659          * anomaly_detection_enabled       (boolean)
10660          * wakelock_enabled                (boolean)
10661          * wakelock_threshold              (long)
10662          * wakeup_alarm_enabled            (boolean)
10663          * wakeup_alarm_threshold          (long)
10664          * wakeup_blacklisted_tags         (string)
10665          * bluetooth_scan_enabled          (boolean)
10666          * bluetooth_scan_threshold        (long)
10667          * </pre>
10668          * @hide
10669          */
10670         public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants";
10671 
10672         /**
10673          * An integer to show the version of the anomaly config. Ex: 1, which means
10674          * current version is 1.
10675          * @hide
10676          */
10677         public static final String ANOMALY_CONFIG_VERSION = "anomaly_config_version";
10678 
10679         /**
10680          * A base64-encoded string represents anomaly stats config, used for
10681          * {@link android.app.StatsManager}.
10682          * @hide
10683          */
10684         public static final String ANOMALY_CONFIG = "anomaly_config";
10685 
10686         /**
10687          * Always on display(AOD) specific settings
10688          * This is encoded as a key=value list, separated by commas. Ex:
10689          *
10690          * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4"
10691          *
10692          * The following keys are supported:
10693          *
10694          * <pre>
10695          * screen_brightness_array         (int[])
10696          * dimming_scrim_array             (int[])
10697          * prox_screen_off_delay           (long)
10698          * prox_cooldown_trigger           (long)
10699          * prox_cooldown_period            (long)
10700          * </pre>
10701          * @hide
10702          */
10703         public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants";
10704 
10705         /**
10706         * System VDSO global setting. This links to the "sys.vdso" system property.
10707         * The following values are supported:
10708         * false  -> both 32 and 64 bit vdso disabled
10709         * 32     -> 32 bit vdso enabled
10710         * 64     -> 64 bit vdso enabled
10711         * Any other value defaults to both 32 bit and 64 bit true.
10712         * @hide
10713         */
10714         public static final String SYS_VDSO = "sys_vdso";
10715 
10716         /**
10717         * UidCpuPower global setting. This links the sys.uidcpupower system property.
10718         * The following values are supported:
10719         * 0 -> /proc/uid_cpupower/* are disabled
10720         * 1 -> /proc/uid_cpupower/* are enabled
10721         * Any other value defaults to enabled.
10722         * @hide
10723         */
10724         public static final String SYS_UIDCPUPOWER = "sys_uidcpupower";
10725 
10726         /**
10727         * traced global setting. This controls weather the deamons: traced and
10728         * traced_probes run. This links the sys.traced system property.
10729         * The following values are supported:
10730         * 0 -> traced and traced_probes are disabled
10731         * 1 -> traced and traced_probes are enabled
10732         * Any other value defaults to disabled.
10733         * @hide
10734         */
10735         public static final String SYS_TRACED = "sys_traced";
10736 
10737         /**
10738          * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the
10739          * device for this setting to take full effect.
10740          *
10741          * @hide
10742          */
10743         public static final String FPS_DEVISOR = "fps_divisor";
10744 
10745         /**
10746          * Flag to enable or disable display panel low power mode (lpm)
10747          * false -> Display panel power saving mode is disabled.
10748          * true  -> Display panel power saving mode is enabled.
10749          *
10750          * @hide
10751          */
10752         public static final String DISPLAY_PANEL_LPM = "display_panel_lpm";
10753 
10754         /**
10755          * App standby (app idle) specific settings.
10756          * This is encoded as a key=value list, separated by commas. Ex:
10757          * <p>
10758          * "idle_duration=5000,parole_interval=4500,screen_thresholds=0/0/60000/120000"
10759          * <p>
10760          * All durations are in millis.
10761          * Array values are separated by forward slashes
10762          * The following keys are supported:
10763          *
10764          * <pre>
10765          * parole_interval                  (long)
10766          * parole_window                    (long)
10767          * parole_duration                  (long)
10768          * screen_thresholds                (long[4])
10769          * elapsed_thresholds               (long[4])
10770          * strong_usage_duration            (long)
10771          * notification_seen_duration       (long)
10772          * system_update_usage_duration     (long)
10773          * prediction_timeout               (long)
10774          * sync_adapter_duration            (long)
10775          * exempted_sync_duration           (long)
10776          * system_interaction_duration      (long)
10777          * stable_charging_threshold        (long)
10778          *
10779          * idle_duration        (long) // This is deprecated and used to circumvent b/26355386.
10780          * idle_duration2       (long) // deprecated
10781          * wallclock_threshold  (long) // deprecated
10782          * </pre>
10783          *
10784          * <p>
10785          * Type: string
10786          * @hide
10787          * @see com.android.server.usage.UsageStatsService.SettingsObserver
10788          */
10789         public static final String APP_IDLE_CONSTANTS = "app_idle_constants";
10790 
10791         /**
10792          * Power manager specific settings.
10793          * This is encoded as a key=value list, separated by commas. Ex:
10794          *
10795          * "no_cached_wake_locks=1"
10796          *
10797          * The following keys are supported:
10798          *
10799          * <pre>
10800          * no_cached_wake_locks                 (boolean)
10801          * </pre>
10802          *
10803          * <p>
10804          * Type: string
10805          * @hide
10806          * @see com.android.server.power.PowerManagerConstants
10807          */
10808         public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants";
10809 
10810         /**
10811          * Alarm manager specific settings.
10812          * This is encoded as a key=value list, separated by commas. Ex:
10813          *
10814          * "min_futurity=5000,allow_while_idle_short_time=4500"
10815          *
10816          * The following keys are supported:
10817          *
10818          * <pre>
10819          * min_futurity                         (long)
10820          * min_interval                         (long)
10821          * allow_while_idle_short_time          (long)
10822          * allow_while_idle_long_time           (long)
10823          * allow_while_idle_whitelist_duration  (long)
10824          * </pre>
10825          *
10826          * <p>
10827          * Type: string
10828          * @hide
10829          * @see com.android.server.AlarmManagerService.Constants
10830          */
10831         public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants";
10832 
10833         /**
10834          * Job scheduler specific settings.
10835          * This is encoded as a key=value list, separated by commas. Ex:
10836          *
10837          * "min_ready_jobs_count=2,moderate_use_factor=.5"
10838          *
10839          * The following keys are supported:
10840          *
10841          * <pre>
10842          * min_idle_count                       (int)
10843          * min_charging_count                   (int)
10844          * min_connectivity_count               (int)
10845          * min_content_count                    (int)
10846          * min_ready_jobs_count                 (int)
10847          * heavy_use_factor                     (float)
10848          * moderate_use_factor                  (float)
10849          * fg_job_count                         (int)
10850          * bg_normal_job_count                  (int)
10851          * bg_moderate_job_count                (int)
10852          * bg_low_job_count                     (int)
10853          * bg_critical_job_count                (int)
10854          * </pre>
10855          *
10856          * <p>
10857          * Type: string
10858          * @hide
10859          * @see com.android.server.job.JobSchedulerService.Constants
10860          */
10861         public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants";
10862 
10863         /**
10864          * ShortcutManager specific settings.
10865          * This is encoded as a key=value list, separated by commas. Ex:
10866          *
10867          * "reset_interval_sec=86400,max_updates_per_interval=1"
10868          *
10869          * The following keys are supported:
10870          *
10871          * <pre>
10872          * reset_interval_sec              (long)
10873          * max_updates_per_interval        (int)
10874          * max_icon_dimension_dp           (int, DP)
10875          * max_icon_dimension_dp_lowram    (int, DP)
10876          * max_shortcuts                   (int)
10877          * icon_quality                    (int, 0-100)
10878          * icon_format                     (String)
10879          * </pre>
10880          *
10881          * <p>
10882          * Type: string
10883          * @hide
10884          * @see com.android.server.pm.ShortcutService.ConfigConstants
10885          */
10886         public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants";
10887 
10888         /**
10889          * DevicePolicyManager specific settings.
10890          * This is encoded as a key=value list, separated by commas. Ex:
10891          *
10892          * <pre>
10893          * das_died_service_reconnect_backoff_sec       (long)
10894          * das_died_service_reconnect_backoff_increase  (float)
10895          * das_died_service_reconnect_max_backoff_sec   (long)
10896          * </pre>
10897          *
10898          * <p>
10899          * Type: string
10900          * @hide
10901          * see also com.android.server.devicepolicy.DevicePolicyConstants
10902          */
10903         public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants";
10904 
10905         /**
10906          * TextClassifier specific settings.
10907          * This is encoded as a key=value list, separated by commas. String[] types like
10908          * entity_list_default use ":" as delimiter for values. Ex:
10909          *
10910          * <pre>
10911          * smart_linkify_enabled                    (boolean)
10912          * system_textclassifier_enabled            (boolean)
10913          * model_dark_launch_enabled                (boolean)
10914          * smart_selection_enabled                  (boolean)
10915          * smart_text_share_enabled                 (boolean)
10916          * smart_linkify_enabled                    (boolean)
10917          * smart_select_animation_enabled           (boolean)
10918          * suggest_selection_max_range_length       (int)
10919          * classify_text_max_range_length           (int)
10920          * generate_links_max_text_length           (int)
10921          * generate_links_log_sample_rate           (int)
10922          * entity_list_default                      (String[])
10923          * entity_list_not_editable                 (String[])
10924          * entity_list_editable                     (String[])
10925          * </pre>
10926          *
10927          * <p>
10928          * Type: string
10929          * @hide
10930          * see also android.view.textclassifier.TextClassificationConstants
10931          */
10932         public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants";
10933 
10934         /**
10935          * BatteryStats specific settings.
10936          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
10937          *
10938          * The following keys are supported:
10939          * <pre>
10940          * track_cpu_times_by_proc_state (boolean)
10941          * track_cpu_active_cluster_time (boolean)
10942          * read_binary_cpu_time          (boolean)
10943          * proc_state_cpu_times_read_delay_ms (long)
10944          * external_stats_collection_rate_limit_ms (long)
10945          * battery_level_collection_delay_ms (long)
10946          * </pre>
10947          *
10948          * <p>
10949          * Type: string
10950          * @hide
10951          * see also com.android.internal.os.BatteryStatsImpl.Constants
10952          */
10953         public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants";
10954 
10955         /**
10956          * SyncManager specific settings.
10957          *
10958          * <p>
10959          * Type: string
10960          * @hide
10961          * @see com.android.server.content.SyncManagerConstants
10962          */
10963         public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants";
10964 
10965         /**
10966          * Whether or not App Standby feature is enabled by system. This controls throttling of apps
10967          * based on usage patterns and predictions. Platform will turn on this feature if both this
10968          * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on.
10969          * Type: int (0 for false, 1 for true)
10970          * Default: 1
10971          * @hide
10972          * @see #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED
10973          */
10974         public static final String APP_STANDBY_ENABLED = "app_standby_enabled";
10975 
10976         /**
10977          * Whether or not adaptive battery feature is enabled by user. Platform will turn on this
10978          * feature if both this flag and {@link #APP_STANDBY_ENABLED} is on.
10979          * Type: int (0 for false, 1 for true)
10980          * Default: 1
10981          * @hide
10982          * @see #APP_STANDBY_ENABLED
10983          */
10984         public static final String ADAPTIVE_BATTERY_MANAGEMENT_ENABLED =
10985                 "adaptive_battery_management_enabled";
10986 
10987         /**
10988          * Whether or not app auto restriction is enabled. When it is enabled, settings app will
10989          * auto restrict the app if it has bad behavior(e.g. hold wakelock for long time).
10990          *
10991          * Type: boolean (0 for false, 1 for true)
10992          * Default: 1
10993          *
10994          * @hide
10995          */
10996         public static final String APP_AUTO_RESTRICTION_ENABLED =
10997                 "app_auto_restriction_enabled";
10998 
10999         private static final Validator APP_AUTO_RESTRICTION_ENABLED_VALIDATOR =
11000                 BOOLEAN_VALIDATOR;
11001 
11002         /**
11003          * Feature flag to enable or disable the Forced App Standby feature.
11004          * Type: int (0 for false, 1 for true)
11005          * Default: 1
11006          * @hide
11007          */
11008         public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled";
11009 
11010         /**
11011          * Whether or not to enable Forced App Standby on small battery devices.
11012          * Type: int (0 for false, 1 for true)
11013          * Default: 0
11014          * @hide
11015          */
11016         public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED
11017                 = "forced_app_standby_for_small_battery_enabled";
11018 
11019         /**
11020          * Whether or not to enable the User Absent, Radios Off feature on small battery devices.
11021          * Type: int (0 for false, 1 for true)
11022          * Default: 0
11023          * @hide
11024          */
11025         public static final String USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED
11026                 = "user_absent_radios_off_for_small_battery_enabled";
11027 
11028         /**
11029          * Whether or not to turn on Wifi when proxy is disconnected.
11030          * Type: int (0 for false, 1 for true)
11031          * Default: 1
11032          * @hide
11033          */
11034         public static final String WIFI_ON_WHEN_PROXY_DISCONNECTED
11035                 = "wifi_on_when_proxy_disconnected";
11036 
11037         /**
11038          * Time Only Mode specific settings.
11039          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
11040          *
11041          * The following keys are supported:
11042          *
11043          * <pre>
11044          * enabled                  (boolean)
11045          * disable_tilt_to_wake     (boolean)
11046          * disable_touch_to_wake    (boolean)
11047          * </pre>
11048          * Type: string
11049          * @hide
11050          */
11051         public static final String TIME_ONLY_MODE_CONSTANTS
11052                 = "time_only_mode_constants";
11053 
11054         /**
11055          * Whether of not to send keycode sleep for ungaze when Home is the foreground activity on
11056          * watch type devices.
11057          * Type: int (0 for false, 1 for true)
11058          * Default: 0
11059          * @hide
11060          */
11061         public static final String UNGAZE_SLEEP_ENABLED = "ungaze_sleep_enabled";
11062 
11063         /**
11064          * Whether or not Network Watchlist feature is enabled.
11065          * Type: int (0 for false, 1 for true)
11066          * Default: 0
11067          * @hide
11068          */
11069         public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled";
11070 
11071         /**
11072          * Flag to keep background restricted profiles running after exiting. If disabled,
11073          * the restricted profile can be put into stopped state as soon as the user leaves it.
11074          * Type: int (0 for false, 1 for true)
11075          *
11076          * Overridden by the system based on device information. If null, the value specified
11077          * by {@code config_keepRestrictedProfilesInBackground} is used.
11078          *
11079          * @hide
11080          */
11081         public static final String KEEP_PROFILE_IN_BACKGROUND = "keep_profile_in_background";
11082 
11083         /**
11084          * Get the key that retrieves a bluetooth headset's priority.
11085          * @hide
11086          */
getBluetoothHeadsetPriorityKey(String address)11087         public static final String getBluetoothHeadsetPriorityKey(String address) {
11088             return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11089         }
11090 
11091         /**
11092          * Get the key that retrieves a bluetooth a2dp sink's priority.
11093          * @hide
11094          */
getBluetoothA2dpSinkPriorityKey(String address)11095         public static final String getBluetoothA2dpSinkPriorityKey(String address) {
11096             return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11097         }
11098 
11099         /**
11100          * Get the key that retrieves a bluetooth a2dp src's priority.
11101          * @hide
11102          */
getBluetoothA2dpSrcPriorityKey(String address)11103         public static final String getBluetoothA2dpSrcPriorityKey(String address) {
11104             return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11105         }
11106 
11107         /**
11108          * Get the key that retrieves a bluetooth a2dp device's ability to support optional codecs.
11109          * @hide
11110          */
getBluetoothA2dpSupportsOptionalCodecsKey(String address)11111         public static final String getBluetoothA2dpSupportsOptionalCodecsKey(String address) {
11112             return BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX +
11113                     address.toUpperCase(Locale.ROOT);
11114         }
11115 
11116         /**
11117          * Get the key that retrieves whether a bluetooth a2dp device should have optional codecs
11118          * enabled.
11119          * @hide
11120          */
getBluetoothA2dpOptionalCodecsEnabledKey(String address)11121         public static final String getBluetoothA2dpOptionalCodecsEnabledKey(String address) {
11122             return BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX +
11123                     address.toUpperCase(Locale.ROOT);
11124         }
11125 
11126         /**
11127          * Get the key that retrieves a bluetooth Input Device's priority.
11128          * @hide
11129          */
getBluetoothHidHostPriorityKey(String address)11130         public static final String getBluetoothHidHostPriorityKey(String address) {
11131             return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11132         }
11133 
11134         /**
11135          * Get the key that retrieves a bluetooth pan client priority.
11136          * @hide
11137          */
getBluetoothPanPriorityKey(String address)11138         public static final String getBluetoothPanPriorityKey(String address) {
11139             return BLUETOOTH_PAN_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11140         }
11141 
11142         /**
11143          * Get the key that retrieves a bluetooth hearing aid priority.
11144          * @hide
11145          */
getBluetoothHearingAidPriorityKey(String address)11146         public static final String getBluetoothHearingAidPriorityKey(String address) {
11147             return BLUETOOTH_HEARING_AID_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11148         }
11149 
11150         /**
11151          * Get the key that retrieves a bluetooth map priority.
11152          * @hide
11153          */
getBluetoothMapPriorityKey(String address)11154         public static final String getBluetoothMapPriorityKey(String address) {
11155             return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11156         }
11157 
11158         /**
11159          * Get the key that retrieves a bluetooth map client priority.
11160          * @hide
11161          */
getBluetoothMapClientPriorityKey(String address)11162         public static final String getBluetoothMapClientPriorityKey(String address) {
11163             return BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11164         }
11165 
11166         /**
11167          * Get the key that retrieves a bluetooth pbap client priority.
11168          * @hide
11169          */
getBluetoothPbapClientPriorityKey(String address)11170         public static final String getBluetoothPbapClientPriorityKey(String address) {
11171             return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11172         }
11173 
11174         /**
11175          * Get the key that retrieves a bluetooth sap priority.
11176          * @hide
11177          */
getBluetoothSapPriorityKey(String address)11178         public static final String getBluetoothSapPriorityKey(String address) {
11179             return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
11180         }
11181 
11182         /**
11183          * Scaling factor for normal window animations. Setting to 0 will
11184          * disable window animations.
11185          */
11186         public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
11187 
11188         /**
11189          * Scaling factor for activity transition animations. Setting to 0 will
11190          * disable window animations.
11191          */
11192         public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
11193 
11194         /**
11195          * Scaling factor for Animator-based animations. This affects both the
11196          * start delay and duration of all such animations. Setting to 0 will
11197          * cause animations to end immediately. The default value is 1.
11198          */
11199         public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
11200 
11201         /**
11202          * Scaling factor for normal window animations. Setting to 0 will
11203          * disable window animations.
11204          *
11205          * @hide
11206          */
11207         public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
11208 
11209         /**
11210          * If 0, the compatibility mode is off for all applications.
11211          * If 1, older applications run under compatibility mode.
11212          * TODO: remove this settings before code freeze (bug/1907571)
11213          * @hide
11214          */
11215         public static final String COMPATIBILITY_MODE = "compatibility_mode";
11216 
11217         /**
11218          * CDMA only settings
11219          * Emergency Tone  0 = Off
11220          *                 1 = Alert
11221          *                 2 = Vibrate
11222          * @hide
11223          */
11224         public static final String EMERGENCY_TONE = "emergency_tone";
11225 
11226         private static final Validator EMERGENCY_TONE_VALIDATOR =
11227                 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"});
11228 
11229         /**
11230          * CDMA only settings
11231          * Whether the auto retry is enabled. The value is
11232          * boolean (1 or 0).
11233          * @hide
11234          */
11235         public static final String CALL_AUTO_RETRY = "call_auto_retry";
11236 
11237         private static final Validator CALL_AUTO_RETRY_VALIDATOR = BOOLEAN_VALIDATOR;
11238 
11239         /**
11240          * A setting that can be read whether the emergency affordance is currently needed.
11241          * The value is a boolean (1 or 0).
11242          * @hide
11243          */
11244         public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed";
11245 
11246         /**
11247          * See RIL_PreferredNetworkType in ril.h
11248          * @hide
11249          */
11250         public static final String PREFERRED_NETWORK_MODE =
11251                 "preferred_network_mode";
11252 
11253         /**
11254          * Name of an application package to be debugged.
11255          */
11256         public static final String DEBUG_APP = "debug_app";
11257 
11258         /**
11259          * If 1, when launching DEBUG_APP it will wait for the debugger before
11260          * starting user code.  If 0, it will run normally.
11261          */
11262         public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
11263 
11264         /**
11265          * Allow GPU debug layers?
11266          * 0 = no
11267          * 1 = yes
11268          * @hide
11269          */
11270         public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers";
11271 
11272         /**
11273          * App allowed to load GPU debug layers
11274          * @hide
11275          */
11276         public static final String GPU_DEBUG_APP = "gpu_debug_app";
11277 
11278         /**
11279          * Ordered GPU debug layer list
11280          * i.e. <layer1>:<layer2>:...:<layerN>
11281          * @hide
11282          */
11283         public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers";
11284 
11285         /**
11286          * Control whether the process CPU usage meter should be shown.
11287          *
11288          * @deprecated This functionality is no longer available as of
11289          * {@link android.os.Build.VERSION_CODES#N_MR1}.
11290          */
11291         @Deprecated
11292         public static final String SHOW_PROCESSES = "show_processes";
11293 
11294         /**
11295          * If 1 low power mode (aka battery saver) is enabled.
11296          * @hide
11297          */
11298         @TestApi
11299         public static final String LOW_POWER_MODE = "low_power";
11300 
11301         /**
11302          * If 1, battery saver ({@link #LOW_POWER_MODE}) will be re-activated after the device
11303          * is unplugged from a charger or rebooted.
11304          * @hide
11305          */
11306         @TestApi
11307         public static final String LOW_POWER_MODE_STICKY = "low_power_sticky";
11308 
11309         /**
11310          * Battery level [1-100] at which low power mode automatically turns on.
11311          * If 0, it will not automatically turn on.
11312          * @hide
11313          */
11314         public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
11315 
11316         private static final Validator LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR =
11317                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 100);
11318 
11319 
11320         /**
11321          * The max value for {@link #LOW_POWER_MODE_TRIGGER_LEVEL}. If this setting is not set
11322          * or the value is 0, the default max will be used.
11323          *
11324          * @hide
11325          */
11326         public static final String LOW_POWER_MODE_TRIGGER_LEVEL_MAX = "low_power_trigger_level_max";
11327 
11328         /**
11329          * See com.android.settingslib.fuelgauge.BatterySaverUtils.
11330          * @hide
11331          */
11332         public static final String LOW_POWER_MODE_SUGGESTION_PARAMS =
11333                 "low_power_mode_suggestion_params";
11334 
11335         /**
11336          * If not 0, the activity manager will aggressively finish activities and
11337          * processes as soon as they are no longer needed.  If 0, the normal
11338          * extended lifetime is used.
11339          */
11340         public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
11341 
11342         /**
11343          * If nonzero, all system error dialogs will be hidden.  For example, the
11344          * crash and ANR dialogs will not be shown, and the system will just proceed
11345          * as if they had been accepted by the user.
11346          * @hide
11347          */
11348         public static final String HIDE_ERROR_DIALOGS = "hide_error_dialogs";
11349 
11350         /**
11351          * Use Dock audio output for media:
11352          *      0 = disabled
11353          *      1 = enabled
11354          * @hide
11355          */
11356         public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
11357 
11358         private static final Validator DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
11359 
11360         /**
11361          * The surround sound formats AC3, DTS or IEC61937 are
11362          * available for use if they are detected.
11363          * This is the default mode.
11364          *
11365          * Note that AUTO is equivalent to ALWAYS for Android TVs and other
11366          * devices that have an S/PDIF output. This is because S/PDIF
11367          * is unidirectional and the TV cannot know if a decoder is
11368          * connected. So it assumes they are always available.
11369          * @hide
11370          */
11371          public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0;
11372 
11373         /**
11374          * AC3, DTS or IEC61937 are NEVER available, even if they
11375          * are detected by the hardware. Those formats will not be
11376          * reported.
11377          *
11378          * An example use case would be an AVR reports that it is capable of
11379          * surround sound decoding but is broken. If NEVER is chosen
11380          * then apps must use PCM output instead of encoded output.
11381          * @hide
11382          */
11383          public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1;
11384 
11385         /**
11386          * AC3, DTS or IEC61937 are ALWAYS available, even if they
11387          * are not detected by the hardware. Those formats will be
11388          * reported as part of the HDMI output capability. Applications
11389          * are then free to use either PCM or encoded output.
11390          *
11391          * An example use case would be a when TV was connected over
11392          * TOS-link to an AVR. But the TV could not see it because TOS-link
11393          * is unidirectional.
11394          * @hide
11395          */
11396          public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2;
11397 
11398         /**
11399          * Surround sound formats are available according to the choice
11400          * of user, even if they are not detected by the hardware. Those
11401          * formats will be reported as part of the HDMI output capability.
11402          * Applications are then free to use either PCM or encoded output.
11403          *
11404          * An example use case would be an AVR that doesn't report a surround
11405          * format while the user knows the AVR does support it.
11406          * @hide
11407          */
11408         public static final int ENCODED_SURROUND_OUTPUT_MANUAL = 3;
11409 
11410         /**
11411          * Set to ENCODED_SURROUND_OUTPUT_AUTO,
11412          * ENCODED_SURROUND_OUTPUT_NEVER,
11413          * ENCODED_SURROUND_OUTPUT_ALWAYS or
11414          * ENCODED_SURROUND_OUTPUT_MANUAL
11415          * @hide
11416          */
11417         public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output";
11418 
11419         private static final Validator ENCODED_SURROUND_OUTPUT_VALIDATOR =
11420                 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2", "3"});
11421 
11422         /**
11423          * Surround sounds formats that are enabled when ENCODED_SURROUND_OUTPUT is set to
11424          * ENCODED_SURROUND_OUTPUT_MANUAL. Encoded as comma separated list. Allowed values
11425          * are the format constants defined in AudioFormat.java. Ex:
11426          *
11427          * "5,6"
11428          *
11429          * @hide
11430          */
11431         public static final String ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS =
11432                 "encoded_surround_output_enabled_formats";
11433 
11434         private static final Validator ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS_VALIDATOR =
11435                 new Validator() {
11436             @Override
11437             public boolean validate(@Nullable String value) {
11438                 try {
11439                     String[] surroundFormats = TextUtils.split(value, ",");
11440                     for (String format : surroundFormats) {
11441                         int audioFormat = Integer.valueOf(format);
11442                         boolean isSurroundFormat = false;
11443                         for (int sf : AudioFormat.SURROUND_SOUND_ENCODING) {
11444                             if (sf == audioFormat) {
11445                                 isSurroundFormat = true;
11446                                 break;
11447                             }
11448                         }
11449                         if (!isSurroundFormat) {
11450                             return false;
11451                         }
11452                     }
11453                     return true;
11454                 } catch (NumberFormatException e) {
11455                     return false;
11456                 }
11457             }
11458         };
11459 
11460         /**
11461          * Persisted safe headphone volume management state by AudioService
11462          * @hide
11463          */
11464         public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
11465 
11466         /**
11467          * URL for tzinfo (time zone) updates
11468          * @hide
11469          */
11470         public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
11471 
11472         /**
11473          * URL for tzinfo (time zone) update metadata
11474          * @hide
11475          */
11476         public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
11477 
11478         /**
11479          * URL for selinux (mandatory access control) updates
11480          * @hide
11481          */
11482         public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
11483 
11484         /**
11485          * URL for selinux (mandatory access control) update metadata
11486          * @hide
11487          */
11488         public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
11489 
11490         /**
11491          * URL for sms short code updates
11492          * @hide
11493          */
11494         public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
11495                 "sms_short_codes_content_url";
11496 
11497         /**
11498          * URL for sms short code update metadata
11499          * @hide
11500          */
11501         public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
11502                 "sms_short_codes_metadata_url";
11503 
11504         /**
11505          * URL for apn_db updates
11506          * @hide
11507          */
11508         public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url";
11509 
11510         /**
11511          * URL for apn_db update metadata
11512          * @hide
11513          */
11514         public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url";
11515 
11516         /**
11517          * URL for cert pinlist updates
11518          * @hide
11519          */
11520         public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
11521 
11522         /**
11523          * URL for cert pinlist updates
11524          * @hide
11525          */
11526         public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
11527 
11528         /**
11529          * URL for intent firewall updates
11530          * @hide
11531          */
11532         public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
11533                 "intent_firewall_content_url";
11534 
11535         /**
11536          * URL for intent firewall update metadata
11537          * @hide
11538          */
11539         public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
11540                 "intent_firewall_metadata_url";
11541 
11542         /**
11543          * URL for lang id model updates
11544          * @hide
11545          */
11546         public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url";
11547 
11548         /**
11549          * URL for lang id model update metadata
11550          * @hide
11551          */
11552         public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url";
11553 
11554         /**
11555          * URL for smart selection model updates
11556          * @hide
11557          */
11558         public static final String SMART_SELECTION_UPDATE_CONTENT_URL =
11559                 "smart_selection_content_url";
11560 
11561         /**
11562          * URL for smart selection model update metadata
11563          * @hide
11564          */
11565         public static final String SMART_SELECTION_UPDATE_METADATA_URL =
11566                 "smart_selection_metadata_url";
11567 
11568         /**
11569          * SELinux enforcement status. If 0, permissive; if 1, enforcing.
11570          * @hide
11571          */
11572         public static final String SELINUX_STATUS = "selinux_status";
11573 
11574         /**
11575          * Developer setting to force RTL layout.
11576          * @hide
11577          */
11578         public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
11579 
11580         /**
11581          * Milliseconds after screen-off after which low battery sounds will be silenced.
11582          *
11583          * If zero, battery sounds will always play.
11584          * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
11585          *
11586          * @hide
11587          */
11588         public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
11589 
11590         /**
11591          * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
11592          * the caller is done with this, they should call {@link ContentResolver#delete} to
11593          * clean up any value that they may have written.
11594          *
11595          * @hide
11596          */
11597         public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
11598 
11599         /**
11600          * Defines global runtime overrides to window policy.
11601          *
11602          * See {@link com.android.server.policy.PolicyControl} for value format.
11603          *
11604          * @hide
11605          */
11606         public static final String POLICY_CONTROL = "policy_control";
11607 
11608         /**
11609          * {@link android.view.DisplayCutout DisplayCutout} emulation mode.
11610          *
11611          * @hide
11612          */
11613         public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout";
11614 
11615         /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0;
11616         /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1;
11617 
11618         /**
11619          * A colon separated list of keys for Settings Slices.
11620          *
11621          * @hide
11622          */
11623         public static final String BLOCKED_SLICES = "blocked_slices";
11624 
11625         /**
11626          * Defines global zen mode.  ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
11627          * or ZEN_MODE_NO_INTERRUPTIONS.
11628          *
11629          * @hide
11630          */
11631         public static final String ZEN_MODE = "zen_mode";
11632 
11633         /** @hide */ public static final int ZEN_MODE_OFF = 0;
11634         /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
11635         /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
11636         /** @hide */ public static final int ZEN_MODE_ALARMS = 3;
11637 
zenModeToString(int mode)11638         /** @hide */ public static String zenModeToString(int mode) {
11639             if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
11640             if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
11641             if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
11642             return "ZEN_MODE_OFF";
11643         }
11644 
isValidZenMode(int value)11645         /** @hide */ public static boolean isValidZenMode(int value) {
11646             switch (value) {
11647                 case Global.ZEN_MODE_OFF:
11648                 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
11649                 case Global.ZEN_MODE_ALARMS:
11650                 case Global.ZEN_MODE_NO_INTERRUPTIONS:
11651                     return true;
11652                 default:
11653                     return false;
11654             }
11655         }
11656 
11657         /**
11658          * Value of the ringer before entering zen mode.
11659          *
11660          * @hide
11661          */
11662         public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level";
11663 
11664         /**
11665          * Opaque value, changes when persisted zen mode configuration changes.
11666          *
11667          * @hide
11668          */
11669         public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
11670 
11671         /**
11672          * If 0, turning on dnd manually will last indefinitely.
11673          * Else if non-negative, turning on dnd manually will last for this many minutes.
11674          * Else (if negative), turning on dnd manually will surface a dialog that prompts
11675          * user to specify a duration.
11676          * @hide
11677          */
11678         public static final String ZEN_DURATION = "zen_duration";
11679 
11680         private static final Validator ZEN_DURATION_VALIDATOR = ANY_INTEGER_VALIDATOR;
11681 
11682         /** @hide */ public static final int ZEN_DURATION_PROMPT = -1;
11683         /** @hide */ public static final int ZEN_DURATION_FOREVER = 0;
11684 
11685         /**
11686          * Defines global heads up toggle.  One of HEADS_UP_OFF, HEADS_UP_ON.
11687          *
11688          * @hide
11689          */
11690         public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
11691                 "heads_up_notifications_enabled";
11692 
11693         /** @hide */ public static final int HEADS_UP_OFF = 0;
11694         /** @hide */ public static final int HEADS_UP_ON = 1;
11695 
11696         /**
11697          * The name of the device
11698          */
11699         public static final String DEVICE_NAME = "device_name";
11700 
11701         /**
11702          * Whether the NetworkScoringService has been first initialized.
11703          * <p>
11704          * Type: int (0 for false, 1 for true)
11705          * @hide
11706          */
11707         public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
11708 
11709         /**
11710          * Whether the user wants to be prompted for password to decrypt the device on boot.
11711          * This only matters if the storage is encrypted.
11712          * <p>
11713          * Type: int (0 for false, 1 for true)
11714          * @hide
11715          */
11716         public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
11717 
11718         /**
11719          * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config
11720          * value {@link CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL}.
11721          * <p>
11722          * Type: int (0 for false, 1 for true)
11723          * @hide
11724          * @deprecated Use {@link android.telephony.SubscriptionManager#ENHANCED_4G_MODE_ENABLED}
11725          * instead.
11726          */
11727         @Deprecated
11728         public static final String ENHANCED_4G_MODE_ENABLED =
11729                 SubscriptionManager.ENHANCED_4G_MODE_ENABLED;
11730 
11731         /**
11732          * Whether VT (Video Telephony over IMS) is enabled
11733          * <p>
11734          * Type: int (0 for false, 1 for true)
11735          *
11736          * @hide
11737          * @deprecated Use {@link android.telephony.SubscriptionManager#VT_IMS_ENABLED} instead.
11738          */
11739         @Deprecated
11740         public static final String VT_IMS_ENABLED = SubscriptionManager.VT_IMS_ENABLED;
11741 
11742         /**
11743          * Whether WFC is enabled
11744          * <p>
11745          * Type: int (0 for false, 1 for true)
11746          *
11747          * @hide
11748          * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ENABLED} instead.
11749          */
11750         @Deprecated
11751         public static final String WFC_IMS_ENABLED = SubscriptionManager.WFC_IMS_ENABLED;
11752 
11753         /**
11754          * WFC mode on home/non-roaming network.
11755          * <p>
11756          * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
11757          *
11758          * @hide
11759          * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_MODE} instead.
11760          */
11761         @Deprecated
11762         public static final String WFC_IMS_MODE = SubscriptionManager.WFC_IMS_MODE;
11763 
11764         /**
11765          * WFC mode on roaming network.
11766          * <p>
11767          * Type: int - see {@link #WFC_IMS_MODE} for values
11768          *
11769          * @hide
11770          * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_MODE}
11771          * instead.
11772          */
11773         @Deprecated
11774         public static final String WFC_IMS_ROAMING_MODE = SubscriptionManager.WFC_IMS_ROAMING_MODE;
11775 
11776         /**
11777          * Whether WFC roaming is enabled
11778          * <p>
11779          * Type: int (0 for false, 1 for true)
11780          *
11781          * @hide
11782          * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_ENABLED}
11783          * instead
11784          */
11785         @Deprecated
11786         public static final String WFC_IMS_ROAMING_ENABLED =
11787                 SubscriptionManager.WFC_IMS_ROAMING_ENABLED;
11788 
11789         /**
11790          * Whether user can enable/disable LTE as a preferred network. A carrier might control
11791          * this via gservices, OMA-DM, carrier app, etc.
11792          * <p>
11793          * Type: int (0 for false, 1 for true)
11794          * @hide
11795          */
11796         public static final String LTE_SERVICE_FORCED = "lte_service_forced";
11797 
11798         /**
11799          * Ephemeral app cookie max size in bytes.
11800          * <p>
11801          * Type: int
11802          * @hide
11803          */
11804         public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES =
11805                 "ephemeral_cookie_max_size_bytes";
11806 
11807         /**
11808          * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is
11809          * enabled. Set to zero to disable.
11810          * <p>
11811          * Type: int (0 for false, 1 for true)
11812          *
11813          * @hide
11814          */
11815         public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature";
11816 
11817         /**
11818          * Toggle to enable/disable dexopt for instant applications. The default is for dexopt
11819          * to be disabled.
11820          * <p>
11821          * Type: int (0 to disable, 1 to enable)
11822          *
11823          * @hide
11824          */
11825         public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled";
11826 
11827         /**
11828          * The min period for caching installed instant apps in milliseconds.
11829          * <p>
11830          * Type: long
11831          * @hide
11832          */
11833         public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
11834                 "installed_instant_app_min_cache_period";
11835 
11836         /**
11837          * The max period for caching installed instant apps in milliseconds.
11838          * <p>
11839          * Type: long
11840          * @hide
11841          */
11842         public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
11843                 "installed_instant_app_max_cache_period";
11844 
11845         /**
11846          * The min period for caching uninstalled instant apps in milliseconds.
11847          * <p>
11848          * Type: long
11849          * @hide
11850          */
11851         public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
11852                 "uninstalled_instant_app_min_cache_period";
11853 
11854         /**
11855          * The max period for caching uninstalled instant apps in milliseconds.
11856          * <p>
11857          * Type: long
11858          * @hide
11859          */
11860         public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
11861                 "uninstalled_instant_app_max_cache_period";
11862 
11863         /**
11864          * The min period for caching unused static shared libs in milliseconds.
11865          * <p>
11866          * Type: long
11867          * @hide
11868          */
11869         public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD =
11870                 "unused_static_shared_lib_min_cache_period";
11871 
11872         /**
11873          * Allows switching users when system user is locked.
11874          * <p>
11875          * Type: int
11876          * @hide
11877          */
11878         public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED =
11879                 "allow_user_switching_when_system_user_locked";
11880 
11881         /**
11882          * Boot count since the device starts running API level 24.
11883          * <p>
11884          * Type: int
11885          */
11886         public static final String BOOT_COUNT = "boot_count";
11887 
11888         /**
11889          * Whether the safe boot is disallowed.
11890          *
11891          * <p>This setting should have the identical value as the corresponding user restriction.
11892          * The purpose of the setting is to make the restriction available in early boot stages
11893          * before the user restrictions are loaded.
11894          * @hide
11895          */
11896         public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed";
11897 
11898         /**
11899          * Whether this device is currently in retail demo mode. If true, device
11900          * usage is severely limited.
11901          * <p>
11902          * Type: int (0 for false, 1 for true)
11903          * @hide
11904          */
11905         public static final String DEVICE_DEMO_MODE = "device_demo_mode";
11906 
11907         /**
11908          * Indicates the maximum time that an app is blocked for the network rules to get updated.
11909          *
11910          * Type: long
11911          *
11912          * @hide
11913          */
11914         public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms";
11915 
11916         /**
11917          * The reason for the settings database being downgraded. This is only for
11918          * troubleshooting purposes and its value should not be interpreted in any way.
11919          *
11920          * Type: string
11921          *
11922          * @hide
11923          */
11924         public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason";
11925 
11926         /**
11927          * The build id of when the settings database was first created (or re-created due it
11928          * being missing).
11929          *
11930          * Type: string
11931          *
11932          * @hide
11933          */
11934         public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid";
11935 
11936         /**
11937          * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by
11938          * default. Set to 0 to disable.
11939          *
11940          * @hide
11941          */
11942         public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled";
11943 
11944         /**
11945          * Flag to enable the link to location permissions in location setting. Set to 0 to disable.
11946          *
11947          * @hide
11948          */
11949         public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED =
11950                 "location_settings_link_to_permissions_enabled";
11951 
11952         /**
11953          * Flag to set the waiting time for euicc factory reset inside System > Settings
11954          * Type: long
11955          *
11956          * @hide
11957          */
11958         public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS =
11959                 "euicc_factory_reset_timeout_millis";
11960 
11961         /**
11962          * Flag to set the timeout for when to refresh the storage settings cached data.
11963          * Type: long
11964          *
11965          * @hide
11966          */
11967         public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD =
11968                 "storage_settings_clobber_threshold";
11969 
11970         /**
11971          * If set to 1, {@link Secure#LOCATION_MODE} will be set to {@link Secure#LOCATION_MODE_OFF}
11972          * temporarily for all users.
11973          *
11974          * @hide
11975          */
11976         @TestApi
11977         public static final String LOCATION_GLOBAL_KILL_SWITCH =
11978                 "location_global_kill_switch";
11979 
11980         /**
11981          * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored
11982          * and restoring to lower version of platform API will be skipped.
11983          *
11984          * @hide
11985          */
11986         public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION =
11987                 "override_settings_provider_restore_any_version";
11988         /**
11989          * Flag to toggle whether system services report attribution chains when they attribute
11990          * battery use via a {@code WorkSource}.
11991          *
11992          * Type: int (0 to disable, 1 to enable)
11993          *
11994          * @hide
11995          */
11996         public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED =
11997                 "chained_battery_attribution_enabled";
11998 
11999         /**
12000          * The packages whitelisted to be run in autofill compatibility mode. The list
12001          * of packages is {@code ":"} colon delimited, and each entry has the name of the
12002          * package and an optional list of url bar resource ids (the list is delimited by
12003          * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited).
12004          *
12005          * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where
12006          * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 }
12007          * have 2 ids {@code url_foo} and {@code url_bas}) would be
12008          * {@code p1[url_bar]:p2:p3[url_foo,url_bas]}
12009          *
12010          * @hide
12011          */
12012         @SystemApi
12013         @TestApi
12014         public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES =
12015                 "autofill_compat_mode_allowed_packages";
12016 
12017         /**
12018          * Exemptions to the hidden API blacklist.
12019          *
12020          * @hide
12021          */
12022         @TestApi
12023         public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS =
12024                 "hidden_api_blacklist_exemptions";
12025 
12026         /**
12027          * Sampling rate for hidden API access event logs, as an integer in the range 0 to 0x10000
12028          * inclusive.
12029          *
12030          * @hide
12031          */
12032         public static final String HIDDEN_API_ACCESS_LOG_SAMPLING_RATE =
12033                 "hidden_api_access_log_sampling_rate";
12034 
12035         /**
12036          * Hidden API enforcement policy for apps targeting SDK versions prior to the latest
12037          * version.
12038          *
12039          * Values correspond to @{@link
12040          * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy}
12041          *
12042          * @hide
12043          */
12044         public static final String HIDDEN_API_POLICY_PRE_P_APPS =
12045                 "hidden_api_policy_pre_p_apps";
12046 
12047         /**
12048          * Hidden API enforcement policy for apps targeting the current SDK version.
12049          *
12050          * Values correspond to @{@link
12051          * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy}
12052          *
12053          * @hide
12054          */
12055         public static final String HIDDEN_API_POLICY_P_APPS =
12056                 "hidden_api_policy_p_apps";
12057 
12058         /**
12059          * Timeout for a single {@link android.media.soundtrigger.SoundTriggerDetectionService}
12060          * operation (in ms).
12061          *
12062          * @hide
12063          */
12064         public static final String SOUND_TRIGGER_DETECTION_SERVICE_OP_TIMEOUT =
12065                 "sound_trigger_detection_service_op_timeout";
12066 
12067         /**
12068          * Maximum number of {@link android.media.soundtrigger.SoundTriggerDetectionService}
12069          * operations per day.
12070          *
12071          * @hide
12072          */
12073         public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY =
12074                 "max_sound_trigger_detection_service_ops_per_day";
12075 
12076         /**
12077          * Settings to backup. This is here so that it's in the same place as the settings
12078          * keys and easy to update.
12079          *
12080          * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
12081          * and Secure as well.  This is because those tables drive both backup and
12082          * restore, and restore needs to properly whitelist keys that used to live
12083          * in those namespaces.  The keys will only actually be backed up / restored
12084          * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
12085          *
12086          * NOTE: Settings are backed up and restored in the order they appear
12087          *       in this array. If you have one setting depending on another,
12088          *       make sure that they are ordered appropriately.
12089          *
12090          * @hide
12091          */
12092         public static final String[] SETTINGS_TO_BACKUP = {
12093             BUGREPORT_IN_POWER_MENU,
12094             STAY_ON_WHILE_PLUGGED_IN,
12095             APP_AUTO_RESTRICTION_ENABLED,
12096             AUTO_TIME,
12097             AUTO_TIME_ZONE,
12098             POWER_SOUNDS_ENABLED,
12099             DOCK_SOUNDS_ENABLED,
12100             CHARGING_SOUNDS_ENABLED,
12101             USB_MASS_STORAGE_ENABLED,
12102             NETWORK_RECOMMENDATIONS_ENABLED,
12103             WIFI_WAKEUP_ENABLED,
12104             WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
12105             WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON,
12106             USE_OPEN_WIFI_PACKAGE,
12107             WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
12108             EMERGENCY_TONE,
12109             CALL_AUTO_RETRY,
12110             DOCK_AUDIO_MEDIA_ENABLED,
12111             ENCODED_SURROUND_OUTPUT,
12112             ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS,
12113             LOW_POWER_MODE_TRIGGER_LEVEL,
12114             BLUETOOTH_ON,
12115             PRIVATE_DNS_MODE,
12116             PRIVATE_DNS_SPECIFIER,
12117             SOFT_AP_TIMEOUT_ENABLED,
12118             ZEN_DURATION,
12119             CHARGING_VIBRATION_ENABLED,
12120         };
12121 
12122         /**
12123          * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator,
12124          * otherwise they won't be restored.
12125          *
12126          * @hide
12127          */
12128         public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
12129         static {
VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR)12130             VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR);
VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR)12131             VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR);
VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR)12132             VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR);
VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR)12133             VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR);
VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR)12134             VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR)12135             VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(CHARGING_SOUNDS_ENABLED, CHARGING_SOUNDS_ENABLED_VALIDATOR)12136             VALIDATORS.put(CHARGING_SOUNDS_ENABLED, CHARGING_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR)12137             VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR);
VALIDATORS.put(NETWORK_RECOMMENDATIONS_ENABLED, NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR)12138             VALIDATORS.put(NETWORK_RECOMMENDATIONS_ENABLED,
12139                     NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR);
VALIDATORS.put(WIFI_WAKEUP_ENABLED, WIFI_WAKEUP_ENABLED_VALIDATOR)12140             VALIDATORS.put(WIFI_WAKEUP_ENABLED, WIFI_WAKEUP_ENABLED_VALIDATOR);
VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR)12141             VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
12142                     WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
VALIDATORS.put(USE_OPEN_WIFI_PACKAGE, USE_OPEN_WIFI_PACKAGE_VALIDATOR)12143             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)12144             VALIDATORS.put(WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
12145                     WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR);
VALIDATORS.put(EMERGENCY_TONE, EMERGENCY_TONE_VALIDATOR)12146             VALIDATORS.put(EMERGENCY_TONE, EMERGENCY_TONE_VALIDATOR);
VALIDATORS.put(CALL_AUTO_RETRY, CALL_AUTO_RETRY_VALIDATOR)12147             VALIDATORS.put(CALL_AUTO_RETRY, CALL_AUTO_RETRY_VALIDATOR);
VALIDATORS.put(DOCK_AUDIO_MEDIA_ENABLED, DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR)12148             VALIDATORS.put(DOCK_AUDIO_MEDIA_ENABLED, DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR);
VALIDATORS.put(ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_VALIDATOR)12149             VALIDATORS.put(ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_VALIDATOR);
VALIDATORS.put(ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS, ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS_VALIDATOR)12150             VALIDATORS.put(ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS,
12151                     ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS_VALIDATOR);
VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL, LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR)12152             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)12153             VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL_MAX,
12154                     LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR);
VALIDATORS.put(BLUETOOTH_ON, BLUETOOTH_ON_VALIDATOR)12155             VALIDATORS.put(BLUETOOTH_ON, BLUETOOTH_ON_VALIDATOR);
VALIDATORS.put(PRIVATE_DNS_MODE, PRIVATE_DNS_MODE_VALIDATOR)12156             VALIDATORS.put(PRIVATE_DNS_MODE, PRIVATE_DNS_MODE_VALIDATOR);
VALIDATORS.put(PRIVATE_DNS_SPECIFIER, PRIVATE_DNS_SPECIFIER_VALIDATOR)12157             VALIDATORS.put(PRIVATE_DNS_SPECIFIER, PRIVATE_DNS_SPECIFIER_VALIDATOR);
VALIDATORS.put(SOFT_AP_TIMEOUT_ENABLED, SOFT_AP_TIMEOUT_ENABLED_VALIDATOR)12158             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)12159             VALIDATORS.put(WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON,
12160                     WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
VALIDATORS.put(APP_AUTO_RESTRICTION_ENABLED, APP_AUTO_RESTRICTION_ENABLED_VALIDATOR)12161             VALIDATORS.put(APP_AUTO_RESTRICTION_ENABLED, APP_AUTO_RESTRICTION_ENABLED_VALIDATOR);
VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR)12162             VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR);
VALIDATORS.put(CHARGING_VIBRATION_ENABLED, CHARGING_VIBRATION_ENABLED_VALIDATOR)12163             VALIDATORS.put(CHARGING_VIBRATION_ENABLED, CHARGING_VIBRATION_ENABLED_VALIDATOR);
12164         }
12165 
12166         /**
12167          * Global settings that shouldn't be persisted.
12168          *
12169          * @hide
12170          */
12171         public static final String[] TRANSIENT_SETTINGS = {
12172                 LOCATION_GLOBAL_KILL_SWITCH,
12173         };
12174 
12175         /**
12176          * Keys we no longer back up under the current schema, but want to continue to
12177          * process when restoring historical backup datasets.
12178          *
12179          * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
12180          * otherwise they won't be restored.
12181          *
12182          * @hide
12183          */
12184         public static final String[] LEGACY_RESTORE_SETTINGS = {
12185         };
12186 
12187         private static final ContentProviderHolder sProviderHolder =
12188                 new ContentProviderHolder(CONTENT_URI);
12189 
12190         // Populated lazily, guarded by class object:
12191         private static final NameValueCache sNameValueCache = new NameValueCache(
12192                     CONTENT_URI,
12193                     CALL_METHOD_GET_GLOBAL,
12194                     CALL_METHOD_PUT_GLOBAL,
12195                     sProviderHolder);
12196 
12197         // Certain settings have been moved from global to the per-user secure namespace
12198         private static final HashSet<String> MOVED_TO_SECURE;
12199         static {
12200             MOVED_TO_SECURE = new HashSet<>(1);
12201             MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
12202         }
12203 
12204         /** @hide */
getMovedToSecureSettings(Set<String> outKeySet)12205         public static void getMovedToSecureSettings(Set<String> outKeySet) {
12206             outKeySet.addAll(MOVED_TO_SECURE);
12207         }
12208 
12209         /** @hide */
clearProviderForTest()12210         public static void clearProviderForTest() {
12211             sProviderHolder.clearProviderForTest();
12212             sNameValueCache.clearGenerationTrackerForTest();
12213         }
12214 
12215         /**
12216          * Look up a name in the database.
12217          * @param resolver to access the database with
12218          * @param name to look up in the table
12219          * @return the corresponding value, or null if not present
12220          */
getString(ContentResolver resolver, String name)12221         public static String getString(ContentResolver resolver, String name) {
12222             return getStringForUser(resolver, name, resolver.getUserId());
12223         }
12224 
12225         /** @hide */
getStringForUser(ContentResolver resolver, String name, int userHandle)12226         public static String getStringForUser(ContentResolver resolver, String name,
12227                 int userHandle) {
12228             if (MOVED_TO_SECURE.contains(name)) {
12229                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
12230                         + " to android.provider.Settings.Secure, returning read-only value.");
12231                 return Secure.getStringForUser(resolver, name, userHandle);
12232             }
12233             return sNameValueCache.getStringForUser(resolver, name, userHandle);
12234         }
12235 
12236         /**
12237          * Store a name/value pair into the database.
12238          * @param resolver to access the database with
12239          * @param name to store
12240          * @param value to associate with the name
12241          * @return true if the value was set, false on database errors
12242          */
putString(ContentResolver resolver, String name, String value)12243         public static boolean putString(ContentResolver resolver,
12244                 String name, String value) {
12245             return putStringForUser(resolver, name, value, null, false, resolver.getUserId());
12246         }
12247 
12248         /**
12249          * Store a name/value pair into the database.
12250          * <p>
12251          * The method takes an optional tag to associate with the setting
12252          * which can be used to clear only settings made by your package and
12253          * associated with this tag by passing the tag to {@link
12254          * #resetToDefaults(ContentResolver, String)}. Anyone can override
12255          * the current tag. Also if another package changes the setting
12256          * then the tag will be set to the one specified in the set call
12257          * which can be null. Also any of the settings setters that do not
12258          * take a tag as an argument effectively clears the tag.
12259          * </p><p>
12260          * For example, if you set settings A and B with tags T1 and T2 and
12261          * another app changes setting A (potentially to the same value), it
12262          * can assign to it a tag T3 (note that now the package that changed
12263          * the setting is not yours). Now if you reset your changes for T1 and
12264          * T2 only setting B will be reset and A not (as it was changed by
12265          * another package) but since A did not change you are in the desired
12266          * initial state. Now if the other app changes the value of A (assuming
12267          * you registered an observer in the beginning) you would detect that
12268          * the setting was changed by another app and handle this appropriately
12269          * (ignore, set back to some value, etc).
12270          * </p><p>
12271          * Also the method takes an argument whether to make the value the
12272          * default for this setting. If the system already specified a default
12273          * value, then the one passed in here will <strong>not</strong>
12274          * be set as the default.
12275          * </p>
12276          *
12277          * @param resolver to access the database with.
12278          * @param name to store.
12279          * @param value to associate with the name.
12280          * @param tag to associated with the setting.
12281          * @param makeDefault whether to make the value the default one.
12282          * @return true if the value was set, false on database errors.
12283          *
12284          * @see #resetToDefaults(ContentResolver, String)
12285          *
12286          * @hide
12287          */
12288         @SystemApi
12289         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)12290         public static boolean putString(@NonNull ContentResolver resolver,
12291                 @NonNull String name, @Nullable String value, @Nullable String tag,
12292                 boolean makeDefault) {
12293             return putStringForUser(resolver, name, value, tag, makeDefault,
12294                     resolver.getUserId());
12295         }
12296 
12297         /**
12298          * Reset the settings to their defaults. This would reset <strong>only</strong>
12299          * settings set by the caller's package. Think of it of a way to undo your own
12300          * changes to the secure settings. Passing in the optional tag will reset only
12301          * settings changed by your package and associated with this tag.
12302          *
12303          * @param resolver Handle to the content resolver.
12304          * @param tag Optional tag which should be associated with the settings to reset.
12305          *
12306          * @see #putString(ContentResolver, String, String, String, boolean)
12307          *
12308          * @hide
12309          */
12310         @SystemApi
12311         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)12312         public static void resetToDefaults(@NonNull ContentResolver resolver,
12313                 @Nullable String tag) {
12314             resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
12315                     resolver.getUserId());
12316         }
12317 
12318         /**
12319          * Reset the settings to their defaults for a given user with a specific mode. The
12320          * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
12321          * allowing resetting the settings made by a package and associated with the tag.
12322          *
12323          * @param resolver Handle to the content resolver.
12324          * @param tag Optional tag which should be associated with the settings to reset.
12325          * @param mode The reset mode.
12326          * @param userHandle The user for which to reset to defaults.
12327          *
12328          * @see #RESET_MODE_PACKAGE_DEFAULTS
12329          * @see #RESET_MODE_UNTRUSTED_DEFAULTS
12330          * @see #RESET_MODE_UNTRUSTED_CHANGES
12331          * @see #RESET_MODE_TRUSTED_DEFAULTS
12332          *
12333          * @hide
12334          */
resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)12335         public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
12336                 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
12337             try {
12338                 Bundle arg = new Bundle();
12339                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
12340                 if (tag != null) {
12341                     arg.putString(CALL_METHOD_TAG_KEY, tag);
12342                 }
12343                 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
12344                 IContentProvider cp = sProviderHolder.getProvider(resolver);
12345                 cp.call(resolver.getPackageName(), CALL_METHOD_RESET_GLOBAL, null, arg);
12346             } catch (RemoteException e) {
12347                 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
12348             }
12349         }
12350 
12351         /** @hide */
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)12352         public static boolean putStringForUser(ContentResolver resolver,
12353                 String name, String value, int userHandle) {
12354             return putStringForUser(resolver, name, value, null, false, userHandle);
12355         }
12356 
12357         /** @hide */
putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle)12358         public static boolean putStringForUser(@NonNull ContentResolver resolver,
12359                 @NonNull String name, @Nullable String value, @Nullable String tag,
12360                 boolean makeDefault, @UserIdInt int userHandle) {
12361             if (LOCAL_LOGV) {
12362                 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
12363                         + " for " + userHandle);
12364             }
12365             // Global and Secure have the same access policy so we can forward writes
12366             if (MOVED_TO_SECURE.contains(name)) {
12367                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
12368                         + " to android.provider.Settings.Secure, value is unchanged.");
12369                 return Secure.putStringForUser(resolver, name, value, tag,
12370                         makeDefault, userHandle);
12371             }
12372             return sNameValueCache.putStringForUser(resolver, name, value, tag,
12373                     makeDefault, userHandle);
12374         }
12375 
12376         /**
12377          * Construct the content URI for a particular name/value pair,
12378          * useful for monitoring changes with a ContentObserver.
12379          * @param name to look up in the table
12380          * @return the corresponding content URI, or null if not present
12381          */
getUriFor(String name)12382         public static Uri getUriFor(String name) {
12383             return getUriFor(CONTENT_URI, name);
12384         }
12385 
12386         /**
12387          * Convenience function for retrieving a single secure settings value
12388          * as an integer.  Note that internally setting values are always
12389          * stored as strings; this function converts the string to an integer
12390          * for you.  The default value will be returned if the setting is
12391          * not defined or not an integer.
12392          *
12393          * @param cr The ContentResolver to access.
12394          * @param name The name of the setting to retrieve.
12395          * @param def Value to return if the setting is not defined.
12396          *
12397          * @return The setting's current value, or 'def' if it is not defined
12398          * or not a valid integer.
12399          */
getInt(ContentResolver cr, String name, int def)12400         public static int getInt(ContentResolver cr, String name, int def) {
12401             String v = getString(cr, name);
12402             try {
12403                 return v != null ? Integer.parseInt(v) : def;
12404             } catch (NumberFormatException e) {
12405                 return def;
12406             }
12407         }
12408 
12409         /**
12410          * Convenience function for retrieving a single secure settings value
12411          * as an integer.  Note that internally setting values are always
12412          * stored as strings; this function converts the string to an integer
12413          * for you.
12414          * <p>
12415          * This version does not take a default value.  If the setting has not
12416          * been set, or the string value is not a number,
12417          * it throws {@link SettingNotFoundException}.
12418          *
12419          * @param cr The ContentResolver to access.
12420          * @param name The name of the setting to retrieve.
12421          *
12422          * @throws SettingNotFoundException Thrown if a setting by the given
12423          * name can't be found or the setting value is not an integer.
12424          *
12425          * @return The setting's current value.
12426          */
getInt(ContentResolver cr, String name)12427         public static int getInt(ContentResolver cr, String name)
12428                 throws SettingNotFoundException {
12429             String v = getString(cr, name);
12430             try {
12431                 return Integer.parseInt(v);
12432             } catch (NumberFormatException e) {
12433                 throw new SettingNotFoundException(name);
12434             }
12435         }
12436 
12437         /**
12438          * Convenience function for updating a single settings value as an
12439          * integer. This will either create a new entry in the table if the
12440          * given name does not exist, or modify the value of the existing row
12441          * with that name.  Note that internally setting values are always
12442          * stored as strings, so this function converts the given value to a
12443          * string before storing it.
12444          *
12445          * @param cr The ContentResolver to access.
12446          * @param name The name of the setting to modify.
12447          * @param value The new value for the setting.
12448          * @return true if the value was set, false on database errors
12449          */
putInt(ContentResolver cr, String name, int value)12450         public static boolean putInt(ContentResolver cr, String name, int value) {
12451             return putString(cr, name, Integer.toString(value));
12452         }
12453 
12454         /**
12455          * Convenience function for retrieving a single secure settings value
12456          * as a {@code long}.  Note that internally setting values are always
12457          * stored as strings; this function converts the string to a {@code long}
12458          * for you.  The default value will be returned if the setting is
12459          * not defined or not a {@code long}.
12460          *
12461          * @param cr The ContentResolver to access.
12462          * @param name The name of the setting to retrieve.
12463          * @param def Value to return if the setting is not defined.
12464          *
12465          * @return The setting's current value, or 'def' if it is not defined
12466          * or not a valid {@code long}.
12467          */
getLong(ContentResolver cr, String name, long def)12468         public static long getLong(ContentResolver cr, String name, long def) {
12469             String valString = getString(cr, name);
12470             long value;
12471             try {
12472                 value = valString != null ? Long.parseLong(valString) : def;
12473             } catch (NumberFormatException e) {
12474                 value = def;
12475             }
12476             return value;
12477         }
12478 
12479         /**
12480          * Convenience function for retrieving a single secure settings value
12481          * as a {@code long}.  Note that internally setting values are always
12482          * stored as strings; this function converts the string to a {@code long}
12483          * for you.
12484          * <p>
12485          * This version does not take a default value.  If the setting has not
12486          * been set, or the string value is not a number,
12487          * it throws {@link SettingNotFoundException}.
12488          *
12489          * @param cr The ContentResolver to access.
12490          * @param name The name of the setting to retrieve.
12491          *
12492          * @return The setting's current value.
12493          * @throws SettingNotFoundException Thrown if a setting by the given
12494          * name can't be found or the setting value is not an integer.
12495          */
getLong(ContentResolver cr, String name)12496         public static long getLong(ContentResolver cr, String name)
12497                 throws SettingNotFoundException {
12498             String valString = getString(cr, name);
12499             try {
12500                 return Long.parseLong(valString);
12501             } catch (NumberFormatException e) {
12502                 throw new SettingNotFoundException(name);
12503             }
12504         }
12505 
12506         /**
12507          * Convenience function for updating a secure settings value as a long
12508          * integer. This will either create a new entry in the table if the
12509          * given name does not exist, or modify the value of the existing row
12510          * with that name.  Note that internally setting values are always
12511          * stored as strings, so this function converts the given value to a
12512          * string before storing it.
12513          *
12514          * @param cr The ContentResolver to access.
12515          * @param name The name of the setting to modify.
12516          * @param value The new value for the setting.
12517          * @return true if the value was set, false on database errors
12518          */
putLong(ContentResolver cr, String name, long value)12519         public static boolean putLong(ContentResolver cr, String name, long value) {
12520             return putString(cr, name, Long.toString(value));
12521         }
12522 
12523         /**
12524          * Convenience function for retrieving a single secure settings value
12525          * as a floating point number.  Note that internally setting values are
12526          * always stored as strings; this function converts the string to an
12527          * float for you. The default value will be returned if the setting
12528          * is not defined or not a valid float.
12529          *
12530          * @param cr The ContentResolver to access.
12531          * @param name The name of the setting to retrieve.
12532          * @param def Value to return if the setting is not defined.
12533          *
12534          * @return The setting's current value, or 'def' if it is not defined
12535          * or not a valid float.
12536          */
getFloat(ContentResolver cr, String name, float def)12537         public static float getFloat(ContentResolver cr, String name, float def) {
12538             String v = getString(cr, name);
12539             try {
12540                 return v != null ? Float.parseFloat(v) : def;
12541             } catch (NumberFormatException e) {
12542                 return def;
12543             }
12544         }
12545 
12546         /**
12547          * Convenience function for retrieving a single secure settings value
12548          * as a float.  Note that internally setting values are always
12549          * stored as strings; this function converts the string to a float
12550          * for you.
12551          * <p>
12552          * This version does not take a default value.  If the setting has not
12553          * been set, or the string value is not a number,
12554          * it throws {@link SettingNotFoundException}.
12555          *
12556          * @param cr The ContentResolver to access.
12557          * @param name The name of the setting to retrieve.
12558          *
12559          * @throws SettingNotFoundException Thrown if a setting by the given
12560          * name can't be found or the setting value is not a float.
12561          *
12562          * @return The setting's current value.
12563          */
getFloat(ContentResolver cr, String name)12564         public static float getFloat(ContentResolver cr, String name)
12565                 throws SettingNotFoundException {
12566             String v = getString(cr, name);
12567             if (v == null) {
12568                 throw new SettingNotFoundException(name);
12569             }
12570             try {
12571                 return Float.parseFloat(v);
12572             } catch (NumberFormatException e) {
12573                 throw new SettingNotFoundException(name);
12574             }
12575         }
12576 
12577         /**
12578          * Convenience function for updating a single settings value as a
12579          * floating point number. This will either create a new entry in the
12580          * table if the given name does not exist, or modify the value of the
12581          * existing row with that name.  Note that internally setting values
12582          * are always stored as strings, so this function converts the given
12583          * value to a string before storing it.
12584          *
12585          * @param cr The ContentResolver to access.
12586          * @param name The name of the setting to modify.
12587          * @param value The new value for the setting.
12588          * @return true if the value was set, false on database errors
12589          */
putFloat(ContentResolver cr, String name, float value)12590         public static boolean putFloat(ContentResolver cr, String name, float value) {
12591             return putString(cr, name, Float.toString(value));
12592         }
12593 
12594         /**
12595           * Subscription to be used for voice call on a multi sim device. The supported values
12596           * are 0 = SUB1, 1 = SUB2 and etc.
12597           * @hide
12598           */
12599         public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
12600 
12601         /**
12602           * Used to provide option to user to select subscription during dial.
12603           * The supported values are 0 = disable or 1 = enable prompt.
12604           * @hide
12605           */
12606         public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
12607 
12608         /**
12609           * Subscription to be used for data call on a multi sim device. The supported values
12610           * are 0 = SUB1, 1 = SUB2 and etc.
12611           * @hide
12612           */
12613         public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
12614 
12615         /**
12616           * Subscription to be used for SMS on a multi sim device. The supported values
12617           * are 0 = SUB1, 1 = SUB2 and etc.
12618           * @hide
12619           */
12620         public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
12621 
12622         /**
12623           * Used to provide option to user to select subscription during send SMS.
12624           * The value 1 - enable, 0 - disable
12625           * @hide
12626           */
12627         public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
12628 
12629         /** User preferred subscriptions setting.
12630           * This holds the details of the user selected subscription from the card and
12631           * the activation status. Each settings string have the comma separated values
12632           * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
12633           * @hide
12634          */
12635         public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
12636                 "user_preferred_sub2","user_preferred_sub3"};
12637 
12638         /**
12639          * Whether to enable new contacts aggregator or not.
12640          * The value 1 - enable, 0 - disable
12641          * @hide
12642          */
12643         public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
12644 
12645         /**
12646          * Whether to enable contacts metadata syncing or not
12647          * The value 1 - enable, 0 - disable
12648          *
12649          * @removed
12650          */
12651         @Deprecated
12652         public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
12653 
12654         /**
12655          * Whether to enable contacts metadata syncing or not
12656          * The value 1 - enable, 0 - disable
12657          */
12658         public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled";
12659 
12660         /**
12661          * Whether to enable cellular on boot.
12662          * The value 1 - enable, 0 - disable
12663          * @hide
12664          */
12665         public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot";
12666 
12667         /**
12668          * The maximum allowed notification enqueue rate in Hertz.
12669          *
12670          * Should be a float, and includes updates only.
12671          * @hide
12672          */
12673         public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate";
12674 
12675         /**
12676          * Displays toasts when an app posts a notification that does not specify a valid channel.
12677          *
12678          * The value 1 - enable, 0 - disable
12679          * @hide
12680          */
12681         public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS =
12682                 "show_notification_channel_warnings";
12683 
12684         /**
12685          * Whether cell is enabled/disabled
12686          * @hide
12687          */
12688         public static final String CELL_ON = "cell_on";
12689 
12690         /**
12691          * Global settings which can be accessed by instant apps.
12692          * @hide
12693          */
12694         public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
12695         static {
12696             INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER);
12697             INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED);
12698             INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES);
12699             INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL);
12700             INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES);
12701             INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON);
12702             INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE);
12703             INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE);
12704             INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE);
12705             INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES);
12706             INSTANT_APP_SETTINGS.add(WTF_IS_FATAL);
12707             INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR);
12708             INSTANT_APP_SETTINGS.add(ZEN_MODE);
12709         }
12710 
12711         /**
12712          * Whether to show the high temperature warning notification.
12713          * @hide
12714          */
12715         public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning";
12716 
12717         /**
12718          * Temperature at which the high temperature warning notification should be shown.
12719          * @hide
12720          */
12721         public static final String WARNING_TEMPERATURE = "warning_temperature";
12722 
12723         /**
12724          * Whether the diskstats logging task is enabled/disabled.
12725          * @hide
12726          */
12727         public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging";
12728 
12729         /**
12730          * Whether the cache quota calculation task is enabled/disabled.
12731          * @hide
12732          */
12733         public static final String ENABLE_CACHE_QUOTA_CALCULATION =
12734                 "enable_cache_quota_calculation";
12735 
12736         /**
12737          * Whether the Deletion Helper no threshold toggle is available.
12738          * @hide
12739          */
12740         public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE =
12741                 "enable_deletion_helper_no_threshold_toggle";
12742 
12743         /**
12744          * The list of snooze options for notifications
12745          * This is encoded as a key=value list, separated by commas. Ex:
12746          *
12747          * "default=60,options_array=15:30:60:120"
12748          *
12749          * The following keys are supported:
12750          *
12751          * <pre>
12752          * default               (int)
12753          * options_array         (int[])
12754          * </pre>
12755          *
12756          * All delays in integer minutes. Array order is respected.
12757          * Options will be used in order up to the maximum allowed by the UI.
12758          * @hide
12759          */
12760         public static final String NOTIFICATION_SNOOZE_OPTIONS =
12761                 "notification_snooze_options";
12762 
12763         /**
12764          * Settings key for the ratio of notification dismissals to notification views - one of the
12765          * criteria for showing the notification blocking helper.
12766          *
12767          * <p>The value is a float ranging from 0.0 to 1.0 (the closer to 0.0, the more intrusive
12768          * the blocking helper will be).
12769          *
12770          * @hide
12771          */
12772         public static final String BLOCKING_HELPER_DISMISS_TO_VIEW_RATIO_LIMIT =
12773                 "blocking_helper_dismiss_to_view_ratio";
12774 
12775         /**
12776          * Settings key for the longest streak of dismissals  - one of the criteria for showing the
12777          * notification blocking helper.
12778          *
12779          * <p>The value is an integer greater than 0.
12780          *
12781          * @hide
12782          */
12783         public static final String BLOCKING_HELPER_STREAK_LIMIT = "blocking_helper_streak_limit";
12784 
12785         /**
12786          * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated
12787          * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF
12788          *
12789          * Supported keys:
12790          * compatibility_wal_supported      (boolean)
12791          * wal_syncmode       (String)
12792          *
12793          * @hide
12794          */
12795         public static final String SQLITE_COMPATIBILITY_WAL_FLAGS =
12796                 "sqlite_compatibility_wal_flags";
12797 
12798         /**
12799          * Enable GNSS Raw Measurements Full Tracking?
12800          * 0 = no
12801          * 1 = yes
12802          * @hide
12803          */
12804         public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING =
12805                 "enable_gnss_raw_meas_full_tracking";
12806 
12807         /**
12808          * Whether the notification should be ongoing (persistent) when a carrier app install is
12809          * required.
12810          *
12811          * The value is a boolean (1 or 0).
12812          * @hide
12813          */
12814         @SystemApi
12815         public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT =
12816                 "install_carrier_app_notification_persistent";
12817 
12818         /**
12819          * The amount of time (ms) to hide the install carrier app notification after the user has
12820          * ignored it. After this time passes, the notification will be shown again
12821          *
12822          * The value is a long
12823          * @hide
12824          */
12825         @SystemApi
12826         public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS =
12827                 "install_carrier_app_notification_sleep_millis";
12828 
12829         /**
12830          * Whether we've enabled zram on this device. Takes effect on
12831          * reboot. The value "1" enables zram; "0" disables it, and
12832          * everything else is unspecified.
12833          * @hide
12834          */
12835         public static final String ZRAM_ENABLED =
12836                 "zram_enabled";
12837 
12838         /**
12839          * Whether we have enable CPU frequency scaling for this device.
12840          * For Wear, default is disable.
12841          *
12842          * The value is "1" for enable, "0" for disable.
12843          * @hide
12844          */
12845         public static final String CPU_SCALING_ENABLED =
12846                 "cpu_frequency_scaling_enabled";
12847 
12848         /**
12849          * Configuration flags for smart replies in notifications.
12850          * This is encoded as a key=value list, separated by commas. Ex:
12851          *
12852          * "enabled=1,max_squeeze_remeasure_count=3"
12853          *
12854          * The following keys are supported:
12855          *
12856          * <pre>
12857          * enabled                         (boolean)
12858          * requires_targeting_p            (boolean)
12859          * max_squeeze_remeasure_attempts  (int)
12860          * </pre>
12861          * @see com.android.systemui.statusbar.policy.SmartReplyConstants
12862          * @hide
12863          */
12864         public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS =
12865                 "smart_replies_in_notifications_flags";
12866 
12867         /**
12868          * If nonzero, crashes in foreground processes will bring up a dialog.
12869          * Otherwise, the process will be silently killed.
12870          * @hide
12871          */
12872         public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog";
12873 
12874         /**
12875          * If nonzero, crash dialogs will show an option to restart the app.
12876          * @hide
12877          */
12878         public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog";
12879 
12880         /**
12881          * If nonzero, crash dialogs will show an option to mute all future crash dialogs for
12882          * this app.
12883          * @hide
12884          */
12885         public static final String SHOW_MUTE_IN_CRASH_DIALOG = "show_mute_in_crash_dialog";
12886 
12887         /**
12888          * If nonzero, will show the zen upgrade notification when the user toggles DND on/off.
12889          * @hide
12890          */
12891         public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";
12892 
12893         /**
12894          * If nonzero, will show the zen update settings suggestion.
12895          * @hide
12896          */
12897         public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion";
12898 
12899         /**
12900          * If nonzero, zen has not been updated to reflect new changes.
12901          * @hide
12902          */
12903         public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated";
12904 
12905         /**
12906          * If nonzero, zen setting suggestion has beem viewed by user
12907          * @hide
12908          */
12909         public static final String ZEN_SETTINGS_SUGGESTION_VIEWED =
12910                 "zen_settings_suggestion_viewed";
12911 
12912         /**
12913          * Backup and restore agent timeout parameters.
12914          * These parameters are represented by a comma-delimited key-value list.
12915          *
12916          * The following strings are supported as keys:
12917          * <pre>
12918          *     kv_backup_agent_timeout_millis         (long)
12919          *     full_backup_agent_timeout_millis       (long)
12920          *     shared_backup_agent_timeout_millis     (long)
12921          *     restore_agent_timeout_millis           (long)
12922          *     restore_agent_finished_timeout_millis  (long)
12923          * </pre>
12924          *
12925          * They map to milliseconds represented as longs.
12926          *
12927          * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000"
12928          *
12929          * @hide
12930          */
12931         public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS =
12932                 "backup_agent_timeout_parameters";
12933 
12934         /**
12935          * Whether we have enabled swapping on this device. For Wear, default is
12936          * enabled.
12937          *
12938          * The value is "1" for enable, "0" for disable.
12939          * @hide
12940          */
12941          public static final String SWAP_ENABLED = "swap_enabled";
12942 
12943         /**
12944          * Blacklist of GNSS satellites.
12945          *
12946          * This is a list of integers separated by commas to represent pairs of (constellation,
12947          * svid). Thus, the number of integers should be even.
12948          *
12949          * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are
12950          * blacklisted. Note that svid=0 denotes all svids in the
12951          * constellation are blacklisted.
12952          *
12953          * @hide
12954          */
12955         public static final String GNSS_SATELLITE_BLACKLIST = "gnss_satellite_blacklist";
12956 
12957         /**
12958          * Duration of updates in millisecond for GNSS location request from HAL to framework.
12959          *
12960          * If zero, the GNSS location request feature is disabled.
12961          *
12962          * The value is a non-negative long.
12963          *
12964          * @hide
12965          */
12966         public static final String GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS =
12967                 "gnss_hal_location_request_duration_millis";
12968     }
12969 
12970     /**
12971      * User-defined bookmarks and shortcuts.  The target of each bookmark is an
12972      * Intent URL, allowing it to be either a web page or a particular
12973      * application activity.
12974      *
12975      * @hide
12976      */
12977     public static final class Bookmarks implements BaseColumns
12978     {
12979         private static final String TAG = "Bookmarks";
12980 
12981         /**
12982          * The content:// style URL for this table
12983          */
12984         public static final Uri CONTENT_URI =
12985             Uri.parse("content://" + AUTHORITY + "/bookmarks");
12986 
12987         /**
12988          * The row ID.
12989          * <p>Type: INTEGER</p>
12990          */
12991         public static final String ID = "_id";
12992 
12993         /**
12994          * Descriptive name of the bookmark that can be displayed to the user.
12995          * If this is empty, the title should be resolved at display time (use
12996          * {@link #getTitle(Context, Cursor)} any time you want to display the
12997          * title of a bookmark.)
12998          * <P>
12999          * Type: TEXT
13000          * </P>
13001          */
13002         public static final String TITLE = "title";
13003 
13004         /**
13005          * Arbitrary string (displayed to the user) that allows bookmarks to be
13006          * organized into categories.  There are some special names for
13007          * standard folders, which all start with '@'.  The label displayed for
13008          * the folder changes with the locale (via {@link #getLabelForFolder}) but
13009          * the folder name does not change so you can consistently query for
13010          * the folder regardless of the current locale.
13011          *
13012          * <P>Type: TEXT</P>
13013          *
13014          */
13015         public static final String FOLDER = "folder";
13016 
13017         /**
13018          * The Intent URL of the bookmark, describing what it points to.  This
13019          * value is given to {@link android.content.Intent#getIntent} to create
13020          * an Intent that can be launched.
13021          * <P>Type: TEXT</P>
13022          */
13023         public static final String INTENT = "intent";
13024 
13025         /**
13026          * Optional shortcut character associated with this bookmark.
13027          * <P>Type: INTEGER</P>
13028          */
13029         public static final String SHORTCUT = "shortcut";
13030 
13031         /**
13032          * The order in which the bookmark should be displayed
13033          * <P>Type: INTEGER</P>
13034          */
13035         public static final String ORDERING = "ordering";
13036 
13037         private static final String[] sIntentProjection = { INTENT };
13038         private static final String[] sShortcutProjection = { ID, SHORTCUT };
13039         private static final String sShortcutSelection = SHORTCUT + "=?";
13040 
13041         /**
13042          * Convenience function to retrieve the bookmarked Intent for a
13043          * particular shortcut key.
13044          *
13045          * @param cr The ContentResolver to query.
13046          * @param shortcut The shortcut key.
13047          *
13048          * @return Intent The bookmarked URL, or null if there is no bookmark
13049          *         matching the given shortcut.
13050          */
getIntentForShortcut(ContentResolver cr, char shortcut)13051         public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
13052         {
13053             Intent intent = null;
13054 
13055             Cursor c = cr.query(CONTENT_URI,
13056                     sIntentProjection, sShortcutSelection,
13057                     new String[] { String.valueOf((int) shortcut) }, ORDERING);
13058             // Keep trying until we find a valid shortcut
13059             try {
13060                 while (intent == null && c.moveToNext()) {
13061                     try {
13062                         String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
13063                         intent = Intent.parseUri(intentURI, 0);
13064                     } catch (java.net.URISyntaxException e) {
13065                         // The stored URL is bad...  ignore it.
13066                     } catch (IllegalArgumentException e) {
13067                         // Column not found
13068                         Log.w(TAG, "Intent column not found", e);
13069                     }
13070                 }
13071             } finally {
13072                 if (c != null) c.close();
13073             }
13074 
13075             return intent;
13076         }
13077 
13078         /**
13079          * Add a new bookmark to the system.
13080          *
13081          * @param cr The ContentResolver to query.
13082          * @param intent The desired target of the bookmark.
13083          * @param title Bookmark title that is shown to the user; null if none
13084          *            or it should be resolved to the intent's title.
13085          * @param folder Folder in which to place the bookmark; null if none.
13086          * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
13087          *            this is non-zero and there is an existing bookmark entry
13088          *            with this same shortcut, then that existing shortcut is
13089          *            cleared (the bookmark is not removed).
13090          * @return The unique content URL for the new bookmark entry.
13091          */
add(ContentResolver cr, Intent intent, String title, String folder, char shortcut, int ordering)13092         public static Uri add(ContentResolver cr,
13093                                            Intent intent,
13094                                            String title,
13095                                            String folder,
13096                                            char shortcut,
13097                                            int ordering)
13098         {
13099             // If a shortcut is supplied, and it is already defined for
13100             // another bookmark, then remove the old definition.
13101             if (shortcut != 0) {
13102                 cr.delete(CONTENT_URI, sShortcutSelection,
13103                         new String[] { String.valueOf((int) shortcut) });
13104             }
13105 
13106             ContentValues values = new ContentValues();
13107             if (title != null) values.put(TITLE, title);
13108             if (folder != null) values.put(FOLDER, folder);
13109             values.put(INTENT, intent.toUri(0));
13110             if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
13111             values.put(ORDERING, ordering);
13112             return cr.insert(CONTENT_URI, values);
13113         }
13114 
13115         /**
13116          * Return the folder name as it should be displayed to the user.  This
13117          * takes care of localizing special folders.
13118          *
13119          * @param r Resources object for current locale; only need access to
13120          *          system resources.
13121          * @param folder The value found in the {@link #FOLDER} column.
13122          *
13123          * @return CharSequence The label for this folder that should be shown
13124          *         to the user.
13125          */
getLabelForFolder(Resources r, String folder)13126         public static CharSequence getLabelForFolder(Resources r, String folder) {
13127             return folder;
13128         }
13129 
13130         /**
13131          * Return the title as it should be displayed to the user. This takes
13132          * care of localizing bookmarks that point to activities.
13133          *
13134          * @param context A context.
13135          * @param cursor A cursor pointing to the row whose title should be
13136          *        returned. The cursor must contain at least the {@link #TITLE}
13137          *        and {@link #INTENT} columns.
13138          * @return A title that is localized and can be displayed to the user,
13139          *         or the empty string if one could not be found.
13140          */
getTitle(Context context, Cursor cursor)13141         public static CharSequence getTitle(Context context, Cursor cursor) {
13142             int titleColumn = cursor.getColumnIndex(TITLE);
13143             int intentColumn = cursor.getColumnIndex(INTENT);
13144             if (titleColumn == -1 || intentColumn == -1) {
13145                 throw new IllegalArgumentException(
13146                         "The cursor must contain the TITLE and INTENT columns.");
13147             }
13148 
13149             String title = cursor.getString(titleColumn);
13150             if (!TextUtils.isEmpty(title)) {
13151                 return title;
13152             }
13153 
13154             String intentUri = cursor.getString(intentColumn);
13155             if (TextUtils.isEmpty(intentUri)) {
13156                 return "";
13157             }
13158 
13159             Intent intent;
13160             try {
13161                 intent = Intent.parseUri(intentUri, 0);
13162             } catch (URISyntaxException e) {
13163                 return "";
13164             }
13165 
13166             PackageManager packageManager = context.getPackageManager();
13167             ResolveInfo info = packageManager.resolveActivity(intent, 0);
13168             return info != null ? info.loadLabel(packageManager) : "";
13169         }
13170     }
13171 
13172     /**
13173      * Returns the device ID that we should use when connecting to the mobile gtalk server.
13174      * This is a string like "android-0x1242", where the hex string is the Android ID obtained
13175      * from the GoogleLoginService.
13176      *
13177      * @param androidId The Android ID for this device.
13178      * @return The device ID that should be used when connecting to the mobile gtalk server.
13179      * @hide
13180      */
getGTalkDeviceId(long androidId)13181     public static String getGTalkDeviceId(long androidId) {
13182         return "android-" + Long.toHexString(androidId);
13183     }
13184 
13185     private static final String[] PM_WRITE_SETTINGS = {
13186         android.Manifest.permission.WRITE_SETTINGS
13187     };
13188     private static final String[] PM_CHANGE_NETWORK_STATE = {
13189         android.Manifest.permission.CHANGE_NETWORK_STATE,
13190         android.Manifest.permission.WRITE_SETTINGS
13191     };
13192     private static final String[] PM_SYSTEM_ALERT_WINDOW = {
13193         android.Manifest.permission.SYSTEM_ALERT_WINDOW
13194     };
13195 
13196     /**
13197      * Performs a strict and comprehensive check of whether a calling package is allowed to
13198      * write/modify system settings, as the condition differs for pre-M, M+, and
13199      * privileged/preinstalled apps. If the provided uid does not match the
13200      * callingPackage, a negative result will be returned.
13201      * @hide
13202      */
isCallingPackageAllowedToWriteSettings(Context context, int uid, String callingPackage, boolean throwException)13203     public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid,
13204             String callingPackage, boolean throwException) {
13205         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
13206                 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
13207                 PM_WRITE_SETTINGS, false);
13208     }
13209 
13210     /**
13211      * Performs a strict and comprehensive check of whether a calling package is allowed to
13212      * write/modify system settings, as the condition differs for pre-M, M+, and
13213      * privileged/preinstalled apps. If the provided uid does not match the
13214      * callingPackage, a negative result will be returned. The caller is expected to have
13215      * the WRITE_SETTINGS permission declared.
13216      *
13217      * Note: if the check is successful, the operation of this app will be updated to the
13218      * current time.
13219      * @hide
13220      */
checkAndNoteWriteSettingsOperation(Context context, int uid, String callingPackage, boolean throwException)13221     public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid,
13222             String callingPackage, boolean throwException) {
13223         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
13224                 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
13225                 PM_WRITE_SETTINGS, true);
13226     }
13227 
13228     /**
13229      * Performs a strict and comprehensive check of whether a calling package is allowed to
13230      * change the state of network, as the condition differs for pre-M, M+, and
13231      * privileged/preinstalled apps. The caller is expected to have either the
13232      * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these
13233      * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and
13234      * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal
13235      * permission and cannot be revoked. See http://b/23597341
13236      *
13237      * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation
13238      * of this app will be updated to the current time.
13239      * @hide
13240      */
checkAndNoteChangeNetworkStateOperation(Context context, int uid, String callingPackage, boolean throwException)13241     public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid,
13242             String callingPackage, boolean throwException) {
13243         if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE)
13244                 == PackageManager.PERMISSION_GRANTED) {
13245             return true;
13246         }
13247         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
13248                 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
13249                 PM_CHANGE_NETWORK_STATE, true);
13250     }
13251 
13252     /**
13253      * Performs a strict and comprehensive check of whether a calling package is allowed to
13254      * draw on top of other apps, as the conditions differs for pre-M, M+, and
13255      * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
13256      * a negative result will be returned.
13257      * @hide
13258      */
isCallingPackageAllowedToDrawOverlays(Context context, int uid, String callingPackage, boolean throwException)13259     public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid,
13260             String callingPackage, boolean throwException) {
13261         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
13262                 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
13263                 PM_SYSTEM_ALERT_WINDOW, false);
13264     }
13265 
13266     /**
13267      * Performs a strict and comprehensive check of whether a calling package is allowed to
13268      * draw on top of other apps, as the conditions differs for pre-M, M+, and
13269      * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
13270      * a negative result will be returned.
13271      *
13272      * Note: if the check is successful, the operation of this app will be updated to the
13273      * current time.
13274      * @hide
13275      */
checkAndNoteDrawOverlaysOperation(Context context, int uid, String callingPackage, boolean throwException)13276     public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String
13277             callingPackage, boolean throwException) {
13278         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
13279                 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
13280                 PM_SYSTEM_ALERT_WINDOW, true);
13281     }
13282 
13283     /**
13284      * Helper method to perform a general and comprehensive check of whether an operation that is
13285      * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and
13286      * OP_WRITE_SETTINGS
13287      * @hide
13288      */
isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] permissions, boolean makeNote)13289     public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
13290             int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[]
13291             permissions, boolean makeNote) {
13292         if (callingPackage == null) {
13293             return false;
13294         }
13295 
13296         AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE);
13297         int mode = AppOpsManager.MODE_DEFAULT;
13298         if (makeNote) {
13299             mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage);
13300         } else {
13301             mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage);
13302         }
13303 
13304         switch (mode) {
13305             case AppOpsManager.MODE_ALLOWED:
13306                 return true;
13307 
13308             case AppOpsManager.MODE_DEFAULT:
13309                 // this is the default operating mode after an app's installation
13310                 // In this case we will check all associated static permission to see
13311                 // if it is granted during install time.
13312                 for (String permission : permissions) {
13313                     if (context.checkCallingOrSelfPermission(permission) == PackageManager
13314                             .PERMISSION_GRANTED) {
13315                         // if either of the permissions are granted, we will allow it
13316                         return true;
13317                     }
13318                 }
13319 
13320             default:
13321                 // this is for all other cases trickled down here...
13322                 if (!throwException) {
13323                     return false;
13324                 }
13325         }
13326 
13327         // prepare string to throw SecurityException
13328         StringBuilder exceptionMessage = new StringBuilder();
13329         exceptionMessage.append(callingPackage);
13330         exceptionMessage.append(" was not granted ");
13331         if (permissions.length > 1) {
13332             exceptionMessage.append(" either of these permissions: ");
13333         } else {
13334             exceptionMessage.append(" this permission: ");
13335         }
13336         for (int i = 0; i < permissions.length; i++) {
13337             exceptionMessage.append(permissions[i]);
13338             exceptionMessage.append((i == permissions.length - 1) ? "." : ", ");
13339         }
13340 
13341         throw new SecurityException(exceptionMessage.toString());
13342     }
13343 
13344     /**
13345      * Retrieves a correponding package name for a given uid. It will query all
13346      * packages that are associated with the given uid, but it will return only
13347      * the zeroth result.
13348      * Note: If package could not be found, a null is returned.
13349      * @hide
13350      */
getPackageNameForUid(Context context, int uid)13351     public static String getPackageNameForUid(Context context, int uid) {
13352         String[] packages = context.getPackageManager().getPackagesForUid(uid);
13353         if (packages == null) {
13354             return null;
13355         }
13356         return packages[0];
13357     }
13358 }
13359