• 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.UnsupportedAppUsage;
41 import android.annotation.UserIdInt;
42 import android.app.ActivityThread;
43 import android.app.AppOpsManager;
44 import android.app.Application;
45 import android.app.NotificationChannel;
46 import android.app.NotificationManager;
47 import android.app.SearchManager;
48 import android.app.WallpaperManager;
49 import android.content.ComponentName;
50 import android.content.ContentResolver;
51 import android.content.ContentValues;
52 import android.content.Context;
53 import android.content.IContentProvider;
54 import android.content.Intent;
55 import android.content.pm.ActivityInfo;
56 import android.content.pm.PackageManager;
57 import android.content.pm.ResolveInfo;
58 import android.content.res.Configuration;
59 import android.content.res.Resources;
60 import android.database.Cursor;
61 import android.database.SQLException;
62 import android.hardware.display.ColorDisplayManager;
63 import android.location.LocationManager;
64 import android.media.AudioFormat;
65 import android.net.ConnectivityManager;
66 import android.net.NetworkScoreManager;
67 import android.net.Uri;
68 import android.net.wifi.WifiManager;
69 import android.os.BatteryManager;
70 import android.os.Binder;
71 import android.os.Build.VERSION_CODES;
72 import android.os.Bundle;
73 import android.os.DropBoxManager;
74 import android.os.IBinder;
75 import android.os.LocaleList;
76 import android.os.PowerManager.AutoPowerSaveModeTriggers;
77 import android.os.Process;
78 import android.os.RemoteException;
79 import android.os.ResultReceiver;
80 import android.os.ServiceManager;
81 import android.os.UserHandle;
82 import android.provider.SettingsValidators.Validator;
83 import android.speech.tts.TextToSpeech;
84 import android.telephony.SubscriptionManager;
85 import android.text.TextUtils;
86 import android.util.AndroidException;
87 import android.util.ArrayMap;
88 import android.util.ArraySet;
89 import android.util.Log;
90 import android.util.MemoryIntArray;
91 import android.view.inputmethod.InputMethodSystemProperty;
92 
93 import com.android.internal.annotations.GuardedBy;
94 import com.android.internal.widget.ILockSettings;
95 
96 import java.io.IOException;
97 import java.lang.annotation.Retention;
98 import java.lang.annotation.RetentionPolicy;
99 import java.net.URISyntaxException;
100 import java.text.SimpleDateFormat;
101 import java.util.HashMap;
102 import java.util.HashSet;
103 import java.util.Locale;
104 import java.util.Map;
105 import java.util.Set;
106 
107 /**
108  * The Settings provider contains global system-level device preferences.
109  */
110 public final class Settings {
111 
112     // Intent actions for Settings
113 
114     /**
115      * Activity Action: Show system settings.
116      * <p>
117      * Input: Nothing.
118      * <p>
119      * Output: Nothing.
120      */
121     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
122     public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
123 
124     /**
125      * Activity Action: Show settings to allow configuration of APNs.
126      * <p>
127      * Input: Nothing.
128      * <p>
129      * Output: Nothing.
130      *
131      * <p class="note">
132      * In some cases, a matching Activity may not exist, so ensure you
133      * safeguard against this.
134      */
135     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
136     public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
137 
138     /**
139      * Activity Action: Show settings to allow configuration of current location
140      * sources.
141      * <p>
142      * In some cases, a matching Activity may not exist, so ensure you
143      * safeguard against this.
144      * <p>
145      * Input: Nothing.
146      * <p>
147      * Output: Nothing.
148      */
149     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
150     public static final String ACTION_LOCATION_SOURCE_SETTINGS =
151             "android.settings.LOCATION_SOURCE_SETTINGS";
152 
153     /**
154      * Activity Action: Show settings to allow configuration of location controller extra package.
155      * <p>
156      * In some cases, a matching Activity may not exist, so ensure you
157      * safeguard against this.
158      * <p>
159      * Input: Nothing.
160      * <p>
161      * Output: Nothing.
162      *
163      * @hide
164      */
165     @SystemApi
166     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
167     public static final String ACTION_LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS =
168             "android.settings.LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS";
169 
170     /**
171      * Activity Action: Show scanning settings to allow configuration of Wi-Fi
172      * and Bluetooth scanning settings.
173      * <p>
174      * In some cases, a matching Activity may not exist, so ensure you
175      * safeguard against this.
176      * <p>
177      * Input: Nothing.
178      * <p>
179      * Output: Nothing.
180      * @hide
181      */
182     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
183     public static final String ACTION_LOCATION_SCANNING_SETTINGS =
184             "android.settings.LOCATION_SCANNING_SETTINGS";
185 
186     /**
187      * Activity Action: Show settings to allow configuration of users.
188      * <p>
189      * In some cases, a matching Activity may not exist, so ensure you
190      * safeguard against this.
191      * <p>
192      * Input: Nothing.
193      * <p>
194      * Output: Nothing.
195      * @hide
196      */
197     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
198     public static final String ACTION_USER_SETTINGS =
199             "android.settings.USER_SETTINGS";
200 
201     /**
202      * Activity Action: Show settings to allow configuration of wireless controls
203      * such as Wi-Fi, Bluetooth and Mobile networks.
204      * <p>
205      * In some cases, a matching Activity may not exist, so ensure you
206      * safeguard against this.
207      * <p>
208      * Input: Nothing.
209      * <p>
210      * Output: Nothing.
211      */
212     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
213     public static final String ACTION_WIRELESS_SETTINGS =
214             "android.settings.WIRELESS_SETTINGS";
215 
216     /**
217      * Activity Action: Show tether provisioning activity.
218      *
219      * <p>
220      * In some cases, a matching Activity may not exist, so ensure you
221      * safeguard against this.
222      * <p>
223      * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type
224      * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should
225      * contain a {@link ResultReceiver} which will be called back with a tether result code.
226      * <p>
227      * Output: The result of the provisioning check.
228      * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful,
229      * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure.
230      *
231      * @hide
232      */
233     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
234     public static final String ACTION_TETHER_PROVISIONING =
235             "android.settings.TETHER_PROVISIONING_UI";
236 
237     /**
238      * Activity Action: Show settings to allow entering/exiting airplane mode.
239      * <p>
240      * In some cases, a matching Activity may not exist, so ensure you
241      * safeguard against this.
242      * <p>
243      * Input: Nothing.
244      * <p>
245      * Output: Nothing.
246      */
247     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
248     public static final String ACTION_AIRPLANE_MODE_SETTINGS =
249             "android.settings.AIRPLANE_MODE_SETTINGS";
250 
251     /**
252      * Activity Action: Show mobile data usage list.
253      * <p>
254      * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify
255      * how and what mobile data statistics should be collected.
256      * <p>
257      * Output: Nothing
258      * @hide
259      */
260     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
261     public static final String ACTION_MOBILE_DATA_USAGE =
262             "android.settings.MOBILE_DATA_USAGE";
263 
264     /** @hide */
265     public static final String EXTRA_NETWORK_TEMPLATE = "network_template";
266 
267     /**
268      * An int extra specifying a subscription ID.
269      *
270      * @see android.telephony.SubscriptionInfo#getSubscriptionId
271      */
272     public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID";
273 
274     /**
275      * Activity Action: Modify Airplane mode settings using a voice command.
276      * <p>
277      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
278      * <p>
279      * This intent MUST be started using
280      * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
281      * startVoiceActivity}.
282      * <p>
283      * Note: The activity implementing this intent MUST verify that
284      * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
285      * modifying the setting.
286      * <p>
287      * Input: To tell which state airplane mode should be set to, add the
288      * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
289      * If the extra is not included, no changes will be made.
290      * <p>
291      * Output: Nothing.
292      */
293     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
294     public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
295             "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
296 
297     /**
298      * Activity Action: Show settings for accessibility modules.
299      * <p>
300      * In some cases, a matching Activity may not exist, so ensure you
301      * safeguard against this.
302      * <p>
303      * Input: Nothing.
304      * <p>
305      * Output: Nothing.
306      */
307     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
308     public static final String ACTION_ACCESSIBILITY_SETTINGS =
309             "android.settings.ACCESSIBILITY_SETTINGS";
310 
311     /**
312      * Activity Action: Show detail settings of a particular accessibility service.
313      * <p>
314      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
315      * <p>
316      * Input: {@link Intent#EXTRA_COMPONENT_NAME} must specify the accessibility service component
317      * name to be shown.
318      * <p>
319      * Output: Nothing.
320      * @hide
321      **/
322     @SystemApi
323     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
324     public static final String ACTION_ACCESSIBILITY_DETAILS_SETTINGS =
325             "android.settings.ACCESSIBILITY_DETAILS_SETTINGS";
326 
327     /**
328      * Activity Action: Show settings to control access to usage information.
329      * <p>
330      * In some cases, a matching Activity may not exist, so ensure you
331      * safeguard against this.
332      * <p>
333      * Input: Nothing.
334      * <p>
335      * Output: Nothing.
336      */
337     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
338     public static final String ACTION_USAGE_ACCESS_SETTINGS =
339             "android.settings.USAGE_ACCESS_SETTINGS";
340 
341     /**
342      * Activity Category: Show application settings related to usage access.
343      * <p>
344      * An activity that provides a user interface for adjusting usage access related
345      * preferences for its containing application. Optional but recommended for apps that
346      * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}.
347      * <p>
348      * The activity may define meta-data to describe what usage access is
349      * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which
350      * will be displayed in Settings.
351      * <p>
352      * Input: Nothing.
353      * <p>
354      * Output: Nothing.
355      */
356     @SdkConstant(SdkConstantType.INTENT_CATEGORY)
357     public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG =
358             "android.intent.category.USAGE_ACCESS_CONFIG";
359 
360     /**
361      * Metadata key: Reason for needing usage access.
362      * <p>
363      * A key for metadata attached to an activity that receives action
364      * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the
365      * user as description of how the app uses usage access.
366      * <p>
367      */
368     public static final String METADATA_USAGE_ACCESS_REASON =
369             "android.settings.metadata.USAGE_ACCESS_REASON";
370 
371     /**
372      * Activity Action: Show settings to allow configuration of security and
373      * location privacy.
374      * <p>
375      * In some cases, a matching Activity may not exist, so ensure you
376      * safeguard against this.
377      * <p>
378      * Input: Nothing.
379      * <p>
380      * Output: Nothing.
381      */
382     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
383     public static final String ACTION_SECURITY_SETTINGS =
384             "android.settings.SECURITY_SETTINGS";
385 
386     /**
387      * Activity Action: Show settings to allow configuration of trusted external sources
388      *
389      * Input: Optionally, the Intent's data URI can specify the application package name to
390      * directly invoke the management GUI specific to the package name. For example
391      * "package:com.my.app".
392      * <p>
393      * Output: Nothing.
394      */
395     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
396     public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES =
397             "android.settings.MANAGE_UNKNOWN_APP_SOURCES";
398 
399     /**
400      * Activity Action: Show the "Open by Default" page in a particular application's details page.
401      * <p>
402      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
403      * <p>
404      * Input: The Intent's data URI specifies the application package name
405      * to be shown, with the "package" scheme. That is "package:com.my.app".
406      * <p>
407      * Output: Nothing.
408      * @hide
409      */
410     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
411     public static final String ACTION_APP_OPEN_BY_DEFAULT_SETTINGS =
412             "com.android.settings.APP_OPEN_BY_DEFAULT_SETTINGS";
413 
414     /**
415      * Activity Action: Show trusted credentials settings, opening to the user tab,
416      * to allow management of installed credentials.
417      * <p>
418      * In some cases, a matching Activity may not exist, so ensure you
419      * safeguard against this.
420      * <p>
421      * Input: Nothing.
422      * <p>
423      * Output: Nothing.
424      * @hide
425      */
426     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
427     @UnsupportedAppUsage
428     public static final String ACTION_TRUSTED_CREDENTIALS_USER =
429             "com.android.settings.TRUSTED_CREDENTIALS_USER";
430 
431     /**
432      * Activity Action: Show dialog explaining that an installed CA cert may enable
433      * monitoring of encrypted network traffic.
434      * <p>
435      * In some cases, a matching Activity may not exist, so ensure you
436      * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the
437      * number of certificates.
438      * <p>
439      * Input: Nothing.
440      * <p>
441      * Output: Nothing.
442      * @hide
443      */
444     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
445     public static final String ACTION_MONITORING_CERT_INFO =
446             "com.android.settings.MONITORING_CERT_INFO";
447 
448     /**
449      * Activity Action: Show settings to allow configuration of privacy options.
450      * <p>
451      * In some cases, a matching Activity may not exist, so ensure you
452      * safeguard against this.
453      * <p>
454      * Input: Nothing.
455      * <p>
456      * Output: Nothing.
457      */
458     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
459     public static final String ACTION_PRIVACY_SETTINGS =
460             "android.settings.PRIVACY_SETTINGS";
461 
462     /**
463      * Activity Action: Show settings to allow configuration of VPN.
464      * <p>
465      * In some cases, a matching Activity may not exist, so ensure you
466      * safeguard against this.
467      * <p>
468      * Input: Nothing.
469      * <p>
470      * Output: Nothing.
471      */
472     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
473     public static final String ACTION_VPN_SETTINGS =
474             "android.settings.VPN_SETTINGS";
475 
476     /**
477      * Activity Action: Show settings to allow configuration of Wi-Fi.
478      * <p>
479      * In some cases, a matching Activity may not exist, so ensure you
480      * safeguard against this.
481      * <p>
482      * Input: Nothing.
483      * <p>
484      * Output: Nothing.
485      */
486     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
487     public static final String ACTION_WIFI_SETTINGS =
488             "android.settings.WIFI_SETTINGS";
489 
490     /**
491      * Activity Action: Show settings to allow configuration of a static IP
492      * address for Wi-Fi.
493      * <p>
494      * In some cases, a matching Activity may not exist, so ensure you safeguard
495      * against this.
496      * <p>
497      * Input: Nothing.
498      * <p>
499      * Output: Nothing.
500      */
501     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
502     public static final String ACTION_WIFI_IP_SETTINGS =
503             "android.settings.WIFI_IP_SETTINGS";
504 
505     /**
506      * Activity Action: Show setting page to process an Easy Connect (Wi-Fi DPP) QR code and start
507      * configuration. This intent should be used when you want to use this device to take on the
508      * configurator role for an IoT/other device. When provided with a valid DPP URI string Settings
509      * will open a wifi selection screen for the user to indicate which network they would like
510      * to configure the device specified in the DPP URI string for and carry them through the rest
511      * of the flow for provisioning the device.
512      * <p>
513      * In some cases, a matching Activity may not exist, so ensure you safeguard
514      * against this by checking WifiManager.isEasyConnectSupported();
515      * <p>
516      * Input: The Intent's data URI specifies bootstrapping information for authenticating and
517      * provisioning the peer, with the "DPP" scheme.
518      * <p>
519      * Output: After {@code startActivityForResult}, the callback {@code onActivityResult} will have
520      *         resultCode {@link android.app.Activity#RESULT_OK} if Wi-Fi Easy Connect configuration
521      *         success and the user clicks 'Done' button.
522      */
523     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
524     public static final String ACTION_PROCESS_WIFI_EASY_CONNECT_URI =
525             "android.settings.PROCESS_WIFI_EASY_CONNECT_URI";
526 
527     /**
528      * Activity Action: Show settings to allow configuration of data and view data usage.
529      * <p>
530      * In some cases, a matching Activity may not exist, so ensure you
531      * safeguard against this.
532      * <p>
533      * Input: Nothing.
534      * <p>
535      * Output: Nothing.
536      */
537     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
538     public static final String ACTION_DATA_USAGE_SETTINGS =
539             "android.settings.DATA_USAGE_SETTINGS";
540 
541     /**
542      * Activity Action: Show settings to allow configuration of Bluetooth.
543      * <p>
544      * In some cases, a matching Activity may not exist, so ensure you
545      * safeguard against this.
546      * <p>
547      * Input: Nothing.
548      * <p>
549      * Output: Nothing.
550      */
551     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
552     public static final String ACTION_BLUETOOTH_SETTINGS =
553             "android.settings.BLUETOOTH_SETTINGS";
554 
555     /**
556      * Activity action: Show Settings app search UI when this action is available for device.
557      * <p>
558      * Input: Nothing.
559      * <p>
560      * Output: Nothing.
561      */
562     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
563     public static final String ACTION_APP_SEARCH_SETTINGS = "android.settings.APP_SEARCH_SETTINGS";
564 
565     /**
566      * Activity Action: Show settings to allow configuration of Assist Gesture.
567      * <p>
568      * In some cases, a matching Activity may not exist, so ensure you
569      * safeguard against this.
570      * <p>
571      * Input: Nothing.
572      * <p>
573      * Output: Nothing.
574      * @hide
575      */
576     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
577     public static final String ACTION_ASSIST_GESTURE_SETTINGS =
578             "android.settings.ASSIST_GESTURE_SETTINGS";
579 
580     /**
581      * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if
582      * necessary.
583      * <p>
584      * Input: Nothing.
585      * <p>
586      * Output: Nothing.
587      */
588     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
589     public static final String ACTION_FINGERPRINT_ENROLL =
590             "android.settings.FINGERPRINT_ENROLL";
591 
592     /**
593      * Activity Action: Show settings to allow configuration of cast endpoints.
594      * <p>
595      * In some cases, a matching Activity may not exist, so ensure you
596      * safeguard against this.
597      * <p>
598      * Input: Nothing.
599      * <p>
600      * Output: Nothing.
601      */
602     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
603     public static final String ACTION_CAST_SETTINGS =
604             "android.settings.CAST_SETTINGS";
605 
606     /**
607      * Activity Action: Show settings to allow configuration of date and time.
608      * <p>
609      * In some cases, a matching Activity may not exist, so ensure you
610      * safeguard against this.
611      * <p>
612      * Input: Nothing.
613      * <p>
614      * Output: Nothing.
615      */
616     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
617     public static final String ACTION_DATE_SETTINGS =
618             "android.settings.DATE_SETTINGS";
619 
620     /**
621      * Activity Action: Show settings to allow configuration of sound and volume.
622      * <p>
623      * In some cases, a matching Activity may not exist, so ensure you
624      * safeguard against this.
625      * <p>
626      * Input: Nothing.
627      * <p>
628      * Output: Nothing.
629      */
630     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
631     public static final String ACTION_SOUND_SETTINGS =
632             "android.settings.SOUND_SETTINGS";
633 
634     /**
635      * Activity Action: Show settings to allow configuration of display.
636      * <p>
637      * In some cases, a matching Activity may not exist, so ensure you
638      * safeguard against this.
639      * <p>
640      * Input: Nothing.
641      * <p>
642      * Output: Nothing.
643      */
644     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
645     public static final String ACTION_DISPLAY_SETTINGS =
646             "android.settings.DISPLAY_SETTINGS";
647 
648     /**
649      * Activity Action: Show settings to allow configuration of Night display.
650      * <p>
651      * In some cases, a matching Activity may not exist, so ensure you
652      * safeguard against this.
653      * <p>
654      * Input: Nothing.
655      * <p>
656      * Output: Nothing.
657      */
658     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
659     public static final String ACTION_NIGHT_DISPLAY_SETTINGS =
660             "android.settings.NIGHT_DISPLAY_SETTINGS";
661 
662     /**
663      * Activity Action: Show settings to allow configuration of locale.
664      * <p>
665      * In some cases, a matching Activity may not exist, so ensure you
666      * safeguard against this.
667      * <p>
668      * Input: Nothing.
669      * <p>
670      * Output: Nothing.
671      */
672     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
673     public static final String ACTION_LOCALE_SETTINGS =
674             "android.settings.LOCALE_SETTINGS";
675 
676     /**
677      * Activity Action: Show settings to configure input methods, in particular
678      * allowing the user to enable input methods.
679      * <p>
680      * In some cases, a matching Activity may not exist, so ensure you
681      * safeguard against this.
682      * <p>
683      * Input: Nothing.
684      * <p>
685      * Output: Nothing.
686      */
687     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
688     public static final String ACTION_VOICE_INPUT_SETTINGS =
689             "android.settings.VOICE_INPUT_SETTINGS";
690 
691     /**
692      * Activity Action: Show settings to configure input methods, in particular
693      * allowing the user to enable input methods.
694      * <p>
695      * In some cases, a matching Activity may not exist, so ensure you
696      * safeguard against this.
697      * <p>
698      * Input: Nothing.
699      * <p>
700      * Output: Nothing.
701      */
702     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
703     public static final String ACTION_INPUT_METHOD_SETTINGS =
704             "android.settings.INPUT_METHOD_SETTINGS";
705 
706     /**
707      * Activity Action: Show settings to enable/disable input method subtypes.
708      * <p>
709      * In some cases, a matching Activity may not exist, so ensure you
710      * safeguard against this.
711      * <p>
712      * To tell which input method's subtypes are displayed in the settings, add
713      * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
714      * If there is no extra in this Intent, subtypes from all installed input methods
715      * will be displayed in the settings.
716      *
717      * @see android.view.inputmethod.InputMethodInfo#getId
718      * <p>
719      * Input: Nothing.
720      * <p>
721      * Output: Nothing.
722      */
723     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
724     public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
725             "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
726 
727     /**
728      * Activity Action: Show settings to manage the user input dictionary.
729      * <p>
730      * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
731      * it is guaranteed there will always be an appropriate implementation for this Intent action.
732      * In prior releases of the platform this was optional, so ensure you safeguard against it.
733      * <p>
734      * Input: Nothing.
735      * <p>
736      * Output: Nothing.
737      */
738     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
739     public static final String ACTION_USER_DICTIONARY_SETTINGS =
740             "android.settings.USER_DICTIONARY_SETTINGS";
741 
742     /**
743      * Activity Action: Show settings to configure the hardware keyboard.
744      * <p>
745      * In some cases, a matching Activity may not exist, so ensure you
746      * safeguard against this.
747      * <p>
748      * Input: Nothing.
749      * <p>
750      * Output: Nothing.
751      */
752     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
753     public static final String ACTION_HARD_KEYBOARD_SETTINGS =
754             "android.settings.HARD_KEYBOARD_SETTINGS";
755 
756     /**
757      * Activity Action: Adds a word to the user dictionary.
758      * <p>
759      * In some cases, a matching Activity may not exist, so ensure you
760      * safeguard against this.
761      * <p>
762      * Input: An extra with key <code>word</code> that contains the word
763      * that should be added to the dictionary.
764      * <p>
765      * Output: Nothing.
766      *
767      * @hide
768      */
769     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
770     @UnsupportedAppUsage
771     public static final String ACTION_USER_DICTIONARY_INSERT =
772             "com.android.settings.USER_DICTIONARY_INSERT";
773 
774     /**
775      * Activity Action: Show settings to allow configuration of application-related settings.
776      * <p>
777      * In some cases, a matching Activity may not exist, so ensure you
778      * safeguard against this.
779      * <p>
780      * Input: Nothing.
781      * <p>
782      * Output: Nothing.
783      */
784     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
785     public static final String ACTION_APPLICATION_SETTINGS =
786             "android.settings.APPLICATION_SETTINGS";
787 
788     /**
789      * Activity Action: Show settings to allow configuration of application
790      * development-related settings.  As of
791      * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
792      * a required part of the platform.
793      * <p>
794      * Input: Nothing.
795      * <p>
796      * Output: Nothing.
797      */
798     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
799     public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
800             "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
801 
802     /**
803      * Activity Action: Show settings to allow configuration of quick launch shortcuts.
804      * <p>
805      * In some cases, a matching Activity may not exist, so ensure you
806      * safeguard against this.
807      * <p>
808      * Input: Nothing.
809      * <p>
810      * Output: Nothing.
811      */
812     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
813     public static final String ACTION_QUICK_LAUNCH_SETTINGS =
814             "android.settings.QUICK_LAUNCH_SETTINGS";
815 
816     /**
817      * Activity Action: Show settings to manage installed applications.
818      * <p>
819      * In some cases, a matching Activity may not exist, so ensure you
820      * safeguard against this.
821      * <p>
822      * Input: Nothing.
823      * <p>
824      * Output: Nothing.
825      */
826     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
827     public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
828             "android.settings.MANAGE_APPLICATIONS_SETTINGS";
829 
830     /**
831      * Activity Action: Show settings to manage all applications.
832      * <p>
833      * In some cases, a matching Activity may not exist, so ensure you
834      * safeguard against this.
835      * <p>
836      * Input: Nothing.
837      * <p>
838      * Output: Nothing.
839      */
840     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
841     public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
842             "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
843 
844     /**
845      * Activity Action: Show screen for controlling which apps can draw on top of other apps.
846      * <p>
847      * In some cases, a matching Activity may not exist, so ensure you
848      * safeguard against this.
849      * <p>
850      * Input: Optionally, the Intent's data URI can specify the application package name to
851      * directly invoke the management GUI specific to the package name. For example
852      * "package:com.my.app".
853      * <p>
854      * Output: Nothing.
855      */
856     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
857     public static final String ACTION_MANAGE_OVERLAY_PERMISSION =
858             "android.settings.action.MANAGE_OVERLAY_PERMISSION";
859 
860     /**
861      * Activity Action: Show screen for controlling which apps are allowed to write/modify
862      * system settings.
863      * <p>
864      * In some cases, a matching Activity may not exist, so ensure you
865      * safeguard against this.
866      * <p>
867      * Input: Optionally, the Intent's data URI can specify the application package name to
868      * directly invoke the management GUI specific to the package name. For example
869      * "package:com.my.app".
870      * <p>
871      * Output: Nothing.
872      */
873     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
874     public static final String ACTION_MANAGE_WRITE_SETTINGS =
875             "android.settings.action.MANAGE_WRITE_SETTINGS";
876 
877     /**
878      * Activity Action: Show screen for controlling app usage properties for an app.
879      * Input: Intent's extra {@link android.content.Intent#EXTRA_PACKAGE_NAME} must specify the
880      * application package name.
881      * Output: Nothing.
882      */
883     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
884     public static final String ACTION_APP_USAGE_SETTINGS =
885             "android.settings.action.APP_USAGE_SETTINGS";
886 
887     /**
888      * Activity Action: Show screen of details about a particular application.
889      * <p>
890      * In some cases, a matching Activity may not exist, so ensure you
891      * safeguard against this.
892      * <p>
893      * Input: The Intent's data URI specifies the application package name
894      * to be shown, with the "package" scheme.  That is "package:com.my.app".
895      * <p>
896      * Output: Nothing.
897      */
898     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
899     public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
900             "android.settings.APPLICATION_DETAILS_SETTINGS";
901 
902     /**
903      * Activity Action: Show list of applications that have been running
904      * foreground services (to the user "running in the background").
905      * <p>
906      * Input: Extras "packages" is a string array of package names.
907      * <p>
908      * Output: Nothing.
909      * @hide
910      */
911     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
912     public static final String ACTION_FOREGROUND_SERVICES_SETTINGS =
913             "android.settings.FOREGROUND_SERVICES_SETTINGS";
914 
915     /**
916      * Activity Action: Show screen for controlling which apps can ignore battery optimizations.
917      * <p>
918      * Input: Nothing.
919      * <p>
920      * Output: Nothing.
921      * <p>
922      * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
923      * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
924      * already ignoring optimizations.  You can use
925      * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you
926      * on this list.
927      */
928     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
929     public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS =
930             "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS";
931 
932     /**
933      * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is,
934      * put them on the whitelist of apps shown by
935      * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}).  For an app to use this, it also
936      * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}
937      * permission.
938      * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities
939      * provided by the platform for applications to operate correctly in the various power
940      * saving modes.  This is only for unusual applications that need to deeply control their own
941      * execution, at the potential expense of the user's battery life.  Note that these applications
942      * greatly run the risk of showing to the user as high power consumers on their device.</p>
943      * <p>
944      * Input: The Intent's data URI must specify the application package name
945      * to be shown, with the "package" scheme.  That is "package:com.my.app".
946      * <p>
947      * Output: Nothing.
948      * <p>
949      * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
950      * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
951      * already ignoring optimizations.
952      */
953     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
954     public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS =
955             "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
956 
957     /**
958      * Activity Action: Open the advanced power usage details page of an associated app.
959      * <p>
960      * Input: Intent's data URI set with an application name, using the
961      * "package" schema (like "package:com.my.app")
962      * <p>
963      * Output: Nothing.
964      *
965      * @hide
966      */
967     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
968     public static final String ACTION_VIEW_ADVANCED_POWER_USAGE_DETAIL =
969             "android.settings.VIEW_ADVANCED_POWER_USAGE_DETAIL";
970 
971     /**
972      * Activity Action: Show screen for controlling background data
973      * restrictions for a particular application.
974      * <p>
975      * Input: Intent's data URI set with an application name, using the
976      * "package" schema (like "package:com.my.app").
977      *
978      * <p>
979      * Output: Nothing.
980      * <p>
981      * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus
982      * ConnectivityManager#getRestrictBackgroundStatus()} to determine the
983      * status of the background data restrictions for them.
984      *
985      * <p class="note">
986      * In some cases, a matching Activity may not exist, so ensure you
987      * safeguard against this.
988      */
989     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
990     public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS =
991             "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS";
992 
993     /**
994      * @hide
995      * Activity Action: Show the "app ops" settings screen.
996      * <p>
997      * Input: Nothing.
998      * <p>
999      * Output: Nothing.
1000      */
1001     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1002     public static final String ACTION_APP_OPS_SETTINGS =
1003             "android.settings.APP_OPS_SETTINGS";
1004 
1005     /**
1006      * Activity Action: Show settings for system update functionality.
1007      * <p>
1008      * In some cases, a matching Activity may not exist, so ensure you
1009      * safeguard against this.
1010      * <p>
1011      * Input: Nothing.
1012      * <p>
1013      * Output: Nothing.
1014      *
1015      * @hide
1016      */
1017     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1018     public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
1019             "android.settings.SYSTEM_UPDATE_SETTINGS";
1020 
1021     /**
1022      * Activity Action: Show settings for managed profile settings.
1023      * <p>
1024      * In some cases, a matching Activity may not exist, so ensure you
1025      * safeguard against this.
1026      * <p>
1027      * Input: Nothing.
1028      * <p>
1029      * Output: Nothing.
1030      *
1031      * @hide
1032      */
1033     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1034     public static final String ACTION_MANAGED_PROFILE_SETTINGS =
1035             "android.settings.MANAGED_PROFILE_SETTINGS";
1036 
1037     /**
1038      * Activity Action: Show settings to allow configuration of sync settings.
1039      * <p>
1040      * In some cases, a matching Activity may not exist, so ensure you
1041      * safeguard against this.
1042      * <p>
1043      * The account types available to add via the add account button may be restricted by adding an
1044      * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
1045      * authorities. Only account types which can sync with that content provider will be offered to
1046      * the user.
1047      * <p>
1048      * Input: Nothing.
1049      * <p>
1050      * Output: Nothing.
1051      */
1052     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1053     public static final String ACTION_SYNC_SETTINGS =
1054             "android.settings.SYNC_SETTINGS";
1055 
1056     /**
1057      * Activity Action: Show add account screen for creating a new account.
1058      * <p>
1059      * In some cases, a matching Activity may not exist, so ensure you
1060      * safeguard against this.
1061      * <p>
1062      * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
1063      * extra to the Intent with one or more syncable content provider's authorities.  Only account
1064      * types which can sync with that content provider will be offered to the user.
1065      * <p>
1066      * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
1067      * Intent with one or more account types.
1068      * <p>
1069      * Input: Nothing.
1070      * <p>
1071      * Output: Nothing.
1072      */
1073     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1074     public static final String ACTION_ADD_ACCOUNT =
1075             "android.settings.ADD_ACCOUNT_SETTINGS";
1076 
1077     /**
1078      * Activity Action: Show settings for enabling or disabling data saver
1079      * <p></p>
1080      * In some cases, a matching Activity may not exist, so ensure you
1081      * safeguard against this.
1082      * <p>
1083      * Input: Nothing.
1084      * <p>
1085      * Output: Nothing.
1086      *
1087      * @hide
1088      */
1089     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1090     public static final String ACTION_DATA_SAVER_SETTINGS =
1091             "android.settings.DATA_SAVER_SETTINGS";
1092 
1093     /**
1094      * Activity Action: Show settings for selecting the network operator.
1095      * <p>
1096      * In some cases, a matching Activity may not exist, so ensure you
1097      * safeguard against this.
1098      * <p>
1099      * The subscription ID of the subscription for which available network operators should be
1100      * displayed may be optionally specified with {@link #EXTRA_SUB_ID}.
1101      * <p>
1102      * Input: Nothing.
1103      * <p>
1104      * Output: Nothing.
1105      */
1106     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1107     public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
1108             "android.settings.NETWORK_OPERATOR_SETTINGS";
1109 
1110     /**
1111      * Activity Action: Show settings for selection of 2G/3G.
1112      * <p>
1113      * In some cases, a matching Activity may not exist, so ensure you
1114      * safeguard against this.
1115      * <p>
1116      * Input: Nothing.
1117      * <p>
1118      * Output: Nothing.
1119      */
1120     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1121     public static final String ACTION_DATA_ROAMING_SETTINGS =
1122             "android.settings.DATA_ROAMING_SETTINGS";
1123 
1124     /**
1125      * Activity Action: Show settings for internal storage.
1126      * <p>
1127      * In some cases, a matching Activity may not exist, so ensure you
1128      * safeguard against this.
1129      * <p>
1130      * Input: Nothing.
1131      * <p>
1132      * Output: Nothing.
1133      */
1134     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1135     public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
1136             "android.settings.INTERNAL_STORAGE_SETTINGS";
1137     /**
1138      * Activity Action: Show settings for memory card storage.
1139      * <p>
1140      * In some cases, a matching Activity may not exist, so ensure you
1141      * safeguard against this.
1142      * <p>
1143      * Input: Nothing.
1144      * <p>
1145      * Output: Nothing.
1146      */
1147     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1148     public static final String ACTION_MEMORY_CARD_SETTINGS =
1149             "android.settings.MEMORY_CARD_SETTINGS";
1150 
1151     /**
1152      * Activity Action: Show settings for global search.
1153      * <p>
1154      * In some cases, a matching Activity may not exist, so ensure you
1155      * safeguard against this.
1156      * <p>
1157      * Input: Nothing.
1158      * <p>
1159      * Output: Nothing
1160      */
1161     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1162     public static final String ACTION_SEARCH_SETTINGS =
1163         "android.search.action.SEARCH_SETTINGS";
1164 
1165     /**
1166      * Activity Action: Show general device information settings (serial
1167      * number, software version, phone number, etc.).
1168      * <p>
1169      * In some cases, a matching Activity may not exist, so ensure you
1170      * safeguard against this.
1171      * <p>
1172      * Input: Nothing.
1173      * <p>
1174      * Output: Nothing
1175      */
1176     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1177     public static final String ACTION_DEVICE_INFO_SETTINGS =
1178         "android.settings.DEVICE_INFO_SETTINGS";
1179 
1180     /**
1181      * Activity Action: Show NFC settings.
1182      * <p>
1183      * This shows UI that allows NFC to be turned on or off.
1184      * <p>
1185      * In some cases, a matching Activity may not exist, so ensure you
1186      * safeguard against this.
1187      * <p>
1188      * Input: Nothing.
1189      * <p>
1190      * Output: Nothing
1191      * @see android.nfc.NfcAdapter#isEnabled()
1192      */
1193     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1194     public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
1195 
1196     /**
1197      * Activity Action: Show NFC Sharing settings.
1198      * <p>
1199      * This shows UI that allows NDEF Push (Android Beam) to be turned on or
1200      * off.
1201      * <p>
1202      * In some cases, a matching Activity may not exist, so ensure you
1203      * safeguard against this.
1204      * <p>
1205      * Input: Nothing.
1206      * <p>
1207      * Output: Nothing
1208      * @see android.nfc.NfcAdapter#isNdefPushEnabled()
1209      */
1210     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1211     public static final String ACTION_NFCSHARING_SETTINGS =
1212         "android.settings.NFCSHARING_SETTINGS";
1213 
1214     /**
1215      * Activity Action: Show NFC Tap & Pay settings
1216      * <p>
1217      * This shows UI that allows the user to configure Tap&Pay
1218      * settings.
1219      * <p>
1220      * In some cases, a matching Activity may not exist, so ensure you
1221      * safeguard against this.
1222      * <p>
1223      * Input: Nothing.
1224      * <p>
1225      * Output: Nothing
1226      */
1227     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1228     public static final String ACTION_NFC_PAYMENT_SETTINGS =
1229         "android.settings.NFC_PAYMENT_SETTINGS";
1230 
1231     /**
1232      * Activity Action: Show Daydream settings.
1233      * <p>
1234      * In some cases, a matching Activity may not exist, so ensure you
1235      * safeguard against this.
1236      * <p>
1237      * Input: Nothing.
1238      * <p>
1239      * Output: Nothing.
1240      * @see android.service.dreams.DreamService
1241      */
1242     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1243     public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
1244 
1245     /**
1246      * Activity Action: Show Notification assistant settings.
1247      * <p>
1248      * In some cases, a matching Activity may not exist, so ensure you
1249      * safeguard against this.
1250      * <p>
1251      * Input: Nothing.
1252      * <p>
1253      * Output: Nothing.
1254      * @see android.service.notification.NotificationAssistantService
1255      */
1256     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1257     public static final String ACTION_NOTIFICATION_ASSISTANT_SETTINGS =
1258             "android.settings.NOTIFICATION_ASSISTANT_SETTINGS";
1259 
1260     /**
1261      * Activity Action: Show Notification listener settings.
1262      * <p>
1263      * In some cases, a matching Activity may not exist, so ensure you
1264      * safeguard against this.
1265      * <p>
1266      * Input: Nothing.
1267      * <p>
1268      * Output: Nothing.
1269      * @see android.service.notification.NotificationListenerService
1270      */
1271     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1272     public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
1273             = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
1274 
1275     /**
1276      * Activity Action: Show Do Not Disturb access settings.
1277      * <p>
1278      * Users can grant and deny access to Do Not Disturb configuration from here. Managed
1279      * profiles cannot grant Do Not Disturb access.
1280      * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1281      * details.
1282      * <p>
1283      * Input: Nothing.
1284      * <p>
1285      * Output: Nothing.
1286      *
1287      * <p class="note">
1288      * In some cases, a matching Activity may not exist, so ensure you
1289      * safeguard against this.
1290      */
1291     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1292     public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
1293             = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
1294 
1295     /**
1296      * Activity Action: Show do not disturb setting page for app.
1297      * <p>
1298      * Users can grant and deny access to Do Not Disturb configuration for an app from here.
1299      * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1300      * details.
1301      * <p>
1302      * Input: Intent's data URI set with an application name, using the
1303      * "package" schema (like "package:com.my.app").
1304      * <p>
1305      * Output: Nothing.
1306      *
1307      * @hide
1308      */
1309     @SystemApi
1310     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1311     public static final String ACTION_NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS =
1312             "android.settings.NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS";
1313 
1314     /**
1315      * @hide
1316      */
1317     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1318     public static final String ACTION_CONDITION_PROVIDER_SETTINGS
1319             = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
1320 
1321     /**
1322      * Activity Action: Show settings for video captioning.
1323      * <p>
1324      * In some cases, a matching Activity may not exist, so ensure you safeguard
1325      * against this.
1326      * <p>
1327      * Input: Nothing.
1328      * <p>
1329      * Output: Nothing.
1330      */
1331     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1332     public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
1333 
1334     /**
1335      * Activity Action: Show the top level print settings.
1336      * <p>
1337      * In some cases, a matching Activity may not exist, so ensure you
1338      * safeguard against this.
1339      * <p>
1340      * Input: Nothing.
1341      * <p>
1342      * Output: Nothing.
1343      */
1344     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1345     public static final String ACTION_PRINT_SETTINGS =
1346             "android.settings.ACTION_PRINT_SETTINGS";
1347 
1348     /**
1349      * Activity Action: Show Zen Mode configuration settings.
1350      *
1351      * @hide
1352      */
1353     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1354     public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
1355 
1356     /**
1357      * Activity Action: Show Zen Mode visual effects configuration settings.
1358      *
1359      * @hide
1360      */
1361     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1362     public static final String ZEN_MODE_BLOCKED_EFFECTS_SETTINGS =
1363             "android.settings.ZEN_MODE_BLOCKED_EFFECTS_SETTINGS";
1364 
1365     /**
1366      * Activity Action: Show Zen Mode onboarding activity.
1367      *
1368      * @hide
1369      */
1370     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1371     public static final String ZEN_MODE_ONBOARDING = "android.settings.ZEN_MODE_ONBOARDING";
1372 
1373     /**
1374      * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings.
1375      */
1376     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1377     public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
1378             = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
1379 
1380     /**
1381      * Activity Action: Show Zen Mode automation configuration settings.
1382      *
1383      * @hide
1384      */
1385     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1386     public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
1387             = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
1388 
1389     /**
1390      * Activity Action: Modify do not disturb mode settings.
1391      * <p>
1392      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1393      * <p>
1394      * This intent MUST be started using
1395      * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1396      * startVoiceActivity}.
1397      * <p>
1398      * Note: The Activity implementing this intent MUST verify that
1399      * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
1400      * returns true before modifying the setting.
1401      * <p>
1402      * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
1403      * how long the user wishes to avoid interruptions for. The optional
1404      * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
1405      * enabling or disabling do not disturb mode. If either extra is not included, the
1406      * user maybe asked to provide the value.
1407      * <p>
1408      * Output: Nothing.
1409      */
1410     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1411     public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
1412             "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
1413 
1414     /**
1415      * Activity Action: Show Zen Mode schedule rule configuration settings.
1416      *
1417      * @hide
1418      */
1419     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1420     public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
1421             = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
1422 
1423     /**
1424      * Activity Action: Show Zen Mode event rule configuration settings.
1425      *
1426      * @hide
1427      */
1428     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1429     public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
1430             = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
1431 
1432     /**
1433      * Activity Action: Show Zen Mode external rule configuration settings.
1434      *
1435      * @hide
1436      */
1437     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1438     public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
1439             = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
1440 
1441     /**
1442      * Activity Action: Show the regulatory information screen for the device.
1443      * <p>
1444      * In some cases, a matching Activity may not exist, so ensure you safeguard
1445      * against this.
1446      * <p>
1447      * Input: Nothing.
1448      * <p>
1449      * Output: Nothing.
1450      */
1451     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1452     public static final String
1453             ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
1454 
1455     /**
1456      * Activity Action: Show Device Name Settings.
1457      * <p>
1458      * In some cases, a matching Activity may not exist, so ensure you safeguard
1459      * against this.
1460      *
1461      * @hide
1462      */
1463     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1464     public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
1465 
1466     /**
1467      * Activity Action: Show pairing settings.
1468      * <p>
1469      * In some cases, a matching Activity may not exist, so ensure you safeguard
1470      * against this.
1471      *
1472      * @hide
1473      */
1474     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1475     public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
1476 
1477     /**
1478      * Activity Action: Show battery saver settings.
1479      * <p>
1480      * In some cases, a matching Activity may not exist, so ensure you safeguard
1481      * against this.
1482      */
1483     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1484     public static final String ACTION_BATTERY_SAVER_SETTINGS
1485             = "android.settings.BATTERY_SAVER_SETTINGS";
1486 
1487     /**
1488      * Activity Action: Modify Battery Saver mode setting using a voice command.
1489      * <p>
1490      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1491      * <p>
1492      * This intent MUST be started using
1493      * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1494      * startVoiceActivity}.
1495      * <p>
1496      * Note: The activity implementing this intent MUST verify that
1497      * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
1498      * modifying the setting.
1499      * <p>
1500      * Input: To tell which state batter saver mode should be set to, add the
1501      * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
1502      * If the extra is not included, no changes will be made.
1503      * <p>
1504      * Output: Nothing.
1505      */
1506     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1507     public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
1508             "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
1509 
1510     /**
1511      * Activity Action: Show Home selection settings. If there are multiple activities
1512      * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
1513      * to pick your preferred activity.
1514      */
1515     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1516     public static final String ACTION_HOME_SETTINGS
1517             = "android.settings.HOME_SETTINGS";
1518 
1519     /**
1520      * Activity Action: Show Default apps settings.
1521      * <p>
1522      * In some cases, a matching Activity may not exist, so ensure you
1523      * safeguard against this.
1524      * <p>
1525      * Input: Nothing.
1526      * <p>
1527      * Output: Nothing.
1528      */
1529     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1530     public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS
1531             = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS";
1532 
1533     /**
1534      * Activity Action: Show More default apps settings.
1535      * <p>
1536      * If a Settings activity handles this intent action, a "More defaults" entry will be shown in
1537      * the Default apps settings, and clicking it will launch that activity.
1538      * <p>
1539      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1540      * <p>
1541      * Input: Nothing.
1542      * <p>
1543      * Output: Nothing.
1544      *
1545      * @hide
1546      */
1547     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1548     @SystemApi
1549     public static final String ACTION_MANAGE_MORE_DEFAULT_APPS_SETTINGS =
1550             "android.settings.MANAGE_MORE_DEFAULT_APPS_SETTINGS";
1551 
1552     /**
1553      * Activity Action: Show notification settings.
1554      *
1555      * @hide
1556      */
1557     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1558     public static final String ACTION_NOTIFICATION_SETTINGS
1559             = "android.settings.NOTIFICATION_SETTINGS";
1560 
1561     /**
1562      * Activity Action: Show app listing settings, filtered by those that send notifications.
1563      *
1564      * @hide
1565      */
1566     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1567     public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS =
1568             "android.settings.ALL_APPS_NOTIFICATION_SETTINGS";
1569 
1570     /**
1571      * Activity Action: Show notification settings for a single app.
1572      * <p>
1573      *     Input: {@link #EXTRA_APP_PACKAGE}, the package to display.
1574      * <p>
1575      * Output: Nothing.
1576      */
1577     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1578     public static final String ACTION_APP_NOTIFICATION_SETTINGS
1579             = "android.settings.APP_NOTIFICATION_SETTINGS";
1580 
1581     /**
1582      * Activity Action: Show notification settings for a single {@link NotificationChannel}.
1583      * <p>
1584      *     Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display.
1585      *     Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display.
1586      * <p>
1587      * Output: Nothing.
1588      */
1589     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1590     public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS
1591             = "android.settings.CHANNEL_NOTIFICATION_SETTINGS";
1592 
1593     /**
1594      * Activity Action: Show notification bubble settings for a single app.
1595      * See {@link NotificationManager#areBubblesAllowed()}.
1596      * <p>
1597      *     Input: {@link #EXTRA_APP_PACKAGE}, the package to display.
1598      * <p>
1599      * Output: Nothing.
1600      */
1601     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1602     public static final String ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS
1603             = "android.settings.APP_NOTIFICATION_BUBBLE_SETTINGS";
1604 
1605     /**
1606      * Activity Extra: The package owner of the notification channel settings to display.
1607      * <p>
1608      * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
1609      */
1610     public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE";
1611 
1612     /**
1613      * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings
1614      * to display.
1615      * <p>
1616      * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
1617      */
1618     public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID";
1619 
1620     /**
1621      * Activity Action: Show notification redaction settings.
1622      *
1623      * @hide
1624      */
1625     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1626     public static final String ACTION_APP_NOTIFICATION_REDACTION
1627             = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
1628 
1629     /** @hide */
1630     @UnsupportedAppUsage
1631     public static final String EXTRA_APP_UID = "app_uid";
1632 
1633     /**
1634      * Activity Action: Show a dialog with disabled by policy message.
1635      * <p> If an user action is disabled by policy, this dialog can be triggered to let
1636      * the user know about this.
1637      * <p>
1638      * Input: {@link Intent#EXTRA_USER}: The user of the admin.
1639      * <p>
1640      * Output: Nothing.
1641      *
1642      * @hide
1643      */
1644     // Intent#EXTRA_USER_ID can also be used
1645     @SystemApi
1646     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1647     public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS
1648             = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
1649 
1650     /**
1651      * Activity Action: Show a dialog for remote bugreport flow.
1652      * <p>
1653      * Input: Nothing.
1654      * <p>
1655      * Output: Nothing.
1656      *
1657      * @hide
1658      */
1659     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1660     public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG
1661             = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG";
1662 
1663     /**
1664      * Activity Action: Show VR listener settings.
1665      * <p>
1666      * Input: Nothing.
1667      * <p>
1668      * Output: Nothing.
1669      *
1670      * @see android.service.vr.VrListenerService
1671      */
1672     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1673     public static final String ACTION_VR_LISTENER_SETTINGS
1674             = "android.settings.VR_LISTENER_SETTINGS";
1675 
1676     /**
1677      * Activity Action: Show Picture-in-picture settings.
1678      * <p>
1679      * Input: Nothing.
1680      * <p>
1681      * Output: Nothing.
1682      *
1683      * @hide
1684      */
1685     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1686     public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS
1687             = "android.settings.PICTURE_IN_PICTURE_SETTINGS";
1688 
1689     /**
1690      * Activity Action: Show Storage Manager settings.
1691      * <p>
1692      * Input: Nothing.
1693      * <p>
1694      * Output: Nothing.
1695      *
1696      * @hide
1697      */
1698     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1699     public static final String ACTION_STORAGE_MANAGER_SETTINGS
1700             = "android.settings.STORAGE_MANAGER_SETTINGS";
1701 
1702     /**
1703      * Activity Action: Allows user to select current webview implementation.
1704      * <p>
1705      * Input: Nothing.
1706      * <p>
1707      * Output: Nothing.
1708      */
1709     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1710     public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS";
1711 
1712     /**
1713      * Activity Action: Show enterprise privacy section.
1714      * <p>
1715      * Input: Nothing.
1716      * <p>
1717      * Output: Nothing.
1718      * @hide
1719      */
1720     @SystemApi
1721     @TestApi
1722     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1723     public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS
1724             = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
1725 
1726     /**
1727      * Activity Action: Show screen that let user select its Autofill Service.
1728      * <p>
1729      * Input: Intent's data URI set with an application name, using the
1730      * "package" schema (like "package:com.my.app").
1731      *
1732      * <p>
1733      * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging
1734      * to the caller package.
1735      *
1736      * <p>
1737      * <b>NOTE: </b> Applications should call
1738      * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and
1739      * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action
1740      * to start an activity if they return {@code false} and {@code true} respectively.
1741      */
1742     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1743     public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE =
1744             "android.settings.REQUEST_SET_AUTOFILL_SERVICE";
1745 
1746     /**
1747      * Activity Action: Show screen for controlling which apps have access on volume directories.
1748      * <p>
1749      * Input: Nothing.
1750      * <p>
1751      * Output: Nothing.
1752      * <p>
1753      * Applications typically use this action to ask the user to revert the "Do not ask again"
1754      * status of directory access requests made by
1755      * {@link android.os.storage.StorageVolume#createAccessIntent(String)}.
1756      * @deprecated use {@link #ACTION_APPLICATION_DETAILS_SETTINGS} to manage storage permissions
1757      *             for a specific application
1758      */
1759     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1760     @Deprecated
1761     public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS =
1762             "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS";
1763 
1764 
1765     /**
1766      * Activity Action: Show screen that let user select enable (or disable) Content Capture.
1767      * <p>
1768      * Input: Nothing.
1769      *
1770      * <p>
1771      * Output: Nothing
1772      *
1773      * @hide
1774      */
1775     @SystemApi
1776     @TestApi
1777     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1778     public static final String ACTION_REQUEST_ENABLE_CONTENT_CAPTURE =
1779             "android.settings.REQUEST_ENABLE_CONTENT_CAPTURE";
1780 
1781     /**
1782      * Activity Action: Show screen that let user manage how Android handles URL resolution.
1783      * <p>
1784      * Input: Nothing.
1785      * <p>
1786      * Output: Nothing
1787      *
1788      * @hide
1789      */
1790     @SystemApi
1791     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1792     public static final String ACTION_MANAGE_DOMAIN_URLS = "android.settings.MANAGE_DOMAIN_URLS";
1793 
1794     /**
1795      * Broadcast to trigger notification of asking user to enable MMS.
1796      * Need to specify {@link #EXTRA_ENABLE_MMS_DATA_REQUEST_REASON} and {@link #EXTRA_SUB_ID}.
1797      *
1798      * @hide
1799      */
1800     @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1801     public static final String ACTION_ENABLE_MMS_DATA_REQUEST =
1802             "android.settings.ENABLE_MMS_DATA_REQUEST";
1803 
1804     /**
1805      * Integer value that specifies the reason triggering enable MMS data notification.
1806      * This must be passed as an extra field to the {@link #ACTION_ENABLE_MMS_DATA_REQUEST}.
1807      * Extra with value of EnableMmsDataReason interface.
1808      * @hide
1809      */
1810     public static final String EXTRA_ENABLE_MMS_DATA_REQUEST_REASON =
1811             "android.settings.extra.ENABLE_MMS_DATA_REQUEST_REASON";
1812 
1813     /** @hide */
1814     @Retention(RetentionPolicy.SOURCE)
1815     @IntDef(prefix = { "ENABLE_MMS_DATA_REQUEST_REASON_" }, value = {
1816             ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS,
1817             ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS,
1818     })
1819     public @interface EnableMmsDataReason{}
1820 
1821     /**
1822      * Requesting to enable MMS data because there's an incoming MMS.
1823      * @hide
1824      */
1825     public static final int ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS = 0;
1826 
1827     /**
1828      * Requesting to enable MMS data because user is sending MMS.
1829      * @hide
1830      */
1831     public static final int ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS = 1;
1832 
1833     /**
1834      * Activity Action: Show screen of a cellular subscription and highlight the
1835      * "enable MMS" toggle.
1836      * <p>
1837      * Input: {@link #EXTRA_SUB_ID}: Sub ID of the subscription.
1838      * <p>
1839      * Output: Nothing
1840      *
1841      * @hide
1842      */
1843     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1844     public static final String ACTION_MMS_MESSAGE_SETTING = "android.settings.MMS_MESSAGE_SETTING";
1845 
1846     // End of Intent actions for Settings
1847 
1848     /**
1849      * @hide - Private call() method on SettingsProvider to read from 'system' table.
1850      */
1851     public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
1852 
1853     /**
1854      * @hide - Private call() method on SettingsProvider to read from 'secure' table.
1855      */
1856     public static final String CALL_METHOD_GET_SECURE = "GET_secure";
1857 
1858     /**
1859      * @hide - Private call() method on SettingsProvider to read from 'global' table.
1860      */
1861     public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
1862 
1863     /**
1864      * @hide - Private call() method on SettingsProvider to read from 'config' table.
1865      */
1866     public static final String CALL_METHOD_GET_CONFIG = "GET_config";
1867 
1868     /**
1869      * @hide - Specifies that the caller of the fast-path call()-based flow tracks
1870      * the settings generation in order to cache values locally. If this key is
1871      * mapped to a <code>null</code> string extra in the request bundle, the response
1872      * bundle will contain the same key mapped to a parcelable extra which would be
1873      * an {@link android.util.MemoryIntArray}. The response will also contain an
1874      * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the
1875      * index in the array clients should use to lookup the generation. For efficiency
1876      * the caller should request the generation tracking memory array only if it
1877      * doesn't already have it.
1878      *
1879      * @see #CALL_METHOD_GENERATION_INDEX_KEY
1880      */
1881     public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation";
1882 
1883     /**
1884      * @hide Key with the location in the {@link android.util.MemoryIntArray} where
1885      * to look up the generation id of the backing table. The value is an integer.
1886      *
1887      * @see #CALL_METHOD_TRACK_GENERATION_KEY
1888      */
1889     public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index";
1890 
1891     /**
1892      * @hide Key with the settings table generation. The value is an integer.
1893      *
1894      * @see #CALL_METHOD_TRACK_GENERATION_KEY
1895      */
1896     public static final String CALL_METHOD_GENERATION_KEY = "_generation";
1897 
1898     /**
1899      * @hide - User handle argument extra to the fast-path call()-based requests
1900      */
1901     public static final String CALL_METHOD_USER_KEY = "_user";
1902 
1903     /**
1904      * @hide - Boolean argument extra to the fast-path call()-based requests
1905      */
1906     public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default";
1907 
1908     /**
1909      * @hide - User handle argument extra to the fast-path call()-based requests
1910      */
1911     public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode";
1912 
1913     /**
1914      * @hide - String argument extra to the fast-path call()-based requests
1915      */
1916     public static final String CALL_METHOD_TAG_KEY = "_tag";
1917 
1918     /**
1919      * @hide - String argument extra to the fast-path call()-based requests
1920      */
1921     public static final String CALL_METHOD_PREFIX_KEY = "_prefix";
1922 
1923     /** @hide - Private call() method to write to 'system' table */
1924     public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
1925 
1926     /** @hide - Private call() method to write to 'secure' table */
1927     public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
1928 
1929     /** @hide - Private call() method to write to 'global' table */
1930     public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
1931 
1932     /** @hide - Private call() method to write to 'configuration' table */
1933     public static final String CALL_METHOD_PUT_CONFIG = "PUT_config";
1934 
1935     /** @hide - Private call() method to delete from the 'system' table */
1936     public static final String CALL_METHOD_DELETE_SYSTEM = "DELETE_system";
1937 
1938     /** @hide - Private call() method to delete from the 'secure' table */
1939     public static final String CALL_METHOD_DELETE_SECURE = "DELETE_secure";
1940 
1941     /** @hide - Private call() method to delete from the 'global' table */
1942     public static final String CALL_METHOD_DELETE_GLOBAL = "DELETE_global";
1943 
1944     /** @hide - Private call() method to reset to defaults the 'configuration' table */
1945     public static final String CALL_METHOD_DELETE_CONFIG = "DELETE_config";
1946 
1947     /** @hide - Private call() method to reset to defaults the 'secure' table */
1948     public static final String CALL_METHOD_RESET_SECURE = "RESET_secure";
1949 
1950     /** @hide - Private call() method to reset to defaults the 'global' table */
1951     public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global";
1952 
1953     /** @hide - Private call() method to reset to defaults the 'configuration' table */
1954     public static final String CALL_METHOD_RESET_CONFIG = "RESET_config";
1955 
1956     /** @hide - Private call() method to query the 'system' table */
1957     public static final String CALL_METHOD_LIST_SYSTEM = "LIST_system";
1958 
1959     /** @hide - Private call() method to query the 'secure' table */
1960     public static final String CALL_METHOD_LIST_SECURE = "LIST_secure";
1961 
1962     /** @hide - Private call() method to query the 'global' table */
1963     public static final String CALL_METHOD_LIST_GLOBAL = "LIST_global";
1964 
1965     /** @hide - Private call() method to reset to defaults the 'configuration' table */
1966     public static final String CALL_METHOD_LIST_CONFIG = "LIST_config";
1967 
1968     /**
1969      * Activity Extra: Limit available options in launched activity based on the given authority.
1970      * <p>
1971      * This can be passed as an extra field in an Activity Intent with one or more syncable content
1972      * provider's authorities as a String[]. This field is used by some intents to alter the
1973      * behavior of the called activity.
1974      * <p>
1975      * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
1976      * on the authority given.
1977      */
1978     public static final String EXTRA_AUTHORITIES = "authorities";
1979 
1980     /**
1981      * Activity Extra: Limit available options in launched activity based on the given account
1982      * types.
1983      * <p>
1984      * This can be passed as an extra field in an Activity Intent with one or more account types
1985      * as a String[]. This field is used by some intents to alter the behavior of the called
1986      * activity.
1987      * <p>
1988      * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
1989      * list.
1990      */
1991     public static final String EXTRA_ACCOUNT_TYPES = "account_types";
1992 
1993     public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
1994 
1995     /**
1996      * Activity Extra: The device identifier to act upon.
1997      * <p>
1998      * This can be passed as an extra field in an Activity Intent with a single
1999      * InputDeviceIdentifier. This field is used by some activities to jump straight into the
2000      * settings for the given device.
2001      * <p>
2002      * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
2003      * dialog for the given device.
2004      * @hide
2005      */
2006     public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
2007 
2008     /**
2009      * Activity Extra: Enable or disable Airplane Mode.
2010      * <p>
2011      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
2012      * intent as a boolean to indicate if it should be enabled.
2013      */
2014     public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
2015 
2016     /**
2017      * Activity Extra: Enable or disable Battery saver mode.
2018      * <p>
2019      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
2020      * intent as a boolean to indicate if it should be enabled.
2021      */
2022     public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
2023             "android.settings.extra.battery_saver_mode_enabled";
2024 
2025     /**
2026      * Activity Extra: Enable or disable Do Not Disturb mode.
2027      * <p>
2028      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
2029      * intent as a boolean to indicate if it should be enabled.
2030      */
2031     public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
2032             "android.settings.extra.do_not_disturb_mode_enabled";
2033 
2034     /**
2035      * Activity Extra: How many minutes to enable do not disturb mode for.
2036      * <p>
2037      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
2038      * intent to indicate how long do not disturb mode should be enabled for.
2039      */
2040     public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
2041             "android.settings.extra.do_not_disturb_mode_minutes";
2042 
2043     /**
2044      * Reset mode: reset to defaults only settings changed by the
2045      * calling package. If there is a default set the setting
2046      * will be set to it, otherwise the setting will be deleted.
2047      * This is the only type of reset available to non-system clients.
2048      * @hide
2049      */
2050     @TestApi
2051     public static final int RESET_MODE_PACKAGE_DEFAULTS = 1;
2052 
2053     /**
2054      * Reset mode: reset all settings set by untrusted packages, which is
2055      * packages that aren't a part of the system, to the current defaults.
2056      * If there is a default set the setting will be set to it, otherwise
2057      * the setting will be deleted. This mode is only available to the system.
2058      * @hide
2059      */
2060     public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2;
2061 
2062     /**
2063      * Reset mode: delete all settings set by untrusted packages, which is
2064      * packages that aren't a part of the system. If a setting is set by an
2065      * untrusted package it will be deleted if its default is not provided
2066      * by the system, otherwise the setting will be set to its default.
2067      * This mode is only available to the system.
2068      * @hide
2069      */
2070     public static final int RESET_MODE_UNTRUSTED_CHANGES = 3;
2071 
2072     /**
2073      * Reset mode: reset all settings to defaults specified by trusted
2074      * packages, which is packages that are a part of the system, and
2075      * delete all settings set by untrusted packages. If a setting has
2076      * a default set by a system package it will be set to the default,
2077      * otherwise the setting will be deleted. This mode is only available
2078      * to the system.
2079      * @hide
2080      */
2081     public static final int RESET_MODE_TRUSTED_DEFAULTS = 4;
2082 
2083     /** @hide */
2084     @Retention(RetentionPolicy.SOURCE)
2085     @IntDef(prefix = { "RESET_MODE_" }, value = {
2086             RESET_MODE_PACKAGE_DEFAULTS,
2087             RESET_MODE_UNTRUSTED_DEFAULTS,
2088             RESET_MODE_UNTRUSTED_CHANGES,
2089             RESET_MODE_TRUSTED_DEFAULTS
2090     })
2091     public @interface ResetMode{}
2092 
2093     /**
2094      * Activity Extra: Number of certificates
2095      * <p>
2096      * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO}
2097      * intent to indicate the number of certificates
2098      * @hide
2099      */
2100     public static final String EXTRA_NUMBER_OF_CERTIFICATES =
2101             "android.settings.extra.number_of_certificates";
2102 
2103     private static final String JID_RESOURCE_PREFIX = "android";
2104 
2105     public static final String AUTHORITY = "settings";
2106 
2107     private static final String TAG = "Settings";
2108     private static final boolean LOCAL_LOGV = false;
2109 
2110     // Lock ensures that when enabling/disabling the master location switch, we don't end up
2111     // with a partial enable/disable state in multi-threaded situations.
2112     private static final Object mLocationSettingsLock = new Object();
2113 
2114     // Used in system server calling uid workaround in call()
2115     private static boolean sInSystemServer = false;
2116     private static final Object sInSystemServerLock = new Object();
2117 
2118     /** @hide */
setInSystemServer()2119     public static void setInSystemServer() {
2120         synchronized (sInSystemServerLock) {
2121             sInSystemServer = true;
2122         }
2123     }
2124 
2125     /** @hide */
isInSystemServer()2126     public static boolean isInSystemServer() {
2127         synchronized (sInSystemServerLock) {
2128             return sInSystemServer;
2129         }
2130     }
2131 
2132     public static class SettingNotFoundException extends AndroidException {
SettingNotFoundException(String msg)2133         public SettingNotFoundException(String msg) {
2134             super(msg);
2135         }
2136     }
2137 
2138     /**
2139      * Common base for tables of name/value settings.
2140      */
2141     public static class NameValueTable implements BaseColumns {
2142         public static final String NAME = "name";
2143         public static final String VALUE = "value";
2144 
putString(ContentResolver resolver, Uri uri, String name, String value)2145         protected static boolean putString(ContentResolver resolver, Uri uri,
2146                 String name, String value) {
2147             // The database will take care of replacing duplicates.
2148             try {
2149                 ContentValues values = new ContentValues();
2150                 values.put(NAME, name);
2151                 values.put(VALUE, value);
2152                 resolver.insert(uri, values);
2153                 return true;
2154             } catch (SQLException e) {
2155                 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
2156                 return false;
2157             }
2158         }
2159 
getUriFor(Uri uri, String name)2160         public static Uri getUriFor(Uri uri, String name) {
2161             return Uri.withAppendedPath(uri, name);
2162         }
2163     }
2164 
2165     private static final class GenerationTracker {
2166         private final MemoryIntArray mArray;
2167         private final Runnable mErrorHandler;
2168         private final int mIndex;
2169         private int mCurrentGeneration;
2170 
GenerationTracker(@onNull MemoryIntArray array, int index, int generation, Runnable errorHandler)2171         public GenerationTracker(@NonNull MemoryIntArray array, int index,
2172                 int generation, Runnable errorHandler) {
2173             mArray = array;
2174             mIndex = index;
2175             mErrorHandler = errorHandler;
2176             mCurrentGeneration = generation;
2177         }
2178 
isGenerationChanged()2179         public boolean isGenerationChanged() {
2180             final int currentGeneration = readCurrentGeneration();
2181             if (currentGeneration >= 0) {
2182                 if (currentGeneration == mCurrentGeneration) {
2183                     return false;
2184                 }
2185                 mCurrentGeneration = currentGeneration;
2186             }
2187             return true;
2188         }
2189 
getCurrentGeneration()2190         public int getCurrentGeneration() {
2191             return mCurrentGeneration;
2192         }
2193 
readCurrentGeneration()2194         private int readCurrentGeneration() {
2195             try {
2196                 return mArray.get(mIndex);
2197             } catch (IOException e) {
2198                 Log.e(TAG, "Error getting current generation", e);
2199                 if (mErrorHandler != null) {
2200                     mErrorHandler.run();
2201                 }
2202             }
2203             return -1;
2204         }
2205 
destroy()2206         public void destroy() {
2207             try {
2208                 mArray.close();
2209             } catch (IOException e) {
2210                 Log.e(TAG, "Error closing backing array", e);
2211                 if (mErrorHandler != null) {
2212                     mErrorHandler.run();
2213                 }
2214             }
2215         }
2216     }
2217 
2218     private static final class ContentProviderHolder {
2219         private final Object mLock = new Object();
2220 
2221         @GuardedBy("mLock")
2222         private final Uri mUri;
2223         @GuardedBy("mLock")
2224         @UnsupportedAppUsage
2225         private IContentProvider mContentProvider;
2226 
ContentProviderHolder(Uri uri)2227         public ContentProviderHolder(Uri uri) {
2228             mUri = uri;
2229         }
2230 
getProvider(ContentResolver contentResolver)2231         public IContentProvider getProvider(ContentResolver contentResolver) {
2232             synchronized (mLock) {
2233                 if (mContentProvider == null) {
2234                     mContentProvider = contentResolver
2235                             .acquireProvider(mUri.getAuthority());
2236                 }
2237                 return mContentProvider;
2238             }
2239         }
2240 
clearProviderForTest()2241         public void clearProviderForTest() {
2242             synchronized (mLock) {
2243                 mContentProvider = null;
2244             }
2245         }
2246     }
2247 
2248     // Thread-safe.
2249     private static class NameValueCache {
2250         private static final boolean DEBUG = false;
2251 
2252         private static final String[] SELECT_VALUE_PROJECTION = new String[] {
2253                 Settings.NameValueTable.VALUE
2254         };
2255 
2256         private static final String NAME_EQ_PLACEHOLDER = "name=?";
2257 
2258         // Must synchronize on 'this' to access mValues and mValuesVersion.
2259         private final HashMap<String, String> mValues = new HashMap<>();
2260 
2261         private final Uri mUri;
2262         @UnsupportedAppUsage
2263         private final ContentProviderHolder mProviderHolder;
2264 
2265         // The method we'll call (or null, to not use) on the provider
2266         // for the fast path of retrieving settings.
2267         private final String mCallGetCommand;
2268         private final String mCallSetCommand;
2269 
2270         @GuardedBy("this")
2271         private GenerationTracker mGenerationTracker;
2272 
NameValueCache(Uri uri, String getCommand, String setCommand, ContentProviderHolder providerHolder)2273         public NameValueCache(Uri uri, String getCommand, String setCommand,
2274                 ContentProviderHolder providerHolder) {
2275             mUri = uri;
2276             mCallGetCommand = getCommand;
2277             mCallSetCommand = setCommand;
2278             mProviderHolder = providerHolder;
2279         }
2280 
putStringForUser(ContentResolver cr, String name, String value, String tag, boolean makeDefault, final int userHandle)2281         public boolean putStringForUser(ContentResolver cr, String name, String value,
2282                 String tag, boolean makeDefault, final int userHandle) {
2283             try {
2284                 Bundle arg = new Bundle();
2285                 arg.putString(Settings.NameValueTable.VALUE, value);
2286                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
2287                 if (tag != null) {
2288                     arg.putString(CALL_METHOD_TAG_KEY, tag);
2289                 }
2290                 if (makeDefault) {
2291                     arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true);
2292                 }
2293                 IContentProvider cp = mProviderHolder.getProvider(cr);
2294                 cp.call(cr.getPackageName(), mProviderHolder.mUri.getAuthority(),
2295                         mCallSetCommand, name, arg);
2296             } catch (RemoteException e) {
2297                 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
2298                 return false;
2299             }
2300             return true;
2301         }
2302 
2303         @UnsupportedAppUsage
getStringForUser(ContentResolver cr, String name, final int userHandle)2304         public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
2305             final boolean isSelf = (userHandle == UserHandle.myUserId());
2306             int currentGeneration = -1;
2307             if (isSelf) {
2308                 synchronized (NameValueCache.this) {
2309                     if (mGenerationTracker != null) {
2310                         if (mGenerationTracker.isGenerationChanged()) {
2311                             if (DEBUG) {
2312                                 Log.i(TAG, "Generation changed for type:"
2313                                         + mUri.getPath() + " in package:"
2314                                         + cr.getPackageName() +" and user:" + userHandle);
2315                             }
2316                             mValues.clear();
2317                         } else if (mValues.containsKey(name)) {
2318                             return mValues.get(name);
2319                         }
2320                         if (mGenerationTracker != null) {
2321                             currentGeneration = mGenerationTracker.getCurrentGeneration();
2322                         }
2323                     }
2324                 }
2325             } else {
2326                 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
2327                         + " by user " + UserHandle.myUserId() + " so skipping cache");
2328             }
2329 
2330             IContentProvider cp = mProviderHolder.getProvider(cr);
2331 
2332             // Try the fast path first, not using query().  If this
2333             // fails (alternate Settings provider that doesn't support
2334             // this interface?) then we fall back to the query/table
2335             // interface.
2336             if (mCallGetCommand != null) {
2337                 try {
2338                     Bundle args = null;
2339                     if (!isSelf) {
2340                         args = new Bundle();
2341                         args.putInt(CALL_METHOD_USER_KEY, userHandle);
2342                     }
2343                     boolean needsGenerationTracker = false;
2344                     synchronized (NameValueCache.this) {
2345                         if (isSelf && mGenerationTracker == null) {
2346                             needsGenerationTracker = true;
2347                             if (args == null) {
2348                                 args = new Bundle();
2349                             }
2350                             args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
2351                             if (DEBUG) {
2352                                 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath()
2353                                         + " in package:" + cr.getPackageName() +" and user:"
2354                                         + userHandle);
2355                             }
2356                         }
2357                     }
2358                     Bundle b;
2359                     // If we're in system server and in a binder transaction we need to clear the
2360                     // calling uid. This works around code in system server that did not call
2361                     // clearCallingIdentity, previously this wasn't needed because reading settings
2362                     // did not do permission checking but thats no longer the case.
2363                     // Long term this should be removed and callers should properly call
2364                     // clearCallingIdentity or use a ContentResolver from the caller as needed.
2365                     if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
2366                         final long token = Binder.clearCallingIdentity();
2367                         try {
2368                             b = cp.call(cr.getPackageName(), mProviderHolder.mUri.getAuthority(),
2369                                     mCallGetCommand, name, args);
2370                         } finally {
2371                             Binder.restoreCallingIdentity(token);
2372                         }
2373                     } else {
2374                         b = cp.call(cr.getPackageName(), mProviderHolder.mUri.getAuthority(),
2375                                 mCallGetCommand, name, args);
2376                     }
2377                     if (b != null) {
2378                         String value = b.getString(Settings.NameValueTable.VALUE);
2379                         // Don't update our cache for reads of other users' data
2380                         if (isSelf) {
2381                             synchronized (NameValueCache.this) {
2382                                 if (needsGenerationTracker) {
2383                                     MemoryIntArray array = b.getParcelable(
2384                                             CALL_METHOD_TRACK_GENERATION_KEY);
2385                                     final int index = b.getInt(
2386                                             CALL_METHOD_GENERATION_INDEX_KEY, -1);
2387                                     if (array != null && index >= 0) {
2388                                         final int generation = b.getInt(
2389                                                 CALL_METHOD_GENERATION_KEY, 0);
2390                                         if (DEBUG) {
2391                                             Log.i(TAG, "Received generation tracker for type:"
2392                                                     + mUri.getPath() + " in package:"
2393                                                     + cr.getPackageName() + " and user:"
2394                                                     + userHandle + " with index:" + index);
2395                                         }
2396                                         if (mGenerationTracker != null) {
2397                                             mGenerationTracker.destroy();
2398                                         }
2399                                         mGenerationTracker = new GenerationTracker(array, index,
2400                                                 generation, () -> {
2401                                             synchronized (NameValueCache.this) {
2402                                                 Log.e(TAG, "Error accessing generation"
2403                                                         + " tracker - removing");
2404                                                 if (mGenerationTracker != null) {
2405                                                     GenerationTracker generationTracker =
2406                                                             mGenerationTracker;
2407                                                     mGenerationTracker = null;
2408                                                     generationTracker.destroy();
2409                                                     mValues.clear();
2410                                                 }
2411                                             }
2412                                         });
2413                                     }
2414                                 }
2415                                 if (mGenerationTracker != null && currentGeneration ==
2416                                         mGenerationTracker.getCurrentGeneration()) {
2417                                     mValues.put(name, value);
2418                                 }
2419                             }
2420                         } else {
2421                             if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
2422                                     + " by " + UserHandle.myUserId()
2423                                     + " so not updating cache");
2424                         }
2425                         return value;
2426                     }
2427                     // If the response Bundle is null, we fall through
2428                     // to the query interface below.
2429                 } catch (RemoteException e) {
2430                     // Not supported by the remote side?  Fall through
2431                     // to query().
2432                 }
2433             }
2434 
2435             Cursor c = null;
2436             try {
2437                 Bundle queryArgs = ContentResolver.createSqlQueryBundle(
2438                         NAME_EQ_PLACEHOLDER, new String[]{name}, null);
2439                 // Same workaround as above.
2440                 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
2441                     final long token = Binder.clearCallingIdentity();
2442                     try {
2443                         c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs,
2444                                 null);
2445                     } finally {
2446                         Binder.restoreCallingIdentity(token);
2447                     }
2448                 } else {
2449                     c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs,
2450                             null);
2451                 }
2452                 if (c == null) {
2453                     Log.w(TAG, "Can't get key " + name + " from " + mUri);
2454                     return null;
2455                 }
2456 
2457                 String value = c.moveToNext() ? c.getString(0) : null;
2458                 synchronized (NameValueCache.this) {
2459                     if(mGenerationTracker != null &&
2460                             currentGeneration == mGenerationTracker.getCurrentGeneration()) {
2461                         mValues.put(name, value);
2462                     }
2463                 }
2464                 if (LOCAL_LOGV) {
2465                     Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
2466                             name + " = " + (value == null ? "(null)" : value));
2467                 }
2468                 return value;
2469             } catch (RemoteException e) {
2470                 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
2471                 return null;  // Return null, but don't cache it.
2472             } finally {
2473                 if (c != null) c.close();
2474             }
2475         }
2476 
clearGenerationTrackerForTest()2477         public void clearGenerationTrackerForTest() {
2478             synchronized (NameValueCache.this) {
2479                 if (mGenerationTracker != null) {
2480                     mGenerationTracker.destroy();
2481                 }
2482                 mValues.clear();
2483                 mGenerationTracker = null;
2484             }
2485         }
2486     }
2487 
2488     /**
2489      * Checks if the specified context can draw on top of other apps. As of API
2490      * level 23, an app cannot draw on top of other apps unless it declares the
2491      * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its
2492      * manifest, <em>and</em> the user specifically grants the app this
2493      * capability. To prompt the user to grant this approval, the app must send an
2494      * intent with the action
2495      * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which
2496      * causes the system to display a permission management screen.
2497      *
2498      * @param context App context.
2499      * @return true if the specified context can draw on top of other apps, false otherwise
2500      */
canDrawOverlays(Context context)2501     public static boolean canDrawOverlays(Context context) {
2502         return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(),
2503                 context.getOpPackageName(), false);
2504     }
2505 
2506     /**
2507      * System settings, containing miscellaneous system preferences.  This
2508      * table holds simple name/value pairs.  There are convenience
2509      * functions for accessing individual settings entries.
2510      */
2511     public static final class System extends NameValueTable {
2512         // NOTE: If you add new settings here, be sure to add them to
2513         // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked.
2514 
2515         private static final float DEFAULT_FONT_SCALE = 1.0f;
2516 
2517         /**
2518          * The content:// style URL for this table
2519          */
2520         public static final Uri CONTENT_URI =
2521             Uri.parse("content://" + AUTHORITY + "/system");
2522 
2523         @UnsupportedAppUsage
2524         private static final ContentProviderHolder sProviderHolder =
2525                 new ContentProviderHolder(CONTENT_URI);
2526 
2527         @UnsupportedAppUsage
2528         private static final NameValueCache sNameValueCache = new NameValueCache(
2529                 CONTENT_URI,
2530                 CALL_METHOD_GET_SYSTEM,
2531                 CALL_METHOD_PUT_SYSTEM,
2532                 sProviderHolder);
2533 
2534         @UnsupportedAppUsage
2535         private static final HashSet<String> MOVED_TO_SECURE;
2536         static {
2537             MOVED_TO_SECURE = new HashSet<>(30);
2538             MOVED_TO_SECURE.add(Secure.ANDROID_ID);
2539             MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
2540             MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
2541             MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
2542             MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
2543             MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
2544             MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
2545             MOVED_TO_SECURE.add(Secure.LOGGING_ID);
2546             MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
2547             MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
2548             MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
2549             MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
2550             MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
2551             MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
2552             MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
2553             MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
2554             MOVED_TO_SECURE.add(Secure.WIFI_ON);
2555             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
2556             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
2557             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
2558             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
2559             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
2560             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
2561             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
2562             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
2563             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
2564             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
2565             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
2566 
2567             // At one time in System, then Global, but now back in Secure
2568             MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
2569         }
2570 
2571         @UnsupportedAppUsage
2572         private static final HashSet<String> MOVED_TO_GLOBAL;
2573         @UnsupportedAppUsage
2574         private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
2575         static {
2576             MOVED_TO_GLOBAL = new HashSet<>();
2577             MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>();
2578 
2579             // these were originally in system but migrated to secure in the past,
2580             // so are duplicated in the Secure.* namespace
2581             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
2582             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
2583             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
2584             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
2585             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
2586             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
2587 
2588             // these are moving directly from system to global
2589             MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
2590             MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
2591             MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
2592             MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
2593             MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
2594             MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
2595             MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
2596             MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
2597             MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
2598             MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
2599             MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
2600             MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
2601             MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
2602             MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
2603             MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
2604             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
2605             MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
2606             MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
2607             MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
2608             MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
2609             MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
2610             MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
2611             MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
2612             MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
2613             MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
2614             MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
2615             MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
2616             MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
2617             MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
2618             MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
2619             MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
2620             MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
2621             MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
2622             MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
2623             MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
2624         }
2625 
2626         /** @hide */
getMovedToGlobalSettings(Set<String> outKeySet)2627         public static void getMovedToGlobalSettings(Set<String> outKeySet) {
2628             outKeySet.addAll(MOVED_TO_GLOBAL);
2629             outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
2630         }
2631 
2632         /** @hide */
getMovedToSecureSettings(Set<String> outKeySet)2633         public static void getMovedToSecureSettings(Set<String> outKeySet) {
2634             outKeySet.addAll(MOVED_TO_SECURE);
2635         }
2636 
2637         /** @hide */
getNonLegacyMovedKeys(HashSet<String> outKeySet)2638         public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
2639             outKeySet.addAll(MOVED_TO_GLOBAL);
2640         }
2641 
2642         /** @hide */
clearProviderForTest()2643         public static void clearProviderForTest() {
2644             sProviderHolder.clearProviderForTest();
2645             sNameValueCache.clearGenerationTrackerForTest();
2646         }
2647 
2648         /**
2649          * Look up a name in the database.
2650          * @param resolver to access the database with
2651          * @param name to look up in the table
2652          * @return the corresponding value, or null if not present
2653          */
getString(ContentResolver resolver, String name)2654         public static String getString(ContentResolver resolver, String name) {
2655             return getStringForUser(resolver, name, resolver.getUserId());
2656         }
2657 
2658         /** @hide */
2659         @UnsupportedAppUsage
getStringForUser(ContentResolver resolver, String name, int userHandle)2660         public static String getStringForUser(ContentResolver resolver, String name,
2661                 int userHandle) {
2662             if (MOVED_TO_SECURE.contains(name)) {
2663                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2664                         + " to android.provider.Settings.Secure, returning read-only value.");
2665                 return Secure.getStringForUser(resolver, name, userHandle);
2666             }
2667             if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
2668                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2669                         + " to android.provider.Settings.Global, returning read-only value.");
2670                 return Global.getStringForUser(resolver, name, userHandle);
2671             }
2672             return sNameValueCache.getStringForUser(resolver, name, userHandle);
2673         }
2674 
2675         /**
2676          * Store a name/value pair into the database.
2677          * @param resolver to access the database with
2678          * @param name to store
2679          * @param value to associate with the name
2680          * @return true if the value was set, false on database errors
2681          */
putString(ContentResolver resolver, String name, String value)2682         public static boolean putString(ContentResolver resolver, String name, String value) {
2683             return putStringForUser(resolver, name, value, resolver.getUserId());
2684         }
2685 
2686         /** @hide */
2687         @UnsupportedAppUsage
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)2688         public static boolean putStringForUser(ContentResolver resolver, String name, String value,
2689                 int userHandle) {
2690             if (MOVED_TO_SECURE.contains(name)) {
2691                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2692                         + " to android.provider.Settings.Secure, value is unchanged.");
2693                 return false;
2694             }
2695             if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
2696                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2697                         + " to android.provider.Settings.Global, value is unchanged.");
2698                 return false;
2699             }
2700             return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle);
2701         }
2702 
2703         /**
2704          * Construct the content URI for a particular name/value pair,
2705          * useful for monitoring changes with a ContentObserver.
2706          * @param name to look up in the table
2707          * @return the corresponding content URI, or null if not present
2708          */
getUriFor(String name)2709         public static Uri getUriFor(String name) {
2710             if (MOVED_TO_SECURE.contains(name)) {
2711                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2712                     + " to android.provider.Settings.Secure, returning Secure URI.");
2713                 return Secure.getUriFor(Secure.CONTENT_URI, name);
2714             }
2715             if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
2716                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2717                         + " to android.provider.Settings.Global, returning read-only global URI.");
2718                 return Global.getUriFor(Global.CONTENT_URI, name);
2719             }
2720             return getUriFor(CONTENT_URI, name);
2721         }
2722 
2723         /**
2724          * Convenience function for retrieving a single system settings value
2725          * as an integer.  Note that internally setting values are always
2726          * stored as strings; this function converts the string to an integer
2727          * for you.  The default value will be returned if the setting is
2728          * not defined or not an integer.
2729          *
2730          * @param cr The ContentResolver to access.
2731          * @param name The name of the setting to retrieve.
2732          * @param def Value to return if the setting is not defined.
2733          *
2734          * @return The setting's current value, or 'def' if it is not defined
2735          * or not a valid integer.
2736          */
getInt(ContentResolver cr, String name, int def)2737         public static int getInt(ContentResolver cr, String name, int def) {
2738             return getIntForUser(cr, name, def, cr.getUserId());
2739         }
2740 
2741         /** @hide */
2742         @UnsupportedAppUsage
getIntForUser(ContentResolver cr, String name, int def, int userHandle)2743         public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
2744             String v = getStringForUser(cr, name, userHandle);
2745             try {
2746                 return v != null ? Integer.parseInt(v) : def;
2747             } catch (NumberFormatException e) {
2748                 return def;
2749             }
2750         }
2751 
2752         /**
2753          * Convenience function for retrieving a single system settings value
2754          * as an integer.  Note that internally setting values are always
2755          * stored as strings; this function converts the string to an integer
2756          * for you.
2757          * <p>
2758          * This version does not take a default value.  If the setting has not
2759          * been set, or the string value is not a number,
2760          * it throws {@link SettingNotFoundException}.
2761          *
2762          * @param cr The ContentResolver to access.
2763          * @param name The name of the setting to retrieve.
2764          *
2765          * @throws SettingNotFoundException Thrown if a setting by the given
2766          * name can't be found or the setting value is not an integer.
2767          *
2768          * @return The setting's current value.
2769          */
getInt(ContentResolver cr, String name)2770         public static int getInt(ContentResolver cr, String name)
2771                 throws SettingNotFoundException {
2772             return getIntForUser(cr, name, cr.getUserId());
2773         }
2774 
2775         /** @hide */
2776         @UnsupportedAppUsage
getIntForUser(ContentResolver cr, String name, int userHandle)2777         public static int getIntForUser(ContentResolver cr, String name, int userHandle)
2778                 throws SettingNotFoundException {
2779             String v = getStringForUser(cr, name, userHandle);
2780             try {
2781                 return Integer.parseInt(v);
2782             } catch (NumberFormatException e) {
2783                 throw new SettingNotFoundException(name);
2784             }
2785         }
2786 
2787         /**
2788          * Convenience function for updating a single settings value as an
2789          * integer. This will either create a new entry in the table if the
2790          * given name does not exist, or modify the value of the existing row
2791          * with that name.  Note that internally setting values are always
2792          * stored as strings, so this function converts the given value to a
2793          * string before storing it.
2794          *
2795          * @param cr The ContentResolver to access.
2796          * @param name The name of the setting to modify.
2797          * @param value The new value for the setting.
2798          * @return true if the value was set, false on database errors
2799          */
putInt(ContentResolver cr, String name, int value)2800         public static boolean putInt(ContentResolver cr, String name, int value) {
2801             return putIntForUser(cr, name, value, cr.getUserId());
2802         }
2803 
2804         /** @hide */
2805         @UnsupportedAppUsage
putIntForUser(ContentResolver cr, String name, int value, int userHandle)2806         public static boolean putIntForUser(ContentResolver cr, String name, int value,
2807                 int userHandle) {
2808             return putStringForUser(cr, name, Integer.toString(value), userHandle);
2809         }
2810 
2811         /**
2812          * Convenience function for retrieving a single system settings value
2813          * as a {@code long}.  Note that internally setting values are always
2814          * stored as strings; this function converts the string to a {@code long}
2815          * for you.  The default value will be returned if the setting is
2816          * not defined or not a {@code long}.
2817          *
2818          * @param cr The ContentResolver to access.
2819          * @param name The name of the setting to retrieve.
2820          * @param def Value to return if the setting is not defined.
2821          *
2822          * @return The setting's current value, or 'def' if it is not defined
2823          * or not a valid {@code long}.
2824          */
getLong(ContentResolver cr, String name, long def)2825         public static long getLong(ContentResolver cr, String name, long def) {
2826             return getLongForUser(cr, name, def, cr.getUserId());
2827         }
2828 
2829         /** @hide */
getLongForUser(ContentResolver cr, String name, long def, int userHandle)2830         public static long getLongForUser(ContentResolver cr, String name, long def,
2831                 int userHandle) {
2832             String valString = getStringForUser(cr, name, userHandle);
2833             long value;
2834             try {
2835                 value = valString != null ? Long.parseLong(valString) : def;
2836             } catch (NumberFormatException e) {
2837                 value = def;
2838             }
2839             return value;
2840         }
2841 
2842         /**
2843          * Convenience function for retrieving a single system settings value
2844          * as a {@code long}.  Note that internally setting values are always
2845          * stored as strings; this function converts the string to a {@code long}
2846          * for you.
2847          * <p>
2848          * This version does not take a default value.  If the setting has not
2849          * been set, or the string value is not a number,
2850          * it throws {@link SettingNotFoundException}.
2851          *
2852          * @param cr The ContentResolver to access.
2853          * @param name The name of the setting to retrieve.
2854          *
2855          * @return The setting's current value.
2856          * @throws SettingNotFoundException Thrown if a setting by the given
2857          * name can't be found or the setting value is not an integer.
2858          */
getLong(ContentResolver cr, String name)2859         public static long getLong(ContentResolver cr, String name)
2860                 throws SettingNotFoundException {
2861             return getLongForUser(cr, name, cr.getUserId());
2862         }
2863 
2864         /** @hide */
getLongForUser(ContentResolver cr, String name, int userHandle)2865         public static long getLongForUser(ContentResolver cr, String name, int userHandle)
2866                 throws SettingNotFoundException {
2867             String valString = getStringForUser(cr, name, userHandle);
2868             try {
2869                 return Long.parseLong(valString);
2870             } catch (NumberFormatException e) {
2871                 throw new SettingNotFoundException(name);
2872             }
2873         }
2874 
2875         /**
2876          * Convenience function for updating a single settings value as a long
2877          * integer. This will either create a new entry in the table if the
2878          * given name does not exist, or modify the value of the existing row
2879          * with that name.  Note that internally setting values are always
2880          * stored as strings, so this function converts the given value to a
2881          * string before storing it.
2882          *
2883          * @param cr The ContentResolver to access.
2884          * @param name The name of the setting to modify.
2885          * @param value The new value for the setting.
2886          * @return true if the value was set, false on database errors
2887          */
putLong(ContentResolver cr, String name, long value)2888         public static boolean putLong(ContentResolver cr, String name, long value) {
2889             return putLongForUser(cr, name, value, cr.getUserId());
2890         }
2891 
2892         /** @hide */
putLongForUser(ContentResolver cr, String name, long value, int userHandle)2893         public static boolean putLongForUser(ContentResolver cr, String name, long value,
2894                 int userHandle) {
2895             return putStringForUser(cr, name, Long.toString(value), userHandle);
2896         }
2897 
2898         /**
2899          * Convenience function for retrieving a single system settings value
2900          * as a floating point number.  Note that internally setting values are
2901          * always stored as strings; this function converts the string to an
2902          * float for you. The default value will be returned if the setting
2903          * is not defined or not a valid float.
2904          *
2905          * @param cr The ContentResolver to access.
2906          * @param name The name of the setting to retrieve.
2907          * @param def Value to return if the setting is not defined.
2908          *
2909          * @return The setting's current value, or 'def' if it is not defined
2910          * or not a valid float.
2911          */
getFloat(ContentResolver cr, String name, float def)2912         public static float getFloat(ContentResolver cr, String name, float def) {
2913             return getFloatForUser(cr, name, def, cr.getUserId());
2914         }
2915 
2916         /** @hide */
getFloatForUser(ContentResolver cr, String name, float def, int userHandle)2917         public static float getFloatForUser(ContentResolver cr, String name, float def,
2918                 int userHandle) {
2919             String v = getStringForUser(cr, name, userHandle);
2920             try {
2921                 return v != null ? Float.parseFloat(v) : def;
2922             } catch (NumberFormatException e) {
2923                 return def;
2924             }
2925         }
2926 
2927         /**
2928          * Convenience function for retrieving a single system settings value
2929          * as a float.  Note that internally setting values are always
2930          * stored as strings; this function converts the string to a float
2931          * for you.
2932          * <p>
2933          * This version does not take a default value.  If the setting has not
2934          * been set, or the string value is not a number,
2935          * it throws {@link SettingNotFoundException}.
2936          *
2937          * @param cr The ContentResolver to access.
2938          * @param name The name of the setting to retrieve.
2939          *
2940          * @throws SettingNotFoundException Thrown if a setting by the given
2941          * name can't be found or the setting value is not a float.
2942          *
2943          * @return The setting's current value.
2944          */
getFloat(ContentResolver cr, String name)2945         public static float getFloat(ContentResolver cr, String name)
2946                 throws SettingNotFoundException {
2947             return getFloatForUser(cr, name, cr.getUserId());
2948         }
2949 
2950         /** @hide */
getFloatForUser(ContentResolver cr, String name, int userHandle)2951         public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
2952                 throws SettingNotFoundException {
2953             String v = getStringForUser(cr, name, userHandle);
2954             if (v == null) {
2955                 throw new SettingNotFoundException(name);
2956             }
2957             try {
2958                 return Float.parseFloat(v);
2959             } catch (NumberFormatException e) {
2960                 throw new SettingNotFoundException(name);
2961             }
2962         }
2963 
2964         /**
2965          * Convenience function for updating a single settings value as a
2966          * floating point number. This will either create a new entry in the
2967          * table if the given name does not exist, or modify the value of the
2968          * existing row with that name.  Note that internally setting values
2969          * are always stored as strings, so this function converts the given
2970          * value to a string before storing it.
2971          *
2972          * @param cr The ContentResolver to access.
2973          * @param name The name of the setting to modify.
2974          * @param value The new value for the setting.
2975          * @return true if the value was set, false on database errors
2976          */
putFloat(ContentResolver cr, String name, float value)2977         public static boolean putFloat(ContentResolver cr, String name, float value) {
2978             return putFloatForUser(cr, name, value, cr.getUserId());
2979         }
2980 
2981         /** @hide */
putFloatForUser(ContentResolver cr, String name, float value, int userHandle)2982         public static boolean putFloatForUser(ContentResolver cr, String name, float value,
2983                 int userHandle) {
2984             return putStringForUser(cr, name, Float.toString(value), userHandle);
2985         }
2986 
2987         /**
2988          * Convenience function to read all of the current
2989          * configuration-related settings into a
2990          * {@link Configuration} object.
2991          *
2992          * @param cr The ContentResolver to access.
2993          * @param outConfig Where to place the configuration settings.
2994          */
getConfiguration(ContentResolver cr, Configuration outConfig)2995         public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
2996             adjustConfigurationForUser(cr, outConfig, cr.getUserId(),
2997                     false /* updateSettingsIfEmpty */);
2998         }
2999 
3000         /** @hide */
adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, int userHandle, boolean updateSettingsIfEmpty)3001         public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig,
3002                 int userHandle, boolean updateSettingsIfEmpty) {
3003             outConfig.fontScale = Settings.System.getFloatForUser(
3004                     cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle);
3005             if (outConfig.fontScale < 0) {
3006                 outConfig.fontScale = DEFAULT_FONT_SCALE;
3007             }
3008 
3009             final String localeValue =
3010                     Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle);
3011             if (localeValue != null) {
3012                 outConfig.setLocales(LocaleList.forLanguageTags(localeValue));
3013             } else {
3014                 // Do not update configuration with emtpy settings since we need to take over the
3015                 // locale list of previous user if the settings value is empty. This happens when a
3016                 // new user is created.
3017 
3018                 if (updateSettingsIfEmpty) {
3019                     // Make current configuration persistent. This is necessary the first time a
3020                     // user log in. At the first login, the configuration settings are empty, so we
3021                     // need to store the adjusted configuration as the initial settings.
3022                     Settings.System.putStringForUser(
3023                             cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(),
3024                             userHandle);
3025                 }
3026             }
3027         }
3028 
3029         /**
3030          * @hide Erase the fields in the Configuration that should be applied
3031          * by the settings.
3032          */
clearConfiguration(Configuration inoutConfig)3033         public static void clearConfiguration(Configuration inoutConfig) {
3034             inoutConfig.fontScale = 0;
3035             if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) {
3036                 inoutConfig.clearLocales();
3037             }
3038         }
3039 
3040         /**
3041          * Convenience function to write a batch of configuration-related
3042          * settings from a {@link Configuration} object.
3043          *
3044          * @param cr The ContentResolver to access.
3045          * @param config The settings to write.
3046          * @return true if the values were set, false on database errors
3047          */
putConfiguration(ContentResolver cr, Configuration config)3048         public static boolean putConfiguration(ContentResolver cr, Configuration config) {
3049             return putConfigurationForUser(cr, config, cr.getUserId());
3050         }
3051 
3052         /** @hide */
putConfigurationForUser(ContentResolver cr, Configuration config, int userHandle)3053         public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
3054                 int userHandle) {
3055             return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) &&
3056                     Settings.System.putStringForUser(
3057                             cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle);
3058         }
3059 
3060         /** @hide */
hasInterestingConfigurationChanges(int changes)3061         public static boolean hasInterestingConfigurationChanges(int changes) {
3062             return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 ||
3063                     (changes & ActivityInfo.CONFIG_LOCALE) != 0;
3064         }
3065 
3066         /** @deprecated - Do not use */
3067         @Deprecated
getShowGTalkServiceStatus(ContentResolver cr)3068         public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
3069             return getShowGTalkServiceStatusForUser(cr, cr.getUserId());
3070         }
3071 
3072         /**
3073          * @hide
3074          * @deprecated - Do not use
3075          */
3076         @Deprecated
getShowGTalkServiceStatusForUser(ContentResolver cr, int userHandle)3077         public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
3078                 int userHandle) {
3079             return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
3080         }
3081 
3082         /** @deprecated - Do not use */
3083         @Deprecated
setShowGTalkServiceStatus(ContentResolver cr, boolean flag)3084         public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
3085             setShowGTalkServiceStatusForUser(cr, flag, cr.getUserId());
3086         }
3087 
3088         /**
3089          * @hide
3090          * @deprecated - Do not use
3091          */
3092         @Deprecated
setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, int userHandle)3093         public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
3094                 int userHandle) {
3095             putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
3096         }
3097 
3098         /**
3099          * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
3100          */
3101         @Deprecated
3102         public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN;
3103 
3104         private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() {
3105             @Override
3106             public boolean validate(String value) {
3107                 try {
3108                     int val = Integer.parseInt(value);
3109                     return (val == 0)
3110                             || (val == BatteryManager.BATTERY_PLUGGED_AC)
3111                             || (val == BatteryManager.BATTERY_PLUGGED_USB)
3112                             || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS)
3113                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
3114                                     | BatteryManager.BATTERY_PLUGGED_USB))
3115                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
3116                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS))
3117                             || (val == (BatteryManager.BATTERY_PLUGGED_USB
3118                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS))
3119                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
3120                                     | BatteryManager.BATTERY_PLUGGED_USB
3121                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS));
3122                 } catch (NumberFormatException e) {
3123                     return false;
3124                 }
3125             }
3126         };
3127 
3128         /**
3129          * What happens when the user presses the end call button if they're not
3130          * on a call.<br/>
3131          * <b>Values:</b><br/>
3132          * 0 - The end button does nothing.<br/>
3133          * 1 - The end button goes to the home screen.<br/>
3134          * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
3135          * 3 - The end button goes to the home screen.  If the user is already on the
3136          * home screen, it puts the device to sleep.
3137          */
3138         public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
3139 
3140         private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
3141                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
3142 
3143         /**
3144          * END_BUTTON_BEHAVIOR value for "go home".
3145          * @hide
3146          */
3147         public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
3148 
3149         /**
3150          * END_BUTTON_BEHAVIOR value for "go to sleep".
3151          * @hide
3152          */
3153         public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
3154 
3155         /**
3156          * END_BUTTON_BEHAVIOR default value.
3157          * @hide
3158          */
3159         public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
3160 
3161         /**
3162          * Is advanced settings mode turned on. 0 == no, 1 == yes
3163          * @hide
3164          */
3165         public static final String ADVANCED_SETTINGS = "advanced_settings";
3166 
3167         private static final Validator ADVANCED_SETTINGS_VALIDATOR = BOOLEAN_VALIDATOR;
3168 
3169         /**
3170          * ADVANCED_SETTINGS default value.
3171          * @hide
3172          */
3173         public static final int ADVANCED_SETTINGS_DEFAULT = 0;
3174 
3175         /**
3176          * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
3177          */
3178         @Deprecated
3179         public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
3180 
3181         /**
3182          * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
3183          */
3184         @Deprecated
3185         public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
3186 
3187         /**
3188          * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
3189          */
3190         @Deprecated
3191         public static final String RADIO_WIFI = Global.RADIO_WIFI;
3192 
3193         /**
3194          * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
3195          * {@hide}
3196          */
3197         @Deprecated
3198         public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
3199 
3200         /**
3201          * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
3202          */
3203         @Deprecated
3204         public static final String RADIO_CELL = Global.RADIO_CELL;
3205 
3206         /**
3207          * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
3208          */
3209         @Deprecated
3210         public static final String RADIO_NFC = Global.RADIO_NFC;
3211 
3212         /**
3213          * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
3214          */
3215         @Deprecated
3216         public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
3217 
3218         /**
3219          * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
3220          *
3221          * {@hide}
3222          */
3223         @Deprecated
3224         @UnsupportedAppUsage
3225         public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
3226                 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
3227 
3228         /**
3229          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
3230          */
3231         @Deprecated
3232         public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
3233 
3234         /**
3235          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
3236          */
3237         @Deprecated
3238         public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
3239 
3240         /**
3241          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
3242          */
3243         @Deprecated
3244         public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
3245                 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
3246 
3247         /**
3248          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
3249          */
3250         @Deprecated
3251         public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
3252 
3253         /**
3254          * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
3255          */
3256         @Deprecated
3257         public static final String MODE_RINGER = Global.MODE_RINGER;
3258 
3259         /**
3260          * Whether to use static IP and other static network attributes.
3261          * <p>
3262          * Set to 1 for true and 0 for false.
3263          *
3264          * @deprecated Use {@link WifiManager} instead
3265          */
3266         @Deprecated
3267         public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
3268 
3269         private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = BOOLEAN_VALIDATOR;
3270 
3271         /**
3272          * The static IP address.
3273          * <p>
3274          * Example: "192.168.1.51"
3275          *
3276          * @deprecated Use {@link WifiManager} instead
3277          */
3278         @Deprecated
3279         public static final String WIFI_STATIC_IP = "wifi_static_ip";
3280 
3281         private static final Validator WIFI_STATIC_IP_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
3282 
3283         /**
3284          * If using static IP, the gateway's IP address.
3285          * <p>
3286          * Example: "192.168.1.1"
3287          *
3288          * @deprecated Use {@link WifiManager} instead
3289          */
3290         @Deprecated
3291         public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
3292 
3293         private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
3294 
3295         /**
3296          * If using static IP, the net mask.
3297          * <p>
3298          * Example: "255.255.255.0"
3299          *
3300          * @deprecated Use {@link WifiManager} instead
3301          */
3302         @Deprecated
3303         public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
3304 
3305         private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
3306 
3307         /**
3308          * If using static IP, the primary DNS's IP address.
3309          * <p>
3310          * Example: "192.168.1.1"
3311          *
3312          * @deprecated Use {@link WifiManager} instead
3313          */
3314         @Deprecated
3315         public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
3316 
3317         private static final Validator WIFI_STATIC_DNS1_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
3318 
3319         /**
3320          * If using static IP, the secondary DNS's IP address.
3321          * <p>
3322          * Example: "192.168.1.2"
3323          *
3324          * @deprecated Use {@link WifiManager} instead
3325          */
3326         @Deprecated
3327         public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
3328 
3329         private static final Validator WIFI_STATIC_DNS2_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR;
3330 
3331         /**
3332          * Determines whether remote devices may discover and/or connect to
3333          * this device.
3334          * <P>Type: INT</P>
3335          * 2 -- discoverable and connectable
3336          * 1 -- connectable but not discoverable
3337          * 0 -- neither connectable nor discoverable
3338          */
3339         public static final String BLUETOOTH_DISCOVERABILITY =
3340             "bluetooth_discoverability";
3341 
3342         private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
3343                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 2);
3344 
3345         /**
3346          * Bluetooth discoverability timeout.  If this value is nonzero, then
3347          * Bluetooth becomes discoverable for a certain number of seconds,
3348          * after which is becomes simply connectable.  The value is in seconds.
3349          */
3350         public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
3351             "bluetooth_discoverability_timeout";
3352 
3353         private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
3354                 NON_NEGATIVE_INTEGER_VALIDATOR;
3355 
3356         /**
3357          * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
3358          * instead
3359          */
3360         @Deprecated
3361         public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
3362 
3363         /**
3364          * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
3365          * instead
3366          */
3367         @Deprecated
3368         public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
3369 
3370         /**
3371          * @deprecated Use
3372          * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
3373          * instead
3374          */
3375         @Deprecated
3376         public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
3377             "lock_pattern_tactile_feedback_enabled";
3378 
3379         /**
3380          * A formatted string of the next alarm that is set, or the empty string
3381          * if there is no alarm set.
3382          *
3383          * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
3384          */
3385         @Deprecated
3386         public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
3387 
3388         private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
3389             private static final int MAX_LENGTH = 1000;
3390 
3391             @Override
3392             public boolean validate(String value) {
3393                 // TODO: No idea what the correct format is.
3394                 return value == null || value.length() < MAX_LENGTH;
3395             }
3396         };
3397 
3398         /**
3399          * Scaling factor for fonts, float.
3400          */
3401         public static final String FONT_SCALE = "font_scale";
3402 
3403         private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
3404             @Override
3405             public boolean validate(@Nullable String value) {
3406                 try {
3407                     return Float.parseFloat(value) >= 0;
3408                 } catch (NumberFormatException | NullPointerException e) {
3409                     return false;
3410                 }
3411             }
3412         };
3413 
3414         /**
3415          * The serialized system locale value.
3416          *
3417          * Do not use this value directory.
3418          * To get system locale, use {@link LocaleList#getDefault} instead.
3419          * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales}
3420          * instead.
3421          * @hide
3422          */
3423         public static final String SYSTEM_LOCALES = "system_locales";
3424 
3425 
3426         /**
3427          * Name of an application package to be debugged.
3428          *
3429          * @deprecated Use {@link Global#DEBUG_APP} instead
3430          */
3431         @Deprecated
3432         public static final String DEBUG_APP = Global.DEBUG_APP;
3433 
3434         /**
3435          * If 1, when launching DEBUG_APP it will wait for the debugger before
3436          * starting user code.  If 0, it will run normally.
3437          *
3438          * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
3439          */
3440         @Deprecated
3441         public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
3442 
3443         /**
3444          * Whether or not to dim the screen. 0=no  1=yes
3445          * @deprecated This setting is no longer used.
3446          */
3447         @Deprecated
3448         public static final String DIM_SCREEN = "dim_screen";
3449 
3450         private static final Validator DIM_SCREEN_VALIDATOR = BOOLEAN_VALIDATOR;
3451 
3452         /**
3453          * The display color mode.
3454          * @hide
3455          */
3456         public static final String DISPLAY_COLOR_MODE = "display_color_mode";
3457 
3458         private static final Validator DISPLAY_COLOR_MODE_VALIDATOR = new Validator() {
3459             @Override
3460             public boolean validate(@Nullable String value) {
3461                 // Assume the actual validation that this device can properly handle this kind of
3462                 // color mode further down in ColorDisplayManager / ColorDisplayService.
3463                 try {
3464                     final int setting = Integer.parseInt(value);
3465                     final boolean isInFrameworkRange =
3466                             setting >= ColorDisplayManager.COLOR_MODE_NATURAL
3467                                     && setting <= ColorDisplayManager.COLOR_MODE_AUTOMATIC;
3468                     final boolean isInVendorRange =
3469                             setting >= ColorDisplayManager.VENDOR_COLOR_MODE_RANGE_MIN
3470                                     && setting <= ColorDisplayManager.VENDOR_COLOR_MODE_RANGE_MAX;
3471                     return isInFrameworkRange || isInVendorRange;
3472                 } catch (NumberFormatException | NullPointerException e) {
3473                     return false;
3474                 }
3475             }
3476         };
3477 
3478         /**
3479          * The user selected peak refresh rate in frames per second.
3480          *
3481          * If this isn't set, the system falls back to a device specific default.
3482          * @hide
3483          */
3484         public static final String PEAK_REFRESH_RATE = "peak_refresh_rate";
3485 
3486         private static final Validator PEAK_REFRESH_RATE_VALIDATOR =
3487                 new SettingsValidators.InclusiveFloatRangeValidator(24f, Float.MAX_VALUE);
3488 
3489         /**
3490          * The amount of time in milliseconds before the device goes to sleep or begins
3491          * to dream after a period of inactivity.  This value is also known as the
3492          * user activity timeout period since the screen isn't necessarily turned off
3493          * when it expires.
3494          *
3495          * <p>
3496          * This value is bounded by maximum timeout set by
3497          * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}.
3498          */
3499         public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
3500 
3501         private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR =
3502                 NON_NEGATIVE_INTEGER_VALIDATOR;
3503 
3504         /**
3505          * The screen backlight brightness between 0 and 255.
3506          */
3507         public static final String SCREEN_BRIGHTNESS = "screen_brightness";
3508 
3509         /**
3510          * The screen backlight brightness between 0 and 255.
3511          * @hide
3512          */
3513         public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr";
3514 
3515         private static final Validator SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR =
3516                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 255);
3517 
3518         /**
3519          * Control whether to enable automatic brightness mode.
3520          */
3521         public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
3522 
3523         private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = BOOLEAN_VALIDATOR;
3524 
3525         /**
3526          * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
3527          * or less (<0.0 >-1.0) bright.
3528          * @hide
3529          */
3530         @UnsupportedAppUsage
3531         public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
3532 
3533         private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
3534                 new SettingsValidators.InclusiveFloatRangeValidator(-1, 1);
3535 
3536         /**
3537          * SCREEN_BRIGHTNESS_MODE value for manual mode.
3538          */
3539         public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
3540 
3541         /**
3542          * SCREEN_BRIGHTNESS_MODE value for automatic mode.
3543          */
3544         public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
3545 
3546         /**
3547          * Control whether to enable adaptive sleep mode.
3548          * @hide
3549          */
3550         public static final String ADAPTIVE_SLEEP = "adaptive_sleep";
3551 
3552         private static final Validator ADAPTIVE_SLEEP_VALIDATOR = BOOLEAN_VALIDATOR;
3553 
3554         /**
3555          * Control whether the process CPU usage meter should be shown.
3556          *
3557          * @deprecated This functionality is no longer available as of
3558          * {@link android.os.Build.VERSION_CODES#N_MR1}.
3559          */
3560         @Deprecated
3561         public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
3562 
3563         /**
3564          * If 1, the activity manager will aggressively finish activities and
3565          * processes as soon as they are no longer needed.  If 0, the normal
3566          * extended lifetime is used.
3567          *
3568          * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
3569          */
3570         @Deprecated
3571         public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
3572 
3573         /**
3574          * Determines which streams are affected by ringer and zen mode changes. The
3575          * stream type's bit should be set to 1 if it should be muted when going
3576          * into an inaudible ringer mode.
3577          */
3578         public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
3579 
3580         private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
3581                 NON_NEGATIVE_INTEGER_VALIDATOR;
3582 
3583         /**
3584           * Determines which streams are affected by mute. The
3585           * stream type's bit should be set to 1 if it should be muted when a mute request
3586           * is received.
3587           */
3588         public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
3589 
3590         private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
3591                 NON_NEGATIVE_INTEGER_VALIDATOR;
3592 
3593         /**
3594          * Whether vibrate is on for different events. This is used internally,
3595          * changing this value will not change the vibrate. See AudioManager.
3596          */
3597         public static final String VIBRATE_ON = "vibrate_on";
3598 
3599         private static final Validator VIBRATE_ON_VALIDATOR = BOOLEAN_VALIDATOR;
3600 
3601         /**
3602          * If 1, redirects the system vibrator to all currently attached input devices
3603          * that support vibration.  If there are no such input devices, then the system
3604          * vibrator is used instead.
3605          * If 0, does not register the system vibrator.
3606          *
3607          * This setting is mainly intended to provide a compatibility mechanism for
3608          * applications that only know about the system vibrator and do not use the
3609          * input device vibrator API.
3610          *
3611          * @hide
3612          */
3613         public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
3614 
3615         private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = BOOLEAN_VALIDATOR;
3616 
3617         /**
3618          * The intensity of notification vibrations, if configurable.
3619          *
3620          * Not all devices are capable of changing their vibration intensity; on these devices
3621          * there will likely be no difference between the various vibration intensities except for
3622          * intensity 0 (off) and the rest.
3623          *
3624          * <b>Values:</b><br/>
3625          * 0 - Vibration is disabled<br/>
3626          * 1 - Weak vibrations<br/>
3627          * 2 - Medium vibrations<br/>
3628          * 3 - Strong vibrations
3629          * @hide
3630          */
3631         public static final String NOTIFICATION_VIBRATION_INTENSITY =
3632                 "notification_vibration_intensity";
3633         /**
3634          * The intensity of ringtone vibrations, if configurable.
3635          *
3636          * Not all devices are capable of changing their vibration intensity; on these devices
3637          * there will likely be no difference between the various vibration intensities except for
3638          * intensity 0 (off) and the rest.
3639          *
3640          * <b>Values:</b><br/>
3641          * 0 - Vibration is disabled<br/>
3642          * 1 - Weak vibrations<br/>
3643          * 2 - Medium vibrations<br/>
3644          * 3 - Strong vibrations
3645          * @hide
3646          */
3647         public static final String RING_VIBRATION_INTENSITY =
3648                 "ring_vibration_intensity";
3649 
3650         /**
3651          * The intensity of haptic feedback vibrations, if configurable.
3652          *
3653          * Not all devices are capable of changing their feedback intensity; on these devices
3654          * there will likely be no difference between the various vibration intensities except for
3655          * intensity 0 (off) and the rest.
3656          *
3657          * <b>Values:</b><br/>
3658          * 0 - Vibration is disabled<br/>
3659          * 1 - Weak vibrations<br/>
3660          * 2 - Medium vibrations<br/>
3661          * 3 - Strong vibrations
3662          * @hide
3663          */
3664         public static final String HAPTIC_FEEDBACK_INTENSITY =
3665                 "haptic_feedback_intensity";
3666 
3667         private static final Validator VIBRATION_INTENSITY_VALIDATOR =
3668                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
3669 
3670         /**
3671          * Ringer volume. This is used internally, changing this value will not
3672          * change the volume. See AudioManager.
3673          *
3674          * @removed Not used by anything since API 2.
3675          */
3676         public static final String VOLUME_RING = "volume_ring";
3677 
3678         /**
3679          * System/notifications volume. This is used internally, changing this
3680          * value will not change the volume. See AudioManager.
3681          *
3682          * @removed Not used by anything since API 2.
3683          */
3684         public static final String VOLUME_SYSTEM = "volume_system";
3685 
3686         /**
3687          * Voice call volume. This is used internally, changing this value will
3688          * not change the volume. See AudioManager.
3689          *
3690          * @removed Not used by anything since API 2.
3691          */
3692         public static final String VOLUME_VOICE = "volume_voice";
3693 
3694         /**
3695          * Music/media/gaming volume. This is used internally, changing this
3696          * value will not change the volume. See AudioManager.
3697          *
3698          * @removed Not used by anything since API 2.
3699          */
3700         public static final String VOLUME_MUSIC = "volume_music";
3701 
3702         /**
3703          * Alarm volume. This is used internally, changing this
3704          * value will not change the volume. See AudioManager.
3705          *
3706          * @removed Not used by anything since API 2.
3707          */
3708         public static final String VOLUME_ALARM = "volume_alarm";
3709 
3710         /**
3711          * Notification volume. This is used internally, changing this
3712          * value will not change the volume. See AudioManager.
3713          *
3714          * @removed Not used by anything since API 2.
3715          */
3716         public static final String VOLUME_NOTIFICATION = "volume_notification";
3717 
3718         /**
3719          * Bluetooth Headset volume. This is used internally, changing this value will
3720          * not change the volume. See AudioManager.
3721          *
3722          * @removed Not used by anything since API 2.
3723          */
3724         public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
3725 
3726         /**
3727          * @hide
3728          * Acessibility volume. This is used internally, changing this
3729          * value will not change the volume.
3730          */
3731         public static final String VOLUME_ACCESSIBILITY = "volume_a11y";
3732 
3733         /**
3734          * Master volume (float in the range 0.0f to 1.0f).
3735          *
3736          * @hide
3737          */
3738         public static final String VOLUME_MASTER = "volume_master";
3739 
3740         /**
3741          * Master mono (int 1 = mono, 0 = normal).
3742          *
3743          * @hide
3744          */
3745         @UnsupportedAppUsage
3746         public static final String MASTER_MONO = "master_mono";
3747 
3748         private static final Validator MASTER_MONO_VALIDATOR = BOOLEAN_VALIDATOR;
3749 
3750         /**
3751          * Master balance (float -1.f = 100% left, 0.f = dead center, 1.f = 100% right).
3752          *
3753          * @hide
3754          */
3755         public static final String MASTER_BALANCE = "master_balance";
3756 
3757         private static final Validator MASTER_BALANCE_VALIDATOR =
3758                 new SettingsValidators.InclusiveFloatRangeValidator(-1.f, 1.f);
3759 
3760         /**
3761          * Whether the notifications should use the ring volume (value of 1) or
3762          * a separate notification volume (value of 0). In most cases, users
3763          * will have this enabled so the notification and ringer volumes will be
3764          * the same. However, power users can disable this and use the separate
3765          * notification volume control.
3766          * <p>
3767          * Note: This is a one-off setting that will be removed in the future
3768          * when there is profile support. For this reason, it is kept hidden
3769          * from the public APIs.
3770          *
3771          * @hide
3772          * @deprecated
3773          */
3774         @Deprecated
3775         public static final String NOTIFICATIONS_USE_RING_VOLUME =
3776             "notifications_use_ring_volume";
3777 
3778         private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = BOOLEAN_VALIDATOR;
3779 
3780         /**
3781          * Whether silent mode should allow vibration feedback. This is used
3782          * internally in AudioService and the Sound settings activity to
3783          * coordinate decoupling of vibrate and silent modes. This setting
3784          * will likely be removed in a future release with support for
3785          * audio/vibe feedback profiles.
3786          *
3787          * Not used anymore. On devices with vibrator, the user explicitly selects
3788          * silent or vibrate mode.
3789          * Kept for use by legacy database upgrade code in DatabaseHelper.
3790          * @hide
3791          */
3792         @UnsupportedAppUsage
3793         public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
3794 
3795         private static final Validator VIBRATE_IN_SILENT_VALIDATOR = BOOLEAN_VALIDATOR;
3796 
3797         /**
3798          * The mapping of stream type (integer) to its setting.
3799          *
3800          * @removed  Not used by anything since API 2.
3801          */
3802         public static final String[] VOLUME_SETTINGS = {
3803             VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
3804             VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
3805         };
3806 
3807         /**
3808          * @hide
3809          * The mapping of stream type (integer) to its setting.
3810          * Unlike the VOLUME_SETTINGS array, this one contains as many entries as
3811          * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes
3812          * are never persisted.
3813          */
3814         public static final String[] VOLUME_SETTINGS_INT = {
3815                 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
3816                 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO,
3817                 "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/,
3818                 "" /*STREAM_DTMF, no setting for this stream*/,
3819                 "" /*STREAM_TTS, no setting for this stream*/,
3820                 VOLUME_ACCESSIBILITY
3821             };
3822 
3823         /**
3824          * Appended to various volume related settings to record the previous
3825          * values before they the settings were affected by a silent/vibrate
3826          * ringer mode change.
3827          *
3828          * @removed  Not used by anything since API 2.
3829          */
3830         public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
3831 
3832         /**
3833          * Persistent store for the system-wide default ringtone URI.
3834          * <p>
3835          * If you need to play the default ringtone at any given time, it is recommended
3836          * you give {@link #DEFAULT_RINGTONE_URI} to the media player.  It will resolve
3837          * to the set default ringtone at the time of playing.
3838          *
3839          * @see #DEFAULT_RINGTONE_URI
3840          */
3841         public static final String RINGTONE = "ringtone";
3842 
3843         private static final Validator RINGTONE_VALIDATOR = URI_VALIDATOR;
3844 
3845         /**
3846          * A {@link Uri} that will point to the current default ringtone at any
3847          * given time.
3848          * <p>
3849          * If the current default ringtone is in the DRM provider and the caller
3850          * does not have permission, the exception will be a
3851          * FileNotFoundException.
3852          */
3853         public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
3854 
3855         /** {@hide} */
3856         public static final String RINGTONE_CACHE = "ringtone_cache";
3857         /** {@hide} */
3858         public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE);
3859 
3860         /**
3861          * Persistent store for the system-wide default notification sound.
3862          *
3863          * @see #RINGTONE
3864          * @see #DEFAULT_NOTIFICATION_URI
3865          */
3866         public static final String NOTIFICATION_SOUND = "notification_sound";
3867 
3868         private static final Validator NOTIFICATION_SOUND_VALIDATOR = URI_VALIDATOR;
3869 
3870         /**
3871          * A {@link Uri} that will point to the current default notification
3872          * sound at any given time.
3873          *
3874          * @see #DEFAULT_RINGTONE_URI
3875          */
3876         public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
3877 
3878         /** {@hide} */
3879         public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache";
3880         /** {@hide} */
3881         public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE);
3882 
3883         /**
3884          * Persistent store for the system-wide default alarm alert.
3885          *
3886          * @see #RINGTONE
3887          * @see #DEFAULT_ALARM_ALERT_URI
3888          */
3889         public static final String ALARM_ALERT = "alarm_alert";
3890 
3891         private static final Validator ALARM_ALERT_VALIDATOR = URI_VALIDATOR;
3892 
3893         /**
3894          * A {@link Uri} that will point to the current default alarm alert at
3895          * any given time.
3896          *
3897          * @see #DEFAULT_ALARM_ALERT_URI
3898          */
3899         public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
3900 
3901         /** {@hide} */
3902         public static final String ALARM_ALERT_CACHE = "alarm_alert_cache";
3903         /** {@hide} */
3904         public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE);
3905 
3906         /**
3907          * Persistent store for the system default media button event receiver.
3908          *
3909          * @hide
3910          */
3911         public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
3912 
3913         private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = COMPONENT_NAME_VALIDATOR;
3914 
3915         /**
3916          * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
3917          */
3918         public static final String TEXT_AUTO_REPLACE = "auto_replace";
3919 
3920         private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = BOOLEAN_VALIDATOR;
3921 
3922         /**
3923          * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
3924          */
3925         public static final String TEXT_AUTO_CAPS = "auto_caps";
3926 
3927         private static final Validator TEXT_AUTO_CAPS_VALIDATOR = BOOLEAN_VALIDATOR;
3928 
3929         /**
3930          * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
3931          * feature converts two spaces to a "." and space.
3932          */
3933         public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
3934 
3935         private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = BOOLEAN_VALIDATOR;
3936 
3937         /**
3938          * Setting to showing password characters in text editors. 1 = On, 0 = Off
3939          */
3940         public static final String TEXT_SHOW_PASSWORD = "show_password";
3941 
3942         private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = BOOLEAN_VALIDATOR;
3943 
3944         public static final String SHOW_GTALK_SERVICE_STATUS =
3945                 "SHOW_GTALK_SERVICE_STATUS";
3946 
3947         private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = BOOLEAN_VALIDATOR;
3948 
3949         /**
3950          * Name of activity to use for wallpaper on the home screen.
3951          *
3952          * @deprecated Use {@link WallpaperManager} instead.
3953          */
3954         @Deprecated
3955         public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
3956 
3957         private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
3958             private static final int MAX_LENGTH = 1000;
3959 
3960             @Override
3961             public boolean validate(String value) {
3962                 if (value != null && value.length() > MAX_LENGTH) {
3963                     return false;
3964                 }
3965                 return ComponentName.unflattenFromString(value) != null;
3966             }
3967         };
3968 
3969         /**
3970          * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
3971          * instead
3972          */
3973         @Deprecated
3974         public static final String AUTO_TIME = Global.AUTO_TIME;
3975 
3976         private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR;
3977 
3978         /**
3979          * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
3980          * instead
3981          */
3982         @Deprecated
3983         public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
3984 
3985         private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR;
3986 
3987         /**
3988          * Display times as 12 or 24 hours
3989          *   12
3990          *   24
3991          */
3992         public static final String TIME_12_24 = "time_12_24";
3993 
3994         /** @hide */
3995         public static final Validator TIME_12_24_VALIDATOR =
3996                 new SettingsValidators.DiscreteValueValidator(new String[] {"12", "24", null});
3997 
3998         /**
3999          * Date format string
4000          *   mm/dd/yyyy
4001          *   dd/mm/yyyy
4002          *   yyyy/mm/dd
4003          */
4004         public static final String DATE_FORMAT = "date_format";
4005 
4006         /** @hide */
4007         public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
4008             @Override
4009             public boolean validate(@Nullable String value) {
4010                 try {
4011                     new SimpleDateFormat(value);
4012                     return true;
4013                 } catch (IllegalArgumentException | NullPointerException e) {
4014                     return false;
4015                 }
4016             }
4017         };
4018 
4019         /**
4020          * Whether the setup wizard has been run before (on first boot), or if
4021          * it still needs to be run.
4022          *
4023          * nonzero = it has been run in the past
4024          * 0 = it has not been run in the past
4025          */
4026         public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
4027 
4028         /** @hide */
4029         public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = BOOLEAN_VALIDATOR;
4030 
4031         /**
4032          * Scaling factor for normal window animations. Setting to 0 will disable window
4033          * animations.
4034          *
4035          * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
4036          */
4037         @Deprecated
4038         public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
4039 
4040         /**
4041          * Scaling factor for activity transition animations. Setting to 0 will disable window
4042          * animations.
4043          *
4044          * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
4045          */
4046         @Deprecated
4047         public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
4048 
4049         /**
4050          * Scaling factor for Animator-based animations. This affects both the start delay and
4051          * duration of all such animations. Setting to 0 will cause animations to end immediately.
4052          * The default value is 1.
4053          *
4054          * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
4055          */
4056         @Deprecated
4057         public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
4058 
4059         /**
4060          * Control whether the accelerometer will be used to change screen
4061          * orientation.  If 0, it will not be used unless explicitly requested
4062          * by the application; if 1, it will be used by default unless explicitly
4063          * disabled by the application.
4064          */
4065         public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
4066 
4067         /** @hide */
4068         public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = BOOLEAN_VALIDATOR;
4069 
4070         /**
4071          * Default screen rotation when no other policy applies.
4072          * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
4073          * preference, this rotation value will be used. Must be one of the
4074          * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
4075          *
4076          * @see android.view.Display#getRotation
4077          */
4078         public static final String USER_ROTATION = "user_rotation";
4079 
4080         /** @hide */
4081         public static final Validator USER_ROTATION_VALIDATOR =
4082                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
4083 
4084         /**
4085          * Control whether the rotation lock toggle in the System UI should be hidden.
4086          * Typically this is done for accessibility purposes to make it harder for
4087          * the user to accidentally toggle the rotation lock while the display rotation
4088          * has been locked for accessibility.
4089          *
4090          * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
4091          * unavailable for other reasons).  If 1, then the rotation lock toggle is hidden.
4092          *
4093          * @hide
4094          */
4095         @UnsupportedAppUsage
4096         public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
4097                 "hide_rotation_lock_toggle_for_accessibility";
4098 
4099         /** @hide */
4100         public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
4101                 BOOLEAN_VALIDATOR;
4102 
4103         /**
4104          * Whether the phone vibrates when it is ringing due to an incoming call. This will
4105          * be used by Phone and Setting apps; it shouldn't affect other apps.
4106          * The value is boolean (1 or 0).
4107          *
4108          * Note: this is not same as "vibrate on ring", which had been available until ICS.
4109          * It was about AudioManager's setting and thus affected all the applications which
4110          * relied on the setting, while this is purely about the vibration setting for incoming
4111          * calls.
4112          */
4113         public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
4114 
4115         /** @hide */
4116         public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = BOOLEAN_VALIDATOR;
4117 
4118         /**
4119          * When {@code 1}, Telecom enhanced call blocking functionality is enabled.  When
4120          * {@code 0}, enhanced call blocking functionality is disabled.
4121          * @hide
4122          */
4123         public static final String DEBUG_ENABLE_ENHANCED_CALL_BLOCKING =
4124                 "debug.enable_enhanced_calling";
4125 
4126         /**
4127          * Whether the audible DTMF tones are played by the dialer when dialing. The value is
4128          * boolean (1 or 0).
4129          */
4130         public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
4131 
4132         /** @hide */
4133         public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR;
4134 
4135         /**
4136          * CDMA only settings
4137          * DTMF tone type played by the dialer when dialing.
4138          *                 0 = Normal
4139          *                 1 = Long
4140          */
4141         public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
4142 
4143         /** @hide */
4144         public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR;
4145 
4146         /**
4147          * Whether the hearing aid is enabled. The value is
4148          * boolean (1 or 0).
4149          * @hide
4150          */
4151         @UnsupportedAppUsage
4152         public static final String HEARING_AID = "hearing_aid";
4153 
4154         /** @hide */
4155         public static final Validator HEARING_AID_VALIDATOR = BOOLEAN_VALIDATOR;
4156 
4157         /**
4158          * CDMA only settings
4159          * TTY Mode
4160          * 0 = OFF
4161          * 1 = FULL
4162          * 2 = VCO
4163          * 3 = HCO
4164          * @hide
4165          */
4166         @UnsupportedAppUsage
4167         public static final String TTY_MODE = "tty_mode";
4168 
4169         /** @hide */
4170         public static final Validator TTY_MODE_VALIDATOR =
4171                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3);
4172 
4173         /**
4174          * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
4175          * boolean (1 or 0).
4176          */
4177         public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
4178 
4179         /** @hide */
4180         public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4181 
4182         /**
4183          * Whether haptic feedback (Vibrate on tap) is enabled. The value is
4184          * boolean (1 or 0).
4185          */
4186         public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
4187 
4188         /** @hide */
4189         public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4190 
4191         /**
4192          * @deprecated Each application that shows web suggestions should have its own
4193          * setting for this.
4194          */
4195         @Deprecated
4196         public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
4197 
4198         /** @hide */
4199         public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = BOOLEAN_VALIDATOR;
4200 
4201         /**
4202          * Whether the notification LED should repeatedly flash when a notification is
4203          * pending. The value is boolean (1 or 0).
4204          * @hide
4205          */
4206         @UnsupportedAppUsage
4207         public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
4208 
4209         /** @hide */
4210         public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = BOOLEAN_VALIDATOR;
4211 
4212         /**
4213          * Show pointer location on screen?
4214          * 0 = no
4215          * 1 = yes
4216          * @hide
4217          */
4218         @UnsupportedAppUsage
4219         public static final String POINTER_LOCATION = "pointer_location";
4220 
4221         /** @hide */
4222         public static final Validator POINTER_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR;
4223 
4224         /**
4225          * Show touch positions on screen?
4226          * 0 = no
4227          * 1 = yes
4228          * @hide
4229          */
4230         @UnsupportedAppUsage
4231         public static final String SHOW_TOUCHES = "show_touches";
4232 
4233         /** @hide */
4234         public static final Validator SHOW_TOUCHES_VALIDATOR = BOOLEAN_VALIDATOR;
4235 
4236         /**
4237          * Log raw orientation data from
4238          * {@link com.android.server.policy.WindowOrientationListener} for use with the
4239          * orientationplot.py tool.
4240          * 0 = no
4241          * 1 = yes
4242          * @hide
4243          */
4244         public static final String WINDOW_ORIENTATION_LISTENER_LOG =
4245                 "window_orientation_listener_log";
4246 
4247         /** @hide */
4248         public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = BOOLEAN_VALIDATOR;
4249 
4250         /**
4251          * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
4252          * instead
4253          * @hide
4254          */
4255         @Deprecated
4256         public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
4257 
4258         private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4259 
4260         /**
4261          * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
4262          * instead
4263          * @hide
4264          */
4265         @Deprecated
4266         @UnsupportedAppUsage
4267         public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
4268 
4269         private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4270 
4271         /**
4272          * Whether to play sounds when the keyguard is shown and dismissed.
4273          * @hide
4274          */
4275         @UnsupportedAppUsage
4276         public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
4277 
4278         /** @hide */
4279         public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4280 
4281         /**
4282          * Whether the lockscreen should be completely disabled.
4283          * @hide
4284          */
4285         public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
4286 
4287         /** @hide */
4288         public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4289 
4290         /**
4291          * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
4292          * instead
4293          * @hide
4294          */
4295         @Deprecated
4296         public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
4297 
4298         /**
4299          * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
4300          * instead
4301          * @hide
4302          */
4303         @Deprecated
4304         @UnsupportedAppUsage
4305         public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
4306 
4307         /**
4308          * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
4309          * instead
4310          * @hide
4311          */
4312         @Deprecated
4313         @UnsupportedAppUsage
4314         public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
4315 
4316         /**
4317          * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
4318          * instead
4319          * @hide
4320          */
4321         @Deprecated
4322         @UnsupportedAppUsage
4323         public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
4324 
4325         /**
4326          * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
4327          * instead
4328          * @hide
4329          */
4330         @Deprecated
4331         @UnsupportedAppUsage
4332         public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
4333 
4334         /**
4335          * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
4336          * instead
4337          * @hide
4338          */
4339         @Deprecated
4340         @UnsupportedAppUsage
4341         public static final String LOCK_SOUND = Global.LOCK_SOUND;
4342 
4343         /**
4344          * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
4345          * instead
4346          * @hide
4347          */
4348         @Deprecated
4349         @UnsupportedAppUsage
4350         public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
4351 
4352         /**
4353          * Receive incoming SIP calls?
4354          * 0 = no
4355          * 1 = yes
4356          * @hide
4357          */
4358         public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
4359 
4360         /** @hide */
4361         public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = BOOLEAN_VALIDATOR;
4362 
4363         /**
4364          * Call Preference String.
4365          * "SIP_ALWAYS" : Always use SIP with network access
4366          * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
4367          * @hide
4368          */
4369         public static final String SIP_CALL_OPTIONS = "sip_call_options";
4370 
4371         /** @hide */
4372         public static final Validator SIP_CALL_OPTIONS_VALIDATOR =
4373                 new SettingsValidators.DiscreteValueValidator(
4374                         new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
4375 
4376         /**
4377          * One of the sip call options: Always use SIP with network access.
4378          * @hide
4379          */
4380         public static final String SIP_ALWAYS = "SIP_ALWAYS";
4381 
4382         /** @hide */
4383         public static final Validator SIP_ALWAYS_VALIDATOR = BOOLEAN_VALIDATOR;
4384 
4385         /**
4386          * One of the sip call options: Only if destination is a SIP address.
4387          * @hide
4388          */
4389         public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
4390 
4391         /** @hide */
4392         public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = BOOLEAN_VALIDATOR;
4393 
4394         /**
4395          * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead.  Formerly used to indicate that
4396          * the user should be prompted each time a call is made whether it should be placed using
4397          * SIP.  The {@link com.android.providers.settings.DatabaseHelper} replaces this with
4398          * SIP_ADDRESS_ONLY.
4399          * @hide
4400          */
4401         @Deprecated
4402         public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
4403 
4404         /** @hide */
4405         public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = BOOLEAN_VALIDATOR;
4406 
4407         /**
4408          * Pointer speed setting.
4409          * This is an integer value in a range between -7 and +7, so there are 15 possible values.
4410          *   -7 = slowest
4411          *    0 = default speed
4412          *   +7 = fastest
4413          * @hide
4414          */
4415         @UnsupportedAppUsage
4416         public static final String POINTER_SPEED = "pointer_speed";
4417 
4418         /** @hide */
4419         public static final Validator POINTER_SPEED_VALIDATOR =
4420                 new SettingsValidators.InclusiveFloatRangeValidator(-7, 7);
4421 
4422         /**
4423          * Whether lock-to-app will be triggered by long-press on recents.
4424          * @hide
4425          */
4426         public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
4427 
4428         /** @hide */
4429         public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4430 
4431         /**
4432          * I am the lolrus.
4433          * <p>
4434          * Nonzero values indicate that the user has a bukkit.
4435          * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
4436          * @hide
4437          */
4438         public static final String EGG_MODE = "egg_mode";
4439 
4440         /** @hide */
4441         public static final Validator EGG_MODE_VALIDATOR = new Validator() {
4442             @Override
4443             public boolean validate(@Nullable String value) {
4444                 try {
4445                     return Long.parseLong(value) >= 0;
4446                 } catch (NumberFormatException e) {
4447                     return false;
4448                 }
4449             }
4450         };
4451 
4452         /**
4453          * Setting to determine whether or not to show the battery percentage in the status bar.
4454          *    0 - Don't show percentage
4455          *    1 - Show percentage
4456          * @hide
4457          */
4458         public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent";
4459 
4460         /** @hide */
4461         private static final Validator SHOW_BATTERY_PERCENT_VALIDATOR = BOOLEAN_VALIDATOR;
4462 
4463         /**
4464          * IMPORTANT: If you add a new public settings you also have to add it to
4465          * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
4466          * it to PRIVATE_SETTINGS below. Also add a validator that can validate
4467          * the setting value. See an example above.
4468          */
4469 
4470         /**
4471          * Settings to backup. This is here so that it's in the same place as the settings
4472          * keys and easy to update.
4473          *
4474          * NOTE: Settings are backed up and restored in the order they appear
4475          *       in this array. If you have one setting depending on another,
4476          *       make sure that they are ordered appropriately.
4477          *
4478          * @hide
4479          */
4480         @UnsupportedAppUsage
4481         public static final String[] SETTINGS_TO_BACKUP = {
4482             STAY_ON_WHILE_PLUGGED_IN,   // moved to global
4483             WIFI_USE_STATIC_IP,
4484             WIFI_STATIC_IP,
4485             WIFI_STATIC_GATEWAY,
4486             WIFI_STATIC_NETMASK,
4487             WIFI_STATIC_DNS1,
4488             WIFI_STATIC_DNS2,
4489             BLUETOOTH_DISCOVERABILITY,
4490             BLUETOOTH_DISCOVERABILITY_TIMEOUT,
4491             FONT_SCALE,
4492             DIM_SCREEN,
4493             SCREEN_OFF_TIMEOUT,
4494             SCREEN_BRIGHTNESS_MODE,
4495             SCREEN_AUTO_BRIGHTNESS_ADJ,
4496             SCREEN_BRIGHTNESS_FOR_VR,
4497             ADAPTIVE_SLEEP,
4498             VIBRATE_INPUT_DEVICES,
4499             MODE_RINGER_STREAMS_AFFECTED,
4500             TEXT_AUTO_REPLACE,
4501             TEXT_AUTO_CAPS,
4502             TEXT_AUTO_PUNCTUATE,
4503             TEXT_SHOW_PASSWORD,
4504             AUTO_TIME,                  // moved to global
4505             AUTO_TIME_ZONE,             // moved to global
4506             TIME_12_24,
4507             DATE_FORMAT,
4508             DTMF_TONE_WHEN_DIALING,
4509             DTMF_TONE_TYPE_WHEN_DIALING,
4510             HEARING_AID,
4511             TTY_MODE,
4512             MASTER_MONO,
4513             MASTER_BALANCE,
4514             SOUND_EFFECTS_ENABLED,
4515             HAPTIC_FEEDBACK_ENABLED,
4516             POWER_SOUNDS_ENABLED,       // moved to global
4517             DOCK_SOUNDS_ENABLED,        // moved to global
4518             LOCKSCREEN_SOUNDS_ENABLED,
4519             SHOW_WEB_SUGGESTIONS,
4520             SIP_CALL_OPTIONS,
4521             SIP_RECEIVE_CALLS,
4522             POINTER_SPEED,
4523             VIBRATE_WHEN_RINGING,
4524             RINGTONE,
4525             LOCK_TO_APP_ENABLED,
4526             NOTIFICATION_SOUND,
4527             ACCELEROMETER_ROTATION,
4528             SHOW_BATTERY_PERCENT,
4529             NOTIFICATION_VIBRATION_INTENSITY,
4530             RING_VIBRATION_INTENSITY,
4531             HAPTIC_FEEDBACK_INTENSITY,
4532             DISPLAY_COLOR_MODE,
4533             ALARM_ALERT,
4534             NOTIFICATION_LIGHT_PULSE,
4535         };
4536 
4537         /**
4538          * Keys we no longer back up under the current schema, but want to continue to
4539          * process when restoring historical backup datasets.
4540          *
4541          * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
4542          * otherwise they won't be restored.
4543          *
4544          * @hide
4545          */
4546         public static final String[] LEGACY_RESTORE_SETTINGS = {
4547         };
4548 
4549         /**
4550          * These are all public system settings
4551          *
4552          * @hide
4553          */
4554         @UnsupportedAppUsage
4555         public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
4556         static {
4557             PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
4558             PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
4559             PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
4560             PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
4561             PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
4562             PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
4563             PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
4564             PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
4565             PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
4566             PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
4567             PUBLIC_SETTINGS.add(FONT_SCALE);
4568             PUBLIC_SETTINGS.add(SYSTEM_LOCALES);
4569             PUBLIC_SETTINGS.add(DIM_SCREEN);
4570             PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
4571             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
4572             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR);
4573             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
4574             PUBLIC_SETTINGS.add(ADAPTIVE_SLEEP);
4575             PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
4576             PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
4577             PUBLIC_SETTINGS.add(VIBRATE_ON);
4578             PUBLIC_SETTINGS.add(VOLUME_RING);
4579             PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
4580             PUBLIC_SETTINGS.add(VOLUME_VOICE);
4581             PUBLIC_SETTINGS.add(VOLUME_MUSIC);
4582             PUBLIC_SETTINGS.add(VOLUME_ALARM);
4583             PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
4584             PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
4585             PUBLIC_SETTINGS.add(RINGTONE);
4586             PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
4587             PUBLIC_SETTINGS.add(ALARM_ALERT);
4588             PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
4589             PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
4590             PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
4591             PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
4592             PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
4593             PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
4594             PUBLIC_SETTINGS.add(TIME_12_24);
4595             PUBLIC_SETTINGS.add(DATE_FORMAT);
4596             PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
4597             PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
4598             PUBLIC_SETTINGS.add(USER_ROTATION);
4599             PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
4600             PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
4601             PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
4602             PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
4603             PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING);
4604         }
4605 
4606         /**
4607          * These are all hidden system settings.
4608          *
4609          * @hide
4610          */
4611         @UnsupportedAppUsage
4612         public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
4613         static {
4614             PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
4615             PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
4616             PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
4617             PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
4618             PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
4619             PRIVATE_SETTINGS.add(VOLUME_MASTER);
4620             PRIVATE_SETTINGS.add(MASTER_MONO);
4621             PRIVATE_SETTINGS.add(MASTER_BALANCE);
4622             PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
4623             PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
4624             PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
4625             PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
4626             PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
4627             PRIVATE_SETTINGS.add(HEARING_AID);
4628             PRIVATE_SETTINGS.add(TTY_MODE);
4629             PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
4630             PRIVATE_SETTINGS.add(POINTER_LOCATION);
4631             PRIVATE_SETTINGS.add(SHOW_TOUCHES);
4632             PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
4633             PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
4634             PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
4635             PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
4636             PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
4637             PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
4638             PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
4639             PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
4640             PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
4641             PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
4642             PRIVATE_SETTINGS.add(LOCK_SOUND);
4643             PRIVATE_SETTINGS.add(UNLOCK_SOUND);
4644             PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
4645             PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
4646             PRIVATE_SETTINGS.add(SIP_ALWAYS);
4647             PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
4648             PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
4649             PRIVATE_SETTINGS.add(POINTER_SPEED);
4650             PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
4651             PRIVATE_SETTINGS.add(EGG_MODE);
4652             PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT);
4653             PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE);
4654         }
4655 
4656         /**
4657          * These are all public system settings
4658          *
4659          * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator,
4660          * otherwise they won't be restored.
4661          *
4662          * @hide
4663          */
4664         @UnsupportedAppUsage
4665         public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
4666         static {
VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR)4667             VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR);
VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR)4668             VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR)4669             VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR)4670             VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT, BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR)4671             VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
4672                     BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR)4673             VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR)4674             VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR)4675             VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
VALIDATORS.put(DISPLAY_COLOR_MODE, DISPLAY_COLOR_MODE_VALIDATOR)4676             VALIDATORS.put(DISPLAY_COLOR_MODE, DISPLAY_COLOR_MODE_VALIDATOR);
VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR)4677             VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR)4678             VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR);
VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR)4679             VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
VALIDATORS.put(ADAPTIVE_SLEEP, ADAPTIVE_SLEEP_VALIDATOR)4680             VALIDATORS.put(ADAPTIVE_SLEEP, ADAPTIVE_SLEEP_VALIDATOR);
VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR)4681             VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR)4682             VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR)4683             VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
VALIDATORS.put(NOTIFICATION_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR)4684             VALIDATORS.put(NOTIFICATION_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR);
VALIDATORS.put(RING_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR)4685             VALIDATORS.put(RING_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR);
VALIDATORS.put(HAPTIC_FEEDBACK_INTENSITY, VIBRATION_INTENSITY_VALIDATOR)4686             VALIDATORS.put(HAPTIC_FEEDBACK_INTENSITY, VIBRATION_INTENSITY_VALIDATOR);
VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR)4687             VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR)4688             VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR)4689             VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR)4690             VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR)4691             VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR)4692             VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR)4693             VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR)4694             VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR);
VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR)4695             VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR);
VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR)4696             VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR)4697             VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR)4698             VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR)4699             VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR)4700             VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR)4701             VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR)4702             VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR)4703             VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR)4704             VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR)4705             VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR)4706             VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR)4707             VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR)4708             VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR)4709             VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR)4710             VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR)4711             VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR)4712             VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR)4713             VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR)4714             VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR);
VALIDATORS.put(MASTER_BALANCE, MASTER_BALANCE_VALIDATOR)4715             VALIDATORS.put(MASTER_BALANCE, MASTER_BALANCE_VALIDATOR);
VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR)4716             VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR)4717             VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR)4718             VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR)4719             VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
4720                     HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR)4721             VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR)4722             VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR)4723             VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR)4724             VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR)4725             VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR)4726             VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR)4727             VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG, WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR)4728             VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
4729                     WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR)4730             VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR)4731             VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR)4732             VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR)4733             VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR)4734             VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR)4735             VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR)4736             VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR)4737             VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR)4738             VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR)4739             VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR)4740             VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR)4741             VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR)4742             VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR)4743             VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR)4744             VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
VALIDATORS.put(SHOW_BATTERY_PERCENT, SHOW_BATTERY_PERCENT_VALIDATOR)4745             VALIDATORS.put(SHOW_BATTERY_PERCENT, SHOW_BATTERY_PERCENT_VALIDATOR);
VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, BOOLEAN_VALIDATOR)4746             VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, BOOLEAN_VALIDATOR);
4747         }
4748 
4749         /**
4750          * These entries are considered common between the personal and the managed profile,
4751          * since the managed profile doesn't get to change them.
4752          */
4753         @UnsupportedAppUsage
4754         private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
4755         static {
4756             CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
4757             CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
4758             CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
4759             CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
4760             CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
4761         }
4762 
4763         /** @hide */
getCloneToManagedProfileSettings(Set<String> outKeySet)4764         public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
4765             outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
4766         }
4767 
4768         /**
4769          * These entries should be cloned from this profile's parent only if the dependency's
4770          * value is true ("1")
4771          *
4772          * Note: the dependencies must be Secure settings
4773          *
4774          * @hide
4775          */
4776         public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>();
4777         static {
CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS)4778             CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS);
CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS)4779             CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS);
CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS)4780             CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS);
4781         }
4782 
4783         /** @hide */
getCloneFromParentOnValueSettings(Map<String, String> outMap)4784         public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) {
4785             outMap.putAll(CLONE_FROM_PARENT_ON_VALUE);
4786         }
4787 
4788         /**
4789          * System settings which can be accessed by instant apps.
4790          * @hide
4791          */
4792         public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
4793         static {
4794             INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE);
4795             INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS);
4796             INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
4797             INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD);
4798             INSTANT_APP_SETTINGS.add(DATE_FORMAT);
4799             INSTANT_APP_SETTINGS.add(FONT_SCALE);
4800             INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
4801             INSTANT_APP_SETTINGS.add(TIME_12_24);
4802             INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED);
4803             INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION);
4804         }
4805 
4806         /**
4807          * When to use Wi-Fi calling
4808          *
4809          * @see android.telephony.TelephonyManager.WifiCallingChoices
4810          * @hide
4811          */
4812         public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
4813 
4814         // Settings moved to Settings.Secure
4815 
4816         /**
4817          * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
4818          * instead
4819          */
4820         @Deprecated
4821         public static final String ADB_ENABLED = Global.ADB_ENABLED;
4822 
4823         /**
4824          * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
4825          */
4826         @Deprecated
4827         public static final String ANDROID_ID = Secure.ANDROID_ID;
4828 
4829         /**
4830          * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
4831          */
4832         @Deprecated
4833         public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
4834 
4835         private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR;
4836 
4837         /**
4838          * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
4839          */
4840         @Deprecated
4841         public static final String DATA_ROAMING = Global.DATA_ROAMING;
4842 
4843         /**
4844          * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
4845          */
4846         @Deprecated
4847         public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
4848 
4849         /**
4850          * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
4851          */
4852         @Deprecated
4853         public static final String HTTP_PROXY = Global.HTTP_PROXY;
4854 
4855         /**
4856          * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
4857          */
4858         @Deprecated
4859         public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
4860 
4861         /**
4862          * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
4863          * instead
4864          */
4865         @Deprecated
4866         public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
4867 
4868         /**
4869          * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
4870          */
4871         @Deprecated
4872         public static final String LOGGING_ID = Secure.LOGGING_ID;
4873 
4874         /**
4875          * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
4876          */
4877         @Deprecated
4878         public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
4879 
4880         /**
4881          * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
4882          * instead
4883          */
4884         @Deprecated
4885         public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
4886 
4887         /**
4888          * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
4889          * instead
4890          */
4891         @Deprecated
4892         public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
4893 
4894         /**
4895          * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
4896          * instead
4897          */
4898         @Deprecated
4899         public static final String PARENTAL_CONTROL_REDIRECT_URL =
4900             Secure.PARENTAL_CONTROL_REDIRECT_URL;
4901 
4902         /**
4903          * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
4904          */
4905         @Deprecated
4906         public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
4907 
4908         /**
4909          * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
4910          */
4911         @Deprecated
4912         public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
4913 
4914         private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
4915 
4916         /**
4917          * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
4918          */
4919         @Deprecated
4920         public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
4921 
4922        /**
4923          * @deprecated Use
4924          * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
4925          */
4926         @Deprecated
4927         public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
4928 
4929         /**
4930          * @deprecated Use
4931          * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
4932          */
4933         @Deprecated
4934         public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
4935                 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
4936 
4937         /**
4938          * @deprecated Use
4939          * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
4940          */
4941         @Deprecated
4942         public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
4943                 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
4944 
4945         private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
4946                 BOOLEAN_VALIDATOR;
4947 
4948         /**
4949          * @deprecated Use
4950          * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
4951          */
4952         @Deprecated
4953         public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
4954                 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
4955 
4956         private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR =
4957                 NON_NEGATIVE_INTEGER_VALIDATOR;
4958 
4959         /**
4960          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
4961          * instead
4962          */
4963         @Deprecated
4964         public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
4965 
4966         private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR =
4967                 NON_NEGATIVE_INTEGER_VALIDATOR;
4968 
4969         /**
4970          * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
4971          */
4972         @Deprecated
4973         public static final String WIFI_ON = Global.WIFI_ON;
4974 
4975         /**
4976          * @deprecated Use
4977          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
4978          * instead
4979          */
4980         @Deprecated
4981         public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4982                 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
4983 
4984         /**
4985          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
4986          */
4987         @Deprecated
4988         public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
4989 
4990         /**
4991          * @deprecated Use
4992          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
4993          */
4994         @Deprecated
4995         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4996                 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
4997 
4998         /**
4999          * @deprecated Use
5000          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
5001          */
5002         @Deprecated
5003         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
5004                 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
5005 
5006         /**
5007          * @deprecated Use
5008          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
5009          * instead
5010          */
5011         @Deprecated
5012         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
5013                 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
5014 
5015         /**
5016          * @deprecated Use
5017          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
5018          */
5019         @Deprecated
5020         public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
5021             Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
5022 
5023         /**
5024          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
5025          * instead
5026          */
5027         @Deprecated
5028         public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
5029 
5030         /**
5031          * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
5032          */
5033         @Deprecated
5034         public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
5035 
5036         /**
5037          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
5038          */
5039         @Deprecated
5040         public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
5041 
5042         /**
5043          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
5044          * instead
5045          */
5046         @Deprecated
5047         public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
5048 
5049         /**
5050          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
5051          * instead
5052          */
5053         @Deprecated
5054         public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
5055             Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
5056 
5057         /**
5058          * Checks if the specified app can modify system settings. As of API
5059          * level 23, an app cannot modify system settings unless it declares the
5060          * {@link android.Manifest.permission#WRITE_SETTINGS}
5061          * permission in its manifest, <em>and</em> the user specifically grants
5062          * the app this capability. To prompt the user to grant this approval,
5063          * the app must send an intent with the action {@link
5064          * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes
5065          * the system to display a permission management screen.
5066          *
5067          * @param context App context.
5068          * @return true if the calling app can write to system settings, false otherwise
5069          */
canWrite(Context context)5070         public static boolean canWrite(Context context) {
5071             return isCallingPackageAllowedToWriteSettings(context, Process.myUid(),
5072                     context.getOpPackageName(), false);
5073         }
5074     }
5075 
5076     /**
5077      * Secure system settings, containing system preferences that applications
5078      * can read but are not allowed to write.  These are for preferences that
5079      * the user must explicitly modify through the system UI or specialized
5080      * APIs for those values, not modified directly by applications.
5081      */
5082     public static final class Secure extends NameValueTable {
5083         // NOTE: If you add new settings here, be sure to add them to
5084         // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked.
5085 
5086         /**
5087          * The content:// style URL for this table
5088          */
5089         public static final Uri CONTENT_URI =
5090             Uri.parse("content://" + AUTHORITY + "/secure");
5091 
5092         @UnsupportedAppUsage
5093         private static final ContentProviderHolder sProviderHolder =
5094                 new ContentProviderHolder(CONTENT_URI);
5095 
5096         // Populated lazily, guarded by class object:
5097         @UnsupportedAppUsage
5098         private static final NameValueCache sNameValueCache = new NameValueCache(
5099                 CONTENT_URI,
5100                 CALL_METHOD_GET_SECURE,
5101                 CALL_METHOD_PUT_SECURE,
5102                 sProviderHolder);
5103 
5104         private static ILockSettings sLockSettings = null;
5105 
5106         private static boolean sIsSystemProcess;
5107         @UnsupportedAppUsage
5108         private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
5109         @UnsupportedAppUsage
5110         private static final HashSet<String> MOVED_TO_GLOBAL;
5111         static {
5112             MOVED_TO_LOCK_SETTINGS = new HashSet<>(3);
5113             MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
5114             MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
5115             MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
5116 
5117             MOVED_TO_GLOBAL = new HashSet<>();
5118             MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
5119             MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
5120             MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
5121             MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
5122             MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
5123             MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
5124             MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
5125             MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
5126             MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
5127             MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
5128             MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
5129             MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
5130             MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
5131             MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
5132             MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
5133             MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
5134             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
5135             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
5136             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
5137             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
5138             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
5139             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
5140             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
5141             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
5142             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
5143             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
5144             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
5145             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
5146             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
5147             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
5148             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
5149             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
5150             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
5151             MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
5152             MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
5153             MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
5154             MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
5155             MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
5156             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
5157             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
5158             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
5159             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
5160             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
5161             MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
5162             MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
5163             MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
5164             MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
5165             MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
5166             MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
5167             MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
5168             MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
5169             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
5170             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
5171             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
5172             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
5173             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
5174             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
5175             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
5176             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
5177             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
5178             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
5179             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
5180             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
5181             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
5182             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
5183             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED);
5184             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
5185             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
5186             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
5187             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
5188             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_PENDING_FACTORY_RESET);
5189             MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
5190             MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
5191             MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
5192             MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
5193             MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
5194             MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
5195             MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
5196             MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
5197             MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
5198             MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
5199             MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
5200             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
5201             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
5202             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
5203             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
5204             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
5205             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
5206             MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
5207             MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
5208             MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
5209             MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
5210             MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
5211             MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
5212             MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
5213             MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
5214             MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
5215             MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
5216             MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
5217             MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
5218             MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
5219             MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
5220             MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
5221             MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
5222             MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
5223             MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
5224             MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
5225             MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
5226             MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
5227             MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
5228             MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
5229             MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
5230         }
5231 
5232         /** @hide */
getMovedToGlobalSettings(Set<String> outKeySet)5233         public static void getMovedToGlobalSettings(Set<String> outKeySet) {
5234             outKeySet.addAll(MOVED_TO_GLOBAL);
5235         }
5236 
5237         /** @hide */
clearProviderForTest()5238         public static void clearProviderForTest() {
5239             sProviderHolder.clearProviderForTest();
5240             sNameValueCache.clearGenerationTrackerForTest();
5241         }
5242 
5243         /**
5244          * Look up a name in the database.
5245          * @param resolver to access the database with
5246          * @param name to look up in the table
5247          * @return the corresponding value, or null if not present
5248          */
getString(ContentResolver resolver, String name)5249         public static String getString(ContentResolver resolver, String name) {
5250             return getStringForUser(resolver, name, resolver.getUserId());
5251         }
5252 
5253         /** @hide */
5254         @UnsupportedAppUsage
getStringForUser(ContentResolver resolver, String name, int userHandle)5255         public static String getStringForUser(ContentResolver resolver, String name,
5256                 int userHandle) {
5257             if (MOVED_TO_GLOBAL.contains(name)) {
5258                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
5259                         + " to android.provider.Settings.Global.");
5260                 return Global.getStringForUser(resolver, name, userHandle);
5261             }
5262 
5263             if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
5264                 synchronized (Secure.class) {
5265                     if (sLockSettings == null) {
5266                         sLockSettings = ILockSettings.Stub.asInterface(
5267                                 (IBinder) ServiceManager.getService("lock_settings"));
5268                         sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
5269                     }
5270                 }
5271                 if (sLockSettings != null && !sIsSystemProcess) {
5272                     // No context; use the ActivityThread's context as an approximation for
5273                     // determining the target API level.
5274                     Application application = ActivityThread.currentApplication();
5275 
5276                     boolean isPreMnc = application != null
5277                             && application.getApplicationInfo() != null
5278                             && application.getApplicationInfo().targetSdkVersion
5279                             <= VERSION_CODES.LOLLIPOP_MR1;
5280                     if (isPreMnc) {
5281                         try {
5282                             return sLockSettings.getString(name, "0", userHandle);
5283                         } catch (RemoteException re) {
5284                             // Fall through
5285                         }
5286                     } else {
5287                         throw new SecurityException("Settings.Secure." + name
5288                                 + " is deprecated and no longer accessible."
5289                                 + " See API documentation for potential replacements.");
5290                     }
5291                 }
5292             }
5293 
5294             return sNameValueCache.getStringForUser(resolver, name, userHandle);
5295         }
5296 
5297         /**
5298          * Store a name/value pair into the database.
5299          * @param resolver to access the database with
5300          * @param name to store
5301          * @param value to associate with the name
5302          * @return true if the value was set, false on database errors
5303          */
putString(ContentResolver resolver, String name, String value)5304         public static boolean putString(ContentResolver resolver, String name, String value) {
5305             return putStringForUser(resolver, name, value, resolver.getUserId());
5306         }
5307 
5308         /** @hide */
5309         @UnsupportedAppUsage
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)5310         public static boolean putStringForUser(ContentResolver resolver, String name, String value,
5311                 int userHandle) {
5312             return putStringForUser(resolver, name, value, null, false, userHandle);
5313         }
5314 
5315         /** @hide */
5316         @UnsupportedAppUsage
putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle)5317         public static boolean putStringForUser(@NonNull ContentResolver resolver,
5318                 @NonNull String name, @Nullable String value, @Nullable String tag,
5319                 boolean makeDefault, @UserIdInt int userHandle) {
5320             if (MOVED_TO_GLOBAL.contains(name)) {
5321                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
5322                         + " to android.provider.Settings.Global");
5323                 return Global.putStringForUser(resolver, name, value,
5324                         tag, makeDefault, userHandle);
5325             }
5326             return sNameValueCache.putStringForUser(resolver, name, value, tag,
5327                     makeDefault, userHandle);
5328         }
5329 
5330         /**
5331          * Store a name/value pair into the database.
5332          * <p>
5333          * The method takes an optional tag to associate with the setting
5334          * which can be used to clear only settings made by your package and
5335          * associated with this tag by passing the tag to {@link
5336          * #resetToDefaults(ContentResolver, String)}. Anyone can override
5337          * the current tag. Also if another package changes the setting
5338          * then the tag will be set to the one specified in the set call
5339          * which can be null. Also any of the settings setters that do not
5340          * take a tag as an argument effectively clears the tag.
5341          * </p><p>
5342          * For example, if you set settings A and B with tags T1 and T2 and
5343          * another app changes setting A (potentially to the same value), it
5344          * can assign to it a tag T3 (note that now the package that changed
5345          * the setting is not yours). Now if you reset your changes for T1 and
5346          * T2 only setting B will be reset and A not (as it was changed by
5347          * another package) but since A did not change you are in the desired
5348          * initial state. Now if the other app changes the value of A (assuming
5349          * you registered an observer in the beginning) you would detect that
5350          * the setting was changed by another app and handle this appropriately
5351          * (ignore, set back to some value, etc).
5352          * </p><p>
5353          * Also the method takes an argument whether to make the value the
5354          * default for this setting. If the system already specified a default
5355          * value, then the one passed in here will <strong>not</strong>
5356          * be set as the default.
5357          * </p>
5358          *
5359          * @param resolver to access the database with.
5360          * @param name to store.
5361          * @param value to associate with the name.
5362          * @param tag to associate with the setting.
5363          * @param makeDefault whether to make the value the default one.
5364          * @return true if the value was set, false on database errors.
5365          *
5366          * @see #resetToDefaults(ContentResolver, String)
5367          *
5368          * @hide
5369          */
5370         @SystemApi
5371         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)5372         public static boolean putString(@NonNull ContentResolver resolver,
5373                 @NonNull String name, @Nullable String value, @Nullable String tag,
5374                 boolean makeDefault) {
5375             return putStringForUser(resolver, name, value, tag, makeDefault,
5376                     resolver.getUserId());
5377         }
5378 
5379         /**
5380          * Reset the settings to their defaults. This would reset <strong>only</strong>
5381          * settings set by the caller's package. Think of it of a way to undo your own
5382          * changes to the global settings. Passing in the optional tag will reset only
5383          * settings changed by your package and associated with this tag.
5384          *
5385          * @param resolver Handle to the content resolver.
5386          * @param tag Optional tag which should be associated with the settings to reset.
5387          *
5388          * @see #putString(ContentResolver, String, String, String, boolean)
5389          *
5390          * @hide
5391          */
5392         @SystemApi
5393         @TestApi
5394         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)5395         public static void resetToDefaults(@NonNull ContentResolver resolver,
5396                 @Nullable String tag) {
5397             resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
5398                     resolver.getUserId());
5399         }
5400 
5401         /**
5402          *
5403          * Reset the settings to their defaults for a given user with a specific mode. The
5404          * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
5405          * allowing resetting the settings made by a package and associated with the tag.
5406          *
5407          * @param resolver Handle to the content resolver.
5408          * @param tag Optional tag which should be associated with the settings to reset.
5409          * @param mode The reset mode.
5410          * @param userHandle The user for which to reset to defaults.
5411          *
5412          * @see #RESET_MODE_PACKAGE_DEFAULTS
5413          * @see #RESET_MODE_UNTRUSTED_DEFAULTS
5414          * @see #RESET_MODE_UNTRUSTED_CHANGES
5415          * @see #RESET_MODE_TRUSTED_DEFAULTS
5416          *
5417          * @hide
5418          */
resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)5419         public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
5420                 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
5421             try {
5422                 Bundle arg = new Bundle();
5423                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
5424                 if (tag != null) {
5425                     arg.putString(CALL_METHOD_TAG_KEY, tag);
5426                 }
5427                 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
5428                 IContentProvider cp = sProviderHolder.getProvider(resolver);
5429                 cp.call(resolver.getPackageName(), sProviderHolder.mUri.getAuthority(),
5430                         CALL_METHOD_RESET_SECURE, null, arg);
5431             } catch (RemoteException e) {
5432                 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
5433             }
5434         }
5435 
5436         /**
5437          * Construct the content URI for a particular name/value pair,
5438          * useful for monitoring changes with a ContentObserver.
5439          * @param name to look up in the table
5440          * @return the corresponding content URI, or null if not present
5441          */
getUriFor(String name)5442         public static Uri getUriFor(String name) {
5443             if (MOVED_TO_GLOBAL.contains(name)) {
5444                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
5445                         + " to android.provider.Settings.Global, returning global URI.");
5446                 return Global.getUriFor(Global.CONTENT_URI, name);
5447             }
5448             return getUriFor(CONTENT_URI, name);
5449         }
5450 
5451         /**
5452          * Convenience function for retrieving a single secure settings value
5453          * as an integer.  Note that internally setting values are always
5454          * stored as strings; this function converts the string to an integer
5455          * for you.  The default value will be returned if the setting is
5456          * not defined or not an integer.
5457          *
5458          * @param cr The ContentResolver to access.
5459          * @param name The name of the setting to retrieve.
5460          * @param def Value to return if the setting is not defined.
5461          *
5462          * @return The setting's current value, or 'def' if it is not defined
5463          * or not a valid integer.
5464          */
getInt(ContentResolver cr, String name, int def)5465         public static int getInt(ContentResolver cr, String name, int def) {
5466             return getIntForUser(cr, name, def, cr.getUserId());
5467         }
5468 
5469         /** @hide */
5470         @UnsupportedAppUsage
getIntForUser(ContentResolver cr, String name, int def, int userHandle)5471         public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
5472             String v = getStringForUser(cr, name, userHandle);
5473             try {
5474                 return v != null ? Integer.parseInt(v) : def;
5475             } catch (NumberFormatException e) {
5476                 return def;
5477             }
5478         }
5479 
5480         /**
5481          * Convenience function for retrieving a single secure settings value
5482          * as an integer.  Note that internally setting values are always
5483          * stored as strings; this function converts the string to an integer
5484          * for you.
5485          * <p>
5486          * This version does not take a default value.  If the setting has not
5487          * been set, or the string value is not a number,
5488          * it throws {@link SettingNotFoundException}.
5489          *
5490          * @param cr The ContentResolver to access.
5491          * @param name The name of the setting to retrieve.
5492          *
5493          * @throws SettingNotFoundException Thrown if a setting by the given
5494          * name can't be found or the setting value is not an integer.
5495          *
5496          * @return The setting's current value.
5497          */
getInt(ContentResolver cr, String name)5498         public static int getInt(ContentResolver cr, String name)
5499                 throws SettingNotFoundException {
5500             return getIntForUser(cr, name, cr.getUserId());
5501         }
5502 
5503         /** @hide */
getIntForUser(ContentResolver cr, String name, int userHandle)5504         public static int getIntForUser(ContentResolver cr, String name, int userHandle)
5505                 throws SettingNotFoundException {
5506             String v = getStringForUser(cr, name, userHandle);
5507             try {
5508                 return Integer.parseInt(v);
5509             } catch (NumberFormatException e) {
5510                 throw new SettingNotFoundException(name);
5511             }
5512         }
5513 
5514         /**
5515          * Convenience function for updating a single settings value as an
5516          * integer. This will either create a new entry in the table if the
5517          * given name does not exist, or modify the value of the existing row
5518          * with that name.  Note that internally setting values are always
5519          * stored as strings, so this function converts the given value to a
5520          * string before storing it.
5521          *
5522          * @param cr The ContentResolver to access.
5523          * @param name The name of the setting to modify.
5524          * @param value The new value for the setting.
5525          * @return true if the value was set, false on database errors
5526          */
putInt(ContentResolver cr, String name, int value)5527         public static boolean putInt(ContentResolver cr, String name, int value) {
5528             return putIntForUser(cr, name, value, cr.getUserId());
5529         }
5530 
5531         /** @hide */
5532         @UnsupportedAppUsage
putIntForUser(ContentResolver cr, String name, int value, int userHandle)5533         public static boolean putIntForUser(ContentResolver cr, String name, int value,
5534                 int userHandle) {
5535             return putStringForUser(cr, name, Integer.toString(value), userHandle);
5536         }
5537 
5538         /**
5539          * Convenience function for retrieving a single secure settings value
5540          * as a {@code long}.  Note that internally setting values are always
5541          * stored as strings; this function converts the string to a {@code long}
5542          * for you.  The default value will be returned if the setting is
5543          * not defined or not a {@code long}.
5544          *
5545          * @param cr The ContentResolver to access.
5546          * @param name The name of the setting to retrieve.
5547          * @param def Value to return if the setting is not defined.
5548          *
5549          * @return The setting's current value, or 'def' if it is not defined
5550          * or not a valid {@code long}.
5551          */
getLong(ContentResolver cr, String name, long def)5552         public static long getLong(ContentResolver cr, String name, long def) {
5553             return getLongForUser(cr, name, def, cr.getUserId());
5554         }
5555 
5556         /** @hide */
5557         @UnsupportedAppUsage
getLongForUser(ContentResolver cr, String name, long def, int userHandle)5558         public static long getLongForUser(ContentResolver cr, String name, long def,
5559                 int userHandle) {
5560             String valString = getStringForUser(cr, name, userHandle);
5561             long value;
5562             try {
5563                 value = valString != null ? Long.parseLong(valString) : def;
5564             } catch (NumberFormatException e) {
5565                 value = def;
5566             }
5567             return value;
5568         }
5569 
5570         /**
5571          * Convenience function for retrieving a single secure settings value
5572          * as a {@code long}.  Note that internally setting values are always
5573          * stored as strings; this function converts the string to a {@code long}
5574          * for you.
5575          * <p>
5576          * This version does not take a default value.  If the setting has not
5577          * been set, or the string value is not a number,
5578          * it throws {@link SettingNotFoundException}.
5579          *
5580          * @param cr The ContentResolver to access.
5581          * @param name The name of the setting to retrieve.
5582          *
5583          * @return The setting's current value.
5584          * @throws SettingNotFoundException Thrown if a setting by the given
5585          * name can't be found or the setting value is not an integer.
5586          */
getLong(ContentResolver cr, String name)5587         public static long getLong(ContentResolver cr, String name)
5588                 throws SettingNotFoundException {
5589             return getLongForUser(cr, name, cr.getUserId());
5590         }
5591 
5592         /** @hide */
getLongForUser(ContentResolver cr, String name, int userHandle)5593         public static long getLongForUser(ContentResolver cr, String name, int userHandle)
5594                 throws SettingNotFoundException {
5595             String valString = getStringForUser(cr, name, userHandle);
5596             try {
5597                 return Long.parseLong(valString);
5598             } catch (NumberFormatException e) {
5599                 throw new SettingNotFoundException(name);
5600             }
5601         }
5602 
5603         /**
5604          * Convenience function for updating a secure settings value as a long
5605          * integer. This will either create a new entry in the table if the
5606          * given name does not exist, or modify the value of the existing row
5607          * with that name.  Note that internally setting values are always
5608          * stored as strings, so this function converts the given value to a
5609          * string before storing it.
5610          *
5611          * @param cr The ContentResolver to access.
5612          * @param name The name of the setting to modify.
5613          * @param value The new value for the setting.
5614          * @return true if the value was set, false on database errors
5615          */
putLong(ContentResolver cr, String name, long value)5616         public static boolean putLong(ContentResolver cr, String name, long value) {
5617             return putLongForUser(cr, name, value, cr.getUserId());
5618         }
5619 
5620         /** @hide */
5621         @UnsupportedAppUsage
putLongForUser(ContentResolver cr, String name, long value, int userHandle)5622         public static boolean putLongForUser(ContentResolver cr, String name, long value,
5623                 int userHandle) {
5624             return putStringForUser(cr, name, Long.toString(value), userHandle);
5625         }
5626 
5627         /**
5628          * Convenience function for retrieving a single secure settings value
5629          * as a floating point number.  Note that internally setting values are
5630          * always stored as strings; this function converts the string to an
5631          * float for you. The default value will be returned if the setting
5632          * is not defined or not a valid float.
5633          *
5634          * @param cr The ContentResolver to access.
5635          * @param name The name of the setting to retrieve.
5636          * @param def Value to return if the setting is not defined.
5637          *
5638          * @return The setting's current value, or 'def' if it is not defined
5639          * or not a valid float.
5640          */
getFloat(ContentResolver cr, String name, float def)5641         public static float getFloat(ContentResolver cr, String name, float def) {
5642             return getFloatForUser(cr, name, def, cr.getUserId());
5643         }
5644 
5645         /** @hide */
getFloatForUser(ContentResolver cr, String name, float def, int userHandle)5646         public static float getFloatForUser(ContentResolver cr, String name, float def,
5647                 int userHandle) {
5648             String v = getStringForUser(cr, name, userHandle);
5649             try {
5650                 return v != null ? Float.parseFloat(v) : def;
5651             } catch (NumberFormatException e) {
5652                 return def;
5653             }
5654         }
5655 
5656         /**
5657          * Convenience function for retrieving a single secure settings value
5658          * as a float.  Note that internally setting values are always
5659          * stored as strings; this function converts the string to a float
5660          * for you.
5661          * <p>
5662          * This version does not take a default value.  If the setting has not
5663          * been set, or the string value is not a number,
5664          * it throws {@link SettingNotFoundException}.
5665          *
5666          * @param cr The ContentResolver to access.
5667          * @param name The name of the setting to retrieve.
5668          *
5669          * @throws SettingNotFoundException Thrown if a setting by the given
5670          * name can't be found or the setting value is not a float.
5671          *
5672          * @return The setting's current value.
5673          */
getFloat(ContentResolver cr, String name)5674         public static float getFloat(ContentResolver cr, String name)
5675                 throws SettingNotFoundException {
5676             return getFloatForUser(cr, name, cr.getUserId());
5677         }
5678 
5679         /** @hide */
getFloatForUser(ContentResolver cr, String name, int userHandle)5680         public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
5681                 throws SettingNotFoundException {
5682             String v = getStringForUser(cr, name, userHandle);
5683             if (v == null) {
5684                 throw new SettingNotFoundException(name);
5685             }
5686             try {
5687                 return Float.parseFloat(v);
5688             } catch (NumberFormatException e) {
5689                 throw new SettingNotFoundException(name);
5690             }
5691         }
5692 
5693         /**
5694          * Convenience function for updating a single settings value as a
5695          * floating point number. This will either create a new entry in the
5696          * table if the given name does not exist, or modify the value of the
5697          * existing row with that name.  Note that internally setting values
5698          * are always stored as strings, so this function converts the given
5699          * value to a string before storing it.
5700          *
5701          * @param cr The ContentResolver to access.
5702          * @param name The name of the setting to modify.
5703          * @param value The new value for the setting.
5704          * @return true if the value was set, false on database errors
5705          */
putFloat(ContentResolver cr, String name, float value)5706         public static boolean putFloat(ContentResolver cr, String name, float value) {
5707             return putFloatForUser(cr, name, value, cr.getUserId());
5708         }
5709 
5710         /** @hide */
putFloatForUser(ContentResolver cr, String name, float value, int userHandle)5711         public static boolean putFloatForUser(ContentResolver cr, String name, float value,
5712                 int userHandle) {
5713             return putStringForUser(cr, name, Float.toString(value), userHandle);
5714         }
5715 
5716         /**
5717          * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
5718          * instead
5719          */
5720         @Deprecated
5721         public static final String DEVELOPMENT_SETTINGS_ENABLED =
5722                 Global.DEVELOPMENT_SETTINGS_ENABLED;
5723 
5724         /**
5725          * When the user has enable the option to have a "bug report" command
5726          * in the power menu.
5727          * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
5728          * @hide
5729          */
5730         @Deprecated
5731         public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5732 
5733         private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR;
5734 
5735         /**
5736          * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
5737          */
5738         @Deprecated
5739         public static final String ADB_ENABLED = Global.ADB_ENABLED;
5740 
5741         /**
5742          * Setting to allow mock locations and location provider status to be injected into the
5743          * LocationManager service for testing purposes during application development.  These
5744          * locations and status values  override actual location and status information generated
5745          * by network, gps, or other location providers.
5746          *
5747          * @deprecated This settings is not used anymore.
5748          */
5749         @Deprecated
5750         public static final String ALLOW_MOCK_LOCATION = "mock_location";
5751 
5752         private static final Validator ALLOW_MOCK_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR;
5753 
5754         /**
5755          * Setting to indicate that on device captions are enabled.
5756          *
5757          * @hide
5758          */
5759         @SystemApi
5760         public static final String ODI_CAPTIONS_ENABLED = "odi_captions_enabled";
5761 
5762         private static final Validator ODI_CAPTIONS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
5763 
5764         /**
5765          * On Android 8.0 (API level 26) and higher versions of the platform,
5766          * a 64-bit number (expressed as a hexadecimal string), unique to
5767          * each combination of app-signing key, user, and device.
5768          * Values of {@code ANDROID_ID} are scoped by signing key and user.
5769          * The value may change if a factory reset is performed on the
5770          * device or if an APK signing key changes.
5771          *
5772          * For more information about how the platform handles {@code ANDROID_ID}
5773          * in Android 8.0 (API level 26) and higher, see <a
5774          * href="{@docRoot}about/versions/oreo/android-8.0-changes.html#privacy-all">
5775          * Android 8.0 Behavior Changes</a>.
5776          *
5777          * <p class="note"><strong>Note:</strong> For apps that were installed
5778          * prior to updating the device to a version of Android 8.0
5779          * (API level 26) or higher, the value of {@code ANDROID_ID} changes
5780          * if the app is uninstalled and then reinstalled after the OTA.
5781          * To preserve values across uninstalls after an OTA to Android 8.0
5782          * or higher, developers can use
5783          * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html">
5784          * Key/Value Backup</a>.</p>
5785          *
5786          * <p>In versions of the platform lower than Android 8.0 (API level 26),
5787          * a 64-bit number (expressed as a hexadecimal string) that is randomly
5788          * generated when the user first sets up the device and should remain
5789          * constant for the lifetime of the user's device.
5790          *
5791          * On devices that have
5792          * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">
5793          * multiple users</a>, each user appears as a
5794          * completely separate device, so the {@code ANDROID_ID} value is
5795          * unique to each user.</p>
5796          *
5797          * <p class="note"><strong>Note:</strong> If the caller is an Instant App the ID is scoped
5798          * to the Instant App, it is generated when the Instant App is first installed and reset if
5799          * the user clears the Instant App.
5800          */
5801         public static final String ANDROID_ID = "android_id";
5802 
5803         /**
5804          * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
5805          */
5806         @Deprecated
5807         public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
5808 
5809         private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR;
5810 
5811         /**
5812          * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
5813          */
5814         @Deprecated
5815         public static final String DATA_ROAMING = Global.DATA_ROAMING;
5816 
5817         /**
5818          * Setting to record the input method used by default, holding the ID
5819          * of the desired method.
5820          */
5821         public static final String DEFAULT_INPUT_METHOD = "default_input_method";
5822 
5823         /**
5824          * Setting to record the input method subtype used by default, holding the ID
5825          * of the desired method.
5826          */
5827         public static final String SELECTED_INPUT_METHOD_SUBTYPE =
5828                 "selected_input_method_subtype";
5829 
5830         /**
5831          * Setting to record the history of input method subtype, holding the pair of ID of IME
5832          * and its last used subtype.
5833          * @hide
5834          */
5835         public static final String INPUT_METHODS_SUBTYPE_HISTORY =
5836                 "input_methods_subtype_history";
5837 
5838         /**
5839          * Setting to record the visibility of input method selector
5840          */
5841         public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
5842                 "input_method_selector_visibility";
5843 
5844         /**
5845          * The currently selected voice interaction service flattened ComponentName.
5846          * @hide
5847          */
5848         @TestApi
5849         public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
5850 
5851         /**
5852          * The currently selected autofill service flattened ComponentName.
5853          * @hide
5854          */
5855         @TestApi
5856         public static final String AUTOFILL_SERVICE = "autofill_service";
5857 
5858         private static final Validator AUTOFILL_SERVICE_VALIDATOR =
5859                 NULLABLE_COMPONENT_NAME_VALIDATOR;
5860 
5861         /**
5862          * Boolean indicating if Autofill supports field classification.
5863          *
5864          * @see android.service.autofill.AutofillService
5865          *
5866          * @hide
5867          */
5868         @SystemApi
5869         @TestApi
5870         public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION =
5871                 "autofill_field_classification";
5872 
5873         /**
5874          * Boolean indicating if the dark mode dialog shown on first toggle has been seen.
5875          *
5876          * @hide
5877          */
5878         public static final String DARK_MODE_DIALOG_SEEN =
5879                 "dark_mode_dialog_seen";
5880 
5881         /**
5882          * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}.
5883          *
5884          * @hide
5885          */
5886         @SystemApi
5887         @TestApi
5888         public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE =
5889                 "autofill_user_data_max_user_data_size";
5890 
5891         /**
5892          * Defines value returned by
5893          * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}.
5894          *
5895          * @hide
5896          */
5897         @SystemApi
5898         @TestApi
5899         public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE =
5900                 "autofill_user_data_max_field_classification_size";
5901 
5902         /**
5903          * Defines value returned by
5904          * {@link android.service.autofill.UserData#getMaxCategoryCount()}.
5905          *
5906          * @hide
5907          */
5908         @SystemApi
5909         @TestApi
5910         public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT =
5911                 "autofill_user_data_max_category_count";
5912 
5913         /**
5914          * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}.
5915          *
5916          * @hide
5917          */
5918         @SystemApi
5919         @TestApi
5920         public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH =
5921                 "autofill_user_data_max_value_length";
5922 
5923         /**
5924          * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}.
5925          *
5926          * @hide
5927          */
5928         @SystemApi
5929         @TestApi
5930         public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH =
5931                 "autofill_user_data_min_value_length";
5932 
5933         /**
5934          * Defines whether Content Capture is enabled for the user.
5935          *
5936          * <p>Type: {@code int} ({@code 0} for disabled, {@code 1} for enabled).
5937          * <p>Default: enabled
5938          *
5939          * @hide
5940          */
5941         @TestApi
5942         public static final String CONTENT_CAPTURE_ENABLED = "content_capture_enabled";
5943 
5944         /**
5945          * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
5946          */
5947         @Deprecated
5948         public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
5949 
5950         /**
5951          * Indicates whether a DPC has been downloaded during provisioning.
5952          *
5953          * <p>Type: int (0 for false, 1 for true)
5954          *
5955          * <p>If this is true, then any attempts to begin setup again should result in factory reset
5956          *
5957          * @hide
5958          */
5959         public static final String MANAGED_PROVISIONING_DPC_DOWNLOADED =
5960                 "managed_provisioning_dpc_downloaded";
5961 
5962         /**
5963          * Indicates whether the current user has completed setup via the setup wizard.
5964          * <p>
5965          * Type: int (0 for false, 1 for true)
5966          *
5967          * @hide
5968          */
5969         @SystemApi
5970         @TestApi
5971         public static final String USER_SETUP_COMPLETE = "user_setup_complete";
5972 
5973         /**
5974          * Indicates that the user has not started setup personalization.
5975          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
5976          *
5977          * @hide
5978          */
5979         @SystemApi
5980         public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0;
5981 
5982         /**
5983          * Indicates that the user has not yet completed setup personalization.
5984          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
5985          *
5986          * @hide
5987          */
5988         @SystemApi
5989         public static final int USER_SETUP_PERSONALIZATION_STARTED = 1;
5990 
5991         /**
5992          * Indicates that the user has snoozed personalization and will complete it later.
5993          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
5994          *
5995          * @hide
5996          */
5997         @SystemApi
5998         public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2;
5999 
6000         /**
6001          * Indicates that the user has completed setup personalization.
6002          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
6003          *
6004          * @hide
6005          */
6006         @SystemApi
6007         public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10;
6008 
6009         /** @hide */
6010         @Retention(RetentionPolicy.SOURCE)
6011         @IntDef({
6012                 USER_SETUP_PERSONALIZATION_NOT_STARTED,
6013                 USER_SETUP_PERSONALIZATION_STARTED,
6014                 USER_SETUP_PERSONALIZATION_PAUSED,
6015                 USER_SETUP_PERSONALIZATION_COMPLETE
6016         })
6017         public @interface UserSetupPersonalization {}
6018 
6019         /**
6020          * Defines the user's current state of device personalization.
6021          * The possible states are defined in {@link UserSetupPersonalization}.
6022          *
6023          * @hide
6024          */
6025         @SystemApi
6026         public static final String USER_SETUP_PERSONALIZATION_STATE =
6027                 "user_setup_personalization_state";
6028 
6029         /**
6030          * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
6031          * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0
6032          * in case SetupWizard has been re-enabled on TV devices.
6033          *
6034          * @hide
6035          */
6036         public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete";
6037 
6038         /**
6039          * The prefix for a category name that indicates whether a suggested action from that
6040          * category was marked as completed.
6041          * <p>
6042          * Type: int (0 for false, 1 for true)
6043          *
6044          * @hide
6045          */
6046         @SystemApi
6047         public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
6048 
6049         /**
6050          * List of input methods that are currently enabled.  This is a string
6051          * containing the IDs of all enabled input methods, each ID separated
6052          * by ':'.
6053          *
6054          * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0"
6055          * where imeId is ComponentName and subtype is int32.
6056          */
6057         public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
6058 
6059         /**
6060          * List of system input methods that are currently disabled.  This is a string
6061          * containing the IDs of all disabled input methods, each ID separated
6062          * by ':'.
6063          * @hide
6064          */
6065         public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
6066 
6067         /**
6068          * Whether to show the IME when a hard keyboard is connected. This is a boolean that
6069          * determines if the IME should be shown when a hard keyboard is attached.
6070          * @hide
6071          */
6072         public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
6073 
6074         private static final Validator SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR = BOOLEAN_VALIDATOR;
6075 
6076         /**
6077          * Host name and port for global http proxy. Uses ':' seperator for
6078          * between host and port.
6079          *
6080          * @deprecated Use {@link Global#HTTP_PROXY}
6081          */
6082         @Deprecated
6083         public static final String HTTP_PROXY = Global.HTTP_PROXY;
6084 
6085         /**
6086          * Package designated as always-on VPN provider.
6087          *
6088          * @hide
6089          */
6090         public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app";
6091 
6092         /**
6093          * Whether to block networking outside of VPN connections while always-on is set.
6094          * @see #ALWAYS_ON_VPN_APP
6095          *
6096          * @hide
6097          */
6098         public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown";
6099 
6100         /**
6101          * Comma separated list of packages that are allowed to access the network when VPN is in
6102          * lockdown mode but not running.
6103          * @see #ALWAYS_ON_VPN_LOCKDOWN
6104          *
6105          * @hide
6106          */
6107         public static final String ALWAYS_ON_VPN_LOCKDOWN_WHITELIST =
6108                 "always_on_vpn_lockdown_whitelist";
6109 
6110         /**
6111          * Whether applications can be installed for this user via the system's
6112          * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
6113          *
6114          * <p>1 = permit app installation via the system package installer intent
6115          * <p>0 = do not allow use of the package installer
6116          * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use
6117          * {@link PackageManager#canRequestPackageInstalls()}
6118          * @see PackageManager#canRequestPackageInstalls()
6119          */
6120         public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
6121 
6122         /**
6123          * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that
6124          * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it
6125          * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES}
6126          * on behalf of the profile owner if needed to make the change transparent for profile
6127          * owners.
6128          *
6129          * @hide
6130          */
6131         public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED =
6132                 "unknown_sources_default_reversed";
6133 
6134         /**
6135          * Comma-separated list of location providers that are enabled. Do not rely on this value
6136          * being present or correct, or on ContentObserver notifications on the corresponding Uri.
6137          *
6138          * @deprecated The preferred methods for checking provider status and listening for changes
6139          * are via {@link LocationManager#isProviderEnabled(String)} and
6140          * {@link LocationManager#PROVIDERS_CHANGED_ACTION}.
6141          */
6142         @Deprecated
6143         public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
6144 
6145         /**
6146          * The current location mode of the device. Do not rely on this value being present or on
6147          * ContentObserver notifications on the corresponding Uri.
6148          *
6149          * @deprecated The preferred methods for checking location mode and listening for changes
6150          * are via {@link LocationManager#isLocationEnabled()} and
6151          * {@link LocationManager#MODE_CHANGED_ACTION}.
6152          */
6153         @Deprecated
6154         public static final String LOCATION_MODE = "location_mode";
6155 
6156         /**
6157          * The App or module that changes the location mode.
6158          * @hide
6159          */
6160         public static final String LOCATION_CHANGER = "location_changer";
6161         /**
6162          * The location changer is unknown or unable to detect.
6163          * @hide
6164          */
6165         public static final int LOCATION_CHANGER_UNKNOWN = 0;
6166         /**
6167          * Location settings in system settings.
6168          * @hide
6169          */
6170         public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1;
6171         /**
6172          * The location icon in drop down notification drawer.
6173          * @hide
6174          */
6175         public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2;
6176 
6177         /**
6178          * Location mode is off.
6179          */
6180         public static final int LOCATION_MODE_OFF = 0;
6181 
6182         /**
6183          * This mode no longer has any distinct meaning, but is interpreted as the location mode is
6184          * on.
6185          *
6186          * @deprecated See {@link #LOCATION_MODE}.
6187          */
6188         @Deprecated
6189         public static final int LOCATION_MODE_SENSORS_ONLY = 1;
6190 
6191         /**
6192          * This mode no longer has any distinct meaning, but is interpreted as the location mode is
6193          * on.
6194          *
6195          * @deprecated See {@link #LOCATION_MODE}.
6196          */
6197         @Deprecated
6198         public static final int LOCATION_MODE_BATTERY_SAVING = 2;
6199 
6200         /**
6201          * This mode no longer has any distinct meaning, but is interpreted as the location mode is
6202          * on.
6203          *
6204          * @deprecated See {@link #LOCATION_MODE}.
6205          */
6206         @Deprecated
6207         public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
6208 
6209         /**
6210          * Location mode is on.
6211          *
6212          * @hide
6213          */
6214         @SystemApi
6215         public static final int LOCATION_MODE_ON = LOCATION_MODE_HIGH_ACCURACY;
6216 
6217         /**
6218          * A flag containing settings used for biometric weak
6219          * @hide
6220          */
6221         @Deprecated
6222         public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
6223                 "lock_biometric_weak_flags";
6224 
6225         /**
6226          * Whether lock-to-app will lock the keyguard when exiting.
6227          * @hide
6228          */
6229         public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
6230 
6231         /**
6232          * Whether autolock is enabled (0 = false, 1 = true)
6233          *
6234          * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
6235          *             level of the keyguard. Accessing this setting from an app that is targeting
6236          *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
6237          */
6238         @Deprecated
6239         public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
6240 
6241         /**
6242          * Whether lock pattern is visible as user enters (0 = false, 1 = true)
6243          *
6244          * @deprecated Accessing this setting from an app that is targeting
6245          *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
6246          */
6247         @Deprecated
6248         public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
6249 
6250         /**
6251          * Whether lock pattern will vibrate as user enters (0 = false, 1 =
6252          * true)
6253          *
6254          * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
6255          *             lockscreen uses
6256          *             {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
6257          *             Accessing this setting from an app that is targeting
6258          *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
6259          */
6260         @Deprecated
6261         public static final String
6262                 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
6263 
6264         /**
6265          * This preference allows the device to be locked given time after screen goes off,
6266          * subject to current DeviceAdmin policy limits.
6267          * @hide
6268          */
6269         @UnsupportedAppUsage
6270         public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
6271 
6272 
6273         /**
6274          * This preference contains the string that shows for owner info on LockScreen.
6275          * @hide
6276          * @deprecated
6277          */
6278         @Deprecated
6279         public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
6280 
6281         /**
6282          * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
6283          * @hide
6284          */
6285         @Deprecated
6286         public static final String LOCK_SCREEN_APPWIDGET_IDS =
6287             "lock_screen_appwidget_ids";
6288 
6289         /**
6290          * Id of the appwidget shown on the lock screen when appwidgets are disabled.
6291          * @hide
6292          */
6293         @Deprecated
6294         public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
6295             "lock_screen_fallback_appwidget_id";
6296 
6297         /**
6298          * Index of the lockscreen appwidget to restore, -1 if none.
6299          * @hide
6300          */
6301         @Deprecated
6302         public static final String LOCK_SCREEN_STICKY_APPWIDGET =
6303             "lock_screen_sticky_appwidget";
6304 
6305         /**
6306          * This preference enables showing the owner info on LockScreen.
6307          * @hide
6308          * @deprecated
6309          */
6310         @Deprecated
6311         @UnsupportedAppUsage
6312         public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
6313             "lock_screen_owner_info_enabled";
6314 
6315         /**
6316          * Indicates whether the user has allowed notifications to be shown atop a securely locked
6317          * screen in their full "private" form (same as when the device is unlocked).
6318          * <p>
6319          * Type: int (0 for false, 1 for true)
6320          *
6321          * @hide
6322          */
6323         @SystemApi
6324         public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
6325                 "lock_screen_allow_private_notifications";
6326 
6327         /**
6328          * When set by a user, allows notification remote input atop a securely locked screen
6329          * without having to unlock
6330          * @hide
6331          */
6332         public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT =
6333                 "lock_screen_allow_remote_input";
6334 
6335         /**
6336          * Indicates which clock face to show on lock screen and AOD.
6337          * @hide
6338          */
6339         public static final String LOCK_SCREEN_CUSTOM_CLOCK_FACE = "lock_screen_custom_clock_face";
6340 
6341         private static final Validator LOCK_SCREEN_CUSTOM_CLOCK_FACE_VALIDATOR =
6342                 ANY_STRING_VALIDATOR;
6343 
6344         /**
6345          * Indicates which clock face to show on lock screen and AOD while docked.
6346          * @hide
6347          */
6348         public static final String DOCKED_CLOCK_FACE = "docked_clock_face";
6349 
6350         /**
6351          * Set by the system to track if the user needs to see the call to action for
6352          * the lockscreen notification policy.
6353          * @hide
6354          */
6355         public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
6356                 "show_note_about_notification_hiding";
6357 
6358         /**
6359          * Set to 1 by the system after trust agents have been initialized.
6360          * @hide
6361          */
6362         public static final String TRUST_AGENTS_INITIALIZED =
6363                 "trust_agents_initialized";
6364 
6365         /**
6366          * The Logging ID (a unique 64-bit value) as a hex string.
6367          * Used as a pseudonymous identifier for logging.
6368          * @deprecated This identifier is poorly initialized and has
6369          * many collisions.  It should not be used.
6370          */
6371         @Deprecated
6372         public static final String LOGGING_ID = "logging_id";
6373 
6374         /**
6375          * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
6376          */
6377         @Deprecated
6378         public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
6379 
6380         /**
6381          * No longer supported.
6382          */
6383         public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
6384 
6385         /**
6386          * No longer supported.
6387          */
6388         public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
6389 
6390         /**
6391          * No longer supported.
6392          */
6393         public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
6394 
6395         /**
6396          * Settings classname to launch when Settings is clicked from All
6397          * Applications.  Needed because of user testing between the old
6398          * and new Settings apps.
6399          */
6400         // TODO: 881807
6401         public static final String SETTINGS_CLASSNAME = "settings_classname";
6402 
6403         /**
6404          * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
6405          */
6406         @Deprecated
6407         public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
6408 
6409         private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6410 
6411         /**
6412          * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
6413          */
6414         @Deprecated
6415         public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
6416 
6417         /**
6418          * If accessibility is enabled.
6419          */
6420         public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
6421 
6422         private static final Validator ACCESSIBILITY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6423 
6424         /**
6425          * Setting specifying if the accessibility shortcut is enabled.
6426          * @hide
6427          */
6428         public static final String ACCESSIBILITY_SHORTCUT_ENABLED =
6429                 "accessibility_shortcut_enabled";
6430 
6431         private static final Validator ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6432 
6433         /**
6434          * Setting specifying if the accessibility shortcut is enabled.
6435          * @hide
6436          */
6437         public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN =
6438                 "accessibility_shortcut_on_lock_screen";
6439 
6440         private static final Validator ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR =
6441                 BOOLEAN_VALIDATOR;
6442 
6443         /**
6444          * Setting specifying if the accessibility shortcut dialog has been shown to this user.
6445          * @hide
6446          */
6447         public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN =
6448                 "accessibility_shortcut_dialog_shown";
6449 
6450         private static final Validator ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR =
6451                 BOOLEAN_VALIDATOR;
6452 
6453         /**
6454          * Setting specifying the accessibility service to be toggled via the accessibility
6455          * shortcut. Must be its flattened {@link ComponentName}.
6456          * @hide
6457          */
6458         @TestApi
6459         public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE =
6460                 "accessibility_shortcut_target_service";
6461 
6462         private static final Validator ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR =
6463                 NULLABLE_COMPONENT_NAME_VALIDATOR;
6464 
6465         /**
6466          * Setting specifying the accessibility service or feature to be toggled via the
6467          * accessibility button in the navigation bar. This is either a flattened
6468          * {@link ComponentName} or the class name of a system class implementing a supported
6469          * accessibility feature.
6470          * @hide
6471          */
6472         public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT =
6473                 "accessibility_button_target_component";
6474 
6475         private static final Validator ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR =
6476                 new Validator() {
6477                     @Override
6478                     public boolean validate(@Nullable String value) {
6479                         // technically either ComponentName or class name, but there's proper value
6480                         // validation at callsites, so allow any non-null string
6481                         return value != null;
6482                     }
6483                 };
6484 
6485         /**
6486          * If touch exploration is enabled.
6487          */
6488         public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
6489 
6490         private static final Validator TOUCH_EXPLORATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6491 
6492         /**
6493          * List of the enabled accessibility providers.
6494          */
6495         public static final String ENABLED_ACCESSIBILITY_SERVICES =
6496             "enabled_accessibility_services";
6497 
6498         private static final Validator ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR =
6499                 new SettingsValidators.ComponentNameListValidator(":");
6500 
6501         /**
6502          * List of the accessibility services to which the user has granted
6503          * permission to put the device into touch exploration mode.
6504          *
6505          * @hide
6506          */
6507         public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
6508             "touch_exploration_granted_accessibility_services";
6509 
6510         private static final Validator TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR =
6511                 new SettingsValidators.ComponentNameListValidator(":");
6512 
6513         /**
6514          * Whether the Global Actions Panel is enabled.
6515          * @hide
6516          */
6517         public static final String GLOBAL_ACTIONS_PANEL_ENABLED = "global_actions_panel_enabled";
6518 
6519         private static final Validator GLOBAL_ACTIONS_PANEL_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6520 
6521         /**
6522          * Whether the Global Actions Panel can be toggled on or off in Settings.
6523          * @hide
6524          */
6525         public static final String GLOBAL_ACTIONS_PANEL_AVAILABLE =
6526                 "global_actions_panel_available";
6527 
6528         /**
6529          * Enables debug mode for the Global Actions Panel.
6530          * @hide
6531          */
6532         public static final String GLOBAL_ACTIONS_PANEL_DEBUG_ENABLED =
6533                 "global_actions_panel_debug_enabled";
6534 
6535         /**
6536          * Whether the hush gesture has ever been used
6537          * @hide
6538          */
6539         @SystemApi
6540         public static final String HUSH_GESTURE_USED = "hush_gesture_used";
6541 
6542         private static final Validator HUSH_GESTURE_USED_VALIDATOR = BOOLEAN_VALIDATOR;
6543 
6544         /**
6545          * Number of times the user has manually clicked the ringer toggle
6546          * @hide
6547          */
6548         public static final String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count";
6549 
6550         private static final Validator MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR =
6551                 NON_NEGATIVE_INTEGER_VALIDATOR;
6552 
6553         /**
6554          * Whether to play a sound for charging events.
6555          * @hide
6556          */
6557         public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
6558 
6559         /**
6560          * Whether to vibrate for charging events.
6561          * @hide
6562          */
6563         public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled";
6564 
6565         /**
6566          * If 0, turning on dnd manually will last indefinitely.
6567          * Else if non-negative, turning on dnd manually will last for this many minutes.
6568          * Else (if negative), turning on dnd manually will surface a dialog that prompts
6569          * user to specify a duration.
6570          * @hide
6571          */
6572         public static final String ZEN_DURATION = "zen_duration";
6573 
6574         private static final Validator ZEN_DURATION_VALIDATOR = ANY_INTEGER_VALIDATOR;
6575 
6576         /** @hide */ public static final int ZEN_DURATION_PROMPT = -1;
6577         /** @hide */ public static final int ZEN_DURATION_FOREVER = 0;
6578 
6579         /**
6580          * If nonzero, will show the zen upgrade notification when the user toggles DND on/off.
6581          * @hide
6582          */
6583         public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";
6584 
6585         /**
6586          * If nonzero, will show the zen update settings suggestion.
6587          * @hide
6588          */
6589         public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion";
6590 
6591         /**
6592          * If nonzero, zen has not been updated to reflect new changes.
6593          * @hide
6594          */
6595         public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated";
6596 
6597         /**
6598          * If nonzero, zen setting suggestion has been viewed by user
6599          * @hide
6600          */
6601         public static final String ZEN_SETTINGS_SUGGESTION_VIEWED =
6602                 "zen_settings_suggestion_viewed";
6603 
6604         /**
6605          * Whether the in call notification is enabled to play sound during calls.  The value is
6606          * boolean (1 or 0).
6607          * @hide
6608          */
6609         public static final String IN_CALL_NOTIFICATION_ENABLED = "in_call_notification_enabled";
6610 
6611         private static final Validator IN_CALL_NOTIFICATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
6612 
6613         /**
6614          * Uri of the slice that's presented on the keyguard.
6615          * Defaults to a slice with the date and next alarm.
6616          *
6617          * @hide
6618          */
6619         public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri";
6620 
6621         /**
6622          * Whether to speak passwords while in accessibility mode.
6623          *
6624          * @deprecated The speaking of passwords is controlled by individual accessibility services.
6625          * Apps should ignore this setting and provide complete information to accessibility
6626          * at all times, which was the behavior when this value was {@code true}.
6627          */
6628         @Deprecated
6629         public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
6630 
6631         /**
6632          * Whether to draw text with high contrast while in accessibility mode.
6633          *
6634          * @hide
6635          */
6636         public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
6637                 "high_text_contrast_enabled";
6638 
6639         private static final Validator ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR =
6640                 BOOLEAN_VALIDATOR;
6641 
6642         /**
6643          * Setting that specifies whether the display magnification is enabled via a system-wide
6644          * triple tap gesture. Display magnifications allows the user to zoom in the display content
6645          * and is targeted to low vision users. The current magnification scale is controlled by
6646          * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
6647          *
6648          * @hide
6649          */
6650         @TestApi
6651         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
6652                 "accessibility_display_magnification_enabled";
6653 
6654         private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR =
6655                 BOOLEAN_VALIDATOR;
6656 
6657         /**
6658          * Setting that specifies whether the display magnification is enabled via a shortcut
6659          * affordance within the system's navigation area. Display magnifications allows the user to
6660          * zoom in the display content and is targeted to low vision users. The current
6661          * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
6662          *
6663          * @hide
6664          */
6665         @SystemApi
6666         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED =
6667                 "accessibility_display_magnification_navbar_enabled";
6668 
6669         private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR
6670                 = BOOLEAN_VALIDATOR;
6671 
6672         /**
6673          * Setting that specifies what the display magnification scale is.
6674          * Display magnifications allows the user to zoom in the display
6675          * content and is targeted to low vision users. Whether a display
6676          * magnification is performed is controlled by
6677          * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and
6678          * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED}
6679          *
6680          * @hide
6681          */
6682         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
6683                 "accessibility_display_magnification_scale";
6684 
6685         private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR =
6686                 new SettingsValidators.InclusiveFloatRangeValidator(1.0f, Float.MAX_VALUE);
6687 
6688         /**
6689          * Unused mangnification setting
6690          *
6691          * @hide
6692          * @deprecated
6693          */
6694         @Deprecated
6695         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
6696                 "accessibility_display_magnification_auto_update";
6697 
6698         /**
6699          * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be
6700          * modified from an AccessibilityService using the SoftKeyboardController.
6701          *
6702          * @hide
6703          */
6704         public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE =
6705                 "accessibility_soft_keyboard_mode";
6706 
6707         /**
6708          * Default soft keyboard behavior.
6709          *
6710          * @hide
6711          */
6712         public static final int SHOW_MODE_AUTO = 0;
6713 
6714         /**
6715          * Soft keyboard is never shown.
6716          *
6717          * @hide
6718          */
6719         public static final int SHOW_MODE_HIDDEN = 1;
6720 
6721         /**
6722          * Setting that specifies whether timed text (captions) should be
6723          * displayed in video content. Text display properties are controlled by
6724          * the following settings:
6725          * <ul>
6726          * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
6727          * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
6728          * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
6729          * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
6730          * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
6731          * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
6732          * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
6733          * </ul>
6734          *
6735          * @hide
6736          */
6737         public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
6738                 "accessibility_captioning_enabled";
6739 
6740         private static final Validator ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR =
6741                 BOOLEAN_VALIDATOR;
6742 
6743         /**
6744          * Setting that specifies the language for captions as a locale string,
6745          * e.g. en_US.
6746          *
6747          * @see java.util.Locale#toString
6748          * @hide
6749          */
6750         public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
6751                 "accessibility_captioning_locale";
6752 
6753         private static final Validator ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR = LOCALE_VALIDATOR;
6754 
6755         /**
6756          * Integer property that specifies the preset style for captions, one
6757          * of:
6758          * <ul>
6759          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
6760          * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
6761          * </ul>
6762          *
6763          * @see java.util.Locale#toString
6764          * @hide
6765          */
6766         public static final String ACCESSIBILITY_CAPTIONING_PRESET =
6767                 "accessibility_captioning_preset";
6768 
6769         private static final Validator ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR =
6770                 new SettingsValidators.DiscreteValueValidator(new String[]{"-1", "0", "1", "2",
6771                         "3", "4"});
6772 
6773         /**
6774          * Integer property that specifes the background color for captions as a
6775          * packed 32-bit color.
6776          *
6777          * @see android.graphics.Color#argb
6778          * @hide
6779          */
6780         public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
6781                 "accessibility_captioning_background_color";
6782 
6783         private static final Validator ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR =
6784                 ANY_INTEGER_VALIDATOR;
6785 
6786         /**
6787          * Integer property that specifes the foreground color for captions as a
6788          * packed 32-bit color.
6789          *
6790          * @see android.graphics.Color#argb
6791          * @hide
6792          */
6793         public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
6794                 "accessibility_captioning_foreground_color";
6795 
6796         private static final Validator ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR =
6797                 ANY_INTEGER_VALIDATOR;
6798 
6799         /**
6800          * Integer property that specifes the edge type for captions, one of:
6801          * <ul>
6802          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
6803          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
6804          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
6805          * </ul>
6806          *
6807          * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
6808          * @hide
6809          */
6810         public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
6811                 "accessibility_captioning_edge_type";
6812 
6813         private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR =
6814                 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2"});
6815 
6816         /**
6817          * Integer property that specifes the edge color for captions as a
6818          * packed 32-bit color.
6819          *
6820          * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
6821          * @see android.graphics.Color#argb
6822          * @hide
6823          */
6824         public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
6825                 "accessibility_captioning_edge_color";
6826 
6827         private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR =
6828                 ANY_INTEGER_VALIDATOR;
6829 
6830         /**
6831          * Integer property that specifes the window color for captions as a
6832          * packed 32-bit color.
6833          *
6834          * @see android.graphics.Color#argb
6835          * @hide
6836          */
6837         public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
6838                 "accessibility_captioning_window_color";
6839 
6840         private static final Validator ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR =
6841                 ANY_INTEGER_VALIDATOR;
6842 
6843         /**
6844          * String property that specifies the typeface for captions, one of:
6845          * <ul>
6846          * <li>DEFAULT
6847          * <li>MONOSPACE
6848          * <li>SANS_SERIF
6849          * <li>SERIF
6850          * </ul>
6851          *
6852          * @see android.graphics.Typeface
6853          * @hide
6854          */
6855         @UnsupportedAppUsage
6856         public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
6857                 "accessibility_captioning_typeface";
6858 
6859         private static final Validator ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR =
6860                 new SettingsValidators.DiscreteValueValidator(new String[]{"DEFAULT",
6861                         "MONOSPACE", "SANS_SERIF", "SERIF"});
6862 
6863         /**
6864          * Floating point property that specifies font scaling for captions.
6865          *
6866          * @hide
6867          */
6868         public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
6869                 "accessibility_captioning_font_scale";
6870 
6871         private static final Validator ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR =
6872                 new SettingsValidators.InclusiveFloatRangeValidator(0.5f, 2.0f);
6873 
6874         /**
6875          * Setting that specifies whether display color inversion is enabled.
6876          */
6877         public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
6878                 "accessibility_display_inversion_enabled";
6879 
6880         private static final Validator ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR =
6881                 BOOLEAN_VALIDATOR;
6882 
6883         /**
6884          * Setting that specifies whether display color space adjustment is
6885          * enabled.
6886          *
6887          * @hide
6888          */
6889         @UnsupportedAppUsage
6890         public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
6891                 "accessibility_display_daltonizer_enabled";
6892 
6893         private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR =
6894                 BOOLEAN_VALIDATOR;
6895 
6896         /**
6897          * Integer property that specifies the type of color space adjustment to
6898          * perform. Valid values are defined in AccessibilityManager and Settings arrays.xml:
6899          * - AccessibilityManager.DALTONIZER_DISABLED = -1
6900          * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0
6901          * - <item>@string/daltonizer_mode_protanomaly</item> = 11
6902          * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY and
6903          *       <item>@string/daltonizer_mode_deuteranomaly</item> = 12
6904          * - <item>@string/daltonizer_mode_tritanomaly</item> = 13
6905          *
6906          * @hide
6907          */
6908         @UnsupportedAppUsage
6909         public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
6910                 "accessibility_display_daltonizer";
6911 
6912         private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR =
6913                 new SettingsValidators.DiscreteValueValidator(
6914                         new String[] {"-1", "0", "11", "12", "13"});
6915 
6916         /**
6917          * Setting that specifies whether automatic click when the mouse pointer stops moving is
6918          * enabled.
6919          *
6920          * @hide
6921          */
6922         @UnsupportedAppUsage
6923         public static final String ACCESSIBILITY_AUTOCLICK_ENABLED =
6924                 "accessibility_autoclick_enabled";
6925 
6926         private static final Validator ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR =
6927                 BOOLEAN_VALIDATOR;
6928 
6929         /**
6930          * Integer setting specifying amount of time in ms the mouse pointer has to stay still
6931          * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set.
6932          *
6933          * @see #ACCESSIBILITY_AUTOCLICK_ENABLED
6934          * @hide
6935          */
6936         public static final String ACCESSIBILITY_AUTOCLICK_DELAY =
6937                 "accessibility_autoclick_delay";
6938 
6939         private static final Validator ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR =
6940                 NON_NEGATIVE_INTEGER_VALIDATOR;
6941 
6942         /**
6943          * Whether or not larger size icons are used for the pointer of mouse/trackpad for
6944          * accessibility.
6945          * (0 = false, 1 = true)
6946          * @hide
6947          */
6948         @UnsupportedAppUsage
6949         public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
6950                 "accessibility_large_pointer_icon";
6951 
6952         private static final Validator ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR =
6953                 BOOLEAN_VALIDATOR;
6954 
6955         /**
6956          * The timeout for considering a press to be a long press in milliseconds.
6957          * @hide
6958          */
6959         @UnsupportedAppUsage
6960         public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
6961 
6962         private static final Validator LONG_PRESS_TIMEOUT_VALIDATOR =
6963                 NON_NEGATIVE_INTEGER_VALIDATOR;
6964 
6965         /**
6966          * The duration in milliseconds between the first tap's up event and the second tap's
6967          * down event for an interaction to be considered part of the same multi-press.
6968          * @hide
6969          */
6970         public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout";
6971 
6972         /**
6973          * Setting that specifies recommended timeout in milliseconds for controls
6974          * which don't need user's interactions.
6975          *
6976          * @hide
6977          */
6978         public static final String ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS =
6979                 "accessibility_non_interactive_ui_timeout_ms";
6980 
6981         /**
6982          * Setting that specifies recommended timeout in milliseconds for controls
6983          * which need user's interactions.
6984          *
6985          * @hide
6986          */
6987         public static final String ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS =
6988                 "accessibility_interactive_ui_timeout_ms";
6989 
6990         /**
6991          * List of the enabled print services.
6992          *
6993          * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade
6994          * from pre-N.
6995          *
6996          * @hide
6997          */
6998         @UnsupportedAppUsage
6999         public static final String ENABLED_PRINT_SERVICES =
7000             "enabled_print_services";
7001 
7002         /**
7003          * List of the disabled print services.
7004          *
7005          * @hide
7006          */
7007         @TestApi
7008         public static final String DISABLED_PRINT_SERVICES =
7009             "disabled_print_services";
7010 
7011         /**
7012          * The saved value for WindowManagerService.setForcedDisplayDensity()
7013          * formatted as a single integer representing DPI. If unset, then use
7014          * the real display density.
7015          *
7016          * @hide
7017          */
7018         public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
7019 
7020         /**
7021          * Setting to always use the default text-to-speech settings regardless
7022          * of the application settings.
7023          * 1 = override application settings,
7024          * 0 = use application settings (if specified).
7025          *
7026          * @deprecated  The value of this setting is no longer respected by
7027          * the framework text to speech APIs as of the Ice Cream Sandwich release.
7028          */
7029         @Deprecated
7030         public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
7031 
7032         /**
7033          * Default text-to-speech engine speech rate. 100 = 1x
7034          */
7035         public static final String TTS_DEFAULT_RATE = "tts_default_rate";
7036 
7037         private static final Validator TTS_DEFAULT_RATE_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR;
7038 
7039         /**
7040          * Default text-to-speech engine pitch. 100 = 1x
7041          */
7042         public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
7043 
7044         private static final Validator TTS_DEFAULT_PITCH_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR;
7045 
7046         /**
7047          * Default text-to-speech engine.
7048          */
7049         public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
7050 
7051         private static final Validator TTS_DEFAULT_SYNTH_VALIDATOR = PACKAGE_NAME_VALIDATOR;
7052 
7053         /**
7054          * Default text-to-speech language.
7055          *
7056          * @deprecated this setting is no longer in use, as of the Ice Cream
7057          * Sandwich release. Apps should never need to read this setting directly,
7058          * instead can query the TextToSpeech framework classes for the default
7059          * locale. {@link TextToSpeech#getLanguage()}.
7060          */
7061         @Deprecated
7062         public static final String TTS_DEFAULT_LANG = "tts_default_lang";
7063 
7064         /**
7065          * Default text-to-speech country.
7066          *
7067          * @deprecated this setting is no longer in use, as of the Ice Cream
7068          * Sandwich release. Apps should never need to read this setting directly,
7069          * instead can query the TextToSpeech framework classes for the default
7070          * locale. {@link TextToSpeech#getLanguage()}.
7071          */
7072         @Deprecated
7073         public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
7074 
7075         /**
7076          * Default text-to-speech locale variant.
7077          *
7078          * @deprecated this setting is no longer in use, as of the Ice Cream
7079          * Sandwich release. Apps should never need to read this setting directly,
7080          * instead can query the TextToSpeech framework classes for the
7081          * locale that is in use {@link TextToSpeech#getLanguage()}.
7082          */
7083         @Deprecated
7084         public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
7085 
7086         /**
7087          * Stores the default tts locales on a per engine basis. Stored as
7088          * a comma seperated list of values, each value being of the form
7089          * {@code engine_name:locale} for example,
7090          * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
7091          * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
7092          * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
7093          * setting directly, and can query the TextToSpeech framework classes
7094          * for the locale that is in use.
7095          *
7096          * @hide
7097          */
7098         public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
7099 
7100         private static final Validator TTS_DEFAULT_LOCALE_VALIDATOR = new Validator() {
7101             @Override
7102             public boolean validate(@Nullable String value) {
7103                 if (value == null || value.length() == 0) {
7104                     return false;
7105                 }
7106                 String[] ttsLocales = value.split(",");
7107                 boolean valid = true;
7108                 for (String ttsLocale : ttsLocales) {
7109                     String[] parts = ttsLocale.split(":");
7110                     valid |= ((parts.length == 2)
7111                             && (parts[0].length() > 0)
7112                             && ANY_STRING_VALIDATOR.validate(parts[0])
7113                             && LOCALE_VALIDATOR.validate(parts[1]));
7114                 }
7115                 return valid;
7116             }
7117         };
7118 
7119         /**
7120          * Space delimited list of plugin packages that are enabled.
7121          */
7122         public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
7123 
7124         private static final Validator TTS_ENABLED_PLUGINS_VALIDATOR =
7125                 new SettingsValidators.PackageNameListValidator(" ");
7126 
7127         /**
7128          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
7129          * instead.
7130          */
7131         @Deprecated
7132         public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
7133                 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
7134 
7135         private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
7136                 BOOLEAN_VALIDATOR;
7137 
7138         /**
7139          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
7140          * instead.
7141          */
7142         @Deprecated
7143         public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
7144                 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
7145 
7146         private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR =
7147                 NON_NEGATIVE_INTEGER_VALIDATOR;
7148 
7149         /**
7150          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
7151          * instead.
7152          */
7153         @Deprecated
7154         public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
7155                 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
7156 
7157         private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR =
7158                 NON_NEGATIVE_INTEGER_VALIDATOR;
7159 
7160         /**
7161          * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
7162          * instead.
7163          */
7164         @Deprecated
7165         public static final String WIFI_ON = Global.WIFI_ON;
7166 
7167         /**
7168          * The acceptable packet loss percentage (range 0 - 100) before trying
7169          * another AP on the same network.
7170          * @deprecated This setting is not used.
7171          */
7172         @Deprecated
7173         public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
7174                 "wifi_watchdog_acceptable_packet_loss_percentage";
7175 
7176         /**
7177          * The number of access points required for a network in order for the
7178          * watchdog to monitor it.
7179          * @deprecated This setting is not used.
7180          */
7181         @Deprecated
7182         public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
7183 
7184         /**
7185          * The delay between background checks.
7186          * @deprecated This setting is not used.
7187          */
7188         @Deprecated
7189         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
7190                 "wifi_watchdog_background_check_delay_ms";
7191 
7192         /**
7193          * Whether the Wi-Fi watchdog is enabled for background checking even
7194          * after it thinks the user has connected to a good access point.
7195          * @deprecated This setting is not used.
7196          */
7197         @Deprecated
7198         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
7199                 "wifi_watchdog_background_check_enabled";
7200 
7201         /**
7202          * The timeout for a background ping
7203          * @deprecated This setting is not used.
7204          */
7205         @Deprecated
7206         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
7207                 "wifi_watchdog_background_check_timeout_ms";
7208 
7209         /**
7210          * The number of initial pings to perform that *may* be ignored if they
7211          * fail. Again, if these fail, they will *not* be used in packet loss
7212          * calculation. For example, one network always seemed to time out for
7213          * the first couple pings, so this is set to 3 by default.
7214          * @deprecated This setting is not used.
7215          */
7216         @Deprecated
7217         public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
7218             "wifi_watchdog_initial_ignored_ping_count";
7219 
7220         /**
7221          * The maximum number of access points (per network) to attempt to test.
7222          * If this number is reached, the watchdog will no longer monitor the
7223          * initial connection state for the network. This is a safeguard for
7224          * networks containing multiple APs whose DNS does not respond to pings.
7225          * @deprecated This setting is not used.
7226          */
7227         @Deprecated
7228         public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
7229 
7230         /**
7231          * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
7232          */
7233         @Deprecated
7234         public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
7235 
7236         /**
7237          * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
7238          * @deprecated This setting is not used.
7239          */
7240         @Deprecated
7241         public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
7242 
7243         /**
7244          * The number of pings to test if an access point is a good connection.
7245          * @deprecated This setting is not used.
7246          */
7247         @Deprecated
7248         public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
7249 
7250         /**
7251          * The delay between pings.
7252          * @deprecated This setting is not used.
7253          */
7254         @Deprecated
7255         public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
7256 
7257         /**
7258          * The timeout per ping.
7259          * @deprecated This setting is not used.
7260          */
7261         @Deprecated
7262         public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
7263 
7264         /**
7265          * @deprecated Use
7266          * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
7267          */
7268         @Deprecated
7269         public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
7270 
7271         /**
7272          * @deprecated Use
7273          * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
7274          */
7275         @Deprecated
7276         public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
7277                 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
7278 
7279         /**
7280          * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
7281          * the receivers of the PendingIntent an opportunity to make a new network request before
7282          * the Network satisfying the request is potentially removed.
7283          *
7284          * @hide
7285          */
7286         public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
7287                 "connectivity_release_pending_intent_delay_ms";
7288 
7289         /**
7290          * Whether background data usage is allowed.
7291          *
7292          * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
7293          *             availability of background data depends on several
7294          *             combined factors. When background data is unavailable,
7295          *             {@link ConnectivityManager#getActiveNetworkInfo()} will
7296          *             now appear disconnected.
7297          */
7298         @Deprecated
7299         public static final String BACKGROUND_DATA = "background_data";
7300 
7301         /**
7302          * Origins for which browsers should allow geolocation by default.
7303          * The value is a space-separated list of origins.
7304          */
7305         public static final String ALLOWED_GEOLOCATION_ORIGINS
7306                 = "allowed_geolocation_origins";
7307 
7308         /**
7309          * The preferred TTY mode     0 = TTy Off, CDMA default
7310          *                            1 = TTY Full
7311          *                            2 = TTY HCO
7312          *                            3 = TTY VCO
7313          * @hide
7314          */
7315         public static final String PREFERRED_TTY_MODE =
7316                 "preferred_tty_mode";
7317 
7318         private static final Validator PREFERRED_TTY_MODE_VALIDATOR =
7319                 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2", "3"});
7320 
7321         /**
7322          * Whether the enhanced voice privacy mode is enabled.
7323          * 0 = normal voice privacy
7324          * 1 = enhanced voice privacy
7325          * @hide
7326          */
7327         public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
7328 
7329         private static final Validator ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7330 
7331         /**
7332          * Whether the TTY mode mode is enabled.
7333          * 0 = disabled
7334          * 1 = enabled
7335          * @hide
7336          */
7337         public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
7338 
7339         private static final Validator TTY_MODE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7340 
7341         /**
7342          * User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT
7343          * calls when supported by the device and carrier. Boolean value.
7344          * 0 = OFF
7345          * 1 = ON
7346          */
7347         public static final String RTT_CALLING_MODE = "rtt_calling_mode";
7348 
7349         private static final Validator RTT_CALLING_MODE_VALIDATOR = BOOLEAN_VALIDATOR;
7350 
7351         /**
7352         /**
7353          * Controls whether settings backup is enabled.
7354          * Type: int ( 0 = disabled, 1 = enabled )
7355          * @hide
7356          */
7357         @UnsupportedAppUsage
7358         public static final String BACKUP_ENABLED = "backup_enabled";
7359 
7360         /**
7361          * Controls whether application data is automatically restored from backup
7362          * at install time.
7363          * Type: int ( 0 = disabled, 1 = enabled )
7364          * @hide
7365          */
7366         @UnsupportedAppUsage
7367         public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
7368 
7369         /**
7370          * Indicates whether settings backup has been fully provisioned.
7371          * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
7372          * @hide
7373          */
7374         @UnsupportedAppUsage
7375         public static final String BACKUP_PROVISIONED = "backup_provisioned";
7376 
7377         /**
7378          * Component of the transport to use for backup/restore.
7379          * @hide
7380          */
7381         @UnsupportedAppUsage
7382         public static final String BACKUP_TRANSPORT = "backup_transport";
7383 
7384         /**
7385          * Indicates the version for which the setup wizard was last shown. The version gets
7386          * bumped for each release when there is new setup information to show.
7387          *
7388          * @hide
7389          */
7390         @SystemApi
7391         public static final String LAST_SETUP_SHOWN = "last_setup_shown";
7392 
7393         /**
7394          * The interval in milliseconds after which Wi-Fi is considered idle.
7395          * When idle, it is possible for the device to be switched from Wi-Fi to
7396          * the mobile data network.
7397          * @hide
7398          * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
7399          * instead.
7400          */
7401         @Deprecated
7402         public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
7403 
7404         /**
7405          * The global search provider chosen by the user (if multiple global
7406          * search providers are installed). This will be the provider returned
7407          * by {@link SearchManager#getGlobalSearchActivity()} if it's still
7408          * installed. This setting is stored as a flattened component name as
7409          * per {@link ComponentName#flattenToString()}.
7410          *
7411          * @hide
7412          */
7413         public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
7414                 "search_global_search_activity";
7415 
7416         /**
7417          * The number of promoted sources in GlobalSearch.
7418          * @hide
7419          */
7420         public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
7421         /**
7422          * The maximum number of suggestions returned by GlobalSearch.
7423          * @hide
7424          */
7425         public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
7426         /**
7427          * The number of suggestions GlobalSearch will ask each non-web search source for.
7428          * @hide
7429          */
7430         public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
7431         /**
7432          * The number of suggestions the GlobalSearch will ask the web search source for.
7433          * @hide
7434          */
7435         public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
7436                 "search_web_results_override_limit";
7437         /**
7438          * The number of milliseconds that GlobalSearch will wait for suggestions from
7439          * promoted sources before continuing with all other sources.
7440          * @hide
7441          */
7442         public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
7443                 "search_promoted_source_deadline_millis";
7444         /**
7445          * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
7446          * @hide
7447          */
7448         public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
7449         /**
7450          * The maximum number of milliseconds that GlobalSearch shows the previous results
7451          * after receiving a new query.
7452          * @hide
7453          */
7454         public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
7455         /**
7456          * The maximum age of log data used for shortcuts in GlobalSearch.
7457          * @hide
7458          */
7459         public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
7460         /**
7461          * The maximum age of log data used for source ranking in GlobalSearch.
7462          * @hide
7463          */
7464         public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
7465                 "search_max_source_event_age_millis";
7466         /**
7467          * The minimum number of impressions needed to rank a source in GlobalSearch.
7468          * @hide
7469          */
7470         public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
7471                 "search_min_impressions_for_source_ranking";
7472         /**
7473          * The minimum number of clicks needed to rank a source in GlobalSearch.
7474          * @hide
7475          */
7476         public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
7477                 "search_min_clicks_for_source_ranking";
7478         /**
7479          * The maximum number of shortcuts shown by GlobalSearch.
7480          * @hide
7481          */
7482         public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
7483         /**
7484          * The size of the core thread pool for suggestion queries in GlobalSearch.
7485          * @hide
7486          */
7487         public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
7488                 "search_query_thread_core_pool_size";
7489         /**
7490          * The maximum size of the thread pool for suggestion queries in GlobalSearch.
7491          * @hide
7492          */
7493         public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
7494                 "search_query_thread_max_pool_size";
7495         /**
7496          * The size of the core thread pool for shortcut refreshing in GlobalSearch.
7497          * @hide
7498          */
7499         public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
7500                 "search_shortcut_refresh_core_pool_size";
7501         /**
7502          * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
7503          * @hide
7504          */
7505         public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
7506                 "search_shortcut_refresh_max_pool_size";
7507         /**
7508          * The maximun time that excess threads in the GlobalSeach thread pools will
7509          * wait before terminating.
7510          * @hide
7511          */
7512         public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
7513                 "search_thread_keepalive_seconds";
7514         /**
7515          * The maximum number of concurrent suggestion queries to each source.
7516          * @hide
7517          */
7518         public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
7519                 "search_per_source_concurrent_query_limit";
7520 
7521         /**
7522          * Whether or not alert sounds are played on StorageManagerService events.
7523          * (0 = false, 1 = true)
7524          * @hide
7525          */
7526         public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
7527 
7528         private static final Validator MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR = BOOLEAN_VALIDATOR;
7529 
7530         /**
7531          * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
7532          * @hide
7533          */
7534         public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
7535 
7536         private static final Validator MOUNT_UMS_AUTOSTART_VALIDATOR = BOOLEAN_VALIDATOR;
7537 
7538         /**
7539          * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
7540          * @hide
7541          */
7542         public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
7543 
7544         private static final Validator MOUNT_UMS_PROMPT_VALIDATOR = BOOLEAN_VALIDATOR;
7545 
7546         /**
7547          * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
7548          * @hide
7549          */
7550         public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
7551 
7552         private static final Validator MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7553 
7554         /**
7555          * If nonzero, ANRs in invisible background processes bring up a dialog.
7556          * Otherwise, the process will be silently killed.
7557          *
7558          * Also prevents ANRs and crash dialogs from being suppressed.
7559          * @hide
7560          */
7561         @UnsupportedAppUsage
7562         public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
7563 
7564         /**
7565          * If nonzero, crashes in foreground processes will bring up a dialog.
7566          * Otherwise, the process will be silently killed.
7567          * @hide
7568          */
7569         public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION =
7570                 "show_first_crash_dialog_dev_option";
7571 
7572         private static final Validator SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR =
7573                 BOOLEAN_VALIDATOR;
7574 
7575         /**
7576          * The {@link ComponentName} string of the service to be used as the voice recognition
7577          * service.
7578          *
7579          * @hide
7580          */
7581         @UnsupportedAppUsage
7582         public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
7583 
7584         /**
7585          * Stores whether an user has consented to have apps verified through PAM.
7586          * The value is boolean (1 or 0).
7587          *
7588          * @hide
7589          */
7590         @UnsupportedAppUsage
7591         public static final String PACKAGE_VERIFIER_USER_CONSENT =
7592             "package_verifier_user_consent";
7593 
7594         /**
7595          * The {@link ComponentName} string of the selected spell checker service which is
7596          * one of the services managed by the text service manager.
7597          *
7598          * @hide
7599          */
7600         @UnsupportedAppUsage
7601         public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
7602 
7603         /**
7604          * {@link android.view.textservice.SpellCheckerSubtype#hashCode()} of the selected subtype
7605          * of the selected spell checker service which is one of the services managed by the text
7606          * service manager.
7607          *
7608          * @hide
7609          */
7610         @UnsupportedAppUsage
7611         public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
7612                 "selected_spell_checker_subtype";
7613 
7614         /**
7615          * Whether spell checker is enabled or not.
7616          *
7617          * @hide
7618          */
7619         public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
7620 
7621         /**
7622          * What happens when the user presses the Power button while in-call
7623          * and the screen is on.<br/>
7624          * <b>Values:</b><br/>
7625          * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
7626          * 2 - The Power button hangs up the current call.<br/>
7627          *
7628          * @hide
7629          */
7630         @UnsupportedAppUsage
7631         public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
7632 
7633         private static final Validator INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR =
7634                 new SettingsValidators.DiscreteValueValidator(new String[]{"1", "2"});
7635 
7636         /**
7637          * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
7638          * @hide
7639          */
7640         public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
7641 
7642         /**
7643          * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
7644          * @hide
7645          */
7646         public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
7647 
7648         /**
7649          * INCALL_POWER_BUTTON_BEHAVIOR default value.
7650          * @hide
7651          */
7652         public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
7653                 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
7654 
7655         /**
7656          * What happens when the user presses the Back button while in-call
7657          * and the screen is on.<br/>
7658          * <b>Values:</b><br/>
7659          * 0 - The Back buttons does nothing different.<br/>
7660          * 1 - The Back button hangs up the current call.<br/>
7661          *
7662          * @hide
7663          */
7664         public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior";
7665 
7666         /**
7667          * INCALL_BACK_BUTTON_BEHAVIOR value for no action.
7668          * @hide
7669          */
7670         public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0;
7671 
7672         /**
7673          * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up".
7674          * @hide
7675          */
7676         public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1;
7677 
7678         /**
7679          * INCALL_POWER_BUTTON_BEHAVIOR default value.
7680          * @hide
7681          */
7682         public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT =
7683                 INCALL_BACK_BUTTON_BEHAVIOR_NONE;
7684 
7685         /**
7686          * Whether the device should wake when the wake gesture sensor detects motion.
7687          * @hide
7688          */
7689         public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
7690 
7691         private static final Validator WAKE_GESTURE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7692 
7693         /**
7694          * Whether the device should doze if configured.
7695          * @hide
7696          */
7697         @UnsupportedAppUsage
7698         public static final String DOZE_ENABLED = "doze_enabled";
7699 
7700         private static final Validator DOZE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7701 
7702         /**
7703          * Indicates whether doze should be always on.
7704          * <p>
7705          * Type: int (0 for false, 1 for true)
7706          *
7707          * @hide
7708          */
7709         @SystemApi
7710         @TestApi
7711         public static final String DOZE_ALWAYS_ON = "doze_always_on";
7712 
7713         private static final Validator DOZE_ALWAYS_ON_VALIDATOR = BOOLEAN_VALIDATOR;
7714 
7715         /**
7716          * Whether the device should pulse on pick up gesture.
7717          * @hide
7718          */
7719         public static final String DOZE_PICK_UP_GESTURE = "doze_pulse_on_pick_up";
7720 
7721         private static final Validator DOZE_PICK_UP_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR;
7722 
7723         /**
7724          * Whether the device should pulse on long press gesture.
7725          * @hide
7726          */
7727         public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press";
7728 
7729         /**
7730          * Whether the device should pulse on double tap gesture.
7731          * @hide
7732          */
7733         public static final String DOZE_DOUBLE_TAP_GESTURE = "doze_pulse_on_double_tap";
7734 
7735         private static final Validator DOZE_DOUBLE_TAP_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR;
7736 
7737         /**
7738          * Whether the device should respond to the SLPI tap gesture.
7739          * @hide
7740          */
7741         public static final String DOZE_TAP_SCREEN_GESTURE = "doze_tap_gesture";
7742 
7743         private static final Validator DOZE_TAP_SCREEN_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR;
7744 
7745         /**
7746          * Gesture that wakes up the display, showing the ambient version of the status bar.
7747          * @hide
7748          */
7749         public static final String DOZE_WAKE_SCREEN_GESTURE = "doze_wake_screen_gesture";
7750 
7751         private static final Validator DOZE_WAKE_SCREEN_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR;
7752 
7753         /**
7754          * Gesture that skips media.
7755          * @hide
7756          */
7757         public static final String SKIP_GESTURE = "skip_gesture";
7758 
7759         private static final Validator SKIP_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR;
7760 
7761         /**
7762          * Count of successful gestures.
7763          * @hide
7764          */
7765         public static final String SKIP_GESTURE_COUNT = "skip_gesture_count";
7766 
7767         private static final Validator SKIP_GESTURE_COUNT_VALIDATOR =
7768                 NON_NEGATIVE_INTEGER_VALIDATOR;
7769 
7770         /**
7771          * Gesture that silences sound (alarms, notification, calls).
7772          * @hide
7773          */
7774         public static final String SILENCE_GESTURE = "silence_gesture";
7775 
7776         private static final Validator SILENCE_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR;
7777 
7778         /**
7779          * Count of successful silence alarms gestures.
7780          * @hide
7781          */
7782         public static final String SILENCE_ALARMS_GESTURE_COUNT = "silence_alarms_gesture_count";
7783 
7784         /**
7785          * Count of successful silence timer gestures.
7786          * @hide
7787          */
7788         public static final String SILENCE_TIMER_GESTURE_COUNT = "silence_timer_gesture_count";
7789 
7790         /**
7791          * Count of successful silence call gestures.
7792          * @hide
7793          */
7794         public static final String SILENCE_CALL_GESTURE_COUNT = "silence_call_gesture_count";
7795 
7796         /**
7797          * Count of successful silence notification gestures.
7798          * @hide
7799          */
7800         public static final String SILENCE_NOTIFICATION_GESTURE_COUNT =
7801                 "silence_notification_gesture_count";
7802 
7803         private static final Validator SILENCE_GESTURE_COUNT_VALIDATOR =
7804                 NON_NEGATIVE_INTEGER_VALIDATOR;
7805 
7806         /**
7807          * The current night mode that has been selected by the user.  Owned
7808          * and controlled by UiModeManagerService.  Constants are as per
7809          * UiModeManager.
7810          * @hide
7811          */
7812         public static final String UI_NIGHT_MODE = "ui_night_mode";
7813 
7814         private static final Validator UI_NIGHT_MODE_VALIDATOR =
7815                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 2);
7816 
7817         /**
7818          * Whether screensavers are enabled.
7819          * @hide
7820          */
7821         public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
7822 
7823         private static final Validator SCREENSAVER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
7824 
7825         /**
7826          * The user's chosen screensaver components.
7827          *
7828          * These will be launched by the PhoneWindowManager after a timeout when not on
7829          * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
7830          * @hide
7831          */
7832         public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
7833 
7834         private static final Validator SCREENSAVER_COMPONENTS_VALIDATOR =
7835                 new SettingsValidators.ComponentNameListValidator(",");
7836 
7837         /**
7838          * If screensavers are enabled, whether the screensaver should be automatically launched
7839          * when the device is inserted into a (desk) dock.
7840          * @hide
7841          */
7842         public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
7843 
7844         private static final Validator SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR = BOOLEAN_VALIDATOR;
7845 
7846         /**
7847          * If screensavers are enabled, whether the screensaver should be automatically launched
7848          * when the screen times out when not on battery.
7849          * @hide
7850          */
7851         public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
7852 
7853         private static final Validator SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR = BOOLEAN_VALIDATOR;
7854 
7855         /**
7856          * If screensavers are enabled, the default screensaver component.
7857          * @hide
7858          */
7859         public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
7860 
7861         /**
7862          * The default NFC payment component
7863          * @hide
7864          */
7865         @UnsupportedAppUsage
7866         public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
7867 
7868         private static final Validator NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR =
7869                 COMPONENT_NAME_VALIDATOR;
7870 
7871         /**
7872          * Whether NFC payment is handled by the foreground application or a default.
7873          * @hide
7874          */
7875         public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
7876 
7877         /**
7878          * Specifies the package name currently configured to be the primary sms application
7879          * @hide
7880          */
7881         @UnsupportedAppUsage
7882         public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
7883 
7884         /**
7885          * Specifies the package name currently configured to be the default dialer application
7886          * @hide
7887          */
7888         @UnsupportedAppUsage
7889         public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
7890 
7891         /**
7892          * Specifies the component name currently configured to be the default call screening
7893          * application
7894          * @hide
7895          */
7896         public static final String CALL_SCREENING_DEFAULT_COMPONENT =
7897                 "call_screening_default_component";
7898 
7899         /**
7900          * Specifies the package name currently configured to be the emergency assistance application
7901          *
7902          * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
7903          *
7904          * @hide
7905          */
7906         public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
7907 
7908         /**
7909          * Specifies whether the current app context on scren (assist data) will be sent to the
7910          * assist application (active voice interaction service).
7911          *
7912          * @hide
7913          */
7914         public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
7915 
7916         /**
7917          * Specifies whether a screenshot of the screen contents will be sent to the assist
7918          * application (active voice interaction service).
7919          *
7920          * @hide
7921          */
7922         public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";
7923 
7924         /**
7925          * Specifies whether the screen will show an animation if screen contents are sent to the
7926          * assist application (active voice interaction service).
7927          *
7928          * Note that the disclosure will be forced for third-party assistants or if the device
7929          * does not support disabling it.
7930          *
7931          * @hide
7932          */
7933         public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled";
7934 
7935         /**
7936          * Control if rotation suggestions are sent to System UI when in rotation locked mode.
7937          * Done to enable screen rotation while the the screen rotation is locked. Enabling will
7938          * poll the accelerometer in rotation locked mode.
7939          *
7940          * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent.
7941          *
7942          * @hide
7943          */
7944 
7945         public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions";
7946 
7947         /**
7948          * The disabled state of SHOW_ROTATION_SUGGESTIONS.
7949          * @hide
7950          */
7951         public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0;
7952 
7953         /**
7954          * The enabled state of SHOW_ROTATION_SUGGESTIONS.
7955          * @hide
7956          */
7957         public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1;
7958 
7959         /**
7960          * The default state of SHOW_ROTATION_SUGGESTIONS.
7961          * @hide
7962          */
7963         public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT =
7964                 SHOW_ROTATION_SUGGESTIONS_ENABLED;
7965 
7966         /**
7967          * The number of accepted rotation suggestions. Used to determine if the user has been
7968          * introduced to rotation suggestions.
7969          * @hide
7970          */
7971         public static final String NUM_ROTATION_SUGGESTIONS_ACCEPTED =
7972                 "num_rotation_suggestions_accepted";
7973 
7974         /**
7975          * Read only list of the service components that the current user has explicitly allowed to
7976          * see and assist with all of the user's notifications.
7977          *
7978          * @deprecated Use
7979          * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}.
7980          * @hide
7981          */
7982         @Deprecated
7983         public static final String ENABLED_NOTIFICATION_ASSISTANT =
7984                 "enabled_notification_assistant";
7985 
7986         private static final Validator ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR =
7987                 new SettingsValidators.ComponentNameListValidator(":");
7988 
7989         /**
7990          * Read only list of the service components that the current user has explicitly allowed to
7991          * see all of the user's notifications, separated by ':'.
7992          *
7993          * @hide
7994          * @deprecated Use
7995          * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}.
7996          */
7997         @Deprecated
7998         @UnsupportedAppUsage
7999         public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
8000 
8001         private static final Validator ENABLED_NOTIFICATION_LISTENERS_VALIDATOR =
8002                 new SettingsValidators.ComponentNameListValidator(":");
8003 
8004         /**
8005          * Read only list of the packages that the current user has explicitly allowed to
8006          * manage do not disturb, separated by ':'.
8007          *
8008          * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}.
8009          * @hide
8010          */
8011         @Deprecated
8012         @TestApi
8013         public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES =
8014                 "enabled_notification_policy_access_packages";
8015 
8016         private static final Validator ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR =
8017                 new SettingsValidators.PackageNameListValidator(":");
8018 
8019         /**
8020          * Defines whether managed profile ringtones should be synced from it's parent profile
8021          * <p>
8022          * 0 = ringtones are not synced
8023          * 1 = ringtones are synced from the profile's parent (default)
8024          * <p>
8025          * This value is only used for managed profiles.
8026          * @hide
8027          */
8028         @TestApi
8029         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
8030         public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds";
8031 
8032         private static final Validator SYNC_PARENT_SOUNDS_VALIDATOR = BOOLEAN_VALIDATOR;
8033 
8034         /** @hide */
8035         @UnsupportedAppUsage
8036         public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
8037 
8038         /**
8039          * This is the query URI for finding a print service to install.
8040          *
8041          * @hide
8042          */
8043         public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
8044 
8045         /**
8046          * This is the query URI for finding a NFC payment service to install.
8047          *
8048          * @hide
8049          */
8050         public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
8051 
8052         /**
8053          * This is the query URI for finding a auto fill service to install.
8054          *
8055          * @hide
8056          */
8057         public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri";
8058 
8059         /**
8060          * If enabled, apps should try to skip any introductory hints on first launch. This might
8061          * apply to users that are already familiar with the environment or temporary users.
8062          * <p>
8063          * Type : int (0 to show hints, 1 to skip showing hints)
8064          */
8065         public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
8066 
8067         /**
8068          * Persisted playback time after a user confirmation of an unsafe volume level.
8069          *
8070          * @hide
8071          */
8072         public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
8073 
8074         /**
8075          * Indicates whether notification display on the lock screen is enabled.
8076          * <p>
8077          * Type: int (0 for false, 1 for true)
8078          *
8079          * @hide
8080          */
8081         @SystemApi
8082         public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
8083                 "lock_screen_show_notifications";
8084 
8085         /**
8086          * Indicates whether the lock screen should display silent notifications.
8087          * <p>
8088          * Type: int (0 for false, 1 for true)
8089          *
8090          * @hide
8091          */
8092         public static final String LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS =
8093                 "lock_screen_show_silent_notifications";
8094 
8095         /**
8096          * Indicates whether snooze options should be shown on notifications
8097          * <p>
8098          * Type: int (0 for false, 1 for true)
8099          *
8100          * @hide
8101          */
8102         public static final String SHOW_NOTIFICATION_SNOOZE = "show_notification_snooze";
8103 
8104         /**
8105          * List of TV inputs that are currently hidden. This is a string
8106          * containing the IDs of all hidden TV inputs. Each ID is encoded by
8107          * {@link android.net.Uri#encode(String)} and separated by ':'.
8108          * @hide
8109          */
8110         public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
8111 
8112         /**
8113          * List of custom TV input labels. This is a string containing <TV input id, custom name>
8114          * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
8115          * and separated by ','. Each pair is separated by ':'.
8116          * @hide
8117          */
8118         public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
8119 
8120         /**
8121          * Whether TV app uses non-system inputs.
8122          *
8123          * <p>
8124          * The value is boolean (1 or 0), where 1 means non-system TV inputs are allowed,
8125          * and 0 means non-system TV inputs are not allowed.
8126          *
8127          * <p>
8128          * Devices such as sound bars may have changed the system property allow_third_party_inputs
8129          * to false so the TV Application only uses HDMI and other built in inputs. This setting
8130          * allows user to override the default and have the TV Application use third party TV inputs
8131          * available on play store.
8132          *
8133          * @hide
8134          */
8135         public static final String TV_APP_USES_NON_SYSTEM_INPUTS = "tv_app_uses_non_system_inputs";
8136 
8137         /**
8138          * Whether automatic routing of system audio to USB audio peripheral is disabled.
8139          * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
8140          * and 0 means automatic routing is enabled.
8141          *
8142          * @hide
8143          */
8144         public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
8145                 "usb_audio_automatic_routing_disabled";
8146 
8147         /**
8148          * The timeout in milliseconds before the device fully goes to sleep after
8149          * a period of inactivity.  This value sets an upper bound on how long the device
8150          * will stay awake or dreaming without user activity.  It should generally
8151          * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
8152          * will sleep before it ever has a chance to dream.
8153          * <p>
8154          * Use -1 to disable this timeout.
8155          * </p>
8156          *
8157          * @hide
8158          */
8159         public static final String SLEEP_TIMEOUT = "sleep_timeout";
8160 
8161         /**
8162          * Controls whether double tap to wake is enabled.
8163          * @hide
8164          */
8165         public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
8166 
8167         private static final Validator DOUBLE_TAP_TO_WAKE_VALIDATOR = BOOLEAN_VALIDATOR;
8168 
8169         /**
8170          * The current assistant component. It could be a voice interaction service,
8171          * or an activity that handles ACTION_ASSIST, or empty which means using the default
8172          * handling.
8173          *
8174          * <p>This should be set indirectly by setting the {@link
8175          * android.app.role.RoleManager#ROLE_ASSISTANT assistant role}.
8176          *
8177          * @hide
8178          */
8179         @UnsupportedAppUsage
8180         public static final String ASSISTANT = "assistant";
8181 
8182         /**
8183          * Whether the camera launch gesture should be disabled.
8184          *
8185          * @hide
8186          */
8187         public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled";
8188 
8189         private static final Validator CAMERA_GESTURE_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8190 
8191         /**
8192          * Whether the camera launch gesture to double tap the power button when the screen is off
8193          * should be disabled.
8194          *
8195          * @hide
8196          */
8197         public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED =
8198                 "camera_double_tap_power_gesture_disabled";
8199 
8200         private static final Validator CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR =
8201                 BOOLEAN_VALIDATOR;
8202 
8203         /**
8204          * Whether the camera double twist gesture to flip between front and back mode should be
8205          * enabled.
8206          *
8207          * @hide
8208          */
8209         public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED =
8210                 "camera_double_twist_to_flip_enabled";
8211 
8212         private static final Validator CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR =
8213                 BOOLEAN_VALIDATOR;
8214 
8215         /**
8216          * Whether or not the smart camera lift trigger that launches the camera when the user moves
8217          * the phone into a position for taking photos should be enabled.
8218          *
8219          * @hide
8220          */
8221         public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled";
8222 
8223         /**
8224          * The default enable state of the camera lift trigger.
8225          *
8226          * @hide
8227          */
8228         public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1;
8229 
8230         /**
8231          * Whether or not the flashlight (camera torch mode) is available required to turn
8232          * on flashlight.
8233          *
8234          * @hide
8235          */
8236         public static final String FLASHLIGHT_AVAILABLE = "flashlight_available";
8237 
8238         /**
8239          * Whether or not flashlight is enabled.
8240          *
8241          * @hide
8242          */
8243         public static final String FLASHLIGHT_ENABLED = "flashlight_enabled";
8244 
8245         /**
8246          * Whether or not face unlock is allowed on Keyguard.
8247          * @hide
8248          */
8249         public static final String FACE_UNLOCK_KEYGUARD_ENABLED = "face_unlock_keyguard_enabled";
8250 
8251         private static final Validator FACE_UNLOCK_KEYGUARD_ENABLED_VALIDATOR =
8252                 BOOLEAN_VALIDATOR;
8253 
8254         /**
8255          * Whether or not face unlock dismisses the keyguard.
8256          * @hide
8257          */
8258         public static final String FACE_UNLOCK_DISMISSES_KEYGUARD =
8259                 "face_unlock_dismisses_keyguard";
8260 
8261         private static final Validator FACE_UNLOCK_DISMISSES_KEYGUARD_VALIDATOR =
8262                 BOOLEAN_VALIDATOR;
8263 
8264         /**
8265          * Whether or not face unlock requires attention. This is a cached value, the source of
8266          * truth is obtained through the HAL.
8267          * @hide
8268          */
8269         public static final String FACE_UNLOCK_ATTENTION_REQUIRED =
8270                 "face_unlock_attention_required";
8271 
8272         /**
8273          * Whether or not face unlock requires a diverse set of poses during enrollment. This is a
8274          * cached value, the source of truth is obtained through the HAL.
8275          * @hide
8276          */
8277         public static final String FACE_UNLOCK_DIVERSITY_REQUIRED =
8278                 "face_unlock_diversity_required";
8279 
8280 
8281         /**
8282          * Whether or not face unlock is allowed for apps (through BiometricPrompt).
8283          * @hide
8284          */
8285         public static final String FACE_UNLOCK_APP_ENABLED = "face_unlock_app_enabled";
8286 
8287         private static final Validator FACE_UNLOCK_APP_ENABLED_VALIDATOR =
8288                 BOOLEAN_VALIDATOR;
8289 
8290         /**
8291          * Whether or not face unlock always requires user confirmation, meaning {@link
8292          * android.hardware.biometrics.BiometricPrompt.Builder#setConfirmationRequired(boolean)}
8293          * is always 'true'. This overrides the behavior that apps choose in the
8294          * setConfirmationRequired API.
8295          * @hide
8296          */
8297         public static final String FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION =
8298                 "face_unlock_always_require_confirmation";
8299 
8300         private static final Validator FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION_VALIDATOR =
8301                 BOOLEAN_VALIDATOR;
8302 
8303         /**
8304          * Whether or not the face unlock education screen has been shown to the user.
8305          * @hide
8306          */
8307         public static final String FACE_UNLOCK_EDUCATION_INFO_DISPLAYED =
8308                 "face_unlock_education_info_displayed";
8309 
8310         private static final Validator FACE_UNLOCK_EDUCATION_INFO_DISPLAYED_VALIDATOR =
8311                 BOOLEAN_VALIDATOR;
8312 
8313         /**
8314          * Whether or not debugging is enabled.
8315          * @hide
8316          */
8317         public static final String BIOMETRIC_DEBUG_ENABLED =
8318                 "biometric_debug_enabled";
8319 
8320         /**
8321          * Whether the assist gesture should be enabled.
8322          *
8323          * @hide
8324          */
8325         public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled";
8326 
8327         private static final Validator ASSIST_GESTURE_ENABLED_VALIDATOR =
8328                 BOOLEAN_VALIDATOR;
8329 
8330         /**
8331          * Sensitivity control for the assist gesture.
8332          *
8333          * @hide
8334          */
8335         public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity";
8336 
8337         /**
8338          * Whether the assist gesture should silence alerts.
8339          *
8340          * @hide
8341          */
8342         public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED =
8343                 "assist_gesture_silence_alerts_enabled";
8344 
8345         private static final Validator ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR =
8346                 BOOLEAN_VALIDATOR;
8347 
8348         /**
8349          * Whether the assist gesture should wake the phone.
8350          *
8351          * @hide
8352          */
8353         public static final String ASSIST_GESTURE_WAKE_ENABLED =
8354                 "assist_gesture_wake_enabled";
8355 
8356         private static final Validator ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR =
8357                 BOOLEAN_VALIDATOR;
8358 
8359         /**
8360          * Indicates whether the Assist Gesture Deferred Setup has been completed.
8361          * <p>
8362          * Type: int (0 for false, 1 for true)
8363          *
8364          * @hide
8365          */
8366         @SystemApi
8367         public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
8368 
8369         /**
8370          * Control whether Trust Agents are in active unlock or extend unlock mode.
8371          * @hide
8372          */
8373         public static final String TRUST_AGENTS_EXTEND_UNLOCK = "trust_agents_extend_unlock";
8374 
8375         private static final Validator TRUST_AGENTS_EXTEND_UNLOCK_VALIDATOR =
8376                 BOOLEAN_VALIDATOR;
8377 
8378         /**
8379          * Control whether the screen locks when trust is lost.
8380          * @hide
8381          */
8382         public static final String LOCK_SCREEN_WHEN_TRUST_LOST = "lock_screen_when_trust_lost";
8383 
8384         private static final Validator LOCK_SCREEN_WHEN_TRUST_LOST_VALIDATOR =
8385                 BOOLEAN_VALIDATOR;
8386 
8387         /**
8388          * Control whether Night display is currently activated.
8389          * @hide
8390          */
8391         public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated";
8392 
8393         /**
8394          * Control whether Night display will automatically activate/deactivate.
8395          * @hide
8396          */
8397         public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode";
8398 
8399         private static final Validator NIGHT_DISPLAY_AUTO_MODE_VALIDATOR =
8400                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 2);
8401 
8402         /**
8403          * Control the color temperature of Night Display, represented in Kelvin.
8404          * @hide
8405          */
8406         public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE =
8407                 "night_display_color_temperature";
8408 
8409         private static final Validator NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR =
8410                 NON_NEGATIVE_INTEGER_VALIDATOR;
8411 
8412         /**
8413          * Custom time when Night display is scheduled to activate.
8414          * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
8415          * @hide
8416          */
8417         public static final String NIGHT_DISPLAY_CUSTOM_START_TIME =
8418                 "night_display_custom_start_time";
8419 
8420         private static final Validator NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR =
8421                 NON_NEGATIVE_INTEGER_VALIDATOR;
8422 
8423         /**
8424          * Custom time when Night display is scheduled to deactivate.
8425          * Represented as milliseconds from midnight (e.g. 21600000 == 6am).
8426          * @hide
8427          */
8428         public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time";
8429 
8430         private static final Validator NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR =
8431                 NON_NEGATIVE_INTEGER_VALIDATOR;
8432 
8433         /**
8434          * A String representing the LocalDateTime when Night display was last activated. Use to
8435          * decide whether to apply the current activated state after a reboot or user change. In
8436          * legacy cases, this is represented by the time in milliseconds (since epoch).
8437          * @hide
8438          */
8439         public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME =
8440                 "night_display_last_activated_time";
8441 
8442         /**
8443          * Control whether display white balance is currently enabled.
8444          * @hide
8445          */
8446         public static final String DISPLAY_WHITE_BALANCE_ENABLED = "display_white_balance_enabled";
8447 
8448         private static final Validator DISPLAY_WHITE_BALANCE_ENABLED_VALIDATOR =
8449                 BOOLEAN_VALIDATOR;
8450 
8451         /**
8452          * Names of the service components that the current user has explicitly allowed to
8453          * be a VR mode listener, separated by ':'.
8454          *
8455          * @hide
8456          */
8457         @TestApi
8458         public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners";
8459 
8460         private static final Validator ENABLED_VR_LISTENERS_VALIDATOR =
8461                 new SettingsValidators.ComponentNameListValidator(":");
8462 
8463         /**
8464          * Behavior of the display while in VR mode.
8465          *
8466          * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}.
8467          *
8468          * @hide
8469          */
8470         public static final String VR_DISPLAY_MODE = "vr_display_mode";
8471 
8472         private static final Validator VR_DISPLAY_MODE_VALIDATOR =
8473                 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1"});
8474 
8475         /**
8476          * Lower the display persistence while the system is in VR mode.
8477          *
8478          * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
8479          *
8480          * @hide.
8481          */
8482         public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0;
8483 
8484         /**
8485          * Do not alter the display persistence while the system is in VR mode.
8486          *
8487          * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
8488          *
8489          * @hide.
8490          */
8491         public static final int VR_DISPLAY_MODE_OFF = 1;
8492 
8493         /**
8494          * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least
8495          * once.
8496          *
8497          * <p>This is used to ensure that we only take one pass which will disable apps that are not
8498          * privileged (if any). From then on, we only want to enable apps (when a matching SIM is
8499          * inserted), to avoid disabling an app that the user might actively be using.
8500          *
8501          * <p>Will be set to 1 once executed.
8502          *
8503          * @hide
8504          */
8505         public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled";
8506 
8507         /**
8508          * Whether parent user can access remote contact in managed profile.
8509          *
8510          * @hide
8511          */
8512         public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH =
8513                 "managed_profile_contact_remote_search";
8514 
8515         /**
8516          * Whether parent profile can access remote calendar data in managed profile.
8517          *
8518          * @hide
8519          */
8520         public static final String CROSS_PROFILE_CALENDAR_ENABLED =
8521                 "cross_profile_calendar_enabled";
8522 
8523         /**
8524          * Whether or not the automatic storage manager is enabled and should run on the device.
8525          *
8526          * @hide
8527          */
8528         public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED =
8529                 "automatic_storage_manager_enabled";
8530 
8531         /**
8532          * How many days of information for the automatic storage manager to retain on the device.
8533          *
8534          * @hide
8535          */
8536         public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN =
8537                 "automatic_storage_manager_days_to_retain";
8538 
8539         private static final Validator AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR =
8540                 NON_NEGATIVE_INTEGER_VALIDATOR;
8541 
8542         /**
8543          * Default number of days of information for the automatic storage manager to retain.
8544          *
8545          * @hide
8546          */
8547         public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90;
8548 
8549         /**
8550          * How many bytes the automatic storage manager has cleared out.
8551          *
8552          * @hide
8553          */
8554         public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED =
8555                 "automatic_storage_manager_bytes_cleared";
8556 
8557 
8558         /**
8559          * Last run time for the automatic storage manager.
8560          *
8561          * @hide
8562          */
8563         public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN =
8564                 "automatic_storage_manager_last_run";
8565 
8566         /**
8567          * If the automatic storage manager has been disabled by policy. Note that this doesn't
8568          * mean that the automatic storage manager is prevented from being re-enabled -- this only
8569          * means that it was turned off by policy at least once.
8570          *
8571          * @hide
8572          */
8573         public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY =
8574                 "automatic_storage_manager_turned_off_by_policy";
8575 
8576         /**
8577          * Whether SystemUI navigation keys is enabled.
8578          * @hide
8579          */
8580         public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
8581                 "system_navigation_keys_enabled";
8582 
8583         private static final Validator SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8584 
8585         /**
8586          * Holds comma separated list of ordering of QS tiles.
8587          * @hide
8588          */
8589         public static final String QS_TILES = "sysui_qs_tiles";
8590 
8591         private static final Validator QS_TILES_VALIDATOR = new Validator() {
8592             @Override
8593             public boolean validate(@Nullable String value) {
8594                 if (value == null) {
8595                     return false;
8596                 }
8597                 String[] tiles = value.split(",");
8598                 boolean valid = true;
8599                 for (String tile : tiles) {
8600                     // tile can be any non-empty string as specified by OEM
8601                     valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile));
8602                 }
8603                 return valid;
8604             }
8605         };
8606 
8607         /**
8608          * Specifies whether the web action API is enabled.
8609          *
8610          * @hide
8611          */
8612         @SystemApi
8613         public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled";
8614 
8615         /**
8616          * Has this pairable device been paired or upgraded from a previously paired system.
8617          * @hide
8618          */
8619         public static final String DEVICE_PAIRED = "device_paired";
8620 
8621         /**
8622          * Integer state indicating whether package verifier is enabled.
8623          * TODO(b/34259924): Remove this setting.
8624          *
8625          * @hide
8626          */
8627         public static final String PACKAGE_VERIFIER_STATE = "package_verifier_state";
8628 
8629         /**
8630          * Specifies additional package name for broadcasting the CMAS messages.
8631          * @hide
8632          */
8633         public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg";
8634 
8635         /**
8636          * Whether the launcher should show any notification badges.
8637          * The value is boolean (1 or 0).
8638          * @hide
8639          */
8640         @TestApi
8641         public static final String NOTIFICATION_BADGING = "notification_badging";
8642 
8643         private static final Validator NOTIFICATION_BADGING_VALIDATOR = BOOLEAN_VALIDATOR;
8644 
8645         /**
8646          * Whether the notification bubbles are globally enabled
8647          * The value is boolean (1 or 0).
8648          * @hide
8649          */
8650         @TestApi
8651         public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
8652 
8653         private static final Validator NOTIFICATION_BUBBLES_VALIDATOR = BOOLEAN_VALIDATOR;
8654 
8655         /**
8656          * Whether notifications are dismissed by a right-to-left swipe (instead of a left-to-right
8657          * swipe).
8658          *
8659          * @hide
8660          */
8661         public static final String NOTIFICATION_DISMISS_RTL = "notification_dismiss_rtl";
8662 
8663         private static final Validator NOTIFICATION_DISMISS_RTL_VALIDATOR = BOOLEAN_VALIDATOR;
8664 
8665         /**
8666          * Comma separated list of QS tiles that have been auto-added already.
8667          * @hide
8668          */
8669         public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles";
8670 
8671         private static final Validator QS_AUTO_ADDED_TILES_VALIDATOR = new Validator() {
8672             @Override
8673             public boolean validate(@Nullable String value) {
8674                 if (value == null) {
8675                     return false;
8676                 }
8677                 String[] tiles = value.split(",");
8678                 boolean valid = true;
8679                 for (String tile : tiles) {
8680                     // tile can be any non-empty string as specified by OEM
8681                     valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile));
8682                 }
8683                 return valid;
8684             }
8685         };
8686 
8687         /**
8688          * Whether the Lockdown button should be shown in the power menu.
8689          * @hide
8690          */
8691         public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu";
8692 
8693         private static final Validator LOCKDOWN_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR;
8694 
8695         /**
8696          * Backup manager behavioral parameters.
8697          * This is encoded as a key=value list, separated by commas. Ex:
8698          *
8699          * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true"
8700          *
8701          * The following keys are supported:
8702          *
8703          * <pre>
8704          * key_value_backup_interval_milliseconds  (long)
8705          * key_value_backup_fuzz_milliseconds      (long)
8706          * key_value_backup_require_charging       (boolean)
8707          * key_value_backup_required_network_type  (int)
8708          * full_backup_interval_milliseconds       (long)
8709          * full_backup_require_charging            (boolean)
8710          * full_backup_required_network_type       (int)
8711          * backup_finished_notification_receivers  (String[])
8712          * </pre>
8713          *
8714          * backup_finished_notification_receivers uses ":" as delimeter for values.
8715          *
8716          * <p>
8717          * Type: string
8718          * @hide
8719          */
8720         public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants";
8721 
8722 
8723         /**
8724          * Local transport parameters so we can configure it for tests.
8725          * This is encoded as a key=value list, separated by commas.
8726          *
8727          * The following keys are supported:
8728          *
8729          * <pre>
8730          * fake_encryption_flag  (boolean)
8731          * </pre>
8732          *
8733          * <p>
8734          * Type: string
8735          * @hide
8736          */
8737         public static final String BACKUP_LOCAL_TRANSPORT_PARAMETERS =
8738                 "backup_local_transport_parameters";
8739 
8740         /**
8741          * Flag to set if the system should predictively attempt to re-enable Bluetooth while
8742          * the user is driving.
8743          * @hide
8744          */
8745         public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving";
8746 
8747         /**
8748          * What behavior should be invoked when the volume hush gesture is triggered
8749          * One of VOLUME_HUSH_OFF, VOLUME_HUSH_VIBRATE, VOLUME_HUSH_MUTE.
8750          *
8751          * @hide
8752          */
8753         @SystemApi
8754         public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture";
8755 
8756         /** @hide */
8757         @SystemApi
8758         public static final int VOLUME_HUSH_OFF = 0;
8759         /** @hide */
8760         @SystemApi
8761         public static final int VOLUME_HUSH_VIBRATE = 1;
8762         /** @hide */
8763         @SystemApi
8764         public static final int VOLUME_HUSH_MUTE = 2;
8765 
8766         private static final Validator VOLUME_HUSH_GESTURE_VALIDATOR =
8767                 NON_NEGATIVE_INTEGER_VALIDATOR;
8768 
8769         /**
8770          * The number of times (integer) the user has manually enabled battery saver.
8771          * @hide
8772          */
8773         public static final String LOW_POWER_MANUAL_ACTIVATION_COUNT =
8774                 "low_power_manual_activation_count";
8775 
8776         /**
8777          * Whether the "first time battery saver warning" dialog needs to be shown (0: default)
8778          * or not (1).
8779          *
8780          * @hide
8781          */
8782         public static final String LOW_POWER_WARNING_ACKNOWLEDGED =
8783                 "low_power_warning_acknowledged";
8784 
8785         /**
8786          * 0 (default) Auto battery saver suggestion has not been suppressed. 1) it has been
8787          * suppressed.
8788          * @hide
8789          */
8790         public static final String SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION =
8791                 "suppress_auto_battery_saver_suggestion";
8792 
8793         /**
8794          * List of packages, which data need to be unconditionally cleared before full restore.
8795          * Type: string
8796          * @hide
8797          */
8798         public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE =
8799                 "packages_to_clear_data_before_full_restore";
8800 
8801         /**
8802          * Setting to determine whether to use the new notification priority handling features.
8803          * @hide
8804          */
8805         public static final String NOTIFICATION_NEW_INTERRUPTION_MODEL = "new_interruption_model";
8806 
8807         /**
8808          * How often to check for location access.
8809          * @hide
8810          */
8811         @SystemApi
8812         @TestApi
8813         public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS =
8814                 "location_access_check_interval_millis";
8815 
8816         /**
8817          * Delay between granting location access and checking it.
8818          * @hide
8819          */
8820         @SystemApi
8821         @TestApi
8822         public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS =
8823                 "location_access_check_delay_millis";
8824 
8825         /**
8826          * What should happen to the location permissions when upgraded to Android Q.
8827          *
8828          * <ul>
8829          *     <li>0/unset == revoke permissions</li>
8830          *     <li>anything else == Don't do anything</li>
8831          * </ul>
8832          *
8833          * @hide
8834          */
8835         @SystemApi
8836         public static final String LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE =
8837                 "location_permissions_upgrade_to_q_mode";
8838 
8839         /**
8840          * Map of android.theme.customization.* categories to the enabled overlay package for that
8841          * category, formatted as a serialized {@link org.json.JSONObject}. If there is no
8842          * corresponding package included for a category, then all overlay packages in that
8843          * category must be disabled.
8844          * @hide
8845          */
8846         @SystemApi
8847         public static final String THEME_CUSTOMIZATION_OVERLAY_PACKAGES =
8848                 "theme_customization_overlay_packages";
8849 
8850         private static final Validator THEME_CUSTOMIZATION_OVERLAY_PACKAGES_VALIDATOR =
8851                 SettingsValidators.JSON_OBJECT_VALIDATOR;
8852 
8853         /**
8854          * Navigation bar mode.
8855          *  0 = 3 button
8856          *  1 = 2 button
8857          *  2 = fully gestural
8858          * @hide
8859          */
8860         public static final String NAVIGATION_MODE =
8861                 "navigation_mode";
8862         private static final Validator NAVIGATION_MODE_VALIDATOR =
8863                 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"});
8864 
8865         /**
8866          * Controls whether aware is enabled.
8867          * @hide
8868          */
8869         public static final String AWARE_ENABLED = "aware_enabled";
8870 
8871         private static final Validator AWARE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8872 
8873         /**
8874          * Controls whether aware_lock is enabled.
8875          * @hide
8876          */
8877         public static final String AWARE_LOCK_ENABLED = "aware_lock_enabled";
8878 
8879         private static final Validator AWARE_LOCK_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
8880 
8881         /**
8882          * This are the settings to be backed up.
8883          *
8884          * NOTE: Settings are backed up and restored in the order they appear
8885          *       in this array. If you have one setting depending on another,
8886          *       make sure that they are ordered appropriately.
8887          *
8888          * @hide
8889          */
8890         @UnsupportedAppUsage
8891         public static final String[] SETTINGS_TO_BACKUP = {
8892             BUGREPORT_IN_POWER_MENU,                            // moved to global
8893             ALLOW_MOCK_LOCATION,
8894             USB_MASS_STORAGE_ENABLED,                           // moved to global
8895             ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
8896             ACCESSIBILITY_DISPLAY_DALTONIZER,
8897             ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
8898             ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
8899             ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED,
8900             AUTOFILL_SERVICE,
8901             ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
8902             ENABLED_ACCESSIBILITY_SERVICES,
8903             ENABLED_VR_LISTENERS,
8904             TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
8905             TOUCH_EXPLORATION_ENABLED,
8906             ACCESSIBILITY_ENABLED,
8907             ACCESSIBILITY_SHORTCUT_TARGET_SERVICE,
8908             ACCESSIBILITY_BUTTON_TARGET_COMPONENT,
8909             ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN,
8910             ACCESSIBILITY_SHORTCUT_ENABLED,
8911             ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN,
8912             ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
8913             ACCESSIBILITY_CAPTIONING_PRESET,
8914             ACCESSIBILITY_CAPTIONING_ENABLED,
8915             ACCESSIBILITY_CAPTIONING_LOCALE,
8916             ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
8917             ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
8918             ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
8919             ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
8920             ACCESSIBILITY_CAPTIONING_TYPEFACE,
8921             ACCESSIBILITY_CAPTIONING_FONT_SCALE,
8922             ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
8923             TTS_DEFAULT_RATE,
8924             TTS_DEFAULT_PITCH,
8925             TTS_DEFAULT_SYNTH,
8926             TTS_ENABLED_PLUGINS,
8927             TTS_DEFAULT_LOCALE,
8928             SHOW_IME_WITH_HARD_KEYBOARD,
8929             WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,            // moved to global
8930             WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,               // moved to global
8931             WIFI_NUM_OPEN_NETWORKS_KEPT,                        // moved to global
8932             MOUNT_PLAY_NOTIFICATION_SND,
8933             MOUNT_UMS_AUTOSTART,
8934             MOUNT_UMS_PROMPT,
8935             MOUNT_UMS_NOTIFY_ENABLED,
8936             DOUBLE_TAP_TO_WAKE,
8937             WAKE_GESTURE_ENABLED,
8938             LONG_PRESS_TIMEOUT,
8939             CAMERA_GESTURE_DISABLED,
8940             ACCESSIBILITY_AUTOCLICK_ENABLED,
8941             ACCESSIBILITY_AUTOCLICK_DELAY,
8942             ACCESSIBILITY_LARGE_POINTER_ICON,
8943             PREFERRED_TTY_MODE,
8944             ENHANCED_VOICE_PRIVACY_ENABLED,
8945             TTY_MODE_ENABLED,
8946             RTT_CALLING_MODE,
8947             INCALL_POWER_BUTTON_BEHAVIOR,
8948             NIGHT_DISPLAY_CUSTOM_START_TIME,
8949             NIGHT_DISPLAY_CUSTOM_END_TIME,
8950             NIGHT_DISPLAY_COLOR_TEMPERATURE,
8951             NIGHT_DISPLAY_AUTO_MODE,
8952             DISPLAY_WHITE_BALANCE_ENABLED,
8953             SYNC_PARENT_SOUNDS,
8954             CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
8955             CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
8956             SYSTEM_NAVIGATION_KEYS_ENABLED,
8957             QS_TILES,
8958             DOZE_ENABLED,
8959             DOZE_ALWAYS_ON,
8960             DOZE_PICK_UP_GESTURE,
8961             DOZE_DOUBLE_TAP_GESTURE,
8962             DOZE_TAP_SCREEN_GESTURE,
8963             DOZE_WAKE_SCREEN_GESTURE,
8964             NFC_PAYMENT_DEFAULT_COMPONENT,
8965             AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN,
8966             FACE_UNLOCK_KEYGUARD_ENABLED,
8967             FACE_UNLOCK_DISMISSES_KEYGUARD,
8968             FACE_UNLOCK_APP_ENABLED,
8969             FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION,
8970             ASSIST_GESTURE_ENABLED,
8971             ASSIST_GESTURE_SILENCE_ALERTS_ENABLED,
8972             ASSIST_GESTURE_WAKE_ENABLED,
8973             VR_DISPLAY_MODE,
8974             NOTIFICATION_BADGING,
8975             NOTIFICATION_BUBBLES,
8976             NOTIFICATION_DISMISS_RTL,
8977             QS_AUTO_ADDED_TILES,
8978             SCREENSAVER_ENABLED,
8979             SCREENSAVER_COMPONENTS,
8980             SCREENSAVER_ACTIVATE_ON_DOCK,
8981             SCREENSAVER_ACTIVATE_ON_SLEEP,
8982             LOCKDOWN_IN_POWER_MENU,
8983             SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
8984             VOLUME_HUSH_GESTURE,
8985             MANUAL_RINGER_TOGGLE_COUNT,
8986             HUSH_GESTURE_USED,
8987             IN_CALL_NOTIFICATION_ENABLED,
8988             LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS,
8989             LOCK_SCREEN_CUSTOM_CLOCK_FACE,
8990             LOCK_SCREEN_SHOW_NOTIFICATIONS,
8991             LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS,
8992             SHOW_NOTIFICATION_SNOOZE,
8993             ZEN_DURATION,
8994             SHOW_ZEN_UPGRADE_NOTIFICATION,
8995             SHOW_ZEN_SETTINGS_SUGGESTION,
8996             ZEN_SETTINGS_UPDATED,
8997             ZEN_SETTINGS_SUGGESTION_VIEWED,
8998             CHARGING_SOUNDS_ENABLED,
8999             CHARGING_VIBRATION_ENABLED,
9000             ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS,
9001             ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS,
9002             NOTIFICATION_NEW_INTERRUPTION_MODEL,
9003             TRUST_AGENTS_EXTEND_UNLOCK,
9004             UI_NIGHT_MODE,
9005             LOCK_SCREEN_WHEN_TRUST_LOST,
9006             SKIP_GESTURE,
9007             SILENCE_GESTURE,
9008             THEME_CUSTOMIZATION_OVERLAY_PACKAGES,
9009             NAVIGATION_MODE,
9010             AWARE_ENABLED,
9011             SKIP_GESTURE_COUNT,
9012             SILENCE_ALARMS_GESTURE_COUNT,
9013             SILENCE_NOTIFICATION_GESTURE_COUNT,
9014             SILENCE_CALL_GESTURE_COUNT,
9015             SILENCE_TIMER_GESTURE_COUNT,
9016             DARK_MODE_DIALOG_SEEN,
9017             GLOBAL_ACTIONS_PANEL_ENABLED,
9018             AWARE_LOCK_ENABLED
9019         };
9020 
9021         /**
9022          * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator,
9023          * otherwise they won't be restored.
9024          *
9025          * @hide
9026          */
9027         public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
9028         static {
VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR)9029             VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR);
VALIDATORS.put(ALLOW_MOCK_LOCATION, ALLOW_MOCK_LOCATION_VALIDATOR)9030             VALIDATORS.put(ALLOW_MOCK_LOCATION, ALLOW_MOCK_LOCATION_VALIDATOR);
VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR)9031             VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR)9032             VALIDATORS.put(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
9033                     ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER, ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR)9034             VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER,
9035                     ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR)9036             VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
9037                     ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR)9038             VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
9039                     ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR)9040             VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED,
9041                     ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR);
VALIDATORS.put(AUTOFILL_SERVICE, AUTOFILL_SERVICE_VALIDATOR)9042             VALIDATORS.put(AUTOFILL_SERVICE, AUTOFILL_SERVICE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR)9043             VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
9044                     ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR);
VALIDATORS.put(ENABLED_ACCESSIBILITY_SERVICES, ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR)9045             VALIDATORS.put(ENABLED_ACCESSIBILITY_SERVICES,
9046                     ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR);
VALIDATORS.put(ENABLED_VR_LISTENERS, ENABLED_VR_LISTENERS_VALIDATOR)9047             VALIDATORS.put(ENABLED_VR_LISTENERS, ENABLED_VR_LISTENERS_VALIDATOR);
VALIDATORS.put(TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES, TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR)9048             VALIDATORS.put(TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
9049                     TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR);
VALIDATORS.put(TOUCH_EXPLORATION_ENABLED, TOUCH_EXPLORATION_ENABLED_VALIDATOR)9050             VALIDATORS.put(TOUCH_EXPLORATION_ENABLED, TOUCH_EXPLORATION_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_ENABLED, ACCESSIBILITY_ENABLED_VALIDATOR)9051             VALIDATORS.put(ACCESSIBILITY_ENABLED, ACCESSIBILITY_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR)9052             VALIDATORS.put(ACCESSIBILITY_SHORTCUT_TARGET_SERVICE,
9053                     ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_BUTTON_TARGET_COMPONENT, ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR)9054             VALIDATORS.put(ACCESSIBILITY_BUTTON_TARGET_COMPONENT,
9055                     ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR)9056             VALIDATORS.put(ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN,
9057                     ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ENABLED, ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR)9058             VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ENABLED,
9059                     ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN, ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR)9060             VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN,
9061                     ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR)9062             VALIDATORS.put(ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
9063                     ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_PRESET, ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR)9064             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_PRESET,
9065                     ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_ENABLED, ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR)9066             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_ENABLED,
9067                     ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_LOCALE, ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR)9068             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_LOCALE,
9069                     ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR, ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR)9070             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
9071                     ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR, ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR)9072             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
9073                     ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_TYPE, ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR)9074             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
9075                     ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_COLOR, ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR)9076             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
9077                     ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_TYPEFACE, ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR)9078             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_TYPEFACE,
9079                     ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FONT_SCALE, ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR)9080             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FONT_SCALE,
9081                     ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR)9082             VALIDATORS.put(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
9083                     ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR);
VALIDATORS.put(TTS_DEFAULT_RATE, TTS_DEFAULT_RATE_VALIDATOR)9084             VALIDATORS.put(TTS_DEFAULT_RATE, TTS_DEFAULT_RATE_VALIDATOR);
VALIDATORS.put(TTS_DEFAULT_PITCH, TTS_DEFAULT_PITCH_VALIDATOR)9085             VALIDATORS.put(TTS_DEFAULT_PITCH, TTS_DEFAULT_PITCH_VALIDATOR);
VALIDATORS.put(TTS_DEFAULT_SYNTH, TTS_DEFAULT_SYNTH_VALIDATOR)9086             VALIDATORS.put(TTS_DEFAULT_SYNTH, TTS_DEFAULT_SYNTH_VALIDATOR);
VALIDATORS.put(TTS_ENABLED_PLUGINS, TTS_ENABLED_PLUGINS_VALIDATOR)9087             VALIDATORS.put(TTS_ENABLED_PLUGINS, TTS_ENABLED_PLUGINS_VALIDATOR);
VALIDATORS.put(TTS_DEFAULT_LOCALE, TTS_DEFAULT_LOCALE_VALIDATOR)9088             VALIDATORS.put(TTS_DEFAULT_LOCALE, TTS_DEFAULT_LOCALE_VALIDATOR);
VALIDATORS.put(SHOW_IME_WITH_HARD_KEYBOARD, SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR)9089             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)9090             VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
9091                     WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR)9092             VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
9093                     WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR);
VALIDATORS.put(WIFI_NUM_OPEN_NETWORKS_KEPT, WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR)9094             VALIDATORS.put(WIFI_NUM_OPEN_NETWORKS_KEPT, WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR);
VALIDATORS.put(MOUNT_PLAY_NOTIFICATION_SND, MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR)9095             VALIDATORS.put(MOUNT_PLAY_NOTIFICATION_SND, MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR);
VALIDATORS.put(MOUNT_UMS_AUTOSTART, MOUNT_UMS_AUTOSTART_VALIDATOR)9096             VALIDATORS.put(MOUNT_UMS_AUTOSTART, MOUNT_UMS_AUTOSTART_VALIDATOR);
VALIDATORS.put(MOUNT_UMS_PROMPT, MOUNT_UMS_PROMPT_VALIDATOR)9097             VALIDATORS.put(MOUNT_UMS_PROMPT, MOUNT_UMS_PROMPT_VALIDATOR);
VALIDATORS.put(MOUNT_UMS_NOTIFY_ENABLED, MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR)9098             VALIDATORS.put(MOUNT_UMS_NOTIFY_ENABLED, MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR);
VALIDATORS.put(DOUBLE_TAP_TO_WAKE, DOUBLE_TAP_TO_WAKE_VALIDATOR)9099             VALIDATORS.put(DOUBLE_TAP_TO_WAKE, DOUBLE_TAP_TO_WAKE_VALIDATOR);
VALIDATORS.put(WAKE_GESTURE_ENABLED, WAKE_GESTURE_ENABLED_VALIDATOR)9100             VALIDATORS.put(WAKE_GESTURE_ENABLED, WAKE_GESTURE_ENABLED_VALIDATOR);
VALIDATORS.put(LONG_PRESS_TIMEOUT, LONG_PRESS_TIMEOUT_VALIDATOR)9101             VALIDATORS.put(LONG_PRESS_TIMEOUT, LONG_PRESS_TIMEOUT_VALIDATOR);
VALIDATORS.put(CAMERA_GESTURE_DISABLED, CAMERA_GESTURE_DISABLED_VALIDATOR)9102             VALIDATORS.put(CAMERA_GESTURE_DISABLED, CAMERA_GESTURE_DISABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_ENABLED, ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR)9103             VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_ENABLED,
9104                     ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_DELAY, ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR)9105             VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_DELAY, ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_LARGE_POINTER_ICON, ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR)9106             VALIDATORS.put(ACCESSIBILITY_LARGE_POINTER_ICON,
9107                     ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR);
VALIDATORS.put(PREFERRED_TTY_MODE, PREFERRED_TTY_MODE_VALIDATOR)9108             VALIDATORS.put(PREFERRED_TTY_MODE, PREFERRED_TTY_MODE_VALIDATOR);
VALIDATORS.put(ENHANCED_VOICE_PRIVACY_ENABLED, ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR)9109             VALIDATORS.put(ENHANCED_VOICE_PRIVACY_ENABLED,
9110                     ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR);
VALIDATORS.put(TTY_MODE_ENABLED, TTY_MODE_ENABLED_VALIDATOR)9111             VALIDATORS.put(TTY_MODE_ENABLED, TTY_MODE_ENABLED_VALIDATOR);
VALIDATORS.put(RTT_CALLING_MODE, RTT_CALLING_MODE_VALIDATOR)9112             VALIDATORS.put(RTT_CALLING_MODE, RTT_CALLING_MODE_VALIDATOR);
VALIDATORS.put(INCALL_POWER_BUTTON_BEHAVIOR, INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR)9113             VALIDATORS.put(INCALL_POWER_BUTTON_BEHAVIOR, INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR);
VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_START_TIME, NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR)9114             VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_START_TIME,
9115                     NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR);
VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_END_TIME, NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR)9116             VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_END_TIME, NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR);
VALIDATORS.put(NIGHT_DISPLAY_COLOR_TEMPERATURE, NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR)9117             VALIDATORS.put(NIGHT_DISPLAY_COLOR_TEMPERATURE,
9118                     NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR);
VALIDATORS.put(NIGHT_DISPLAY_AUTO_MODE, NIGHT_DISPLAY_AUTO_MODE_VALIDATOR)9119             VALIDATORS.put(NIGHT_DISPLAY_AUTO_MODE, NIGHT_DISPLAY_AUTO_MODE_VALIDATOR);
VALIDATORS.put(DISPLAY_WHITE_BALANCE_ENABLED, DISPLAY_WHITE_BALANCE_ENABLED_VALIDATOR)9120             VALIDATORS.put(DISPLAY_WHITE_BALANCE_ENABLED, DISPLAY_WHITE_BALANCE_ENABLED_VALIDATOR);
VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR)9121             VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR);
VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR)9122             VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
9123                     CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR);
VALIDATORS.put(CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR)9124             VALIDATORS.put(CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
9125                     CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR);
VALIDATORS.put(SYSTEM_NAVIGATION_KEYS_ENABLED, SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR)9126             VALIDATORS.put(SYSTEM_NAVIGATION_KEYS_ENABLED,
9127                     SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR);
VALIDATORS.put(QS_TILES, QS_TILES_VALIDATOR)9128             VALIDATORS.put(QS_TILES, QS_TILES_VALIDATOR);
VALIDATORS.put(DOZE_ENABLED, DOZE_ENABLED_VALIDATOR)9129             VALIDATORS.put(DOZE_ENABLED, DOZE_ENABLED_VALIDATOR);
VALIDATORS.put(DOZE_ALWAYS_ON, DOZE_ALWAYS_ON_VALIDATOR)9130             VALIDATORS.put(DOZE_ALWAYS_ON, DOZE_ALWAYS_ON_VALIDATOR);
VALIDATORS.put(DOZE_PICK_UP_GESTURE, DOZE_PICK_UP_GESTURE_VALIDATOR)9131             VALIDATORS.put(DOZE_PICK_UP_GESTURE, DOZE_PICK_UP_GESTURE_VALIDATOR);
VALIDATORS.put(DOZE_DOUBLE_TAP_GESTURE, DOZE_DOUBLE_TAP_GESTURE_VALIDATOR)9132             VALIDATORS.put(DOZE_DOUBLE_TAP_GESTURE, DOZE_DOUBLE_TAP_GESTURE_VALIDATOR);
VALIDATORS.put(DOZE_TAP_SCREEN_GESTURE, DOZE_TAP_SCREEN_GESTURE_VALIDATOR)9133             VALIDATORS.put(DOZE_TAP_SCREEN_GESTURE, DOZE_TAP_SCREEN_GESTURE_VALIDATOR);
VALIDATORS.put(DOZE_WAKE_SCREEN_GESTURE, DOZE_WAKE_SCREEN_GESTURE_VALIDATOR)9134             VALIDATORS.put(DOZE_WAKE_SCREEN_GESTURE, DOZE_WAKE_SCREEN_GESTURE_VALIDATOR);
VALIDATORS.put(NFC_PAYMENT_DEFAULT_COMPONENT, NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR)9135             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)9136             VALIDATORS.put(AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN,
9137                     AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR);
VALIDATORS.put(FACE_UNLOCK_KEYGUARD_ENABLED, FACE_UNLOCK_KEYGUARD_ENABLED_VALIDATOR)9138             VALIDATORS.put(FACE_UNLOCK_KEYGUARD_ENABLED, FACE_UNLOCK_KEYGUARD_ENABLED_VALIDATOR);
VALIDATORS.put(FACE_UNLOCK_DISMISSES_KEYGUARD, FACE_UNLOCK_DISMISSES_KEYGUARD_VALIDATOR)9139             VALIDATORS.put(FACE_UNLOCK_DISMISSES_KEYGUARD,
9140                     FACE_UNLOCK_DISMISSES_KEYGUARD_VALIDATOR);
VALIDATORS.put(FACE_UNLOCK_APP_ENABLED, FACE_UNLOCK_APP_ENABLED_VALIDATOR)9141             VALIDATORS.put(FACE_UNLOCK_APP_ENABLED, FACE_UNLOCK_APP_ENABLED_VALIDATOR);
VALIDATORS.put(FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION, FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION_VALIDATOR)9142             VALIDATORS.put(FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION,
9143                     FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION_VALIDATOR);
VALIDATORS.put(FACE_UNLOCK_EDUCATION_INFO_DISPLAYED, FACE_UNLOCK_EDUCATION_INFO_DISPLAYED_VALIDATOR)9144             VALIDATORS.put(FACE_UNLOCK_EDUCATION_INFO_DISPLAYED,
9145                     FACE_UNLOCK_EDUCATION_INFO_DISPLAYED_VALIDATOR);
VALIDATORS.put(ASSIST_GESTURE_ENABLED, ASSIST_GESTURE_ENABLED_VALIDATOR)9146             VALIDATORS.put(ASSIST_GESTURE_ENABLED, ASSIST_GESTURE_ENABLED_VALIDATOR);
VALIDATORS.put(ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR)9147             VALIDATORS.put(ASSIST_GESTURE_SILENCE_ALERTS_ENABLED,
9148                     ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR);
VALIDATORS.put(ASSIST_GESTURE_WAKE_ENABLED, ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR)9149             VALIDATORS.put(ASSIST_GESTURE_WAKE_ENABLED, ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR);
VALIDATORS.put(VR_DISPLAY_MODE, VR_DISPLAY_MODE_VALIDATOR)9150             VALIDATORS.put(VR_DISPLAY_MODE, VR_DISPLAY_MODE_VALIDATOR);
VALIDATORS.put(NOTIFICATION_BADGING, NOTIFICATION_BADGING_VALIDATOR)9151             VALIDATORS.put(NOTIFICATION_BADGING, NOTIFICATION_BADGING_VALIDATOR);
VALIDATORS.put(NOTIFICATION_BUBBLES, NOTIFICATION_BUBBLES_VALIDATOR)9152             VALIDATORS.put(NOTIFICATION_BUBBLES, NOTIFICATION_BUBBLES_VALIDATOR);
VALIDATORS.put(NOTIFICATION_DISMISS_RTL, NOTIFICATION_DISMISS_RTL_VALIDATOR)9153             VALIDATORS.put(NOTIFICATION_DISMISS_RTL, NOTIFICATION_DISMISS_RTL_VALIDATOR);
VALIDATORS.put(QS_AUTO_ADDED_TILES, QS_AUTO_ADDED_TILES_VALIDATOR)9154             VALIDATORS.put(QS_AUTO_ADDED_TILES, QS_AUTO_ADDED_TILES_VALIDATOR);
VALIDATORS.put(SCREENSAVER_ENABLED, SCREENSAVER_ENABLED_VALIDATOR)9155             VALIDATORS.put(SCREENSAVER_ENABLED, SCREENSAVER_ENABLED_VALIDATOR);
VALIDATORS.put(SCREENSAVER_COMPONENTS, SCREENSAVER_COMPONENTS_VALIDATOR)9156             VALIDATORS.put(SCREENSAVER_COMPONENTS, SCREENSAVER_COMPONENTS_VALIDATOR);
VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_DOCK, SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR)9157             VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_DOCK, SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR);
VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_SLEEP, SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR)9158             VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_SLEEP, SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR);
VALIDATORS.put(LOCKDOWN_IN_POWER_MENU, LOCKDOWN_IN_POWER_MENU_VALIDATOR)9159             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)9160             VALIDATORS.put(SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
9161                     SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR);
VALIDATORS.put(VOLUME_HUSH_GESTURE, VOLUME_HUSH_GESTURE_VALIDATOR)9162             VALIDATORS.put(VOLUME_HUSH_GESTURE, VOLUME_HUSH_GESTURE_VALIDATOR);
VALIDATORS.put(ENABLED_NOTIFICATION_LISTENERS, ENABLED_NOTIFICATION_LISTENERS_VALIDATOR)9163             VALIDATORS.put(ENABLED_NOTIFICATION_LISTENERS,
9164                     ENABLED_NOTIFICATION_LISTENERS_VALIDATOR); //legacy restore setting
VALIDATORS.put(ENABLED_NOTIFICATION_ASSISTANT, ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR)9165             VALIDATORS.put(ENABLED_NOTIFICATION_ASSISTANT,
9166                     ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR); //legacy restore setting
VALIDATORS.put(ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES, ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR)9167             VALIDATORS.put(ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES,
9168                     ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR); //legacy restore setting
VALIDATORS.put(HUSH_GESTURE_USED, HUSH_GESTURE_USED_VALIDATOR)9169             VALIDATORS.put(HUSH_GESTURE_USED, HUSH_GESTURE_USED_VALIDATOR);
VALIDATORS.put(MANUAL_RINGER_TOGGLE_COUNT, MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR)9170             VALIDATORS.put(MANUAL_RINGER_TOGGLE_COUNT, MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR);
VALIDATORS.put(IN_CALL_NOTIFICATION_ENABLED, IN_CALL_NOTIFICATION_ENABLED_VALIDATOR)9171             VALIDATORS.put(IN_CALL_NOTIFICATION_ENABLED, IN_CALL_NOTIFICATION_ENABLED_VALIDATOR);
VALIDATORS.put(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, BOOLEAN_VALIDATOR)9172             VALIDATORS.put(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, BOOLEAN_VALIDATOR);
VALIDATORS.put(LOCK_SCREEN_SHOW_NOTIFICATIONS, BOOLEAN_VALIDATOR)9173             VALIDATORS.put(LOCK_SCREEN_SHOW_NOTIFICATIONS, BOOLEAN_VALIDATOR);
VALIDATORS.put(LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, BOOLEAN_VALIDATOR)9174             VALIDATORS.put(LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, BOOLEAN_VALIDATOR);
VALIDATORS.put(SHOW_NOTIFICATION_SNOOZE, BOOLEAN_VALIDATOR)9175             VALIDATORS.put(SHOW_NOTIFICATION_SNOOZE, BOOLEAN_VALIDATOR);
VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR)9176             VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR);
VALIDATORS.put(SHOW_ZEN_UPGRADE_NOTIFICATION, BOOLEAN_VALIDATOR)9177             VALIDATORS.put(SHOW_ZEN_UPGRADE_NOTIFICATION, BOOLEAN_VALIDATOR);
VALIDATORS.put(SHOW_ZEN_SETTINGS_SUGGESTION, BOOLEAN_VALIDATOR)9178             VALIDATORS.put(SHOW_ZEN_SETTINGS_SUGGESTION, BOOLEAN_VALIDATOR);
VALIDATORS.put(ZEN_SETTINGS_UPDATED, BOOLEAN_VALIDATOR)9179             VALIDATORS.put(ZEN_SETTINGS_UPDATED, BOOLEAN_VALIDATOR);
VALIDATORS.put(ZEN_SETTINGS_SUGGESTION_VIEWED, BOOLEAN_VALIDATOR)9180             VALIDATORS.put(ZEN_SETTINGS_SUGGESTION_VIEWED, BOOLEAN_VALIDATOR);
VALIDATORS.put(CHARGING_SOUNDS_ENABLED, BOOLEAN_VALIDATOR)9181             VALIDATORS.put(CHARGING_SOUNDS_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(CHARGING_VIBRATION_ENABLED, BOOLEAN_VALIDATOR)9182             VALIDATORS.put(CHARGING_VIBRATION_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS, NON_NEGATIVE_INTEGER_VALIDATOR)9183             VALIDATORS.put(ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS,
9184                     NON_NEGATIVE_INTEGER_VALIDATOR);
VALIDATORS.put(ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS, NON_NEGATIVE_INTEGER_VALIDATOR)9185             VALIDATORS.put(ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS, NON_NEGATIVE_INTEGER_VALIDATOR);
VALIDATORS.put(USER_SETUP_COMPLETE, BOOLEAN_VALIDATOR)9186             VALIDATORS.put(USER_SETUP_COMPLETE, BOOLEAN_VALIDATOR);
VALIDATORS.put(ASSIST_GESTURE_SETUP_COMPLETE, BOOLEAN_VALIDATOR)9187             VALIDATORS.put(ASSIST_GESTURE_SETUP_COMPLETE, BOOLEAN_VALIDATOR);
VALIDATORS.put(NOTIFICATION_NEW_INTERRUPTION_MODEL, BOOLEAN_VALIDATOR)9188             VALIDATORS.put(NOTIFICATION_NEW_INTERRUPTION_MODEL, BOOLEAN_VALIDATOR);
VALIDATORS.put(TRUST_AGENTS_EXTEND_UNLOCK, TRUST_AGENTS_EXTEND_UNLOCK_VALIDATOR)9189             VALIDATORS.put(TRUST_AGENTS_EXTEND_UNLOCK, TRUST_AGENTS_EXTEND_UNLOCK_VALIDATOR);
VALIDATORS.put(LOCK_SCREEN_CUSTOM_CLOCK_FACE, LOCK_SCREEN_CUSTOM_CLOCK_FACE_VALIDATOR)9190             VALIDATORS.put(LOCK_SCREEN_CUSTOM_CLOCK_FACE, LOCK_SCREEN_CUSTOM_CLOCK_FACE_VALIDATOR);
VALIDATORS.put(LOCK_SCREEN_WHEN_TRUST_LOST, LOCK_SCREEN_WHEN_TRUST_LOST_VALIDATOR)9191             VALIDATORS.put(LOCK_SCREEN_WHEN_TRUST_LOST, LOCK_SCREEN_WHEN_TRUST_LOST_VALIDATOR);
VALIDATORS.put(SKIP_GESTURE, SKIP_GESTURE_VALIDATOR)9192             VALIDATORS.put(SKIP_GESTURE, SKIP_GESTURE_VALIDATOR);
VALIDATORS.put(SILENCE_GESTURE, SILENCE_GESTURE_VALIDATOR)9193             VALIDATORS.put(SILENCE_GESTURE, SILENCE_GESTURE_VALIDATOR);
VALIDATORS.put(THEME_CUSTOMIZATION_OVERLAY_PACKAGES, THEME_CUSTOMIZATION_OVERLAY_PACKAGES_VALIDATOR)9194             VALIDATORS.put(THEME_CUSTOMIZATION_OVERLAY_PACKAGES,
9195                     THEME_CUSTOMIZATION_OVERLAY_PACKAGES_VALIDATOR);
VALIDATORS.put(NAVIGATION_MODE, NAVIGATION_MODE_VALIDATOR)9196             VALIDATORS.put(NAVIGATION_MODE, NAVIGATION_MODE_VALIDATOR);
VALIDATORS.put(AWARE_ENABLED, AWARE_ENABLED_VALIDATOR)9197             VALIDATORS.put(AWARE_ENABLED, AWARE_ENABLED_VALIDATOR);
VALIDATORS.put(SKIP_GESTURE_COUNT, SKIP_GESTURE_COUNT_VALIDATOR)9198             VALIDATORS.put(SKIP_GESTURE_COUNT, SKIP_GESTURE_COUNT_VALIDATOR);
VALIDATORS.put(SILENCE_ALARMS_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR)9199             VALIDATORS.put(SILENCE_ALARMS_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
VALIDATORS.put(SILENCE_TIMER_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR)9200             VALIDATORS.put(SILENCE_TIMER_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
VALIDATORS.put(SILENCE_CALL_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR)9201             VALIDATORS.put(SILENCE_CALL_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
VALIDATORS.put(SILENCE_NOTIFICATION_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR)9202             VALIDATORS.put(SILENCE_NOTIFICATION_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
VALIDATORS.put(ODI_CAPTIONS_ENABLED, ODI_CAPTIONS_ENABLED_VALIDATOR)9203             VALIDATORS.put(ODI_CAPTIONS_ENABLED, ODI_CAPTIONS_ENABLED_VALIDATOR);
VALIDATORS.put(DARK_MODE_DIALOG_SEEN, BOOLEAN_VALIDATOR)9204             VALIDATORS.put(DARK_MODE_DIALOG_SEEN, BOOLEAN_VALIDATOR);
VALIDATORS.put(UI_NIGHT_MODE, UI_NIGHT_MODE_VALIDATOR)9205             VALIDATORS.put(UI_NIGHT_MODE, UI_NIGHT_MODE_VALIDATOR);
VALIDATORS.put(GLOBAL_ACTIONS_PANEL_ENABLED, GLOBAL_ACTIONS_PANEL_ENABLED_VALIDATOR)9206             VALIDATORS.put(GLOBAL_ACTIONS_PANEL_ENABLED, GLOBAL_ACTIONS_PANEL_ENABLED_VALIDATOR);
VALIDATORS.put(AWARE_LOCK_ENABLED, AWARE_LOCK_ENABLED_VALIDATOR)9207             VALIDATORS.put(AWARE_LOCK_ENABLED, AWARE_LOCK_ENABLED_VALIDATOR);
9208         }
9209 
9210         /**
9211          * Keys we no longer back up under the current schema, but want to continue to
9212          * process when restoring historical backup datasets.
9213          *
9214          * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
9215          * otherwise they won't be restored.
9216          *
9217          * @hide
9218          */
9219         public static final String[] LEGACY_RESTORE_SETTINGS = {
9220                 ENABLED_NOTIFICATION_LISTENERS,
9221                 ENABLED_NOTIFICATION_ASSISTANT,
9222                 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES
9223         };
9224 
9225         /**
9226          * These entries are considered common between the personal and the managed profile,
9227          * since the managed profile doesn't get to change them.
9228          */
9229         private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
9230 
9231         static {
9232             CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
9233             CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
9234             CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
9235             CLONE_TO_MANAGED_PROFILE.add(CONTENT_CAPTURE_ENABLED);
9236             CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
9237             CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER);
9238             CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
9239             CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
9240             CLONE_TO_MANAGED_PROFILE.add(SHOW_IME_WITH_HARD_KEYBOARD);
9241             if (!InputMethodSystemProperty.PER_PROFILE_IME_ENABLED) {
9242                 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
9243                 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
9244                 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
9245                 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
9246                 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
9247             }
9248         }
9249 
9250         /** @hide */
getCloneToManagedProfileSettings(Set<String> outKeySet)9251         public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
9252             outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
9253         }
9254 
9255         /**
9256          * Secure settings which can be accessed by instant apps.
9257          * @hide
9258          */
9259         public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
9260         static {
9261             INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES);
9262             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD);
9263             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED);
9264             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED);
9265             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET);
9266             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE);
9267             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR);
9268             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE);
9269             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR);
9270             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR);
9271             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE);
9272             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE);
9273             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR);
9274             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED);
9275             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER);
9276             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY);
9277             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED);
9278             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON);
9279 
9280             INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD);
9281             INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS);
9282 
9283             INSTANT_APP_SETTINGS.add(ANDROID_ID);
9284 
9285             INSTANT_APP_SETTINGS.add(PACKAGE_VERIFIER_USER_CONSENT);
9286             INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION);
9287         }
9288 
9289         /**
9290          * Helper method for determining if a location provider is enabled.
9291          *
9292          * @param cr the content resolver to use
9293          * @param provider the location provider to query
9294          * @return true if the provider is enabled
9295          *
9296          * @deprecated use {@link LocationManager#isProviderEnabled(String)}
9297          */
9298         @Deprecated
isLocationProviderEnabled(ContentResolver cr, String provider)9299         public static boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
9300             String allowedProviders = Settings.Secure.getStringForUser(cr,
9301                     LOCATION_PROVIDERS_ALLOWED, cr.getUserId());
9302             return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
9303         }
9304 
9305         /**
9306          * Thread-safe method for enabling or disabling a single location provider. This will have
9307          * no effect on Android Q and above.
9308          * @param cr the content resolver to use
9309          * @param provider the location provider to enable or disable
9310          * @param enabled true if the provider should be enabled
9311          * @deprecated This API is deprecated
9312          */
9313         @Deprecated
setLocationProviderEnabled(ContentResolver cr, String provider, boolean enabled)9314         public static void setLocationProviderEnabled(ContentResolver cr,
9315                 String provider, boolean enabled) {
9316         }
9317     }
9318 
9319     /**
9320      * Global system settings, containing preferences that always apply identically
9321      * to all defined users.  Applications can read these but are not allowed to write;
9322      * like the "Secure" settings, these are for preferences that the user must
9323      * explicitly modify through the system UI or specialized APIs for those values.
9324      */
9325     public static final class Global extends NameValueTable {
9326         // NOTE: If you add new settings here, be sure to add them to
9327         // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked.
9328 
9329         /**
9330          * The content:// style URL for global secure settings items.  Not public.
9331          */
9332         public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
9333 
9334         /**
9335          * Whether users are allowed to add more users or guest from lockscreen.
9336          * <p>
9337          * Type: int
9338          * @hide
9339          */
9340         public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
9341 
9342         /**
9343          * Whether applying ramping ringer on incoming phone call ringtone.
9344          * <p>1 = apply ramping ringer
9345          * <p>0 = do not apply ramping ringer
9346          */
9347         public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer";
9348 
9349         private static final Validator APPLY_RAMPING_RINGER_VALIDATOR = BOOLEAN_VALIDATOR;
9350 
9351         /**
9352          * Setting whether the global gesture for enabling accessibility is enabled.
9353          * If this gesture is enabled the user will be able to perfrom it to enable
9354          * the accessibility state without visiting the settings app.
9355          *
9356          * @hide
9357          * No longer used. Should be removed once all dependencies have been updated.
9358          */
9359         @UnsupportedAppUsage
9360         public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
9361                 "enable_accessibility_global_gesture_enabled";
9362 
9363         /**
9364          * Whether Airplane Mode is on.
9365          */
9366         public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
9367 
9368         /**
9369          * Whether Theater Mode is on.
9370          * {@hide}
9371          */
9372         @SystemApi
9373         public static final String THEATER_MODE_ON = "theater_mode_on";
9374 
9375         /**
9376          * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
9377          */
9378         public static final String RADIO_BLUETOOTH = "bluetooth";
9379 
9380         /**
9381          * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
9382          */
9383         public static final String RADIO_WIFI = "wifi";
9384 
9385         /**
9386          * {@hide}
9387          */
9388         public static final String RADIO_WIMAX = "wimax";
9389         /**
9390          * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
9391          */
9392         public static final String RADIO_CELL = "cell";
9393 
9394         /**
9395          * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
9396          */
9397         public static final String RADIO_NFC = "nfc";
9398 
9399         /**
9400          * A comma separated list of radios that need to be disabled when airplane mode
9401          * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
9402          * included in the comma separated list.
9403          */
9404         public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
9405 
9406         /**
9407          * A comma separated list of radios that should to be disabled when airplane mode
9408          * is on, but can be manually reenabled by the user.  For example, if RADIO_WIFI is
9409          * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
9410          * will be turned off when entering airplane mode, but the user will be able to reenable
9411          * Wifi in the Settings app.
9412          *
9413          * {@hide}
9414          */
9415         public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
9416 
9417         /**
9418          * An integer representing the Bluetooth Class of Device (CoD).
9419          *
9420          * @hide
9421          */
9422         public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device";
9423 
9424         /**
9425          * A Long representing a bitmap of profiles that should be disabled when bluetooth starts.
9426          * See {@link android.bluetooth.BluetoothProfile}.
9427          * {@hide}
9428          */
9429         public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";
9430 
9431         /**
9432          * A semi-colon separated list of Bluetooth interoperability workarounds.
9433          * Each entry is a partial Bluetooth device address string and an integer representing
9434          * the feature to be disabled, separated by a comma. The integer must correspond
9435          * to a interoperability feature as defined in "interop.h" in /system/bt.
9436          * <p>
9437          * Example: <br/>
9438          *   "00:11:22,0;01:02:03:04,2"
9439          * @hide
9440          */
9441        public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";
9442 
9443         /**
9444          * The policy for deciding when Wi-Fi should go to sleep (which will in
9445          * turn switch to using the mobile data as an Internet connection).
9446          * <p>
9447          * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
9448          * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
9449          * {@link #WIFI_SLEEP_POLICY_NEVER}.
9450          */
9451         public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
9452 
9453         /**
9454          * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
9455          * policy, which is to sleep shortly after the turning off
9456          * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
9457          */
9458         public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
9459 
9460         /**
9461          * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
9462          * the device is on battery, and never go to sleep when the device is
9463          * plugged in.
9464          */
9465         public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
9466 
9467         /**
9468          * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
9469          */
9470         public static final int WIFI_SLEEP_POLICY_NEVER = 2;
9471 
9472         /**
9473          * Value to specify if the user prefers the date, time and time zone
9474          * to be automatically fetched from the network (NITZ). 1=yes, 0=no
9475          */
9476         public static final String AUTO_TIME = "auto_time";
9477 
9478         private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR;
9479 
9480         /**
9481          * Value to specify if the user prefers the time zone
9482          * to be automatically fetched from the network (NITZ). 1=yes, 0=no
9483          */
9484         public static final String AUTO_TIME_ZONE = "auto_time_zone";
9485 
9486         private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR;
9487 
9488         /**
9489          * URI for the car dock "in" event sound.
9490          * @hide
9491          */
9492         public static final String CAR_DOCK_SOUND = "car_dock_sound";
9493 
9494         /**
9495          * URI for the car dock "out" event sound.
9496          * @hide
9497          */
9498         public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
9499 
9500         /**
9501          * URI for the desk dock "in" event sound.
9502          * @hide
9503          */
9504         public static final String DESK_DOCK_SOUND = "desk_dock_sound";
9505 
9506         /**
9507          * URI for the desk dock "out" event sound.
9508          * @hide
9509          */
9510         public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
9511 
9512         /**
9513          * Whether to play a sound for dock events.
9514          * @hide
9515          */
9516         public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
9517 
9518         private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9519 
9520         /**
9521          * Whether to play a sound for dock events, only when an accessibility service is on.
9522          * @hide
9523          */
9524         public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility";
9525 
9526         /**
9527          * URI for the "device locked" (keyguard shown) sound.
9528          * @hide
9529          */
9530         public static final String LOCK_SOUND = "lock_sound";
9531 
9532         /**
9533          * URI for the "device unlocked" sound.
9534          * @hide
9535          */
9536         public static final String UNLOCK_SOUND = "unlock_sound";
9537 
9538         /**
9539          * URI for the "device is trusted" sound, which is played when the device enters the trusted
9540          * state without unlocking.
9541          * @hide
9542          */
9543         public static final String TRUSTED_SOUND = "trusted_sound";
9544 
9545         /**
9546          * URI for the low battery sound file.
9547          * @hide
9548          */
9549         public static final String LOW_BATTERY_SOUND = "low_battery_sound";
9550 
9551         /**
9552          * Whether to play a sound for low-battery alerts.
9553          * @hide
9554          */
9555         public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
9556 
9557         private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9558 
9559         /**
9560          * URI for the "wireless charging started" and "wired charging started" sound.
9561          * @hide
9562          */
9563         public static final String CHARGING_STARTED_SOUND =
9564                 "wireless_charging_started_sound";
9565 
9566         /**
9567          * Whether to play a sound for charging events.
9568          * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_SOUNDS_ENABLED} instead
9569          * @hide
9570          */
9571         @Deprecated
9572         public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
9573 
9574         private static final Validator CHARGING_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9575 
9576         /**
9577          * Whether to vibrate for wireless charging events.
9578          * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_VIBRATION_ENABLED}
9579          * @hide
9580          */
9581         @Deprecated
9582         public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled";
9583 
9584         private static final Validator CHARGING_VIBRATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
9585 
9586         /**
9587          * Whether we keep the device on while the device is plugged in.
9588          * Supported values are:
9589          * <ul>
9590          * <li>{@code 0} to never stay on while plugged in</li>
9591          * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
9592          * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
9593          * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
9594          * </ul>
9595          * These values can be OR-ed together.
9596          */
9597         public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
9598 
9599         private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() {
9600             @Override
9601             public boolean validate(@Nullable String value) {
9602                 try {
9603                     int val = Integer.parseInt(value);
9604                     return (val == 0)
9605                             || (val == BatteryManager.BATTERY_PLUGGED_AC)
9606                             || (val == BatteryManager.BATTERY_PLUGGED_USB)
9607                             || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS)
9608                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
9609                                     | BatteryManager.BATTERY_PLUGGED_USB))
9610                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
9611                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS))
9612                             || (val == (BatteryManager.BATTERY_PLUGGED_USB
9613                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS))
9614                             || (val == (BatteryManager.BATTERY_PLUGGED_AC
9615                                     | BatteryManager.BATTERY_PLUGGED_USB
9616                                     | BatteryManager.BATTERY_PLUGGED_WIRELESS));
9617                 } catch (NumberFormatException e) {
9618                     return false;
9619                 }
9620             }
9621         };
9622 
9623         /**
9624          * When the user has enable the option to have a "bug report" command
9625          * in the power menu.
9626          * @hide
9627          */
9628         public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
9629 
9630         private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR;
9631 
9632         /**
9633          * Whether ADB is enabled.
9634          */
9635         public static final String ADB_ENABLED = "adb_enabled";
9636 
9637         /**
9638          * Whether Views are allowed to save their attribute data.
9639          * @hide
9640          */
9641         public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
9642 
9643         /**
9644          * Which application package is allowed to save View attribute data.
9645          * @hide
9646          */
9647         public static final String DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE =
9648                 "debug_view_attributes_application_package";
9649 
9650         /**
9651          * Whether assisted GPS should be enabled or not.
9652          * @hide
9653          */
9654         public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
9655 
9656         /**
9657          * Whether bluetooth is enabled/disabled
9658          * 0=disabled. 1=enabled.
9659          */
9660         public static final String BLUETOOTH_ON = "bluetooth_on";
9661 
9662         private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR;
9663 
9664         /**
9665          * CDMA Cell Broadcast SMS
9666          *                            0 = CDMA Cell Broadcast SMS disabled
9667          *                            1 = CDMA Cell Broadcast SMS enabled
9668          * @hide
9669          */
9670         public static final String CDMA_CELL_BROADCAST_SMS =
9671                 "cdma_cell_broadcast_sms";
9672 
9673         /**
9674          * The CDMA roaming mode 0 = Home Networks, CDMA default
9675          *                       1 = Roaming on Affiliated networks
9676          *                       2 = Roaming on any networks
9677          * @hide
9678          */
9679         public static final String CDMA_ROAMING_MODE = "roaming_settings";
9680 
9681         /**
9682          * The CDMA subscription mode 0 = RUIM/SIM (default)
9683          *                                1 = NV
9684          * @hide
9685          */
9686         public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
9687 
9688         /**
9689          * The default value for whether background data is enabled or not.
9690          *
9691          * Used by {@code NetworkPolicyManagerService}.
9692          *
9693          * @hide
9694          */
9695         public static final String DEFAULT_RESTRICT_BACKGROUND_DATA =
9696                 "default_restrict_background_data";
9697 
9698         /** Inactivity timeout to track mobile data activity.
9699         *
9700         * If set to a positive integer, it indicates the inactivity timeout value in seconds to
9701         * infer the data activity of mobile network. After a period of no activity on mobile
9702         * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
9703         * intent is fired to indicate a transition of network status from "active" to "idle". Any
9704         * subsequent activity on mobile networks triggers the firing of {@code
9705         * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
9706         *
9707         * Network activity refers to transmitting or receiving data on the network interfaces.
9708         *
9709         * Tracking is disabled if set to zero or negative value.
9710         *
9711         * @hide
9712         */
9713        public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
9714 
9715        /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
9716         * but for Wifi network.
9717         * @hide
9718         */
9719        public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
9720 
9721        /**
9722         * Whether or not data roaming is enabled. (0 = false, 1 = true)
9723         */
9724        public static final String DATA_ROAMING = "data_roaming";
9725 
9726        /**
9727         * The value passed to a Mobile DataConnection via bringUp which defines the
9728         * number of retries to preform when setting up the initial connection. The default
9729         * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
9730         * @hide
9731         */
9732        public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
9733 
9734        /**
9735         * Whether any package can be on external storage. When this is true, any
9736         * package, regardless of manifest values, is a candidate for installing
9737         * or moving onto external storage. (0 = false, 1 = true)
9738         * @hide
9739         */
9740        public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external";
9741 
9742         /**
9743          * The default SM-DP+ configured for this device.
9744          *
9745          * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to
9746          * download profiles. If this value is set, the LPA will query this server for any profiles
9747          * available to this device. If any are available, they may be downloaded during device
9748          * provisioning or in settings without needing the user to enter an activation code.
9749          *
9750          * @see android.service.euicc.EuiccService
9751          * @hide
9752          */
9753         @SystemApi
9754         public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
9755 
9756         /**
9757          * Whether any profile has ever been downloaded onto a eUICC on the device.
9758          *
9759          * <p>Used to hide eUICC UI from users who have never made use of it and would only be
9760          * confused by seeing references to it in settings.
9761          * (0 = false, 1 = true)
9762          * @hide
9763          */
9764         @SystemApi
9765         public static final String EUICC_PROVISIONED = "euicc_provisioned";
9766 
9767         /**
9768          * List of ISO country codes in which eUICC UI is shown. Country codes should be separated
9769          * by comma.
9770          *
9771          * <p>Used to hide eUICC UI from users who are currently in countries no carriers support
9772          * eUICC.
9773          * @hide
9774          */
9775         //TODO(b/77914569) Changes this to System Api.
9776         public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries";
9777 
9778         /**
9779          * Whether any activity can be resized. When this is true, any
9780          * activity, regardless of manifest values, can be resized for multi-window.
9781          * (0 = false, 1 = true)
9782          * @hide
9783          */
9784         public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES
9785                 = "force_resizable_activities";
9786 
9787         /**
9788          * Whether to enable experimental freeform support for windows.
9789          * @hide
9790          */
9791         public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT
9792                 = "enable_freeform_support";
9793 
9794         /**
9795          * Whether to enable experimental desktop mode on secondary displays.
9796          * @hide
9797          */
9798         public static final String DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS =
9799                 "force_desktop_mode_on_external_displays";
9800 
9801        /**
9802         * Whether user has enabled development settings.
9803         */
9804        public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
9805 
9806        /**
9807         * Whether the device has been provisioned (0 = false, 1 = true).
9808         * <p>On a multiuser device with a separate system user, the screen may be locked
9809         * as soon as this is set to true and further activities cannot be launched on the
9810         * system user unless they are marked to show over keyguard.
9811         */
9812        public static final String DEVICE_PROVISIONED = "device_provisioned";
9813 
9814         /**
9815          * Indicates whether mobile data should be allowed while the device is being provisioned.
9816          * This allows the provisioning process to turn off mobile data before the user
9817          * has an opportunity to set things up, preventing other processes from burning
9818          * precious bytes before wifi is setup.
9819          * <p>
9820          * Type: int (0 for false, 1 for true)
9821          *
9822          * @hide
9823          */
9824         @SystemApi
9825         public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED =
9826                 "device_provisioning_mobile_data";
9827 
9828        /**
9829         * The saved value for WindowManagerService.setForcedDisplaySize().
9830         * Two integers separated by a comma.  If unset, then use the real display size.
9831         * @hide
9832         */
9833        public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
9834 
9835        /**
9836         * The saved value for WindowManagerService.setForcedDisplayScalingMode().
9837         * 0 or unset if scaling is automatic, 1 if scaling is disabled.
9838         * @hide
9839         */
9840        public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
9841 
9842        /**
9843         * The maximum size, in bytes, of a download that the download manager will transfer over
9844         * a non-wifi connection.
9845         * @hide
9846         */
9847        public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
9848                "download_manager_max_bytes_over_mobile";
9849 
9850        /**
9851         * The recommended maximum size, in bytes, of a download that the download manager should
9852         * transfer over a non-wifi connection. Over this size, the use will be warned, but will
9853         * have the option to start the download over the mobile connection anyway.
9854         * @hide
9855         */
9856        public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
9857                "download_manager_recommended_max_bytes_over_mobile";
9858 
9859        /**
9860         * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
9861         */
9862        @Deprecated
9863        public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
9864 
9865        /**
9866         * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
9867         * sent or processed. (0 = false, 1 = true)
9868         * @hide
9869         */
9870        public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
9871 
9872        /**
9873         * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on
9874         * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will
9875         * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be
9876         * activated.
9877         * @hide
9878         */
9879         public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED =
9880                 "hdmi_system_audio_control_enabled";
9881 
9882         /**
9883          * Whether HDMI Routing Control feature is enabled. If enabled, the switch device will
9884          * route to the correct input source on receiving Routing Control related messages. If
9885          * disabled, you can only switch the input via controls on this device.
9886          * @hide
9887          */
9888         public static final String HDMI_CEC_SWITCH_ENABLED =
9889                 "hdmi_cec_switch_enabled";
9890 
9891         /**
9892          * Whether TV will automatically turn on upon reception of the CEC command
9893          * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
9894          *
9895          * @hide
9896          */
9897         public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
9898                 "hdmi_control_auto_wakeup_enabled";
9899 
9900         /**
9901          * Whether TV will also turn off other CEC devices when it goes to standby mode.
9902          * (0 = false, 1 = true)
9903          *
9904          * @hide
9905          */
9906         public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
9907                 "hdmi_control_auto_device_off_enabled";
9908 
9909         /**
9910          * The interval in milliseconds at which location requests will be throttled when they are
9911          * coming from the background.
9912          *
9913          * @hide
9914          */
9915         public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS =
9916                 "location_background_throttle_interval_ms";
9917 
9918         /**
9919          * Most frequent location update interval in milliseconds that proximity alert is allowed
9920          * to request.
9921          * @hide
9922          */
9923         public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS =
9924                 "location_background_throttle_proximity_alert_interval_ms";
9925 
9926         /**
9927          * Packages that are whitelisted for background throttling (throttling will not be applied).
9928          * @hide
9929          */
9930         public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST =
9931             "location_background_throttle_package_whitelist";
9932 
9933         /**
9934          * Packages that are whitelisted for ignoring location settings (may retrieve location even
9935          * when user location settings are off), for emergency purposes.
9936          * @hide
9937          */
9938         @TestApi
9939         public static final String LOCATION_IGNORE_SETTINGS_PACKAGE_WHITELIST =
9940                 "location_ignore_settings_package_whitelist";
9941 
9942         /**
9943          * Whether to disable location status callbacks in preparation for deprecation.
9944          * @hide
9945          */
9946         public static final String LOCATION_DISABLE_STATUS_CALLBACKS =
9947                 "location_disable_status_callbacks";
9948 
9949         /**
9950          * Maximum staleness allowed for last location when returned to clients with only foreground
9951          * location permissions.
9952          * @hide
9953          */
9954         public static final String LOCATION_LAST_LOCATION_MAX_AGE_MILLIS =
9955                 "location_last_location_max_age_millis";
9956 
9957         /**
9958         * Whether TV will switch to MHL port when a mobile device is plugged in.
9959         * (0 = false, 1 = true)
9960         * @hide
9961         */
9962        public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
9963 
9964        /**
9965         * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
9966         * @hide
9967         */
9968        public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
9969 
9970        /**
9971         * Whether mobile data connections are allowed by the user.  See
9972         * ConnectivityManager for more info.
9973         * @hide
9974         */
9975        @UnsupportedAppUsage
9976        public static final String MOBILE_DATA = "mobile_data";
9977 
9978        /**
9979         * Whether the mobile data connection should remain active even when higher
9980         * priority networks like WiFi are active, to help make network switching faster.
9981         *
9982         * See ConnectivityService for more info.
9983         *
9984         * (0 = disabled, 1 = enabled)
9985         * @hide
9986         */
9987        public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
9988 
9989         /**
9990          * Whether the wifi data connection should remain active even when higher
9991          * priority networks like Ethernet are active, to keep both networks.
9992          * In the case where higher priority networks are connected, wifi will be
9993          * unused unless an application explicitly requests to use it.
9994          *
9995          * See ConnectivityService for more info.
9996          *
9997          * (0 = disabled, 1 = enabled)
9998          * @hide
9999          */
10000         public static final String WIFI_ALWAYS_REQUESTED = "wifi_always_requested";
10001 
10002         /**
10003          * Size of the event buffer for IP connectivity metrics.
10004          * @hide
10005          */
10006         public static final String CONNECTIVITY_METRICS_BUFFER_SIZE =
10007               "connectivity_metrics_buffer_size";
10008 
10009        /** {@hide} */
10010        public static final String NETSTATS_ENABLED = "netstats_enabled";
10011        /** {@hide} */
10012        public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
10013        /** {@hide} */
10014        @Deprecated
10015        public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
10016        /** {@hide} */
10017        public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
10018        /** {@hide} */
10019        public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
10020        /** {@hide} */
10021        public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled";
10022 
10023        /** {@hide} */
10024        public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
10025        /** {@hide} */
10026        public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
10027        /** {@hide} */
10028        public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
10029        /** {@hide} */
10030        public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
10031 
10032        /** {@hide} */
10033        public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
10034        /** {@hide} */
10035        public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
10036        /** {@hide} */
10037        public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
10038        /** {@hide} */
10039        public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
10040 
10041        /** {@hide} */
10042        public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
10043        /** {@hide} */
10044        public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
10045        /** {@hide} */
10046        public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
10047        /** {@hide} */
10048        public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
10049 
10050        /** {@hide} */
10051        public static final String NETPOLICY_QUOTA_ENABLED = "netpolicy_quota_enabled";
10052        /** {@hide} */
10053        public static final String NETPOLICY_QUOTA_UNLIMITED = "netpolicy_quota_unlimited";
10054        /** {@hide} */
10055        public static final String NETPOLICY_QUOTA_LIMITED = "netpolicy_quota_limited";
10056        /** {@hide} */
10057        public static final String NETPOLICY_QUOTA_FRAC_JOBS = "netpolicy_quota_frac_jobs";
10058        /** {@hide} */
10059        public static final String NETPOLICY_QUOTA_FRAC_MULTIPATH = "netpolicy_quota_frac_multipath";
10060 
10061        /** {@hide} */
10062        public static final String NETPOLICY_OVERRIDE_ENABLED = "netpolicy_override_enabled";
10063 
10064        /**
10065         * User preference for which network(s) should be used. Only the
10066         * connectivity service should touch this.
10067         */
10068        public static final String NETWORK_PREFERENCE = "network_preference";
10069 
10070        /**
10071         * Which package name to use for network scoring. If null, or if the package is not a valid
10072         * scorer app, external network scores will neither be requested nor accepted.
10073         * @hide
10074         */
10075        @UnsupportedAppUsage
10076        public static final String NETWORK_SCORER_APP = "network_scorer_app";
10077 
10078         /**
10079          * Whether night display forced auto mode is available.
10080          * 0 = unavailable, 1 = available.
10081          * @hide
10082          */
10083         public static final String NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE =
10084                 "night_display_forced_auto_mode_available";
10085 
10086        /**
10087         * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
10088         * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
10089         * exceeded.
10090         * @hide
10091         */
10092        public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
10093 
10094        /**
10095         * The length of time in milli-seconds that automatic small adjustments to
10096         * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
10097         * @hide
10098         */
10099        public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
10100 
10101        /** Preferred NTP server. {@hide} */
10102        public static final String NTP_SERVER = "ntp_server";
10103        /** Timeout in milliseconds to wait for NTP server. {@hide} */
10104        public static final String NTP_TIMEOUT = "ntp_timeout";
10105 
10106        /** {@hide} */
10107        public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval";
10108 
10109         /**
10110          * Whether or not Settings should enable psd API.
10111          * {@hide}
10112          */
10113         public static final String SETTINGS_USE_PSD_API = "settings_use_psd_api";
10114 
10115         /**
10116          * Whether or not Settings should enable external provider API.
10117          * {@hide}
10118          */
10119         public static final String SETTINGS_USE_EXTERNAL_PROVIDER_API =
10120                 "settings_use_external_provider_api";
10121 
10122        /**
10123         * Sample validity in seconds to configure for the system DNS resolver.
10124         * {@hide}
10125         */
10126        public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS =
10127                "dns_resolver_sample_validity_seconds";
10128 
10129        /**
10130         * Success threshold in percent for use with the system DNS resolver.
10131         * {@hide}
10132         */
10133        public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT =
10134                 "dns_resolver_success_threshold_percent";
10135 
10136        /**
10137         * Minimum number of samples needed for statistics to be considered meaningful in the
10138         * system DNS resolver.
10139         * {@hide}
10140         */
10141        public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples";
10142 
10143        /**
10144         * Maximum number taken into account for statistics purposes in the system DNS resolver.
10145         * {@hide}
10146         */
10147        public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples";
10148 
10149        /**
10150         * Whether to disable the automatic scheduling of system updates.
10151         * 1 = system updates won't be automatically scheduled (will always
10152         * present notification instead).
10153         * 0 = system updates will be automatically scheduled. (default)
10154         * @hide
10155         */
10156        @SystemApi
10157        public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
10158 
10159        /**
10160         * Whether the package manager should send package verification broadcasts for verifiers to
10161         * review apps prior to installation.
10162         * 1 = request apps to be verified prior to installation, if a verifier exists.
10163         * 0 = do not verify apps before installation
10164         * @hide
10165         */
10166        @UnsupportedAppUsage
10167        public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
10168 
10169        /** Timeout for package verification.
10170         * @hide */
10171        public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
10172 
10173        /** Default response code for package verification.
10174         * @hide */
10175        public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
10176 
10177        /**
10178         * Show package verification setting in the Settings app.
10179         * 1 = show (default)
10180         * 0 = hide
10181         * @hide
10182         */
10183        public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
10184 
10185        /**
10186         * Run package verification on apps installed through ADB/ADT/USB
10187         * 1 = perform package verification on ADB installs (default)
10188         * 0 = bypass package verification on ADB installs
10189         * @hide
10190         */
10191        public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
10192 
10193        /**
10194         * Time since last fstrim (milliseconds) after which we force one to happen
10195         * during device startup.  If unset, the default is 3 days.
10196         * @hide
10197         */
10198        public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
10199 
10200        /**
10201         * The interval in milliseconds at which to check packet counts on the
10202         * mobile data interface when screen is on, to detect possible data
10203         * connection problems.
10204         * @hide
10205         */
10206        public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
10207                "pdp_watchdog_poll_interval_ms";
10208 
10209        /**
10210         * The interval in milliseconds at which to check packet counts on the
10211         * mobile data interface when screen is off, to detect possible data
10212         * connection problems.
10213         * @hide
10214         */
10215        public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
10216                "pdp_watchdog_long_poll_interval_ms";
10217 
10218        /**
10219         * The interval in milliseconds at which to check packet counts on the
10220         * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
10221         * outgoing packets has been reached without incoming packets.
10222         * @hide
10223         */
10224        public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
10225                "pdp_watchdog_error_poll_interval_ms";
10226 
10227        /**
10228         * The number of outgoing packets sent without seeing an incoming packet
10229         * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
10230         * device is logged to the event log
10231         * @hide
10232         */
10233        public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
10234                "pdp_watchdog_trigger_packet_count";
10235 
10236        /**
10237         * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
10238         * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
10239         * attempting data connection recovery.
10240         * @hide
10241         */
10242        public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
10243                "pdp_watchdog_error_poll_count";
10244 
10245        /**
10246         * The number of failed PDP reset attempts before moving to something more
10247         * drastic: re-registering to the network.
10248         * @hide
10249         */
10250        public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
10251                "pdp_watchdog_max_pdp_reset_fail_count";
10252 
10253        /**
10254         * URL to open browser on to allow user to manage a prepay account
10255         * @hide
10256         */
10257        public static final String SETUP_PREPAID_DATA_SERVICE_URL =
10258                "setup_prepaid_data_service_url";
10259 
10260        /**
10261         * URL to attempt a GET on to see if this is a prepay device
10262         * @hide
10263         */
10264        public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
10265                "setup_prepaid_detection_target_url";
10266 
10267        /**
10268         * Host to check for a redirect to after an attempt to GET
10269         * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
10270         * this is a prepaid device with zero balance.)
10271         * @hide
10272         */
10273        public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
10274                "setup_prepaid_detection_redir_host";
10275 
10276        /**
10277         * The interval in milliseconds at which to check the number of SMS sent out without asking
10278         * for use permit, to limit the un-authorized SMS usage.
10279         *
10280         * @hide
10281         */
10282        public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
10283                "sms_outgoing_check_interval_ms";
10284 
10285        /**
10286         * The number of outgoing SMS sent without asking for user permit (of {@link
10287         * #SMS_OUTGOING_CHECK_INTERVAL_MS}
10288         *
10289         * @hide
10290         */
10291        public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
10292                "sms_outgoing_check_max_count";
10293 
10294        /**
10295         * Used to disable SMS short code confirmation - defaults to true.
10296         * True indcates we will do the check, etc.  Set to false to disable.
10297         * @see com.android.internal.telephony.SmsUsageMonitor
10298         * @hide
10299         */
10300        public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
10301 
10302         /**
10303          * Used to select which country we use to determine premium sms codes.
10304          * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
10305          * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
10306          * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
10307          * @hide
10308          */
10309         public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
10310 
10311        /**
10312         * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
10313         * @hide
10314         */
10315        public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
10316 
10317        /**
10318         * Used to disable Tethering on a device - defaults to true
10319         * @hide
10320         */
10321        public static final String TETHER_SUPPORTED = "tether_supported";
10322 
10323        /**
10324         * Used to require DUN APN on the device or not - defaults to a build config value
10325         * which defaults to false
10326         * @hide
10327         */
10328        public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
10329 
10330        /**
10331         * Used to hold a gservices-provisioned apn value for DUN.  If set, or the
10332         * corresponding build config values are set it will override the APN DB
10333         * values.
10334         * Consists of a comma seperated list of strings:
10335         * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
10336         * note that empty fields can be omitted: "name,apn,,,,,,,,,310,260,,DUN"
10337         * @hide
10338         */
10339        public static final String TETHER_DUN_APN = "tether_dun_apn";
10340 
10341         /**
10342          * Used to disable trying to talk to any available tethering offload HAL.
10343          *
10344          * Integer values are interpreted as boolean, and the absence of an explicit setting
10345          * is interpreted as |false|.
10346          * @hide
10347          */
10348         public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled";
10349 
10350         /**
10351          * Use the old dnsmasq DHCP server for tethering instead of the framework implementation.
10352          *
10353          * Integer values are interpreted as boolean, and the absence of an explicit setting
10354          * is interpreted as |false|.
10355          * @hide
10356          */
10357         public static final String TETHER_ENABLE_LEGACY_DHCP_SERVER =
10358                 "tether_enable_legacy_dhcp_server";
10359 
10360         /**
10361          * List of certificate (hex string representation of the application's certificate - SHA-1
10362          * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for
10363          * install when a sim card with matching UICC carrier privilege rules is inserted.  The
10364          * certificate is used as a key, so the certificate encoding here must be the same as the
10365          * certificate encoding used on the SIM.
10366          *
10367          * The value is "cert1:package1;cert2:package2;..."
10368          * @hide
10369          */
10370         @SystemApi
10371         public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
10372 
10373         /**
10374          * Map of package name to application names. The application names cannot and will not be
10375          * localized. App names may not contain colons or semicolons.
10376          *
10377          * The value is "packageName1:appName1;packageName2:appName2;..."
10378          * @hide
10379          */
10380         @SystemApi
10381         public static final String CARRIER_APP_NAMES = "carrier_app_names";
10382 
10383        /**
10384         * USB Mass Storage Enabled
10385         */
10386        public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
10387 
10388        private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
10389 
10390        /**
10391         * If this setting is set (to anything), then all references
10392         * to Gmail on the device must change to Google Mail.
10393         */
10394        public static final String USE_GOOGLE_MAIL = "use_google_mail";
10395 
10396         /**
10397          * Whether or not switching/creating users is enabled by user.
10398          * @hide
10399          */
10400         public static final String USER_SWITCHER_ENABLED = "user_switcher_enabled";
10401 
10402         /**
10403          * Webview Data reduction proxy key.
10404          * @hide
10405          */
10406         public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
10407                 "webview_data_reduction_proxy_key";
10408 
10409        /**
10410         * Whether or not the WebView fallback mechanism should be enabled.
10411         * 0=disabled, 1=enabled.
10412         * @hide
10413         */
10414        public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED =
10415                "webview_fallback_logic_enabled";
10416 
10417        /**
10418         * Name of the package used as WebView provider (if unset the provider is instead determined
10419         * by the system).
10420         * @hide
10421         */
10422        @UnsupportedAppUsage
10423        public static final String WEBVIEW_PROVIDER = "webview_provider";
10424 
10425        /**
10426         * Developer setting to enable WebView multiprocess rendering.
10427         * @hide
10428         */
10429        @SystemApi
10430        public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
10431 
10432        /**
10433         * The maximum number of notifications shown in 24 hours when switching networks.
10434         * @hide
10435         */
10436        public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT =
10437               "network_switch_notification_daily_limit";
10438 
10439        /**
10440         * The minimum time in milliseconds between notifications when switching networks.
10441         * @hide
10442         */
10443        public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS =
10444               "network_switch_notification_rate_limit_millis";
10445 
10446        /**
10447         * Whether to automatically switch away from wifi networks that lose Internet access.
10448         * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always
10449         * avoids such networks. Valid values are:
10450         *
10451         * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013.
10452         * null: Ask the user whether to switch away from bad wifi.
10453         * 1: Avoid bad wifi.
10454         *
10455         * @hide
10456         */
10457        public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi";
10458 
10459        /**
10460         * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be
10461         * overridden by the system based on device or application state. If null, the value
10462         * specified by config_networkMeteredMultipathPreference is used.
10463         *
10464         * @hide
10465         */
10466        public static final String NETWORK_METERED_MULTIPATH_PREFERENCE =
10467                "network_metered_multipath_preference";
10468 
10469         /**
10470          * Default daily multipath budget used by ConnectivityManager.getMultipathPreference()
10471          * on metered networks. This default quota is only used if quota could not be determined
10472          * from data plan or data limit/warning set by the user.
10473          * @hide
10474          */
10475         public static final String NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES =
10476                 "network_default_daily_multipath_quota_bytes";
10477 
10478         /**
10479          * Network watchlist last report time.
10480          * @hide
10481          */
10482         public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME =
10483                 "network_watchlist_last_report_time";
10484 
10485        /**
10486         * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of
10487         * colon-delimited key-value pairs. The key is the badging enum value defined in
10488         * android.net.ScoredNetwork and the value is the minimum sustained network throughput in
10489         * kbps required for the badge. For example: "10:3000,20:5000,30:25000"
10490         *
10491         * @hide
10492         */
10493        @SystemApi
10494        public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds";
10495 
10496        /**
10497         * Whether Wifi display is enabled/disabled
10498         * 0=disabled. 1=enabled.
10499         * @hide
10500         */
10501        public static final String WIFI_DISPLAY_ON = "wifi_display_on";
10502 
10503        /**
10504         * Whether Wifi display certification mode is enabled/disabled
10505         * 0=disabled. 1=enabled.
10506         * @hide
10507         */
10508        public static final String WIFI_DISPLAY_CERTIFICATION_ON =
10509                "wifi_display_certification_on";
10510 
10511        /**
10512         * WPS Configuration method used by Wifi display, this setting only
10513         * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
10514         *
10515         * Possible values are:
10516         *
10517         * WpsInfo.INVALID: use default WPS method chosen by framework
10518         * WpsInfo.PBC    : use Push button
10519         * WpsInfo.KEYPAD : use Keypad
10520         * WpsInfo.DISPLAY: use Display
10521         * @hide
10522         */
10523        public static final String WIFI_DISPLAY_WPS_CONFIG =
10524            "wifi_display_wps_config";
10525 
10526        /**
10527         * Whether to notify the user of open networks.
10528         * <p>
10529         * If not connected and the scan results have an open network, we will
10530         * put this notification up. If we attempt to connect to a network or
10531         * the open network(s) disappear, we remove the notification. When we
10532         * show the notification, we will not show it again for
10533         * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
10534         *
10535         * @deprecated This feature is no longer controlled by this setting in
10536         * {@link android.os.Build.VERSION_CODES#O}.
10537         */
10538        @Deprecated
10539        public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
10540                "wifi_networks_available_notification_on";
10541 
10542        private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
10543                BOOLEAN_VALIDATOR;
10544 
10545        /**
10546         * Whether to notify the user of carrier networks.
10547         * <p>
10548         * If not connected and the scan results have a carrier network, we will
10549         * put this notification up. If we attempt to connect to a network or
10550         * the carrier network(s) disappear, we remove the notification. When we
10551         * show the notification, we will not show it again for
10552         * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
10553         * @hide
10554         */
10555        public static final String WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON =
10556                "wifi_carrier_networks_available_notification_on";
10557 
10558        private static final Validator WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR =
10559                BOOLEAN_VALIDATOR;
10560 
10561        /**
10562         * {@hide}
10563         */
10564        public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
10565                "wimax_networks_available_notification_on";
10566 
10567        /**
10568         * Delay (in seconds) before repeating the Wi-Fi networks available notification.
10569         * Connecting to a network will reset the timer.
10570         */
10571        public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
10572                "wifi_networks_available_repeat_delay";
10573 
10574        private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR =
10575                NON_NEGATIVE_INTEGER_VALIDATOR;
10576 
10577        /**
10578         * 802.11 country code in ISO 3166 format
10579         * @hide
10580         */
10581        public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
10582 
10583        /**
10584         * The interval in milliseconds to issue wake up scans when wifi needs
10585         * to connect. This is necessary to connect to an access point when
10586         * device is on the move and the screen is off.
10587         * @hide
10588         */
10589        public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
10590                "wifi_framework_scan_interval_ms";
10591 
10592        /**
10593         * The interval in milliseconds after which Wi-Fi is considered idle.
10594         * When idle, it is possible for the device to be switched from Wi-Fi to
10595         * the mobile data network.
10596         * @hide
10597         */
10598        public static final String WIFI_IDLE_MS = "wifi_idle_ms";
10599 
10600        /**
10601         * When the number of open networks exceeds this number, the
10602         * least-recently-used excess networks will be removed.
10603         */
10604        public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
10605 
10606        private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR =
10607                NON_NEGATIVE_INTEGER_VALIDATOR;
10608 
10609        /**
10610         * Whether the Wi-Fi should be on.  Only the Wi-Fi service should touch this.
10611         */
10612        public static final String WIFI_ON = "wifi_on";
10613 
10614        /**
10615         * Setting to allow scans to be enabled even wifi is turned off for connectivity.
10616         * @hide
10617         */
10618        public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
10619                 "wifi_scan_always_enabled";
10620 
10621         /**
10622          * The interval in milliseconds at which wifi rtt ranging requests will be throttled when
10623          * they are coming from the background.
10624          *
10625          * @hide
10626          */
10627         public static final String WIFI_RTT_BACKGROUND_EXEC_GAP_MS =
10628                 "wifi_rtt_background_exec_gap_ms";
10629 
10630         /**
10631          * Indicate whether factory reset request is pending.
10632          *
10633          * Type: int (0 for false, 1 for true)
10634          * @hide
10635          */
10636         public static final String WIFI_P2P_PENDING_FACTORY_RESET =
10637                 "wifi_p2p_pending_factory_reset";
10638 
10639         /**
10640          * Whether soft AP will shut down after a timeout period when no devices are connected.
10641          *
10642          * Type: int (0 for false, 1 for true)
10643          * @hide
10644          */
10645         public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled";
10646 
10647         private static final Validator SOFT_AP_TIMEOUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
10648 
10649         /**
10650          * Value to specify if Wi-Fi Wakeup feature is enabled.
10651          *
10652          * Type: int (0 for false, 1 for true)
10653          * @hide
10654          */
10655         @SystemApi
10656         public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
10657 
10658         private static final Validator WIFI_WAKEUP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
10659 
10660         /**
10661          * Value to specify whether network quality scores and badging should be shown in the UI.
10662          *
10663          * Type: int (0 for false, 1 for true)
10664          * @hide
10665          */
10666         public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled";
10667 
10668         /**
10669          * Value to specify how long in milliseconds to retain seen score cache curves to be used
10670          * when generating SSID only bases score curves.
10671          *
10672          * Type: long
10673          * @hide
10674          */
10675         public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS =
10676                 "speed_label_cache_eviction_age_millis";
10677 
10678         /**
10679          * Value to specify if network recommendations from
10680          * {@link com.android.server.NetworkScoreService} are enabled.
10681          *
10682          * Type: int
10683          * Valid values:
10684          *   -1 = Forced off
10685          *    0 = Disabled
10686          *    1 = Enabled
10687          *
10688          * Most readers of this setting should simply check if value == 1 to determined the
10689          * enabled state.
10690          * @hide
10691          */
10692         public static final String NETWORK_RECOMMENDATIONS_ENABLED =
10693                 "network_recommendations_enabled";
10694 
10695         private static final Validator NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR =
10696                 new SettingsValidators.DiscreteValueValidator(new String[] {"-1", "0", "1"});
10697 
10698         /**
10699          * Which package name to use for network recommendations. If null, network recommendations
10700          * will neither be requested nor accepted.
10701          *
10702          * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and
10703          * {@link NetworkScoreManager#setActiveScorer(String)} to write it.
10704          *
10705          * Type: string - package name
10706          * @hide
10707          */
10708         public static final String NETWORK_RECOMMENDATIONS_PACKAGE =
10709                 "network_recommendations_package";
10710 
10711         /**
10712          * The package name of the application that connect and secures high quality open wifi
10713          * networks automatically.
10714          *
10715          * Type: string package name or null if the feature is either not provided or disabled.
10716          * @hide
10717          */
10718         @TestApi
10719         public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package";
10720 
10721         private static final Validator USE_OPEN_WIFI_PACKAGE_VALIDATOR = new Validator() {
10722             @Override
10723             public boolean validate(@Nullable String value) {
10724                 return (value == null) || PACKAGE_NAME_VALIDATOR.validate(value);
10725             }
10726         };
10727 
10728         /**
10729          * The number of milliseconds the {@link com.android.server.NetworkScoreService}
10730          * will give a recommendation request to complete before returning a default response.
10731          *
10732          * Type: long
10733          * @hide
10734          * @deprecated to be removed
10735          */
10736         public static final String NETWORK_RECOMMENDATION_REQUEST_TIMEOUT_MS =
10737                 "network_recommendation_request_timeout_ms";
10738 
10739         /**
10740          * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in
10741          * {@link com.android.server.wifi.RecommendedNetworkEvaluator}.
10742          *
10743          * Type: long
10744          * @hide
10745          */
10746         public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS =
10747                 "recommended_network_evaluator_cache_expiry_ms";
10748 
10749         /**
10750          * Whether wifi scan throttle is enabled or not.
10751          * This is intended to be used via adb commands or a menu in developer option to turn off
10752          * the default wifi scan throttling mechanism for apps.
10753          *
10754          * Type: int (0 for false, 1 for true)
10755          * @hide
10756          */
10757         public static final String WIFI_SCAN_THROTTLE_ENABLED = "wifi_scan_throttle_enabled";
10758 
10759         private static final Validator WIFI_SCAN_THROTTLE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
10760 
10761         /**
10762         * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
10763         * connectivity.
10764         * @hide
10765         */
10766         public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled";
10767 
10768         /**
10769          * The length in milliseconds of a BLE scan window in a low-power scan mode.
10770          * @hide
10771          */
10772         public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms";
10773 
10774         /**
10775          * The length in milliseconds of a BLE scan window in a balanced scan mode.
10776          * @hide
10777          */
10778         public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms";
10779 
10780         /**
10781          * The length in milliseconds of a BLE scan window in a low-latency scan mode.
10782          * @hide
10783          */
10784         public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS =
10785                 "ble_scan_low_latency_window_ms";
10786 
10787         /**
10788          * The length in milliseconds of a BLE scan interval in a low-power scan mode.
10789          * @hide
10790          */
10791         public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS =
10792                 "ble_scan_low_power_interval_ms";
10793 
10794         /**
10795          * The length in milliseconds of a BLE scan interval in a balanced scan mode.
10796          * @hide
10797          */
10798         public static final String BLE_SCAN_BALANCED_INTERVAL_MS =
10799                 "ble_scan_balanced_interval_ms";
10800 
10801         /**
10802          * The length in milliseconds of a BLE scan interval in a low-latency scan mode.
10803          * @hide
10804          */
10805         public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS =
10806                 "ble_scan_low_latency_interval_ms";
10807 
10808         /**
10809          * The mode that BLE scanning clients will be moved to when in the background.
10810          * @hide
10811          */
10812         public static final String BLE_SCAN_BACKGROUND_MODE = "ble_scan_background_mode";
10813 
10814        /**
10815         * Used to save the Wifi_ON state prior to tethering.
10816         * This state will be checked to restore Wifi after
10817         * the user turns off tethering.
10818         *
10819         * @hide
10820         */
10821        @UnsupportedAppUsage
10822        public static final String WIFI_SAVED_STATE = "wifi_saved_state";
10823 
10824        /**
10825         * The interval in milliseconds to scan as used by the wifi supplicant
10826         * @hide
10827         */
10828        public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
10829                "wifi_supplicant_scan_interval_ms";
10830 
10831         /**
10832          * whether frameworks handles wifi auto-join
10833          * @hide
10834          */
10835        public static final String WIFI_ENHANCED_AUTO_JOIN =
10836                 "wifi_enhanced_auto_join";
10837 
10838         /**
10839          * whether settings show RSSI
10840          * @hide
10841          */
10842         public static final String WIFI_NETWORK_SHOW_RSSI =
10843                 "wifi_network_show_rssi";
10844 
10845         /**
10846         * The interval in milliseconds to scan at supplicant when p2p is connected
10847         * @hide
10848         */
10849        public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
10850                "wifi_scan_interval_p2p_connected_ms";
10851 
10852        /**
10853         * Whether the Wi-Fi watchdog is enabled.
10854         */
10855        public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
10856 
10857        /**
10858         * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
10859         * the setting needs to be set to 0 to disable it.
10860         * @hide
10861         */
10862        @UnsupportedAppUsage
10863        public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
10864                "wifi_watchdog_poor_network_test_enabled";
10865 
10866        private static final Validator WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR =
10867                ANY_STRING_VALIDATOR;
10868 
10869        /**
10870         * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
10871         * needs to be set to 0 to disable it.
10872         * @hide
10873         */
10874        public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
10875                "wifi_suspend_optimizations_enabled";
10876 
10877        /**
10878         * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1
10879         * will enable it. In the future, additional values may be supported.
10880         * @hide
10881         */
10882        public static final String WIFI_VERBOSE_LOGGING_ENABLED =
10883                "wifi_verbose_logging_enabled";
10884 
10885         /**
10886          * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and
10887          * setting to 1 will enable it. In the future, additional values may be supported.
10888          * @deprecated MAC randomization is now a per-network setting
10889          * @hide
10890          */
10891         @Deprecated
10892         public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED =
10893                 "wifi_connected_mac_randomization_enabled";
10894 
10895         /**
10896          * Parameters to adjust the performance of framework wifi scoring methods.
10897          * <p>
10898          * Encoded as a comma-separated key=value list, for example:
10899          *   "rssi5=-80:-77:-70:-57,rssi2=-83:-80:-73:-60,horizon=15"
10900          * This is intended for experimenting with new parameter values,
10901          * and is normally unset or empty. The example does not include all
10902          * parameters that may be honored.
10903          * Default values are provided by code or device configurations.
10904          * Errors in the parameters will cause the entire setting to be ignored.
10905          * @hide
10906          */
10907         public static final String WIFI_SCORE_PARAMS =
10908                 "wifi_score_params";
10909 
10910         /**
10911          * Setting to enable logging WifiIsUnusableEvent in metrics
10912          * which gets triggered when wifi becomes unusable.
10913          * Disabled by default, and setting it to 1 will enable it.
10914          * @hide
10915          */
10916         public static final String WIFI_IS_UNUSABLE_EVENT_METRICS_ENABLED =
10917                 "wifi_is_unusable_event_metrics_enabled";
10918 
10919         /**
10920          * The minimum number of txBad the framework has to observe
10921          * to trigger a wifi data stall.
10922          * @hide
10923          */
10924         public static final String WIFI_DATA_STALL_MIN_TX_BAD =
10925                 "wifi_data_stall_min_tx_bad";
10926 
10927         /**
10928          * The minimum number of txSuccess the framework has to observe
10929          * to trigger a wifi data stall when rxSuccess is 0.
10930          * @hide
10931          */
10932         public static final String WIFI_DATA_STALL_MIN_TX_SUCCESS_WITHOUT_RX =
10933                 "wifi_data_stall_min_tx_success_without_rx";
10934 
10935         /**
10936          * Setting to enable logging Wifi LinkSpeedCounts in metrics.
10937          * Disabled by default, and setting it to 1 will enable it.
10938          * @hide
10939          */
10940         public static final String WIFI_LINK_SPEED_METRICS_ENABLED =
10941                 "wifi_link_speed_metrics_enabled";
10942 
10943         /**
10944          * Setting to enable the PNO frequency culling optimization.
10945          * Disabled by default, and setting it to 1 will enable it.
10946          * The value is boolean (0 or 1).
10947          * @hide
10948          */
10949         public static final String WIFI_PNO_FREQUENCY_CULLING_ENABLED =
10950                 "wifi_pno_frequency_culling_enabled";
10951 
10952         private static final Validator WIFI_PNO_FREQUENCY_CULLING_ENABLED_VALIDATOR =
10953                 BOOLEAN_VALIDATOR;
10954 
10955         /**
10956          * Setting to enable including recency information when determining pno network priorities.
10957          * Disabled by default, and setting it to 1 will enable it.
10958          * The value is boolean (0 or 1).
10959          * @hide
10960          */
10961         public static final String WIFI_PNO_RECENCY_SORTING_ENABLED =
10962                 "wifi_pno_recency_sorting_enabled";
10963 
10964         private static final Validator WIFI_PNO_RECENCY_SORTING_ENABLED_VALIDATOR =
10965                 BOOLEAN_VALIDATOR;
10966 
10967         /**
10968          * Setting to enable the Wi-Fi link probing.
10969          * Enabled by default, and setting it to 0 will disable it.
10970          * The value is boolean (0 or 1).
10971          * @hide
10972          */
10973         public static final String WIFI_LINK_PROBING_ENABLED =
10974                 "wifi_link_probing_enabled";
10975 
10976         private static final Validator WIFI_LINK_PROBING_ENABLED_VALIDATOR =
10977                 BOOLEAN_VALIDATOR;
10978 
10979        /**
10980         * The maximum number of times we will retry a connection to an access
10981         * point for which we have failed in acquiring an IP address from DHCP.
10982         * A value of N means that we will make N+1 connection attempts in all.
10983         */
10984        public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
10985 
10986        /**
10987         * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
10988         * data connectivity to be established after a disconnect from Wi-Fi.
10989         */
10990        public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
10991            "wifi_mobile_data_transition_wakelock_timeout_ms";
10992 
10993        /**
10994         * This setting controls whether WiFi configurations created by a Device Owner app
10995         * should be locked down (that is, be editable or removable only by the Device Owner App,
10996         * not even by Settings app).
10997         * This setting takes integer values. Non-zero values mean DO created configurations
10998         * are locked down. Value of zero means they are not. Default value in the absence of
10999         * actual value to this setting is 0.
11000         */
11001        public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN =
11002                "wifi_device_owner_configs_lockdown";
11003 
11004        /**
11005         * The operational wifi frequency band
11006         * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
11007         * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
11008         * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
11009         *
11010         * @hide
11011         */
11012        public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
11013 
11014        /**
11015         * The Wi-Fi peer-to-peer device name
11016         * @hide
11017         */
11018        public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
11019 
11020        /**
11021         * The min time between wifi disable and wifi enable
11022         * @hide
11023         */
11024        public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
11025 
11026        /**
11027         * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
11028         * from an ephemeral network if there is no BSSID for that network with a non-null score that
11029         * has been seen in this time period.
11030         *
11031         * If this is less than or equal to zero, we use a more conservative behavior and only check
11032         * for a non-null score from the currently connected or target BSSID.
11033         * @hide
11034         */
11035        public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
11036                "wifi_ephemeral_out_of_range_timeout_ms";
11037 
11038        /**
11039         * The number of milliseconds to delay when checking for data stalls during
11040         * non-aggressive detection. (screen is turned off.)
11041         * @hide
11042         */
11043        public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
11044                "data_stall_alarm_non_aggressive_delay_in_ms";
11045 
11046        /**
11047         * The number of milliseconds to delay when checking for data stalls during
11048         * aggressive detection. (screen on or suspected data stall)
11049         * @hide
11050         */
11051        public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
11052                "data_stall_alarm_aggressive_delay_in_ms";
11053 
11054        /**
11055         * The number of milliseconds to allow the provisioning apn to remain active
11056         * @hide
11057         */
11058        public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
11059                "provisioning_apn_alarm_delay_in_ms";
11060 
11061        /**
11062         * The interval in milliseconds at which to check gprs registration
11063         * after the first registration mismatch of gprs and voice service,
11064         * to detect possible data network registration problems.
11065         *
11066         * @hide
11067         */
11068        public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
11069                "gprs_register_check_period_ms";
11070 
11071        /**
11072         * Nonzero causes Log.wtf() to crash.
11073         * @hide
11074         */
11075        public static final String WTF_IS_FATAL = "wtf_is_fatal";
11076 
11077        /**
11078         * Ringer mode. This is used internally, changing this value will not
11079         * change the ringer mode. See AudioManager.
11080         */
11081        public static final String MODE_RINGER = "mode_ringer";
11082 
11083        /**
11084         * Overlay display devices setting.
11085         * The associated value is a specially formatted string that describes the
11086         * size and density of simulated secondary display devices.
11087         * <p>
11088         * Format: {width}x{height}/{dpi};...
11089         * </p><p>
11090         * Example:
11091         * <ul>
11092         * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
11093         * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
11094         * at 1080p and the second at 720p.</li>
11095         * <li>If the value is empty, then no overlay display devices are created.</li>
11096         * </ul></p>
11097         *
11098         * @hide
11099         */
11100        @TestApi
11101        public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
11102 
11103         /**
11104          * Threshold values for the duration and level of a discharge cycle,
11105          * under which we log discharge cycle info.
11106          *
11107          * @hide
11108          */
11109         public static final String
11110                 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
11111 
11112         /** @hide */
11113         public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
11114 
11115         /**
11116          * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
11117          * intents on application crashes and ANRs. If this is disabled, the
11118          * crash/ANR dialog will never display the "Report" button.
11119          * <p>
11120          * Type: int (0 = disallow, 1 = allow)
11121          *
11122          * @hide
11123          */
11124         public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
11125 
11126         /**
11127          * Maximum age of entries kept by {@link DropBoxManager}.
11128          *
11129          * @hide
11130          */
11131         public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
11132 
11133         /**
11134          * Maximum number of entry files which {@link DropBoxManager} will keep
11135          * around.
11136          *
11137          * @hide
11138          */
11139         public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
11140 
11141         /**
11142          * Maximum amount of disk space used by {@link DropBoxManager} no matter
11143          * what.
11144          *
11145          * @hide
11146          */
11147         public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
11148 
11149         /**
11150          * Percent of free disk (excluding reserve) which {@link DropBoxManager}
11151          * will use.
11152          *
11153          * @hide
11154          */
11155         public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
11156 
11157         /**
11158          * Percent of total disk which {@link DropBoxManager} will never dip
11159          * into.
11160          *
11161          * @hide
11162          */
11163         public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
11164 
11165         /**
11166          * Prefix for per-tag dropbox disable/enable settings.
11167          *
11168          * @hide
11169          */
11170         public static final String DROPBOX_TAG_PREFIX = "dropbox:";
11171 
11172         /**
11173          * Lines of logcat to include with system crash/ANR/etc. reports, as a
11174          * prefix of the dropbox tag of the report type. For example,
11175          * "logcat_for_system_server_anr" controls the lines of logcat captured
11176          * with system server ANR reports. 0 to disable.
11177          *
11178          * @hide
11179          */
11180         public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
11181 
11182         /**
11183          * The interval in minutes after which the amount of free storage left
11184          * on the device is logged to the event log
11185          *
11186          * @hide
11187          */
11188         public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
11189 
11190         /**
11191          * Threshold for the amount of change in disk free space required to
11192          * report the amount of free space. Used to prevent spamming the logs
11193          * when the disk free space isn't changing frequently.
11194          *
11195          * @hide
11196          */
11197         public static final String
11198                 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
11199 
11200         /**
11201          * Minimum percentage of free storage on the device that is used to
11202          * determine if the device is running low on storage. The default is 10.
11203          * <p>
11204          * Say this value is set to 10, the device is considered running low on
11205          * storage if 90% or more of the device storage is filled up.
11206          *
11207          * @hide
11208          */
11209         public static final String
11210                 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
11211 
11212         /**
11213          * Maximum byte size of the low storage threshold. This is to ensure
11214          * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
11215          * overly large threshold for large storage devices. Currently this must
11216          * be less than 2GB. This default is 500MB.
11217          *
11218          * @hide
11219          */
11220         public static final String
11221                 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
11222 
11223         /**
11224          * Minimum bytes of free storage on the device before the data partition
11225          * is considered full. By default, 1 MB is reserved to avoid system-wide
11226          * SQLite disk full exceptions.
11227          *
11228          * @hide
11229          */
11230         public static final String
11231                 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
11232 
11233         /**
11234          * Minimum percentage of storage on the device that is reserved for
11235          * cached data.
11236          *
11237          * @hide
11238          */
11239         public static final String
11240                 SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage";
11241 
11242         /**
11243          * Maximum bytes of storage on the device that is reserved for cached
11244          * data.
11245          *
11246          * @hide
11247          */
11248         public static final String
11249                 SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes";
11250 
11251         /**
11252          * The maximum reconnect delay for short network outages or when the
11253          * network is suspended due to phone use.
11254          *
11255          * @hide
11256          */
11257         public static final String
11258                 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
11259 
11260         /**
11261          * The number of milliseconds to delay before sending out
11262          * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
11263          *
11264          * @hide
11265          */
11266         public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
11267 
11268 
11269         /**
11270          * Network sampling interval, in seconds. We'll generate link information
11271          * about bytes/packets sent and error rates based on data sampled in this interval
11272          *
11273          * @hide
11274          */
11275 
11276         public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
11277                 "connectivity_sampling_interval_in_seconds";
11278 
11279         /**
11280          * The series of successively longer delays used in retrying to download PAC file.
11281          * Last delay is used between successful PAC downloads.
11282          *
11283          * @hide
11284          */
11285         public static final String PAC_CHANGE_DELAY = "pac_change_delay";
11286 
11287         /**
11288          * Don't attempt to detect captive portals.
11289          *
11290          * @hide
11291          */
11292         public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0;
11293 
11294         /**
11295          * When detecting a captive portal, display a notification that
11296          * prompts the user to sign in.
11297          *
11298          * @hide
11299          */
11300         public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1;
11301 
11302         /**
11303          * When detecting a captive portal, immediately disconnect from the
11304          * network and do not reconnect to that network in the future.
11305          *
11306          * @hide
11307          */
11308         public static final int CAPTIVE_PORTAL_MODE_AVOID = 2;
11309 
11310         /**
11311          * What to do when connecting a network that presents a captive portal.
11312          * Must be one of the CAPTIVE_PORTAL_MODE_* constants above.
11313          *
11314          * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT.
11315          * @hide
11316          */
11317         public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
11318 
11319         /**
11320          * Setting to turn off captive portal detection. Feature is enabled by
11321          * default and the setting needs to be set to 0 to disable it.
11322          *
11323          * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection
11324          * @hide
11325          */
11326         @Deprecated
11327         public static final String
11328                 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
11329 
11330         /**
11331          * The server used for captive portal detection upon a new conection. A
11332          * 204 response code from the server is used for validation.
11333          * TODO: remove this deprecated symbol.
11334          *
11335          * @hide
11336          */
11337         public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
11338 
11339         /**
11340          * The URL used for HTTPS captive portal detection upon a new connection.
11341          * A 204 response code from the server is used for validation.
11342          *
11343          * @hide
11344          */
11345         public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
11346 
11347         /**
11348          * The URL used for HTTP captive portal detection upon a new connection.
11349          * A 204 response code from the server is used for validation.
11350          *
11351          * @hide
11352          */
11353         public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
11354 
11355         /**
11356          * The URL used for fallback HTTP captive portal detection when previous HTTP
11357          * and HTTPS captive portal detection attemps did not return a conclusive answer.
11358          *
11359          * @hide
11360          */
11361         public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
11362 
11363         /**
11364          * A comma separated list of URLs used for captive portal detection in addition to the
11365          * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings.
11366          *
11367          * @hide
11368          */
11369         public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS =
11370                 "captive_portal_other_fallback_urls";
11371 
11372         /**
11373          * A list of captive portal detection specifications used in addition to the fallback URLs.
11374          * Each spec has the format url@@/@@statusCodeRegex@@/@@contentRegex. Specs are separated
11375          * by "@@,@@".
11376          * @hide
11377          */
11378         public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS =
11379                 "captive_portal_fallback_probe_specs";
11380 
11381         /**
11382          * Whether to use HTTPS for network validation. This is enabled by default and the setting
11383          * needs to be set to 0 to disable it. This setting is a misnomer because captive portals
11384          * don't actually use HTTPS, but it's consistent with the other settings.
11385          *
11386          * @hide
11387          */
11388         public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
11389 
11390         /**
11391          * Which User-Agent string to use in the header of the captive portal detection probes.
11392          * The User-Agent field is unset when this setting has no value (HttpUrlConnection default).
11393          *
11394          * @hide
11395          */
11396         public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
11397 
11398         /**
11399          * Whether to try cellular data recovery when a bad network is reported.
11400          *
11401          * @hide
11402          */
11403         public static final String DATA_STALL_RECOVERY_ON_BAD_NETWORK =
11404                 "data_stall_recovery_on_bad_network";
11405 
11406         /**
11407          * Minumim duration in millisecodns between cellular data recovery attempts
11408          *
11409          * @hide
11410          */
11411         public static final String MIN_DURATION_BETWEEN_RECOVERY_STEPS_IN_MS =
11412                 "min_duration_between_recovery_steps";
11413         /**
11414          * Whether network service discovery is enabled.
11415          *
11416          * @hide
11417          */
11418         public static final String NSD_ON = "nsd_on";
11419 
11420         /**
11421          * Let user pick default install location.
11422          *
11423          * @hide
11424          */
11425         public static final String SET_INSTALL_LOCATION = "set_install_location";
11426 
11427         /**
11428          * Default install location value.
11429          * 0 = auto, let system decide
11430          * 1 = internal
11431          * 2 = sdcard
11432          * @hide
11433          */
11434         public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
11435 
11436         /**
11437          * ms during which to consume extra events related to Inet connection
11438          * condition after a transtion to fully-connected
11439          *
11440          * @hide
11441          */
11442         public static final String
11443                 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
11444 
11445         /**
11446          * ms during which to consume extra events related to Inet connection
11447          * condtion after a transtion to partly-connected
11448          *
11449          * @hide
11450          */
11451         public static final String
11452                 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
11453 
11454         /** {@hide} */
11455         public static final String
11456                 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
11457 
11458         /**
11459          * Host name and port for global http proxy. Uses ':' seperator for
11460          * between host and port.
11461          */
11462         public static final String HTTP_PROXY = "http_proxy";
11463 
11464         /**
11465          * Host name for global http proxy. Set via ConnectivityManager.
11466          *
11467          * @hide
11468          */
11469         public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
11470 
11471         /**
11472          * Integer host port for global http proxy. Set via ConnectivityManager.
11473          *
11474          * @hide
11475          */
11476         public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
11477 
11478         /**
11479          * Exclusion list for global proxy. This string contains a list of
11480          * comma-separated domains where the global proxy does not apply.
11481          * Domains should be listed in a comma- separated list. Example of
11482          * acceptable formats: ".domain1.com,my.domain2.com" Use
11483          * ConnectivityManager to set/get.
11484          *
11485          * @hide
11486          */
11487         public static final String
11488                 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
11489 
11490         /**
11491          * The location PAC File for the proxy.
11492          * @hide
11493          */
11494         public static final String
11495                 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
11496 
11497         /**
11498          * Enables the UI setting to allow the user to specify the global HTTP
11499          * proxy and associated exclusion list.
11500          *
11501          * @hide
11502          */
11503         public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
11504 
11505         /**
11506          * Setting for default DNS in case nobody suggests one
11507          *
11508          * @hide
11509          */
11510         public static final String DEFAULT_DNS_SERVER = "default_dns_server";
11511 
11512         /**
11513          * The requested Private DNS mode (string), and an accompanying specifier (string).
11514          *
11515          * Currently, the specifier holds the chosen provider name when the mode requests
11516          * a specific provider. It may be used to store the provider name even when the
11517          * mode changes so that temporarily disabling and re-enabling the specific
11518          * provider mode does not necessitate retyping the provider hostname.
11519          *
11520          * @hide
11521          */
11522         public static final String PRIVATE_DNS_MODE = "private_dns_mode";
11523 
11524         private static final Validator PRIVATE_DNS_MODE_VALIDATOR = ANY_STRING_VALIDATOR;
11525 
11526         /**
11527          * @hide
11528          */
11529         public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier";
11530 
11531         private static final Validator PRIVATE_DNS_SPECIFIER_VALIDATOR = ANY_STRING_VALIDATOR;
11532 
11533         /**
11534           * Forced override of the default mode (hardcoded as "automatic", nee "opportunistic").
11535           * This allows changing the default mode without effectively disabling other modes,
11536           * all of which require explicit user action to enable/configure. See also b/79719289.
11537           *
11538           * Value is a string, suitable for assignment to PRIVATE_DNS_MODE above.
11539           *
11540           * {@hide}
11541           */
11542         public static final String PRIVATE_DNS_DEFAULT_MODE = "private_dns_default_mode";
11543 
11544 
11545         /** {@hide} */
11546         public static final String
11547                 BLUETOOTH_BTSNOOP_DEFAULT_MODE = "bluetooth_btsnoop_default_mode";
11548         /** {@hide} */
11549         public static final String
11550                 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
11551         /** {@hide} */
11552         public static final String
11553                 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
11554         /** {@hide} */
11555         public static final String
11556                 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_";
11557         /** {@hide} */
11558         public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX =
11559                 "bluetooth_a2dp_supports_optional_codecs_";
11560         /** {@hide} */
11561         public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX =
11562                 "bluetooth_a2dp_optional_codecs_enabled_";
11563         /** {@hide} */
11564         public static final String
11565                 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
11566         /** {@hide} */
11567         public static final String
11568                 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
11569         /** {@hide} */
11570         public static final String
11571                 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_";
11572         /** {@hide} */
11573         public static final String
11574                 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_";
11575         /** {@hide} */
11576         public static final String
11577                 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
11578         /** {@hide} */
11579         public static final String
11580                 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_";
11581         /** {@hide} */
11582         public static final String
11583                 BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_";
11584         /**
11585          * Enable/disable radio bug detection
11586          *
11587          * {@hide}
11588          */
11589         public static final String
11590                 ENABLE_RADIO_BUG_DETECTION = "enable_radio_bug_detection";
11591 
11592         /**
11593          * Count threshold of RIL wakelock timeout for radio bug detection
11594          *
11595          * {@hide}
11596          */
11597         public static final String
11598                 RADIO_BUG_WAKELOCK_TIMEOUT_COUNT_THRESHOLD =
11599                 "radio_bug_wakelock_timeout_count_threshold";
11600 
11601         /**
11602          * Count threshold of RIL system error for radio bug detection
11603          *
11604          * {@hide}
11605          */
11606         public static final String
11607                 RADIO_BUG_SYSTEM_ERROR_COUNT_THRESHOLD =
11608                 "radio_bug_system_error_count_threshold";
11609 
11610         /**
11611          * Activity manager specific settings.
11612          * This is encoded as a key=value list, separated by commas. Ex:
11613          *
11614          * "gc_timeout=5000,max_cached_processes=24"
11615          *
11616          * The following keys are supported:
11617          *
11618          * <pre>
11619          * max_cached_processes                 (int)
11620          * background_settle_time               (long)
11621          * fgservice_min_shown_time             (long)
11622          * fgservice_min_report_time            (long)
11623          * fgservice_screen_on_before_time      (long)
11624          * fgservice_screen_on_after_time       (long)
11625          * content_provider_retain_time         (long)
11626          * gc_timeout                           (long)
11627          * gc_min_interval                      (long)
11628          * full_pss_min_interval                (long)
11629          * full_pss_lowered_interval            (long)
11630          * power_check_interval                 (long)
11631          * power_check_max_cpu_1                (int)
11632          * power_check_max_cpu_2                (int)
11633          * power_check_max_cpu_3                (int)
11634          * power_check_max_cpu_4                (int)
11635          * service_usage_interaction_time       (long)
11636          * usage_stats_interaction_interval     (long)
11637          * service_restart_duration             (long)
11638          * service_reset_run_duration           (long)
11639          * service_restart_duration_factor      (int)
11640          * service_min_restart_time_between     (long)
11641          * service_max_inactivity               (long)
11642          * service_bg_start_timeout             (long)
11643          * service_bg_activity_start_timeout    (long)
11644          * process_start_async                  (boolean)
11645          * </pre>
11646          *
11647          * <p>
11648          * Type: string
11649          * @hide
11650          * @see com.android.server.am.ActivityManagerConstants
11651          */
11652         public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants";
11653 
11654         /**
11655          * Feature flag to enable or disable the activity starts logging feature.
11656          * Type: int (0 for false, 1 for true)
11657          * Default: 1
11658          * @hide
11659          */
11660         public static final String ACTIVITY_STARTS_LOGGING_ENABLED
11661                 = "activity_starts_logging_enabled";
11662 
11663         /**
11664          * @hide
11665          * @see com.android.server.appbinding.AppBindingConstants
11666          */
11667         public static final String APP_BINDING_CONSTANTS = "app_binding_constants";
11668 
11669         /**
11670          * App ops specific settings.
11671          * This is encoded as a key=value list, separated by commas. Ex:
11672          *
11673          * "state_settle_time=10000"
11674          *
11675          * The following keys are supported:
11676          *
11677          * <pre>
11678          * top_state_settle_time                (long)
11679          * fg_service_state_settle_time         (long)
11680          * bg_state_settle_time                 (long)
11681          * </pre>
11682          *
11683          * <p>
11684          * Type: string
11685          * @hide
11686          * @see com.android.server.AppOpsService.Constants
11687          */
11688         public static final String APP_OPS_CONSTANTS = "app_ops_constants";
11689 
11690         /**
11691          * Device Idle (Doze) specific settings.
11692          * This is encoded as a key=value list, separated by commas. Ex:
11693          *
11694          * "inactive_to=60000,sensing_to=400000"
11695          *
11696          * The following keys are supported:
11697          *
11698          * <pre>
11699          * inactive_to                      (long)
11700          * sensing_to                       (long)
11701          * motion_inactive_to               (long)
11702          * idle_after_inactive_to           (long)
11703          * idle_pending_to                  (long)
11704          * max_idle_pending_to              (long)
11705          * idle_pending_factor              (float)
11706          * quick_doze_delay_to              (long)
11707          * idle_to                          (long)
11708          * max_idle_to                      (long)
11709          * idle_factor                      (float)
11710          * min_time_to_alarm                (long)
11711          * max_temp_app_whitelist_duration  (long)
11712          * notification_whitelist_duration  (long)
11713          * </pre>
11714          *
11715          * <p>
11716          * Type: string
11717          * @hide
11718          * @see com.android.server.DeviceIdleController.Constants
11719          */
11720         public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants";
11721 
11722         /**
11723          * Battery Saver specific settings
11724          * This is encoded as a key=value list, separated by commas. Ex:
11725          *
11726          * "vibration_disabled=true,adjust_brightness_factor=0.5"
11727          *
11728          * The following keys are supported:
11729          *
11730          * <pre>
11731          * advertise_is_enabled              (boolean)
11732          * datasaver_disabled                (boolean)
11733          * enable_night_mode                 (boolean)
11734          * launch_boost_disabled             (boolean)
11735          * vibration_disabled                (boolean)
11736          * animation_disabled                (boolean)
11737          * soundtrigger_disabled             (boolean)
11738          * fullbackup_deferred               (boolean)
11739          * keyvaluebackup_deferred           (boolean)
11740          * firewall_disabled                 (boolean)
11741          * gps_mode                          (int)
11742          * adjust_brightness_disabled        (boolean)
11743          * adjust_brightness_factor          (float)
11744          * force_all_apps_standby            (boolean)
11745          * force_background_check            (boolean)
11746          * optional_sensors_disabled         (boolean)
11747          * aod_disabled                      (boolean)
11748          * quick_doze_enabled                (boolean)
11749          * </pre>
11750          * @hide
11751          * @see com.android.server.power.batterysaver.BatterySaverPolicy
11752          */
11753         @TestApi
11754         public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants";
11755 
11756         /**
11757          * Battery Saver device specific settings
11758          * This is encoded as a key=value list, separated by commas.
11759          *
11760          * The following keys are supported:
11761          *
11762          * <pre>
11763          *     cpufreq-i (list of "core-number:frequency" pairs concatenated with /)
11764          *     cpufreq-n (list of "core-number:frequency" pairs concatenated with /)
11765          * </pre>
11766          *
11767          * See {@link com.android.server.power.batterysaver.BatterySaverPolicy} for the details.
11768          *
11769          * @hide
11770          */
11771         public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS =
11772                 "battery_saver_device_specific_constants";
11773 
11774         /**
11775          * Settings for adaptive Battery Saver mode. Uses the same flags as
11776          * {@link #BATTERY_SAVER_CONSTANTS}.
11777          *
11778          * @hide
11779          */
11780         public static final String BATTERY_SAVER_ADAPTIVE_CONSTANTS =
11781                 "battery_saver_adaptive_constants";
11782 
11783         /**
11784          * Device specific settings for adaptive Battery Saver mode. Uses the same flags as
11785          * {@link #BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS}.
11786          *
11787          * @hide
11788          */
11789         public static final String BATTERY_SAVER_ADAPTIVE_DEVICE_SPECIFIC_CONSTANTS =
11790                 "battery_saver_adaptive_device_specific_constants";
11791 
11792         /**
11793          * Battery tip specific settings
11794          * This is encoded as a key=value list, separated by commas. Ex:
11795          *
11796          * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true,"
11797          * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50,"
11798          * "high_usage_battery_draining=25,high_usage_period_ms=3000"
11799          *
11800          * The following keys are supported:
11801          *
11802          * <pre>
11803          * battery_tip_enabled              (boolean)
11804          * summary_enabled                  (boolean)
11805          * battery_saver_tip_enabled        (boolean)
11806          * high_usage_enabled               (boolean)
11807          * high_usage_app_count             (int)
11808          * high_usage_period_ms             (long)
11809          * high_usage_battery_draining      (int)
11810          * app_restriction_enabled          (boolean)
11811          * reduced_battery_enabled          (boolean)
11812          * reduced_battery_percent          (int)
11813          * low_battery_enabled              (boolean)
11814          * low_battery_hour                 (int)
11815          * </pre>
11816          * @hide
11817          */
11818         public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants";
11819 
11820         /**
11821          * Battery anomaly detection specific settings
11822          * This is encoded as a key=value list, separated by commas.
11823          * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via
11824          * {@link Uri#encode(String)}, separated by colons. Ex:
11825          *
11826          * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true,"
11827          * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon"
11828          *
11829          * The following keys are supported:
11830          *
11831          * <pre>
11832          * anomaly_detection_enabled       (boolean)
11833          * wakelock_enabled                (boolean)
11834          * wakelock_threshold              (long)
11835          * wakeup_alarm_enabled            (boolean)
11836          * wakeup_alarm_threshold          (long)
11837          * wakeup_blacklisted_tags         (string)
11838          * bluetooth_scan_enabled          (boolean)
11839          * bluetooth_scan_threshold        (long)
11840          * </pre>
11841          * @hide
11842          */
11843         public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants";
11844 
11845         /**
11846          * An integer to show the version of the anomaly config. Ex: 1, which means
11847          * current version is 1.
11848          * @hide
11849          */
11850         public static final String ANOMALY_CONFIG_VERSION = "anomaly_config_version";
11851 
11852         /**
11853          * A base64-encoded string represents anomaly stats config, used for
11854          * {@link android.app.StatsManager}.
11855          * @hide
11856          */
11857         public static final String ANOMALY_CONFIG = "anomaly_config";
11858 
11859         /**
11860          * Always on display(AOD) specific settings
11861          * This is encoded as a key=value list, separated by commas. Ex:
11862          *
11863          * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4"
11864          *
11865          * The following keys are supported:
11866          *
11867          * <pre>
11868          * screen_brightness_array         (int[])
11869          * dimming_scrim_array             (int[])
11870          * prox_screen_off_delay           (long)
11871          * prox_cooldown_trigger           (long)
11872          * prox_cooldown_period            (long)
11873          * </pre>
11874          * @hide
11875          */
11876         public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants";
11877 
11878         /**
11879         * System VDSO global setting. This links to the "sys.vdso" system property.
11880         * The following values are supported:
11881         * false  -> both 32 and 64 bit vdso disabled
11882         * 32     -> 32 bit vdso enabled
11883         * 64     -> 64 bit vdso enabled
11884         * Any other value defaults to both 32 bit and 64 bit true.
11885         * @hide
11886         */
11887         public static final String SYS_VDSO = "sys_vdso";
11888 
11889         /**
11890         * UidCpuPower global setting. This links the sys.uidcpupower system property.
11891         * The following values are supported:
11892         * 0 -> /proc/uid_cpupower/* are disabled
11893         * 1 -> /proc/uid_cpupower/* are enabled
11894         * Any other value defaults to enabled.
11895         * @hide
11896         */
11897         public static final String SYS_UIDCPUPOWER = "sys_uidcpupower";
11898 
11899         /**
11900         * traced global setting. This controls weather the deamons: traced and
11901         * traced_probes run. This links the sys.traced system property.
11902         * The following values are supported:
11903         * 0 -> traced and traced_probes are disabled
11904         * 1 -> traced and traced_probes are enabled
11905         * Any other value defaults to disabled.
11906         * @hide
11907         */
11908         public static final String SYS_TRACED = "sys_traced";
11909 
11910         /**
11911          * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the
11912          * device for this setting to take full effect.
11913          *
11914          * @hide
11915          */
11916         public static final String FPS_DEVISOR = "fps_divisor";
11917 
11918         /**
11919          * Flag to enable or disable display panel low power mode (lpm)
11920          * false -> Display panel power saving mode is disabled.
11921          * true  -> Display panel power saving mode is enabled.
11922          *
11923          * @hide
11924          */
11925         public static final String DISPLAY_PANEL_LPM = "display_panel_lpm";
11926 
11927         /**
11928          * App time limit usage source setting.
11929          * This controls which app in a task will be considered the source of usage when
11930          * calculating app usage time limits.
11931          *
11932          * 1 -> task root app
11933          * 2 -> current app
11934          * Any other value defaults to task root app.
11935          *
11936          * Need to reboot the device for this setting to take effect.
11937          * @hide
11938          */
11939         public static final String APP_TIME_LIMIT_USAGE_SOURCE = "app_time_limit_usage_source";
11940 
11941         /**
11942          * App standby (app idle) specific settings.
11943          * This is encoded as a key=value list, separated by commas. Ex:
11944          * <p>
11945          * "idle_duration=5000,parole_interval=4500,screen_thresholds=0/0/60000/120000"
11946          * <p>
11947          * All durations are in millis.
11948          * Array values are separated by forward slashes
11949          * The following keys are supported:
11950          *
11951          * <pre>
11952          * parole_interval                  (long)
11953          * parole_window                    (long)
11954          * parole_duration                  (long)
11955          * screen_thresholds                (long[4])
11956          * elapsed_thresholds               (long[4])
11957          * strong_usage_duration            (long)
11958          * notification_seen_duration       (long)
11959          * system_update_usage_duration     (long)
11960          * prediction_timeout               (long)
11961          * sync_adapter_duration            (long)
11962          * exempted_sync_duration           (long)
11963          * system_interaction_duration      (long)
11964          * initial_foreground_service_start_duration (long)
11965          * stable_charging_threshold        (long)
11966          *
11967          * idle_duration        (long) // This is deprecated and used to circumvent b/26355386.
11968          * idle_duration2       (long) // deprecated
11969          * wallclock_threshold  (long) // deprecated
11970          * </pre>
11971          *
11972          * <p>
11973          * Type: string
11974          * @hide
11975          * @see com.android.server.usage.UsageStatsService.SettingsObserver
11976          */
11977         public static final String APP_IDLE_CONSTANTS = "app_idle_constants";
11978 
11979         /**
11980          * Enable ART bytecode verification verifications for debuggable apps.
11981          * 0 = disable, 1 = enable.
11982          * @hide
11983          */
11984         public static final String ART_VERIFIER_VERIFY_DEBUGGABLE =
11985                 "art_verifier_verify_debuggable";
11986 
11987         /**
11988          * Power manager specific settings.
11989          * This is encoded as a key=value list, separated by commas. Ex:
11990          *
11991          * "no_cached_wake_locks=1"
11992          *
11993          * The following keys are supported:
11994          *
11995          * <pre>
11996          * no_cached_wake_locks                 (boolean)
11997          * </pre>
11998          *
11999          * <p>
12000          * Type: string
12001          * @hide
12002          * @see com.android.server.power.PowerManagerConstants
12003          */
12004         public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants";
12005 
12006         /**
12007          * Alarm manager specific settings.
12008          * This is encoded as a key=value list, separated by commas. Ex:
12009          *
12010          * "min_futurity=5000,allow_while_idle_short_time=4500"
12011          *
12012          * The following keys are supported:
12013          *
12014          * <pre>
12015          * min_futurity                         (long)
12016          * min_interval                         (long)
12017          * allow_while_idle_short_time          (long)
12018          * allow_while_idle_long_time           (long)
12019          * allow_while_idle_whitelist_duration  (long)
12020          * </pre>
12021          *
12022          * <p>
12023          * Type: string
12024          * @hide
12025          * @see com.android.server.AlarmManagerService.Constants
12026          */
12027         public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants";
12028 
12029         /**
12030          * Job scheduler specific settings.
12031          * This is encoded as a key=value list, separated by commas. Ex:
12032          *
12033          * "min_ready_jobs_count=2,moderate_use_factor=.5"
12034          *
12035          * The following keys are supported:
12036          *
12037          * <pre>
12038          * min_idle_count                       (int)
12039          * min_charging_count                   (int)
12040          * min_connectivity_count               (int)
12041          * min_content_count                    (int)
12042          * min_ready_jobs_count                 (int)
12043          * heavy_use_factor                     (float)
12044          * moderate_use_factor                  (float)
12045          * fg_job_count                         (int)
12046          * bg_normal_job_count                  (int)
12047          * bg_moderate_job_count                (int)
12048          * bg_low_job_count                     (int)
12049          * bg_critical_job_count                (int)
12050          * </pre>
12051          *
12052          * <p>
12053          * Type: string
12054          * @hide
12055          * @see com.android.server.job.JobSchedulerService.Constants
12056          */
12057         public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants";
12058 
12059         /**
12060          * Job scheduler QuotaController specific settings.
12061          * This is encoded as a key=value list, separated by commas. Ex:
12062          *
12063          * "max_job_count_working=5,max_job_count_rare=2"
12064          *
12065          * <p>
12066          * Type: string
12067          *
12068          * @hide
12069          * @see com.android.server.job.JobSchedulerService.Constants
12070          */
12071         public static final String JOB_SCHEDULER_QUOTA_CONTROLLER_CONSTANTS =
12072                 "job_scheduler_quota_controller_constants";
12073 
12074         /**
12075          * Job scheduler TimeController specific settings.
12076          * This is encoded as a key=value list, separated by commas. Ex:
12077          *
12078          * "skip_not_ready_jobs=true5,other_key=2"
12079          *
12080          * <p>
12081          * Type: string
12082          *
12083          * @hide
12084          * @see com.android.server.job.JobSchedulerService.Constants
12085          */
12086         public static final String JOB_SCHEDULER_TIME_CONTROLLER_CONSTANTS =
12087                 "job_scheduler_time_controller_constants";
12088 
12089         /**
12090          * ShortcutManager specific settings.
12091          * This is encoded as a key=value list, separated by commas. Ex:
12092          *
12093          * "reset_interval_sec=86400,max_updates_per_interval=1"
12094          *
12095          * The following keys are supported:
12096          *
12097          * <pre>
12098          * reset_interval_sec              (long)
12099          * max_updates_per_interval        (int)
12100          * max_icon_dimension_dp           (int, DP)
12101          * max_icon_dimension_dp_lowram    (int, DP)
12102          * max_shortcuts                   (int)
12103          * icon_quality                    (int, 0-100)
12104          * icon_format                     (String)
12105          * </pre>
12106          *
12107          * <p>
12108          * Type: string
12109          * @hide
12110          * @see com.android.server.pm.ShortcutService.ConfigConstants
12111          */
12112         public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants";
12113 
12114         /**
12115          * DevicePolicyManager specific settings.
12116          * This is encoded as a key=value list, separated by commas. Ex:
12117          *
12118          * <pre>
12119          * das_died_service_reconnect_backoff_sec       (long)
12120          * das_died_service_reconnect_backoff_increase  (float)
12121          * das_died_service_reconnect_max_backoff_sec   (long)
12122          * </pre>
12123          *
12124          * <p>
12125          * Type: string
12126          * @hide
12127          * see also com.android.server.devicepolicy.DevicePolicyConstants
12128          */
12129         public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants";
12130 
12131         /**
12132          * TextClassifier specific settings.
12133          * This is encoded as a key=value list, separated by commas. String[] types like
12134          * entity_list_default use ":" as delimiter for values. Ex:
12135          *
12136          * <pre>
12137          * classify_text_max_range_length                   (int)
12138          * detect_language_from_text_enabled                (boolean)
12139          * entity_list_default                              (String[])
12140          * entity_list_editable                             (String[])
12141          * entity_list_not_editable                         (String[])
12142          * generate_links_log_sample_rate                   (int)
12143          * generate_links_max_text_length                   (int)
12144          * in_app_conversation_action_types_default         (String[])
12145          * lang_id_context_settings                         (float[])
12146          * lang_id_threshold_override                       (float)
12147          * local_textclassifier_enabled                     (boolean)
12148          * model_dark_launch_enabled                        (boolean)
12149          * notification_conversation_action_types_default   (String[])
12150          * smart_linkify_enabled                            (boolean)
12151          * smart_select_animation_enabled                   (boolean)
12152          * smart_selection_enabled                          (boolean)
12153          * smart_text_share_enabled                         (boolean)
12154          * suggest_selection_max_range_length               (int)
12155          * system_textclassifier_enabled                    (boolean)
12156          * template_intent_factory_enabled                  (boolean)
12157          * translate_in_classification_enabled              (boolean)
12158          * </pre>
12159          *
12160          * <p>
12161          * Type: string
12162          * @hide
12163          * see also android.view.textclassifier.TextClassificationConstants
12164          */
12165         public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants";
12166 
12167         /**
12168          * BatteryStats specific settings.
12169          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
12170          *
12171          * The following keys are supported:
12172          * <pre>
12173          * track_cpu_times_by_proc_state (boolean)
12174          * track_cpu_active_cluster_time (boolean)
12175          * read_binary_cpu_time          (boolean)
12176          * proc_state_cpu_times_read_delay_ms (long)
12177          * external_stats_collection_rate_limit_ms (long)
12178          * battery_level_collection_delay_ms (long)
12179          * max_history_files (int)
12180          * max_history_buffer_kb (int)
12181          * battery_charged_delay_ms (int)
12182          * </pre>
12183          *
12184          * <p>
12185          * Type: string
12186          * @hide
12187          * see also com.android.internal.os.BatteryStatsImpl.Constants
12188          */
12189         public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants";
12190 
12191         /**
12192          * SyncManager specific settings.
12193          *
12194          * <p>
12195          * Type: string
12196          * @hide
12197          * @see com.android.server.content.SyncManagerConstants
12198          */
12199         public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants";
12200 
12201         /**
12202          * Broadcast dispatch tuning parameters specific to foreground broadcasts.
12203          *
12204          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
12205          *
12206          * The following keys are supported:
12207          * <pre>
12208          * bcast_timeout                (long)
12209          * bcast_slow_time              (long)
12210          * bcast_deferral               (long)
12211          * bcast_deferral_decay_factor  (float)
12212          * bcast_deferral_floor         (long)
12213          * bcast_allow_bg_activity_start_timeout    (long)
12214          * </pre>
12215          *
12216          * @hide
12217          */
12218         public static final String BROADCAST_FG_CONSTANTS = "bcast_fg_constants";
12219 
12220         /**
12221          * Broadcast dispatch tuning parameters specific to background broadcasts.
12222          *
12223          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true".
12224          * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys.
12225          *
12226          * @hide
12227          */
12228         public static final String BROADCAST_BG_CONSTANTS = "bcast_bg_constants";
12229 
12230         /**
12231          * Broadcast dispatch tuning parameters specific to specific "offline" broadcasts.
12232          *
12233          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true".
12234          * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys.
12235          *
12236          * @hide
12237          */
12238         public static final String BROADCAST_OFFLOAD_CONSTANTS = "bcast_offload_constants";
12239 
12240         /**
12241          * Whether or not App Standby feature is enabled by system. This controls throttling of apps
12242          * based on usage patterns and predictions. Platform will turn on this feature if both this
12243          * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on.
12244          * Type: int (0 for false, 1 for true)
12245          * Default: 1
12246          * @hide
12247          * @see #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED
12248          */
12249         @SystemApi
12250         public static final String APP_STANDBY_ENABLED = "app_standby_enabled";
12251 
12252         /**
12253          * Whether or not adaptive battery feature is enabled by user. Platform will turn on this
12254          * feature if both this flag and {@link #APP_STANDBY_ENABLED} is on.
12255          * Type: int (0 for false, 1 for true)
12256          * Default: 1
12257          * @hide
12258          * @see #APP_STANDBY_ENABLED
12259          */
12260         public static final String ADAPTIVE_BATTERY_MANAGEMENT_ENABLED =
12261                 "adaptive_battery_management_enabled";
12262 
12263         /**
12264          * Whether or not app auto restriction is enabled. When it is enabled, settings app will
12265          * auto restrict the app if it has bad behavior(e.g. hold wakelock for long time).
12266          *
12267          * Type: boolean (0 for false, 1 for true)
12268          * Default: 1
12269          *
12270          * @hide
12271          */
12272         public static final String APP_AUTO_RESTRICTION_ENABLED =
12273                 "app_auto_restriction_enabled";
12274 
12275         private static final Validator APP_AUTO_RESTRICTION_ENABLED_VALIDATOR =
12276                 BOOLEAN_VALIDATOR;
12277 
12278         /**
12279          * Feature flag to enable or disable the Forced App Standby feature.
12280          * Type: int (0 for false, 1 for true)
12281          * Default: 1
12282          * @hide
12283          */
12284         public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled";
12285 
12286         /**
12287          * Whether or not to enable Forced App Standby on small battery devices.
12288          * Type: int (0 for false, 1 for true)
12289          * Default: 0
12290          * @hide
12291          */
12292         public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED
12293                 = "forced_app_standby_for_small_battery_enabled";
12294 
12295         /**
12296          * Whether or not to enable the User Absent, Radios Off feature on small battery devices.
12297          * Type: int (0 for false, 1 for true)
12298          * Default: 0
12299          * @hide
12300          */
12301         public static final String USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED
12302                 = "user_absent_radios_off_for_small_battery_enabled";
12303 
12304         /**
12305          * Whether or not to enable the User Absent, Touch Off feature on small battery devices.
12306          * Type: int (0 for false, 1 for true)
12307          * Default: 0
12308          * @hide
12309          */
12310         public static final String USER_ABSENT_TOUCH_OFF_FOR_SMALL_BATTERY_ENABLED
12311                 = "user_absent_touch_off_for_small_battery_enabled";
12312 
12313         /**
12314          * Whether or not to turn on Wifi when proxy is disconnected.
12315          * Type: int (0 for false, 1 for true)
12316          * Default: 1
12317          * @hide
12318          */
12319         public static final String WIFI_ON_WHEN_PROXY_DISCONNECTED
12320                 = "wifi_on_when_proxy_disconnected";
12321 
12322         /**
12323          * Time Only Mode specific settings.
12324          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
12325          *
12326          * The following keys are supported:
12327          *
12328          * <pre>
12329          * enabled                  (boolean)
12330          * disable_home             (boolean)
12331          * disable_tilt_to_wake     (boolean)
12332          * disable_touch_to_wake    (boolean)
12333          * </pre>
12334          * Type: string
12335          * @hide
12336          */
12337         public static final String TIME_ONLY_MODE_CONSTANTS
12338                 = "time_only_mode_constants";
12339 
12340         /**
12341          * Whether of not to send keycode sleep for ungaze when Home is the foreground activity on
12342          * watch type devices.
12343          * Type: int (0 for false, 1 for true)
12344          * Default: 0
12345          * @hide
12346          */
12347         public static final String UNGAZE_SLEEP_ENABLED = "ungaze_sleep_enabled";
12348 
12349         /**
12350          * Whether or not Network Watchlist feature is enabled.
12351          * Type: int (0 for false, 1 for true)
12352          * Default: 0
12353          * @hide
12354          */
12355         public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled";
12356 
12357         /**
12358          * Whether or not show hidden launcher icon apps feature is enabled.
12359          * Type: int (0 for false, 1 for true)
12360          * Default: 1
12361          * @hide
12362          */
12363         public static final String SHOW_HIDDEN_LAUNCHER_ICON_APPS_ENABLED =
12364                 "show_hidden_icon_apps_enabled";
12365 
12366         /**
12367          * Whether or not show new app installed notification is enabled.
12368          * Type: int (0 for false, 1 for true)
12369          * Default: 0
12370          * @hide
12371          */
12372         public static final String SHOW_NEW_APP_INSTALLED_NOTIFICATION_ENABLED =
12373                 "show_new_app_installed_notification_enabled";
12374 
12375         /**
12376          * Flag to keep background restricted profiles running after exiting. If disabled,
12377          * the restricted profile can be put into stopped state as soon as the user leaves it.
12378          * Type: int (0 for false, 1 for true)
12379          *
12380          * Overridden by the system based on device information. If null, the value specified
12381          * by {@code config_keepRestrictedProfilesInBackground} is used.
12382          *
12383          * @hide
12384          */
12385         public static final String KEEP_PROFILE_IN_BACKGROUND = "keep_profile_in_background";
12386 
12387         /**
12388          * The default time in ms within which a subsequent connection from an always allowed system
12389          * is allowed to reconnect without user interaction.
12390          *
12391          * @hide
12392          */
12393         public static final long DEFAULT_ADB_ALLOWED_CONNECTION_TIME = 604800000;
12394 
12395         /**
12396          * When the user first connects their device to a system a prompt is displayed to allow
12397          * the adb connection with an option to 'Always allow' connections from this system. If the
12398          * user selects this always allow option then the connection time is stored for the system.
12399          * This setting is the time in ms within which a subsequent connection from an always
12400          * allowed system is allowed to reconnect without user interaction.
12401          *
12402          * Type: long
12403          *
12404          * @hide
12405          */
12406         public static final String ADB_ALLOWED_CONNECTION_TIME =
12407                 "adb_allowed_connection_time";
12408 
12409         /**
12410          * Get the key that retrieves a bluetooth headset's priority.
12411          * @hide
12412          */
getBluetoothHeadsetPriorityKey(String address)12413         public static final String getBluetoothHeadsetPriorityKey(String address) {
12414             return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12415         }
12416 
12417         /**
12418          * Get the key that retrieves a bluetooth a2dp sink's priority.
12419          * @hide
12420          */
getBluetoothA2dpSinkPriorityKey(String address)12421         public static final String getBluetoothA2dpSinkPriorityKey(String address) {
12422             return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12423         }
12424 
12425         /**
12426          * Get the key that retrieves a bluetooth a2dp src's priority.
12427          * @hide
12428          */
getBluetoothA2dpSrcPriorityKey(String address)12429         public static final String getBluetoothA2dpSrcPriorityKey(String address) {
12430             return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12431         }
12432 
12433         /**
12434          * Get the key that retrieves a bluetooth a2dp device's ability to support optional codecs.
12435          * @hide
12436          */
getBluetoothA2dpSupportsOptionalCodecsKey(String address)12437         public static final String getBluetoothA2dpSupportsOptionalCodecsKey(String address) {
12438             return BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX +
12439                     address.toUpperCase(Locale.ROOT);
12440         }
12441 
12442         /**
12443          * Get the key that retrieves whether a bluetooth a2dp device should have optional codecs
12444          * enabled.
12445          * @hide
12446          */
getBluetoothA2dpOptionalCodecsEnabledKey(String address)12447         public static final String getBluetoothA2dpOptionalCodecsEnabledKey(String address) {
12448             return BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX +
12449                     address.toUpperCase(Locale.ROOT);
12450         }
12451 
12452         /**
12453          * Get the key that retrieves a bluetooth Input Device's priority.
12454          * @hide
12455          */
getBluetoothHidHostPriorityKey(String address)12456         public static final String getBluetoothHidHostPriorityKey(String address) {
12457             return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12458         }
12459 
12460         /**
12461          * Get the key that retrieves a bluetooth pan client priority.
12462          * @hide
12463          */
getBluetoothPanPriorityKey(String address)12464         public static final String getBluetoothPanPriorityKey(String address) {
12465             return BLUETOOTH_PAN_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12466         }
12467 
12468         /**
12469          * Get the key that retrieves a bluetooth hearing aid priority.
12470          * @hide
12471          */
getBluetoothHearingAidPriorityKey(String address)12472         public static final String getBluetoothHearingAidPriorityKey(String address) {
12473             return BLUETOOTH_HEARING_AID_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12474         }
12475 
12476         /**
12477          * Get the key that retrieves a bluetooth map priority.
12478          * @hide
12479          */
getBluetoothMapPriorityKey(String address)12480         public static final String getBluetoothMapPriorityKey(String address) {
12481             return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12482         }
12483 
12484         /**
12485          * Get the key that retrieves a bluetooth map client priority.
12486          * @hide
12487          */
getBluetoothMapClientPriorityKey(String address)12488         public static final String getBluetoothMapClientPriorityKey(String address) {
12489             return BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12490         }
12491 
12492         /**
12493          * Get the key that retrieves a bluetooth pbap client priority.
12494          * @hide
12495          */
getBluetoothPbapClientPriorityKey(String address)12496         public static final String getBluetoothPbapClientPriorityKey(String address) {
12497             return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12498         }
12499 
12500         /**
12501          * Get the key that retrieves a bluetooth sap priority.
12502          * @hide
12503          */
getBluetoothSapPriorityKey(String address)12504         public static final String getBluetoothSapPriorityKey(String address) {
12505             return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
12506         }
12507 
12508         /**
12509          * Scaling factor for normal window animations. Setting to 0 will
12510          * disable window animations.
12511          */
12512         public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
12513 
12514         /**
12515          * Scaling factor for activity transition animations. Setting to 0 will
12516          * disable window animations.
12517          */
12518         public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
12519 
12520         /**
12521          * Scaling factor for Animator-based animations. This affects both the
12522          * start delay and duration of all such animations. Setting to 0 will
12523          * cause animations to end immediately. The default value is 1.
12524          */
12525         public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
12526 
12527         /**
12528          * Scaling factor for normal window animations. Setting to 0 will
12529          * disable window animations.
12530          *
12531          * @hide
12532          */
12533         public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
12534 
12535         /**
12536          * If 0, the compatibility mode is off for all applications.
12537          * If 1, older applications run under compatibility mode.
12538          * TODO: remove this settings before code freeze (bug/1907571)
12539          * @hide
12540          */
12541         public static final String COMPATIBILITY_MODE = "compatibility_mode";
12542 
12543         /**
12544          * CDMA only settings
12545          * Emergency Tone  0 = Off
12546          *                 1 = Alert
12547          *                 2 = Vibrate
12548          * @hide
12549          */
12550         public static final String EMERGENCY_TONE = "emergency_tone";
12551 
12552         private static final Validator EMERGENCY_TONE_VALIDATOR =
12553                 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"});
12554 
12555         /**
12556          * CDMA only settings
12557          * Whether the auto retry is enabled. The value is
12558          * boolean (1 or 0).
12559          * @hide
12560          */
12561         public static final String CALL_AUTO_RETRY = "call_auto_retry";
12562 
12563         private static final Validator CALL_AUTO_RETRY_VALIDATOR = BOOLEAN_VALIDATOR;
12564 
12565         /**
12566          * A setting that can be read whether the emergency affordance is currently needed.
12567          * The value is a boolean (1 or 0).
12568          * @hide
12569          */
12570         public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed";
12571 
12572         /**
12573          * Whether to enable automatic system server heap dumps. This only works on userdebug or
12574          * eng builds, not on user builds. This is set by the user and overrides the config value.
12575          * 1 means enable, 0 means disable.
12576          *
12577          * @hide
12578          */
12579         public static final String ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS =
12580                 "enable_automatic_system_server_heap_dumps";
12581 
12582         private static final Validator ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS_VALIDATOR =
12583                 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1"});
12584 
12585         /**
12586          * See RIL_PreferredNetworkType in ril.h
12587          * @hide
12588          */
12589         @UnsupportedAppUsage
12590         public static final String PREFERRED_NETWORK_MODE =
12591                 "preferred_network_mode";
12592 
12593         /**
12594          * Name of an application package to be debugged.
12595          */
12596         public static final String DEBUG_APP = "debug_app";
12597 
12598         /**
12599          * If 1, when launching DEBUG_APP it will wait for the debugger before
12600          * starting user code.  If 0, it will run normally.
12601          */
12602         public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
12603 
12604         /**
12605          * Allow GPU debug layers?
12606          * 0 = no
12607          * 1 = yes
12608          * @hide
12609          */
12610         public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers";
12611 
12612         /**
12613          * App allowed to load GPU debug layers
12614          * @hide
12615          */
12616         public static final String GPU_DEBUG_APP = "gpu_debug_app";
12617 
12618         /**
12619          * Package containing ANGLE libraries other than system, which are only available
12620          * to dumpable apps that opt-in.
12621          * @hide
12622          */
12623         public static final String GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE =
12624                 "angle_debug_package";
12625 
12626         /**
12627          * Force all PKGs to use ANGLE, regardless of any other settings
12628          * The value is a boolean (1 or 0).
12629          * @hide
12630          */
12631         public static final String GLOBAL_SETTINGS_ANGLE_GL_DRIVER_ALL_ANGLE =
12632                 "angle_gl_driver_all_angle";
12633 
12634         /**
12635          * List of PKGs that have an OpenGL driver selected
12636          * @hide
12637          */
12638         public static final String GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_PKGS =
12639                 "angle_gl_driver_selection_pkgs";
12640 
12641         /**
12642          * List of selected OpenGL drivers, corresponding to the PKGs in GLOBAL_SETTINGS_DRIVER_PKGS
12643          * @hide
12644          */
12645         public static final String GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_VALUES =
12646                 "angle_gl_driver_selection_values";
12647 
12648         /**
12649          * List of package names that should check ANGLE rules
12650          * @hide
12651          */
12652         public static final String GLOBAL_SETTINGS_ANGLE_WHITELIST =
12653                 "angle_whitelist";
12654 
12655         /**
12656          * Show the "ANGLE In Use" dialog box to the user when ANGLE is the OpenGL driver.
12657          * The value is a boolean (1 or 0).
12658          * @hide
12659          */
12660         public static final String GLOBAL_SETTINGS_SHOW_ANGLE_IN_USE_DIALOG_BOX =
12661                 "show_angle_in_use_dialog_box";
12662 
12663         /**
12664          * Game Driver global preference for all Apps.
12665          * 0 = Default
12666          * 1 = All Apps use Game Driver
12667          * 2 = All Apps use system graphics driver
12668          * @hide
12669          */
12670         public static final String GAME_DRIVER_ALL_APPS = "game_driver_all_apps";
12671 
12672         /**
12673          * List of Apps selected to use Game Driver.
12674          * i.e. <pkg1>,<pkg2>,...,<pkgN>
12675          * @hide
12676          */
12677         public static final String GAME_DRIVER_OPT_IN_APPS = "game_driver_opt_in_apps";
12678 
12679         /**
12680          * List of Apps selected to use prerelease Game Driver.
12681          * i.e. <pkg1>,<pkg2>,...,<pkgN>
12682          * @hide
12683          */
12684         public static final String GAME_DRIVER_PRERELEASE_OPT_IN_APPS =
12685                 "game_driver_prerelease_opt_in_apps";
12686 
12687         /**
12688          * List of Apps selected not to use Game Driver.
12689          * i.e. <pkg1>,<pkg2>,...,<pkgN>
12690          * @hide
12691          */
12692         public static final String GAME_DRIVER_OPT_OUT_APPS = "game_driver_opt_out_apps";
12693 
12694         /**
12695          * Apps on the blacklist that are forbidden to use Game Driver.
12696          * @hide
12697          */
12698         public static final String GAME_DRIVER_BLACKLIST = "game_driver_blacklist";
12699 
12700         /**
12701          * List of blacklists, each blacklist is a blacklist for a specific version of Game Driver.
12702          * @hide
12703          */
12704         public static final String GAME_DRIVER_BLACKLISTS = "game_driver_blacklists";
12705 
12706         /**
12707          * Apps on the whitelist that are allowed to use Game Driver.
12708          * The string is a list of application package names, seperated by comma.
12709          * i.e. <apk1>,<apk2>,...,<apkN>
12710          * @hide
12711          */
12712         public static final String GAME_DRIVER_WHITELIST = "game_driver_whitelist";
12713 
12714         /**
12715          * List of libraries in sphal accessible by Game Driver
12716          * The string is a list of library names, separated by colon.
12717          * i.e. <lib1>:<lib2>:...:<libN>
12718          * @hide
12719          */
12720         public static final String GAME_DRIVER_SPHAL_LIBRARIES = "game_driver_sphal_libraries";
12721 
12722         /**
12723          * Ordered GPU debug layer list for Vulkan
12724          * i.e. <layer1>:<layer2>:...:<layerN>
12725          * @hide
12726          */
12727         public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers";
12728 
12729         /**
12730          * Ordered GPU debug layer list for GLES
12731          * i.e. <layer1>:<layer2>:...:<layerN>
12732          * @hide
12733          */
12734         public static final String GPU_DEBUG_LAYERS_GLES = "gpu_debug_layers_gles";
12735 
12736         /**
12737          * Addition app for GPU layer discovery
12738          * @hide
12739          */
12740         public static final String GPU_DEBUG_LAYER_APP = "gpu_debug_layer_app";
12741 
12742         /**
12743          * Control whether the process CPU usage meter should be shown.
12744          *
12745          * @deprecated This functionality is no longer available as of
12746          * {@link android.os.Build.VERSION_CODES#N_MR1}.
12747          */
12748         @Deprecated
12749         public static final String SHOW_PROCESSES = "show_processes";
12750 
12751         /**
12752          * If 1 low power mode (aka battery saver) is enabled.
12753          * @hide
12754          */
12755         @TestApi
12756         public static final String LOW_POWER_MODE = "low_power";
12757 
12758         /**
12759          * If 1, battery saver ({@link #LOW_POWER_MODE}) will be re-activated after the device
12760          * is unplugged from a charger or rebooted.
12761          * @hide
12762          */
12763         @TestApi
12764         public static final String LOW_POWER_MODE_STICKY = "low_power_sticky";
12765 
12766         /**
12767          * When a device is unplugged from a changer (or is rebooted), do not re-activate battery
12768          * saver even if {@link #LOW_POWER_MODE_STICKY} is 1, if the battery level is equal to or
12769          * above this threshold.
12770          *
12771          * @hide
12772          */
12773         public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL =
12774                 "low_power_sticky_auto_disable_level";
12775 
12776         private static final Validator LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL_VALIDATOR =
12777                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 100);
12778 
12779         /**
12780          * Whether sticky battery saver should be deactivated once the battery level has reached the
12781          * threshold specified by {@link #LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL}.
12782          *
12783          * @hide
12784          */
12785         public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED =
12786                 "low_power_sticky_auto_disable_enabled";
12787 
12788         private static final Validator LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED_VALIDATOR =
12789                 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1"});
12790 
12791         /**
12792          * Battery level [1-100] at which low power mode automatically turns on.
12793          * If 0, it will not automatically turn on. For Q and newer, it will only automatically
12794          * turn on if the value is greater than 0 and the {@link #AUTOMATIC_POWER_SAVE_MODE}
12795          * setting is also set to
12796          * {@link android.os.PowerManager.AutoPowerSaveMode#POWER_SAVE_MODE_TRIGGER_PERCENTAGE}.
12797          * @see #AUTOMATIC_POWER_SAVE_MODE
12798          * @see android.os.PowerManager#getPowerSaveModeTrigger()
12799          * @hide
12800          */
12801         public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
12802 
12803         private static final Validator LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR =
12804                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 100);
12805 
12806         /**
12807          * Whether battery saver is currently set to trigger based on percentage, dynamic power
12808          * savings trigger, or none. See {@link AutoPowerSaveModeTriggers} for
12809          * accepted values.
12810          *
12811          *  @hide
12812          */
12813         @TestApi
12814         public static final String AUTOMATIC_POWER_SAVE_MODE = "automatic_power_save_mode";
12815 
12816         private static final Validator AUTOMATIC_POWER_SAVE_MODE_VALIDATOR =
12817                 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1"});
12818 
12819         /**
12820          * The setting that backs the disable threshold for the setPowerSavingsWarning api in
12821          * PowerManager
12822          *
12823          * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int)
12824          * @hide
12825          */
12826         @TestApi
12827         public static final String DYNAMIC_POWER_SAVINGS_DISABLE_THRESHOLD =
12828                 "dynamic_power_savings_disable_threshold";
12829         private static final Validator DYNAMIC_POWER_SAVINGS_VALIDATOR =
12830                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 100);
12831 
12832         /**
12833          * The setting which backs the setDynamicPowerSaveHint api in PowerManager.
12834          *
12835          * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int)
12836          * @hide
12837          */
12838         @TestApi
12839         public static final String DYNAMIC_POWER_SAVINGS_ENABLED = "dynamic_power_savings_enabled";
12840 
12841         /**
12842          * A long value indicating how much longer the system battery is estimated to last in
12843          * millis. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value
12844          * was updated.
12845          *
12846          * @hide
12847          */
12848         public static final String TIME_REMAINING_ESTIMATE_MILLIS =
12849                 "time_remaining_estimate_millis";
12850 
12851         /**
12852          * A boolean indicating whether {@link #TIME_REMAINING_ESTIMATE_MILLIS} is based customized
12853          * to the devices usage or using global models. See
12854          * {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value was updated.
12855          *
12856          * @hide
12857          */
12858         public static final String TIME_REMAINING_ESTIMATE_BASED_ON_USAGE =
12859                 "time_remaining_estimate_based_on_usage";
12860 
12861         /**
12862          * A long value indicating how long the system battery takes to deplete from 100% to 0% on
12863          * average based on historical drain rates. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME}
12864          * for the last time this value was updated.
12865          *
12866          * @hide
12867          */
12868         public static final String AVERAGE_TIME_TO_DISCHARGE = "average_time_to_discharge";
12869 
12870         /**
12871          * A long indicating the epoch time in milliseconds when
12872          * {@link #TIME_REMAINING_ESTIMATE_MILLIS}, {@link #TIME_REMAINING_ESTIMATE_BASED_ON_USAGE},
12873          * and {@link #AVERAGE_TIME_TO_DISCHARGE} were last updated.
12874          *
12875          * @hide
12876          */
12877         public static final String BATTERY_ESTIMATES_LAST_UPDATE_TIME =
12878                 "battery_estimates_last_update_time";
12879 
12880         /**
12881          * The max value for {@link #LOW_POWER_MODE_TRIGGER_LEVEL}. If this setting is not set
12882          * or the value is 0, the default max will be used.
12883          *
12884          * @hide
12885          */
12886         public static final String LOW_POWER_MODE_TRIGGER_LEVEL_MAX = "low_power_trigger_level_max";
12887 
12888         /**
12889          * See com.android.settingslib.fuelgauge.BatterySaverUtils.
12890          * @hide
12891          */
12892         public static final String LOW_POWER_MODE_SUGGESTION_PARAMS =
12893                 "low_power_mode_suggestion_params";
12894 
12895         /**
12896          * If not 0, the activity manager will aggressively finish activities and
12897          * processes as soon as they are no longer needed.  If 0, the normal
12898          * extended lifetime is used.
12899          */
12900         public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
12901 
12902         /**
12903          * If nonzero, all system error dialogs will be hidden.  For example, the
12904          * crash and ANR dialogs will not be shown, and the system will just proceed
12905          * as if they had been accepted by the user.
12906          * @hide
12907          */
12908         public static final String HIDE_ERROR_DIALOGS = "hide_error_dialogs";
12909 
12910         /**
12911          * Use Dock audio output for media:
12912          *      0 = disabled
12913          *      1 = enabled
12914          * @hide
12915          */
12916         public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
12917 
12918         private static final Validator DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
12919 
12920         /**
12921          * The surround sound formats AC3, DTS or IEC61937 are
12922          * available for use if they are detected.
12923          * This is the default mode.
12924          *
12925          * Note that AUTO is equivalent to ALWAYS for Android TVs and other
12926          * devices that have an S/PDIF output. This is because S/PDIF
12927          * is unidirectional and the TV cannot know if a decoder is
12928          * connected. So it assumes they are always available.
12929          * @hide
12930          */
12931          public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0;
12932 
12933         /**
12934          * AC3, DTS or IEC61937 are NEVER available, even if they
12935          * are detected by the hardware. Those formats will not be
12936          * reported.
12937          *
12938          * An example use case would be an AVR reports that it is capable of
12939          * surround sound decoding but is broken. If NEVER is chosen
12940          * then apps must use PCM output instead of encoded output.
12941          * @hide
12942          */
12943          public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1;
12944 
12945         /**
12946          * AC3, DTS or IEC61937 are ALWAYS available, even if they
12947          * are not detected by the hardware. Those formats will be
12948          * reported as part of the HDMI output capability. Applications
12949          * are then free to use either PCM or encoded output.
12950          *
12951          * An example use case would be a when TV was connected over
12952          * TOS-link to an AVR. But the TV could not see it because TOS-link
12953          * is unidirectional.
12954          * @hide
12955          */
12956          public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2;
12957 
12958         /**
12959          * Surround sound formats are available according to the choice
12960          * of user, even if they are not detected by the hardware. Those
12961          * formats will be reported as part of the HDMI output capability.
12962          * Applications are then free to use either PCM or encoded output.
12963          *
12964          * An example use case would be an AVR that doesn't report a surround
12965          * format while the user knows the AVR does support it.
12966          * @hide
12967          */
12968         public static final int ENCODED_SURROUND_OUTPUT_MANUAL = 3;
12969 
12970         /**
12971          * Set to ENCODED_SURROUND_OUTPUT_AUTO,
12972          * ENCODED_SURROUND_OUTPUT_NEVER,
12973          * ENCODED_SURROUND_OUTPUT_ALWAYS or
12974          * ENCODED_SURROUND_OUTPUT_MANUAL
12975          * @hide
12976          */
12977         public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output";
12978 
12979         private static final Validator ENCODED_SURROUND_OUTPUT_VALIDATOR =
12980                 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2", "3"});
12981 
12982         /**
12983          * Surround sounds formats that are enabled when ENCODED_SURROUND_OUTPUT is set to
12984          * ENCODED_SURROUND_OUTPUT_MANUAL. Encoded as comma separated list. Allowed values
12985          * are the format constants defined in AudioFormat.java. Ex:
12986          *
12987          * "5,6"
12988          *
12989          * @hide
12990          */
12991         public static final String ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS =
12992                 "encoded_surround_output_enabled_formats";
12993 
12994         private static final Validator ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS_VALIDATOR =
12995                 new Validator() {
12996             @Override
12997             public boolean validate(@Nullable String value) {
12998                 try {
12999                     String[] surroundFormats = TextUtils.split(value, ",");
13000                     for (String format : surroundFormats) {
13001                         int audioFormat = Integer.valueOf(format);
13002                         boolean isSurroundFormat = false;
13003                         for (int sf : AudioFormat.SURROUND_SOUND_ENCODING) {
13004                             if (sf == audioFormat) {
13005                                 isSurroundFormat = true;
13006                                 break;
13007                             }
13008                         }
13009                         if (!isSurroundFormat) {
13010                             return false;
13011                         }
13012                     }
13013                     return true;
13014                 } catch (NumberFormatException e) {
13015                     return false;
13016                 }
13017             }
13018         };
13019 
13020         /**
13021          * Persisted safe headphone volume management state by AudioService
13022          * @hide
13023          */
13024         public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
13025 
13026         /**
13027          * URL for tzinfo (time zone) updates
13028          * @hide
13029          */
13030         public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
13031 
13032         /**
13033          * URL for tzinfo (time zone) update metadata
13034          * @hide
13035          */
13036         public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
13037 
13038         /**
13039          * URL for selinux (mandatory access control) updates
13040          * @hide
13041          */
13042         public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
13043 
13044         /**
13045          * URL for selinux (mandatory access control) update metadata
13046          * @hide
13047          */
13048         public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
13049 
13050         /**
13051          * URL for sms short code updates
13052          * @hide
13053          */
13054         public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
13055                 "sms_short_codes_content_url";
13056 
13057         /**
13058          * URL for sms short code update metadata
13059          * @hide
13060          */
13061         public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
13062                 "sms_short_codes_metadata_url";
13063 
13064         /**
13065          * URL for apn_db updates
13066          * @hide
13067          */
13068         public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url";
13069 
13070         /**
13071          * URL for apn_db update metadata
13072          * @hide
13073          */
13074         public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url";
13075 
13076         /**
13077          * URL for cert pinlist updates
13078          * @hide
13079          */
13080         public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
13081 
13082         /**
13083          * URL for cert pinlist updates
13084          * @hide
13085          */
13086         public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
13087 
13088         /**
13089          * URL for intent firewall updates
13090          * @hide
13091          */
13092         public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
13093                 "intent_firewall_content_url";
13094 
13095         /**
13096          * URL for intent firewall update metadata
13097          * @hide
13098          */
13099         public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
13100                 "intent_firewall_metadata_url";
13101 
13102         /**
13103          * URL for lang id model updates
13104          * @hide
13105          */
13106         public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url";
13107 
13108         /**
13109          * URL for lang id model update metadata
13110          * @hide
13111          */
13112         public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url";
13113 
13114         /**
13115          * URL for smart selection model updates
13116          * @hide
13117          */
13118         public static final String SMART_SELECTION_UPDATE_CONTENT_URL =
13119                 "smart_selection_content_url";
13120 
13121         /**
13122          * URL for smart selection model update metadata
13123          * @hide
13124          */
13125         public static final String SMART_SELECTION_UPDATE_METADATA_URL =
13126                 "smart_selection_metadata_url";
13127 
13128         /**
13129          * URL for conversation actions model updates
13130          * @hide
13131          */
13132         public static final String CONVERSATION_ACTIONS_UPDATE_CONTENT_URL =
13133                 "conversation_actions_content_url";
13134 
13135         /**
13136          * URL for conversation actions model update metadata
13137          * @hide
13138          */
13139         public static final String CONVERSATION_ACTIONS_UPDATE_METADATA_URL =
13140                 "conversation_actions_metadata_url";
13141 
13142         /**
13143          * SELinux enforcement status. If 0, permissive; if 1, enforcing.
13144          * @hide
13145          */
13146         public static final String SELINUX_STATUS = "selinux_status";
13147 
13148         /**
13149          * Developer setting to force RTL layout.
13150          * @hide
13151          */
13152         public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
13153 
13154         /**
13155          * Milliseconds after screen-off after which low battery sounds will be silenced.
13156          *
13157          * If zero, battery sounds will always play.
13158          * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
13159          *
13160          * @hide
13161          */
13162         public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
13163 
13164         /**
13165          * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
13166          * the caller is done with this, they should call {@link ContentResolver#delete} to
13167          * clean up any value that they may have written.
13168          *
13169          * @hide
13170          */
13171         public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
13172 
13173         /**
13174          * Defines global runtime overrides to window policy.
13175          *
13176          * See {@link com.android.server.wm.PolicyControl} for value format.
13177          *
13178          * @hide
13179          */
13180         public static final String POLICY_CONTROL = "policy_control";
13181 
13182         /**
13183          * {@link android.view.DisplayCutout DisplayCutout} emulation mode.
13184          *
13185          * @hide
13186          */
13187         public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout";
13188 
13189         /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0;
13190         /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1;
13191 
13192         /**
13193          * A colon separated list of keys for Settings Slices.
13194          *
13195          * @hide
13196          */
13197         public static final String BLOCKED_SLICES = "blocked_slices";
13198 
13199         /**
13200          * Defines global zen mode.  ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
13201          * or ZEN_MODE_NO_INTERRUPTIONS.
13202          *
13203          * @hide
13204          */
13205         @UnsupportedAppUsage
13206         public static final String ZEN_MODE = "zen_mode";
13207 
13208         /** @hide */
13209         @UnsupportedAppUsage
13210         public static final int ZEN_MODE_OFF = 0;
13211         /** @hide */
13212         @UnsupportedAppUsage
13213         public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
13214         /** @hide */
13215         @UnsupportedAppUsage
13216         public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
13217         /** @hide */
13218         @UnsupportedAppUsage
13219         public static final int ZEN_MODE_ALARMS = 3;
13220 
zenModeToString(int mode)13221         /** @hide */ public static String zenModeToString(int mode) {
13222             if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
13223             if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
13224             if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
13225             return "ZEN_MODE_OFF";
13226         }
13227 
isValidZenMode(int value)13228         /** @hide */ public static boolean isValidZenMode(int value) {
13229             switch (value) {
13230                 case Global.ZEN_MODE_OFF:
13231                 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
13232                 case Global.ZEN_MODE_ALARMS:
13233                 case Global.ZEN_MODE_NO_INTERRUPTIONS:
13234                     return true;
13235                 default:
13236                     return false;
13237             }
13238         }
13239 
13240         /**
13241          * Value of the ringer before entering zen mode.
13242          *
13243          * @hide
13244          */
13245         public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level";
13246 
13247         /**
13248          * Opaque value, changes when persisted zen mode configuration changes.
13249          *
13250          * @hide
13251          */
13252         @UnsupportedAppUsage
13253         public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
13254 
13255         /**
13256          * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION} instead
13257          * @hide
13258          */
13259         @Deprecated
13260         public static final String ZEN_DURATION = "zen_duration";
13261 
13262         private static final Validator ZEN_DURATION_VALIDATOR = ANY_INTEGER_VALIDATOR;
13263 
13264         /**
13265          * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_PROMPT} instead
13266          * @hide
13267          */
13268         @Deprecated
13269         public static final int ZEN_DURATION_PROMPT = -1;
13270 
13271         /**
13272          * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_FOREVER} instead
13273          * @hide
13274          */
13275         @Deprecated
13276         public static final int ZEN_DURATION_FOREVER = 0;
13277 
13278         /**
13279          * Defines global heads up toggle.  One of HEADS_UP_OFF, HEADS_UP_ON.
13280          *
13281          * @hide
13282          */
13283         @UnsupportedAppUsage
13284         public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
13285                 "heads_up_notifications_enabled";
13286 
13287         /** @hide */
13288         @UnsupportedAppUsage
13289         public static final int HEADS_UP_OFF = 0;
13290         /** @hide */
13291         @UnsupportedAppUsage
13292         public static final int HEADS_UP_ON = 1;
13293 
13294         /**
13295          * The name of the device
13296          */
13297         public static final String DEVICE_NAME = "device_name";
13298 
13299         /**
13300          * Whether the NetworkScoringService has been first initialized.
13301          * <p>
13302          * Type: int (0 for false, 1 for true)
13303          * @hide
13304          */
13305         public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
13306 
13307         /**
13308          * Indicates whether the user wants to be prompted for password to decrypt the device on
13309          * boot. This only matters if the storage is encrypted.
13310          * <p>
13311          * Type: int (0 for false, 1 for true)
13312          *
13313          * @hide
13314          */
13315         @SystemApi
13316         public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
13317 
13318         /**
13319          * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config
13320          * value {@link CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL}.
13321          * <p>
13322          * Type: int (0 for false, 1 for true)
13323          * @hide
13324          * @deprecated Use {@link android.telephony.SubscriptionManager#ENHANCED_4G_MODE_ENABLED}
13325          * instead.
13326          */
13327         @Deprecated
13328         public static final String ENHANCED_4G_MODE_ENABLED =
13329                 SubscriptionManager.ENHANCED_4G_MODE_ENABLED;
13330 
13331         /**
13332          * Whether VT (Video Telephony over IMS) is enabled
13333          * <p>
13334          * Type: int (0 for false, 1 for true)
13335          *
13336          * @hide
13337          * @deprecated Use {@link android.telephony.SubscriptionManager#VT_IMS_ENABLED} instead.
13338          */
13339         @Deprecated
13340         public static final String VT_IMS_ENABLED = SubscriptionManager.VT_IMS_ENABLED;
13341 
13342         /**
13343          * Whether WFC is enabled
13344          * <p>
13345          * Type: int (0 for false, 1 for true)
13346          *
13347          * @hide
13348          * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ENABLED} instead.
13349          */
13350         @Deprecated
13351         public static final String WFC_IMS_ENABLED = SubscriptionManager.WFC_IMS_ENABLED;
13352 
13353         /**
13354          * WFC mode on home/non-roaming network.
13355          * <p>
13356          * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
13357          *
13358          * @hide
13359          * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_MODE} instead.
13360          */
13361         @Deprecated
13362         public static final String WFC_IMS_MODE = SubscriptionManager.WFC_IMS_MODE;
13363 
13364         /**
13365          * WFC mode on roaming network.
13366          * <p>
13367          * Type: int - see {@link #WFC_IMS_MODE} for values
13368          *
13369          * @hide
13370          * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_MODE}
13371          * instead.
13372          */
13373         @Deprecated
13374         public static final String WFC_IMS_ROAMING_MODE = SubscriptionManager.WFC_IMS_ROAMING_MODE;
13375 
13376         /**
13377          * Whether WFC roaming is enabled
13378          * <p>
13379          * Type: int (0 for false, 1 for true)
13380          *
13381          * @hide
13382          * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_ENABLED}
13383          * instead
13384          */
13385         @Deprecated
13386         public static final String WFC_IMS_ROAMING_ENABLED =
13387                 SubscriptionManager.WFC_IMS_ROAMING_ENABLED;
13388 
13389         /**
13390          * Whether user can enable/disable LTE as a preferred network. A carrier might control
13391          * this via gservices, OMA-DM, carrier app, etc.
13392          * <p>
13393          * Type: int (0 for false, 1 for true)
13394          * @hide
13395          */
13396         public static final String LTE_SERVICE_FORCED = "lte_service_forced";
13397 
13398 
13399         /**
13400          * Specifies the behaviour the lid triggers when closed
13401          * <p>
13402          * See WindowManagerPolicy.WindowManagerFuncs
13403          * @hide
13404          */
13405         public static final String LID_BEHAVIOR = "lid_behavior";
13406 
13407         /**
13408          * Ephemeral app cookie max size in bytes.
13409          * <p>
13410          * Type: int
13411          * @hide
13412          */
13413         public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES =
13414                 "ephemeral_cookie_max_size_bytes";
13415 
13416         /**
13417          * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is
13418          * enabled. Set to zero to disable.
13419          * <p>
13420          * Type: int (0 for false, 1 for true)
13421          *
13422          * @hide
13423          */
13424         public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature";
13425 
13426         /**
13427          * Toggle to enable/disable dexopt for instant applications. The default is for dexopt
13428          * to be disabled.
13429          * <p>
13430          * Type: int (0 to disable, 1 to enable)
13431          *
13432          * @hide
13433          */
13434         public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled";
13435 
13436         /**
13437          * The min period for caching installed instant apps in milliseconds.
13438          * <p>
13439          * Type: long
13440          * @hide
13441          */
13442         public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
13443                 "installed_instant_app_min_cache_period";
13444 
13445         /**
13446          * The max period for caching installed instant apps in milliseconds.
13447          * <p>
13448          * Type: long
13449          * @hide
13450          */
13451         public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
13452                 "installed_instant_app_max_cache_period";
13453 
13454         /**
13455          * The min period for caching uninstalled instant apps in milliseconds.
13456          * <p>
13457          * Type: long
13458          * @hide
13459          */
13460         public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
13461                 "uninstalled_instant_app_min_cache_period";
13462 
13463         /**
13464          * The max period for caching uninstalled instant apps in milliseconds.
13465          * <p>
13466          * Type: long
13467          * @hide
13468          */
13469         public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
13470                 "uninstalled_instant_app_max_cache_period";
13471 
13472         /**
13473          * The min period for caching unused static shared libs in milliseconds.
13474          * <p>
13475          * Type: long
13476          * @hide
13477          */
13478         public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD =
13479                 "unused_static_shared_lib_min_cache_period";
13480 
13481         /**
13482          * Allows switching users when system user is locked.
13483          * <p>
13484          * Type: int
13485          * @hide
13486          */
13487         public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED =
13488                 "allow_user_switching_when_system_user_locked";
13489 
13490         /**
13491          * Boot count since the device starts running API level 24.
13492          * <p>
13493          * Type: int
13494          */
13495         public static final String BOOT_COUNT = "boot_count";
13496 
13497         /**
13498          * Whether the safe boot is disallowed.
13499          *
13500          * <p>This setting should have the identical value as the corresponding user restriction.
13501          * The purpose of the setting is to make the restriction available in early boot stages
13502          * before the user restrictions are loaded.
13503          * @hide
13504          */
13505         public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed";
13506 
13507         /**
13508          * Indicates whether this device is currently in retail demo mode. If true, the device
13509          * usage is severely limited.
13510          * <p>
13511          * Type: int (0 for false, 1 for true)
13512          *
13513          * @hide
13514          */
13515         @SystemApi
13516         public static final String DEVICE_DEMO_MODE = "device_demo_mode";
13517 
13518         /**
13519          * Indicates the maximum time that an app is blocked for the network rules to get updated.
13520          *
13521          * Type: long
13522          *
13523          * @hide
13524          */
13525         public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms";
13526 
13527         /**
13528          * The reason for the settings database being downgraded. This is only for
13529          * troubleshooting purposes and its value should not be interpreted in any way.
13530          *
13531          * Type: string
13532          *
13533          * @hide
13534          */
13535         public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason";
13536 
13537         /**
13538          * The build id of when the settings database was first created (or re-created due it
13539          * being missing).
13540          *
13541          * Type: string
13542          *
13543          * @hide
13544          */
13545         public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid";
13546 
13547         /**
13548          * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by
13549          * default. Set to 0 to disable.
13550          *
13551          * @hide
13552          */
13553         public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled";
13554 
13555         /**
13556          * Flag to enable the link to location permissions in location setting. Set to 0 to disable.
13557          *
13558          * @hide
13559          */
13560         public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED =
13561                 "location_settings_link_to_permissions_enabled";
13562 
13563         /**
13564          * Flag to set the waiting time for euicc factory reset inside System > Settings
13565          * Type: long
13566          *
13567          * @hide
13568          */
13569         public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS =
13570                 "euicc_factory_reset_timeout_millis";
13571 
13572         /**
13573          * Flag to set the timeout for when to refresh the storage settings cached data.
13574          * Type: long
13575          *
13576          * @hide
13577          */
13578         public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD =
13579                 "storage_settings_clobber_threshold";
13580 
13581         /**
13582          * If set to 1, {@link Secure#LOCATION_MODE} will be set to {@link Secure#LOCATION_MODE_OFF}
13583          * temporarily for all users.
13584          *
13585          * @hide
13586          */
13587         @TestApi
13588         public static final String LOCATION_GLOBAL_KILL_SWITCH =
13589                 "location_global_kill_switch";
13590 
13591         /**
13592          * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored
13593          * and restoring to lower version of platform API will be skipped.
13594          *
13595          * @hide
13596          */
13597         public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION =
13598                 "override_settings_provider_restore_any_version";
13599         /**
13600          * Flag to toggle whether system services report attribution chains when they attribute
13601          * battery use via a {@code WorkSource}.
13602          *
13603          * Type: int (0 to disable, 1 to enable)
13604          *
13605          * @hide
13606          */
13607         public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED =
13608                 "chained_battery_attribution_enabled";
13609 
13610         /**
13611          * The packages whitelisted to be run in autofill compatibility mode. The list
13612          * of packages is {@code ":"} colon delimited, and each entry has the name of the
13613          * package and an optional list of url bar resource ids (the list is delimited by
13614          * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited).
13615          *
13616          * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where
13617          * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 }
13618          * have 2 ids {@code url_foo} and {@code url_bas}) would be
13619          * {@code p1[url_bar]:p2:p3[url_foo,url_bas]}
13620          *
13621          * @hide
13622          */
13623         @SystemApi
13624         @TestApi
13625         public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES =
13626                 "autofill_compat_mode_allowed_packages";
13627 
13628         /**
13629          * Level of autofill logging.
13630          *
13631          * <p>Valid values are
13632          * {@link android.view.autofill.AutofillManager#NO_LOGGING},
13633          * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_DEBUG}, or
13634          * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_VERBOSE}.
13635          *
13636          * @hide
13637          */
13638         public static final String AUTOFILL_LOGGING_LEVEL = "autofill_logging_level";
13639 
13640         /**
13641          * Maximum number of partitions that can be allowed in an autofill session.
13642          *
13643          * @hide
13644          */
13645         public static final String AUTOFILL_MAX_PARTITIONS_SIZE = "autofill_max_partitions_size";
13646 
13647         /**
13648          * Maximum number of visible datasets in the Autofill dataset picker UI, or {@code 0} to use
13649          * the default value from resources.
13650          *
13651          * @hide
13652          */
13653         public static final String AUTOFILL_MAX_VISIBLE_DATASETS = "autofill_max_visible_datasets";
13654 
13655         /**
13656          * Exemptions to the hidden API blacklist.
13657          *
13658          * @hide
13659          */
13660         @TestApi
13661         public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS =
13662                 "hidden_api_blacklist_exemptions";
13663 
13664         /**
13665          * Hidden API enforcement policy for apps.
13666          *
13667          * Values correspond to @{@link
13668          * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy}
13669          *
13670          * @hide
13671          */
13672         public static final String HIDDEN_API_POLICY = "hidden_api_policy";
13673 
13674         /**
13675          * Current version of signed configuration applied.
13676          *
13677          * @hide
13678          */
13679         public static final String SIGNED_CONFIG_VERSION = "signed_config_version";
13680 
13681         /**
13682          * Timeout for a single {@link android.media.soundtrigger.SoundTriggerDetectionService}
13683          * operation (in ms).
13684          *
13685          * @hide
13686          */
13687         public static final String SOUND_TRIGGER_DETECTION_SERVICE_OP_TIMEOUT =
13688                 "sound_trigger_detection_service_op_timeout";
13689 
13690         /**
13691          * Maximum number of {@link android.media.soundtrigger.SoundTriggerDetectionService}
13692          * operations per day.
13693          *
13694          * @hide
13695          */
13696         public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY =
13697                 "max_sound_trigger_detection_service_ops_per_day";
13698 
13699         /** {@hide} */
13700         public static final String ISOLATED_STORAGE_LOCAL = "isolated_storage_local";
13701         /** {@hide} */
13702         public static final String ISOLATED_STORAGE_REMOTE = "isolated_storage_remote";
13703 
13704         /**
13705          * Indicates whether aware is available in the current location.
13706          * @hide
13707          */
13708         public static final String AWARE_ALLOWED = "aware_allowed";
13709 
13710         private static final Validator AWARE_ALLOWED_VALIDATOR = BOOLEAN_VALIDATOR;
13711 
13712         /**
13713          * Overrides internal R.integer.config_longPressOnPowerBehavior.
13714          * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
13715          * Used by PhoneWindowManager.
13716          * @hide
13717          */
13718         public static final String POWER_BUTTON_LONG_PRESS =
13719                 "power_button_long_press";
13720         private static final Validator POWER_BUTTON_LONG_PRESS_VALIDATOR =
13721                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 5);
13722 
13723         /**
13724          * Overrides internal R.integer.config_veryLongPressOnPowerBehavior.
13725          * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
13726          * Used by PhoneWindowManager.
13727          * @hide
13728          */
13729         public static final String POWER_BUTTON_VERY_LONG_PRESS =
13730                 "power_button_very_long_press";
13731         private static final Validator POWER_BUTTON_VERY_LONG_PRESS_VALIDATOR =
13732                 new SettingsValidators.InclusiveIntegerRangeValidator(0, 1);
13733 
13734         /**
13735          * Settings to backup. This is here so that it's in the same place as the settings
13736          * keys and easy to update.
13737          *
13738          * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
13739          * and Secure as well.  This is because those tables drive both backup and
13740          * restore, and restore needs to properly whitelist keys that used to live
13741          * in those namespaces.  The keys will only actually be backed up / restored
13742          * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
13743          *
13744          * NOTE: Settings are backed up and restored in the order they appear
13745          *       in this array. If you have one setting depending on another,
13746          *       make sure that they are ordered appropriately.
13747          *
13748          * @hide
13749          */
13750         public static final String[] SETTINGS_TO_BACKUP = {
13751             APPLY_RAMPING_RINGER,
13752             BUGREPORT_IN_POWER_MENU,
13753             STAY_ON_WHILE_PLUGGED_IN,
13754             APP_AUTO_RESTRICTION_ENABLED,
13755             AUTO_TIME,
13756             AUTO_TIME_ZONE,
13757             POWER_SOUNDS_ENABLED,
13758             DOCK_SOUNDS_ENABLED,
13759             CHARGING_SOUNDS_ENABLED,
13760             USB_MASS_STORAGE_ENABLED,
13761             NETWORK_RECOMMENDATIONS_ENABLED,
13762             WIFI_WAKEUP_ENABLED,
13763             WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
13764             WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON,
13765             USE_OPEN_WIFI_PACKAGE,
13766             WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
13767             EMERGENCY_TONE,
13768             CALL_AUTO_RETRY,
13769             DOCK_AUDIO_MEDIA_ENABLED,
13770             ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS,
13771             ENCODED_SURROUND_OUTPUT,
13772             ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS,
13773             LOW_POWER_MODE_TRIGGER_LEVEL,
13774             LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED,
13775             LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL,
13776             BLUETOOTH_ON,
13777             PRIVATE_DNS_MODE,
13778             PRIVATE_DNS_SPECIFIER,
13779             SOFT_AP_TIMEOUT_ENABLED,
13780             ZEN_DURATION,
13781             CHARGING_VIBRATION_ENABLED,
13782             AWARE_ALLOWED,
13783         };
13784 
13785         /**
13786          * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator,
13787          * otherwise they won't be restored.
13788          *
13789          * @hide
13790          */
13791         public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
13792         static {
VALIDATORS.put(APPLY_RAMPING_RINGER, APPLY_RAMPING_RINGER_VALIDATOR)13793             VALIDATORS.put(APPLY_RAMPING_RINGER, APPLY_RAMPING_RINGER_VALIDATOR);
VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR)13794             VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR);
VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR)13795             VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR);
VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR)13796             VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR);
VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR)13797             VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR);
VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR)13798             VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR)13799             VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(CHARGING_SOUNDS_ENABLED, CHARGING_SOUNDS_ENABLED_VALIDATOR)13800             VALIDATORS.put(CHARGING_SOUNDS_ENABLED, CHARGING_SOUNDS_ENABLED_VALIDATOR);
VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR)13801             VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR);
VALIDATORS.put(NETWORK_RECOMMENDATIONS_ENABLED, NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR)13802             VALIDATORS.put(NETWORK_RECOMMENDATIONS_ENABLED,
13803                     NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR);
VALIDATORS.put(WIFI_WAKEUP_ENABLED, WIFI_WAKEUP_ENABLED_VALIDATOR)13804             VALIDATORS.put(WIFI_WAKEUP_ENABLED, WIFI_WAKEUP_ENABLED_VALIDATOR);
VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR)13805             VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
13806                     WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
VALIDATORS.put(USE_OPEN_WIFI_PACKAGE, USE_OPEN_WIFI_PACKAGE_VALIDATOR)13807             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)13808             VALIDATORS.put(WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
13809                     WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR);
VALIDATORS.put(EMERGENCY_TONE, EMERGENCY_TONE_VALIDATOR)13810             VALIDATORS.put(EMERGENCY_TONE, EMERGENCY_TONE_VALIDATOR);
VALIDATORS.put(CALL_AUTO_RETRY, CALL_AUTO_RETRY_VALIDATOR)13811             VALIDATORS.put(CALL_AUTO_RETRY, CALL_AUTO_RETRY_VALIDATOR);
VALIDATORS.put(DOCK_AUDIO_MEDIA_ENABLED, DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR)13812             VALIDATORS.put(DOCK_AUDIO_MEDIA_ENABLED, DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR);
VALIDATORS.put(ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS, ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS_VALIDATOR)13813             VALIDATORS.put(ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS,
13814                     ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS_VALIDATOR);
VALIDATORS.put(ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_VALIDATOR)13815             VALIDATORS.put(ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_VALIDATOR);
VALIDATORS.put(ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS, ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS_VALIDATOR)13816             VALIDATORS.put(ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS,
13817                     ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS_VALIDATOR);
VALIDATORS.put(LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL, LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL_VALIDATOR)13818             VALIDATORS.put(LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL,
13819                     LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL_VALIDATOR);
VALIDATORS.put(LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED, LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED_VALIDATOR)13820             VALIDATORS.put(LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED,
13821                     LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED_VALIDATOR);
VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL, LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR)13822             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)13823             VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL_MAX,
13824                     LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR);
VALIDATORS.put(AUTOMATIC_POWER_SAVE_MODE, AUTOMATIC_POWER_SAVE_MODE_VALIDATOR)13825             VALIDATORS.put(AUTOMATIC_POWER_SAVE_MODE, AUTOMATIC_POWER_SAVE_MODE_VALIDATOR);
VALIDATORS.put(DYNAMIC_POWER_SAVINGS_DISABLE_THRESHOLD, DYNAMIC_POWER_SAVINGS_VALIDATOR)13826             VALIDATORS.put(DYNAMIC_POWER_SAVINGS_DISABLE_THRESHOLD,
13827                     DYNAMIC_POWER_SAVINGS_VALIDATOR);
VALIDATORS.put(BLUETOOTH_ON, BLUETOOTH_ON_VALIDATOR)13828             VALIDATORS.put(BLUETOOTH_ON, BLUETOOTH_ON_VALIDATOR);
VALIDATORS.put(PRIVATE_DNS_MODE, PRIVATE_DNS_MODE_VALIDATOR)13829             VALIDATORS.put(PRIVATE_DNS_MODE, PRIVATE_DNS_MODE_VALIDATOR);
VALIDATORS.put(PRIVATE_DNS_SPECIFIER, PRIVATE_DNS_SPECIFIER_VALIDATOR)13830             VALIDATORS.put(PRIVATE_DNS_SPECIFIER, PRIVATE_DNS_SPECIFIER_VALIDATOR);
VALIDATORS.put(SOFT_AP_TIMEOUT_ENABLED, SOFT_AP_TIMEOUT_ENABLED_VALIDATOR)13831             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)13832             VALIDATORS.put(WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON,
13833                     WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR);
VALIDATORS.put(WIFI_SCAN_THROTTLE_ENABLED, WIFI_SCAN_THROTTLE_ENABLED_VALIDATOR)13834             VALIDATORS.put(WIFI_SCAN_THROTTLE_ENABLED, WIFI_SCAN_THROTTLE_ENABLED_VALIDATOR);
VALIDATORS.put(APP_AUTO_RESTRICTION_ENABLED, APP_AUTO_RESTRICTION_ENABLED_VALIDATOR)13835             VALIDATORS.put(APP_AUTO_RESTRICTION_ENABLED, APP_AUTO_RESTRICTION_ENABLED_VALIDATOR);
VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR)13836             VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR);
VALIDATORS.put(CHARGING_VIBRATION_ENABLED, CHARGING_VIBRATION_ENABLED_VALIDATOR)13837             VALIDATORS.put(CHARGING_VIBRATION_ENABLED, CHARGING_VIBRATION_ENABLED_VALIDATOR);
VALIDATORS.put(DEVICE_PROVISIONING_MOBILE_DATA_ENABLED, BOOLEAN_VALIDATOR)13838             VALIDATORS.put(DEVICE_PROVISIONING_MOBILE_DATA_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(REQUIRE_PASSWORD_TO_DECRYPT, BOOLEAN_VALIDATOR)13839             VALIDATORS.put(REQUIRE_PASSWORD_TO_DECRYPT, BOOLEAN_VALIDATOR);
VALIDATORS.put(DEVICE_DEMO_MODE, BOOLEAN_VALIDATOR)13840             VALIDATORS.put(DEVICE_DEMO_MODE, BOOLEAN_VALIDATOR);
VALIDATORS.put(WIFI_PNO_FREQUENCY_CULLING_ENABLED, WIFI_PNO_FREQUENCY_CULLING_ENABLED_VALIDATOR)13841             VALIDATORS.put(WIFI_PNO_FREQUENCY_CULLING_ENABLED,
13842                     WIFI_PNO_FREQUENCY_CULLING_ENABLED_VALIDATOR);
VALIDATORS.put(WIFI_PNO_RECENCY_SORTING_ENABLED, WIFI_PNO_RECENCY_SORTING_ENABLED_VALIDATOR)13843             VALIDATORS.put(WIFI_PNO_RECENCY_SORTING_ENABLED,
13844                     WIFI_PNO_RECENCY_SORTING_ENABLED_VALIDATOR);
VALIDATORS.put(WIFI_LINK_PROBING_ENABLED, WIFI_LINK_PROBING_ENABLED_VALIDATOR)13845             VALIDATORS.put(WIFI_LINK_PROBING_ENABLED, WIFI_LINK_PROBING_ENABLED_VALIDATOR);
VALIDATORS.put(AWARE_ALLOWED, AWARE_ALLOWED_VALIDATOR)13846             VALIDATORS.put(AWARE_ALLOWED, AWARE_ALLOWED_VALIDATOR);
VALIDATORS.put(POWER_BUTTON_LONG_PRESS, POWER_BUTTON_LONG_PRESS_VALIDATOR)13847             VALIDATORS.put(POWER_BUTTON_LONG_PRESS, POWER_BUTTON_LONG_PRESS_VALIDATOR);
VALIDATORS.put(POWER_BUTTON_VERY_LONG_PRESS, POWER_BUTTON_VERY_LONG_PRESS_VALIDATOR)13848             VALIDATORS.put(POWER_BUTTON_VERY_LONG_PRESS, POWER_BUTTON_VERY_LONG_PRESS_VALIDATOR);
13849         }
13850 
13851         /**
13852          * Global settings that shouldn't be persisted.
13853          *
13854          * @hide
13855          */
13856         public static final String[] TRANSIENT_SETTINGS = {
13857                 LOCATION_GLOBAL_KILL_SWITCH,
13858         };
13859 
13860         /**
13861          * Keys we no longer back up under the current schema, but want to continue to
13862          * process when restoring historical backup datasets.
13863          *
13864          * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
13865          * otherwise they won't be restored.
13866          *
13867          * @hide
13868          */
13869         public static final String[] LEGACY_RESTORE_SETTINGS = {
13870         };
13871 
13872         @UnsupportedAppUsage
13873         private static final ContentProviderHolder sProviderHolder =
13874                 new ContentProviderHolder(CONTENT_URI);
13875 
13876         // Populated lazily, guarded by class object:
13877         @UnsupportedAppUsage
13878         private static final NameValueCache sNameValueCache = new NameValueCache(
13879                     CONTENT_URI,
13880                     CALL_METHOD_GET_GLOBAL,
13881                     CALL_METHOD_PUT_GLOBAL,
13882                     sProviderHolder);
13883 
13884         // Certain settings have been moved from global to the per-user secure namespace
13885         @UnsupportedAppUsage
13886         private static final HashSet<String> MOVED_TO_SECURE;
13887         static {
13888             MOVED_TO_SECURE = new HashSet<>(8);
13889             MOVED_TO_SECURE.add(Global.INSTALL_NON_MARKET_APPS);
13890             MOVED_TO_SECURE.add(Global.ZEN_DURATION);
13891             MOVED_TO_SECURE.add(Global.SHOW_ZEN_UPGRADE_NOTIFICATION);
13892             MOVED_TO_SECURE.add(Global.SHOW_ZEN_SETTINGS_SUGGESTION);
13893             MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_UPDATED);
13894             MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_SUGGESTION_VIEWED);
13895             MOVED_TO_SECURE.add(Global.CHARGING_SOUNDS_ENABLED);
13896             MOVED_TO_SECURE.add(Global.CHARGING_VIBRATION_ENABLED);
13897 
13898         }
13899 
13900         /** @hide */
getMovedToSecureSettings(Set<String> outKeySet)13901         public static void getMovedToSecureSettings(Set<String> outKeySet) {
13902             outKeySet.addAll(MOVED_TO_SECURE);
13903         }
13904 
13905         /** @hide */
clearProviderForTest()13906         public static void clearProviderForTest() {
13907             sProviderHolder.clearProviderForTest();
13908             sNameValueCache.clearGenerationTrackerForTest();
13909         }
13910 
13911         /**
13912          * Look up a name in the database.
13913          * @param resolver to access the database with
13914          * @param name to look up in the table
13915          * @return the corresponding value, or null if not present
13916          */
getString(ContentResolver resolver, String name)13917         public static String getString(ContentResolver resolver, String name) {
13918             return getStringForUser(resolver, name, resolver.getUserId());
13919         }
13920 
13921         /** @hide */
13922         @UnsupportedAppUsage
getStringForUser(ContentResolver resolver, String name, int userHandle)13923         public static String getStringForUser(ContentResolver resolver, String name,
13924                 int userHandle) {
13925             if (MOVED_TO_SECURE.contains(name)) {
13926                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
13927                         + " to android.provider.Settings.Secure, returning read-only value.");
13928                 return Secure.getStringForUser(resolver, name, userHandle);
13929             }
13930             return sNameValueCache.getStringForUser(resolver, name, userHandle);
13931         }
13932 
13933         /**
13934          * Store a name/value pair into the database.
13935          * @param resolver to access the database with
13936          * @param name to store
13937          * @param value to associate with the name
13938          * @return true if the value was set, false on database errors
13939          */
putString(ContentResolver resolver, String name, String value)13940         public static boolean putString(ContentResolver resolver,
13941                 String name, String value) {
13942             return putStringForUser(resolver, name, value, null, false, resolver.getUserId());
13943         }
13944 
13945         /**
13946          * Store a name/value pair into the database.
13947          * <p>
13948          * The method takes an optional tag to associate with the setting
13949          * which can be used to clear only settings made by your package and
13950          * associated with this tag by passing the tag to {@link
13951          * #resetToDefaults(ContentResolver, String)}. Anyone can override
13952          * the current tag. Also if another package changes the setting
13953          * then the tag will be set to the one specified in the set call
13954          * which can be null. Also any of the settings setters that do not
13955          * take a tag as an argument effectively clears the tag.
13956          * </p><p>
13957          * For example, if you set settings A and B with tags T1 and T2 and
13958          * another app changes setting A (potentially to the same value), it
13959          * can assign to it a tag T3 (note that now the package that changed
13960          * the setting is not yours). Now if you reset your changes for T1 and
13961          * T2 only setting B will be reset and A not (as it was changed by
13962          * another package) but since A did not change you are in the desired
13963          * initial state. Now if the other app changes the value of A (assuming
13964          * you registered an observer in the beginning) you would detect that
13965          * the setting was changed by another app and handle this appropriately
13966          * (ignore, set back to some value, etc).
13967          * </p><p>
13968          * Also the method takes an argument whether to make the value the
13969          * default for this setting. If the system already specified a default
13970          * value, then the one passed in here will <strong>not</strong>
13971          * be set as the default.
13972          * </p>
13973          *
13974          * @param resolver to access the database with.
13975          * @param name to store.
13976          * @param value to associate with the name.
13977          * @param tag to associated with the setting.
13978          * @param makeDefault whether to make the value the default one.
13979          * @return true if the value was set, false on database errors.
13980          *
13981          * @see #resetToDefaults(ContentResolver, String)
13982          *
13983          * @hide
13984          */
13985         @SystemApi
13986         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)13987         public static boolean putString(@NonNull ContentResolver resolver,
13988                 @NonNull String name, @Nullable String value, @Nullable String tag,
13989                 boolean makeDefault) {
13990             return putStringForUser(resolver, name, value, tag, makeDefault,
13991                     resolver.getUserId());
13992         }
13993 
13994         /**
13995          * Reset the settings to their defaults. This would reset <strong>only</strong>
13996          * settings set by the caller's package. Think of it of a way to undo your own
13997          * changes to the secure settings. Passing in the optional tag will reset only
13998          * settings changed by your package and associated with this tag.
13999          *
14000          * @param resolver Handle to the content resolver.
14001          * @param tag Optional tag which should be associated with the settings to reset.
14002          *
14003          * @see #putString(ContentResolver, String, String, String, boolean)
14004          *
14005          * @hide
14006          */
14007         @SystemApi
14008         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)14009         public static void resetToDefaults(@NonNull ContentResolver resolver,
14010                 @Nullable String tag) {
14011             resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
14012                     resolver.getUserId());
14013         }
14014 
14015         /**
14016          * Reset the settings to their defaults for a given user with a specific mode. The
14017          * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
14018          * allowing resetting the settings made by a package and associated with the tag.
14019          *
14020          * @param resolver Handle to the content resolver.
14021          * @param tag Optional tag which should be associated with the settings to reset.
14022          * @param mode The reset mode.
14023          * @param userHandle The user for which to reset to defaults.
14024          *
14025          * @see #RESET_MODE_PACKAGE_DEFAULTS
14026          * @see #RESET_MODE_UNTRUSTED_DEFAULTS
14027          * @see #RESET_MODE_UNTRUSTED_CHANGES
14028          * @see #RESET_MODE_TRUSTED_DEFAULTS
14029          *
14030          * @hide
14031          */
resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)14032         public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
14033                 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
14034             try {
14035                 Bundle arg = new Bundle();
14036                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
14037                 if (tag != null) {
14038                     arg.putString(CALL_METHOD_TAG_KEY, tag);
14039                 }
14040                 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
14041                 IContentProvider cp = sProviderHolder.getProvider(resolver);
14042                 cp.call(resolver.getPackageName(), sProviderHolder.mUri.getAuthority(),
14043                         CALL_METHOD_RESET_GLOBAL, null, arg);
14044             } catch (RemoteException e) {
14045                 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
14046             }
14047         }
14048 
14049         /** @hide */
14050         @UnsupportedAppUsage
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)14051         public static boolean putStringForUser(ContentResolver resolver,
14052                 String name, String value, int userHandle) {
14053             return putStringForUser(resolver, name, value, null, false, userHandle);
14054         }
14055 
14056         /** @hide */
putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle)14057         public static boolean putStringForUser(@NonNull ContentResolver resolver,
14058                 @NonNull String name, @Nullable String value, @Nullable String tag,
14059                 boolean makeDefault, @UserIdInt int userHandle) {
14060             if (LOCAL_LOGV) {
14061                 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
14062                         + " for " + userHandle);
14063             }
14064             // Global and Secure have the same access policy so we can forward writes
14065             if (MOVED_TO_SECURE.contains(name)) {
14066                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
14067                         + " to android.provider.Settings.Secure, value is unchanged.");
14068                 return Secure.putStringForUser(resolver, name, value, tag,
14069                         makeDefault, userHandle);
14070             }
14071             return sNameValueCache.putStringForUser(resolver, name, value, tag,
14072                     makeDefault, userHandle);
14073         }
14074 
14075         /**
14076          * Construct the content URI for a particular name/value pair,
14077          * useful for monitoring changes with a ContentObserver.
14078          * @param name to look up in the table
14079          * @return the corresponding content URI, or null if not present
14080          */
getUriFor(String name)14081         public static Uri getUriFor(String name) {
14082             return getUriFor(CONTENT_URI, name);
14083         }
14084 
14085         /**
14086          * Convenience function for retrieving a single secure settings value
14087          * as an integer.  Note that internally setting values are always
14088          * stored as strings; this function converts the string to an integer
14089          * for you.  The default value will be returned if the setting is
14090          * not defined or not an integer.
14091          *
14092          * @param cr The ContentResolver to access.
14093          * @param name The name of the setting to retrieve.
14094          * @param def Value to return if the setting is not defined.
14095          *
14096          * @return The setting's current value, or 'def' if it is not defined
14097          * or not a valid integer.
14098          */
getInt(ContentResolver cr, String name, int def)14099         public static int getInt(ContentResolver cr, String name, int def) {
14100             String v = getString(cr, name);
14101             try {
14102                 return v != null ? Integer.parseInt(v) : def;
14103             } catch (NumberFormatException e) {
14104                 return def;
14105             }
14106         }
14107 
14108         /**
14109          * Convenience function for retrieving a single secure settings value
14110          * as an integer.  Note that internally setting values are always
14111          * stored as strings; this function converts the string to an integer
14112          * for you.
14113          * <p>
14114          * This version does not take a default value.  If the setting has not
14115          * been set, or the string value is not a number,
14116          * it throws {@link SettingNotFoundException}.
14117          *
14118          * @param cr The ContentResolver to access.
14119          * @param name The name of the setting to retrieve.
14120          *
14121          * @throws SettingNotFoundException Thrown if a setting by the given
14122          * name can't be found or the setting value is not an integer.
14123          *
14124          * @return The setting's current value.
14125          */
getInt(ContentResolver cr, String name)14126         public static int getInt(ContentResolver cr, String name)
14127                 throws SettingNotFoundException {
14128             String v = getString(cr, name);
14129             try {
14130                 return Integer.parseInt(v);
14131             } catch (NumberFormatException e) {
14132                 throw new SettingNotFoundException(name);
14133             }
14134         }
14135 
14136         /**
14137          * Convenience function for updating a single settings value as an
14138          * integer. This will either create a new entry in the table if the
14139          * given name does not exist, or modify the value of the existing row
14140          * with that name.  Note that internally setting values are always
14141          * stored as strings, so this function converts the given value to a
14142          * string before storing it.
14143          *
14144          * @param cr The ContentResolver to access.
14145          * @param name The name of the setting to modify.
14146          * @param value The new value for the setting.
14147          * @return true if the value was set, false on database errors
14148          */
putInt(ContentResolver cr, String name, int value)14149         public static boolean putInt(ContentResolver cr, String name, int value) {
14150             return putString(cr, name, Integer.toString(value));
14151         }
14152 
14153         /**
14154          * Convenience function for retrieving a single secure settings value
14155          * as a {@code long}.  Note that internally setting values are always
14156          * stored as strings; this function converts the string to a {@code long}
14157          * for you.  The default value will be returned if the setting is
14158          * not defined or not a {@code long}.
14159          *
14160          * @param cr The ContentResolver to access.
14161          * @param name The name of the setting to retrieve.
14162          * @param def Value to return if the setting is not defined.
14163          *
14164          * @return The setting's current value, or 'def' if it is not defined
14165          * or not a valid {@code long}.
14166          */
getLong(ContentResolver cr, String name, long def)14167         public static long getLong(ContentResolver cr, String name, long def) {
14168             String valString = getString(cr, name);
14169             long value;
14170             try {
14171                 value = valString != null ? Long.parseLong(valString) : def;
14172             } catch (NumberFormatException e) {
14173                 value = def;
14174             }
14175             return value;
14176         }
14177 
14178         /**
14179          * Convenience function for retrieving a single secure settings value
14180          * as a {@code long}.  Note that internally setting values are always
14181          * stored as strings; this function converts the string to a {@code long}
14182          * for you.
14183          * <p>
14184          * This version does not take a default value.  If the setting has not
14185          * been set, or the string value is not a number,
14186          * it throws {@link SettingNotFoundException}.
14187          *
14188          * @param cr The ContentResolver to access.
14189          * @param name The name of the setting to retrieve.
14190          *
14191          * @return The setting's current value.
14192          * @throws SettingNotFoundException Thrown if a setting by the given
14193          * name can't be found or the setting value is not an integer.
14194          */
getLong(ContentResolver cr, String name)14195         public static long getLong(ContentResolver cr, String name)
14196                 throws SettingNotFoundException {
14197             String valString = getString(cr, name);
14198             try {
14199                 return Long.parseLong(valString);
14200             } catch (NumberFormatException e) {
14201                 throw new SettingNotFoundException(name);
14202             }
14203         }
14204 
14205         /**
14206          * Convenience function for updating a secure settings value as a long
14207          * integer. This will either create a new entry in the table if the
14208          * given name does not exist, or modify the value of the existing row
14209          * with that name.  Note that internally setting values are always
14210          * stored as strings, so this function converts the given value to a
14211          * string before storing it.
14212          *
14213          * @param cr The ContentResolver to access.
14214          * @param name The name of the setting to modify.
14215          * @param value The new value for the setting.
14216          * @return true if the value was set, false on database errors
14217          */
putLong(ContentResolver cr, String name, long value)14218         public static boolean putLong(ContentResolver cr, String name, long value) {
14219             return putString(cr, name, Long.toString(value));
14220         }
14221 
14222         /**
14223          * Convenience function for retrieving a single secure settings value
14224          * as a floating point number.  Note that internally setting values are
14225          * always stored as strings; this function converts the string to an
14226          * float for you. The default value will be returned if the setting
14227          * is not defined or not a valid float.
14228          *
14229          * @param cr The ContentResolver to access.
14230          * @param name The name of the setting to retrieve.
14231          * @param def Value to return if the setting is not defined.
14232          *
14233          * @return The setting's current value, or 'def' if it is not defined
14234          * or not a valid float.
14235          */
getFloat(ContentResolver cr, String name, float def)14236         public static float getFloat(ContentResolver cr, String name, float def) {
14237             String v = getString(cr, name);
14238             try {
14239                 return v != null ? Float.parseFloat(v) : def;
14240             } catch (NumberFormatException e) {
14241                 return def;
14242             }
14243         }
14244 
14245         /**
14246          * Convenience function for retrieving a single secure settings value
14247          * as a float.  Note that internally setting values are always
14248          * stored as strings; this function converts the string to a float
14249          * for you.
14250          * <p>
14251          * This version does not take a default value.  If the setting has not
14252          * been set, or the string value is not a number,
14253          * it throws {@link SettingNotFoundException}.
14254          *
14255          * @param cr The ContentResolver to access.
14256          * @param name The name of the setting to retrieve.
14257          *
14258          * @throws SettingNotFoundException Thrown if a setting by the given
14259          * name can't be found or the setting value is not a float.
14260          *
14261          * @return The setting's current value.
14262          */
getFloat(ContentResolver cr, String name)14263         public static float getFloat(ContentResolver cr, String name)
14264                 throws SettingNotFoundException {
14265             String v = getString(cr, name);
14266             if (v == null) {
14267                 throw new SettingNotFoundException(name);
14268             }
14269             try {
14270                 return Float.parseFloat(v);
14271             } catch (NumberFormatException e) {
14272                 throw new SettingNotFoundException(name);
14273             }
14274         }
14275 
14276         /**
14277          * Convenience function for updating a single settings value as a
14278          * floating point number. This will either create a new entry in the
14279          * table if the given name does not exist, or modify the value of the
14280          * existing row with that name.  Note that internally setting values
14281          * are always stored as strings, so this function converts the given
14282          * value to a string before storing it.
14283          *
14284          * @param cr The ContentResolver to access.
14285          * @param name The name of the setting to modify.
14286          * @param value The new value for the setting.
14287          * @return true if the value was set, false on database errors
14288          */
putFloat(ContentResolver cr, String name, float value)14289         public static boolean putFloat(ContentResolver cr, String name, float value) {
14290             return putString(cr, name, Float.toString(value));
14291         }
14292 
14293         /**
14294           * Subscription to be used for voice call on a multi sim device. The supported values
14295           * are 0 = SUB1, 1 = SUB2 and etc.
14296           * @hide
14297           */
14298         public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
14299 
14300         /**
14301           * Used to provide option to user to select subscription during dial.
14302           * The supported values are 0 = disable or 1 = enable prompt.
14303           * @hide
14304           */
14305         @UnsupportedAppUsage
14306         public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
14307 
14308         /**
14309           * Subscription to be used for data call on a multi sim device. The supported values
14310           * are 0 = SUB1, 1 = SUB2 and etc.
14311           * @hide
14312           */
14313         public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
14314 
14315         /**
14316           * Subscription to be used for SMS on a multi sim device. The supported values
14317           * are 0 = SUB1, 1 = SUB2 and etc.
14318           * @hide
14319           */
14320         public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
14321 
14322         /**
14323           * Used to provide option to user to select subscription during send SMS.
14324           * The value 1 - enable, 0 - disable
14325           * @hide
14326           */
14327         public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
14328 
14329         /** User preferred subscriptions setting.
14330           * This holds the details of the user selected subscription from the card and
14331           * the activation status. Each settings string have the comma separated values
14332           * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
14333           * @hide
14334          */
14335         @UnsupportedAppUsage
14336         public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
14337                 "user_preferred_sub2","user_preferred_sub3"};
14338 
14339         /**
14340          * Which subscription is enabled for a physical slot.
14341          * @hide
14342          */
14343         public static final String ENABLED_SUBSCRIPTION_FOR_SLOT = "enabled_subscription_for_slot";
14344 
14345         /**
14346          * Whether corresponding logical modem is enabled for a physical slot.
14347          * The value 1 - enable, 0 - disable
14348          * @hide
14349          */
14350         public static final String MODEM_STACK_ENABLED_FOR_SLOT = "modem_stack_enabled_for_slot";
14351 
14352         /**
14353          * Whether to enable new contacts aggregator or not.
14354          * The value 1 - enable, 0 - disable
14355          * @hide
14356          */
14357         public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
14358 
14359         /**
14360          * Whether to enable contacts metadata syncing or not
14361          * The value 1 - enable, 0 - disable
14362          *
14363          * @removed
14364          */
14365         @Deprecated
14366         public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
14367 
14368         /**
14369          * Whether to enable contacts metadata syncing or not
14370          * The value 1 - enable, 0 - disable
14371          */
14372         public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled";
14373 
14374         /**
14375          * Whether to enable cellular on boot.
14376          * The value 1 - enable, 0 - disable
14377          * @hide
14378          */
14379         public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot";
14380 
14381         /**
14382          * The maximum allowed notification enqueue rate in Hertz.
14383          *
14384          * Should be a float, and includes updates only.
14385          * @hide
14386          */
14387         public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate";
14388 
14389         /**
14390          * Displays toasts when an app posts a notification that does not specify a valid channel.
14391          *
14392          * The value 1 - enable, 0 - disable
14393          * @hide
14394          */
14395         public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS =
14396                 "show_notification_channel_warnings";
14397 
14398         /**
14399          * Whether cell is enabled/disabled
14400          * @hide
14401          */
14402         public static final String CELL_ON = "cell_on";
14403 
14404         /**
14405          * Global settings which can be accessed by instant apps.
14406          * @hide
14407          */
14408         public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
14409         static {
14410             INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER);
14411             INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED);
14412             INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES);
14413             INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL);
14414             INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES);
14415             INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON);
14416             INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE);
14417             INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE);
14418             INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE);
14419             INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES);
14420             INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE);
14421             INSTANT_APP_SETTINGS.add(WTF_IS_FATAL);
14422             INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR);
14423             INSTANT_APP_SETTINGS.add(ZEN_MODE);
14424         }
14425 
14426         /**
14427          * Whether to show the high temperature warning notification.
14428          * @hide
14429          */
14430         public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning";
14431 
14432         /**
14433          * Whether to show the usb high temperature alarm notification.
14434          * @hide
14435          */
14436         public static final String SHOW_USB_TEMPERATURE_ALARM = "show_usb_temperature_alarm";
14437 
14438         /**
14439          * Temperature at which the high temperature warning notification should be shown.
14440          * @hide
14441          */
14442         public static final String WARNING_TEMPERATURE = "warning_temperature";
14443 
14444         /**
14445          * Whether the diskstats logging task is enabled/disabled.
14446          * @hide
14447          */
14448         public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging";
14449 
14450         /**
14451          * Whether the cache quota calculation task is enabled/disabled.
14452          * @hide
14453          */
14454         public static final String ENABLE_CACHE_QUOTA_CALCULATION =
14455                 "enable_cache_quota_calculation";
14456 
14457         /**
14458          * Whether the Deletion Helper no threshold toggle is available.
14459          * @hide
14460          */
14461         public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE =
14462                 "enable_deletion_helper_no_threshold_toggle";
14463 
14464         /**
14465          * The list of snooze options for notifications
14466          * This is encoded as a key=value list, separated by commas. Ex:
14467          *
14468          * "default=60,options_array=15:30:60:120"
14469          *
14470          * The following keys are supported:
14471          *
14472          * <pre>
14473          * default               (int)
14474          * options_array         (int[])
14475          * </pre>
14476          *
14477          * All delays in integer minutes. Array order is respected.
14478          * Options will be used in order up to the maximum allowed by the UI.
14479          * @hide
14480          */
14481         public static final String NOTIFICATION_SNOOZE_OPTIONS =
14482                 "notification_snooze_options";
14483 
14484         /**
14485          * Settings key for the ratio of notification dismissals to notification views - one of the
14486          * criteria for showing the notification blocking helper.
14487          *
14488          * <p>The value is a float ranging from 0.0 to 1.0 (the closer to 0.0, the more intrusive
14489          * the blocking helper will be).
14490          *
14491          * @hide
14492          */
14493         public static final String BLOCKING_HELPER_DISMISS_TO_VIEW_RATIO_LIMIT =
14494                 "blocking_helper_dismiss_to_view_ratio";
14495 
14496         /**
14497          * Settings key for the longest streak of dismissals  - one of the criteria for showing the
14498          * notification blocking helper.
14499          *
14500          * <p>The value is an integer greater than 0.
14501          *
14502          * @hide
14503          */
14504         public static final String BLOCKING_HELPER_STREAK_LIMIT = "blocking_helper_streak_limit";
14505 
14506         /**
14507          * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated
14508          * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF
14509          *
14510          * Supported keys:<br/>
14511          * <li>
14512          * <ul> {@code legacy_compatibility_wal_enabled} : A {code boolean} flag that determines
14513          * whether or not "compatibility WAL" mode is enabled by default. This is a legacy flag
14514          * and is honoured on Android Q and higher. This flag will be removed in a future release.
14515          * </ul>
14516          * <ul> {@code wal_syncmode} : A {@code String} representing the synchronization mode to use
14517          * when WAL is enabled, either via {@code legacy_compatibility_wal_enabled} or using the
14518          * obsolete {@code compatibility_wal_supported} flag.
14519          * </ul>
14520          * <ul> {@code truncate_size} : A {@code int} flag that specifies the truncate size of the
14521          * WAL journal.
14522          * </ul>
14523          * <ul> {@code compatibility_wal_supported} : A {code boolean} flag that specifies whether
14524          * the legacy "compatibility WAL" mode is enabled by default. This flag is obsolete and is
14525          * only supported on Android Pie.
14526          * </ul>
14527          * </li>
14528          *
14529          * @hide
14530          */
14531         public static final String SQLITE_COMPATIBILITY_WAL_FLAGS =
14532                 "sqlite_compatibility_wal_flags";
14533 
14534         /**
14535          * Enable GNSS Raw Measurements Full Tracking?
14536          * 0 = no
14537          * 1 = yes
14538          * @hide
14539          */
14540         public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING =
14541                 "enable_gnss_raw_meas_full_tracking";
14542 
14543         /**
14544          * Whether the notification should be ongoing (persistent) when a carrier app install is
14545          * required.
14546          *
14547          * The value is a boolean (1 or 0).
14548          * @hide
14549          */
14550         @SystemApi
14551         public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT =
14552                 "install_carrier_app_notification_persistent";
14553 
14554         /**
14555          * The amount of time (ms) to hide the install carrier app notification after the user has
14556          * ignored it. After this time passes, the notification will be shown again
14557          *
14558          * The value is a long
14559          * @hide
14560          */
14561         @SystemApi
14562         public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS =
14563                 "install_carrier_app_notification_sleep_millis";
14564 
14565         /**
14566          * Whether we've enabled zram on this device. Takes effect on
14567          * reboot. The value "1" enables zram; "0" disables it, and
14568          * everything else is unspecified.
14569          * @hide
14570          */
14571         public static final String ZRAM_ENABLED =
14572                 "zram_enabled";
14573 
14574         /**
14575          * Configuration flags for smart replies in notifications.
14576          * This is encoded as a key=value list, separated by commas. Ex:
14577          *
14578          * "enabled=1,max_squeeze_remeasure_count=3"
14579          *
14580          * The following keys are supported:
14581          *
14582          * <pre>
14583          * enabled                           (boolean)
14584          * requires_targeting_p              (boolean)
14585          * max_squeeze_remeasure_attempts    (int)
14586          * edit_choices_before_sending       (boolean)
14587          * show_in_heads_up                  (boolean)
14588          * min_num_system_generated_replies  (int)
14589          * max_num_actions                   (int)
14590          * </pre>
14591          * @see com.android.systemui.statusbar.policy.SmartReplyConstants
14592          * @hide
14593          */
14594         public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS =
14595                 "smart_replies_in_notifications_flags";
14596 
14597         /**
14598          * Configuration flags for the automatic generation of smart replies and smart actions in
14599          * notifications. This is encoded as a key=value list, separated by commas. Ex:
14600          * "generate_replies=false,generate_actions=true".
14601          *
14602          * The following keys are supported:
14603          *
14604          * <pre>
14605          * generate_replies                 (boolean)
14606          * generate_actions                 (boolean)
14607          * </pre>
14608          * @hide
14609          */
14610         public static final String SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS =
14611                 "smart_suggestions_in_notifications_flags";
14612 
14613         /**
14614          * If nonzero, crashes in foreground processes will bring up a dialog.
14615          * Otherwise, the process will be silently killed.
14616          * @hide
14617          */
14618         public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog";
14619 
14620         /**
14621          * If nonzero, crash dialogs will show an option to restart the app.
14622          * @hide
14623          */
14624         public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog";
14625 
14626         /**
14627          * If nonzero, crash dialogs will show an option to mute all future crash dialogs for
14628          * this app.
14629          * @hide
14630          */
14631         public static final String SHOW_MUTE_IN_CRASH_DIALOG = "show_mute_in_crash_dialog";
14632 
14633 
14634         /**
14635          * If nonzero, will show the zen upgrade notification when the user toggles DND on/off.
14636          * @hide
14637          * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_UPGRADE_NOTIFICATION}
14638          */
14639         @Deprecated
14640         public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";
14641 
14642         /**
14643          * If nonzero, will show the zen update settings suggestion.
14644          * @hide
14645          * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_SETTINGS_SUGGESTION}
14646          */
14647         @Deprecated
14648         public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion";
14649 
14650         /**
14651          * If nonzero, zen has not been updated to reflect new changes.
14652          * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_UPDATED}
14653          * @hide
14654          */
14655         @Deprecated
14656         public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated";
14657 
14658         /**
14659          * If nonzero, zen setting suggestion has been viewed by user
14660          * @hide
14661          * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_SUGGESTION_VIEWED}
14662          */
14663         @Deprecated
14664         public static final String ZEN_SETTINGS_SUGGESTION_VIEWED =
14665                 "zen_settings_suggestion_viewed";
14666 
14667         /**
14668          * Backup and restore agent timeout parameters.
14669          * These parameters are represented by a comma-delimited key-value list.
14670          *
14671          * The following strings are supported as keys:
14672          * <pre>
14673          *     kv_backup_agent_timeout_millis         (long)
14674          *     full_backup_agent_timeout_millis       (long)
14675          *     shared_backup_agent_timeout_millis     (long)
14676          *     restore_agent_timeout_millis           (long)
14677          *     restore_agent_finished_timeout_millis  (long)
14678          * </pre>
14679          *
14680          * They map to milliseconds represented as longs.
14681          *
14682          * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000"
14683          *
14684          * @hide
14685          */
14686         public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS =
14687                 "backup_agent_timeout_parameters";
14688 
14689         /**
14690          * Whether the backup system service supports multiple users (0 = disabled, 1 = enabled). If
14691          * disabled, the service will only be active for the system user.
14692          *
14693          * @hide
14694          */
14695         public static final String BACKUP_MULTI_USER_ENABLED = "backup_multi_user_enabled";
14696 
14697         /**
14698          * Blacklist of GNSS satellites.
14699          *
14700          * This is a list of integers separated by commas to represent pairs of (constellation,
14701          * svid). Thus, the number of integers should be even.
14702          *
14703          * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are
14704          * blacklisted. Note that svid=0 denotes all svids in the
14705          * constellation are blacklisted.
14706          *
14707          * @hide
14708          */
14709         public static final String GNSS_SATELLITE_BLACKLIST = "gnss_satellite_blacklist";
14710 
14711         /**
14712          * Duration of updates in millisecond for GNSS location request from HAL to framework.
14713          *
14714          * If zero, the GNSS location request feature is disabled.
14715          *
14716          * The value is a non-negative long.
14717          *
14718          * @hide
14719          */
14720         public static final String GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS =
14721                 "gnss_hal_location_request_duration_millis";
14722 
14723         /**
14724          * Binder call stats settings.
14725          *
14726          * The following strings are supported as keys:
14727          * <pre>
14728          *     enabled              (boolean)
14729          *     detailed_tracking    (boolean)
14730          *     upload_data          (boolean)
14731          *     sampling_interval    (int)
14732          * </pre>
14733          *
14734          * @hide
14735          */
14736         public static final String BINDER_CALLS_STATS = "binder_calls_stats";
14737 
14738         /**
14739          * Looper stats settings.
14740          *
14741          * The following strings are supported as keys:
14742          * <pre>
14743          *     enabled              (boolean)
14744          *     sampling_interval    (int)
14745          * </pre>
14746          *
14747          * @hide
14748          */
14749         public static final String LOOPER_STATS = "looper_stats";
14750 
14751         /**
14752          * Settings for collecting statistics on CPU usage per thread
14753          *
14754          * The following strings are supported as keys:
14755          * <pre>
14756          *     num_buckets          (int)
14757          *     collected_uids       (string)
14758          *     minimum_total_cpu_usage_millis (int)
14759          * </pre>
14760          *
14761          * @hide
14762          */
14763         public static final String KERNEL_CPU_THREAD_READER = "kernel_cpu_thread_reader";
14764 
14765         /**
14766          * Default user id to boot into. They map to user ids, for example, 10, 11, 12.
14767          *
14768          * @hide
14769          */
14770         public static final String DEFAULT_USER_ID_TO_BOOT_INTO = "default_boot_into_user_id";
14771 
14772         /**
14773          * Persistent user id that is last logged in to.
14774          *
14775          * They map to user ids, for example, 10, 11, 12.
14776          *
14777          * @hide
14778          */
14779         public static final String LAST_ACTIVE_USER_ID = "last_active_persistent_user_id";
14780 
14781         /**
14782          * Whether we've enabled native flags health check on this device. Takes effect on
14783          * reboot. The value "1" enables native flags health check; otherwise it's disabled.
14784          * @hide
14785          */
14786         public static final String NATIVE_FLAGS_HEALTH_CHECK_ENABLED =
14787                 "native_flags_health_check_enabled";
14788 
14789         /**
14790          * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the mode
14791          * in which the historical registry operates.
14792          *
14793          * @hide
14794          */
14795         public static final String APPOP_HISTORY_MODE = "mode";
14796 
14797         /**
14798          * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls how long
14799          * is the interval between snapshots in the base case i.e. the most recent
14800          * part of the history.
14801          *
14802          * @hide
14803          */
14804         public static final String APPOP_HISTORY_BASE_INTERVAL_MILLIS = "baseIntervalMillis";
14805 
14806         /**
14807          * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the base
14808          * for the logarithmic step when building app op history.
14809          *
14810          * @hide
14811          */
14812         public static final String APPOP_HISTORY_INTERVAL_MULTIPLIER = "intervalMultiplier";
14813 
14814         /**
14815          * Appop history parameters. These parameters are represented by
14816          * a comma-delimited key-value list.
14817          *
14818          * The following strings are supported as keys:
14819          * <pre>
14820          *     mode                  (int)
14821          *     baseIntervalMillis    (long)
14822          *     intervalMultiplier    (int)
14823          * </pre>
14824          *
14825          * Ex: "mode=HISTORICAL_MODE_ENABLED_ACTIVE,baseIntervalMillis=1000,intervalMultiplier=10"
14826          *
14827          * @see #APPOP_HISTORY_MODE
14828          * @see #APPOP_HISTORY_BASE_INTERVAL_MILLIS
14829          * @see #APPOP_HISTORY_INTERVAL_MULTIPLIER
14830          *
14831          * @hide
14832          */
14833         public static final String APPOP_HISTORY_PARAMETERS =
14834                 "appop_history_parameters";
14835 
14836         /**
14837          * Delay for sending ACTION_CHARGING after device is plugged in.
14838          * This is used as an override for constants defined in BatteryStatsImpl for
14839          * ease of experimentation.
14840          *
14841          * @see com.android.internal.os.BatteryStatsImpl.Constants.KEY_BATTERY_CHARGED_DELAY_MS
14842          * @hide
14843          */
14844         public static final String BATTERY_CHARGING_STATE_UPDATE_DELAY =
14845                 "battery_charging_state_update_delay";
14846 
14847         /**
14848          * A serialized string of params that will be loaded into a text classifier action model.
14849          *
14850          * @hide
14851          */
14852         public static final String TEXT_CLASSIFIER_ACTION_MODEL_PARAMS =
14853                 "text_classifier_action_model_params";
14854 
14855         /**
14856          * The amount of time to suppress "power-off" from the power button after the device has
14857          * woken due to a gesture (lifting the phone).  Since users have learned to hit the power
14858          * button immediately when lifting their device, it can cause the device to turn off if a
14859          * gesture has just woken the device. This value tells us the milliseconds to wait after
14860          * a gesture before "power-off" via power-button is functional again. A value of 0 is no
14861          * delay, and reverts to the old behavior.
14862          *
14863          * @hide
14864          */
14865         public static final String POWER_BUTTON_SUPPRESSION_DELAY_AFTER_GESTURE_WAKE =
14866                 "power_button_suppression_delay_after_gesture_wake";
14867     }
14868 
14869     /**
14870      * Configuration system settings, containing settings which are applied identically for all
14871      * defined users. Only Android can read these and only a specific configuration service can
14872      * write these.
14873      *
14874      * @hide
14875      */
14876     public static final class Config extends NameValueTable {
14877         private static final ContentProviderHolder sProviderHolder =
14878                 new ContentProviderHolder(DeviceConfig.CONTENT_URI);
14879 
14880         // Populated lazily, guarded by class object:
14881         private static final NameValueCache sNameValueCache = new NameValueCache(
14882                 DeviceConfig.CONTENT_URI,
14883                 CALL_METHOD_GET_CONFIG,
14884                 CALL_METHOD_PUT_CONFIG,
14885                 sProviderHolder);
14886 
14887         /**
14888          * Look up a name in the database.
14889          * @param resolver to access the database with
14890          * @param name to look up in the table
14891          * @return the corresponding value, or null if not present
14892          *
14893          * @hide
14894          */
14895         @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG)
getString(ContentResolver resolver, String name)14896         static String getString(ContentResolver resolver, String name) {
14897             return sNameValueCache.getStringForUser(resolver, name, resolver.getUserId());
14898         }
14899 
14900         /**
14901          * Store a name/value pair into the database.
14902          * <p>
14903          * Also the method takes an argument whether to make the value the default for this setting.
14904          * If the system already specified a default value, then the one passed in here will
14905          * <strong>not</strong> be set as the default.
14906          * </p>
14907          *
14908          * @param resolver to access the database with.
14909          * @param name to store.
14910          * @param value to associate with the name.
14911          * @param makeDefault whether to make the value the default one.
14912          * @return true if the value was set, false on database errors.
14913          *
14914          * @see #resetToDefaults(ContentResolver, int, String)
14915          *
14916          * @hide
14917          */
14918         @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, boolean makeDefault)14919         static boolean putString(@NonNull ContentResolver resolver, @NonNull String name,
14920                 @Nullable String value, boolean makeDefault) {
14921             return sNameValueCache.putStringForUser(resolver, name, value, null, makeDefault,
14922                     resolver.getUserId());
14923         }
14924 
14925         /**
14926          * Reset the values to their defaults.
14927          * <p>
14928          * The method accepts an optional prefix parameter. If provided, only pairs with a name that
14929          * starts with the exact prefix will be reset. Otherwise all will be reset.
14930          *
14931          * @param resolver Handle to the content resolver.
14932          * @param resetMode The reset mode to use.
14933          * @param prefix Optionally, to limit which which pairs are reset.
14934          *
14935          * @see #putString(ContentResolver, String, String, boolean)
14936          *
14937          * @hide
14938          */
14939         @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
resetToDefaults(@onNull ContentResolver resolver, @ResetMode int resetMode, @Nullable String prefix)14940         static void resetToDefaults(@NonNull ContentResolver resolver, @ResetMode int resetMode,
14941                 @Nullable String prefix) {
14942             try {
14943                 Bundle arg = new Bundle();
14944                 arg.putInt(CALL_METHOD_USER_KEY, resolver.getUserId());
14945                 arg.putInt(CALL_METHOD_RESET_MODE_KEY, resetMode);
14946                 if (prefix != null) {
14947                     arg.putString(Settings.CALL_METHOD_PREFIX_KEY, prefix);
14948                 }
14949                 IContentProvider cp = sProviderHolder.getProvider(resolver);
14950                 cp.call(resolver.getPackageName(), sProviderHolder.mUri.getAuthority(),
14951                         CALL_METHOD_RESET_CONFIG, null, arg);
14952             } catch (RemoteException e) {
14953                 Log.w(TAG, "Can't reset to defaults for " + DeviceConfig.CONTENT_URI, e);
14954             }
14955         }
14956     }
14957 
14958     /**
14959      * User-defined bookmarks and shortcuts.  The target of each bookmark is an
14960      * Intent URL, allowing it to be either a web page or a particular
14961      * application activity.
14962      *
14963      * @hide
14964      */
14965     public static final class Bookmarks implements BaseColumns
14966     {
14967         private static final String TAG = "Bookmarks";
14968 
14969         /**
14970          * The content:// style URL for this table
14971          */
14972         @UnsupportedAppUsage
14973         public static final Uri CONTENT_URI =
14974             Uri.parse("content://" + AUTHORITY + "/bookmarks");
14975 
14976         /**
14977          * The row ID.
14978          * <p>Type: INTEGER</p>
14979          */
14980         public static final String ID = "_id";
14981 
14982         /**
14983          * Descriptive name of the bookmark that can be displayed to the user.
14984          * If this is empty, the title should be resolved at display time (use
14985          * {@link #getTitle(Context, Cursor)} any time you want to display the
14986          * title of a bookmark.)
14987          * <P>
14988          * Type: TEXT
14989          * </P>
14990          */
14991         public static final String TITLE = "title";
14992 
14993         /**
14994          * Arbitrary string (displayed to the user) that allows bookmarks to be
14995          * organized into categories.  There are some special names for
14996          * standard folders, which all start with '@'.  The label displayed for
14997          * the folder changes with the locale (via {@link #getLabelForFolder}) but
14998          * the folder name does not change so you can consistently query for
14999          * the folder regardless of the current locale.
15000          *
15001          * <P>Type: TEXT</P>
15002          *
15003          */
15004         public static final String FOLDER = "folder";
15005 
15006         /**
15007          * The Intent URL of the bookmark, describing what it points to.  This
15008          * value is given to {@link android.content.Intent#getIntent} to create
15009          * an Intent that can be launched.
15010          * <P>Type: TEXT</P>
15011          */
15012         public static final String INTENT = "intent";
15013 
15014         /**
15015          * Optional shortcut character associated with this bookmark.
15016          * <P>Type: INTEGER</P>
15017          */
15018         public static final String SHORTCUT = "shortcut";
15019 
15020         /**
15021          * The order in which the bookmark should be displayed
15022          * <P>Type: INTEGER</P>
15023          */
15024         public static final String ORDERING = "ordering";
15025 
15026         private static final String[] sIntentProjection = { INTENT };
15027         private static final String[] sShortcutProjection = { ID, SHORTCUT };
15028         private static final String sShortcutSelection = SHORTCUT + "=?";
15029 
15030         /**
15031          * Convenience function to retrieve the bookmarked Intent for a
15032          * particular shortcut key.
15033          *
15034          * @param cr The ContentResolver to query.
15035          * @param shortcut The shortcut key.
15036          *
15037          * @return Intent The bookmarked URL, or null if there is no bookmark
15038          *         matching the given shortcut.
15039          */
getIntentForShortcut(ContentResolver cr, char shortcut)15040         public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
15041         {
15042             Intent intent = null;
15043 
15044             Cursor c = cr.query(CONTENT_URI,
15045                     sIntentProjection, sShortcutSelection,
15046                     new String[] { String.valueOf((int) shortcut) }, ORDERING);
15047             // Keep trying until we find a valid shortcut
15048             try {
15049                 while (intent == null && c.moveToNext()) {
15050                     try {
15051                         String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
15052                         intent = Intent.parseUri(intentURI, 0);
15053                     } catch (java.net.URISyntaxException e) {
15054                         // The stored URL is bad...  ignore it.
15055                     } catch (IllegalArgumentException e) {
15056                         // Column not found
15057                         Log.w(TAG, "Intent column not found", e);
15058                     }
15059                 }
15060             } finally {
15061                 if (c != null) c.close();
15062             }
15063 
15064             return intent;
15065         }
15066 
15067         /**
15068          * Add a new bookmark to the system.
15069          *
15070          * @param cr The ContentResolver to query.
15071          * @param intent The desired target of the bookmark.
15072          * @param title Bookmark title that is shown to the user; null if none
15073          *            or it should be resolved to the intent's title.
15074          * @param folder Folder in which to place the bookmark; null if none.
15075          * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
15076          *            this is non-zero and there is an existing bookmark entry
15077          *            with this same shortcut, then that existing shortcut is
15078          *            cleared (the bookmark is not removed).
15079          * @return The unique content URL for the new bookmark entry.
15080          */
15081         @UnsupportedAppUsage
add(ContentResolver cr, Intent intent, String title, String folder, char shortcut, int ordering)15082         public static Uri add(ContentResolver cr,
15083                                            Intent intent,
15084                                            String title,
15085                                            String folder,
15086                                            char shortcut,
15087                                            int ordering)
15088         {
15089             // If a shortcut is supplied, and it is already defined for
15090             // another bookmark, then remove the old definition.
15091             if (shortcut != 0) {
15092                 cr.delete(CONTENT_URI, sShortcutSelection,
15093                         new String[] { String.valueOf((int) shortcut) });
15094             }
15095 
15096             ContentValues values = new ContentValues();
15097             if (title != null) values.put(TITLE, title);
15098             if (folder != null) values.put(FOLDER, folder);
15099             values.put(INTENT, intent.toUri(0));
15100             if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
15101             values.put(ORDERING, ordering);
15102             return cr.insert(CONTENT_URI, values);
15103         }
15104 
15105         /**
15106          * Return the folder name as it should be displayed to the user.  This
15107          * takes care of localizing special folders.
15108          *
15109          * @param r Resources object for current locale; only need access to
15110          *          system resources.
15111          * @param folder The value found in the {@link #FOLDER} column.
15112          *
15113          * @return CharSequence The label for this folder that should be shown
15114          *         to the user.
15115          */
getLabelForFolder(Resources r, String folder)15116         public static CharSequence getLabelForFolder(Resources r, String folder) {
15117             return folder;
15118         }
15119 
15120         /**
15121          * Return the title as it should be displayed to the user. This takes
15122          * care of localizing bookmarks that point to activities.
15123          *
15124          * @param context A context.
15125          * @param cursor A cursor pointing to the row whose title should be
15126          *        returned. The cursor must contain at least the {@link #TITLE}
15127          *        and {@link #INTENT} columns.
15128          * @return A title that is localized and can be displayed to the user,
15129          *         or the empty string if one could not be found.
15130          */
getTitle(Context context, Cursor cursor)15131         public static CharSequence getTitle(Context context, Cursor cursor) {
15132             int titleColumn = cursor.getColumnIndex(TITLE);
15133             int intentColumn = cursor.getColumnIndex(INTENT);
15134             if (titleColumn == -1 || intentColumn == -1) {
15135                 throw new IllegalArgumentException(
15136                         "The cursor must contain the TITLE and INTENT columns.");
15137             }
15138 
15139             String title = cursor.getString(titleColumn);
15140             if (!TextUtils.isEmpty(title)) {
15141                 return title;
15142             }
15143 
15144             String intentUri = cursor.getString(intentColumn);
15145             if (TextUtils.isEmpty(intentUri)) {
15146                 return "";
15147             }
15148 
15149             Intent intent;
15150             try {
15151                 intent = Intent.parseUri(intentUri, 0);
15152             } catch (URISyntaxException e) {
15153                 return "";
15154             }
15155 
15156             PackageManager packageManager = context.getPackageManager();
15157             ResolveInfo info = packageManager.resolveActivity(intent, 0);
15158             return info != null ? info.loadLabel(packageManager) : "";
15159         }
15160     }
15161 
15162     /**
15163      * <p>
15164      *     A Settings panel is floating UI that contains a fixed subset of settings to address a
15165      *     particular user problem. For example, the
15166      *     {@link #ACTION_INTERNET_CONNECTIVITY Internet Panel} surfaces settings related to
15167      *     connecting to the internet.
15168      * <p>
15169      *     Settings panels appear above the calling app to address the problem without
15170      *     the user needing to open Settings and thus leave their current screen.
15171      */
15172     public static final class Panel {
Panel()15173         private Panel() {
15174         }
15175 
15176         /**
15177          * Activity Action: Show a settings dialog containing settings to enable internet
15178          * connection.
15179          * <p>
15180          * Input: Nothing.
15181          * <p>
15182          * Output: Nothing.
15183          */
15184         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
15185         public static final String ACTION_INTERNET_CONNECTIVITY =
15186                 "android.settings.panel.action.INTERNET_CONNECTIVITY";
15187 
15188         /**
15189          * Activity Action: Show a settings dialog containing NFC-related settings.
15190          * <p>
15191          * Input: Nothing.
15192          * <p>
15193          * Output: Nothing.
15194          */
15195         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
15196         public static final String ACTION_NFC =
15197                 "android.settings.panel.action.NFC";
15198 
15199         /**
15200          * Activity Action: Show a settings dialog containing controls for Wifi.
15201          * <p>
15202          * Input: Nothing.
15203          * <p>
15204          * Output: Nothing.
15205          */
15206         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
15207         public static final String ACTION_WIFI =
15208                 "android.settings.panel.action.WIFI";
15209 
15210         /**
15211          * Activity Action: Show a settings dialog containing all volume streams.
15212          * <p>
15213          * Input: Nothing.
15214          * <p>
15215          * Output: Nothing.
15216          */
15217         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
15218         public static final String ACTION_VOLUME =
15219                 "android.settings.panel.action.VOLUME";
15220     }
15221 
15222     private static final String[] PM_WRITE_SETTINGS = {
15223         android.Manifest.permission.WRITE_SETTINGS
15224     };
15225     private static final String[] PM_CHANGE_NETWORK_STATE = {
15226         android.Manifest.permission.CHANGE_NETWORK_STATE,
15227         android.Manifest.permission.WRITE_SETTINGS
15228     };
15229     private static final String[] PM_SYSTEM_ALERT_WINDOW = {
15230         android.Manifest.permission.SYSTEM_ALERT_WINDOW
15231     };
15232 
15233     /**
15234      * Performs a strict and comprehensive check of whether a calling package is allowed to
15235      * write/modify system settings, as the condition differs for pre-M, M+, and
15236      * privileged/preinstalled apps. If the provided uid does not match the
15237      * callingPackage, a negative result will be returned.
15238      * @hide
15239      */
15240     @UnsupportedAppUsage
isCallingPackageAllowedToWriteSettings(Context context, int uid, String callingPackage, boolean throwException)15241     public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid,
15242             String callingPackage, boolean throwException) {
15243         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
15244                 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
15245                 PM_WRITE_SETTINGS, false);
15246     }
15247 
15248     /**
15249      * Performs a strict and comprehensive check of whether a calling package is allowed to
15250      * write/modify system settings, as the condition differs for pre-M, M+, and
15251      * privileged/preinstalled apps. If the provided uid does not match the
15252      * callingPackage, a negative result will be returned. The caller is expected to have
15253      * the WRITE_SETTINGS permission declared.
15254      *
15255      * Note: if the check is successful, the operation of this app will be updated to the
15256      * current time.
15257      * @hide
15258      */
checkAndNoteWriteSettingsOperation(Context context, int uid, String callingPackage, boolean throwException)15259     public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid,
15260             String callingPackage, boolean throwException) {
15261         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
15262                 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
15263                 PM_WRITE_SETTINGS, true);
15264     }
15265 
15266     /**
15267      * Performs a strict and comprehensive check of whether a calling package is allowed to
15268      * change the state of network, as the condition differs for pre-M, M+, and
15269      * privileged/preinstalled apps. The caller is expected to have either the
15270      * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these
15271      * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and
15272      * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal
15273      * permission and cannot be revoked. See http://b/23597341
15274      *
15275      * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation
15276      * of this app will be updated to the current time.
15277      * @hide
15278      */
checkAndNoteChangeNetworkStateOperation(Context context, int uid, String callingPackage, boolean throwException)15279     public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid,
15280             String callingPackage, boolean throwException) {
15281         if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE)
15282                 == PackageManager.PERMISSION_GRANTED) {
15283             return true;
15284         }
15285         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
15286                 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
15287                 PM_CHANGE_NETWORK_STATE, true);
15288     }
15289 
15290     /**
15291      * Performs a strict and comprehensive check of whether a calling package is allowed to
15292      * draw on top of other apps, as the conditions differs for pre-M, M+, and
15293      * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
15294      * a negative result will be returned.
15295      * @hide
15296      */
15297     @UnsupportedAppUsage
isCallingPackageAllowedToDrawOverlays(Context context, int uid, String callingPackage, boolean throwException)15298     public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid,
15299             String callingPackage, boolean throwException) {
15300         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
15301                 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
15302                 PM_SYSTEM_ALERT_WINDOW, false);
15303     }
15304 
15305     /**
15306      * Performs a strict and comprehensive check of whether a calling package is allowed to
15307      * draw on top of other apps, as the conditions differs for pre-M, M+, and
15308      * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
15309      * a negative result will be returned.
15310      *
15311      * Note: if the check is successful, the operation of this app will be updated to the
15312      * current time.
15313      * @hide
15314      */
checkAndNoteDrawOverlaysOperation(Context context, int uid, String callingPackage, boolean throwException)15315     public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String
15316             callingPackage, boolean throwException) {
15317         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
15318                 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
15319                 PM_SYSTEM_ALERT_WINDOW, true);
15320     }
15321 
15322     /**
15323      * Helper method to perform a general and comprehensive check of whether an operation that is
15324      * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and
15325      * OP_WRITE_SETTINGS
15326      * @hide
15327      */
15328     @UnsupportedAppUsage
isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] permissions, boolean makeNote)15329     public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
15330             int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[]
15331             permissions, boolean makeNote) {
15332         if (callingPackage == null) {
15333             return false;
15334         }
15335 
15336         AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE);
15337         int mode = AppOpsManager.MODE_DEFAULT;
15338         if (makeNote) {
15339             mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage);
15340         } else {
15341             mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage);
15342         }
15343 
15344         switch (mode) {
15345             case AppOpsManager.MODE_ALLOWED:
15346                 return true;
15347 
15348             case AppOpsManager.MODE_DEFAULT:
15349                 // this is the default operating mode after an app's installation
15350                 // In this case we will check all associated static permission to see
15351                 // if it is granted during install time.
15352                 for (String permission : permissions) {
15353                     if (context.checkCallingOrSelfPermission(permission) == PackageManager
15354                             .PERMISSION_GRANTED) {
15355                         // if either of the permissions are granted, we will allow it
15356                         return true;
15357                     }
15358                 }
15359 
15360             default:
15361                 // this is for all other cases trickled down here...
15362                 if (!throwException) {
15363                     return false;
15364                 }
15365         }
15366 
15367         // prepare string to throw SecurityException
15368         StringBuilder exceptionMessage = new StringBuilder();
15369         exceptionMessage.append(callingPackage);
15370         exceptionMessage.append(" was not granted ");
15371         if (permissions.length > 1) {
15372             exceptionMessage.append(" either of these permissions: ");
15373         } else {
15374             exceptionMessage.append(" this permission: ");
15375         }
15376         for (int i = 0; i < permissions.length; i++) {
15377             exceptionMessage.append(permissions[i]);
15378             exceptionMessage.append((i == permissions.length - 1) ? "." : ", ");
15379         }
15380 
15381         throw new SecurityException(exceptionMessage.toString());
15382     }
15383 
15384     /**
15385      * Retrieves a correponding package name for a given uid. It will query all
15386      * packages that are associated with the given uid, but it will return only
15387      * the zeroth result.
15388      * Note: If package could not be found, a null is returned.
15389      * @hide
15390      */
getPackageNameForUid(Context context, int uid)15391     public static String getPackageNameForUid(Context context, int uid) {
15392         String[] packages = context.getPackageManager().getPackagesForUid(uid);
15393         if (packages == null) {
15394             return null;
15395         }
15396         return packages[0];
15397     }
15398 }
15399