• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2006 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.provider;
18 
19 import android.Manifest;
20 import android.annotation.IntDef;
21 import android.annotation.IntRange;
22 import android.annotation.NonNull;
23 import android.annotation.Nullable;
24 import android.annotation.RequiresPermission;
25 import android.annotation.SdkConstant;
26 import android.annotation.SdkConstant.SdkConstantType;
27 import android.annotation.SuppressLint;
28 import android.annotation.SystemApi;
29 import android.annotation.TestApi;
30 import android.annotation.UserIdInt;
31 import android.app.ActivityThread;
32 import android.app.AppOpsManager;
33 import android.app.Application;
34 import android.app.AutomaticZenRule;
35 import android.app.NotificationChannel;
36 import android.app.NotificationManager;
37 import android.app.SearchManager;
38 import android.app.WallpaperManager;
39 import android.compat.annotation.UnsupportedAppUsage;
40 import android.content.ComponentName;
41 import android.content.ContentResolver;
42 import android.content.ContentValues;
43 import android.content.Context;
44 import android.content.IContentProvider;
45 import android.content.Intent;
46 import android.content.pm.ActivityInfo;
47 import android.content.pm.PackageManager;
48 import android.content.pm.ResolveInfo;
49 import android.content.res.Configuration;
50 import android.content.res.Resources;
51 import android.database.Cursor;
52 import android.database.SQLException;
53 import android.location.LocationManager;
54 import android.net.ConnectivityManager;
55 import android.net.NetworkScoreManager;
56 import android.net.Uri;
57 import android.net.wifi.SoftApConfiguration;
58 import android.net.wifi.WifiManager;
59 import android.net.wifi.p2p.WifiP2pManager;
60 import android.os.BatteryManager;
61 import android.os.Binder;
62 import android.os.Build.VERSION_CODES;
63 import android.os.Bundle;
64 import android.os.DropBoxManager;
65 import android.os.IBinder;
66 import android.os.LocaleList;
67 import android.os.PowerManager.AutoPowerSaveModeTriggers;
68 import android.os.Process;
69 import android.os.RemoteCallback;
70 import android.os.RemoteException;
71 import android.os.ResultReceiver;
72 import android.os.ServiceManager;
73 import android.os.UserHandle;
74 import android.speech.tts.TextToSpeech;
75 import android.text.TextUtils;
76 import android.util.AndroidException;
77 import android.util.ArrayMap;
78 import android.util.ArraySet;
79 import android.util.Log;
80 import android.util.MemoryIntArray;
81 import android.view.Display;
82 
83 import com.android.internal.annotations.GuardedBy;
84 import com.android.internal.util.Preconditions;
85 import com.android.internal.widget.ILockSettings;
86 
87 import java.io.IOException;
88 import java.lang.annotation.Retention;
89 import java.lang.annotation.RetentionPolicy;
90 import java.net.URISyntaxException;
91 import java.util.ArrayList;
92 import java.util.HashMap;
93 import java.util.HashSet;
94 import java.util.List;
95 import java.util.Map;
96 import java.util.Set;
97 
98 /**
99  * The Settings provider contains global system-level device preferences.
100  */
101 public final class Settings {
102     /** @hide */
103     public static final boolean DEFAULT_OVERRIDEABLE_BY_RESTORE = false;
104 
105     // Intent actions for Settings
106 
107     /**
108      * Activity Action: Show system settings.
109      * <p>
110      * Input: Nothing.
111      * <p>
112      * Output: Nothing.
113      */
114     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
115     public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
116 
117     /**
118      * Activity Action: Show settings to allow configuration of APNs.
119      * <p>
120      * Input: Nothing.
121      * <p>
122      * Output: Nothing.
123      *
124      * <p class="note">
125      * In some cases, a matching Activity may not exist, so ensure you
126      * safeguard against this.
127      */
128     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
129     public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
130 
131     /**
132      * Activity Action: Show settings to allow configuration of current location
133      * sources.
134      * <p>
135      * In some cases, a matching Activity may not exist, so ensure you
136      * safeguard against this.
137      * <p>
138      * Input: Nothing.
139      * <p>
140      * Output: Nothing.
141      */
142     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
143     public static final String ACTION_LOCATION_SOURCE_SETTINGS =
144             "android.settings.LOCATION_SOURCE_SETTINGS";
145 
146     /**
147      * Activity Action: Show settings to allow configuration of location controller extra package.
148      * <p>
149      * In some cases, a matching Activity may not exist, so ensure you
150      * safeguard against this.
151      * <p>
152      * Input: Nothing.
153      * <p>
154      * Output: Nothing.
155      *
156      * @hide
157      */
158     @SystemApi
159     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
160     public static final String ACTION_LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS =
161             "android.settings.LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS";
162 
163     /**
164      * Activity Action: Show scanning settings to allow configuration of Wi-Fi
165      * and Bluetooth scanning settings.
166      * <p>
167      * In some cases, a matching Activity may not exist, so ensure you
168      * safeguard against this.
169      * <p>
170      * Input: Nothing.
171      * <p>
172      * Output: Nothing.
173      * @hide
174      */
175     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
176     public static final String ACTION_LOCATION_SCANNING_SETTINGS =
177             "android.settings.LOCATION_SCANNING_SETTINGS";
178 
179     /**
180      * Activity Action: Show settings to allow configuration of users.
181      * <p>
182      * In some cases, a matching Activity may not exist, so ensure you
183      * safeguard against this.
184      * <p>
185      * Input: Nothing.
186      * <p>
187      * Output: Nothing.
188      * @hide
189      */
190     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
191     public static final String ACTION_USER_SETTINGS =
192             "android.settings.USER_SETTINGS";
193 
194     /**
195      * Activity Action: Show settings to allow configuration of wireless controls
196      * such as Wi-Fi, Bluetooth and Mobile networks.
197      * <p>
198      * In some cases, a matching Activity may not exist, so ensure you
199      * safeguard against this.
200      * <p>
201      * Input: Nothing.
202      * <p>
203      * Output: Nothing.
204      */
205     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
206     public static final String ACTION_WIRELESS_SETTINGS =
207             "android.settings.WIRELESS_SETTINGS";
208 
209     /**
210      * Activity Action: Show tether provisioning activity.
211      *
212      * <p>
213      * In some cases, a matching Activity may not exist, so ensure you
214      * safeguard against this.
215      * <p>
216      * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type
217      * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should
218      * contain a {@link ResultReceiver} which will be called back with a tether result code.
219      * <p>
220      * Output: The result of the provisioning check.
221      * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful,
222      * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure.
223      *
224      * @hide
225      */
226     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
227     @SystemApi
228     @TestApi
229     public static final String ACTION_TETHER_PROVISIONING_UI =
230             "android.settings.TETHER_PROVISIONING_UI";
231 
232     /**
233      * Activity Action: Show settings to allow entering/exiting airplane mode.
234      * <p>
235      * In some cases, a matching Activity may not exist, so ensure you
236      * safeguard against this.
237      * <p>
238      * Input: Nothing.
239      * <p>
240      * Output: Nothing.
241      */
242     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
243     public static final String ACTION_AIRPLANE_MODE_SETTINGS =
244             "android.settings.AIRPLANE_MODE_SETTINGS";
245 
246     /**
247      * Activity Action: Show mobile data usage list.
248      * <p>
249      * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify
250      * how and what mobile data statistics should be collected.
251      * <p>
252      * Output: Nothing
253      * @hide
254      */
255     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
256     public static final String ACTION_MOBILE_DATA_USAGE =
257             "android.settings.MOBILE_DATA_USAGE";
258 
259     /** @hide */
260     public static final String EXTRA_NETWORK_TEMPLATE = "network_template";
261 
262     /** @hide */
263     public static final String KEY_CONFIG_SET_RETURN = "config_set_return";
264 
265     /**
266      * An int extra specifying a subscription ID.
267      *
268      * @see android.telephony.SubscriptionInfo#getSubscriptionId
269      */
270     public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID";
271 
272     /**
273      * Activity Action: Modify Airplane mode settings using a voice command.
274      * <p>
275      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
276      * <p>
277      * This intent MUST be started using
278      * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
279      * startVoiceActivity}.
280      * <p>
281      * Note: The activity implementing this intent MUST verify that
282      * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
283      * modifying the setting.
284      * <p>
285      * Input: To tell which state airplane mode should be set to, add the
286      * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
287      * If the extra is not included, no changes will be made.
288      * <p>
289      * Output: Nothing.
290      */
291     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
292     public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
293             "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
294 
295     /**
296      * Activity Action: Show settings for accessibility modules.
297      * <p>
298      * In some cases, a matching Activity may not exist, so ensure you
299      * safeguard against this.
300      * <p>
301      * Input: Nothing.
302      * <p>
303      * Output: Nothing.
304      */
305     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
306     public static final String ACTION_ACCESSIBILITY_SETTINGS =
307             "android.settings.ACCESSIBILITY_SETTINGS";
308 
309     /**
310      * Activity Action: Show detail settings of a particular accessibility service.
311      * <p>
312      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
313      * <p>
314      * Input: {@link Intent#EXTRA_COMPONENT_NAME} must specify the accessibility service component
315      * name to be shown.
316      * <p>
317      * Output: Nothing.
318      * @hide
319      **/
320     @SystemApi
321     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
322     public static final String ACTION_ACCESSIBILITY_DETAILS_SETTINGS =
323             "android.settings.ACCESSIBILITY_DETAILS_SETTINGS";
324 
325     /**
326      * Activity Action: Show settings to control access to usage information.
327      * <p>
328      * In some cases, a matching Activity may not exist, so ensure you
329      * safeguard against this.
330      * <p>
331      * Input: Nothing.
332      * <p>
333      * Output: Nothing.
334      */
335     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
336     public static final String ACTION_USAGE_ACCESS_SETTINGS =
337             "android.settings.USAGE_ACCESS_SETTINGS";
338 
339     /**
340      * Activity Category: Show application settings related to usage access.
341      * <p>
342      * An activity that provides a user interface for adjusting usage access related
343      * preferences for its containing application. Optional but recommended for apps that
344      * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}.
345      * <p>
346      * The activity may define meta-data to describe what usage access is
347      * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which
348      * will be displayed in Settings.
349      * <p>
350      * Input: Nothing.
351      * <p>
352      * Output: Nothing.
353      */
354     @SdkConstant(SdkConstantType.INTENT_CATEGORY)
355     public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG =
356             "android.intent.category.USAGE_ACCESS_CONFIG";
357 
358     /**
359      * Metadata key: Reason for needing usage access.
360      * <p>
361      * A key for metadata attached to an activity that receives action
362      * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the
363      * user as description of how the app uses usage access.
364      * <p>
365      */
366     public static final String METADATA_USAGE_ACCESS_REASON =
367             "android.settings.metadata.USAGE_ACCESS_REASON";
368 
369     /**
370      * Activity Action: Show settings to allow configuration of security and
371      * location privacy.
372      * <p>
373      * In some cases, a matching Activity may not exist, so ensure you
374      * safeguard against this.
375      * <p>
376      * Input: Nothing.
377      * <p>
378      * Output: Nothing.
379      */
380     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
381     public static final String ACTION_SECURITY_SETTINGS =
382             "android.settings.SECURITY_SETTINGS";
383 
384     /**
385      * Activity Action: Show settings to allow configuration of trusted external sources
386      *
387      * Input: Optionally, the Intent's data URI can specify the application package name to
388      * directly invoke the management GUI specific to the package name. For example
389      * "package:com.my.app".
390      * <p>
391      * Output: Nothing.
392      */
393     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
394     public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES =
395             "android.settings.MANAGE_UNKNOWN_APP_SOURCES";
396 
397     /**
398      * Activity Action: Show settings to allow configuration of cross-profile access for apps
399      *
400      * Input: Optionally, the Intent's data URI can specify the application package name to
401      * directly invoke the management GUI specific to the package name. For example
402      * "package:com.my.app".
403      * <p>
404      * Output: Nothing.
405      *
406      * @hide
407      */
408     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
409     public static final String ACTION_MANAGE_CROSS_PROFILE_ACCESS =
410             "android.settings.MANAGE_CROSS_PROFILE_ACCESS";
411 
412     /**
413      * Activity Action: Show the "Open by Default" page in a particular application's details page.
414      * <p>
415      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
416      * <p>
417      * Input: The Intent's data URI specifies the application package name
418      * to be shown, with the "package" scheme. That is "package:com.my.app".
419      * <p>
420      * Output: Nothing.
421      * @hide
422      */
423     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
424     public static final String ACTION_APP_OPEN_BY_DEFAULT_SETTINGS =
425             "com.android.settings.APP_OPEN_BY_DEFAULT_SETTINGS";
426 
427     /**
428      * Activity Action: Show trusted credentials settings, opening to the user tab,
429      * to allow management of installed credentials.
430      * <p>
431      * In some cases, a matching Activity may not exist, so ensure you
432      * safeguard against this.
433      * <p>
434      * Input: Nothing.
435      * <p>
436      * Output: Nothing.
437      * @hide
438      */
439     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
440     @UnsupportedAppUsage
441     public static final String ACTION_TRUSTED_CREDENTIALS_USER =
442             "com.android.settings.TRUSTED_CREDENTIALS_USER";
443 
444     /**
445      * Activity Action: Show dialog explaining that an installed CA cert may enable
446      * monitoring of encrypted network traffic.
447      * <p>
448      * In some cases, a matching Activity may not exist, so ensure you
449      * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the
450      * number of certificates.
451      * <p>
452      * Input: Nothing.
453      * <p>
454      * Output: Nothing.
455      * @hide
456      */
457     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
458     public static final String ACTION_MONITORING_CERT_INFO =
459             "com.android.settings.MONITORING_CERT_INFO";
460 
461     /**
462      * Activity Action: Show settings to allow configuration of privacy options.
463      * <p>
464      * In some cases, a matching Activity may not exist, so ensure you
465      * safeguard against this.
466      * <p>
467      * Input: Nothing.
468      * <p>
469      * Output: Nothing.
470      */
471     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
472     public static final String ACTION_PRIVACY_SETTINGS =
473             "android.settings.PRIVACY_SETTINGS";
474 
475     /**
476      * Activity Action: Show settings to allow configuration of VPN.
477      * <p>
478      * In some cases, a matching Activity may not exist, so ensure you
479      * safeguard against this.
480      * <p>
481      * Input: Nothing.
482      * <p>
483      * Output: Nothing.
484      */
485     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
486     public static final String ACTION_VPN_SETTINGS =
487             "android.settings.VPN_SETTINGS";
488 
489     /**
490      * Activity Action: Show settings to allow configuration of Wi-Fi.
491      * <p>
492      * In some cases, a matching Activity may not exist, so ensure you
493      * safeguard against this.
494      * <p>
495      * Input: Nothing.
496      * <p>
497      * Output: Nothing.
498      */
499     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
500     public static final String ACTION_WIFI_SETTINGS =
501             "android.settings.WIFI_SETTINGS";
502 
503     /**
504      * Activity Action: Show settings to allow configuration of a static IP
505      * address for Wi-Fi.
506      * <p>
507      * In some cases, a matching Activity may not exist, so ensure you safeguard
508      * against this.
509      * <p>
510      * Input: Nothing.
511      * <p>
512      * Output: Nothing.
513      */
514     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
515     public static final String ACTION_WIFI_IP_SETTINGS =
516             "android.settings.WIFI_IP_SETTINGS";
517 
518     /**
519      * Activity Action: Show setting page to process a Wi-Fi Easy Connect (aka DPP) URI and start
520      * configuration. This intent should be used when you want to use this device to take on the
521      * configurator role for an IoT/other device. When provided with a valid DPP URI
522      * string, Settings will open a Wi-Fi selection screen for the user to indicate which network
523      * they would like to configure the device specified in the DPP URI string and
524      * carry them through the rest of the flow for provisioning the device.
525      * <p>
526      * In some cases, a matching Activity may not exist, so ensure to safeguard against this by
527      * checking {@link WifiManager#isEasyConnectSupported()}.
528      * <p>
529      * Input: The Intent's data URI specifies bootstrapping information for authenticating and
530      * provisioning the peer, and uses a "DPP" scheme. The URI should be attached to the intent
531      * using {@link Intent#setData(Uri)}. The calling app can obtain a DPP URI in any
532      * way, e.g. by scanning a QR code or other out-of-band methods. The calling app may also
533      * attach the {@link #EXTRA_EASY_CONNECT_BAND_LIST} extra to provide information
534      * about the bands supported by the enrollee device.
535      * <p>
536      * Output: After calling {@link android.app.Activity#startActivityForResult}, the callback
537      * {@code onActivityResult} will have resultCode {@link android.app.Activity#RESULT_OK} if
538      * the Wi-Fi Easy Connect configuration succeeded and the user tapped the 'Done' button, or
539      * {@link android.app.Activity#RESULT_CANCELED} if the operation failed and user tapped the
540      * 'Cancel' button. In case the operation has failed, a status code from
541      * {@link android.net.wifi.EasyConnectStatusCallback} {@code EASY_CONNECT_EVENT_FAILURE_*} will
542      * be returned as an Extra {@link #EXTRA_EASY_CONNECT_ERROR_CODE}. Easy Connect R2
543      * Enrollees report additional details about the error they encountered, which will be
544      * provided in the {@link #EXTRA_EASY_CONNECT_ATTEMPTED_SSID},
545      * {@link #EXTRA_EASY_CONNECT_CHANNEL_LIST}, and {@link #EXTRA_EASY_CONNECT_BAND_LIST}.
546      */
547     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
548     public static final String ACTION_PROCESS_WIFI_EASY_CONNECT_URI =
549             "android.settings.PROCESS_WIFI_EASY_CONNECT_URI";
550 
551     /**
552      * Activity Extra: The Easy Connect operation error code
553      * <p>
554      * An extra returned on the result intent received when using the
555      * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation.
556      * This extra contains the integer error code of the operation - one of
557      * {@link android.net.wifi.EasyConnectStatusCallback} {@code EASY_CONNECT_EVENT_FAILURE_*}. If
558      * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK},
559      * then this extra is not attached to the result intent.
560      * <p>
561      * Use the {@link Intent#hasExtra(String)} to determine whether the extra is attached and
562      * {@link Intent#getIntExtra(String, int)} to obtain the error code data.
563      */
564     public static final String EXTRA_EASY_CONNECT_ERROR_CODE =
565             "android.provider.extra.EASY_CONNECT_ERROR_CODE";
566 
567     /**
568      * Activity Extra: The SSID that the Enrollee tried to connect to.
569      * <p>
570      * An extra returned on the result intent received when using the {@link
571      * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This
572      * extra contains the SSID of the Access Point that the remote Enrollee tried to connect to.
573      * This value is populated only by remote R2 devices, and only for the following error codes:
574      * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK}
575      * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION}.
576      * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. If
577      * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, then
578      * this extra is not attached to the result intent.
579      * <p>
580      * Use the {@link Intent#getStringExtra(String)} to obtain the SSID.
581      */
582     public static final String EXTRA_EASY_CONNECT_ATTEMPTED_SSID =
583             "android.provider.extra.EASY_CONNECT_ATTEMPTED_SSID";
584 
585     /**
586      * Activity Extra: The Channel List that the Enrollee used to scan a network.
587      * <p>
588      * An extra returned on the result intent received when using the {@link
589      * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This
590      * extra contains the channel list that the Enrollee scanned for a network. This value is
591      * populated only by remote R2 devices, and only for the following error code: {@link
592      * android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK}.
593      * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. If
594      * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, then
595      * this extra is not attached to the result intent. The list is JSON formatted, as an array
596      * (Wi-Fi global operating classes) of arrays (Wi-Fi channels).
597      * <p>
598      * Use the {@link Intent#getStringExtra(String)} to obtain the list.
599      */
600     public static final String EXTRA_EASY_CONNECT_CHANNEL_LIST =
601             "android.provider.extra.EASY_CONNECT_CHANNEL_LIST";
602 
603     /**
604      * Activity Extra: The Band List that the Enrollee supports.
605      * <p>
606      * This extra contains the bands the Enrollee supports, expressed as the Global Operating
607      * Class, see Table E-4 in IEEE Std 802.11-2016 Global operating classes. It is used both as
608      * input, to configure the Easy Connect operation and as output of the operation.
609      * <p>
610      * As input: an optional extra to be attached to the
611      * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI}. If attached, it indicates the bands which
612      * the remote device (enrollee, device-to-be-configured) supports. The Settings operation
613      * may take this into account when presenting the user with list of networks configurations
614      * to be used. The calling app may obtain this information in any out-of-band method. The
615      * information should be attached as an array of raw integers - using the
616      * {@link Intent#putExtra(String, int[])}.
617      * <p>
618      * As output: an extra returned on the result intent received when using the
619      * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation
620      * . This value is populated only by remote R2 devices, and only for the following error
621      * codes:
622      * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK},
623      * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION},
624      * or
625      * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_REJECTED_CONFIGURATION}.
626      * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}.
627      * If there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}
628      * , then this extra is not attached to the result intent.
629      * <p>
630      * Use the {@link Intent#getIntArrayExtra(String)} to obtain the list.
631      */
632     public static final String EXTRA_EASY_CONNECT_BAND_LIST =
633             "android.provider.extra.EASY_CONNECT_BAND_LIST";
634 
635     /**
636      * Activity Action: Show settings to allow configuration of data and view data usage.
637      * <p>
638      * In some cases, a matching Activity may not exist, so ensure you
639      * safeguard against this.
640      * <p>
641      * Input: Nothing.
642      * <p>
643      * Output: Nothing.
644      */
645     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
646     public static final String ACTION_DATA_USAGE_SETTINGS =
647             "android.settings.DATA_USAGE_SETTINGS";
648 
649     /**
650      * Activity Action: Show settings to allow configuration of Bluetooth.
651      * <p>
652      * In some cases, a matching Activity may not exist, so ensure you
653      * safeguard against this.
654      * <p>
655      * Input: Nothing.
656      * <p>
657      * Output: Nothing.
658      */
659     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
660     public static final String ACTION_BLUETOOTH_SETTINGS =
661             "android.settings.BLUETOOTH_SETTINGS";
662 
663     /**
664      * Activity action: Show Settings app search UI when this action is available for device.
665      * <p>
666      * Input: Nothing.
667      * <p>
668      * Output: Nothing.
669      */
670     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
671     public static final String ACTION_APP_SEARCH_SETTINGS = "android.settings.APP_SEARCH_SETTINGS";
672 
673     /**
674      * Activity Action: Show settings to allow configuration of Assist Gesture.
675      * <p>
676      * In some cases, a matching Activity may not exist, so ensure you
677      * safeguard against this.
678      * <p>
679      * Input: Nothing.
680      * <p>
681      * Output: Nothing.
682      * @hide
683      */
684     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
685     public static final String ACTION_ASSIST_GESTURE_SETTINGS =
686             "android.settings.ASSIST_GESTURE_SETTINGS";
687 
688     /**
689      * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if
690      * necessary.
691      * @deprecated See {@link #ACTION_BIOMETRIC_ENROLL}.
692      * <p>
693      * Input: Nothing.
694      * <p>
695      * Output: Nothing.
696      */
697     @Deprecated
698     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
699     public static final String ACTION_FINGERPRINT_ENROLL =
700             "android.settings.FINGERPRINT_ENROLL";
701 
702     /**
703      * Activity Action: Show settings to enroll biometrics, and setup PIN/Pattern/Pass if
704      * necessary. By default, this prompts the user to enroll biometrics with strength
705      * Weak or above, as defined by the CDD. Only biometrics that meet or exceed Strong, as defined
706      * in the CDD are allowed to participate in Keystore operations.
707      * <p>
708      * Input: extras {@link #EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED} as an integer, with
709      * constants defined in {@link android.hardware.biometrics.BiometricManager.Authenticators},
710      * e.g. {@link android.hardware.biometrics.BiometricManager.Authenticators#BIOMETRIC_STRONG}.
711      * If not specified, the default behavior is
712      * {@link android.hardware.biometrics.BiometricManager.Authenticators#BIOMETRIC_WEAK}.
713      * <p>
714      * Output: Nothing. Note that callers should still check
715      * {@link android.hardware.biometrics.BiometricManager#canAuthenticate(int)}
716      * afterwards to ensure that the user actually completed enrollment.
717      */
718     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
719     public static final String ACTION_BIOMETRIC_ENROLL =
720             "android.settings.BIOMETRIC_ENROLL";
721 
722     /**
723      * Activity Extra: The minimum strength to request enrollment for.
724      * <p>
725      * This can be passed as an extra field to the {@link #ACTION_BIOMETRIC_ENROLL} intent to
726      * indicate that only enrollment for sensors that meet these requirements should be shown. The
727      * value should be a combination of the constants defined in
728      * {@link android.hardware.biometrics.BiometricManager.Authenticators}.
729      */
730     public static final String EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED =
731             "android.provider.extra.BIOMETRIC_AUTHENTICATORS_ALLOWED";
732 
733     /**
734      * Activity Action: Show settings to allow configuration of cast endpoints.
735      * <p>
736      * In some cases, a matching Activity may not exist, so ensure you
737      * safeguard against this.
738      * <p>
739      * Input: Nothing.
740      * <p>
741      * Output: Nothing.
742      */
743     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
744     public static final String ACTION_CAST_SETTINGS =
745             "android.settings.CAST_SETTINGS";
746 
747     /**
748      * Activity Action: Show settings to allow configuration of date and time.
749      * <p>
750      * In some cases, a matching Activity may not exist, so ensure you
751      * safeguard against this.
752      * <p>
753      * Input: Nothing.
754      * <p>
755      * Output: Nothing.
756      */
757     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
758     public static final String ACTION_DATE_SETTINGS =
759             "android.settings.DATE_SETTINGS";
760 
761     /**
762      * Activity Action: Show settings to allow configuration of sound and volume.
763      * <p>
764      * In some cases, a matching Activity may not exist, so ensure you
765      * safeguard against this.
766      * <p>
767      * Input: Nothing.
768      * <p>
769      * Output: Nothing.
770      */
771     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
772     public static final String ACTION_SOUND_SETTINGS =
773             "android.settings.SOUND_SETTINGS";
774 
775     /**
776      * Activity Action: Show settings to allow configuration of display.
777      * <p>
778      * In some cases, a matching Activity may not exist, so ensure you
779      * safeguard against this.
780      * <p>
781      * Input: Nothing.
782      * <p>
783      * Output: Nothing.
784      */
785     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
786     public static final String ACTION_DISPLAY_SETTINGS =
787             "android.settings.DISPLAY_SETTINGS";
788 
789     /**
790      * Activity Action: Show settings to allow configuration of Night display.
791      * <p>
792      * In some cases, a matching Activity may not exist, so ensure you
793      * safeguard against this.
794      * <p>
795      * Input: Nothing.
796      * <p>
797      * Output: Nothing.
798      */
799     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
800     public static final String ACTION_NIGHT_DISPLAY_SETTINGS =
801             "android.settings.NIGHT_DISPLAY_SETTINGS";
802 
803     /**
804      * Activity Action: Show settings to allow configuration of Dark theme.
805      * <p>
806      * In some cases, a matching Activity may not exist, so ensure you
807      * safeguard against this.
808      * <p>
809      * Input: Nothing.
810      * <p>
811      * Output: Nothing.
812      *
813      * @hide
814      */
815     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
816     public static final String ACTION_DARK_THEME_SETTINGS =
817             "android.settings.DARK_THEME_SETTINGS";
818 
819     /**
820      * Activity Action: Show settings to allow configuration of locale.
821      * <p>
822      * In some cases, a matching Activity may not exist, so ensure you
823      * safeguard against this.
824      * <p>
825      * Input: Nothing.
826      * <p>
827      * Output: Nothing.
828      */
829     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
830     public static final String ACTION_LOCALE_SETTINGS =
831             "android.settings.LOCALE_SETTINGS";
832 
833     /**
834      * Activity Action: Show settings to configure input methods, in particular
835      * allowing the user to enable input methods.
836      * <p>
837      * In some cases, a matching Activity may not exist, so ensure you
838      * safeguard against this.
839      * <p>
840      * Input: Nothing.
841      * <p>
842      * Output: Nothing.
843      */
844     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
845     public static final String ACTION_VOICE_INPUT_SETTINGS =
846             "android.settings.VOICE_INPUT_SETTINGS";
847 
848     /**
849      * Activity Action: Show settings to configure input methods, in particular
850      * allowing the user to enable input methods.
851      * <p>
852      * In some cases, a matching Activity may not exist, so ensure you
853      * safeguard against this.
854      * <p>
855      * Input: Nothing.
856      * <p>
857      * Output: Nothing.
858      */
859     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
860     public static final String ACTION_INPUT_METHOD_SETTINGS =
861             "android.settings.INPUT_METHOD_SETTINGS";
862 
863     /**
864      * Activity Action: Show settings to enable/disable input method subtypes.
865      * <p>
866      * In some cases, a matching Activity may not exist, so ensure you
867      * safeguard against this.
868      * <p>
869      * To tell which input method's subtypes are displayed in the settings, add
870      * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
871      * If there is no extra in this Intent, subtypes from all installed input methods
872      * will be displayed in the settings.
873      *
874      * @see android.view.inputmethod.InputMethodInfo#getId
875      * <p>
876      * Input: Nothing.
877      * <p>
878      * Output: Nothing.
879      */
880     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
881     public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
882             "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
883 
884     /**
885      * Activity Action: Show settings to manage the user input dictionary.
886      * <p>
887      * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
888      * it is guaranteed there will always be an appropriate implementation for this Intent action.
889      * In prior releases of the platform this was optional, so ensure you safeguard against it.
890      * <p>
891      * Input: Nothing.
892      * <p>
893      * Output: Nothing.
894      */
895     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
896     public static final String ACTION_USER_DICTIONARY_SETTINGS =
897             "android.settings.USER_DICTIONARY_SETTINGS";
898 
899     /**
900      * Activity Action: Show settings to configure the hardware keyboard.
901      * <p>
902      * In some cases, a matching Activity may not exist, so ensure you
903      * safeguard against this.
904      * <p>
905      * Input: Nothing.
906      * <p>
907      * Output: Nothing.
908      */
909     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
910     public static final String ACTION_HARD_KEYBOARD_SETTINGS =
911             "android.settings.HARD_KEYBOARD_SETTINGS";
912 
913     /**
914      * Activity Action: Adds a word to the user dictionary.
915      * <p>
916      * In some cases, a matching Activity may not exist, so ensure you
917      * safeguard against this.
918      * <p>
919      * Input: An extra with key <code>word</code> that contains the word
920      * that should be added to the dictionary.
921      * <p>
922      * Output: Nothing.
923      *
924      * @hide
925      */
926     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
927     @UnsupportedAppUsage
928     public static final String ACTION_USER_DICTIONARY_INSERT =
929             "com.android.settings.USER_DICTIONARY_INSERT";
930 
931     /**
932      * Activity Action: Show settings to allow configuration of application-related settings.
933      * <p>
934      * In some cases, a matching Activity may not exist, so ensure you
935      * safeguard against this.
936      * <p>
937      * Input: Nothing.
938      * <p>
939      * Output: Nothing.
940      */
941     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
942     public static final String ACTION_APPLICATION_SETTINGS =
943             "android.settings.APPLICATION_SETTINGS";
944 
945     /**
946      * Activity Action: Show settings to allow configuration of application
947      * development-related settings.  As of
948      * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
949      * a required part of the platform.
950      * <p>
951      * Input: Nothing.
952      * <p>
953      * Output: Nothing.
954      */
955     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
956     public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
957             "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
958 
959     /**
960      * Activity Action: Show settings to allow configuration of quick launch shortcuts.
961      * <p>
962      * In some cases, a matching Activity may not exist, so ensure you
963      * safeguard against this.
964      * <p>
965      * Input: Nothing.
966      * <p>
967      * Output: Nothing.
968      */
969     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
970     public static final String ACTION_QUICK_LAUNCH_SETTINGS =
971             "android.settings.QUICK_LAUNCH_SETTINGS";
972 
973     /**
974      * Activity Action: Show settings to manage installed applications.
975      * <p>
976      * In some cases, a matching Activity may not exist, so ensure you
977      * safeguard against this.
978      * <p>
979      * Input: Nothing.
980      * <p>
981      * Output: Nothing.
982      */
983     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
984     public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
985             "android.settings.MANAGE_APPLICATIONS_SETTINGS";
986 
987     /**
988      * Activity Action: Show settings to manage all applications.
989      * <p>
990      * In some cases, a matching Activity may not exist, so ensure you
991      * safeguard against this.
992      * <p>
993      * Input: Nothing.
994      * <p>
995      * Output: Nothing.
996      */
997     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
998     public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
999             "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
1000 
1001     /**
1002      * Activity Action: Show screen for controlling which apps can draw on top of other apps.
1003      * <p>
1004      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1005      * <p>
1006      * Input: Optionally, in versions of Android prior to {@link android.os.Build.VERSION_CODES#R},
1007      * the Intent's data URI can specify the application package name to directly invoke the
1008      * management GUI specific to the package name.
1009      * For example "package:com.my.app".
1010      * <p>
1011      * Output: Nothing.
1012      */
1013     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1014     public static final String ACTION_MANAGE_OVERLAY_PERMISSION =
1015             "android.settings.action.MANAGE_OVERLAY_PERMISSION";
1016 
1017     /**
1018      * Activity Action: Show screen for controlling if the app specified in the data URI of the
1019      * intent can draw on top of other apps.
1020      * <p>
1021      * Unlike {@link #ACTION_MANAGE_OVERLAY_PERMISSION}, which in Android {@link
1022      * android.os.Build.VERSION_CODES#R} can't be used to show a GUI for a specific package,
1023      * permission {@code android.permission.INTERNAL_SYSTEM_WINDOW} is needed to start an activity
1024      * with this intent.
1025      * <p>
1026      * In some cases, a matching Activity may not exist, so ensure you
1027      * safeguard against this.
1028      * <p>
1029      * Input: The Intent's data URI MUST specify the application package name whose ability of
1030      * drawing on top of other apps you want to control.
1031      * For example "package:com.my.app".
1032      * <p>
1033      * Output: Nothing.
1034      *
1035      * @hide
1036      */
1037     @TestApi
1038     @SystemApi
1039     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1040     public static final String ACTION_MANAGE_APP_OVERLAY_PERMISSION =
1041             "android.settings.MANAGE_APP_OVERLAY_PERMISSION";
1042 
1043     /**
1044      * Activity Action: Show screen for controlling which apps are allowed to write/modify
1045      * system settings.
1046      * <p>
1047      * In some cases, a matching Activity may not exist, so ensure you
1048      * safeguard against this.
1049      * <p>
1050      * Input: Optionally, the Intent's data URI can specify the application package name to
1051      * directly invoke the management GUI specific to the package name. For example
1052      * "package:com.my.app".
1053      * <p>
1054      * Output: Nothing.
1055      */
1056     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1057     public static final String ACTION_MANAGE_WRITE_SETTINGS =
1058             "android.settings.action.MANAGE_WRITE_SETTINGS";
1059 
1060     /**
1061      * Activity Action: Show screen for controlling app usage properties for an app.
1062      * Input: Intent's extra {@link android.content.Intent#EXTRA_PACKAGE_NAME} must specify the
1063      * application package name.
1064      * Output: Nothing.
1065      */
1066     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1067     public static final String ACTION_APP_USAGE_SETTINGS =
1068             "android.settings.action.APP_USAGE_SETTINGS";
1069 
1070     /**
1071      * Activity Action: Show screen of details about a particular application.
1072      * <p>
1073      * In some cases, a matching Activity may not exist, so ensure you
1074      * safeguard against this.
1075      * <p>
1076      * Input: The Intent's data URI specifies the application package name
1077      * to be shown, with the "package" scheme.  That is "package:com.my.app".
1078      * <p>
1079      * Output: Nothing.
1080      */
1081     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1082     public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
1083             "android.settings.APPLICATION_DETAILS_SETTINGS";
1084 
1085     /**
1086      * Activity Action: Show list of applications that have been running
1087      * foreground services (to the user "running in the background").
1088      * <p>
1089      * Input: Extras "packages" is a string array of package names.
1090      * <p>
1091      * Output: Nothing.
1092      * @hide
1093      */
1094     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1095     public static final String ACTION_FOREGROUND_SERVICES_SETTINGS =
1096             "android.settings.FOREGROUND_SERVICES_SETTINGS";
1097 
1098     /**
1099      * Activity Action: Show screen for controlling which apps can ignore battery optimizations.
1100      * <p>
1101      * Input: Nothing.
1102      * <p>
1103      * Output: Nothing.
1104      * <p>
1105      * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
1106      * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
1107      * already ignoring optimizations.  You can use
1108      * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you
1109      * on this list.
1110      */
1111     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1112     public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS =
1113             "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS";
1114 
1115     /**
1116      * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is,
1117      * put them on the whitelist of apps shown by
1118      * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}).  For an app to use this, it also
1119      * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}
1120      * permission.
1121      * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities
1122      * provided by the platform for applications to operate correctly in the various power
1123      * saving modes.  This is only for unusual applications that need to deeply control their own
1124      * execution, at the potential expense of the user's battery life.  Note that these applications
1125      * greatly run the risk of showing to the user as high power consumers on their device.</p>
1126      * <p>
1127      * Input: The Intent's data URI must specify the application package name
1128      * to be shown, with the "package" scheme.  That is "package:com.my.app".
1129      * <p>
1130      * Output: Nothing.
1131      * <p>
1132      * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
1133      * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
1134      * already ignoring optimizations.
1135      */
1136     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1137     public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS =
1138             "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
1139 
1140     /**
1141      * Activity Action: Open the advanced power usage details page of an associated app.
1142      * <p>
1143      * Input: Intent's data URI set with an application name, using the
1144      * "package" schema (like "package:com.my.app")
1145      * <p>
1146      * Output: Nothing.
1147      *
1148      * @hide
1149      */
1150     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1151     public static final String ACTION_VIEW_ADVANCED_POWER_USAGE_DETAIL =
1152             "android.settings.VIEW_ADVANCED_POWER_USAGE_DETAIL";
1153 
1154     /**
1155      * Activity Action: Show screen for controlling background data
1156      * restrictions for a particular application.
1157      * <p>
1158      * Input: Intent's data URI set with an application name, using the
1159      * "package" schema (like "package:com.my.app").
1160      *
1161      * <p>
1162      * Output: Nothing.
1163      * <p>
1164      * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus
1165      * ConnectivityManager#getRestrictBackgroundStatus()} to determine the
1166      * status of the background data restrictions for them.
1167      *
1168      * <p class="note">
1169      * In some cases, a matching Activity may not exist, so ensure you
1170      * safeguard against this.
1171      */
1172     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1173     public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS =
1174             "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS";
1175 
1176     /**
1177      * @hide
1178      * Activity Action: Show the "app ops" settings screen.
1179      * <p>
1180      * Input: Nothing.
1181      * <p>
1182      * Output: Nothing.
1183      */
1184     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1185     public static final String ACTION_APP_OPS_SETTINGS =
1186             "android.settings.APP_OPS_SETTINGS";
1187 
1188     /**
1189      * Activity Action: Show settings for system update functionality.
1190      * <p>
1191      * In some cases, a matching Activity may not exist, so ensure you
1192      * safeguard against this.
1193      * <p>
1194      * Input: Nothing.
1195      * <p>
1196      * Output: Nothing.
1197      *
1198      * @hide
1199      */
1200     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1201     public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
1202             "android.settings.SYSTEM_UPDATE_SETTINGS";
1203 
1204     /**
1205      * Activity Action: Show settings for managed profile settings.
1206      * <p>
1207      * In some cases, a matching Activity may not exist, so ensure you
1208      * safeguard against this.
1209      * <p>
1210      * Input: Nothing.
1211      * <p>
1212      * Output: Nothing.
1213      *
1214      * @hide
1215      */
1216     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1217     public static final String ACTION_MANAGED_PROFILE_SETTINGS =
1218             "android.settings.MANAGED_PROFILE_SETTINGS";
1219 
1220     /**
1221      * Activity Action: Show settings to allow configuration of sync settings.
1222      * <p>
1223      * In some cases, a matching Activity may not exist, so ensure you
1224      * safeguard against this.
1225      * <p>
1226      * The account types available to add via the add account button may be restricted by adding an
1227      * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
1228      * authorities. Only account types which can sync with that content provider will be offered to
1229      * the user.
1230      * <p>
1231      * Input: Nothing.
1232      * <p>
1233      * Output: Nothing.
1234      */
1235     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1236     public static final String ACTION_SYNC_SETTINGS =
1237             "android.settings.SYNC_SETTINGS";
1238 
1239     /**
1240      * Activity Action: Show add account screen for creating a new account.
1241      * <p>
1242      * In some cases, a matching Activity may not exist, so ensure you
1243      * safeguard against this.
1244      * <p>
1245      * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
1246      * extra to the Intent with one or more syncable content provider's authorities.  Only account
1247      * types which can sync with that content provider will be offered to the user.
1248      * <p>
1249      * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
1250      * Intent with one or more account types.
1251      * <p>
1252      * Input: Nothing.
1253      * <p>
1254      * Output: Nothing.
1255      */
1256     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1257     public static final String ACTION_ADD_ACCOUNT =
1258             "android.settings.ADD_ACCOUNT_SETTINGS";
1259 
1260     /**
1261      * Activity Action: Show settings for enabling or disabling data saver
1262      * <p></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      *
1270      * @hide
1271      */
1272     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1273     public static final String ACTION_DATA_SAVER_SETTINGS =
1274             "android.settings.DATA_SAVER_SETTINGS";
1275 
1276     /**
1277      * Activity Action: Show settings for selecting the network operator.
1278      * <p>
1279      * In some cases, a matching Activity may not exist, so ensure you
1280      * safeguard against this.
1281      * <p>
1282      * The subscription ID of the subscription for which available network operators should be
1283      * displayed may be optionally specified with {@link #EXTRA_SUB_ID}.
1284      * <p>
1285      * Input: Nothing.
1286      * <p>
1287      * Output: Nothing.
1288      */
1289     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1290     public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
1291             "android.settings.NETWORK_OPERATOR_SETTINGS";
1292 
1293     /**
1294      * Activity Action: Show settings for selection of 2G/3G.
1295      * <p>
1296      * In some cases, a matching Activity may not exist, so ensure you
1297      * safeguard against this.
1298      * <p>
1299      * Input: Nothing.
1300      * <p>
1301      * Output: Nothing.
1302      */
1303     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1304     public static final String ACTION_DATA_ROAMING_SETTINGS =
1305             "android.settings.DATA_ROAMING_SETTINGS";
1306 
1307     /**
1308      * Activity Action: Show settings for internal storage.
1309      * <p>
1310      * In some cases, a matching Activity may not exist, so ensure you
1311      * safeguard against this.
1312      * <p>
1313      * Input: Nothing.
1314      * <p>
1315      * Output: Nothing.
1316      */
1317     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1318     public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
1319             "android.settings.INTERNAL_STORAGE_SETTINGS";
1320     /**
1321      * Activity Action: Show settings for memory card storage.
1322      * <p>
1323      * In some cases, a matching Activity may not exist, so ensure you
1324      * safeguard against this.
1325      * <p>
1326      * Input: Nothing.
1327      * <p>
1328      * Output: Nothing.
1329      */
1330     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1331     public static final String ACTION_MEMORY_CARD_SETTINGS =
1332             "android.settings.MEMORY_CARD_SETTINGS";
1333 
1334     /**
1335      * Activity Action: Show settings for global search.
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_SEARCH_SETTINGS =
1346         "android.search.action.SEARCH_SETTINGS";
1347 
1348     /**
1349      * Activity Action: Show general device information settings (serial
1350      * number, software version, phone number, etc.).
1351      * <p>
1352      * In some cases, a matching Activity may not exist, so ensure you
1353      * safeguard against this.
1354      * <p>
1355      * Input: Nothing.
1356      * <p>
1357      * Output: Nothing
1358      */
1359     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1360     public static final String ACTION_DEVICE_INFO_SETTINGS =
1361         "android.settings.DEVICE_INFO_SETTINGS";
1362 
1363     /**
1364      * Activity Action: Show NFC settings.
1365      * <p>
1366      * This shows UI that allows NFC to be turned on or off.
1367      * <p>
1368      * In some cases, a matching Activity may not exist, so ensure you
1369      * safeguard against this.
1370      * <p>
1371      * Input: Nothing.
1372      * <p>
1373      * Output: Nothing
1374      * @see android.nfc.NfcAdapter#isEnabled()
1375      */
1376     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1377     public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
1378 
1379     /**
1380      * Activity Action: Show NFC Sharing settings.
1381      * <p>
1382      * This shows UI that allows NDEF Push (Android Beam) to be turned on or
1383      * off.
1384      * <p>
1385      * In some cases, a matching Activity may not exist, so ensure you
1386      * safeguard against this.
1387      * <p>
1388      * Input: Nothing.
1389      * <p>
1390      * Output: Nothing
1391      * @see android.nfc.NfcAdapter#isNdefPushEnabled()
1392      */
1393     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1394     public static final String ACTION_NFCSHARING_SETTINGS =
1395         "android.settings.NFCSHARING_SETTINGS";
1396 
1397     /**
1398      * Activity Action: Show NFC Tap & Pay settings
1399      * <p>
1400      * This shows UI that allows the user to configure Tap&Pay
1401      * settings.
1402      * <p>
1403      * In some cases, a matching Activity may not exist, so ensure you
1404      * safeguard against this.
1405      * <p>
1406      * Input: Nothing.
1407      * <p>
1408      * Output: Nothing
1409      */
1410     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1411     public static final String ACTION_NFC_PAYMENT_SETTINGS =
1412         "android.settings.NFC_PAYMENT_SETTINGS";
1413 
1414     /**
1415      * Activity Action: Show Daydream settings.
1416      * <p>
1417      * In some cases, a matching Activity may not exist, so ensure you
1418      * safeguard against this.
1419      * <p>
1420      * Input: Nothing.
1421      * <p>
1422      * Output: Nothing.
1423      * @see android.service.dreams.DreamService
1424      */
1425     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1426     public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
1427 
1428     /**
1429      * Activity Action: Show Notification assistant settings.
1430      * <p>
1431      * In some cases, a matching Activity may not exist, so ensure you
1432      * safeguard against this.
1433      * <p>
1434      * Input: Nothing.
1435      * <p>
1436      * Output: Nothing.
1437      * @see android.service.notification.NotificationAssistantService
1438      */
1439     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1440     public static final String ACTION_NOTIFICATION_ASSISTANT_SETTINGS =
1441             "android.settings.NOTIFICATION_ASSISTANT_SETTINGS";
1442 
1443     /**
1444      * Activity Action: Show Notification listener settings.
1445      * <p>
1446      * In some cases, a matching Activity may not exist, so ensure you
1447      * safeguard against this.
1448      * <p>
1449      * Input: Nothing.
1450      * <p>
1451      * Output: Nothing.
1452      * @see android.service.notification.NotificationListenerService
1453      */
1454     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1455     public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
1456             = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
1457 
1458     /**
1459      * Activity Action: Show notification listener permission settings page for app.
1460      * <p>
1461      * Users can grant and deny access to notifications for a {@link ComponentName} from here.
1462      * See
1463      * {@link android.app.NotificationManager#isNotificationListenerAccessGranted(ComponentName)}
1464      * for more details.
1465      * <p>
1466      * Input: The extra {@link #EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME} containing the name
1467      * of the component to grant or revoke notification listener access to.
1468      * <p>
1469      * Output: Nothing.
1470      */
1471     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1472     public static final String ACTION_NOTIFICATION_LISTENER_DETAIL_SETTINGS =
1473             "android.settings.NOTIFICATION_LISTENER_DETAIL_SETTINGS";
1474 
1475     /**
1476      * Activity Extra: What component name to show the notification listener permission
1477      * page for.
1478      * <p>
1479      * A string extra containing a {@link ComponentName}. This must be passed as an extra field to
1480      * {@link #ACTION_NOTIFICATION_LISTENER_DETAIL_SETTINGS}.
1481      */
1482     public static final String EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME =
1483             "android.provider.extra.NOTIFICATION_LISTENER_COMPONENT_NAME";
1484 
1485     /**
1486      * Activity Action: Show Do Not Disturb access settings.
1487      * <p>
1488      * Users can grant and deny access to Do Not Disturb configuration from here. Managed
1489      * profiles cannot grant Do Not Disturb access.
1490      * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1491      * details.
1492      * <p>
1493      * Input: Nothing.
1494      * <p>
1495      * Output: Nothing.
1496      *
1497      * <p class="note">
1498      * In some cases, a matching Activity may not exist, so ensure you
1499      * safeguard against this.
1500      */
1501     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1502     public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
1503             = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
1504 
1505     /**
1506      * Activity Action: Show do not disturb setting page for app.
1507      * <p>
1508      * Users can grant and deny access to Do Not Disturb configuration for an app from here.
1509      * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1510      * details.
1511      * <p>
1512      * Input: Intent's data URI set with an application name, using the
1513      * "package" schema (like "package:com.my.app").
1514      * <p>
1515      * Output: Nothing.
1516      *
1517      * @hide
1518      */
1519     @SystemApi
1520     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1521     public static final String ACTION_NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS =
1522             "android.settings.NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS";
1523 
1524     /**
1525      * Activity Action: Show the automatic do not disturb rule listing page
1526      * <p>
1527      *     Users can add, enable, disable, and remove automatic do not disturb rules from this
1528      *     screen. See {@link NotificationManager#addAutomaticZenRule(AutomaticZenRule)} for more
1529      *     details.
1530      * </p>
1531      * <p>
1532      *     Input: Nothing
1533      *     Output: Nothing
1534      * </p>
1535      *
1536      */
1537     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1538     public static final String ACTION_CONDITION_PROVIDER_SETTINGS
1539             = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
1540 
1541     /**
1542      * Activity Action: Show settings for video captioning.
1543      * <p>
1544      * In some cases, a matching Activity may not exist, so ensure you safeguard
1545      * against this.
1546      * <p>
1547      * Input: Nothing.
1548      * <p>
1549      * Output: Nothing.
1550      */
1551     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1552     public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
1553 
1554     /**
1555      * Activity Action: Show the top level print settings.
1556      * <p>
1557      * In some cases, a matching Activity may not exist, so ensure you
1558      * safeguard against this.
1559      * <p>
1560      * Input: Nothing.
1561      * <p>
1562      * Output: Nothing.
1563      */
1564     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1565     public static final String ACTION_PRINT_SETTINGS =
1566             "android.settings.ACTION_PRINT_SETTINGS";
1567 
1568     /**
1569      * Activity Action: Show Zen Mode configuration settings.
1570      *
1571      * @hide
1572      */
1573     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1574     public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
1575 
1576     /**
1577      * Activity Action: Show Zen Mode visual effects configuration settings.
1578      *
1579      * @hide
1580      */
1581     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1582     public static final String ZEN_MODE_BLOCKED_EFFECTS_SETTINGS =
1583             "android.settings.ZEN_MODE_BLOCKED_EFFECTS_SETTINGS";
1584 
1585     /**
1586      * Activity Action: Show Zen Mode onboarding activity.
1587      *
1588      * @hide
1589      */
1590     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1591     public static final String ZEN_MODE_ONBOARDING = "android.settings.ZEN_MODE_ONBOARDING";
1592 
1593     /**
1594      * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings.
1595      */
1596     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1597     public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
1598             = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
1599 
1600     /**
1601      * Activity Action: Show Zen Mode automation configuration settings.
1602      *
1603      * @hide
1604      */
1605     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1606     public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
1607             = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
1608 
1609     /**
1610      * Activity Action: Modify do not disturb mode settings.
1611      * <p>
1612      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1613      * <p>
1614      * This intent MUST be started using
1615      * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1616      * startVoiceActivity}.
1617      * <p>
1618      * Note: The Activity implementing this intent MUST verify that
1619      * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
1620      * returns true before modifying the setting.
1621      * <p>
1622      * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
1623      * how long the user wishes to avoid interruptions for. The optional
1624      * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
1625      * enabling or disabling do not disturb mode. If either extra is not included, the
1626      * user maybe asked to provide the value.
1627      * <p>
1628      * Output: Nothing.
1629      */
1630     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1631     public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
1632             "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
1633 
1634     /**
1635      * Activity Action: Show Zen Mode schedule rule configuration settings.
1636      *
1637      * @hide
1638      */
1639     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1640     public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
1641             = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
1642 
1643     /**
1644      * Activity Action: Show Zen Mode event rule configuration settings.
1645      *
1646      * @hide
1647      */
1648     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1649     public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
1650             = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
1651 
1652     /**
1653      * Activity Action: Show Zen Mode external rule configuration settings.
1654      *
1655      * @hide
1656      */
1657     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1658     public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
1659             = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
1660 
1661     /**
1662      * Activity Action: Show the regulatory information screen for the device.
1663      * <p>
1664      * In some cases, a matching Activity may not exist, so ensure you safeguard
1665      * against this.
1666      * <p>
1667      * Input: Nothing.
1668      * <p>
1669      * Output: Nothing.
1670      */
1671     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1672     public static final String
1673             ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
1674 
1675     /**
1676      * Activity Action: Show Device Name Settings.
1677      * <p>
1678      * In some cases, a matching Activity may not exist, so ensure you safeguard
1679      * against this.
1680      *
1681      * @hide
1682      */
1683     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1684     public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
1685 
1686     /**
1687      * Activity Action: Show pairing settings.
1688      * <p>
1689      * In some cases, a matching Activity may not exist, so ensure you safeguard
1690      * against this.
1691      *
1692      * @hide
1693      */
1694     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1695     public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
1696 
1697     /**
1698      * Activity Action: Show battery saver settings.
1699      * <p>
1700      * In some cases, a matching Activity may not exist, so ensure you safeguard
1701      * against this.
1702      */
1703     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1704     public static final String ACTION_BATTERY_SAVER_SETTINGS
1705             = "android.settings.BATTERY_SAVER_SETTINGS";
1706 
1707     /**
1708      * Activity Action: Modify Battery Saver mode setting using a voice command.
1709      * <p>
1710      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1711      * <p>
1712      * This intent MUST be started using
1713      * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1714      * startVoiceActivity}.
1715      * <p>
1716      * Note: The activity implementing this intent MUST verify that
1717      * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
1718      * modifying the setting.
1719      * <p>
1720      * Input: To tell which state batter saver mode should be set to, add the
1721      * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
1722      * If the extra is not included, no changes will be made.
1723      * <p>
1724      * Output: Nothing.
1725      */
1726     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1727     public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
1728             "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
1729 
1730     /**
1731      * Activity Action: Show Home selection settings. If there are multiple activities
1732      * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
1733      * to pick your preferred activity.
1734      */
1735     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1736     public static final String ACTION_HOME_SETTINGS
1737             = "android.settings.HOME_SETTINGS";
1738 
1739     /**
1740      * Activity Action: Show Default apps settings.
1741      * <p>
1742      * In some cases, a matching Activity may not exist, so ensure you
1743      * safeguard against this.
1744      * <p>
1745      * Input: Nothing.
1746      * <p>
1747      * Output: Nothing.
1748      */
1749     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1750     public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS
1751             = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS";
1752 
1753     /**
1754      * Activity Action: Show More default apps settings.
1755      * <p>
1756      * If a Settings activity handles this intent action, a "More defaults" entry will be shown in
1757      * the Default apps settings, and clicking it will launch that activity.
1758      * <p>
1759      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1760      * <p>
1761      * Input: Nothing.
1762      * <p>
1763      * Output: Nothing.
1764      *
1765      * @hide
1766      */
1767     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1768     @SystemApi
1769     public static final String ACTION_MANAGE_MORE_DEFAULT_APPS_SETTINGS =
1770             "android.settings.MANAGE_MORE_DEFAULT_APPS_SETTINGS";
1771 
1772     /**
1773      * Activity Action: Show notification settings.
1774      *
1775      * @hide
1776      */
1777     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1778     public static final String ACTION_NOTIFICATION_SETTINGS
1779             = "android.settings.NOTIFICATION_SETTINGS";
1780 
1781     /**
1782      * Activity Action: Show conversation settings.
1783      *
1784      * @hide
1785      */
1786     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1787     public static final String ACTION_CONVERSATION_SETTINGS
1788             = "android.settings.CONVERSATION_SETTINGS";
1789 
1790     /**
1791      * Activity Action: Show notification history screen.
1792      *
1793      * @hide
1794      */
1795     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1796     public static final String ACTION_NOTIFICATION_HISTORY
1797             = "android.settings.NOTIFICATION_HISTORY";
1798 
1799     /**
1800      * Activity Action: Show app listing settings, filtered by those that send notifications.
1801      *
1802      * @hide
1803      */
1804     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1805     public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS =
1806             "android.settings.ALL_APPS_NOTIFICATION_SETTINGS";
1807 
1808     /**
1809      * Activity Action: Show notification settings for a single app.
1810      * <p>
1811      *     Input: {@link #EXTRA_APP_PACKAGE}, the package to display.
1812      * <p>
1813      * Output: Nothing.
1814      */
1815     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1816     public static final String ACTION_APP_NOTIFICATION_SETTINGS
1817             = "android.settings.APP_NOTIFICATION_SETTINGS";
1818 
1819     /**
1820      * Activity Action: Show notification settings for a single {@link NotificationChannel}.
1821      * <p>
1822      *     Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display.
1823      *     Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display.
1824      * <p>
1825      * Output: Nothing.
1826      */
1827     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1828     public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS
1829             = "android.settings.CHANNEL_NOTIFICATION_SETTINGS";
1830 
1831     /**
1832      * Activity Action: Show notification bubble settings for a single app.
1833      * See {@link NotificationManager#areBubblesAllowed()}.
1834      * <p>
1835      *     Input: {@link #EXTRA_APP_PACKAGE}, the package to display.
1836      * <p>
1837      * Output: Nothing.
1838      */
1839     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1840     public static final String ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS
1841             = "android.settings.APP_NOTIFICATION_BUBBLE_SETTINGS";
1842 
1843     /**
1844      * Activity Extra: The package owner of the notification channel settings to display.
1845      * <p>
1846      * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
1847      */
1848     public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE";
1849 
1850     /**
1851      * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings
1852      * to display.
1853      * <p>
1854      * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
1855      */
1856     public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID";
1857 
1858     /**
1859      * Activity Extra: The {@link NotificationChannel#getConversationId()} of the notification
1860      * conversation settings to display.
1861      * <p>
1862      * This is an optional extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. If
1863      * included the system will first look up notification settings by channel and conversation id,
1864      * and will fall back to channel id if a specialized channel for this conversation doesn't
1865      * exist, similar to {@link NotificationManager#getNotificationChannel(String, String)}.
1866      */
1867     public static final String EXTRA_CONVERSATION_ID = "android.provider.extra.CONVERSATION_ID";
1868 
1869     /**
1870      * Activity Action: Show notification redaction settings.
1871      *
1872      * @hide
1873      */
1874     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1875     public static final String ACTION_APP_NOTIFICATION_REDACTION
1876             = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
1877 
1878     /** @hide */
1879     @UnsupportedAppUsage
1880     public static final String EXTRA_APP_UID = "app_uid";
1881 
1882     /**
1883      * Activity Action: Show power menu settings.
1884      *
1885      * @hide
1886      */
1887     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1888     public static final String ACTION_POWER_MENU_SETTINGS =
1889             "android.settings.ACTION_POWER_MENU_SETTINGS";
1890 
1891     /**
1892      * Activity Action: Show controls settings.
1893      *
1894      * @hide
1895      */
1896     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1897     public static final String ACTION_DEVICE_CONTROLS_SETTINGS =
1898             "android.settings.ACTION_DEVICE_CONTROLS_SETTINGS";
1899 
1900     /**
1901      * Activity Action: Show media control settings
1902      *
1903      * @hide
1904      */
1905     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1906     public static final String ACTION_MEDIA_CONTROLS_SETTINGS =
1907             "android.settings.ACTION_MEDIA_CONTROLS_SETTINGS";
1908 
1909     /**
1910      * Activity Action: Show a dialog with disabled by policy message.
1911      * <p> If an user action is disabled by policy, this dialog can be triggered to let
1912      * the user know about this.
1913      * <p>
1914      * Input: {@link Intent#EXTRA_USER}: The user of the admin.
1915      * <p>
1916      * Output: Nothing.
1917      *
1918      * @hide
1919      */
1920     // Intent#EXTRA_USER_ID can also be used
1921     @SystemApi
1922     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1923     public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS
1924             = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
1925 
1926     /**
1927      * Activity Action: Show a dialog for remote bugreport flow.
1928      * <p>
1929      * Input: Nothing.
1930      * <p>
1931      * Output: Nothing.
1932      *
1933      * @hide
1934      */
1935     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1936     public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG
1937             = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG";
1938 
1939     /**
1940      * Activity Action: Show VR listener settings.
1941      * <p>
1942      * Input: Nothing.
1943      * <p>
1944      * Output: Nothing.
1945      *
1946      * @see android.service.vr.VrListenerService
1947      */
1948     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1949     public static final String ACTION_VR_LISTENER_SETTINGS
1950             = "android.settings.VR_LISTENER_SETTINGS";
1951 
1952     /**
1953      * Activity Action: Show Picture-in-picture settings.
1954      * <p>
1955      * Input: Nothing.
1956      * <p>
1957      * Output: Nothing.
1958      *
1959      * @hide
1960      */
1961     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1962     public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS
1963             = "android.settings.PICTURE_IN_PICTURE_SETTINGS";
1964 
1965     /**
1966      * Activity Action: Show Storage Manager settings.
1967      * <p>
1968      * Input: Nothing.
1969      * <p>
1970      * Output: Nothing.
1971      *
1972      * @hide
1973      */
1974     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1975     public static final String ACTION_STORAGE_MANAGER_SETTINGS
1976             = "android.settings.STORAGE_MANAGER_SETTINGS";
1977 
1978     /**
1979      * Activity Action: Allows user to select current webview implementation.
1980      * <p>
1981      * Input: Nothing.
1982      * <p>
1983      * Output: Nothing.
1984      * <p class="note">
1985      * In some cases, a matching Activity may not exist, so ensure you
1986      * safeguard against this.
1987 
1988      */
1989     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1990     public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS";
1991 
1992     /**
1993      * Activity Action: Show enterprise privacy section.
1994      * <p>
1995      * Input: Nothing.
1996      * <p>
1997      * Output: Nothing.
1998      * @hide
1999      */
2000     @SystemApi
2001     @TestApi
2002     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2003     public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS
2004             = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
2005 
2006     /**
2007      * Activity Action: Show Work Policy info.
2008      * DPC apps can implement an activity that handles this intent in order to show device policies
2009      * associated with the work profile or managed device.
2010      * <p>
2011      * Input: Nothing.
2012      * <p>
2013      * Output: Nothing.
2014      *
2015      */
2016     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2017     public static final String ACTION_SHOW_WORK_POLICY_INFO =
2018             "android.settings.SHOW_WORK_POLICY_INFO";
2019 
2020     /**
2021      * Activity Action: Show screen that let user select its Autofill Service.
2022      * <p>
2023      * Input: Intent's data URI set with an application name, using the
2024      * "package" schema (like "package:com.my.app").
2025      *
2026      * <p>
2027      * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging
2028      * to the caller package.
2029      *
2030      * <p>
2031      * <b>NOTE: </b> Applications should call
2032      * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and
2033      * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action
2034      * to start an activity if they return {@code false} and {@code true} respectively.
2035      */
2036     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2037     public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE =
2038             "android.settings.REQUEST_SET_AUTOFILL_SERVICE";
2039 
2040     /**
2041      * Activity Action: Show screen for controlling the Quick Access Wallet.
2042      * <p>
2043      * In some cases, a matching Activity may not exist, so ensure you
2044      * safeguard against this.
2045      * <p>
2046      * Input: Nothing.
2047      * <p>
2048      * Output: Nothing.
2049      */
2050     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2051     public static final String ACTION_QUICK_ACCESS_WALLET_SETTINGS =
2052             "android.settings.QUICK_ACCESS_WALLET_SETTINGS";
2053 
2054     /**
2055      * Activity Action: Show screen for controlling which apps have access on volume directories.
2056      * <p>
2057      * Input: Nothing.
2058      * <p>
2059      * Output: Nothing.
2060      * <p>
2061      * Applications typically use this action to ask the user to revert the "Do not ask again"
2062      * status of directory access requests made by
2063      * {@link android.os.storage.StorageVolume#createAccessIntent(String)}.
2064      * @deprecated use {@link #ACTION_APPLICATION_DETAILS_SETTINGS} to manage storage permissions
2065      *             for a specific application
2066      */
2067     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2068     @Deprecated
2069     public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS =
2070             "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS";
2071 
2072 
2073     /**
2074      * Activity Action: Show screen that let user select enable (or disable) Content Capture.
2075      * <p>
2076      * Input: Nothing.
2077      *
2078      * <p>
2079      * Output: Nothing
2080      *
2081      * @hide
2082      */
2083     @SystemApi
2084     @TestApi
2085     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2086     public static final String ACTION_REQUEST_ENABLE_CONTENT_CAPTURE =
2087             "android.settings.REQUEST_ENABLE_CONTENT_CAPTURE";
2088 
2089     /**
2090      * Activity Action: Show screen that let user manage how Android handles URL resolution.
2091      * <p>
2092      * Input: Nothing.
2093      * <p>
2094      * Output: Nothing
2095      *
2096      * @hide
2097      */
2098     @SystemApi
2099     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2100     public static final String ACTION_MANAGE_DOMAIN_URLS = "android.settings.MANAGE_DOMAIN_URLS";
2101 
2102     /**
2103      * Activity Action: Show screen that let user select enable (or disable) tethering.
2104      * <p>
2105      * Input: Nothing.
2106      * <p>
2107      * Output: Nothing
2108      *
2109      * @hide
2110      */
2111     @SystemApi
2112     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2113     public static final String ACTION_TETHER_SETTINGS = "android.settings.TETHER_SETTINGS";
2114 
2115     /**
2116      * Broadcast to trigger notification of asking user to enable MMS.
2117      * Need to specify {@link #EXTRA_ENABLE_MMS_DATA_REQUEST_REASON} and {@link #EXTRA_SUB_ID}.
2118      *
2119      * @hide
2120      */
2121     @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
2122     public static final String ACTION_ENABLE_MMS_DATA_REQUEST =
2123             "android.settings.ENABLE_MMS_DATA_REQUEST";
2124 
2125     /**
2126      * Integer value that specifies the reason triggering enable MMS data notification.
2127      * This must be passed as an extra field to the {@link #ACTION_ENABLE_MMS_DATA_REQUEST}.
2128      * Extra with value of EnableMmsDataReason interface.
2129      * @hide
2130      */
2131     public static final String EXTRA_ENABLE_MMS_DATA_REQUEST_REASON =
2132             "android.settings.extra.ENABLE_MMS_DATA_REQUEST_REASON";
2133 
2134     /** @hide */
2135     @Retention(RetentionPolicy.SOURCE)
2136     @IntDef(prefix = { "ENABLE_MMS_DATA_REQUEST_REASON_" }, value = {
2137             ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS,
2138             ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS,
2139     })
2140     public @interface EnableMmsDataReason{}
2141 
2142     /**
2143      * Requesting to enable MMS data because there's an incoming MMS.
2144      * @hide
2145      */
2146     public static final int ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS = 0;
2147 
2148     /**
2149      * Requesting to enable MMS data because user is sending MMS.
2150      * @hide
2151      */
2152     public static final int ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS = 1;
2153 
2154     /**
2155      * Activity Action: Show screen of a cellular subscription and highlight the
2156      * "enable MMS" toggle.
2157      * <p>
2158      * Input: {@link #EXTRA_SUB_ID}: Sub ID of the subscription.
2159      * <p>
2160      * Output: Nothing
2161      *
2162      * @hide
2163      */
2164     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2165     public static final String ACTION_MMS_MESSAGE_SETTING = "android.settings.MMS_MESSAGE_SETTING";
2166 
2167     // End of Intent actions for Settings
2168 
2169     /**
2170      * @hide - Private call() method on SettingsProvider to read from 'system' table.
2171      */
2172     public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
2173 
2174     /**
2175      * @hide - Private call() method on SettingsProvider to read from 'secure' table.
2176      */
2177     public static final String CALL_METHOD_GET_SECURE = "GET_secure";
2178 
2179     /**
2180      * @hide - Private call() method on SettingsProvider to read from 'global' table.
2181      */
2182     public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
2183 
2184     /**
2185      * @hide - Private call() method on SettingsProvider to read from 'config' table.
2186      */
2187     public static final String CALL_METHOD_GET_CONFIG = "GET_config";
2188 
2189     /**
2190      * @hide - Specifies that the caller of the fast-path call()-based flow tracks
2191      * the settings generation in order to cache values locally. If this key is
2192      * mapped to a <code>null</code> string extra in the request bundle, the response
2193      * bundle will contain the same key mapped to a parcelable extra which would be
2194      * an {@link android.util.MemoryIntArray}. The response will also contain an
2195      * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the
2196      * index in the array clients should use to lookup the generation. For efficiency
2197      * the caller should request the generation tracking memory array only if it
2198      * doesn't already have it.
2199      *
2200      * @see #CALL_METHOD_GENERATION_INDEX_KEY
2201      */
2202     public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation";
2203 
2204     /**
2205      * @hide Key with the location in the {@link android.util.MemoryIntArray} where
2206      * to look up the generation id of the backing table. The value is an integer.
2207      *
2208      * @see #CALL_METHOD_TRACK_GENERATION_KEY
2209      */
2210     public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index";
2211 
2212     /**
2213      * @hide Key with the settings table generation. The value is an integer.
2214      *
2215      * @see #CALL_METHOD_TRACK_GENERATION_KEY
2216      */
2217     public static final String CALL_METHOD_GENERATION_KEY = "_generation";
2218 
2219     /**
2220      * @hide - User handle argument extra to the fast-path call()-based requests
2221      */
2222     public static final String CALL_METHOD_USER_KEY = "_user";
2223 
2224     /**
2225      * @hide - Boolean argument extra to the fast-path call()-based requests
2226      */
2227     public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default";
2228 
2229     /**
2230      * @hide - User handle argument extra to the fast-path call()-based requests
2231      */
2232     public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode";
2233 
2234     /**
2235      * @hide - String argument extra to the fast-path call()-based requests
2236      */
2237     public static final String CALL_METHOD_TAG_KEY = "_tag";
2238 
2239     /**
2240      * @hide - String argument extra to the fast-path call()-based requests
2241      */
2242     public static final String CALL_METHOD_PREFIX_KEY = "_prefix";
2243 
2244     /**
2245      * @hide - RemoteCallback monitor callback argument extra to the fast-path call()-based requests
2246      */
2247     public static final String CALL_METHOD_MONITOR_CALLBACK_KEY = "_monitor_callback_key";
2248 
2249     /**
2250      * @hide - String argument extra to the fast-path call()-based requests
2251      */
2252     public static final String CALL_METHOD_FLAGS_KEY = "_flags";
2253 
2254     /**
2255      * @hide - String argument extra to the fast-path call()-based requests
2256      */
2257     public static final String CALL_METHOD_OVERRIDEABLE_BY_RESTORE_KEY = "_overrideable_by_restore";
2258 
2259     /** @hide - Private call() method to write to 'system' table */
2260     public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
2261 
2262     /** @hide - Private call() method to write to 'secure' table */
2263     public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
2264 
2265     /** @hide - Private call() method to write to 'global' table */
2266     public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
2267 
2268     /** @hide - Private call() method to write to 'configuration' table */
2269     public static final String CALL_METHOD_PUT_CONFIG = "PUT_config";
2270 
2271     /** @hide - Private call() method to write to and delete from the 'configuration' table */
2272     public static final String CALL_METHOD_SET_ALL_CONFIG = "SET_ALL_config";
2273 
2274     /** @hide - Private call() method to delete from the 'system' table */
2275     public static final String CALL_METHOD_DELETE_SYSTEM = "DELETE_system";
2276 
2277     /** @hide - Private call() method to delete from the 'secure' table */
2278     public static final String CALL_METHOD_DELETE_SECURE = "DELETE_secure";
2279 
2280     /** @hide - Private call() method to delete from the 'global' table */
2281     public static final String CALL_METHOD_DELETE_GLOBAL = "DELETE_global";
2282 
2283     /** @hide - Private call() method to reset to defaults the 'configuration' table */
2284     public static final String CALL_METHOD_DELETE_CONFIG = "DELETE_config";
2285 
2286     /** @hide - Private call() method to reset to defaults the 'secure' table */
2287     public static final String CALL_METHOD_RESET_SECURE = "RESET_secure";
2288 
2289     /** @hide - Private call() method to reset to defaults the 'global' table */
2290     public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global";
2291 
2292     /** @hide - Private call() method to reset to defaults the 'configuration' table */
2293     public static final String CALL_METHOD_RESET_CONFIG = "RESET_config";
2294 
2295     /** @hide - Private call() method to query the 'system' table */
2296     public static final String CALL_METHOD_LIST_SYSTEM = "LIST_system";
2297 
2298     /** @hide - Private call() method to query the 'secure' table */
2299     public static final String CALL_METHOD_LIST_SECURE = "LIST_secure";
2300 
2301     /** @hide - Private call() method to query the 'global' table */
2302     public static final String CALL_METHOD_LIST_GLOBAL = "LIST_global";
2303 
2304     /** @hide - Private call() method to reset to defaults the 'configuration' table */
2305     public static final String CALL_METHOD_LIST_CONFIG = "LIST_config";
2306 
2307     /** @hide - Private call() method to register monitor callback for 'configuration' table */
2308     public static final String CALL_METHOD_REGISTER_MONITOR_CALLBACK_CONFIG =
2309             "REGISTER_MONITOR_CALLBACK_config";
2310 
2311     /** @hide - String argument extra to the config monitor callback */
2312     public static final String EXTRA_MONITOR_CALLBACK_TYPE = "monitor_callback_type";
2313 
2314     /** @hide - String argument extra to the config monitor callback */
2315     public static final String EXTRA_ACCESS_CALLBACK = "access_callback";
2316 
2317     /** @hide - String argument extra to the config monitor callback */
2318     public static final String EXTRA_NAMESPACE_UPDATED_CALLBACK =
2319             "namespace_updated_callback";
2320 
2321     /** @hide - String argument extra to the config monitor callback */
2322     public static final String EXTRA_NAMESPACE = "namespace";
2323 
2324     /** @hide - String argument extra to the config monitor callback */
2325     public static final String EXTRA_CALLING_PACKAGE = "calling_package";
2326 
2327     /**
2328      * Activity Extra: Limit available options in launched activity based on the given authority.
2329      * <p>
2330      * This can be passed as an extra field in an Activity Intent with one or more syncable content
2331      * provider's authorities as a String[]. This field is used by some intents to alter the
2332      * behavior of the called activity.
2333      * <p>
2334      * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
2335      * on the authority given.
2336      */
2337     public static final String EXTRA_AUTHORITIES = "authorities";
2338 
2339     /**
2340      * Activity Extra: Limit available options in launched activity based on the given account
2341      * types.
2342      * <p>
2343      * This can be passed as an extra field in an Activity Intent with one or more account types
2344      * as a String[]. This field is used by some intents to alter the behavior of the called
2345      * activity.
2346      * <p>
2347      * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
2348      * list.
2349      */
2350     public static final String EXTRA_ACCOUNT_TYPES = "account_types";
2351 
2352     public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
2353 
2354     /**
2355      * Activity Extra: The device identifier to act upon.
2356      * <p>
2357      * This can be passed as an extra field in an Activity Intent with a single
2358      * InputDeviceIdentifier. This field is used by some activities to jump straight into the
2359      * settings for the given device.
2360      * <p>
2361      * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
2362      * dialog for the given device.
2363      * @hide
2364      */
2365     public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
2366 
2367     /**
2368      * Activity Extra: Enable or disable Airplane Mode.
2369      * <p>
2370      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
2371      * intent as a boolean to indicate if it should be enabled.
2372      */
2373     public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
2374 
2375     /**
2376      * Activity Extra: Enable or disable Battery saver mode.
2377      * <p>
2378      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
2379      * intent as a boolean to indicate if it should be enabled.
2380      */
2381     public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
2382             "android.settings.extra.battery_saver_mode_enabled";
2383 
2384     /**
2385      * Activity Extra: Enable or disable Do Not Disturb mode.
2386      * <p>
2387      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
2388      * intent as a boolean to indicate if it should be enabled.
2389      */
2390     public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
2391             "android.settings.extra.do_not_disturb_mode_enabled";
2392 
2393     /**
2394      * Activity Extra: How many minutes to enable do not disturb mode for.
2395      * <p>
2396      * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
2397      * intent to indicate how long do not disturb mode should be enabled for.
2398      */
2399     public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
2400             "android.settings.extra.do_not_disturb_mode_minutes";
2401 
2402     /**
2403      * Reset mode: reset to defaults only settings changed by the
2404      * calling package. If there is a default set the setting
2405      * will be set to it, otherwise the setting will be deleted.
2406      * This is the only type of reset available to non-system clients.
2407      * @hide
2408      */
2409     @UnsupportedAppUsage
2410     @TestApi
2411     public static final int RESET_MODE_PACKAGE_DEFAULTS = 1;
2412 
2413     /**
2414      * Reset mode: reset all settings set by untrusted packages, which is
2415      * packages that aren't a part of the system, to the current defaults.
2416      * If there is a default set the setting will be set to it, otherwise
2417      * the setting will be deleted. This mode is only available to the system.
2418      * @hide
2419      */
2420     public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2;
2421 
2422     /**
2423      * Reset mode: delete all settings set by untrusted packages, which is
2424      * packages that aren't a part of the system. If a setting is set by an
2425      * untrusted package it will be deleted if its default is not provided
2426      * by the system, otherwise the setting will be set to its default.
2427      * This mode is only available to the system.
2428      * @hide
2429      */
2430     public static final int RESET_MODE_UNTRUSTED_CHANGES = 3;
2431 
2432     /**
2433      * Reset mode: reset all settings to defaults specified by trusted
2434      * packages, which is packages that are a part of the system, and
2435      * delete all settings set by untrusted packages. If a setting has
2436      * a default set by a system package it will be set to the default,
2437      * otherwise the setting will be deleted. This mode is only available
2438      * to the system.
2439      * @hide
2440      */
2441     public static final int RESET_MODE_TRUSTED_DEFAULTS = 4;
2442 
2443     /** @hide */
2444     @Retention(RetentionPolicy.SOURCE)
2445     @IntDef(prefix = { "RESET_MODE_" }, value = {
2446             RESET_MODE_PACKAGE_DEFAULTS,
2447             RESET_MODE_UNTRUSTED_DEFAULTS,
2448             RESET_MODE_UNTRUSTED_CHANGES,
2449             RESET_MODE_TRUSTED_DEFAULTS
2450     })
2451     public @interface ResetMode{}
2452 
2453     /**
2454      * Activity Extra: Number of certificates
2455      * <p>
2456      * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO}
2457      * intent to indicate the number of certificates
2458      * @hide
2459      */
2460     public static final String EXTRA_NUMBER_OF_CERTIFICATES =
2461             "android.settings.extra.number_of_certificates";
2462 
2463     private static final String JID_RESOURCE_PREFIX = "android";
2464 
2465     public static final String AUTHORITY = "settings";
2466 
2467     private static final String TAG = "Settings";
2468     private static final boolean LOCAL_LOGV = false;
2469 
2470     // Used in system server calling uid workaround in call()
2471     private static boolean sInSystemServer = false;
2472     private static final Object sInSystemServerLock = new Object();
2473 
2474     /** @hide */
setInSystemServer()2475     public static void setInSystemServer() {
2476         synchronized (sInSystemServerLock) {
2477             sInSystemServer = true;
2478         }
2479     }
2480 
2481     /** @hide */
isInSystemServer()2482     public static boolean isInSystemServer() {
2483         synchronized (sInSystemServerLock) {
2484             return sInSystemServer;
2485         }
2486     }
2487 
2488     public static class SettingNotFoundException extends AndroidException {
SettingNotFoundException(String msg)2489         public SettingNotFoundException(String msg) {
2490             super(msg);
2491         }
2492     }
2493 
2494     /**
2495      * Common base for tables of name/value settings.
2496      */
2497     public static class NameValueTable implements BaseColumns {
2498         public static final String NAME = "name";
2499         public static final String VALUE = "value";
2500         // A flag indicating whether the current value of a setting should be preserved during
2501         // restore.
2502         /** @hide */
2503         public static final String IS_PRESERVED_IN_RESTORE = "is_preserved_in_restore";
2504 
putString(ContentResolver resolver, Uri uri, String name, String value)2505         protected static boolean putString(ContentResolver resolver, Uri uri,
2506                 String name, String value) {
2507             // The database will take care of replacing duplicates.
2508             try {
2509                 ContentValues values = new ContentValues();
2510                 values.put(NAME, name);
2511                 values.put(VALUE, value);
2512                 resolver.insert(uri, values);
2513                 return true;
2514             } catch (SQLException e) {
2515                 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
2516                 return false;
2517             }
2518         }
2519 
getUriFor(Uri uri, String name)2520         public static Uri getUriFor(Uri uri, String name) {
2521             return Uri.withAppendedPath(uri, name);
2522         }
2523     }
2524 
2525     private static final class GenerationTracker {
2526         private final MemoryIntArray mArray;
2527         private final Runnable mErrorHandler;
2528         private final int mIndex;
2529         private int mCurrentGeneration;
2530 
GenerationTracker(@onNull MemoryIntArray array, int index, int generation, Runnable errorHandler)2531         public GenerationTracker(@NonNull MemoryIntArray array, int index,
2532                 int generation, Runnable errorHandler) {
2533             mArray = array;
2534             mIndex = index;
2535             mErrorHandler = errorHandler;
2536             mCurrentGeneration = generation;
2537         }
2538 
isGenerationChanged()2539         public boolean isGenerationChanged() {
2540             final int currentGeneration = readCurrentGeneration();
2541             if (currentGeneration >= 0) {
2542                 if (currentGeneration == mCurrentGeneration) {
2543                     return false;
2544                 }
2545                 mCurrentGeneration = currentGeneration;
2546             }
2547             return true;
2548         }
2549 
getCurrentGeneration()2550         public int getCurrentGeneration() {
2551             return mCurrentGeneration;
2552         }
2553 
readCurrentGeneration()2554         private int readCurrentGeneration() {
2555             try {
2556                 return mArray.get(mIndex);
2557             } catch (IOException e) {
2558                 Log.e(TAG, "Error getting current generation", e);
2559                 if (mErrorHandler != null) {
2560                     mErrorHandler.run();
2561                 }
2562             }
2563             return -1;
2564         }
2565 
destroy()2566         public void destroy() {
2567             try {
2568                 mArray.close();
2569             } catch (IOException e) {
2570                 Log.e(TAG, "Error closing backing array", e);
2571                 if (mErrorHandler != null) {
2572                     mErrorHandler.run();
2573                 }
2574             }
2575         }
2576     }
2577 
2578     private static final class ContentProviderHolder {
2579         private final Object mLock = new Object();
2580 
2581         @GuardedBy("mLock")
2582         private final Uri mUri;
2583         @GuardedBy("mLock")
2584         @UnsupportedAppUsage
2585         private IContentProvider mContentProvider;
2586 
ContentProviderHolder(Uri uri)2587         public ContentProviderHolder(Uri uri) {
2588             mUri = uri;
2589         }
2590 
getProvider(ContentResolver contentResolver)2591         public IContentProvider getProvider(ContentResolver contentResolver) {
2592             synchronized (mLock) {
2593                 if (mContentProvider == null) {
2594                     mContentProvider = contentResolver
2595                             .acquireProvider(mUri.getAuthority());
2596                 }
2597                 return mContentProvider;
2598             }
2599         }
2600 
clearProviderForTest()2601         public void clearProviderForTest() {
2602             synchronized (mLock) {
2603                 mContentProvider = null;
2604             }
2605         }
2606     }
2607 
2608     // Thread-safe.
2609     private static class NameValueCache {
2610         private static final boolean DEBUG = false;
2611 
2612         private static final String[] SELECT_VALUE_PROJECTION = new String[] {
2613                 Settings.NameValueTable.VALUE
2614         };
2615 
2616         private static final String NAME_EQ_PLACEHOLDER = "name=?";
2617 
2618         // Must synchronize on 'this' to access mValues and mValuesVersion.
2619         private final ArrayMap<String, String> mValues = new ArrayMap<>();
2620 
2621         private final Uri mUri;
2622         @UnsupportedAppUsage
2623         private final ContentProviderHolder mProviderHolder;
2624 
2625         // The method we'll call (or null, to not use) on the provider
2626         // for the fast path of retrieving settings.
2627         private final String mCallGetCommand;
2628         private final String mCallSetCommand;
2629         private final String mCallListCommand;
2630         private final String mCallSetAllCommand;
2631 
2632         @GuardedBy("this")
2633         private GenerationTracker mGenerationTracker;
2634 
NameValueCache(Uri uri, String getCommand, String setCommand, ContentProviderHolder providerHolder)2635         public NameValueCache(Uri uri, String getCommand, String setCommand,
2636                 ContentProviderHolder providerHolder) {
2637             this(uri, getCommand, setCommand, null, null, providerHolder);
2638         }
2639 
NameValueCache(Uri uri, String getCommand, String setCommand, String listCommand, String setAllCommand, ContentProviderHolder providerHolder)2640         NameValueCache(Uri uri, String getCommand, String setCommand, String listCommand,
2641                 String setAllCommand, ContentProviderHolder providerHolder) {
2642             mUri = uri;
2643             mCallGetCommand = getCommand;
2644             mCallSetCommand = setCommand;
2645             mCallListCommand = listCommand;
2646             mCallSetAllCommand = setAllCommand;
2647             mProviderHolder = providerHolder;
2648         }
2649 
putStringForUser(ContentResolver cr, String name, String value, String tag, boolean makeDefault, final int userHandle, boolean overrideableByRestore)2650         public boolean putStringForUser(ContentResolver cr, String name, String value,
2651                 String tag, boolean makeDefault, final int userHandle,
2652                 boolean overrideableByRestore) {
2653             try {
2654                 Bundle arg = new Bundle();
2655                 arg.putString(Settings.NameValueTable.VALUE, value);
2656                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
2657                 if (tag != null) {
2658                     arg.putString(CALL_METHOD_TAG_KEY, tag);
2659                 }
2660                 if (makeDefault) {
2661                     arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true);
2662                 }
2663                 if (overrideableByRestore) {
2664                     arg.putBoolean(CALL_METHOD_OVERRIDEABLE_BY_RESTORE_KEY, true);
2665                 }
2666                 IContentProvider cp = mProviderHolder.getProvider(cr);
2667                 cp.call(cr.getPackageName(), cr.getAttributionTag(),
2668                         mProviderHolder.mUri.getAuthority(), mCallSetCommand, name, arg);
2669             } catch (RemoteException e) {
2670                 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
2671                 return false;
2672             }
2673             return true;
2674         }
2675 
setStringsForPrefix(ContentResolver cr, String prefix, HashMap<String, String> keyValues)2676         public boolean setStringsForPrefix(ContentResolver cr, String prefix,
2677                 HashMap<String, String> keyValues) {
2678             if (mCallSetAllCommand == null) {
2679                 // This NameValueCache does not support atomically setting multiple flags
2680                 return false;
2681             }
2682             try {
2683                 Bundle args = new Bundle();
2684                 args.putString(CALL_METHOD_PREFIX_KEY, prefix);
2685                 args.putSerializable(CALL_METHOD_FLAGS_KEY, keyValues);
2686                 IContentProvider cp = mProviderHolder.getProvider(cr);
2687                 Bundle bundle = cp.call(cr.getPackageName(), cr.getAttributionTag(),
2688                         mProviderHolder.mUri.getAuthority(),
2689                         mCallSetAllCommand, null, args);
2690                 return bundle.getBoolean(KEY_CONFIG_SET_RETURN);
2691             } catch (RemoteException e) {
2692                 // Not supported by the remote side
2693                 return false;
2694             }
2695         }
2696 
2697         @UnsupportedAppUsage
getStringForUser(ContentResolver cr, String name, final int userHandle)2698         public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
2699             final boolean isSelf = (userHandle == UserHandle.myUserId());
2700             int currentGeneration = -1;
2701             if (isSelf) {
2702                 synchronized (NameValueCache.this) {
2703                     if (mGenerationTracker != null) {
2704                         if (mGenerationTracker.isGenerationChanged()) {
2705                             if (DEBUG) {
2706                                 Log.i(TAG, "Generation changed for type:"
2707                                         + mUri.getPath() + " in package:"
2708                                         + cr.getPackageName() +" and user:" + userHandle);
2709                             }
2710                             mValues.clear();
2711                         } else if (mValues.containsKey(name)) {
2712                             return mValues.get(name);
2713                         }
2714                         if (mGenerationTracker != null) {
2715                             currentGeneration = mGenerationTracker.getCurrentGeneration();
2716                         }
2717                     }
2718                 }
2719             } else {
2720                 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
2721                         + " by user " + UserHandle.myUserId() + " so skipping cache");
2722             }
2723 
2724             IContentProvider cp = mProviderHolder.getProvider(cr);
2725 
2726             // Try the fast path first, not using query().  If this
2727             // fails (alternate Settings provider that doesn't support
2728             // this interface?) then we fall back to the query/table
2729             // interface.
2730             if (mCallGetCommand != null) {
2731                 try {
2732                     Bundle args = null;
2733                     if (!isSelf) {
2734                         args = new Bundle();
2735                         args.putInt(CALL_METHOD_USER_KEY, userHandle);
2736                     }
2737                     boolean needsGenerationTracker = false;
2738                     synchronized (NameValueCache.this) {
2739                         if (isSelf && mGenerationTracker == null) {
2740                             needsGenerationTracker = true;
2741                             if (args == null) {
2742                                 args = new Bundle();
2743                             }
2744                             args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
2745                             if (DEBUG) {
2746                                 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath()
2747                                         + " in package:" + cr.getPackageName() +" and user:"
2748                                         + userHandle);
2749                             }
2750                         }
2751                     }
2752                     Bundle b;
2753                     // If we're in system server and in a binder transaction we need to clear the
2754                     // calling uid. This works around code in system server that did not call
2755                     // clearCallingIdentity, previously this wasn't needed because reading settings
2756                     // did not do permission checking but thats no longer the case.
2757                     // Long term this should be removed and callers should properly call
2758                     // clearCallingIdentity or use a ContentResolver from the caller as needed.
2759                     if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
2760                         final long token = Binder.clearCallingIdentity();
2761                         try {
2762                             b = cp.call(cr.getPackageName(), cr.getAttributionTag(),
2763                                     mProviderHolder.mUri.getAuthority(), mCallGetCommand, name,
2764                                     args);
2765                         } finally {
2766                             Binder.restoreCallingIdentity(token);
2767                         }
2768                     } else {
2769                         b = cp.call(cr.getPackageName(), cr.getAttributionTag(),
2770                                 mProviderHolder.mUri.getAuthority(), mCallGetCommand, name, args);
2771                     }
2772                     if (b != null) {
2773                         String value = b.getString(Settings.NameValueTable.VALUE);
2774                         // Don't update our cache for reads of other users' data
2775                         if (isSelf) {
2776                             synchronized (NameValueCache.this) {
2777                                 if (needsGenerationTracker) {
2778                                     MemoryIntArray array = b.getParcelable(
2779                                             CALL_METHOD_TRACK_GENERATION_KEY);
2780                                     final int index = b.getInt(
2781                                             CALL_METHOD_GENERATION_INDEX_KEY, -1);
2782                                     if (array != null && index >= 0) {
2783                                         final int generation = b.getInt(
2784                                                 CALL_METHOD_GENERATION_KEY, 0);
2785                                         if (DEBUG) {
2786                                             Log.i(TAG, "Received generation tracker for type:"
2787                                                     + mUri.getPath() + " in package:"
2788                                                     + cr.getPackageName() + " and user:"
2789                                                     + userHandle + " with index:" + index);
2790                                         }
2791                                         if (mGenerationTracker != null) {
2792                                             mGenerationTracker.destroy();
2793                                         }
2794                                         mGenerationTracker = new GenerationTracker(array, index,
2795                                                 generation, () -> {
2796                                             synchronized (NameValueCache.this) {
2797                                                 Log.e(TAG, "Error accessing generation"
2798                                                         + " tracker - removing");
2799                                                 if (mGenerationTracker != null) {
2800                                                     GenerationTracker generationTracker =
2801                                                             mGenerationTracker;
2802                                                     mGenerationTracker = null;
2803                                                     generationTracker.destroy();
2804                                                     mValues.clear();
2805                                                 }
2806                                             }
2807                                         });
2808                                         currentGeneration = generation;
2809                                     }
2810                                 }
2811                                 if (mGenerationTracker != null && currentGeneration ==
2812                                         mGenerationTracker.getCurrentGeneration()) {
2813                                     mValues.put(name, value);
2814                                 }
2815                             }
2816                         } else {
2817                             if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
2818                                     + " by " + UserHandle.myUserId()
2819                                     + " so not updating cache");
2820                         }
2821                         return value;
2822                     }
2823                     // If the response Bundle is null, we fall through
2824                     // to the query interface below.
2825                 } catch (RemoteException e) {
2826                     // Not supported by the remote side?  Fall through
2827                     // to query().
2828                 }
2829             }
2830 
2831             Cursor c = null;
2832             try {
2833                 Bundle queryArgs = ContentResolver.createSqlQueryBundle(
2834                         NAME_EQ_PLACEHOLDER, new String[]{name}, null);
2835                 // Same workaround as above.
2836                 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
2837                     final long token = Binder.clearCallingIdentity();
2838                     try {
2839                         c = cp.query(cr.getPackageName(), cr.getAttributionTag(), mUri,
2840                                 SELECT_VALUE_PROJECTION, queryArgs, null);
2841                     } finally {
2842                         Binder.restoreCallingIdentity(token);
2843                     }
2844                 } else {
2845                     c = cp.query(cr.getPackageName(), cr.getAttributionTag(), mUri,
2846                             SELECT_VALUE_PROJECTION, queryArgs, null);
2847                 }
2848                 if (c == null) {
2849                     Log.w(TAG, "Can't get key " + name + " from " + mUri);
2850                     return null;
2851                 }
2852 
2853                 String value = c.moveToNext() ? c.getString(0) : null;
2854                 synchronized (NameValueCache.this) {
2855                     if (mGenerationTracker != null
2856                             && currentGeneration == mGenerationTracker.getCurrentGeneration()) {
2857                         mValues.put(name, value);
2858                     }
2859                 }
2860                 if (LOCAL_LOGV) {
2861                     Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
2862                             name + " = " + (value == null ? "(null)" : value));
2863                 }
2864                 return value;
2865             } catch (RemoteException e) {
2866                 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
2867                 return null;  // Return null, but don't cache it.
2868             } finally {
2869                 if (c != null) c.close();
2870             }
2871         }
2872 
getStringsForPrefix(ContentResolver cr, String prefix, List<String> names)2873         public ArrayMap<String, String> getStringsForPrefix(ContentResolver cr, String prefix,
2874                 List<String> names) {
2875             String namespace = prefix.substring(0, prefix.length() - 1);
2876             DeviceConfig.enforceReadPermission(ActivityThread.currentApplication(), namespace);
2877             ArrayMap<String, String> keyValues = new ArrayMap<>();
2878             int currentGeneration = -1;
2879 
2880             synchronized (NameValueCache.this) {
2881                 if (mGenerationTracker != null) {
2882                     if (mGenerationTracker.isGenerationChanged()) {
2883                         if (DEBUG) {
2884                             Log.i(TAG, "Generation changed for type:" + mUri.getPath()
2885                                     + " in package:" + cr.getPackageName());
2886                         }
2887                         mValues.clear();
2888                     } else {
2889                         boolean prefixCached = mValues.containsKey(prefix);
2890                         if (prefixCached) {
2891                             if (!names.isEmpty()) {
2892                                 for (String name : names) {
2893                                     if (mValues.containsKey(name)) {
2894                                         keyValues.put(name, mValues.get(name));
2895                                     }
2896                                 }
2897                             } else {
2898                                 for (int i = 0; i < mValues.size(); ++i) {
2899                                     String key = mValues.keyAt(i);
2900                                     // Explicitly exclude the prefix as it is only there to
2901                                     // signal that the prefix has been cached.
2902                                     if (key.startsWith(prefix) && !key.equals(prefix)) {
2903                                         keyValues.put(key, mValues.get(key));
2904                                     }
2905                                 }
2906                             }
2907                             return keyValues;
2908                         }
2909                     }
2910                     if (mGenerationTracker != null) {
2911                         currentGeneration = mGenerationTracker.getCurrentGeneration();
2912                     }
2913                 }
2914             }
2915 
2916             if (mCallListCommand == null) {
2917                 // No list command specified, return empty map
2918                 return keyValues;
2919             }
2920             IContentProvider cp = mProviderHolder.getProvider(cr);
2921 
2922             try {
2923                 Bundle args = new Bundle();
2924                 args.putString(Settings.CALL_METHOD_PREFIX_KEY, prefix);
2925                 boolean needsGenerationTracker = false;
2926                 synchronized (NameValueCache.this) {
2927                     if (mGenerationTracker == null) {
2928                         needsGenerationTracker = true;
2929                         args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
2930                         if (DEBUG) {
2931                             Log.i(TAG, "Requested generation tracker for type: "
2932                                     + mUri.getPath() + " in package:" + cr.getPackageName());
2933                         }
2934                     }
2935                 }
2936 
2937                 // Fetch all flags for the namespace at once for caching purposes
2938                 Bundle b = cp.call(cr.getPackageName(), cr.getAttributionTag(),
2939                         mProviderHolder.mUri.getAuthority(), mCallListCommand, null, args);
2940                 if (b == null) {
2941                     // Invalid response, return an empty map
2942                     return keyValues;
2943                 }
2944 
2945                 // All flags for the namespace
2946                 Map<String, String> flagsToValues =
2947                         (HashMap) b.getSerializable(Settings.NameValueTable.VALUE);
2948                 // Only the flags requested by the caller
2949                 if (!names.isEmpty()) {
2950                     for (Map.Entry<String, String> flag : flagsToValues.entrySet()) {
2951                         if (names.contains(flag.getKey())) {
2952                             keyValues.put(flag.getKey(), flag.getValue());
2953                         }
2954                     }
2955                 } else {
2956                     keyValues.putAll(flagsToValues);
2957                 }
2958 
2959                 synchronized (NameValueCache.this) {
2960                     if (needsGenerationTracker) {
2961                         MemoryIntArray array = b.getParcelable(
2962                                 CALL_METHOD_TRACK_GENERATION_KEY);
2963                         final int index = b.getInt(
2964                                 CALL_METHOD_GENERATION_INDEX_KEY, -1);
2965                         if (array != null && index >= 0) {
2966                             final int generation = b.getInt(
2967                                     CALL_METHOD_GENERATION_KEY, 0);
2968                             if (DEBUG) {
2969                                 Log.i(TAG, "Received generation tracker for type:"
2970                                         + mUri.getPath() + " in package:"
2971                                         + cr.getPackageName() + " with index:" + index);
2972                             }
2973                             if (mGenerationTracker != null) {
2974                                 mGenerationTracker.destroy();
2975                             }
2976                             mGenerationTracker = new GenerationTracker(array, index,
2977                                     generation, () -> {
2978                                 synchronized (NameValueCache.this) {
2979                                     Log.e(TAG, "Error accessing generation tracker"
2980                                             + " - removing");
2981                                     if (mGenerationTracker != null) {
2982                                         GenerationTracker generationTracker =
2983                                                 mGenerationTracker;
2984                                         mGenerationTracker = null;
2985                                         generationTracker.destroy();
2986                                         mValues.clear();
2987                                     }
2988                                 }
2989                             });
2990                             currentGeneration = generation;
2991                         }
2992                     }
2993                     if (mGenerationTracker != null && currentGeneration
2994                             == mGenerationTracker.getCurrentGeneration()) {
2995                         // cache the complete list of flags for the namespace
2996                         mValues.putAll(flagsToValues);
2997                         // Adding the prefix as a signal that the prefix is cached.
2998                         mValues.put(prefix, null);
2999                     }
3000                 }
3001                 return keyValues;
3002             } catch (RemoteException e) {
3003                 // Not supported by the remote side, return an empty map
3004                 return keyValues;
3005             }
3006         }
3007 
clearGenerationTrackerForTest()3008         public void clearGenerationTrackerForTest() {
3009             synchronized (NameValueCache.this) {
3010                 if (mGenerationTracker != null) {
3011                     mGenerationTracker.destroy();
3012                 }
3013                 mValues.clear();
3014                 mGenerationTracker = null;
3015             }
3016         }
3017     }
3018 
3019     /**
3020      * Checks if the specified context can draw on top of other apps. As of API
3021      * level 23, an app cannot draw on top of other apps unless it declares the
3022      * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its
3023      * manifest, <em>and</em> the user specifically grants the app this
3024      * capability. To prompt the user to grant this approval, the app must send an
3025      * intent with the action
3026      * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which
3027      * causes the system to display a permission management screen.
3028      *
3029      * @param context App context.
3030      * @return true if the specified context can draw on top of other apps, false otherwise
3031      */
canDrawOverlays(Context context)3032     public static boolean canDrawOverlays(Context context) {
3033         return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(),
3034                 context.getOpPackageName(), false);
3035     }
3036 
3037     /**
3038      * System settings, containing miscellaneous system preferences.  This
3039      * table holds simple name/value pairs.  There are convenience
3040      * functions for accessing individual settings entries.
3041      */
3042     public static final class System extends NameValueTable {
3043         // NOTE: If you add new settings here, be sure to add them to
3044         // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked.
3045 
3046         private static final float DEFAULT_FONT_SCALE = 1.0f;
3047 
3048         /**
3049          * The content:// style URL for this table
3050          */
3051         public static final Uri CONTENT_URI =
3052             Uri.parse("content://" + AUTHORITY + "/system");
3053 
3054         @UnsupportedAppUsage
3055         private static final ContentProviderHolder sProviderHolder =
3056                 new ContentProviderHolder(CONTENT_URI);
3057 
3058         @UnsupportedAppUsage
3059         private static final NameValueCache sNameValueCache = new NameValueCache(
3060                 CONTENT_URI,
3061                 CALL_METHOD_GET_SYSTEM,
3062                 CALL_METHOD_PUT_SYSTEM,
3063                 sProviderHolder);
3064 
3065         @UnsupportedAppUsage
3066         private static final HashSet<String> MOVED_TO_SECURE;
3067         static {
3068             MOVED_TO_SECURE = new HashSet<>(30);
3069             MOVED_TO_SECURE.add(Secure.ADAPTIVE_SLEEP);
3070             MOVED_TO_SECURE.add(Secure.ANDROID_ID);
3071             MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
3072             MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
3073             MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
3074             MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
3075             MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
3076             MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
3077             MOVED_TO_SECURE.add(Secure.LOGGING_ID);
3078             MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
3079             MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
3080             MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
3081             MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
3082             MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
3083             MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
3084             MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
3085             MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
3086             MOVED_TO_SECURE.add(Secure.WIFI_ON);
3087             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
3088             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
3089             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
3090             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
3091             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
3092             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
3093             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
3094             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
3095             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
3096             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
3097             MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
3098 
3099             // At one time in System, then Global, but now back in Secure
3100             MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
3101         }
3102 
3103         @UnsupportedAppUsage
3104         private static final HashSet<String> MOVED_TO_GLOBAL;
3105         @UnsupportedAppUsage
3106         private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
3107         static {
3108             MOVED_TO_GLOBAL = new HashSet<>();
3109             MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>();
3110 
3111             // these were originally in system but migrated to secure in the past,
3112             // so are duplicated in the Secure.* namespace
3113             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
3114             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
3115             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
3116             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
3117             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
3118             MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
3119 
3120             // these are moving directly from system to global
3121             MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
3122             MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
3123             MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
3124             MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
3125             MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
3126             MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
3127             MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
3128             MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
3129             MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
3130             MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
3131             MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
3132             MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
3133             MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
3134             MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
3135             MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
3136             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
3137             MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
3138             MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
3139             MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
3140             MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
3141             MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
3142             MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
3143             MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
3144             MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
3145             MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
3146             MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
3147             MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
3148             MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
3149             MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
3150             MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
3151             MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
3152             MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
3153             MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
3154             MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
3155             MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
3156         }
3157 
3158         /** @hide */
getMovedToGlobalSettings(Set<String> outKeySet)3159         public static void getMovedToGlobalSettings(Set<String> outKeySet) {
3160             outKeySet.addAll(MOVED_TO_GLOBAL);
3161             outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
3162         }
3163 
3164         /** @hide */
getMovedToSecureSettings(Set<String> outKeySet)3165         public static void getMovedToSecureSettings(Set<String> outKeySet) {
3166             outKeySet.addAll(MOVED_TO_SECURE);
3167         }
3168 
3169         /** @hide */
getNonLegacyMovedKeys(HashSet<String> outKeySet)3170         public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
3171             outKeySet.addAll(MOVED_TO_GLOBAL);
3172         }
3173 
3174         /** @hide */
clearProviderForTest()3175         public static void clearProviderForTest() {
3176             sProviderHolder.clearProviderForTest();
3177             sNameValueCache.clearGenerationTrackerForTest();
3178         }
3179 
3180         /**
3181          * Look up a name in the database.
3182          * @param resolver to access the database with
3183          * @param name to look up in the table
3184          * @return the corresponding value, or null if not present
3185          */
getString(ContentResolver resolver, String name)3186         public static String getString(ContentResolver resolver, String name) {
3187             return getStringForUser(resolver, name, resolver.getUserId());
3188         }
3189 
3190         /** @hide */
3191         @UnsupportedAppUsage
getStringForUser(ContentResolver resolver, String name, int userHandle)3192         public static String getStringForUser(ContentResolver resolver, String name,
3193                 int userHandle) {
3194             if (MOVED_TO_SECURE.contains(name)) {
3195                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3196                         + " to android.provider.Settings.Secure, returning read-only value.");
3197                 return Secure.getStringForUser(resolver, name, userHandle);
3198             }
3199             if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
3200                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3201                         + " to android.provider.Settings.Global, returning read-only value.");
3202                 return Global.getStringForUser(resolver, name, userHandle);
3203             }
3204             return sNameValueCache.getStringForUser(resolver, name, userHandle);
3205         }
3206 
3207         /**
3208          * Store a name/value pair into the database.
3209          * @param resolver to access the database with
3210          * @param name to store
3211          * @param value to associate with the name
3212          * @return true if the value was set, false on database errors
3213          */
putString(ContentResolver resolver, String name, String value)3214         public static boolean putString(ContentResolver resolver, String name, String value) {
3215             return putStringForUser(resolver, name, value, resolver.getUserId());
3216         }
3217 
3218         /**
3219          * Store a name/value pair into the database. Values written by this method will be
3220          * overridden if a restore happens in the future.
3221          *
3222          * @param resolver to access the database with
3223          * @param name to store
3224          * @param value to associate with the name
3225          *
3226          * @return true if the value was set, false on database errors
3227          *
3228          * @hide
3229          */
3230         @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE)
3231         @SystemApi
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, boolean overrideableByRestore)3232         public static boolean putString(@NonNull ContentResolver resolver,
3233                 @NonNull String name, @Nullable String value, boolean overrideableByRestore) {
3234             return putStringForUser(resolver, name, value, resolver.getUserId(),
3235                    overrideableByRestore);
3236         }
3237 
3238         /** @hide */
3239         @UnsupportedAppUsage
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)3240         public static boolean putStringForUser(ContentResolver resolver, String name, String value,
3241                 int userHandle) {
3242             return putStringForUser(resolver, name, value, userHandle,
3243                     DEFAULT_OVERRIDEABLE_BY_RESTORE);
3244         }
3245 
putStringForUser(ContentResolver resolver, String name, String value, int userHandle, boolean overrideableByRestore)3246         private static boolean putStringForUser(ContentResolver resolver, String name, String value,
3247                 int userHandle, boolean overrideableByRestore) {
3248             if (MOVED_TO_SECURE.contains(name)) {
3249                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3250                         + " to android.provider.Settings.Secure, value is unchanged.");
3251                 return false;
3252             }
3253             if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
3254                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3255                         + " to android.provider.Settings.Global, value is unchanged.");
3256                 return false;
3257             }
3258             return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle,
3259                     overrideableByRestore);
3260         }
3261 
3262         /**
3263          * Construct the content URI for a particular name/value pair,
3264          * useful for monitoring changes with a ContentObserver.
3265          * @param name to look up in the table
3266          * @return the corresponding content URI, or null if not present
3267          */
getUriFor(String name)3268         public static Uri getUriFor(String name) {
3269             if (MOVED_TO_SECURE.contains(name)) {
3270                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3271                     + " to android.provider.Settings.Secure, returning Secure URI.");
3272                 return Secure.getUriFor(Secure.CONTENT_URI, name);
3273             }
3274             if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
3275                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3276                         + " to android.provider.Settings.Global, returning read-only global URI.");
3277                 return Global.getUriFor(Global.CONTENT_URI, name);
3278             }
3279             return getUriFor(CONTENT_URI, name);
3280         }
3281 
3282         /**
3283          * Convenience function for retrieving a single system settings value
3284          * as an integer.  Note that internally setting values are always
3285          * stored as strings; this function converts the string to an integer
3286          * for you.  The default value will be returned if the setting is
3287          * not defined or not an integer.
3288          *
3289          * @param cr The ContentResolver to access.
3290          * @param name The name of the setting to retrieve.
3291          * @param def Value to return if the setting is not defined.
3292          *
3293          * @return The setting's current value, or 'def' if it is not defined
3294          * or not a valid integer.
3295          */
getInt(ContentResolver cr, String name, int def)3296         public static int getInt(ContentResolver cr, String name, int def) {
3297             return getIntForUser(cr, name, def, cr.getUserId());
3298         }
3299 
3300         /** @hide */
3301         @UnsupportedAppUsage
getIntForUser(ContentResolver cr, String name, int def, int userHandle)3302         public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
3303             String v = getStringForUser(cr, name, userHandle);
3304             try {
3305                 return v != null ? Integer.parseInt(v) : def;
3306             } catch (NumberFormatException e) {
3307                 return def;
3308             }
3309         }
3310 
3311         /**
3312          * Convenience function for retrieving a single system settings value
3313          * as an integer.  Note that internally setting values are always
3314          * stored as strings; this function converts the string to an integer
3315          * for you.
3316          * <p>
3317          * This version does not take a default value.  If the setting has not
3318          * been set, or the string value is not a number,
3319          * it throws {@link SettingNotFoundException}.
3320          *
3321          * @param cr The ContentResolver to access.
3322          * @param name The name of the setting to retrieve.
3323          *
3324          * @throws SettingNotFoundException Thrown if a setting by the given
3325          * name can't be found or the setting value is not an integer.
3326          *
3327          * @return The setting's current value.
3328          */
getInt(ContentResolver cr, String name)3329         public static int getInt(ContentResolver cr, String name)
3330                 throws SettingNotFoundException {
3331             return getIntForUser(cr, name, cr.getUserId());
3332         }
3333 
3334         /** @hide */
3335         @UnsupportedAppUsage
getIntForUser(ContentResolver cr, String name, int userHandle)3336         public static int getIntForUser(ContentResolver cr, String name, int userHandle)
3337                 throws SettingNotFoundException {
3338             String v = getStringForUser(cr, name, userHandle);
3339             try {
3340                 return Integer.parseInt(v);
3341             } catch (NumberFormatException e) {
3342                 throw new SettingNotFoundException(name);
3343             }
3344         }
3345 
3346         /**
3347          * Convenience function for updating a single settings value as an
3348          * integer. This will either create a new entry in the table if the
3349          * given name does not exist, or modify the value of the existing row
3350          * with that name.  Note that internally setting values are always
3351          * stored as strings, so this function converts the given value to a
3352          * string before storing it.
3353          *
3354          * @param cr The ContentResolver to access.
3355          * @param name The name of the setting to modify.
3356          * @param value The new value for the setting.
3357          * @return true if the value was set, false on database errors
3358          */
putInt(ContentResolver cr, String name, int value)3359         public static boolean putInt(ContentResolver cr, String name, int value) {
3360             return putIntForUser(cr, name, value, cr.getUserId());
3361         }
3362 
3363         /** @hide */
3364         @UnsupportedAppUsage
putIntForUser(ContentResolver cr, String name, int value, int userHandle)3365         public static boolean putIntForUser(ContentResolver cr, String name, int value,
3366                 int userHandle) {
3367             return putStringForUser(cr, name, Integer.toString(value), userHandle);
3368         }
3369 
3370         /**
3371          * Convenience function for retrieving a single system settings value
3372          * as a {@code long}.  Note that internally setting values are always
3373          * stored as strings; this function converts the string to a {@code long}
3374          * for you.  The default value will be returned if the setting is
3375          * not defined or not a {@code long}.
3376          *
3377          * @param cr The ContentResolver to access.
3378          * @param name The name of the setting to retrieve.
3379          * @param def Value to return if the setting is not defined.
3380          *
3381          * @return The setting's current value, or 'def' if it is not defined
3382          * or not a valid {@code long}.
3383          */
getLong(ContentResolver cr, String name, long def)3384         public static long getLong(ContentResolver cr, String name, long def) {
3385             return getLongForUser(cr, name, def, cr.getUserId());
3386         }
3387 
3388         /** @hide */
getLongForUser(ContentResolver cr, String name, long def, int userHandle)3389         public static long getLongForUser(ContentResolver cr, String name, long def,
3390                 int userHandle) {
3391             String valString = getStringForUser(cr, name, userHandle);
3392             long value;
3393             try {
3394                 value = valString != null ? Long.parseLong(valString) : def;
3395             } catch (NumberFormatException e) {
3396                 value = def;
3397             }
3398             return value;
3399         }
3400 
3401         /**
3402          * Convenience function for retrieving a single system settings value
3403          * as a {@code long}.  Note that internally setting values are always
3404          * stored as strings; this function converts the string to a {@code long}
3405          * for you.
3406          * <p>
3407          * This version does not take a default value.  If the setting has not
3408          * been set, or the string value is not a number,
3409          * it throws {@link SettingNotFoundException}.
3410          *
3411          * @param cr The ContentResolver to access.
3412          * @param name The name of the setting to retrieve.
3413          *
3414          * @return The setting's current value.
3415          * @throws SettingNotFoundException Thrown if a setting by the given
3416          * name can't be found or the setting value is not an integer.
3417          */
getLong(ContentResolver cr, String name)3418         public static long getLong(ContentResolver cr, String name)
3419                 throws SettingNotFoundException {
3420             return getLongForUser(cr, name, cr.getUserId());
3421         }
3422 
3423         /** @hide */
getLongForUser(ContentResolver cr, String name, int userHandle)3424         public static long getLongForUser(ContentResolver cr, String name, int userHandle)
3425                 throws SettingNotFoundException {
3426             String valString = getStringForUser(cr, name, userHandle);
3427             try {
3428                 return Long.parseLong(valString);
3429             } catch (NumberFormatException e) {
3430                 throw new SettingNotFoundException(name);
3431             }
3432         }
3433 
3434         /**
3435          * Convenience function for updating a single settings value as a long
3436          * integer. This will either create a new entry in the table if the
3437          * given name does not exist, or modify the value of the existing row
3438          * with that name.  Note that internally setting values are always
3439          * stored as strings, so this function converts the given value to a
3440          * string before storing it.
3441          *
3442          * @param cr The ContentResolver to access.
3443          * @param name The name of the setting to modify.
3444          * @param value The new value for the setting.
3445          * @return true if the value was set, false on database errors
3446          */
putLong(ContentResolver cr, String name, long value)3447         public static boolean putLong(ContentResolver cr, String name, long value) {
3448             return putLongForUser(cr, name, value, cr.getUserId());
3449         }
3450 
3451         /** @hide */
putLongForUser(ContentResolver cr, String name, long value, int userHandle)3452         public static boolean putLongForUser(ContentResolver cr, String name, long value,
3453                 int userHandle) {
3454             return putStringForUser(cr, name, Long.toString(value), userHandle);
3455         }
3456 
3457         /**
3458          * Convenience function for retrieving a single system settings value
3459          * as a floating point number.  Note that internally setting values are
3460          * always stored as strings; this function converts the string to an
3461          * float for you. The default value will be returned if the setting
3462          * is not defined or not a valid float.
3463          *
3464          * @param cr The ContentResolver to access.
3465          * @param name The name of the setting to retrieve.
3466          * @param def Value to return if the setting is not defined.
3467          *
3468          * @return The setting's current value, or 'def' if it is not defined
3469          * or not a valid float.
3470          */
getFloat(ContentResolver cr, String name, float def)3471         public static float getFloat(ContentResolver cr, String name, float def) {
3472             return getFloatForUser(cr, name, def, cr.getUserId());
3473         }
3474 
3475         /** @hide */
getFloatForUser(ContentResolver cr, String name, float def, int userHandle)3476         public static float getFloatForUser(ContentResolver cr, String name, float def,
3477                 int userHandle) {
3478             String v = getStringForUser(cr, name, userHandle);
3479             try {
3480                 return v != null ? Float.parseFloat(v) : def;
3481             } catch (NumberFormatException e) {
3482                 return def;
3483             }
3484         }
3485 
3486         /**
3487          * Convenience function for retrieving a single system settings value
3488          * as a float.  Note that internally setting values are always
3489          * stored as strings; this function converts the string to a float
3490          * for you.
3491          * <p>
3492          * This version does not take a default value.  If the setting has not
3493          * been set, or the string value is not a number,
3494          * it throws {@link SettingNotFoundException}.
3495          *
3496          * @param cr The ContentResolver to access.
3497          * @param name The name of the setting to retrieve.
3498          *
3499          * @throws SettingNotFoundException Thrown if a setting by the given
3500          * name can't be found or the setting value is not a float.
3501          *
3502          * @return The setting's current value.
3503          */
getFloat(ContentResolver cr, String name)3504         public static float getFloat(ContentResolver cr, String name)
3505                 throws SettingNotFoundException {
3506             return getFloatForUser(cr, name, cr.getUserId());
3507         }
3508 
3509         /** @hide */
getFloatForUser(ContentResolver cr, String name, int userHandle)3510         public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
3511                 throws SettingNotFoundException {
3512             String v = getStringForUser(cr, name, userHandle);
3513             if (v == null) {
3514                 throw new SettingNotFoundException(name);
3515             }
3516             try {
3517                 return Float.parseFloat(v);
3518             } catch (NumberFormatException e) {
3519                 throw new SettingNotFoundException(name);
3520             }
3521         }
3522 
3523         /**
3524          * Convenience function for updating a single settings value as a
3525          * floating point number. This will either create a new entry in the
3526          * table if the given name does not exist, or modify the value of the
3527          * existing row with that name.  Note that internally setting values
3528          * are always stored as strings, so this function converts the given
3529          * value to a string before storing it.
3530          *
3531          * @param cr The ContentResolver to access.
3532          * @param name The name of the setting to modify.
3533          * @param value The new value for the setting.
3534          * @return true if the value was set, false on database errors
3535          */
putFloat(ContentResolver cr, String name, float value)3536         public static boolean putFloat(ContentResolver cr, String name, float value) {
3537             return putFloatForUser(cr, name, value, cr.getUserId());
3538         }
3539 
3540         /** @hide */
putFloatForUser(ContentResolver cr, String name, float value, int userHandle)3541         public static boolean putFloatForUser(ContentResolver cr, String name, float value,
3542                 int userHandle) {
3543             return putStringForUser(cr, name, Float.toString(value), userHandle);
3544         }
3545 
3546         /**
3547          * Convenience function to read all of the current
3548          * configuration-related settings into a
3549          * {@link Configuration} object.
3550          *
3551          * @param cr The ContentResolver to access.
3552          * @param outConfig Where to place the configuration settings.
3553          */
getConfiguration(ContentResolver cr, Configuration outConfig)3554         public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
3555             adjustConfigurationForUser(cr, outConfig, cr.getUserId(),
3556                     false /* updateSettingsIfEmpty */);
3557         }
3558 
3559         /** @hide */
adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, int userHandle, boolean updateSettingsIfEmpty)3560         public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig,
3561                 int userHandle, boolean updateSettingsIfEmpty) {
3562             outConfig.fontScale = Settings.System.getFloatForUser(
3563                     cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle);
3564             if (outConfig.fontScale < 0) {
3565                 outConfig.fontScale = DEFAULT_FONT_SCALE;
3566             }
3567 
3568             final String localeValue =
3569                     Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle);
3570             if (localeValue != null) {
3571                 outConfig.setLocales(LocaleList.forLanguageTags(localeValue));
3572             } else {
3573                 // Do not update configuration with emtpy settings since we need to take over the
3574                 // locale list of previous user if the settings value is empty. This happens when a
3575                 // new user is created.
3576 
3577                 if (updateSettingsIfEmpty) {
3578                     // Make current configuration persistent. This is necessary the first time a
3579                     // user log in. At the first login, the configuration settings are empty, so we
3580                     // need to store the adjusted configuration as the initial settings.
3581                     Settings.System.putStringForUser(
3582                             cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(),
3583                             userHandle, DEFAULT_OVERRIDEABLE_BY_RESTORE);
3584                 }
3585             }
3586         }
3587 
3588         /**
3589          * @hide Erase the fields in the Configuration that should be applied
3590          * by the settings.
3591          */
clearConfiguration(Configuration inoutConfig)3592         public static void clearConfiguration(Configuration inoutConfig) {
3593             inoutConfig.fontScale = 0;
3594             if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) {
3595                 inoutConfig.clearLocales();
3596             }
3597         }
3598 
3599         /**
3600          * Convenience function to write a batch of configuration-related
3601          * settings from a {@link Configuration} object.
3602          *
3603          * @param cr The ContentResolver to access.
3604          * @param config The settings to write.
3605          * @return true if the values were set, false on database errors
3606          */
putConfiguration(ContentResolver cr, Configuration config)3607         public static boolean putConfiguration(ContentResolver cr, Configuration config) {
3608             return putConfigurationForUser(cr, config, cr.getUserId());
3609         }
3610 
3611         /** @hide */
putConfigurationForUser(ContentResolver cr, Configuration config, int userHandle)3612         public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
3613                 int userHandle) {
3614             return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) &&
3615                     Settings.System.putStringForUser(
3616                             cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle,
3617                             DEFAULT_OVERRIDEABLE_BY_RESTORE);
3618         }
3619 
3620         /** @hide */
hasInterestingConfigurationChanges(int changes)3621         public static boolean hasInterestingConfigurationChanges(int changes) {
3622             return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 ||
3623                     (changes & ActivityInfo.CONFIG_LOCALE) != 0;
3624         }
3625 
3626         /** @deprecated - Do not use */
3627         @Deprecated
getShowGTalkServiceStatus(ContentResolver cr)3628         public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
3629             return getShowGTalkServiceStatusForUser(cr, cr.getUserId());
3630         }
3631 
3632         /**
3633          * @hide
3634          * @deprecated - Do not use
3635          */
3636         @Deprecated
getShowGTalkServiceStatusForUser(ContentResolver cr, int userHandle)3637         public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
3638                 int userHandle) {
3639             return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
3640         }
3641 
3642         /** @deprecated - Do not use */
3643         @Deprecated
setShowGTalkServiceStatus(ContentResolver cr, boolean flag)3644         public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
3645             setShowGTalkServiceStatusForUser(cr, flag, cr.getUserId());
3646         }
3647 
3648         /**
3649          * @hide
3650          * @deprecated - Do not use
3651          */
3652         @Deprecated
setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, int userHandle)3653         public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
3654                 int userHandle) {
3655             putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
3656         }
3657 
3658         /**
3659          * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
3660          */
3661         @Deprecated
3662         public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN;
3663 
3664         /**
3665          * What happens when the user presses the end call button if they're not
3666          * on a call.<br/>
3667          * <b>Values:</b><br/>
3668          * 0 - The end button does nothing.<br/>
3669          * 1 - The end button goes to the home screen.<br/>
3670          * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
3671          * 3 - The end button goes to the home screen.  If the user is already on the
3672          * home screen, it puts the device to sleep.
3673          */
3674         public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
3675 
3676         /**
3677          * END_BUTTON_BEHAVIOR value for "go home".
3678          * @hide
3679          */
3680         public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
3681 
3682         /**
3683          * END_BUTTON_BEHAVIOR value for "go to sleep".
3684          * @hide
3685          */
3686         public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
3687 
3688         /**
3689          * END_BUTTON_BEHAVIOR default value.
3690          * @hide
3691          */
3692         public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
3693 
3694         /**
3695          * Is advanced settings mode turned on. 0 == no, 1 == yes
3696          * @hide
3697          */
3698         public static final String ADVANCED_SETTINGS = "advanced_settings";
3699 
3700         /**
3701          * ADVANCED_SETTINGS default value.
3702          * @hide
3703          */
3704         public static final int ADVANCED_SETTINGS_DEFAULT = 0;
3705 
3706         /**
3707          * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
3708          */
3709         @Deprecated
3710         public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
3711 
3712         /**
3713          * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
3714          */
3715         @Deprecated
3716         public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
3717 
3718         /**
3719          * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
3720          */
3721         @Deprecated
3722         public static final String RADIO_WIFI = Global.RADIO_WIFI;
3723 
3724         /**
3725          * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
3726          * {@hide}
3727          */
3728         @Deprecated
3729         public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
3730 
3731         /**
3732          * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
3733          */
3734         @Deprecated
3735         public static final String RADIO_CELL = Global.RADIO_CELL;
3736 
3737         /**
3738          * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
3739          */
3740         @Deprecated
3741         public static final String RADIO_NFC = Global.RADIO_NFC;
3742 
3743         /**
3744          * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
3745          */
3746         @Deprecated
3747         public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
3748 
3749         /**
3750          * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
3751          *
3752          * {@hide}
3753          */
3754         @Deprecated
3755         @UnsupportedAppUsage
3756         public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
3757                 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
3758 
3759         /**
3760          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
3761          */
3762         @Deprecated
3763         public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
3764 
3765         /**
3766          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
3767          */
3768         @Deprecated
3769         public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
3770 
3771         /**
3772          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
3773          */
3774         @Deprecated
3775         public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
3776                 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
3777 
3778         /**
3779          * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
3780          */
3781         @Deprecated
3782         public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
3783 
3784         /**
3785          * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
3786          */
3787         @Deprecated
3788         public static final String MODE_RINGER = Global.MODE_RINGER;
3789 
3790         /**
3791          * Whether to use static IP and other static network attributes.
3792          * <p>
3793          * Set to 1 for true and 0 for false.
3794          *
3795          * @deprecated Use {@link WifiManager} instead
3796          */
3797         @Deprecated
3798         public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
3799 
3800         /**
3801          * The static IP address.
3802          * <p>
3803          * Example: "192.168.1.51"
3804          *
3805          * @deprecated Use {@link WifiManager} instead
3806          */
3807         @Deprecated
3808         public static final String WIFI_STATIC_IP = "wifi_static_ip";
3809 
3810         /**
3811          * If using static IP, the gateway's IP address.
3812          * <p>
3813          * Example: "192.168.1.1"
3814          *
3815          * @deprecated Use {@link WifiManager} instead
3816          */
3817         @Deprecated
3818         public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
3819 
3820         /**
3821          * If using static IP, the net mask.
3822          * <p>
3823          * Example: "255.255.255.0"
3824          *
3825          * @deprecated Use {@link WifiManager} instead
3826          */
3827         @Deprecated
3828         public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
3829 
3830         /**
3831          * If using static IP, the primary DNS's IP address.
3832          * <p>
3833          * Example: "192.168.1.1"
3834          *
3835          * @deprecated Use {@link WifiManager} instead
3836          */
3837         @Deprecated
3838         public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
3839 
3840         /**
3841          * If using static IP, the secondary DNS's IP address.
3842          * <p>
3843          * Example: "192.168.1.2"
3844          *
3845          * @deprecated Use {@link WifiManager} instead
3846          */
3847         @Deprecated
3848         public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
3849 
3850         /**
3851          * Determines whether remote devices may discover and/or connect to
3852          * this device.
3853          * <P>Type: INT</P>
3854          * 2 -- discoverable and connectable
3855          * 1 -- connectable but not discoverable
3856          * 0 -- neither connectable nor discoverable
3857          */
3858         public static final String BLUETOOTH_DISCOVERABILITY =
3859             "bluetooth_discoverability";
3860 
3861         /**
3862          * Bluetooth discoverability timeout.  If this value is nonzero, then
3863          * Bluetooth becomes discoverable for a certain number of seconds,
3864          * after which is becomes simply connectable.  The value is in seconds.
3865          */
3866         public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
3867             "bluetooth_discoverability_timeout";
3868 
3869         /**
3870          * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
3871          * instead
3872          */
3873         @Deprecated
3874         public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
3875 
3876         /**
3877          * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
3878          * instead
3879          */
3880         @Deprecated
3881         public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
3882 
3883         /**
3884          * @deprecated Use
3885          * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
3886          * instead
3887          */
3888         @Deprecated
3889         public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
3890             "lock_pattern_tactile_feedback_enabled";
3891 
3892         /**
3893          * A formatted string of the next alarm that is set, or the empty string
3894          * if there is no alarm set.
3895          *
3896          * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
3897          */
3898         @Deprecated
3899         public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
3900 
3901         /**
3902          * Scaling factor for fonts, float.
3903          */
3904         public static final String FONT_SCALE = "font_scale";
3905 
3906         /**
3907          * The serialized system locale value.
3908          *
3909          * Do not use this value directory.
3910          * To get system locale, use {@link LocaleList#getDefault} instead.
3911          * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales}
3912          * instead.
3913          * @hide
3914          */
3915         public static final String SYSTEM_LOCALES = "system_locales";
3916 
3917 
3918         /**
3919          * Name of an application package to be debugged.
3920          *
3921          * @deprecated Use {@link Global#DEBUG_APP} instead
3922          */
3923         @Deprecated
3924         public static final String DEBUG_APP = Global.DEBUG_APP;
3925 
3926         /**
3927          * If 1, when launching DEBUG_APP it will wait for the debugger before
3928          * starting user code.  If 0, it will run normally.
3929          *
3930          * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
3931          */
3932         @Deprecated
3933         public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
3934 
3935         /**
3936          * Whether or not to dim the screen. 0=no  1=yes
3937          * @deprecated This setting is no longer used.
3938          */
3939         @Deprecated
3940         public static final String DIM_SCREEN = "dim_screen";
3941 
3942         /**
3943          * The display color mode.
3944          * @hide
3945          */
3946         public static final String DISPLAY_COLOR_MODE = "display_color_mode";
3947 
3948         /**
3949          * The user selected min refresh rate in frames per second.
3950          *
3951          * If this isn't set, 0 will be used.
3952          * @hide
3953          */
3954         public static final String MIN_REFRESH_RATE = "min_refresh_rate";
3955 
3956         /**
3957          * The user selected peak refresh rate in frames per second.
3958          *
3959          * If this isn't set, the system falls back to a device specific default.
3960          * @hide
3961          */
3962         public static final String PEAK_REFRESH_RATE = "peak_refresh_rate";
3963 
3964         /**
3965          * The amount of time in milliseconds before the device goes to sleep or begins
3966          * to dream after a period of inactivity.  This value is also known as the
3967          * user activity timeout period since the screen isn't necessarily turned off
3968          * when it expires.
3969          *
3970          * <p>
3971          * This value is bounded by maximum timeout set by
3972          * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}.
3973          */
3974         public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
3975 
3976         /**
3977          * The screen backlight brightness between 0 and 255.
3978          */
3979         public static final String SCREEN_BRIGHTNESS = "screen_brightness";
3980 
3981         /**
3982          * The screen backlight brightness between 0 and 255.
3983          * @hide
3984          */
3985         public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr";
3986 
3987         /**
3988          * The screen backlight brightness between 0.0f and 1.0f.
3989          * @hide
3990          */
3991         public static final String SCREEN_BRIGHTNESS_FOR_VR_FLOAT =
3992                 "screen_brightness_for_vr_float";
3993 
3994         /**
3995          * The screen backlight brightness between 0.0f and 1.0f.
3996          * @hide
3997          */
3998         public static final String SCREEN_BRIGHTNESS_FLOAT = "screen_brightness_float";
3999 
4000         /**
4001          * Control whether to enable automatic brightness mode.
4002          */
4003         public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
4004 
4005         /**
4006          * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
4007          * or less (<0.0 >-1.0) bright.
4008          * @hide
4009          */
4010         @UnsupportedAppUsage
4011         public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
4012 
4013         /**
4014          * SCREEN_BRIGHTNESS_MODE value for manual mode.
4015          */
4016         public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
4017 
4018         /**
4019          * SCREEN_BRIGHTNESS_MODE value for automatic mode.
4020          */
4021         public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
4022 
4023         /**
4024          * Control whether to enable adaptive sleep mode.
4025          * @deprecated Use {@link android.provider.Settings.Secure#ADAPTIVE_SLEEP} instead.
4026          * @hide
4027          */
4028         public static final String ADAPTIVE_SLEEP = "adaptive_sleep";
4029 
4030         /**
4031          * Control whether the process CPU usage meter should be shown.
4032          *
4033          * @deprecated This functionality is no longer available as of
4034          * {@link android.os.Build.VERSION_CODES#N_MR1}.
4035          */
4036         @Deprecated
4037         public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
4038 
4039         /**
4040          * If 1, the activity manager will aggressively finish activities and
4041          * processes as soon as they are no longer needed.  If 0, the normal
4042          * extended lifetime is used.
4043          *
4044          * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
4045          */
4046         @Deprecated
4047         public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
4048 
4049         /**
4050          * Determines which streams are affected by ringer and zen mode changes. The
4051          * stream type's bit should be set to 1 if it should be muted when going
4052          * into an inaudible ringer mode.
4053          */
4054         public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
4055 
4056         /**
4057           * Determines which streams are affected by mute. The
4058           * stream type's bit should be set to 1 if it should be muted when a mute request
4059           * is received.
4060           */
4061         public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
4062 
4063         /**
4064          * Whether vibrate is on for different events. This is used internally,
4065          * changing this value will not change the vibrate. See AudioManager.
4066          */
4067         public static final String VIBRATE_ON = "vibrate_on";
4068 
4069         /**
4070          * If 1, redirects the system vibrator to all currently attached input devices
4071          * that support vibration.  If there are no such input devices, then the system
4072          * vibrator is used instead.
4073          * If 0, does not register the system vibrator.
4074          *
4075          * This setting is mainly intended to provide a compatibility mechanism for
4076          * applications that only know about the system vibrator and do not use the
4077          * input device vibrator API.
4078          *
4079          * @hide
4080          */
4081         public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
4082 
4083         /**
4084          * The intensity of notification vibrations, if configurable.
4085          *
4086          * Not all devices are capable of changing their vibration intensity; on these devices
4087          * there will likely be no difference between the various vibration intensities except for
4088          * intensity 0 (off) and the rest.
4089          *
4090          * <b>Values:</b><br/>
4091          * 0 - Vibration is disabled<br/>
4092          * 1 - Weak vibrations<br/>
4093          * 2 - Medium vibrations<br/>
4094          * 3 - Strong vibrations
4095          * @hide
4096          */
4097         public static final String NOTIFICATION_VIBRATION_INTENSITY =
4098                 "notification_vibration_intensity";
4099         /**
4100          * The intensity of ringtone vibrations, if configurable.
4101          *
4102          * Not all devices are capable of changing their vibration intensity; on these devices
4103          * there will likely be no difference between the various vibration intensities except for
4104          * intensity 0 (off) and the rest.
4105          *
4106          * <b>Values:</b><br/>
4107          * 0 - Vibration is disabled<br/>
4108          * 1 - Weak vibrations<br/>
4109          * 2 - Medium vibrations<br/>
4110          * 3 - Strong vibrations
4111          * @hide
4112          */
4113         public static final String RING_VIBRATION_INTENSITY =
4114                 "ring_vibration_intensity";
4115 
4116         /**
4117          * The intensity of haptic feedback vibrations, if configurable.
4118          *
4119          * Not all devices are capable of changing their feedback intensity; on these devices
4120          * there will likely be no difference between the various vibration intensities except for
4121          * intensity 0 (off) and the rest.
4122          *
4123          * <b>Values:</b><br/>
4124          * 0 - Vibration is disabled<br/>
4125          * 1 - Weak vibrations<br/>
4126          * 2 - Medium vibrations<br/>
4127          * 3 - Strong vibrations
4128          * @hide
4129          */
4130         public static final String HAPTIC_FEEDBACK_INTENSITY =
4131                 "haptic_feedback_intensity";
4132 
4133         /**
4134          * Ringer volume. This is used internally, changing this value will not
4135          * change the volume. See AudioManager.
4136          *
4137          * @removed Not used by anything since API 2.
4138          */
4139         public static final String VOLUME_RING = "volume_ring";
4140 
4141         /**
4142          * System/notifications volume. This is used internally, changing this
4143          * value will not change the volume. See AudioManager.
4144          *
4145          * @removed Not used by anything since API 2.
4146          */
4147         public static final String VOLUME_SYSTEM = "volume_system";
4148 
4149         /**
4150          * Voice call volume. This is used internally, changing this value will
4151          * not change the volume. See AudioManager.
4152          *
4153          * @removed Not used by anything since API 2.
4154          */
4155         public static final String VOLUME_VOICE = "volume_voice";
4156 
4157         /**
4158          * Music/media/gaming volume. This is used internally, changing this
4159          * value will not change the volume. See AudioManager.
4160          *
4161          * @removed Not used by anything since API 2.
4162          */
4163         public static final String VOLUME_MUSIC = "volume_music";
4164 
4165         /**
4166          * Alarm volume. This is used internally, changing this
4167          * value will not change the volume. See AudioManager.
4168          *
4169          * @removed Not used by anything since API 2.
4170          */
4171         public static final String VOLUME_ALARM = "volume_alarm";
4172 
4173         /**
4174          * Notification volume. This is used internally, changing this
4175          * value will not change the volume. See AudioManager.
4176          *
4177          * @removed Not used by anything since API 2.
4178          */
4179         public static final String VOLUME_NOTIFICATION = "volume_notification";
4180 
4181         /**
4182          * Bluetooth Headset volume. This is used internally, changing this value will
4183          * not change the volume. See AudioManager.
4184          *
4185          * @removed Not used by anything since API 2.
4186          */
4187         public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
4188 
4189         /**
4190          * @hide
4191          * Acessibility volume. This is used internally, changing this
4192          * value will not change the volume.
4193          */
4194         public static final String VOLUME_ACCESSIBILITY = "volume_a11y";
4195 
4196         /**
4197          * @hide
4198          * Volume index for virtual assistant.
4199          */
4200         public static final String VOLUME_ASSISTANT = "volume_assistant";
4201 
4202         /**
4203          * Master volume (float in the range 0.0f to 1.0f).
4204          *
4205          * @hide
4206          */
4207         public static final String VOLUME_MASTER = "volume_master";
4208 
4209         /**
4210          * Master mono (int 1 = mono, 0 = normal).
4211          *
4212          * @hide
4213          */
4214         @UnsupportedAppUsage
4215         public static final String MASTER_MONO = "master_mono";
4216 
4217         /**
4218          * Master balance (float -1.f = 100% left, 0.f = dead center, 1.f = 100% right).
4219          *
4220          * @hide
4221          */
4222         public static final String MASTER_BALANCE = "master_balance";
4223 
4224         /**
4225          * Whether the notifications should use the ring volume (value of 1) or
4226          * a separate notification volume (value of 0). In most cases, users
4227          * will have this enabled so the notification and ringer volumes will be
4228          * the same. However, power users can disable this and use the separate
4229          * notification volume control.
4230          * <p>
4231          * Note: This is a one-off setting that will be removed in the future
4232          * when there is profile support. For this reason, it is kept hidden
4233          * from the public APIs.
4234          *
4235          * @hide
4236          * @deprecated
4237          */
4238         @Deprecated
4239         public static final String NOTIFICATIONS_USE_RING_VOLUME =
4240             "notifications_use_ring_volume";
4241 
4242         /**
4243          * Whether silent mode should allow vibration feedback. This is used
4244          * internally in AudioService and the Sound settings activity to
4245          * coordinate decoupling of vibrate and silent modes. This setting
4246          * will likely be removed in a future release with support for
4247          * audio/vibe feedback profiles.
4248          *
4249          * Not used anymore. On devices with vibrator, the user explicitly selects
4250          * silent or vibrate mode.
4251          * Kept for use by legacy database upgrade code in DatabaseHelper.
4252          * @hide
4253          */
4254         @UnsupportedAppUsage
4255         public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
4256 
4257         /**
4258          * The mapping of stream type (integer) to its setting.
4259          *
4260          * @removed  Not used by anything since API 2.
4261          */
4262         public static final String[] VOLUME_SETTINGS = {
4263             VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
4264             VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
4265         };
4266 
4267         /**
4268          * @hide
4269          * The mapping of stream type (integer) to its setting.
4270          * Unlike the VOLUME_SETTINGS array, this one contains as many entries as
4271          * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes
4272          * are never persisted.
4273          */
4274         public static final String[] VOLUME_SETTINGS_INT = {
4275                 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
4276                 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO,
4277                 "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/,
4278                 "" /*STREAM_DTMF, no setting for this stream*/,
4279                 "" /*STREAM_TTS, no setting for this stream*/,
4280                 VOLUME_ACCESSIBILITY, VOLUME_ASSISTANT
4281             };
4282 
4283         /**
4284          * Appended to various volume related settings to record the previous
4285          * values before they the settings were affected by a silent/vibrate
4286          * ringer mode change.
4287          *
4288          * @removed  Not used by anything since API 2.
4289          */
4290         public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
4291 
4292         /**
4293          * Persistent store for the system-wide default ringtone URI.
4294          * <p>
4295          * If you need to play the default ringtone at any given time, it is recommended
4296          * you give {@link #DEFAULT_RINGTONE_URI} to the media player.  It will resolve
4297          * to the set default ringtone at the time of playing.
4298          *
4299          * @see #DEFAULT_RINGTONE_URI
4300          */
4301         public static final String RINGTONE = "ringtone";
4302 
4303         /**
4304          * A {@link Uri} that will point to the current default ringtone at any
4305          * given time.
4306          * <p>
4307          * If the current default ringtone is in the DRM provider and the caller
4308          * does not have permission, the exception will be a
4309          * FileNotFoundException.
4310          */
4311         public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
4312 
4313         /** {@hide} */
4314         public static final String RINGTONE_CACHE = "ringtone_cache";
4315         /** {@hide} */
4316         public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE);
4317 
4318         /**
4319          * Persistent store for the system-wide default notification sound.
4320          *
4321          * @see #RINGTONE
4322          * @see #DEFAULT_NOTIFICATION_URI
4323          */
4324         public static final String NOTIFICATION_SOUND = "notification_sound";
4325 
4326         /**
4327          * A {@link Uri} that will point to the current default notification
4328          * sound at any given time.
4329          *
4330          * @see #DEFAULT_RINGTONE_URI
4331          */
4332         public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
4333 
4334         /** {@hide} */
4335         public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache";
4336         /** {@hide} */
4337         public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE);
4338 
4339         /**
4340          * Persistent store for the system-wide default alarm alert.
4341          *
4342          * @see #RINGTONE
4343          * @see #DEFAULT_ALARM_ALERT_URI
4344          */
4345         public static final String ALARM_ALERT = "alarm_alert";
4346 
4347         /**
4348          * A {@link Uri} that will point to the current default alarm alert at
4349          * any given time.
4350          *
4351          * @see #DEFAULT_ALARM_ALERT_URI
4352          */
4353         public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
4354 
4355         /** {@hide} */
4356         public static final String ALARM_ALERT_CACHE = "alarm_alert_cache";
4357         /** {@hide} */
4358         public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE);
4359 
4360         /**
4361          * Persistent store for the system default media button event receiver.
4362          *
4363          * @hide
4364          */
4365         public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
4366 
4367         /**
4368          * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
4369          */
4370         public static final String TEXT_AUTO_REPLACE = "auto_replace";
4371 
4372         /**
4373          * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
4374          */
4375         public static final String TEXT_AUTO_CAPS = "auto_caps";
4376 
4377         /**
4378          * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
4379          * feature converts two spaces to a "." and space.
4380          */
4381         public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
4382 
4383         /**
4384          * Setting to showing password characters in text editors. 1 = On, 0 = Off
4385          */
4386         public static final String TEXT_SHOW_PASSWORD = "show_password";
4387 
4388         public static final String SHOW_GTALK_SERVICE_STATUS =
4389                 "SHOW_GTALK_SERVICE_STATUS";
4390 
4391         /**
4392          * Name of activity to use for wallpaper on the home screen.
4393          *
4394          * @deprecated Use {@link WallpaperManager} instead.
4395          */
4396         @Deprecated
4397         public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
4398 
4399         /**
4400          * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
4401          * instead
4402          */
4403         @Deprecated
4404         public static final String AUTO_TIME = Global.AUTO_TIME;
4405 
4406         /**
4407          * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
4408          * instead
4409          */
4410         @Deprecated
4411         public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
4412 
4413         /**
4414          * Display times as 12 or 24 hours
4415          *   12
4416          *   24
4417          */
4418         public static final String TIME_12_24 = "time_12_24";
4419 
4420         /**
4421          * Date format string
4422          *   mm/dd/yyyy
4423          *   dd/mm/yyyy
4424          *   yyyy/mm/dd
4425          */
4426         public static final String DATE_FORMAT = "date_format";
4427 
4428         /**
4429          * Whether the setup wizard has been run before (on first boot), or if
4430          * it still needs to be run.
4431          *
4432          * nonzero = it has been run in the past
4433          * 0 = it has not been run in the past
4434          */
4435         public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
4436 
4437         /**
4438          * Scaling factor for normal window animations. Setting to 0 will disable window
4439          * animations.
4440          *
4441          * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
4442          */
4443         @Deprecated
4444         public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
4445 
4446         /**
4447          * Scaling factor for activity transition animations. Setting to 0 will disable window
4448          * animations.
4449          *
4450          * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
4451          */
4452         @Deprecated
4453         public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
4454 
4455         /**
4456          * Scaling factor for Animator-based animations. This affects both the start delay and
4457          * duration of all such animations. Setting to 0 will cause animations to end immediately.
4458          * The default value is 1.
4459          *
4460          * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
4461          */
4462         @Deprecated
4463         public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
4464 
4465         /**
4466          * Control whether the accelerometer will be used to change screen
4467          * orientation.  If 0, it will not be used unless explicitly requested
4468          * by the application; if 1, it will be used by default unless explicitly
4469          * disabled by the application.
4470          */
4471         public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
4472 
4473         /**
4474          * Default screen rotation when no other policy applies.
4475          * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
4476          * preference, this rotation value will be used. Must be one of the
4477          * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
4478          *
4479          * @see Display#getRotation
4480          */
4481         public static final String USER_ROTATION = "user_rotation";
4482 
4483         /**
4484          * Control whether the rotation lock toggle in the System UI should be hidden.
4485          * Typically this is done for accessibility purposes to make it harder for
4486          * the user to accidentally toggle the rotation lock while the display rotation
4487          * has been locked for accessibility.
4488          *
4489          * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
4490          * unavailable for other reasons).  If 1, then the rotation lock toggle is hidden.
4491          *
4492          * @hide
4493          */
4494         @UnsupportedAppUsage
4495         public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
4496                 "hide_rotation_lock_toggle_for_accessibility";
4497 
4498         /**
4499          * Whether the phone vibrates when it is ringing due to an incoming call. This will
4500          * be used by Phone and Setting apps; it shouldn't affect other apps.
4501          * The value is boolean (1 or 0).
4502          *
4503          * Note: this is not same as "vibrate on ring", which had been available until ICS.
4504          * It was about AudioManager's setting and thus affected all the applications which
4505          * relied on the setting, while this is purely about the vibration setting for incoming
4506          * calls.
4507          */
4508         public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
4509 
4510         /**
4511          * When {@code 1}, Telecom enhanced call blocking functionality is enabled.  When
4512          * {@code 0}, enhanced call blocking functionality is disabled.
4513          * @hide
4514          */
4515         public static final String DEBUG_ENABLE_ENHANCED_CALL_BLOCKING =
4516                 "debug.enable_enhanced_calling";
4517 
4518         /**
4519          * Whether the audible DTMF tones are played by the dialer when dialing. The value is
4520          * boolean (1 or 0).
4521          */
4522         public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
4523 
4524         /**
4525          * CDMA only settings
4526          * DTMF tone type played by the dialer when dialing.
4527          *                 0 = Normal
4528          *                 1 = Long
4529          */
4530         public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
4531 
4532         /**
4533          * Whether the hearing aid is enabled. The value is
4534          * boolean (1 or 0).
4535          * @hide
4536          */
4537         @UnsupportedAppUsage
4538         public static final String HEARING_AID = "hearing_aid";
4539 
4540         /**
4541          * CDMA only settings
4542          * TTY Mode
4543          * 0 = OFF
4544          * 1 = FULL
4545          * 2 = VCO
4546          * 3 = HCO
4547          * @hide
4548          */
4549         @UnsupportedAppUsage
4550         public static final String TTY_MODE = "tty_mode";
4551 
4552         /**
4553          * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
4554          * boolean (1 or 0).
4555          */
4556         public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
4557 
4558         /**
4559          * Whether haptic feedback (Vibrate on tap) is enabled. The value is
4560          * boolean (1 or 0).
4561          */
4562         public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
4563 
4564         /**
4565          * @deprecated Each application that shows web suggestions should have its own
4566          * setting for this.
4567          */
4568         @Deprecated
4569         public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
4570 
4571         /**
4572          * Whether the notification LED should repeatedly flash when a notification is
4573          * pending. The value is boolean (1 or 0).
4574          * @hide
4575          */
4576         @UnsupportedAppUsage
4577         public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
4578 
4579         /**
4580          * Show pointer location on screen?
4581          * 0 = no
4582          * 1 = yes
4583          * @hide
4584          */
4585         @UnsupportedAppUsage
4586         public static final String POINTER_LOCATION = "pointer_location";
4587 
4588         /**
4589          * Show touch positions on screen?
4590          * 0 = no
4591          * 1 = yes
4592          * @hide
4593          */
4594         @UnsupportedAppUsage
4595         public static final String SHOW_TOUCHES = "show_touches";
4596 
4597         /**
4598          * Log raw orientation data from
4599          * {@link com.android.server.policy.WindowOrientationListener} for use with the
4600          * orientationplot.py tool.
4601          * 0 = no
4602          * 1 = yes
4603          * @hide
4604          */
4605         public static final String WINDOW_ORIENTATION_LISTENER_LOG =
4606                 "window_orientation_listener_log";
4607 
4608         /**
4609          * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
4610          * instead
4611          * @hide
4612          */
4613         @Deprecated
4614         public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
4615 
4616         /**
4617          * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
4618          * instead
4619          * @hide
4620          */
4621         @Deprecated
4622         @UnsupportedAppUsage
4623         public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
4624 
4625         /**
4626          * Whether to play sounds when the keyguard is shown and dismissed.
4627          * @hide
4628          */
4629         @UnsupportedAppUsage
4630         public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
4631 
4632         /**
4633          * Whether the lockscreen should be completely disabled.
4634          * @hide
4635          */
4636         public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
4637 
4638         /**
4639          * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
4640          * instead
4641          * @hide
4642          */
4643         @Deprecated
4644         public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
4645 
4646         /**
4647          * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
4648          * instead
4649          * @hide
4650          */
4651         @Deprecated
4652         @UnsupportedAppUsage
4653         public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
4654 
4655         /**
4656          * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
4657          * instead
4658          * @hide
4659          */
4660         @Deprecated
4661         @UnsupportedAppUsage
4662         public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
4663 
4664         /**
4665          * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
4666          * instead
4667          * @hide
4668          */
4669         @Deprecated
4670         @UnsupportedAppUsage
4671         public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
4672 
4673         /**
4674          * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
4675          * instead
4676          * @hide
4677          */
4678         @Deprecated
4679         @UnsupportedAppUsage
4680         public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
4681 
4682         /**
4683          * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
4684          * instead
4685          * @hide
4686          */
4687         @Deprecated
4688         @UnsupportedAppUsage
4689         public static final String LOCK_SOUND = Global.LOCK_SOUND;
4690 
4691         /**
4692          * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
4693          * instead
4694          * @hide
4695          */
4696         @Deprecated
4697         @UnsupportedAppUsage
4698         public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
4699 
4700         /**
4701          * Receive incoming SIP calls?
4702          * 0 = no
4703          * 1 = yes
4704          * @hide
4705          */
4706         public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
4707 
4708         /**
4709          * Call Preference String.
4710          * "SIP_ALWAYS" : Always use SIP with network access
4711          * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
4712          * @hide
4713          */
4714         public static final String SIP_CALL_OPTIONS = "sip_call_options";
4715 
4716         /**
4717          * One of the sip call options: Always use SIP with network access.
4718          * @hide
4719          */
4720         public static final String SIP_ALWAYS = "SIP_ALWAYS";
4721 
4722         /**
4723          * One of the sip call options: Only if destination is a SIP address.
4724          * @hide
4725          */
4726         public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
4727 
4728         /**
4729          * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead.  Formerly used to indicate that
4730          * the user should be prompted each time a call is made whether it should be placed using
4731          * SIP.  The {@link com.android.providers.settings.DatabaseHelper} replaces this with
4732          * SIP_ADDRESS_ONLY.
4733          * @hide
4734          */
4735         @Deprecated
4736         public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
4737 
4738         /**
4739          * Pointer speed setting.
4740          * This is an integer value in a range between -7 and +7, so there are 15 possible values.
4741          *   -7 = slowest
4742          *    0 = default speed
4743          *   +7 = fastest
4744          * @hide
4745          */
4746         @UnsupportedAppUsage
4747         public static final String POINTER_SPEED = "pointer_speed";
4748 
4749         /**
4750          * Whether lock-to-app will be triggered by long-press on recents.
4751          * @hide
4752          */
4753         public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
4754 
4755         /**
4756          * I am the lolrus.
4757          * <p>
4758          * Nonzero values indicate that the user has a bukkit.
4759          * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
4760          * @hide
4761          */
4762         public static final String EGG_MODE = "egg_mode";
4763 
4764         /**
4765          * Setting to determine whether or not to show the battery percentage in the status bar.
4766          *    0 - Don't show percentage
4767          *    1 - Show percentage
4768          * @hide
4769          */
4770         public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent";
4771 
4772         /**
4773          * Whether or not to enable multiple audio focus.
4774          * When enabled, requires more management by user over application playback activity,
4775          * for instance pausing media apps when another starts.
4776          * @hide
4777          */
4778         public static final String MULTI_AUDIO_FOCUS_ENABLED = "multi_audio_focus_enabled";
4779 
4780         /**
4781          * IMPORTANT: If you add a new public settings you also have to add it to
4782          * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
4783          * it to PRIVATE_SETTINGS below. Also add a validator that can validate
4784          * the setting value. See an example above.
4785          */
4786 
4787         /**
4788          * Keys we no longer back up under the current schema, but want to continue to
4789          * process when restoring historical backup datasets.
4790          *
4791          * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
4792          * otherwise they won't be restored.
4793          *
4794          * @hide
4795          */
4796         public static final String[] LEGACY_RESTORE_SETTINGS = {
4797         };
4798 
4799         /**
4800          * These are all public system settings
4801          *
4802          * @hide
4803          */
4804         @UnsupportedAppUsage
4805         public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
4806         static {
4807             PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
4808             PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
4809             PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
4810             PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
4811             PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
4812             PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
4813             PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
4814             PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
4815             PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
4816             PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
4817             PUBLIC_SETTINGS.add(FONT_SCALE);
4818             PUBLIC_SETTINGS.add(SYSTEM_LOCALES);
4819             PUBLIC_SETTINGS.add(DIM_SCREEN);
4820             PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
4821             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
4822             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FLOAT);
4823             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR);
4824             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR_FLOAT);
4825             PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
4826             PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
4827             PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
4828             PUBLIC_SETTINGS.add(VIBRATE_ON);
4829             PUBLIC_SETTINGS.add(VOLUME_RING);
4830             PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
4831             PUBLIC_SETTINGS.add(VOLUME_VOICE);
4832             PUBLIC_SETTINGS.add(VOLUME_MUSIC);
4833             PUBLIC_SETTINGS.add(VOLUME_ALARM);
4834             PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
4835             PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
4836             PUBLIC_SETTINGS.add(VOLUME_ASSISTANT);
4837             PUBLIC_SETTINGS.add(RINGTONE);
4838             PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
4839             PUBLIC_SETTINGS.add(ALARM_ALERT);
4840             PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
4841             PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
4842             PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
4843             PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
4844             PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
4845             PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
4846             PUBLIC_SETTINGS.add(TIME_12_24);
4847             PUBLIC_SETTINGS.add(DATE_FORMAT);
4848             PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
4849             PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
4850             PUBLIC_SETTINGS.add(USER_ROTATION);
4851             PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
4852             PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
4853             PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
4854             PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
4855             PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING);
4856         }
4857 
4858         /**
4859          * These are all hidden system settings.
4860          *
4861          * @hide
4862          */
4863         @UnsupportedAppUsage
4864         public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
4865         static {
4866             PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
4867             PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
4868             PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
4869             PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
4870             PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
4871             PRIVATE_SETTINGS.add(VOLUME_MASTER);
4872             PRIVATE_SETTINGS.add(MASTER_MONO);
4873             PRIVATE_SETTINGS.add(MASTER_BALANCE);
4874             PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
4875             PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
4876             PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
4877             PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
4878             PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
4879             PRIVATE_SETTINGS.add(HEARING_AID);
4880             PRIVATE_SETTINGS.add(TTY_MODE);
4881             PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
4882             PRIVATE_SETTINGS.add(POINTER_LOCATION);
4883             PRIVATE_SETTINGS.add(SHOW_TOUCHES);
4884             PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
4885             PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
4886             PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
4887             PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
4888             PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
4889             PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
4890             PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
4891             PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
4892             PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
4893             PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
4894             PRIVATE_SETTINGS.add(LOCK_SOUND);
4895             PRIVATE_SETTINGS.add(UNLOCK_SOUND);
4896             PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
4897             PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
4898             PRIVATE_SETTINGS.add(SIP_ALWAYS);
4899             PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
4900             PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
4901             PRIVATE_SETTINGS.add(POINTER_SPEED);
4902             PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
4903             PRIVATE_SETTINGS.add(EGG_MODE);
4904             PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT);
4905             PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE);
4906         }
4907 
4908         /**
4909          * These entries are considered common between the personal and the managed profile,
4910          * since the managed profile doesn't get to change them.
4911          */
4912         @UnsupportedAppUsage
4913         private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
4914         static {
4915             CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
4916             CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
4917             CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
4918             CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
4919             CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
4920         }
4921 
4922         /** @hide */
getCloneToManagedProfileSettings(Set<String> outKeySet)4923         public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
4924             outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
4925         }
4926 
4927         /**
4928          * These entries should be cloned from this profile's parent only if the dependency's
4929          * value is true ("1")
4930          *
4931          * Note: the dependencies must be Secure settings
4932          *
4933          * @hide
4934          */
4935         public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>();
4936         static {
CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS)4937             CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS);
CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS)4938             CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS);
CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS)4939             CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS);
4940         }
4941 
4942         /** @hide */
getCloneFromParentOnValueSettings(Map<String, String> outMap)4943         public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) {
4944             outMap.putAll(CLONE_FROM_PARENT_ON_VALUE);
4945         }
4946 
4947         /**
4948          * System settings which can be accessed by instant apps.
4949          * @hide
4950          */
4951         public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
4952         static {
4953             INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE);
4954             INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS);
4955             INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
4956             INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD);
4957             INSTANT_APP_SETTINGS.add(DATE_FORMAT);
4958             INSTANT_APP_SETTINGS.add(FONT_SCALE);
4959             INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
4960             INSTANT_APP_SETTINGS.add(TIME_12_24);
4961             INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED);
4962             INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION);
4963         }
4964 
4965         /**
4966          * When to use Wi-Fi calling
4967          *
4968          * @see android.telephony.TelephonyManager.WifiCallingChoices
4969          * @hide
4970          */
4971         public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
4972 
4973         // Settings moved to Settings.Secure
4974 
4975         /**
4976          * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
4977          * instead
4978          */
4979         @Deprecated
4980         public static final String ADB_ENABLED = Global.ADB_ENABLED;
4981 
4982         /**
4983          * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
4984          */
4985         @Deprecated
4986         public static final String ANDROID_ID = Secure.ANDROID_ID;
4987 
4988         /**
4989          * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
4990          */
4991         @Deprecated
4992         public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
4993 
4994         /**
4995          * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
4996          */
4997         @Deprecated
4998         public static final String DATA_ROAMING = Global.DATA_ROAMING;
4999 
5000         /**
5001          * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
5002          */
5003         @Deprecated
5004         public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
5005 
5006         /**
5007          * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
5008          */
5009         @Deprecated
5010         public static final String HTTP_PROXY = Global.HTTP_PROXY;
5011 
5012         /**
5013          * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
5014          */
5015         @Deprecated
5016         public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
5017 
5018         /**
5019          * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
5020          * instead
5021          */
5022         @Deprecated
5023         public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
5024 
5025         /**
5026          * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
5027          */
5028         @Deprecated
5029         public static final String LOGGING_ID = Secure.LOGGING_ID;
5030 
5031         /**
5032          * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
5033          */
5034         @Deprecated
5035         public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
5036 
5037         /**
5038          * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
5039          * instead
5040          */
5041         @Deprecated
5042         public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
5043 
5044         /**
5045          * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
5046          * instead
5047          */
5048         @Deprecated
5049         public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
5050 
5051         /**
5052          * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
5053          * instead
5054          */
5055         @Deprecated
5056         public static final String PARENTAL_CONTROL_REDIRECT_URL =
5057             Secure.PARENTAL_CONTROL_REDIRECT_URL;
5058 
5059         /**
5060          * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
5061          */
5062         @Deprecated
5063         public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
5064 
5065         /**
5066          * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
5067          */
5068         @Deprecated
5069         public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
5070 
5071         /**
5072          * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
5073          */
5074         @Deprecated
5075         public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
5076 
5077        /**
5078          * @deprecated Use
5079          * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
5080          */
5081         @Deprecated
5082         public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
5083 
5084         /**
5085          * @deprecated Use
5086          * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
5087          */
5088         @Deprecated
5089         public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
5090                 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
5091 
5092         /**
5093          * @deprecated Use
5094          * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
5095          */
5096         @Deprecated
5097         public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
5098                 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
5099 
5100         /**
5101          * @deprecated Use
5102          * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
5103          */
5104         @Deprecated
5105         public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
5106                 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
5107 
5108         /**
5109          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
5110          * instead
5111          */
5112         @Deprecated
5113         public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
5114 
5115         /**
5116          * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
5117          */
5118         @Deprecated
5119         public static final String WIFI_ON = Global.WIFI_ON;
5120 
5121         /**
5122          * @deprecated Use
5123          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
5124          * instead
5125          */
5126         @Deprecated
5127         public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
5128                 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
5129 
5130         /**
5131          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
5132          */
5133         @Deprecated
5134         public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
5135 
5136         /**
5137          * @deprecated Use
5138          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
5139          */
5140         @Deprecated
5141         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
5142                 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
5143 
5144         /**
5145          * @deprecated Use
5146          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
5147          */
5148         @Deprecated
5149         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
5150                 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
5151 
5152         /**
5153          * @deprecated Use
5154          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
5155          * instead
5156          */
5157         @Deprecated
5158         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
5159                 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
5160 
5161         /**
5162          * @deprecated Use
5163          * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
5164          */
5165         @Deprecated
5166         public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
5167             Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
5168 
5169         /**
5170          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
5171          * instead
5172          */
5173         @Deprecated
5174         public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
5175 
5176         /**
5177          * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
5178          */
5179         @Deprecated
5180         public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
5181 
5182         /**
5183          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
5184          */
5185         @Deprecated
5186         public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
5187 
5188         /**
5189          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
5190          * instead
5191          */
5192         @Deprecated
5193         public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
5194 
5195         /**
5196          * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
5197          * instead
5198          */
5199         @Deprecated
5200         public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
5201             Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
5202 
5203         /**
5204          * Checks if the specified app can modify system settings. As of API
5205          * level 23, an app cannot modify system settings unless it declares the
5206          * {@link android.Manifest.permission#WRITE_SETTINGS}
5207          * permission in its manifest, <em>and</em> the user specifically grants
5208          * the app this capability. To prompt the user to grant this approval,
5209          * the app must send an intent with the action {@link
5210          * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes
5211          * the system to display a permission management screen.
5212          *
5213          * @param context App context.
5214          * @return true if the calling app can write to system settings, false otherwise
5215          */
canWrite(Context context)5216         public static boolean canWrite(Context context) {
5217             return isCallingPackageAllowedToWriteSettings(context, Process.myUid(),
5218                     context.getOpPackageName(), false);
5219         }
5220     }
5221 
5222     /**
5223      * Secure system settings, containing system preferences that applications
5224      * can read but are not allowed to write.  These are for preferences that
5225      * the user must explicitly modify through the UI of a system app. Normal
5226      * applications cannot modify the secure settings database, either directly
5227      * or by calling the "put" methods that this class contains.
5228      */
5229     public static final class Secure extends NameValueTable {
5230         // NOTE: If you add new settings here, be sure to add them to
5231         // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked.
5232 
5233         /**
5234          * The content:// style URL for this table
5235          */
5236         public static final Uri CONTENT_URI =
5237             Uri.parse("content://" + AUTHORITY + "/secure");
5238 
5239         @UnsupportedAppUsage
5240         private static final ContentProviderHolder sProviderHolder =
5241                 new ContentProviderHolder(CONTENT_URI);
5242 
5243         // Populated lazily, guarded by class object:
5244         @UnsupportedAppUsage
5245         private static final NameValueCache sNameValueCache = new NameValueCache(
5246                 CONTENT_URI,
5247                 CALL_METHOD_GET_SECURE,
5248                 CALL_METHOD_PUT_SECURE,
5249                 sProviderHolder);
5250 
5251         private static ILockSettings sLockSettings = null;
5252 
5253         private static boolean sIsSystemProcess;
5254         @UnsupportedAppUsage
5255         private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
5256         @UnsupportedAppUsage
5257         private static final HashSet<String> MOVED_TO_GLOBAL;
5258         static {
5259             MOVED_TO_LOCK_SETTINGS = new HashSet<>(3);
5260             MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
5261             MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
5262             MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
5263 
5264             MOVED_TO_GLOBAL = new HashSet<>();
5265             MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
5266             MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
5267             MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
5268             MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
5269             MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
5270             MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
5271             MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
5272             MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
5273             MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
5274             MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
5275             MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
5276             MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
5277             MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
5278             MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
5279             MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
5280             MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
5281             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
5282             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
5283             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
5284             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
5285             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
5286             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
5287             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
5288             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
5289             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
5290             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
5291             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
5292             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
5293             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
5294             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
5295             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
5296             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
5297             MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
5298             MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
5299             MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
5300             MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
5301             MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
5302             MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
5303             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
5304             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
5305             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
5306             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
5307             MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
5308             MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
5309             MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
5310             MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
5311             MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
5312             MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
5313             MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
5314             MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
5315             MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
5316             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
5317             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
5318             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
5319             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
5320             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
5321             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
5322             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
5323             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
5324             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
5325             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
5326             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
5327             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
5328             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED);
5329             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
5330             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
5331             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
5332             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
5333             MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_PENDING_FACTORY_RESET);
5334             MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
5335             MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
5336             MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
5337             MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
5338             MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
5339             MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
5340             MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
5341             MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
5342             MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
5343             MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
5344             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
5345             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
5346             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
5347             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
5348             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
5349             MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
5350             MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
5351             MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
5352             MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
5353             MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
5354             MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
5355             MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
5356             MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
5357             MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
5358             MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
5359             MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
5360             MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
5361             MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
5362             MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
5363             MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
5364             MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
5365             MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
5366             MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
5367             MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
5368             MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
5369             MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
5370             MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
5371             MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
5372             MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
5373             MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
5374         }
5375 
5376         /** @hide */
getMovedToGlobalSettings(Set<String> outKeySet)5377         public static void getMovedToGlobalSettings(Set<String> outKeySet) {
5378             outKeySet.addAll(MOVED_TO_GLOBAL);
5379         }
5380 
5381         /** @hide */
clearProviderForTest()5382         public static void clearProviderForTest() {
5383             sProviderHolder.clearProviderForTest();
5384             sNameValueCache.clearGenerationTrackerForTest();
5385         }
5386 
5387         /**
5388          * Look up a name in the database.
5389          * @param resolver to access the database with
5390          * @param name to look up in the table
5391          * @return the corresponding value, or null if not present
5392          */
getString(ContentResolver resolver, String name)5393         public static String getString(ContentResolver resolver, String name) {
5394             return getStringForUser(resolver, name, resolver.getUserId());
5395         }
5396 
5397         /** @hide */
5398         @UnsupportedAppUsage
getStringForUser(ContentResolver resolver, String name, int userHandle)5399         public static String getStringForUser(ContentResolver resolver, String name,
5400                 int userHandle) {
5401             if (MOVED_TO_GLOBAL.contains(name)) {
5402                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
5403                         + " to android.provider.Settings.Global.");
5404                 return Global.getStringForUser(resolver, name, userHandle);
5405             }
5406 
5407             if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
5408                 synchronized (Secure.class) {
5409                     if (sLockSettings == null) {
5410                         sLockSettings = ILockSettings.Stub.asInterface(
5411                                 (IBinder) ServiceManager.getService("lock_settings"));
5412                         sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
5413                     }
5414                 }
5415                 if (sLockSettings != null && !sIsSystemProcess) {
5416                     // No context; use the ActivityThread's context as an approximation for
5417                     // determining the target API level.
5418                     Application application = ActivityThread.currentApplication();
5419 
5420                     boolean isPreMnc = application != null
5421                             && application.getApplicationInfo() != null
5422                             && application.getApplicationInfo().targetSdkVersion
5423                             <= VERSION_CODES.LOLLIPOP_MR1;
5424                     if (isPreMnc) {
5425                         try {
5426                             return sLockSettings.getString(name, "0", userHandle);
5427                         } catch (RemoteException re) {
5428                             // Fall through
5429                         }
5430                     } else {
5431                         throw new SecurityException("Settings.Secure." + name
5432                                 + " is deprecated and no longer accessible."
5433                                 + " See API documentation for potential replacements.");
5434                     }
5435                 }
5436             }
5437 
5438             return sNameValueCache.getStringForUser(resolver, name, userHandle);
5439         }
5440 
5441         /**
5442          * Store a name/value pair into the database. Values written by this method will be
5443          * overridden if a restore happens in the future.
5444          *
5445          * @param resolver to access the database with
5446          * @param name to store
5447          * @param value to associate with the name
5448          * @return true if the value was set, false on database errors
5449          *
5450          * @hide
5451          */
5452         @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE)
putString(ContentResolver resolver, String name, String value, boolean overrideableByRestore)5453         public static boolean putString(ContentResolver resolver, String name,
5454                 String value, boolean overrideableByRestore) {
5455             return putStringForUser(resolver, name, value, /* tag */ null, /* makeDefault */ false,
5456                     resolver.getUserId(), overrideableByRestore);
5457         }
5458 
5459         /**
5460          * Store a name/value pair into the database.
5461          * @param resolver to access the database with
5462          * @param name to store
5463          * @param value to associate with the name
5464          * @return true if the value was set, false on database errors
5465          */
putString(ContentResolver resolver, String name, String value)5466         public static boolean putString(ContentResolver resolver, String name, String value) {
5467             return putStringForUser(resolver, name, value, resolver.getUserId());
5468         }
5469 
5470         /** @hide */
5471         @UnsupportedAppUsage
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)5472         public static boolean putStringForUser(ContentResolver resolver, String name, String value,
5473                 int userHandle) {
5474             return putStringForUser(resolver, name, value, null, false, userHandle,
5475                     DEFAULT_OVERRIDEABLE_BY_RESTORE);
5476         }
5477 
5478         /** @hide */
5479         @UnsupportedAppUsage
putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore)5480         public static boolean putStringForUser(@NonNull ContentResolver resolver,
5481                 @NonNull String name, @Nullable String value, @Nullable String tag,
5482                 boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore) {
5483             if (MOVED_TO_GLOBAL.contains(name)) {
5484                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
5485                         + " to android.provider.Settings.Global");
5486                 return Global.putStringForUser(resolver, name, value,
5487                         tag, makeDefault, userHandle, DEFAULT_OVERRIDEABLE_BY_RESTORE);
5488             }
5489             return sNameValueCache.putStringForUser(resolver, name, value, tag,
5490                     makeDefault, userHandle, overrideableByRestore);
5491         }
5492 
5493         /**
5494          * Store a name/value pair into the database.
5495          * <p>
5496          * The method takes an optional tag to associate with the setting
5497          * which can be used to clear only settings made by your package and
5498          * associated with this tag by passing the tag to {@link
5499          * #resetToDefaults(ContentResolver, String)}. Anyone can override
5500          * the current tag. Also if another package changes the setting
5501          * then the tag will be set to the one specified in the set call
5502          * which can be null. Also any of the settings setters that do not
5503          * take a tag as an argument effectively clears the tag.
5504          * </p><p>
5505          * For example, if you set settings A and B with tags T1 and T2 and
5506          * another app changes setting A (potentially to the same value), it
5507          * can assign to it a tag T3 (note that now the package that changed
5508          * the setting is not yours). Now if you reset your changes for T1 and
5509          * T2 only setting B will be reset and A not (as it was changed by
5510          * another package) but since A did not change you are in the desired
5511          * initial state. Now if the other app changes the value of A (assuming
5512          * you registered an observer in the beginning) you would detect that
5513          * the setting was changed by another app and handle this appropriately
5514          * (ignore, set back to some value, etc).
5515          * </p><p>
5516          * Also the method takes an argument whether to make the value the
5517          * default for this setting. If the system already specified a default
5518          * value, then the one passed in here will <strong>not</strong>
5519          * be set as the default.
5520          * </p>
5521          *
5522          * @param resolver to access the database with.
5523          * @param name to store.
5524          * @param value to associate with the name.
5525          * @param tag to associate with the setting.
5526          * @param makeDefault whether to make the value the default one.
5527          * @return true if the value was set, false on database errors.
5528          *
5529          * @see #resetToDefaults(ContentResolver, String)
5530          *
5531          * @hide
5532          */
5533         @SystemApi
5534         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)5535         public static boolean putString(@NonNull ContentResolver resolver,
5536                 @NonNull String name, @Nullable String value, @Nullable String tag,
5537                 boolean makeDefault) {
5538             return putStringForUser(resolver, name, value, tag, makeDefault,
5539                     resolver.getUserId(), DEFAULT_OVERRIDEABLE_BY_RESTORE);
5540         }
5541 
5542         /**
5543          * Reset the settings to their defaults. This would reset <strong>only</strong>
5544          * settings set by the caller's package. Think of it of a way to undo your own
5545          * changes to the global settings. Passing in the optional tag will reset only
5546          * settings changed by your package and associated with this tag.
5547          *
5548          * @param resolver Handle to the content resolver.
5549          * @param tag Optional tag which should be associated with the settings to reset.
5550          *
5551          * @see #putString(ContentResolver, String, String, String, boolean)
5552          *
5553          * @hide
5554          */
5555         @SystemApi
5556         @TestApi
5557         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)5558         public static void resetToDefaults(@NonNull ContentResolver resolver,
5559                 @Nullable String tag) {
5560             resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
5561                     resolver.getUserId());
5562         }
5563 
5564         /**
5565          *
5566          * Reset the settings to their defaults for a given user with a specific mode. The
5567          * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
5568          * allowing resetting the settings made by a package and associated with the tag.
5569          *
5570          * @param resolver Handle to the content resolver.
5571          * @param tag Optional tag which should be associated with the settings to reset.
5572          * @param mode The reset mode.
5573          * @param userHandle The user for which to reset to defaults.
5574          *
5575          * @see #RESET_MODE_PACKAGE_DEFAULTS
5576          * @see #RESET_MODE_UNTRUSTED_DEFAULTS
5577          * @see #RESET_MODE_UNTRUSTED_CHANGES
5578          * @see #RESET_MODE_TRUSTED_DEFAULTS
5579          *
5580          * @hide
5581          */
resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)5582         public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
5583                 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
5584             try {
5585                 Bundle arg = new Bundle();
5586                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
5587                 if (tag != null) {
5588                     arg.putString(CALL_METHOD_TAG_KEY, tag);
5589                 }
5590                 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
5591                 IContentProvider cp = sProviderHolder.getProvider(resolver);
5592                 cp.call(resolver.getPackageName(), resolver.getAttributionTag(),
5593                         sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_SECURE, null, arg);
5594             } catch (RemoteException e) {
5595                 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
5596             }
5597         }
5598 
5599         /**
5600          * Construct the content URI for a particular name/value pair,
5601          * useful for monitoring changes with a ContentObserver.
5602          * @param name to look up in the table
5603          * @return the corresponding content URI, or null if not present
5604          */
getUriFor(String name)5605         public static Uri getUriFor(String name) {
5606             if (MOVED_TO_GLOBAL.contains(name)) {
5607                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
5608                         + " to android.provider.Settings.Global, returning global URI.");
5609                 return Global.getUriFor(Global.CONTENT_URI, name);
5610             }
5611             return getUriFor(CONTENT_URI, name);
5612         }
5613 
5614         /**
5615          * Convenience function for retrieving a single secure settings value
5616          * as an integer.  Note that internally setting values are always
5617          * stored as strings; this function converts the string to an integer
5618          * for you.  The default value will be returned if the setting is
5619          * not defined or not an integer.
5620          *
5621          * @param cr The ContentResolver to access.
5622          * @param name The name of the setting to retrieve.
5623          * @param def Value to return if the setting is not defined.
5624          *
5625          * @return The setting's current value, or 'def' if it is not defined
5626          * or not a valid integer.
5627          */
getInt(ContentResolver cr, String name, int def)5628         public static int getInt(ContentResolver cr, String name, int def) {
5629             return getIntForUser(cr, name, def, cr.getUserId());
5630         }
5631 
5632         /** @hide */
5633         @UnsupportedAppUsage
getIntForUser(ContentResolver cr, String name, int def, int userHandle)5634         public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
5635             String v = getStringForUser(cr, name, userHandle);
5636             try {
5637                 return v != null ? Integer.parseInt(v) : def;
5638             } catch (NumberFormatException e) {
5639                 return def;
5640             }
5641         }
5642 
5643         /**
5644          * Convenience function for retrieving a single secure settings value
5645          * as an integer.  Note that internally setting values are always
5646          * stored as strings; this function converts the string to an integer
5647          * for you.
5648          * <p>
5649          * This version does not take a default value.  If the setting has not
5650          * been set, or the string value is not a number,
5651          * it throws {@link SettingNotFoundException}.
5652          *
5653          * @param cr The ContentResolver to access.
5654          * @param name The name of the setting to retrieve.
5655          *
5656          * @throws SettingNotFoundException Thrown if a setting by the given
5657          * name can't be found or the setting value is not an integer.
5658          *
5659          * @return The setting's current value.
5660          */
getInt(ContentResolver cr, String name)5661         public static int getInt(ContentResolver cr, String name)
5662                 throws SettingNotFoundException {
5663             return getIntForUser(cr, name, cr.getUserId());
5664         }
5665 
5666         /** @hide */
getIntForUser(ContentResolver cr, String name, int userHandle)5667         public static int getIntForUser(ContentResolver cr, String name, int userHandle)
5668                 throws SettingNotFoundException {
5669             String v = getStringForUser(cr, name, userHandle);
5670             try {
5671                 return Integer.parseInt(v);
5672             } catch (NumberFormatException e) {
5673                 throw new SettingNotFoundException(name);
5674             }
5675         }
5676 
5677         /**
5678          * Convenience function for updating a single settings value as an
5679          * integer. This will either create a new entry in the table if the
5680          * given name does not exist, or modify the value of the existing row
5681          * with that name.  Note that internally setting values are always
5682          * stored as strings, so this function converts the given value to a
5683          * string before storing it.
5684          *
5685          * @param cr The ContentResolver to access.
5686          * @param name The name of the setting to modify.
5687          * @param value The new value for the setting.
5688          * @return true if the value was set, false on database errors
5689          */
putInt(ContentResolver cr, String name, int value)5690         public static boolean putInt(ContentResolver cr, String name, int value) {
5691             return putIntForUser(cr, name, value, cr.getUserId());
5692         }
5693 
5694         /** @hide */
5695         @UnsupportedAppUsage
putIntForUser(ContentResolver cr, String name, int value, int userHandle)5696         public static boolean putIntForUser(ContentResolver cr, String name, int value,
5697                 int userHandle) {
5698             return putStringForUser(cr, name, Integer.toString(value), userHandle);
5699         }
5700 
5701         /**
5702          * Convenience function for retrieving a single secure settings value
5703          * as a {@code long}.  Note that internally setting values are always
5704          * stored as strings; this function converts the string to a {@code long}
5705          * for you.  The default value will be returned if the setting is
5706          * not defined or not a {@code long}.
5707          *
5708          * @param cr The ContentResolver to access.
5709          * @param name The name of the setting to retrieve.
5710          * @param def Value to return if the setting is not defined.
5711          *
5712          * @return The setting's current value, or 'def' if it is not defined
5713          * or not a valid {@code long}.
5714          */
getLong(ContentResolver cr, String name, long def)5715         public static long getLong(ContentResolver cr, String name, long def) {
5716             return getLongForUser(cr, name, def, cr.getUserId());
5717         }
5718 
5719         /** @hide */
5720         @UnsupportedAppUsage
getLongForUser(ContentResolver cr, String name, long def, int userHandle)5721         public static long getLongForUser(ContentResolver cr, String name, long def,
5722                 int userHandle) {
5723             String valString = getStringForUser(cr, name, userHandle);
5724             long value;
5725             try {
5726                 value = valString != null ? Long.parseLong(valString) : def;
5727             } catch (NumberFormatException e) {
5728                 value = def;
5729             }
5730             return value;
5731         }
5732 
5733         /**
5734          * Convenience function for retrieving a single secure settings value
5735          * as a {@code long}.  Note that internally setting values are always
5736          * stored as strings; this function converts the string to a {@code long}
5737          * for you.
5738          * <p>
5739          * This version does not take a default value.  If the setting has not
5740          * been set, or the string value is not a number,
5741          * it throws {@link SettingNotFoundException}.
5742          *
5743          * @param cr The ContentResolver to access.
5744          * @param name The name of the setting to retrieve.
5745          *
5746          * @return The setting's current value.
5747          * @throws SettingNotFoundException Thrown if a setting by the given
5748          * name can't be found or the setting value is not an integer.
5749          */
getLong(ContentResolver cr, String name)5750         public static long getLong(ContentResolver cr, String name)
5751                 throws SettingNotFoundException {
5752             return getLongForUser(cr, name, cr.getUserId());
5753         }
5754 
5755         /** @hide */
getLongForUser(ContentResolver cr, String name, int userHandle)5756         public static long getLongForUser(ContentResolver cr, String name, int userHandle)
5757                 throws SettingNotFoundException {
5758             String valString = getStringForUser(cr, name, userHandle);
5759             try {
5760                 return Long.parseLong(valString);
5761             } catch (NumberFormatException e) {
5762                 throw new SettingNotFoundException(name);
5763             }
5764         }
5765 
5766         /**
5767          * Convenience function for updating a secure settings value as a long
5768          * integer. This will either create a new entry in the table if the
5769          * given name does not exist, or modify the value of the existing row
5770          * with that name.  Note that internally setting values are always
5771          * stored as strings, so this function converts the given value to a
5772          * string before storing it.
5773          *
5774          * @param cr The ContentResolver to access.
5775          * @param name The name of the setting to modify.
5776          * @param value The new value for the setting.
5777          * @return true if the value was set, false on database errors
5778          */
putLong(ContentResolver cr, String name, long value)5779         public static boolean putLong(ContentResolver cr, String name, long value) {
5780             return putLongForUser(cr, name, value, cr.getUserId());
5781         }
5782 
5783         /** @hide */
5784         @UnsupportedAppUsage
putLongForUser(ContentResolver cr, String name, long value, int userHandle)5785         public static boolean putLongForUser(ContentResolver cr, String name, long value,
5786                 int userHandle) {
5787             return putStringForUser(cr, name, Long.toString(value), userHandle);
5788         }
5789 
5790         /**
5791          * Convenience function for retrieving a single secure settings value
5792          * as a floating point number.  Note that internally setting values are
5793          * always stored as strings; this function converts the string to an
5794          * float for you. The default value will be returned if the setting
5795          * is not defined or not a valid float.
5796          *
5797          * @param cr The ContentResolver to access.
5798          * @param name The name of the setting to retrieve.
5799          * @param def Value to return if the setting is not defined.
5800          *
5801          * @return The setting's current value, or 'def' if it is not defined
5802          * or not a valid float.
5803          */
getFloat(ContentResolver cr, String name, float def)5804         public static float getFloat(ContentResolver cr, String name, float def) {
5805             return getFloatForUser(cr, name, def, cr.getUserId());
5806         }
5807 
5808         /** @hide */
getFloatForUser(ContentResolver cr, String name, float def, int userHandle)5809         public static float getFloatForUser(ContentResolver cr, String name, float def,
5810                 int userHandle) {
5811             String v = getStringForUser(cr, name, userHandle);
5812             try {
5813                 return v != null ? Float.parseFloat(v) : def;
5814             } catch (NumberFormatException e) {
5815                 return def;
5816             }
5817         }
5818 
5819         /**
5820          * Convenience function for retrieving a single secure settings value
5821          * as a float.  Note that internally setting values are always
5822          * stored as strings; this function converts the string to a float
5823          * for you.
5824          * <p>
5825          * This version does not take a default value.  If the setting has not
5826          * been set, or the string value is not a number,
5827          * it throws {@link SettingNotFoundException}.
5828          *
5829          * @param cr The ContentResolver to access.
5830          * @param name The name of the setting to retrieve.
5831          *
5832          * @throws SettingNotFoundException Thrown if a setting by the given
5833          * name can't be found or the setting value is not a float.
5834          *
5835          * @return The setting's current value.
5836          */
getFloat(ContentResolver cr, String name)5837         public static float getFloat(ContentResolver cr, String name)
5838                 throws SettingNotFoundException {
5839             return getFloatForUser(cr, name, cr.getUserId());
5840         }
5841 
5842         /** @hide */
getFloatForUser(ContentResolver cr, String name, int userHandle)5843         public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
5844                 throws SettingNotFoundException {
5845             String v = getStringForUser(cr, name, userHandle);
5846             if (v == null) {
5847                 throw new SettingNotFoundException(name);
5848             }
5849             try {
5850                 return Float.parseFloat(v);
5851             } catch (NumberFormatException e) {
5852                 throw new SettingNotFoundException(name);
5853             }
5854         }
5855 
5856         /**
5857          * Convenience function for updating a single settings value as a
5858          * floating point number. This will either create a new entry in the
5859          * table if the given name does not exist, or modify the value of the
5860          * existing row with that name.  Note that internally setting values
5861          * are always stored as strings, so this function converts the given
5862          * value to a string before storing it.
5863          *
5864          * @param cr The ContentResolver to access.
5865          * @param name The name of the setting to modify.
5866          * @param value The new value for the setting.
5867          * @return true if the value was set, false on database errors
5868          */
putFloat(ContentResolver cr, String name, float value)5869         public static boolean putFloat(ContentResolver cr, String name, float value) {
5870             return putFloatForUser(cr, name, value, cr.getUserId());
5871         }
5872 
5873         /** @hide */
putFloatForUser(ContentResolver cr, String name, float value, int userHandle)5874         public static boolean putFloatForUser(ContentResolver cr, String name, float value,
5875                 int userHandle) {
5876             return putStringForUser(cr, name, Float.toString(value), userHandle);
5877         }
5878 
5879         /**
5880          * Control whether to enable adaptive sleep mode.
5881          * @hide
5882          */
5883         public static final String ADAPTIVE_SLEEP = "adaptive_sleep";
5884 
5885         /**
5886          * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
5887          * instead
5888          */
5889         @Deprecated
5890         public static final String DEVELOPMENT_SETTINGS_ENABLED =
5891                 Global.DEVELOPMENT_SETTINGS_ENABLED;
5892 
5893         /**
5894          * When the user has enable the option to have a "bug report" command
5895          * in the power menu.
5896          * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
5897          * @hide
5898          */
5899         @Deprecated
5900         public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5901 
5902         /**
5903          * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
5904          */
5905         @Deprecated
5906         public static final String ADB_ENABLED = Global.ADB_ENABLED;
5907 
5908         /**
5909          * Setting to allow mock locations and location provider status to be injected into the
5910          * LocationManager service for testing purposes during application development.  These
5911          * locations and status values  override actual location and status information generated
5912          * by network, gps, or other location providers.
5913          *
5914          * @deprecated This settings is not used anymore.
5915          */
5916         @Deprecated
5917         public static final String ALLOW_MOCK_LOCATION = "mock_location";
5918 
5919         /**
5920          * Setting to indicate that on device captions are enabled.
5921          *
5922          * @hide
5923          */
5924         @SystemApi
5925         public static final String ODI_CAPTIONS_ENABLED = "odi_captions_enabled";
5926 
5927         /**
5928          * On Android 8.0 (API level 26) and higher versions of the platform,
5929          * a 64-bit number (expressed as a hexadecimal string), unique to
5930          * each combination of app-signing key, user, and device.
5931          * Values of {@code ANDROID_ID} are scoped by signing key and user.
5932          * The value may change if a factory reset is performed on the
5933          * device or if an APK signing key changes.
5934          *
5935          * For more information about how the platform handles {@code ANDROID_ID}
5936          * in Android 8.0 (API level 26) and higher, see <a
5937          * href="{@docRoot}about/versions/oreo/android-8.0-changes.html#privacy-all">
5938          * Android 8.0 Behavior Changes</a>.
5939          *
5940          * <p class="note"><strong>Note:</strong> For apps that were installed
5941          * prior to updating the device to a version of Android 8.0
5942          * (API level 26) or higher, the value of {@code ANDROID_ID} changes
5943          * if the app is uninstalled and then reinstalled after the OTA.
5944          * To preserve values across uninstalls after an OTA to Android 8.0
5945          * or higher, developers can use
5946          * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html">
5947          * Key/Value Backup</a>.</p>
5948          *
5949          * <p>In versions of the platform lower than Android 8.0 (API level 26),
5950          * a 64-bit number (expressed as a hexadecimal string) that is randomly
5951          * generated when the user first sets up the device and should remain
5952          * constant for the lifetime of the user's device.
5953          *
5954          * On devices that have
5955          * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">
5956          * multiple users</a>, each user appears as a
5957          * completely separate device, so the {@code ANDROID_ID} value is
5958          * unique to each user.</p>
5959          *
5960          * <p class="note"><strong>Note:</strong> If the caller is an Instant App the ID is scoped
5961          * to the Instant App, it is generated when the Instant App is first installed and reset if
5962          * the user clears the Instant App.
5963          */
5964         public static final String ANDROID_ID = "android_id";
5965 
5966         /**
5967          * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
5968          */
5969         @Deprecated
5970         public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
5971 
5972         /**
5973          * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
5974          */
5975         @Deprecated
5976         public static final String DATA_ROAMING = Global.DATA_ROAMING;
5977 
5978         /**
5979          * Setting to record the input method used by default, holding the ID
5980          * of the desired method.
5981          */
5982         public static final String DEFAULT_INPUT_METHOD = "default_input_method";
5983 
5984         /**
5985          * Setting to record the input method subtype used by default, holding the ID
5986          * of the desired method.
5987          */
5988         public static final String SELECTED_INPUT_METHOD_SUBTYPE =
5989                 "selected_input_method_subtype";
5990 
5991         /**
5992          * Setting to record the history of input method subtype, holding the pair of ID of IME
5993          * and its last used subtype.
5994          * @hide
5995          */
5996         public static final String INPUT_METHODS_SUBTYPE_HISTORY =
5997                 "input_methods_subtype_history";
5998 
5999         /**
6000          * Setting to record the visibility of input method selector
6001          */
6002         public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
6003                 "input_method_selector_visibility";
6004 
6005         /**
6006          * The currently selected voice interaction service flattened ComponentName.
6007          * @hide
6008          */
6009         @TestApi
6010         public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
6011 
6012         /**
6013          * The currently selected autofill service flattened ComponentName.
6014          * @hide
6015          */
6016         @TestApi
6017         public static final String AUTOFILL_SERVICE = "autofill_service";
6018 
6019         /**
6020          * Boolean indicating if Autofill supports field classification.
6021          *
6022          * @see android.service.autofill.AutofillService
6023          *
6024          * @hide
6025          */
6026         @SystemApi
6027         @TestApi
6028         public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION =
6029                 "autofill_field_classification";
6030 
6031         /**
6032          * Boolean indicating if the dark mode dialog shown on first toggle has been seen.
6033          *
6034          * @hide
6035          */
6036         public static final String DARK_MODE_DIALOG_SEEN =
6037                 "dark_mode_dialog_seen";
6038 
6039         /**
6040          * Custom time when Dark theme is scheduled to activate.
6041          * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
6042          * @hide
6043          */
6044         public static final String DARK_THEME_CUSTOM_START_TIME =
6045                 "dark_theme_custom_start_time";
6046 
6047         /**
6048          * Custom time when Dark theme is scheduled to deactivate.
6049          * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
6050          * @hide
6051          */
6052         public static final String DARK_THEME_CUSTOM_END_TIME =
6053                 "dark_theme_custom_end_time";
6054 
6055         /**
6056          * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}.
6057          *
6058          * @hide
6059          */
6060         @SystemApi
6061         @TestApi
6062         public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE =
6063                 "autofill_user_data_max_user_data_size";
6064 
6065         /**
6066          * Defines value returned by
6067          * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}.
6068          *
6069          * @hide
6070          */
6071         @SystemApi
6072         @TestApi
6073         public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE =
6074                 "autofill_user_data_max_field_classification_size";
6075 
6076         /**
6077          * Defines value returned by
6078          * {@link android.service.autofill.UserData#getMaxCategoryCount()}.
6079          *
6080          * @hide
6081          */
6082         @SystemApi
6083         @TestApi
6084         public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT =
6085                 "autofill_user_data_max_category_count";
6086 
6087         /**
6088          * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}.
6089          *
6090          * @hide
6091          */
6092         @SystemApi
6093         @TestApi
6094         public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH =
6095                 "autofill_user_data_max_value_length";
6096 
6097         /**
6098          * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}.
6099          *
6100          * @hide
6101          */
6102         @SystemApi
6103         @TestApi
6104         public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH =
6105                 "autofill_user_data_min_value_length";
6106 
6107         /**
6108          * Defines whether Content Capture is enabled for the user.
6109          *
6110          * <p>Type: {@code int} ({@code 0} for disabled, {@code 1} for enabled).
6111          * <p>Default: enabled
6112          *
6113          * @hide
6114          */
6115         @TestApi
6116         public static final String CONTENT_CAPTURE_ENABLED = "content_capture_enabled";
6117 
6118         /**
6119          * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
6120          */
6121         @Deprecated
6122         public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
6123 
6124         /**
6125          * Indicates whether a DPC has been downloaded during provisioning.
6126          *
6127          * <p>Type: int (0 for false, 1 for true)
6128          *
6129          * <p>If this is true, then any attempts to begin setup again should result in factory reset
6130          *
6131          * @hide
6132          */
6133         public static final String MANAGED_PROVISIONING_DPC_DOWNLOADED =
6134                 "managed_provisioning_dpc_downloaded";
6135 
6136         /**
6137          * Indicates whether the device is under restricted secure FRP mode.
6138          * Secure FRP mode is enabled when the device is under FRP. On solving of FRP challenge,
6139          * device is removed from this mode.
6140          * <p>
6141          * Type: int (0 for false, 1 for true)
6142          */
6143         public static final String SECURE_FRP_MODE = "secure_frp_mode";
6144 
6145         /**
6146          * Indicates whether the current user has completed setup via the setup wizard.
6147          * <p>
6148          * Type: int (0 for false, 1 for true)
6149          *
6150          * @hide
6151          */
6152         @SystemApi
6153         @TestApi
6154         public static final String USER_SETUP_COMPLETE = "user_setup_complete";
6155 
6156         /**
6157          * Indicates that the user has not started setup personalization.
6158          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
6159          *
6160          * @hide
6161          */
6162         @SystemApi
6163         public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0;
6164 
6165         /**
6166          * Indicates that the user has not yet completed setup personalization.
6167          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
6168          *
6169          * @hide
6170          */
6171         @SystemApi
6172         public static final int USER_SETUP_PERSONALIZATION_STARTED = 1;
6173 
6174         /**
6175          * Indicates that the user has snoozed personalization and will complete it later.
6176          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
6177          *
6178          * @hide
6179          */
6180         @SystemApi
6181         public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2;
6182 
6183         /**
6184          * Indicates that the user has completed setup personalization.
6185          * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
6186          *
6187          * @hide
6188          */
6189         @SystemApi
6190         public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10;
6191 
6192         /** @hide */
6193         @Retention(RetentionPolicy.SOURCE)
6194         @IntDef({
6195                 USER_SETUP_PERSONALIZATION_NOT_STARTED,
6196                 USER_SETUP_PERSONALIZATION_STARTED,
6197                 USER_SETUP_PERSONALIZATION_PAUSED,
6198                 USER_SETUP_PERSONALIZATION_COMPLETE
6199         })
6200         public @interface UserSetupPersonalization {}
6201 
6202         /**
6203          * Defines the user's current state of device personalization.
6204          * The possible states are defined in {@link UserSetupPersonalization}.
6205          *
6206          * @hide
6207          */
6208         @SystemApi
6209         public static final String USER_SETUP_PERSONALIZATION_STATE =
6210                 "user_setup_personalization_state";
6211 
6212         /**
6213          * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
6214          * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0
6215          * in case SetupWizard has been re-enabled on TV devices.
6216          *
6217          * @hide
6218          */
6219         public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete";
6220 
6221         /**
6222          * The prefix for a category name that indicates whether a suggested action from that
6223          * category was marked as completed.
6224          * <p>
6225          * Type: int (0 for false, 1 for true)
6226          *
6227          * @hide
6228          */
6229         @SystemApi
6230         public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
6231 
6232         /**
6233          * List of input methods that are currently enabled.  This is a string
6234          * containing the IDs of all enabled input methods, each ID separated
6235          * by ':'.
6236          *
6237          * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0"
6238          * where imeId is ComponentName and subtype is int32.
6239          */
6240         public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
6241 
6242         /**
6243          * List of system input methods that are currently disabled.  This is a string
6244          * containing the IDs of all disabled input methods, each ID separated
6245          * by ':'.
6246          * @hide
6247          */
6248         public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
6249 
6250         /**
6251          * Whether to show the IME when a hard keyboard is connected. This is a boolean that
6252          * determines if the IME should be shown when a hard keyboard is attached.
6253          * @hide
6254          */
6255         @TestApi
6256         @SuppressLint("NoSettingsProvider")
6257         public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
6258 
6259         /**
6260          * Host name and port for global http proxy. Uses ':' seperator for
6261          * between host and port.
6262          *
6263          * @deprecated Use {@link Global#HTTP_PROXY}
6264          */
6265         @Deprecated
6266         public static final String HTTP_PROXY = Global.HTTP_PROXY;
6267 
6268         /**
6269          * Package designated as always-on VPN provider.
6270          *
6271          * @hide
6272          */
6273         public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app";
6274 
6275         /**
6276          * Whether to block networking outside of VPN connections while always-on is set.
6277          * @see #ALWAYS_ON_VPN_APP
6278          *
6279          * @hide
6280          */
6281         public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown";
6282 
6283         /**
6284          * Comma separated list of packages that are allowed to access the network when VPN is in
6285          * lockdown mode but not running.
6286          * @see #ALWAYS_ON_VPN_LOCKDOWN
6287          *
6288          * @hide
6289          */
6290         public static final String ALWAYS_ON_VPN_LOCKDOWN_WHITELIST =
6291                 "always_on_vpn_lockdown_whitelist";
6292 
6293         /**
6294          * Whether applications can be installed for this user via the system's
6295          * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
6296          *
6297          * <p>1 = permit app installation via the system package installer intent
6298          * <p>0 = do not allow use of the package installer
6299          * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use
6300          * {@link PackageManager#canRequestPackageInstalls()}
6301          * @see PackageManager#canRequestPackageInstalls()
6302          */
6303         public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
6304 
6305         /**
6306          * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that
6307          * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it
6308          * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES}
6309          * on behalf of the profile owner if needed to make the change transparent for profile
6310          * owners.
6311          *
6312          * @hide
6313          */
6314         public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED =
6315                 "unknown_sources_default_reversed";
6316 
6317         /**
6318          * Comma-separated list of location providers that are enabled. Do not rely on this value
6319          * being present or correct, or on ContentObserver notifications on the corresponding Uri.
6320          *
6321          * @deprecated The preferred methods for checking provider status and listening for changes
6322          * are via {@link LocationManager#isProviderEnabled(String)} and
6323          * {@link LocationManager#PROVIDERS_CHANGED_ACTION}.
6324          */
6325         @Deprecated
6326         public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
6327 
6328         /**
6329          * The current location mode of the device. Do not rely on this value being present or on
6330          * ContentObserver notifications on the corresponding Uri.
6331          *
6332          * @deprecated The preferred methods for checking location mode and listening for changes
6333          * are via {@link LocationManager#isLocationEnabled()} and
6334          * {@link LocationManager#MODE_CHANGED_ACTION}.
6335          */
6336         @Deprecated
6337         public static final String LOCATION_MODE = "location_mode";
6338 
6339         /**
6340          * The App or module that changes the location mode.
6341          * @hide
6342          */
6343         public static final String LOCATION_CHANGER = "location_changer";
6344 
6345         /**
6346          * The location changer is unknown or unable to detect.
6347          * @hide
6348          */
6349         public static final int LOCATION_CHANGER_UNKNOWN = 0;
6350 
6351         /**
6352          * Location settings in system settings.
6353          * @hide
6354          */
6355         public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1;
6356 
6357         /**
6358          * The location icon in drop down notification drawer.
6359          * @hide
6360          */
6361         public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2;
6362 
6363         /**
6364          * Location mode is off.
6365          */
6366         public static final int LOCATION_MODE_OFF = 0;
6367 
6368         /**
6369          * This mode no longer has any distinct meaning, but is interpreted as the location mode is
6370          * on.
6371          *
6372          * @deprecated See {@link #LOCATION_MODE}.
6373          */
6374         @Deprecated
6375         public static final int LOCATION_MODE_SENSORS_ONLY = 1;
6376 
6377         /**
6378          * This mode no longer has any distinct meaning, but is interpreted as the location mode is
6379          * on.
6380          *
6381          * @deprecated See {@link #LOCATION_MODE}.
6382          */
6383         @Deprecated
6384         public static final int LOCATION_MODE_BATTERY_SAVING = 2;
6385 
6386         /**
6387          * This mode no longer has any distinct meaning, but is interpreted as the location mode is
6388          * on.
6389          *
6390          * @deprecated See {@link #LOCATION_MODE}.
6391          */
6392         @Deprecated
6393         public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
6394 
6395         /**
6396          * Location mode is on.
6397          *
6398          * @hide
6399          */
6400         @SystemApi
6401         public static final int LOCATION_MODE_ON = LOCATION_MODE_HIGH_ACCURACY;
6402 
6403         /**
6404          * The accuracy in meters used for coarsening location for clients with only the coarse
6405          * location permission.
6406          *
6407          * @hide
6408          */
6409         public static final String LOCATION_COARSE_ACCURACY_M = "locationCoarseAccuracy";
6410 
6411         /**
6412          * A flag containing settings used for biometric weak
6413          * @hide
6414          */
6415         @Deprecated
6416         public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
6417                 "lock_biometric_weak_flags";
6418 
6419         /**
6420          * Whether lock-to-app will lock the keyguard when exiting.
6421          * @hide
6422          */
6423         public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
6424 
6425         /**
6426          * Whether autolock is enabled (0 = false, 1 = true)
6427          *
6428          * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
6429          *             level of the keyguard. Accessing this setting from an app that is targeting
6430          *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
6431          */
6432         @Deprecated
6433         public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
6434 
6435         /**
6436          * Whether lock pattern is visible as user enters (0 = false, 1 = true)
6437          *
6438          * @deprecated Accessing this setting from an app that is targeting
6439          *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
6440          */
6441         @Deprecated
6442         public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
6443 
6444         /**
6445          * Whether lock pattern will vibrate as user enters (0 = false, 1 =
6446          * true)
6447          *
6448          * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
6449          *             lockscreen uses
6450          *             {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
6451          *             Accessing this setting from an app that is targeting
6452          *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
6453          */
6454         @Deprecated
6455         public static final String
6456                 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
6457 
6458         /**
6459          * This preference allows the device to be locked given time after screen goes off,
6460          * subject to current DeviceAdmin policy limits.
6461          * @hide
6462          */
6463         @UnsupportedAppUsage
6464         public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
6465 
6466 
6467         /**
6468          * This preference contains the string that shows for owner info on LockScreen.
6469          * @hide
6470          * @deprecated
6471          */
6472         @Deprecated
6473         public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
6474 
6475         /**
6476          * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
6477          * @hide
6478          */
6479         @Deprecated
6480         public static final String LOCK_SCREEN_APPWIDGET_IDS =
6481             "lock_screen_appwidget_ids";
6482 
6483         /**
6484          * Id of the appwidget shown on the lock screen when appwidgets are disabled.
6485          * @hide
6486          */
6487         @Deprecated
6488         public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
6489             "lock_screen_fallback_appwidget_id";
6490 
6491         /**
6492          * Index of the lockscreen appwidget to restore, -1 if none.
6493          * @hide
6494          */
6495         @Deprecated
6496         public static final String LOCK_SCREEN_STICKY_APPWIDGET =
6497             "lock_screen_sticky_appwidget";
6498 
6499         /**
6500          * This preference enables showing the owner info on LockScreen.
6501          * @hide
6502          * @deprecated
6503          */
6504         @Deprecated
6505         @UnsupportedAppUsage
6506         public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
6507             "lock_screen_owner_info_enabled";
6508 
6509         /**
6510          * Indicates whether the user has allowed notifications to be shown atop a securely locked
6511          * screen in their full "private" form (same as when the device is unlocked).
6512          * <p>
6513          * Type: int (0 for false, 1 for true)
6514          *
6515          * @hide
6516          */
6517         @SystemApi
6518         @TestApi
6519         public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
6520                 "lock_screen_allow_private_notifications";
6521 
6522         /**
6523          * When set by a user, allows notification remote input atop a securely locked screen
6524          * without having to unlock
6525          * @hide
6526          */
6527         public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT =
6528                 "lock_screen_allow_remote_input";
6529 
6530         /**
6531          * Indicates which clock face to show on lock screen and AOD formatted as a serialized
6532          * {@link org.json.JSONObject} with the format:
6533          *     {"clock": id, "_applied_timestamp": timestamp}
6534          * @hide
6535          */
6536         public static final String LOCK_SCREEN_CUSTOM_CLOCK_FACE = "lock_screen_custom_clock_face";
6537 
6538         /**
6539          * Indicates which clock face to show on lock screen and AOD while docked.
6540          * @hide
6541          */
6542         public static final String DOCKED_CLOCK_FACE = "docked_clock_face";
6543 
6544         /**
6545          * Set by the system to track if the user needs to see the call to action for
6546          * the lockscreen notification policy.
6547          * @hide
6548          */
6549         public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
6550                 "show_note_about_notification_hiding";
6551 
6552         /**
6553          * Set to 1 by the system after trust agents have been initialized.
6554          * @hide
6555          */
6556         public static final String TRUST_AGENTS_INITIALIZED =
6557                 "trust_agents_initialized";
6558 
6559         /**
6560          * The Logging ID (a unique 64-bit value) as a hex string.
6561          * Used as a pseudonymous identifier for logging.
6562          * @deprecated This identifier is poorly initialized and has
6563          * many collisions.  It should not be used.
6564          */
6565         @Deprecated
6566         public static final String LOGGING_ID = "logging_id";
6567 
6568         /**
6569          * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
6570          */
6571         @Deprecated
6572         public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
6573 
6574         /**
6575          * No longer supported.
6576          */
6577         public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
6578 
6579         /**
6580          * No longer supported.
6581          */
6582         public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
6583 
6584         /**
6585          * No longer supported.
6586          */
6587         public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
6588 
6589         /**
6590          * Settings classname to launch when Settings is clicked from All
6591          * Applications.  Needed because of user testing between the old
6592          * and new Settings apps.
6593          */
6594         // TODO: 881807
6595         public static final String SETTINGS_CLASSNAME = "settings_classname";
6596 
6597         /**
6598          * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
6599          */
6600         @Deprecated
6601         public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
6602 
6603         /**
6604          * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
6605          */
6606         @Deprecated
6607         public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
6608 
6609         /**
6610          * If accessibility is enabled.
6611          */
6612         public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
6613 
6614         /**
6615          * Setting specifying if the accessibility shortcut is enabled.
6616          * @hide
6617          */
6618         public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN =
6619                 "accessibility_shortcut_on_lock_screen";
6620 
6621         /**
6622          * Setting specifying if the accessibility shortcut dialog has been shown to this user.
6623          * @hide
6624          */
6625         public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN =
6626                 "accessibility_shortcut_dialog_shown";
6627 
6628         /**
6629          * Setting specifying the accessibility services, accessibility shortcut targets,
6630          * or features to be toggled via the accessibility shortcut.
6631          *
6632          * <p> This is a colon-separated string list which contains the flattened
6633          * {@link ComponentName} and the class name of a system class implementing a supported
6634          * accessibility feature.
6635          * @hide
6636          */
6637         @UnsupportedAppUsage
6638         @TestApi
6639         public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE =
6640                 "accessibility_shortcut_target_service";
6641 
6642         /**
6643          * Setting specifying the accessibility service or feature to be toggled via the
6644          * accessibility button in the navigation bar. This is either a flattened
6645          * {@link ComponentName} or the class name of a system class implementing a supported
6646          * accessibility feature.
6647          * @hide
6648          */
6649         public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT =
6650                 "accessibility_button_target_component";
6651 
6652         /**
6653          * Setting specifying the accessibility services, accessibility shortcut targets,
6654          * or features to be toggled via the accessibility button in the navigation bar.
6655          *
6656          * <p> This is a colon-separated string list which contains the flattened
6657          * {@link ComponentName} and the class name of a system class implementing a supported
6658          * accessibility feature.
6659          * @hide
6660          */
6661         public static final String ACCESSIBILITY_BUTTON_TARGETS = "accessibility_button_targets";
6662 
6663         /**
6664          * The system class name of magnification controller which is a target to be toggled via
6665          * accessibility shortcut or accessibility button.
6666          *
6667          * @hide
6668          */
6669         public static final String ACCESSIBILITY_SHORTCUT_TARGET_MAGNIFICATION_CONTROLLER =
6670                 "com.android.server.accessibility.MagnificationController";
6671 
6672         /**
6673          * If touch exploration is enabled.
6674          */
6675         public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
6676 
6677         /**
6678          * List of the enabled accessibility providers.
6679          */
6680         public static final String ENABLED_ACCESSIBILITY_SERVICES =
6681             "enabled_accessibility_services";
6682 
6683         /**
6684          * List of the accessibility services to which the user has granted
6685          * permission to put the device into touch exploration mode.
6686          *
6687          * @hide
6688          */
6689         public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
6690             "touch_exploration_granted_accessibility_services";
6691 
6692         /**
6693          * Whether the Global Actions Panel is enabled.
6694          * @hide
6695          */
6696         public static final String GLOBAL_ACTIONS_PANEL_ENABLED = "global_actions_panel_enabled";
6697 
6698         /**
6699          * Whether the Global Actions Panel can be toggled on or off in Settings.
6700          * @hide
6701          */
6702         public static final String GLOBAL_ACTIONS_PANEL_AVAILABLE =
6703                 "global_actions_panel_available";
6704 
6705         /**
6706          * Enables debug mode for the Global Actions Panel.
6707          * @hide
6708          */
6709         public static final String GLOBAL_ACTIONS_PANEL_DEBUG_ENABLED =
6710                 "global_actions_panel_debug_enabled";
6711 
6712         /**
6713          * Whether the hush gesture has ever been used
6714          * @hide
6715          */
6716         @SystemApi
6717         public static final String HUSH_GESTURE_USED = "hush_gesture_used";
6718 
6719         /**
6720          * Number of times the user has manually clicked the ringer toggle
6721          * @hide
6722          */
6723         public static final String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count";
6724 
6725         /**
6726          * Whether to play a sound for charging events.
6727          * @hide
6728          */
6729         public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
6730 
6731         /**
6732          * Whether to vibrate for charging events.
6733          * @hide
6734          */
6735         public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled";
6736 
6737         /**
6738          * If 0, turning on dnd manually will last indefinitely.
6739          * Else if non-negative, turning on dnd manually will last for this many minutes.
6740          * Else (if negative), turning on dnd manually will surface a dialog that prompts
6741          * user to specify a duration.
6742          * @hide
6743          */
6744         public static final String ZEN_DURATION = "zen_duration";
6745 
6746         /** @hide */ public static final int ZEN_DURATION_PROMPT = -1;
6747         /** @hide */ public static final int ZEN_DURATION_FOREVER = 0;
6748 
6749         /**
6750          * If nonzero, will show the zen upgrade notification when the user toggles DND on/off.
6751          * @hide
6752          */
6753         public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";
6754 
6755         /**
6756          * If nonzero, will show the zen update settings suggestion.
6757          * @hide
6758          */
6759         public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion";
6760 
6761         /**
6762          * If nonzero, zen has not been updated to reflect new changes.
6763          * @hide
6764          */
6765         public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated";
6766 
6767         /**
6768          * If nonzero, zen setting suggestion has been viewed by user
6769          * @hide
6770          */
6771         public static final String ZEN_SETTINGS_SUGGESTION_VIEWED =
6772                 "zen_settings_suggestion_viewed";
6773 
6774         /**
6775          * Whether the in call notification is enabled to play sound during calls.  The value is
6776          * boolean (1 or 0).
6777          * @hide
6778          */
6779         public static final String IN_CALL_NOTIFICATION_ENABLED = "in_call_notification_enabled";
6780 
6781         /**
6782          * Uri of the slice that's presented on the keyguard.
6783          * Defaults to a slice with the date and next alarm.
6784          *
6785          * @hide
6786          */
6787         public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri";
6788 
6789         /**
6790          * Whether to speak passwords while in accessibility mode.
6791          *
6792          * @deprecated The speaking of passwords is controlled by individual accessibility services.
6793          * Apps should ignore this setting and provide complete information to accessibility
6794          * at all times, which was the behavior when this value was {@code true}.
6795          */
6796         @Deprecated
6797         public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
6798 
6799         /**
6800          * Whether to draw text with high contrast while in accessibility mode.
6801          *
6802          * @hide
6803          */
6804         public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
6805                 "high_text_contrast_enabled";
6806 
6807         /**
6808          * Setting that specifies whether the display magnification is enabled via a system-wide
6809          * triple tap gesture. Display magnifications allows the user to zoom in the display content
6810          * and is targeted to low vision users. The current magnification scale is controlled by
6811          * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
6812          *
6813          * @hide
6814          */
6815         @UnsupportedAppUsage
6816         @TestApi
6817         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
6818                 "accessibility_display_magnification_enabled";
6819 
6820         /**
6821          * Setting that specifies whether the display magnification is enabled via a shortcut
6822          * affordance within the system's navigation area. Display magnifications allows the user to
6823          * zoom in the display content and is targeted to low vision users. The current
6824          * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
6825          *
6826          * @deprecated Use {@link #ACCESSIBILITY_BUTTON_TARGETS} instead.
6827          * {@link #ACCESSIBILITY_BUTTON_TARGETS} holds the magnification system class name
6828          * when navigation bar magnification is enabled.
6829          * @hide
6830          */
6831         @SystemApi
6832         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED =
6833                 "accessibility_display_magnification_navbar_enabled";
6834 
6835         /**
6836          * Setting that specifies what the display magnification scale is.
6837          * Display magnifications allows the user to zoom in the display
6838          * content and is targeted to low vision users. Whether a display
6839          * magnification is performed is controlled by
6840          * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and
6841          * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED}
6842          *
6843          * @hide
6844          */
6845         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
6846                 "accessibility_display_magnification_scale";
6847 
6848         /**
6849          * Unused mangnification setting
6850          *
6851          * @hide
6852          * @deprecated
6853          */
6854         @Deprecated
6855         public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
6856                 "accessibility_display_magnification_auto_update";
6857 
6858         /**
6859          * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be
6860          * modified from an AccessibilityService using the SoftKeyboardController.
6861          *
6862          * @hide
6863          */
6864         public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE =
6865                 "accessibility_soft_keyboard_mode";
6866 
6867         /**
6868          * Default soft keyboard behavior.
6869          *
6870          * @hide
6871          */
6872         public static final int SHOW_MODE_AUTO = 0;
6873 
6874         /**
6875          * Soft keyboard is never shown.
6876          *
6877          * @hide
6878          */
6879         public static final int SHOW_MODE_HIDDEN = 1;
6880 
6881         /**
6882          * Setting that specifies whether timed text (captions) should be
6883          * displayed in video content. Text display properties are controlled by
6884          * the following settings:
6885          * <ul>
6886          * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
6887          * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
6888          * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
6889          * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
6890          * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
6891          * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
6892          * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
6893          * </ul>
6894          *
6895          * @hide
6896          */
6897         public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
6898                 "accessibility_captioning_enabled";
6899 
6900         /**
6901          * Setting that specifies the language for captions as a locale string,
6902          * e.g. en_US.
6903          *
6904          * @see java.util.Locale#toString
6905          * @hide
6906          */
6907         public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
6908                 "accessibility_captioning_locale";
6909 
6910         /**
6911          * Integer property that specifies the preset style for captions, one
6912          * of:
6913          * <ul>
6914          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
6915          * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
6916          * </ul>
6917          *
6918          * @see java.util.Locale#toString
6919          * @hide
6920          */
6921         public static final String ACCESSIBILITY_CAPTIONING_PRESET =
6922                 "accessibility_captioning_preset";
6923 
6924         /**
6925          * Integer property that specifes the background color for captions as a
6926          * packed 32-bit color.
6927          *
6928          * @see android.graphics.Color#argb
6929          * @hide
6930          */
6931         public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
6932                 "accessibility_captioning_background_color";
6933 
6934         /**
6935          * Integer property that specifes the foreground color for captions as a
6936          * packed 32-bit color.
6937          *
6938          * @see android.graphics.Color#argb
6939          * @hide
6940          */
6941         public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
6942                 "accessibility_captioning_foreground_color";
6943 
6944         /**
6945          * Integer property that specifes the edge type for captions, one of:
6946          * <ul>
6947          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
6948          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
6949          * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
6950          * </ul>
6951          *
6952          * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
6953          * @hide
6954          */
6955         public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
6956                 "accessibility_captioning_edge_type";
6957 
6958         /**
6959          * Integer property that specifes the edge color for captions as a
6960          * packed 32-bit color.
6961          *
6962          * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
6963          * @see android.graphics.Color#argb
6964          * @hide
6965          */
6966         public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
6967                 "accessibility_captioning_edge_color";
6968 
6969         /**
6970          * Integer property that specifes the window color for captions as a
6971          * packed 32-bit color.
6972          *
6973          * @see android.graphics.Color#argb
6974          * @hide
6975          */
6976         public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
6977                 "accessibility_captioning_window_color";
6978 
6979         /**
6980          * String property that specifies the typeface for captions, one of:
6981          * <ul>
6982          * <li>DEFAULT
6983          * <li>MONOSPACE
6984          * <li>SANS_SERIF
6985          * <li>SERIF
6986          * </ul>
6987          *
6988          * @see android.graphics.Typeface
6989          * @hide
6990          */
6991         @UnsupportedAppUsage
6992         public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
6993                 "accessibility_captioning_typeface";
6994 
6995         /**
6996          * Floating point property that specifies font scaling for captions.
6997          *
6998          * @hide
6999          */
7000         public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
7001                 "accessibility_captioning_font_scale";
7002 
7003         /**
7004          * Setting that specifies whether display color inversion is enabled.
7005          */
7006         public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
7007                 "accessibility_display_inversion_enabled";
7008 
7009         /**
7010          * Setting that specifies whether display color space adjustment is
7011          * enabled.
7012          *
7013          * @hide
7014          */
7015         @UnsupportedAppUsage
7016         public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
7017                 "accessibility_display_daltonizer_enabled";
7018 
7019         /**
7020          * Integer property that specifies the type of color space adjustment to
7021          * perform. Valid values are defined in AccessibilityManager and Settings arrays.xml:
7022          * - AccessibilityManager.DALTONIZER_DISABLED = -1
7023          * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0
7024          * - <item>@string/daltonizer_mode_protanomaly</item> = 11
7025          * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY and
7026          *       <item>@string/daltonizer_mode_deuteranomaly</item> = 12
7027          * - <item>@string/daltonizer_mode_tritanomaly</item> = 13
7028          *
7029          * @hide
7030          */
7031         @UnsupportedAppUsage
7032         public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
7033                 "accessibility_display_daltonizer";
7034 
7035         /**
7036          * Setting that specifies whether automatic click when the mouse pointer stops moving is
7037          * enabled.
7038          *
7039          * @hide
7040          */
7041         @UnsupportedAppUsage
7042         public static final String ACCESSIBILITY_AUTOCLICK_ENABLED =
7043                 "accessibility_autoclick_enabled";
7044 
7045         /**
7046          * Integer setting specifying amount of time in ms the mouse pointer has to stay still
7047          * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set.
7048          *
7049          * @see #ACCESSIBILITY_AUTOCLICK_ENABLED
7050          * @hide
7051          */
7052         public static final String ACCESSIBILITY_AUTOCLICK_DELAY =
7053                 "accessibility_autoclick_delay";
7054 
7055         /**
7056          * Whether or not larger size icons are used for the pointer of mouse/trackpad for
7057          * accessibility.
7058          * (0 = false, 1 = true)
7059          * @hide
7060          */
7061         @UnsupportedAppUsage
7062         public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
7063                 "accessibility_large_pointer_icon";
7064 
7065         /**
7066          * The timeout for considering a press to be a long press in milliseconds.
7067          * @hide
7068          */
7069         @UnsupportedAppUsage
7070         public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
7071 
7072         /**
7073          * The duration in milliseconds between the first tap's up event and the second tap's
7074          * down event for an interaction to be considered part of the same multi-press.
7075          * @hide
7076          */
7077         public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout";
7078 
7079         /**
7080          * Setting that specifies recommended timeout in milliseconds for controls
7081          * which don't need user's interactions.
7082          *
7083          * @hide
7084          */
7085         public static final String ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS =
7086                 "accessibility_non_interactive_ui_timeout_ms";
7087 
7088         /**
7089          * Setting that specifies recommended timeout in milliseconds for controls
7090          * which need user's interactions.
7091          *
7092          * @hide
7093          */
7094         public static final String ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS =
7095                 "accessibility_interactive_ui_timeout_ms";
7096 
7097         /**
7098          * List of the enabled print services.
7099          *
7100          * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade
7101          * from pre-N.
7102          *
7103          * @hide
7104          */
7105         @UnsupportedAppUsage
7106         public static final String ENABLED_PRINT_SERVICES =
7107             "enabled_print_services";
7108 
7109         /**
7110          * List of the disabled print services.
7111          *
7112          * @hide
7113          */
7114         @TestApi
7115         public static final String DISABLED_PRINT_SERVICES =
7116             "disabled_print_services";
7117 
7118         /**
7119          * The saved value for WindowManagerService.setForcedDisplayDensity()
7120          * formatted as a single integer representing DPI. If unset, then use
7121          * the real display density.
7122          *
7123          * @hide
7124          */
7125         public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
7126 
7127         /**
7128          * Setting to always use the default text-to-speech settings regardless
7129          * of the application settings.
7130          * 1 = override application settings,
7131          * 0 = use application settings (if specified).
7132          *
7133          * @deprecated  The value of this setting is no longer respected by
7134          * the framework text to speech APIs as of the Ice Cream Sandwich release.
7135          */
7136         @Deprecated
7137         public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
7138 
7139         /**
7140          * Default text-to-speech engine speech rate. 100 = 1x
7141          */
7142         public static final String TTS_DEFAULT_RATE = "tts_default_rate";
7143 
7144         /**
7145          * Default text-to-speech engine pitch. 100 = 1x
7146          */
7147         public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
7148 
7149         /**
7150          * Default text-to-speech engine.
7151          */
7152         public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
7153 
7154         /**
7155          * Default text-to-speech language.
7156          *
7157          * @deprecated this setting is no longer in use, as of the Ice Cream
7158          * Sandwich release. Apps should never need to read this setting directly,
7159          * instead can query the TextToSpeech framework classes for the default
7160          * locale. {@link TextToSpeech#getLanguage()}.
7161          */
7162         @Deprecated
7163         public static final String TTS_DEFAULT_LANG = "tts_default_lang";
7164 
7165         /**
7166          * Default text-to-speech country.
7167          *
7168          * @deprecated this setting is no longer in use, as of the Ice Cream
7169          * Sandwich release. Apps should never need to read this setting directly,
7170          * instead can query the TextToSpeech framework classes for the default
7171          * locale. {@link TextToSpeech#getLanguage()}.
7172          */
7173         @Deprecated
7174         public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
7175 
7176         /**
7177          * Default text-to-speech locale variant.
7178          *
7179          * @deprecated this setting is no longer in use, as of the Ice Cream
7180          * Sandwich release. Apps should never need to read this setting directly,
7181          * instead can query the TextToSpeech framework classes for the
7182          * locale that is in use {@link TextToSpeech#getLanguage()}.
7183          */
7184         @Deprecated
7185         public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
7186 
7187         /**
7188          * Stores the default tts locales on a per engine basis. Stored as
7189          * a comma seperated list of values, each value being of the form
7190          * {@code engine_name:locale} for example,
7191          * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
7192          * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
7193          * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
7194          * setting directly, and can query the TextToSpeech framework classes
7195          * for the locale that is in use.
7196          *
7197          * @hide
7198          */
7199         public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
7200 
7201         /**
7202          * Space delimited list of plugin packages that are enabled.
7203          */
7204         public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
7205 
7206         /**
7207          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
7208          * instead.
7209          */
7210         @Deprecated
7211         public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
7212                 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
7213 
7214         /**
7215          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
7216          * instead.
7217          */
7218         @Deprecated
7219         public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
7220                 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
7221 
7222         /**
7223          * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
7224          * instead.
7225          */
7226         @Deprecated
7227         public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
7228                 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
7229 
7230         /**
7231          * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
7232          * instead.
7233          */
7234         @Deprecated
7235         public static final String WIFI_ON = Global.WIFI_ON;
7236 
7237         /**
7238          * The acceptable packet loss percentage (range 0 - 100) before trying
7239          * another AP on the same network.
7240          * @deprecated This setting is not used.
7241          */
7242         @Deprecated
7243         public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
7244                 "wifi_watchdog_acceptable_packet_loss_percentage";
7245 
7246         /**
7247          * The number of access points required for a network in order for the
7248          * watchdog to monitor it.
7249          * @deprecated This setting is not used.
7250          */
7251         @Deprecated
7252         public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
7253 
7254         /**
7255          * The delay between background checks.
7256          * @deprecated This setting is not used.
7257          */
7258         @Deprecated
7259         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
7260                 "wifi_watchdog_background_check_delay_ms";
7261 
7262         /**
7263          * Whether the Wi-Fi watchdog is enabled for background checking even
7264          * after it thinks the user has connected to a good access point.
7265          * @deprecated This setting is not used.
7266          */
7267         @Deprecated
7268         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
7269                 "wifi_watchdog_background_check_enabled";
7270 
7271         /**
7272          * The timeout for a background ping
7273          * @deprecated This setting is not used.
7274          */
7275         @Deprecated
7276         public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
7277                 "wifi_watchdog_background_check_timeout_ms";
7278 
7279         /**
7280          * The number of initial pings to perform that *may* be ignored if they
7281          * fail. Again, if these fail, they will *not* be used in packet loss
7282          * calculation. For example, one network always seemed to time out for
7283          * the first couple pings, so this is set to 3 by default.
7284          * @deprecated This setting is not used.
7285          */
7286         @Deprecated
7287         public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
7288             "wifi_watchdog_initial_ignored_ping_count";
7289 
7290         /**
7291          * The maximum number of access points (per network) to attempt to test.
7292          * If this number is reached, the watchdog will no longer monitor the
7293          * initial connection state for the network. This is a safeguard for
7294          * networks containing multiple APs whose DNS does not respond to pings.
7295          * @deprecated This setting is not used.
7296          */
7297         @Deprecated
7298         public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
7299 
7300         /**
7301          * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
7302          */
7303         @Deprecated
7304         public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
7305 
7306         /**
7307          * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
7308          * @deprecated This setting is not used.
7309          */
7310         @Deprecated
7311         public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
7312 
7313         /**
7314          * The number of pings to test if an access point is a good connection.
7315          * @deprecated This setting is not used.
7316          */
7317         @Deprecated
7318         public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
7319 
7320         /**
7321          * The delay between pings.
7322          * @deprecated This setting is not used.
7323          */
7324         @Deprecated
7325         public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
7326 
7327         /**
7328          * The timeout per ping.
7329          * @deprecated This setting is not used.
7330          */
7331         @Deprecated
7332         public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
7333 
7334         /**
7335          * @deprecated Use
7336          * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
7337          */
7338         @Deprecated
7339         public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
7340 
7341         /**
7342          * @deprecated Use
7343          * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
7344          */
7345         @Deprecated
7346         public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
7347                 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
7348 
7349         /**
7350          * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
7351          * the receivers of the PendingIntent an opportunity to make a new network request before
7352          * the Network satisfying the request is potentially removed.
7353          *
7354          * @hide
7355          */
7356         public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
7357                 "connectivity_release_pending_intent_delay_ms";
7358 
7359         /**
7360          * Whether background data usage is allowed.
7361          *
7362          * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
7363          *             availability of background data depends on several
7364          *             combined factors. When background data is unavailable,
7365          *             {@link ConnectivityManager#getActiveNetworkInfo()} will
7366          *             now appear disconnected.
7367          */
7368         @Deprecated
7369         public static final String BACKGROUND_DATA = "background_data";
7370 
7371         /**
7372          * Origins for which browsers should allow geolocation by default.
7373          * The value is a space-separated list of origins.
7374          */
7375         public static final String ALLOWED_GEOLOCATION_ORIGINS
7376                 = "allowed_geolocation_origins";
7377 
7378         /**
7379          * The preferred TTY mode     0 = TTy Off, CDMA default
7380          *                            1 = TTY Full
7381          *                            2 = TTY HCO
7382          *                            3 = TTY VCO
7383          * @hide
7384          */
7385         public static final String PREFERRED_TTY_MODE =
7386                 "preferred_tty_mode";
7387 
7388         /**
7389          * Whether the enhanced voice privacy mode is enabled.
7390          * 0 = normal voice privacy
7391          * 1 = enhanced voice privacy
7392          * @hide
7393          */
7394         public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
7395 
7396         /**
7397          * Whether the TTY mode mode is enabled.
7398          * 0 = disabled
7399          * 1 = enabled
7400          * @hide
7401          */
7402         public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
7403 
7404         /**
7405          * User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT
7406          * calls when supported by the device and carrier. Boolean value.
7407          * 0 = OFF
7408          * 1 = ON
7409          */
7410         public static final String RTT_CALLING_MODE = "rtt_calling_mode";
7411 
7412         /**
7413         /**
7414          * Controls whether settings backup is enabled.
7415          * Type: int ( 0 = disabled, 1 = enabled )
7416          * @hide
7417          */
7418         @UnsupportedAppUsage
7419         public static final String BACKUP_ENABLED = "backup_enabled";
7420 
7421         /**
7422          * Controls whether application data is automatically restored from backup
7423          * at install time.
7424          * Type: int ( 0 = disabled, 1 = enabled )
7425          * @hide
7426          */
7427         @UnsupportedAppUsage
7428         public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
7429 
7430         /**
7431          * Indicates whether settings backup has been fully provisioned.
7432          * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
7433          * @hide
7434          */
7435         @UnsupportedAppUsage
7436         public static final String BACKUP_PROVISIONED = "backup_provisioned";
7437 
7438         /**
7439          * Component of the transport to use for backup/restore.
7440          * @hide
7441          */
7442         @UnsupportedAppUsage
7443         public static final String BACKUP_TRANSPORT = "backup_transport";
7444 
7445         /**
7446          * Indicates the version for which the setup wizard was last shown. The version gets
7447          * bumped for each release when there is new setup information to show.
7448          *
7449          * @hide
7450          */
7451         @SystemApi
7452         public static final String LAST_SETUP_SHOWN = "last_setup_shown";
7453 
7454         /**
7455          * The interval in milliseconds after which Wi-Fi is considered idle.
7456          * When idle, it is possible for the device to be switched from Wi-Fi to
7457          * the mobile data network.
7458          * @hide
7459          * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
7460          * instead.
7461          */
7462         @Deprecated
7463         public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
7464 
7465         /**
7466          * The global search provider chosen by the user (if multiple global
7467          * search providers are installed). This will be the provider returned
7468          * by {@link SearchManager#getGlobalSearchActivity()} if it's still
7469          * installed. This setting is stored as a flattened component name as
7470          * per {@link ComponentName#flattenToString()}.
7471          *
7472          * @hide
7473          */
7474         public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
7475                 "search_global_search_activity";
7476 
7477         /**
7478          * The number of promoted sources in GlobalSearch.
7479          * @hide
7480          */
7481         public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
7482         /**
7483          * The maximum number of suggestions returned by GlobalSearch.
7484          * @hide
7485          */
7486         public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
7487         /**
7488          * The number of suggestions GlobalSearch will ask each non-web search source for.
7489          * @hide
7490          */
7491         public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
7492         /**
7493          * The number of suggestions the GlobalSearch will ask the web search source for.
7494          * @hide
7495          */
7496         public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
7497                 "search_web_results_override_limit";
7498         /**
7499          * The number of milliseconds that GlobalSearch will wait for suggestions from
7500          * promoted sources before continuing with all other sources.
7501          * @hide
7502          */
7503         public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
7504                 "search_promoted_source_deadline_millis";
7505         /**
7506          * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
7507          * @hide
7508          */
7509         public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
7510         /**
7511          * The maximum number of milliseconds that GlobalSearch shows the previous results
7512          * after receiving a new query.
7513          * @hide
7514          */
7515         public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
7516         /**
7517          * The maximum age of log data used for shortcuts in GlobalSearch.
7518          * @hide
7519          */
7520         public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
7521         /**
7522          * The maximum age of log data used for source ranking in GlobalSearch.
7523          * @hide
7524          */
7525         public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
7526                 "search_max_source_event_age_millis";
7527         /**
7528          * The minimum number of impressions needed to rank a source in GlobalSearch.
7529          * @hide
7530          */
7531         public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
7532                 "search_min_impressions_for_source_ranking";
7533         /**
7534          * The minimum number of clicks needed to rank a source in GlobalSearch.
7535          * @hide
7536          */
7537         public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
7538                 "search_min_clicks_for_source_ranking";
7539         /**
7540          * The maximum number of shortcuts shown by GlobalSearch.
7541          * @hide
7542          */
7543         public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
7544         /**
7545          * The size of the core thread pool for suggestion queries in GlobalSearch.
7546          * @hide
7547          */
7548         public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
7549                 "search_query_thread_core_pool_size";
7550         /**
7551          * The maximum size of the thread pool for suggestion queries in GlobalSearch.
7552          * @hide
7553          */
7554         public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
7555                 "search_query_thread_max_pool_size";
7556         /**
7557          * The size of the core thread pool for shortcut refreshing in GlobalSearch.
7558          * @hide
7559          */
7560         public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
7561                 "search_shortcut_refresh_core_pool_size";
7562         /**
7563          * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
7564          * @hide
7565          */
7566         public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
7567                 "search_shortcut_refresh_max_pool_size";
7568         /**
7569          * The maximun time that excess threads in the GlobalSeach thread pools will
7570          * wait before terminating.
7571          * @hide
7572          */
7573         public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
7574                 "search_thread_keepalive_seconds";
7575         /**
7576          * The maximum number of concurrent suggestion queries to each source.
7577          * @hide
7578          */
7579         public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
7580                 "search_per_source_concurrent_query_limit";
7581 
7582         /**
7583          * Whether or not alert sounds are played on StorageManagerService events.
7584          * (0 = false, 1 = true)
7585          * @hide
7586          */
7587         public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
7588 
7589         /**
7590          * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
7591          * @hide
7592          */
7593         public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
7594 
7595         /**
7596          * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
7597          * @hide
7598          */
7599         public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
7600 
7601         /**
7602          * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
7603          * @hide
7604          */
7605         public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
7606 
7607         /**
7608          * If nonzero, ANRs in invisible background processes bring up a dialog.
7609          * Otherwise, the process will be silently killed.
7610          *
7611          * Also prevents ANRs and crash dialogs from being suppressed.
7612          * @hide
7613          */
7614         @UnsupportedAppUsage
7615         public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
7616 
7617         /**
7618          * If nonzero, crashes in foreground processes will bring up a dialog.
7619          * Otherwise, the process will be silently killed.
7620          * @hide
7621          */
7622         public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION =
7623                 "show_first_crash_dialog_dev_option";
7624 
7625         /**
7626          * The {@link ComponentName} string of the service to be used as the voice recognition
7627          * service.
7628          *
7629          * @hide
7630          */
7631         @UnsupportedAppUsage
7632         public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
7633 
7634         /**
7635          * The {@link ComponentName} string of the selected spell checker service which is
7636          * one of the services managed by the text service manager.
7637          *
7638          * @hide
7639          */
7640         @UnsupportedAppUsage
7641         public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
7642 
7643         /**
7644          * {@link android.view.textservice.SpellCheckerSubtype#hashCode()} of the selected subtype
7645          * of the selected spell checker service which is one of the services managed by the text
7646          * service manager.
7647          *
7648          * @hide
7649          */
7650         @UnsupportedAppUsage
7651         public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
7652                 "selected_spell_checker_subtype";
7653 
7654         /**
7655          * Whether spell checker is enabled or not.
7656          *
7657          * @hide
7658          */
7659         public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
7660 
7661         /**
7662          * What happens when the user presses the Power button while in-call
7663          * and the screen is on.<br/>
7664          * <b>Values:</b><br/>
7665          * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
7666          * 2 - The Power button hangs up the current call.<br/>
7667          *
7668          * @hide
7669          */
7670         @UnsupportedAppUsage
7671         public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
7672 
7673         /**
7674          * Whether the user allows minimal post processing or not.
7675          *
7676          * <p>Values:
7677          * 0 - Not allowed. Any preferences set through the Window.setPreferMinimalPostProcessing
7678          *     API will be ignored.
7679          * 1 - Allowed. Any preferences set through the Window.setPreferMinimalPostProcessing API
7680          *     will be respected and the appropriate signals will be sent to display.
7681          *     (Default behaviour)
7682          *
7683          * @hide
7684          */
7685         public static final String MINIMAL_POST_PROCESSING_ALLOWED =
7686                 "minimal_post_processing_allowed";
7687 
7688         /**
7689          * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
7690          * @hide
7691          */
7692         public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
7693 
7694         /**
7695          * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
7696          * @hide
7697          */
7698         public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
7699 
7700         /**
7701          * INCALL_POWER_BUTTON_BEHAVIOR default value.
7702          * @hide
7703          */
7704         public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
7705                 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
7706 
7707         /**
7708          * What happens when the user presses the Back button while in-call
7709          * and the screen is on.<br/>
7710          * <b>Values:</b><br/>
7711          * 0 - The Back buttons does nothing different.<br/>
7712          * 1 - The Back button hangs up the current call.<br/>
7713          *
7714          * @hide
7715          */
7716         public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior";
7717 
7718         /**
7719          * INCALL_BACK_BUTTON_BEHAVIOR value for no action.
7720          * @hide
7721          */
7722         public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0;
7723 
7724         /**
7725          * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up".
7726          * @hide
7727          */
7728         public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1;
7729 
7730         /**
7731          * INCALL_POWER_BUTTON_BEHAVIOR default value.
7732          * @hide
7733          */
7734         public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT =
7735                 INCALL_BACK_BUTTON_BEHAVIOR_NONE;
7736 
7737         /**
7738          * Whether the device should wake when the wake gesture sensor detects motion.
7739          * @hide
7740          */
7741         public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
7742 
7743         /**
7744          * Whether the device should doze if configured.
7745          * @hide
7746          */
7747         @UnsupportedAppUsage
7748         public static final String DOZE_ENABLED = "doze_enabled";
7749 
7750         /**
7751          * Indicates whether doze should be always on.
7752          * <p>
7753          * Type: int (0 for false, 1 for true)
7754          *
7755          * @hide
7756          */
7757         @SystemApi
7758         @TestApi
7759         public static final String DOZE_ALWAYS_ON = "doze_always_on";
7760 
7761         /**
7762          * Whether the device should pulse on pick up gesture.
7763          * @hide
7764          */
7765         public static final String DOZE_PICK_UP_GESTURE = "doze_pulse_on_pick_up";
7766 
7767         /**
7768          * Whether the device should pulse on long press gesture.
7769          * @hide
7770          */
7771         public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press";
7772 
7773         /**
7774          * Whether the device should pulse on double tap gesture.
7775          * @hide
7776          */
7777         public static final String DOZE_DOUBLE_TAP_GESTURE = "doze_pulse_on_double_tap";
7778 
7779         /**
7780          * Whether the device should respond to the SLPI tap gesture.
7781          * @hide
7782          */
7783         public static final String DOZE_TAP_SCREEN_GESTURE = "doze_tap_gesture";
7784 
7785         /**
7786          * Gesture that wakes up the display, showing some version of the lock screen.
7787          * @hide
7788          */
7789         public static final String DOZE_WAKE_LOCK_SCREEN_GESTURE = "doze_wake_screen_gesture";
7790 
7791         /**
7792          * Gesture that wakes up the display, toggling between {@link Display.STATE_OFF} and
7793          * {@link Display.STATE_DOZE}.
7794          * @hide
7795          */
7796         public static final String DOZE_WAKE_DISPLAY_GESTURE = "doze_wake_display_gesture";
7797 
7798         /**
7799          * Whether the device should suppress the current doze configuration and disable dozing.
7800          * @hide
7801          */
7802         public static final String SUPPRESS_DOZE = "suppress_doze";
7803 
7804         /**
7805          * Gesture that skips media.
7806          * @hide
7807          */
7808         public static final String SKIP_GESTURE = "skip_gesture";
7809 
7810         /**
7811          * Count of successful gestures.
7812          * @hide
7813          */
7814         public static final String SKIP_GESTURE_COUNT = "skip_gesture_count";
7815 
7816         /**
7817          * Count of non-gesture interaction.
7818          * @hide
7819          */
7820         public static final String SKIP_TOUCH_COUNT = "skip_touch_count";
7821 
7822         /**
7823          * Direction to advance media for skip gesture
7824          * @hide
7825          */
7826         public static final String SKIP_DIRECTION = "skip_gesture_direction";
7827 
7828         /**
7829          * Gesture that silences sound (alarms, notification, calls).
7830          * @hide
7831          */
7832         public static final String SILENCE_GESTURE = "silence_gesture";
7833 
7834         /**
7835          * Count of successful silence alarms gestures.
7836          * @hide
7837          */
7838         public static final String SILENCE_ALARMS_GESTURE_COUNT = "silence_alarms_gesture_count";
7839 
7840         /**
7841          * Count of successful silence timer gestures.
7842          * @hide
7843          */
7844         public static final String SILENCE_TIMER_GESTURE_COUNT = "silence_timer_gesture_count";
7845 
7846         /**
7847          * Count of successful silence call gestures.
7848          * @hide
7849          */
7850         public static final String SILENCE_CALL_GESTURE_COUNT = "silence_call_gesture_count";
7851 
7852         /**
7853          * Count of non-gesture interaction.
7854          * @hide
7855          */
7856         public static final String SILENCE_ALARMS_TOUCH_COUNT = "silence_alarms_touch_count";
7857 
7858         /**
7859          * Count of non-gesture interaction.
7860          * @hide
7861          */
7862         public static final String SILENCE_TIMER_TOUCH_COUNT = "silence_timer_touch_count";
7863 
7864         /**
7865          * Count of non-gesture interaction.
7866          * @hide
7867          */
7868         public static final String SILENCE_CALL_TOUCH_COUNT = "silence_call_touch_count";
7869 
7870         /**
7871          * Number of successful "Motion Sense" tap gestures to pause media.
7872          * @hide
7873          */
7874         public static final String AWARE_TAP_PAUSE_GESTURE_COUNT = "aware_tap_pause_gesture_count";
7875 
7876         /**
7877          * Number of touch interactions to pause media when a "Motion Sense" gesture could
7878          * have been used.
7879          * @hide
7880          */
7881         public static final String AWARE_TAP_PAUSE_TOUCH_COUNT = "aware_tap_pause_touch_count";
7882 
7883         /**
7884          * The current night mode that has been selected by the user.  Owned
7885          * and controlled by UiModeManagerService.  Constants are as per
7886          * UiModeManager.
7887          * @hide
7888          */
7889         public static final String UI_NIGHT_MODE = "ui_night_mode";
7890 
7891         /**
7892          * The current night mode that has been overridden to turn on by the system.  Owned
7893          * and controlled by UiModeManagerService.  Constants are as per
7894          * UiModeManager.
7895          * @hide
7896          */
7897         public static final String UI_NIGHT_MODE_OVERRIDE_ON = "ui_night_mode_override_on";
7898 
7899         /**
7900          * The last computed night mode bool the last time the phone was on
7901          * @hide
7902          */
7903         public static final String UI_NIGHT_MODE_LAST_COMPUTED = "ui_night_mode_last_computed";
7904 
7905         /**
7906          * The current night mode that has been overridden to turn off by the system.  Owned
7907          * and controlled by UiModeManagerService.  Constants are as per
7908          * UiModeManager.
7909          * @hide
7910          */
7911         public static final String UI_NIGHT_MODE_OVERRIDE_OFF = "ui_night_mode_override_off";
7912 
7913         /**
7914          * Whether screensavers are enabled.
7915          * @hide
7916          */
7917         public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
7918 
7919         /**
7920          * The user's chosen screensaver components.
7921          *
7922          * These will be launched by the PhoneWindowManager after a timeout when not on
7923          * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
7924          * @hide
7925          */
7926         public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
7927 
7928         /**
7929          * If screensavers are enabled, whether the screensaver should be automatically launched
7930          * when the device is inserted into a (desk) dock.
7931          * @hide
7932          */
7933         public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
7934 
7935         /**
7936          * If screensavers are enabled, whether the screensaver should be automatically launched
7937          * when the screen times out when not on battery.
7938          * @hide
7939          */
7940         public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
7941 
7942         /**
7943          * If screensavers are enabled, the default screensaver component.
7944          * @hide
7945          */
7946         public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
7947 
7948         /**
7949          * The default NFC payment component
7950          * @hide
7951          */
7952         @UnsupportedAppUsage
7953         @TestApi
7954         public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
7955 
7956         /**
7957          * Whether NFC payment is handled by the foreground application or a default.
7958          * @hide
7959          */
7960         public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
7961 
7962         /**
7963          * Specifies the package name currently configured to be the primary sms application
7964          * @hide
7965          */
7966         @UnsupportedAppUsage
7967         public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
7968 
7969         /**
7970          * Specifies the package name currently configured to be the default dialer application
7971          * @hide
7972          */
7973         @UnsupportedAppUsage
7974         public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
7975 
7976         /**
7977          * Specifies the component name currently configured to be the default call screening
7978          * application
7979          * @hide
7980          */
7981         public static final String CALL_SCREENING_DEFAULT_COMPONENT =
7982                 "call_screening_default_component";
7983 
7984         /**
7985          * Specifies the package name currently configured to be the emergency assistance application
7986          *
7987          * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
7988          *
7989          * @hide
7990          */
7991         public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
7992 
7993         /**
7994          * Specifies whether the current app context on scren (assist data) will be sent to the
7995          * assist application (active voice interaction service).
7996          *
7997          * @hide
7998          */
7999         public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
8000 
8001         /**
8002          * Specifies whether a screenshot of the screen contents will be sent to the assist
8003          * application (active voice interaction service).
8004          *
8005          * @hide
8006          */
8007         public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";
8008 
8009         /**
8010          * Specifies whether the screen will show an animation if screen contents are sent to the
8011          * assist application (active voice interaction service).
8012          *
8013          * Note that the disclosure will be forced for third-party assistants or if the device
8014          * does not support disabling it.
8015          *
8016          * @hide
8017          */
8018         public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled";
8019 
8020         /**
8021          * Control if rotation suggestions are sent to System UI when in rotation locked mode.
8022          * Done to enable screen rotation while the the screen rotation is locked. Enabling will
8023          * poll the accelerometer in rotation locked mode.
8024          *
8025          * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent.
8026          *
8027          * @hide
8028          */
8029 
8030         public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions";
8031 
8032         /**
8033          * The disabled state of SHOW_ROTATION_SUGGESTIONS.
8034          * @hide
8035          */
8036         public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0;
8037 
8038         /**
8039          * The enabled state of SHOW_ROTATION_SUGGESTIONS.
8040          * @hide
8041          */
8042         public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1;
8043 
8044         /**
8045          * The default state of SHOW_ROTATION_SUGGESTIONS.
8046          * @hide
8047          */
8048         public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT =
8049                 SHOW_ROTATION_SUGGESTIONS_ENABLED;
8050 
8051         /**
8052          * The number of accepted rotation suggestions. Used to determine if the user has been
8053          * introduced to rotation suggestions.
8054          * @hide
8055          */
8056         public static final String NUM_ROTATION_SUGGESTIONS_ACCEPTED =
8057                 "num_rotation_suggestions_accepted";
8058 
8059         /**
8060          * Read only list of the service components that the current user has explicitly allowed to
8061          * see and assist with all of the user's notifications.
8062          *
8063          * @deprecated Use
8064          * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}.
8065          * @hide
8066          */
8067         @Deprecated
8068         public static final String ENABLED_NOTIFICATION_ASSISTANT =
8069                 "enabled_notification_assistant";
8070 
8071         /**
8072          * Read only list of the service components that the current user has explicitly allowed to
8073          * see all of the user's notifications, separated by ':'.
8074          *
8075          * @hide
8076          * @deprecated Use
8077          * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}.
8078          */
8079         @Deprecated
8080         @UnsupportedAppUsage
8081         public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
8082 
8083         /**
8084          * Read only list of the packages that the current user has explicitly allowed to
8085          * manage do not disturb, separated by ':'.
8086          *
8087          * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}.
8088          * @hide
8089          */
8090         @Deprecated
8091         @TestApi
8092         public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES =
8093                 "enabled_notification_policy_access_packages";
8094 
8095         /**
8096          * Defines whether managed profile ringtones should be synced from it's parent profile
8097          * <p>
8098          * 0 = ringtones are not synced
8099          * 1 = ringtones are synced from the profile's parent (default)
8100          * <p>
8101          * This value is only used for managed profiles.
8102          * @hide
8103          */
8104         @TestApi
8105         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
8106         public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds";
8107 
8108         /**
8109          * @hide
8110          */
8111         @UnsupportedAppUsage
8112         @TestApi
8113         public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
8114 
8115         /**
8116          * This is the query URI for finding a print service to install.
8117          *
8118          * @hide
8119          */
8120         public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
8121 
8122         /**
8123          * This is the query URI for finding a NFC payment service to install.
8124          *
8125          * @hide
8126          */
8127         public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
8128 
8129         /**
8130          * This is the query URI for finding a auto fill service to install.
8131          *
8132          * @hide
8133          */
8134         public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri";
8135 
8136         /**
8137          * If enabled, apps should try to skip any introductory hints on first launch. This might
8138          * apply to users that are already familiar with the environment or temporary users.
8139          * <p>
8140          * Type : int (0 to show hints, 1 to skip showing hints)
8141          */
8142         public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
8143 
8144         /**
8145          * Persisted playback time after a user confirmation of an unsafe volume level.
8146          *
8147          * @hide
8148          */
8149         public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
8150 
8151         /**
8152          * Indicates whether notification display on the lock screen is enabled.
8153          * <p>
8154          * Type: int (0 for false, 1 for true)
8155          *
8156          * @hide
8157          */
8158         @SystemApi
8159         @TestApi
8160         public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
8161                 "lock_screen_show_notifications";
8162 
8163         /**
8164          * Indicates whether the lock screen should display silent notifications.
8165          * <p>
8166          * Type: int (0 for false, 1 for true)
8167          *
8168          * @hide
8169          */
8170         public static final String LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS =
8171                 "lock_screen_show_silent_notifications";
8172 
8173         /**
8174          * Indicates whether snooze options should be shown on notifications
8175          * <p>
8176          * Type: int (0 for false, 1 for true)
8177          *
8178          * @hide
8179          */
8180         public static final String SHOW_NOTIFICATION_SNOOZE = "show_notification_snooze";
8181 
8182         /**
8183          * List of TV inputs that are currently hidden. This is a string
8184          * containing the IDs of all hidden TV inputs. Each ID is encoded by
8185          * {@link android.net.Uri#encode(String)} and separated by ':'.
8186          * @hide
8187          */
8188         public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
8189 
8190         /**
8191          * List of custom TV input labels. This is a string containing <TV input id, custom name>
8192          * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
8193          * and separated by ','. Each pair is separated by ':'.
8194          * @hide
8195          */
8196         public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
8197 
8198         /**
8199          * Whether TV app uses non-system inputs.
8200          *
8201          * <p>
8202          * The value is boolean (1 or 0), where 1 means non-system TV inputs are allowed,
8203          * and 0 means non-system TV inputs are not allowed.
8204          *
8205          * <p>
8206          * Devices such as sound bars may have changed the system property allow_third_party_inputs
8207          * to false so the TV Application only uses HDMI and other built in inputs. This setting
8208          * allows user to override the default and have the TV Application use third party TV inputs
8209          * available on play store.
8210          *
8211          * @hide
8212          */
8213         public static final String TV_APP_USES_NON_SYSTEM_INPUTS = "tv_app_uses_non_system_inputs";
8214 
8215         /**
8216          * Whether automatic routing of system audio to USB audio peripheral is disabled.
8217          * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
8218          * and 0 means automatic routing is enabled.
8219          *
8220          * @hide
8221          */
8222         public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
8223                 "usb_audio_automatic_routing_disabled";
8224 
8225         /**
8226          * The timeout in milliseconds before the device fully goes to sleep after
8227          * a period of inactivity.  This value sets an upper bound on how long the device
8228          * will stay awake or dreaming without user activity.  It should generally
8229          * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
8230          * will sleep before it ever has a chance to dream.
8231          * <p>
8232          * Use -1 to disable this timeout.
8233          * </p>
8234          *
8235          * @hide
8236          */
8237         public static final String SLEEP_TIMEOUT = "sleep_timeout";
8238 
8239         /**
8240          * The timeout in milliseconds before the device goes to sleep due to user inattentiveness,
8241          * even if the system is holding wakelocks. It should generally be longer than {@code
8242          * config_attentiveWarningDuration}, as otherwise the device will show the attentive
8243          * warning constantly. Small timeouts are discouraged, as they will cause the device to
8244          * go to sleep quickly after waking up.
8245          * <p>
8246          * Use -1 to disable this timeout.
8247          * </p>
8248          *
8249          * @hide
8250          */
8251         public static final String ATTENTIVE_TIMEOUT = "attentive_timeout";
8252 
8253         /**
8254          * Controls whether double tap to wake is enabled.
8255          * @hide
8256          */
8257         public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
8258 
8259         /**
8260          * The current assistant component. It could be a voice interaction service,
8261          * or an activity that handles ACTION_ASSIST, or empty which means using the default
8262          * handling.
8263          *
8264          * <p>This should be set indirectly by setting the {@link
8265          * android.app.role.RoleManager#ROLE_ASSISTANT assistant role}.
8266          *
8267          * @hide
8268          */
8269         @UnsupportedAppUsage
8270         public static final String ASSISTANT = "assistant";
8271 
8272         /**
8273          * Whether the camera launch gesture should be disabled.
8274          *
8275          * @hide
8276          */
8277         public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled";
8278 
8279         /**
8280          * Whether the camera launch gesture to double tap the power button when the screen is off
8281          * should be disabled.
8282          *
8283          * @hide
8284          */
8285         public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED =
8286                 "camera_double_tap_power_gesture_disabled";
8287 
8288         /**
8289          * Whether the camera double twist gesture to flip between front and back mode should be
8290          * enabled.
8291          *
8292          * @hide
8293          */
8294         public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED =
8295                 "camera_double_twist_to_flip_enabled";
8296 
8297         /**
8298          * Whether or not the smart camera lift trigger that launches the camera when the user moves
8299          * the phone into a position for taking photos should be enabled.
8300          *
8301          * @hide
8302          */
8303         public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled";
8304 
8305         /**
8306          * The default enable state of the camera lift trigger.
8307          *
8308          * @hide
8309          */
8310         public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1;
8311 
8312         /**
8313          * Whether or not the flashlight (camera torch mode) is available required to turn
8314          * on flashlight.
8315          *
8316          * @hide
8317          */
8318         public static final String FLASHLIGHT_AVAILABLE = "flashlight_available";
8319 
8320         /**
8321          * Whether or not flashlight is enabled.
8322          *
8323          * @hide
8324          */
8325         public static final String FLASHLIGHT_ENABLED = "flashlight_enabled";
8326 
8327         /**
8328          * Whether or not face unlock is allowed on Keyguard.
8329          * @hide
8330          */
8331         public static final String FACE_UNLOCK_KEYGUARD_ENABLED = "face_unlock_keyguard_enabled";
8332 
8333         /**
8334          * Whether or not face unlock dismisses the keyguard.
8335          * @hide
8336          */
8337         public static final String FACE_UNLOCK_DISMISSES_KEYGUARD =
8338                 "face_unlock_dismisses_keyguard";
8339 
8340         /**
8341          * Whether or not media is shown automatically when bypassing as a heads up.
8342          * @hide
8343          */
8344         public static final String SHOW_MEDIA_WHEN_BYPASSING =
8345                 "show_media_when_bypassing";
8346 
8347         /**
8348          * Whether or not face unlock requires attention. This is a cached value, the source of
8349          * truth is obtained through the HAL.
8350          * @hide
8351          */
8352         public static final String FACE_UNLOCK_ATTENTION_REQUIRED =
8353                 "face_unlock_attention_required";
8354 
8355         /**
8356          * Whether or not face unlock requires a diverse set of poses during enrollment. This is a
8357          * cached value, the source of truth is obtained through the HAL.
8358          * @hide
8359          */
8360         public static final String FACE_UNLOCK_DIVERSITY_REQUIRED =
8361                 "face_unlock_diversity_required";
8362 
8363 
8364         /**
8365          * Whether or not face unlock is allowed for apps (through BiometricPrompt).
8366          * @hide
8367          */
8368         public static final String FACE_UNLOCK_APP_ENABLED = "face_unlock_app_enabled";
8369 
8370         /**
8371          * Whether or not face unlock always requires user confirmation, meaning {@link
8372          * android.hardware.biometrics.BiometricPrompt.Builder#setConfirmationRequired(boolean)}
8373          * is always 'true'. This overrides the behavior that apps choose in the
8374          * setConfirmationRequired API.
8375          * @hide
8376          */
8377         public static final String FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION =
8378                 "face_unlock_always_require_confirmation";
8379 
8380         /**
8381          * Whether or not a user should re enroll their face.
8382          *
8383          * Face unlock re enroll.
8384          *  0 = No re enrollment.
8385          *  1 = Re enrollment is suggested.
8386          *  2 = Re enrollment is required after a set time period.
8387          *  3 = Re enrollment is required immediately.
8388          *
8389          * @hide
8390          */
8391         public static final String FACE_UNLOCK_RE_ENROLL = "face_unlock_re_enroll";
8392 
8393         /**
8394          * Whether or not debugging is enabled.
8395          * @hide
8396          */
8397         public static final String BIOMETRIC_DEBUG_ENABLED =
8398                 "biometric_debug_enabled";
8399 
8400         /**
8401          * Whether the assist gesture should be enabled.
8402          *
8403          * @hide
8404          */
8405         public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled";
8406 
8407         /**
8408          * Sensitivity control for the assist gesture.
8409          *
8410          * @hide
8411          */
8412         public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity";
8413 
8414         /**
8415          * Whether the assist gesture should silence alerts.
8416          *
8417          * @hide
8418          */
8419         public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED =
8420                 "assist_gesture_silence_alerts_enabled";
8421 
8422         /**
8423          * Whether the assist gesture should wake the phone.
8424          *
8425          * @hide
8426          */
8427         public static final String ASSIST_GESTURE_WAKE_ENABLED =
8428                 "assist_gesture_wake_enabled";
8429 
8430         /**
8431          * Indicates whether the Assist Gesture Deferred Setup has been completed.
8432          * <p>
8433          * Type: int (0 for false, 1 for true)
8434          *
8435          * @hide
8436          */
8437         @SystemApi
8438         public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
8439 
8440         /**
8441          * Control whether Trust Agents are in active unlock or extend unlock mode.
8442          * @hide
8443          */
8444         public static final String TRUST_AGENTS_EXTEND_UNLOCK = "trust_agents_extend_unlock";
8445 
8446         /**
8447          * Control whether the screen locks when trust is lost.
8448          * @hide
8449          */
8450         public static final String LOCK_SCREEN_WHEN_TRUST_LOST = "lock_screen_when_trust_lost";
8451 
8452         /**
8453          * Control whether Night display is currently activated.
8454          * @hide
8455          */
8456         public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated";
8457 
8458         /**
8459          * Control whether Night display will automatically activate/deactivate.
8460          * @hide
8461          */
8462         public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode";
8463 
8464         /**
8465          * Control the color temperature of Night Display, represented in Kelvin.
8466          * @hide
8467          */
8468         public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE =
8469                 "night_display_color_temperature";
8470 
8471         /**
8472          * Custom time when Night display is scheduled to activate.
8473          * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
8474          * @hide
8475          */
8476         public static final String NIGHT_DISPLAY_CUSTOM_START_TIME =
8477                 "night_display_custom_start_time";
8478 
8479         /**
8480          * Custom time when Night display is scheduled to deactivate.
8481          * Represented as milliseconds from midnight (e.g. 21600000 == 6am).
8482          * @hide
8483          */
8484         public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time";
8485 
8486         /**
8487          * A String representing the LocalDateTime when Night display was last activated. Use to
8488          * decide whether to apply the current activated state after a reboot or user change. In
8489          * legacy cases, this is represented by the time in milliseconds (since epoch).
8490          * @hide
8491          */
8492         public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME =
8493                 "night_display_last_activated_time";
8494 
8495         /**
8496          * Control whether display white balance is currently enabled.
8497          * @hide
8498          */
8499         public static final String DISPLAY_WHITE_BALANCE_ENABLED = "display_white_balance_enabled";
8500 
8501         /**
8502          * Names of the service components that the current user has explicitly allowed to
8503          * be a VR mode listener, separated by ':'.
8504          *
8505          * @hide
8506          */
8507         @UnsupportedAppUsage
8508         @TestApi
8509         public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners";
8510 
8511         /**
8512          * Behavior of the display while in VR mode.
8513          *
8514          * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}.
8515          *
8516          * @hide
8517          */
8518         public static final String VR_DISPLAY_MODE = "vr_display_mode";
8519 
8520         /**
8521          * Lower the display persistence while the system is in VR mode.
8522          *
8523          * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
8524          *
8525          * @hide.
8526          */
8527         public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0;
8528 
8529         /**
8530          * Do not alter the display persistence while the system is in VR mode.
8531          *
8532          * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
8533          *
8534          * @hide.
8535          */
8536         public static final int VR_DISPLAY_MODE_OFF = 1;
8537 
8538         /**
8539          * The latest SDK version that CarrierAppUtils#disableCarrierAppsUntilPrivileged has been
8540          * executed for.
8541          *
8542          * <p>This is used to ensure that we only take one pass which will disable apps that are not
8543          * privileged (if any). From then on, we only want to enable apps (when a matching SIM is
8544          * inserted), to avoid disabling an app that the user might actively be using.
8545          *
8546          * <p>Will be set to {@link android.os.Build.VERSION#SDK_INT} once executed. Note that older
8547          * SDK versions prior to R set 1 for this value.
8548          *
8549          * @hide
8550          */
8551         public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled";
8552 
8553         /**
8554          * Whether parent user can access remote contact in managed profile.
8555          *
8556          * @hide
8557          */
8558         public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH =
8559                 "managed_profile_contact_remote_search";
8560 
8561         /**
8562          * Whether parent profile can access remote calendar data in managed profile.
8563          *
8564          * @hide
8565          */
8566         public static final String CROSS_PROFILE_CALENDAR_ENABLED =
8567                 "cross_profile_calendar_enabled";
8568 
8569         /**
8570          * Whether or not the automatic storage manager is enabled and should run on the device.
8571          *
8572          * @hide
8573          */
8574         public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED =
8575                 "automatic_storage_manager_enabled";
8576 
8577         /**
8578          * How many days of information for the automatic storage manager to retain on the device.
8579          *
8580          * @hide
8581          */
8582         public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN =
8583                 "automatic_storage_manager_days_to_retain";
8584 
8585         /**
8586          * Default number of days of information for the automatic storage manager to retain.
8587          *
8588          * @hide
8589          */
8590         public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90;
8591 
8592         /**
8593          * How many bytes the automatic storage manager has cleared out.
8594          *
8595          * @hide
8596          */
8597         public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED =
8598                 "automatic_storage_manager_bytes_cleared";
8599 
8600         /**
8601          * Last run time for the automatic storage manager.
8602          *
8603          * @hide
8604          */
8605         public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN =
8606                 "automatic_storage_manager_last_run";
8607         /**
8608          * If the automatic storage manager has been disabled by policy. Note that this doesn't
8609          * mean that the automatic storage manager is prevented from being re-enabled -- this only
8610          * means that it was turned off by policy at least once.
8611          *
8612          * @hide
8613          */
8614         public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY =
8615                 "automatic_storage_manager_turned_off_by_policy";
8616 
8617         /**
8618          * Whether SystemUI navigation keys is enabled.
8619          * @hide
8620          */
8621         public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
8622                 "system_navigation_keys_enabled";
8623 
8624         /**
8625          * Holds comma separated list of ordering of QS tiles.
8626          *
8627          * @hide
8628          */
8629         public static final String QS_TILES = "sysui_qs_tiles";
8630 
8631         /**
8632          * Whether this user has enabled Quick controls.
8633          *
8634          * 0 indicates disabled and 1 indicates enabled. A non existent value should be treated as
8635          * enabled.
8636          *
8637          * @hide
8638          */
8639         public static final String CONTROLS_ENABLED = "controls_enabled";
8640 
8641         /**
8642          * Whether power menu content (cards, passes, controls) will be shown when device is locked.
8643          *
8644          * 0 indicates hide and 1 indicates show. A non existent value will be treated as hide.
8645          * @hide
8646          */
8647         @TestApi
8648         public static final String POWER_MENU_LOCKED_SHOW_CONTENT =
8649                 "power_menu_locked_show_content";
8650 
8651         /**
8652          * Specifies whether the web action API is enabled.
8653          *
8654          * @hide
8655          */
8656         @SystemApi
8657         public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled";
8658 
8659         /**
8660          * Has this pairable device been paired or upgraded from a previously paired system.
8661          * @hide
8662          */
8663         public static final String DEVICE_PAIRED = "device_paired";
8664 
8665         /**
8666          * Specifies additional package name for broadcasting the CMAS messages.
8667          * @hide
8668          */
8669         public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg";
8670 
8671         /**
8672          * Whether the launcher should show any notification badges.
8673          * The value is boolean (1 or 0).
8674          * @hide
8675          */
8676         @UnsupportedAppUsage
8677         @TestApi
8678         public static final String NOTIFICATION_BADGING = "notification_badging";
8679 
8680         /**
8681          * When enabled the system will maintain a rolling history of received notifications. When
8682          * disabled the history will be disabled and deleted.
8683          *
8684          * The value 1 - enable, 0 - disable
8685          * @hide
8686          */
8687         public static final String NOTIFICATION_HISTORY_ENABLED = "notification_history_enabled";
8688 
8689         /**
8690          * When enabled conversations marked as favorites will be set to bubble.
8691          *
8692          * The value 1 - enable, 0 - disable
8693          * @hide
8694          */
8695         public static final String BUBBLE_IMPORTANT_CONVERSATIONS
8696                 = "bubble_important_conversations";
8697 
8698         /**
8699          * Whether notifications are dismissed by a right-to-left swipe (instead of a left-to-right
8700          * swipe).
8701          *
8702          * @hide
8703          */
8704         public static final String NOTIFICATION_DISMISS_RTL = "notification_dismiss_rtl";
8705 
8706         /**
8707          * Comma separated list of QS tiles that have been auto-added already.
8708          * @hide
8709          */
8710         public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles";
8711 
8712         /**
8713          * Whether the Lockdown button should be shown in the power menu.
8714          * @hide
8715          */
8716         public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu";
8717 
8718         /**
8719          * Backup manager behavioral parameters.
8720          * This is encoded as a key=value list, separated by commas. Ex:
8721          *
8722          * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true"
8723          *
8724          * The following keys are supported:
8725          *
8726          * <pre>
8727          * key_value_backup_interval_milliseconds  (long)
8728          * key_value_backup_fuzz_milliseconds      (long)
8729          * key_value_backup_require_charging       (boolean)
8730          * key_value_backup_required_network_type  (int)
8731          * full_backup_interval_milliseconds       (long)
8732          * full_backup_require_charging            (boolean)
8733          * full_backup_required_network_type       (int)
8734          * backup_finished_notification_receivers  (String[])
8735          * </pre>
8736          *
8737          * backup_finished_notification_receivers uses ":" as delimeter for values.
8738          *
8739          * <p>
8740          * Type: string
8741          * @hide
8742          */
8743         public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants";
8744 
8745 
8746         /**
8747          * Local transport parameters so we can configure it for tests.
8748          * This is encoded as a key=value list, separated by commas.
8749          *
8750          * The following keys are supported:
8751          *
8752          * <pre>
8753          * fake_encryption_flag  (boolean)
8754          * </pre>
8755          *
8756          * <p>
8757          * Type: string
8758          * @hide
8759          */
8760         public static final String BACKUP_LOCAL_TRANSPORT_PARAMETERS =
8761                 "backup_local_transport_parameters";
8762 
8763         /**
8764          * Flag to set if the system should predictively attempt to re-enable Bluetooth while
8765          * the user is driving.
8766          * @hide
8767          */
8768         public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving";
8769 
8770         /**
8771          * What behavior should be invoked when the volume hush gesture is triggered
8772          * One of VOLUME_HUSH_OFF, VOLUME_HUSH_VIBRATE, VOLUME_HUSH_MUTE.
8773          *
8774          * @hide
8775          */
8776         @SystemApi
8777         public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture";
8778 
8779         /** @hide */
8780         @SystemApi
8781         public static final int VOLUME_HUSH_OFF = 0;
8782         /** @hide */
8783         @SystemApi
8784         public static final int VOLUME_HUSH_VIBRATE = 1;
8785         /** @hide */
8786         @SystemApi
8787         public static final int VOLUME_HUSH_MUTE = 2;
8788 
8789         /**
8790          * The number of times (integer) the user has manually enabled battery saver.
8791          * @hide
8792          */
8793         public static final String LOW_POWER_MANUAL_ACTIVATION_COUNT =
8794                 "low_power_manual_activation_count";
8795 
8796         /**
8797          * Whether the "first time battery saver warning" dialog needs to be shown (0: default)
8798          * or not (1).
8799          *
8800          * @hide
8801          */
8802         public static final String LOW_POWER_WARNING_ACKNOWLEDGED =
8803                 "low_power_warning_acknowledged";
8804 
8805         /**
8806          * 0 (default) Auto battery saver suggestion has not been suppressed. 1) it has been
8807          * suppressed.
8808          * @hide
8809          */
8810         public static final String SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION =
8811                 "suppress_auto_battery_saver_suggestion";
8812 
8813         /**
8814          * List of packages, which data need to be unconditionally cleared before full restore.
8815          * Type: string
8816          * @hide
8817          */
8818         public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE =
8819                 "packages_to_clear_data_before_full_restore";
8820 
8821         /**
8822          * Setting to determine whether to use the new notification priority handling features.
8823          * @hide
8824          */
8825         public static final String NOTIFICATION_NEW_INTERRUPTION_MODEL = "new_interruption_model";
8826 
8827         /**
8828          * How often to check for location access.
8829          * @hide
8830          */
8831         @SystemApi
8832         @TestApi
8833         public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS =
8834                 "location_access_check_interval_millis";
8835 
8836         /**
8837          * Delay between granting location access and checking it.
8838          * @hide
8839          */
8840         @SystemApi
8841         @TestApi
8842         public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS =
8843                 "location_access_check_delay_millis";
8844 
8845         /**
8846          * @deprecated This setting does not have any effect anymore
8847          * @hide
8848          */
8849         @SystemApi
8850         @Deprecated
8851         public static final String LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE =
8852                 "location_permissions_upgrade_to_q_mode";
8853 
8854         /**
8855          * Whether or not the system Auto Revoke feature is disabled.
8856          * @hide
8857          */
8858         @SystemApi
8859         public static final String AUTO_REVOKE_DISABLED = "auto_revoke_disabled";
8860 
8861         /**
8862          * Map of android.theme.customization.* categories to the enabled overlay package for that
8863          * category, formatted as a serialized {@link org.json.JSONObject}. If there is no
8864          * corresponding package included for a category, then all overlay packages in that
8865          * category must be disabled.
8866          * @hide
8867          */
8868         @SystemApi
8869         public static final String THEME_CUSTOMIZATION_OVERLAY_PACKAGES =
8870                 "theme_customization_overlay_packages";
8871 
8872         /**
8873          * Navigation bar mode.
8874          *  0 = 3 button
8875          *  1 = 2 button
8876          *  2 = fully gestural
8877          * @hide
8878          */
8879         public static final String NAVIGATION_MODE =
8880                 "navigation_mode";
8881 
8882         /**
8883          * Scale factor for the back gesture inset size on the left side of the screen.
8884          * @hide
8885          */
8886         public static final String BACK_GESTURE_INSET_SCALE_LEFT =
8887                 "back_gesture_inset_scale_left";
8888 
8889         /**
8890          * Scale factor for the back gesture inset size on the right side of the screen.
8891          * @hide
8892          */
8893         public static final String BACK_GESTURE_INSET_SCALE_RIGHT =
8894                 "back_gesture_inset_scale_right";
8895 
8896         /**
8897          * Current provider of proximity-based sharing services.
8898          * Default value in @string/config_defaultNearbySharingComponent.
8899          * No VALIDATOR as this setting will not be backed up.
8900          * @hide
8901          */
8902         public static final String NEARBY_SHARING_COMPONENT = "nearby_sharing_component";
8903 
8904         /**
8905          * Controls whether aware is enabled.
8906          * @hide
8907          */
8908         public static final String AWARE_ENABLED = "aware_enabled";
8909 
8910         /**
8911          * Controls whether aware_lock is enabled.
8912          * @hide
8913          */
8914         public static final String AWARE_LOCK_ENABLED = "aware_lock_enabled";
8915 
8916         /**
8917          * Controls whether tap gesture is enabled.
8918          * @hide
8919          */
8920         public static final String TAP_GESTURE = "tap_gesture";
8921 
8922         /**
8923          * Controls whether the people strip is enabled.
8924          * @hide
8925          */
8926         public static final String PEOPLE_STRIP = "people_strip";
8927 
8928         /**
8929          * Whether or not to enable media resumption
8930          * When enabled, media controls in quick settings will populate on boot and persist if
8931          * resumable via a MediaBrowserService.
8932          * @see Settings.Global#SHOW_MEDIA_ON_QUICK_SETTINGS
8933          * @hide
8934          */
8935         public static final String MEDIA_CONTROLS_RESUME = "qs_media_resumption";
8936 
8937         /**
8938          * Controls if window magnification is enabled.
8939          * @hide
8940          */
8941         public static final String WINDOW_MAGNIFICATION = "window_magnification";
8942 
8943         /**
8944          * Controls magnification mode when magnification is enabled via a system-wide
8945          * triple tap gesture or the accessibility shortcut.
8946          *
8947          * @see#ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN
8948          * @see#ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW
8949          * @hide
8950          */
8951         public static final String ACCESSIBILITY_MAGNIFICATION_MODE =
8952                 "accessibility_magnification_mode";
8953 
8954         /**
8955          * Magnification mode value that magnifies whole display.
8956          * @hide
8957          */
8958         public static final int ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN = 0x1;
8959 
8960         /**
8961          * Magnification mode value that magnifies magnify particular region in a window
8962          * @hide
8963          */
8964         public static final int ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW = 0x2;
8965 
8966         /**
8967          * Whether the Adaptive connectivity option is enabled.
8968          *
8969          * @hide
8970          */
8971         public static final String ADAPTIVE_CONNECTIVITY_ENABLED = "adaptive_connectivity_enabled";
8972 
8973         /**
8974          * Keys we no longer back up under the current schema, but want to continue to
8975          * process when restoring historical backup datasets.
8976          *
8977          * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
8978          * otherwise they won't be restored.
8979          *
8980          * @hide
8981          */
8982         public static final String[] LEGACY_RESTORE_SETTINGS = {
8983                 ENABLED_NOTIFICATION_LISTENERS,
8984                 ENABLED_NOTIFICATION_ASSISTANT,
8985                 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES
8986         };
8987 
8988         /**
8989          * How long Assistant handles have enabled in milliseconds.
8990          *
8991          * @hide
8992          */
8993         public static final String ASSIST_HANDLES_LEARNING_TIME_ELAPSED_MILLIS =
8994                 "reminder_exp_learning_time_elapsed";
8995 
8996         /**
8997          * How many times the Assistant has been triggered using the touch gesture.
8998          *
8999          * @hide
9000          */
9001         public static final String ASSIST_HANDLES_LEARNING_EVENT_COUNT =
9002                 "reminder_exp_learning_event_count";
9003 
9004         /**
9005          * These entries are considered common between the personal and the managed profile,
9006          * since the managed profile doesn't get to change them.
9007          */
9008         private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
9009 
9010         static {
9011             CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
9012             CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
9013             CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
9014             CLONE_TO_MANAGED_PROFILE.add(CONTENT_CAPTURE_ENABLED);
9015             CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
9016             CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER);
9017             CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
9018             CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
9019             CLONE_TO_MANAGED_PROFILE.add(SHOW_IME_WITH_HARD_KEYBOARD);
9020         }
9021 
9022         /** @hide */
getCloneToManagedProfileSettings(Set<String> outKeySet)9023         public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
9024             outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
9025         }
9026 
9027         /**
9028          * Secure settings which can be accessed by instant apps.
9029          * @hide
9030          */
9031         public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
9032         static {
9033             INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES);
9034             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD);
9035             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED);
9036             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED);
9037             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET);
9038             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE);
9039             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR);
9040             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE);
9041             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR);
9042             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR);
9043             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE);
9044             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE);
9045             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR);
9046             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED);
9047             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER);
9048             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY);
9049             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED);
9050             INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON);
9051 
9052             INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD);
9053             INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS);
9054 
9055             INSTANT_APP_SETTINGS.add(ANDROID_ID);
9056 
9057             INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION);
9058         }
9059 
9060         /**
9061          * Helper method for determining if a location provider is enabled.
9062          *
9063          * @param cr the content resolver to use
9064          * @param provider the location provider to query
9065          * @return true if the provider is enabled
9066          *
9067          * @deprecated use {@link LocationManager#isProviderEnabled(String)}
9068          */
9069         @Deprecated
isLocationProviderEnabled(ContentResolver cr, String provider)9070         public static boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
9071             String allowedProviders = Settings.Secure.getStringForUser(cr,
9072                     LOCATION_PROVIDERS_ALLOWED, cr.getUserId());
9073             return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
9074         }
9075 
9076         /**
9077          * Thread-safe method for enabling or disabling a single location provider. This will have
9078          * no effect on Android Q and above.
9079          * @param cr the content resolver to use
9080          * @param provider the location provider to enable or disable
9081          * @param enabled true if the provider should be enabled
9082          * @deprecated This API is deprecated
9083          */
9084         @Deprecated
setLocationProviderEnabled(ContentResolver cr, String provider, boolean enabled)9085         public static void setLocationProviderEnabled(ContentResolver cr,
9086                 String provider, boolean enabled) {
9087         }
9088     }
9089 
9090     /**
9091      * Global system settings, containing preferences that always apply identically
9092      * to all defined users.  Applications can read these but are not allowed to write;
9093      * like the "Secure" settings, these are for preferences that the user must
9094      * explicitly modify through the system UI or specialized APIs for those values.
9095      */
9096     public static final class Global extends NameValueTable {
9097         // NOTE: If you add new settings here, be sure to add them to
9098         // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked.
9099 
9100         /**
9101          * The content:// style URL for global secure settings items.  Not public.
9102          */
9103         public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
9104 
9105         /**
9106          * Whether the notification bubbles are globally enabled
9107          * The value is boolean (1 or 0).
9108          * @hide
9109          */
9110         @TestApi
9111         public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
9112 
9113         /**
9114          * Whether users are allowed to add more users or guest from lockscreen.
9115          * <p>
9116          * Type: int
9117          * @hide
9118          */
9119         public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
9120 
9121         /**
9122          * Whether applying ramping ringer on incoming phone call ringtone.
9123          * <p>1 = apply ramping ringer
9124          * <p>0 = do not apply ramping ringer
9125          */
9126         public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer";
9127 
9128         /**
9129          * Setting whether the global gesture for enabling accessibility is enabled.
9130          * If this gesture is enabled the user will be able to perfrom it to enable
9131          * the accessibility state without visiting the settings app.
9132          *
9133          * @hide
9134          * No longer used. Should be removed once all dependencies have been updated.
9135          */
9136         @UnsupportedAppUsage
9137         public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
9138                 "enable_accessibility_global_gesture_enabled";
9139 
9140         /**
9141          * Whether Airplane Mode is on.
9142          */
9143         public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
9144 
9145         /**
9146          * Whether Theater Mode is on.
9147          * {@hide}
9148          */
9149         @SystemApi
9150         public static final String THEATER_MODE_ON = "theater_mode_on";
9151 
9152         /**
9153          * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
9154          */
9155         public static final String RADIO_BLUETOOTH = "bluetooth";
9156 
9157         /**
9158          * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
9159          */
9160         public static final String RADIO_WIFI = "wifi";
9161 
9162         /**
9163          * {@hide}
9164          */
9165         public static final String RADIO_WIMAX = "wimax";
9166         /**
9167          * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
9168          */
9169         public static final String RADIO_CELL = "cell";
9170 
9171         /**
9172          * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
9173          */
9174         public static final String RADIO_NFC = "nfc";
9175 
9176         /**
9177          * A comma separated list of radios that need to be disabled when airplane mode
9178          * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
9179          * included in the comma separated list.
9180          */
9181         public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
9182 
9183         /**
9184          * A comma separated list of radios that should to be disabled when airplane mode
9185          * is on, but can be manually reenabled by the user.  For example, if RADIO_WIFI is
9186          * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
9187          * will be turned off when entering airplane mode, but the user will be able to reenable
9188          * Wifi in the Settings app.
9189          * @hide
9190          */
9191         @SystemApi
9192         public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
9193 
9194         /**
9195          * An integer representing the Bluetooth Class of Device (CoD).
9196          *
9197          * @hide
9198          */
9199         public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device";
9200 
9201         /**
9202          * A Long representing a bitmap of profiles that should be disabled when bluetooth starts.
9203          * See {@link android.bluetooth.BluetoothProfile}.
9204          * {@hide}
9205          */
9206         public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";
9207 
9208         /**
9209          * A semi-colon separated list of Bluetooth interoperability workarounds.
9210          * Each entry is a partial Bluetooth device address string and an integer representing
9211          * the feature to be disabled, separated by a comma. The integer must correspond
9212          * to a interoperability feature as defined in "interop.h" in /system/bt.
9213          * <p>
9214          * Example: <br/>
9215          *   "00:11:22,0;01:02:03:04,2"
9216          * @hide
9217          */
9218        public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";
9219 
9220         /**
9221          * The policy for deciding when Wi-Fi should go to sleep (which will in
9222          * turn switch to using the mobile data as an Internet connection).
9223          * <p>
9224          * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
9225          * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
9226          * {@link #WIFI_SLEEP_POLICY_NEVER}.
9227          * @deprecated This is no longer used or set by the platform.
9228          */
9229         @Deprecated
9230         public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
9231 
9232         /**
9233          * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
9234          * policy, which is to sleep shortly after the turning off
9235          * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
9236          * @deprecated This is no longer used by the platform.
9237          */
9238         @Deprecated
9239         public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
9240 
9241         /**
9242          * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
9243          * the device is on battery, and never go to sleep when the device is
9244          * plugged in.
9245          * @deprecated This is no longer used by the platform.
9246          */
9247         @Deprecated
9248         public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
9249 
9250         /**
9251          * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
9252          * @deprecated This is no longer used by the platform.
9253          */
9254         @Deprecated
9255         public static final int WIFI_SLEEP_POLICY_NEVER = 2;
9256 
9257         /**
9258          * Value to specify if the user prefers the date, time and time zone
9259          * to be automatically fetched from the network (NITZ). 1=yes, 0=no
9260          */
9261         public static final String AUTO_TIME = "auto_time";
9262 
9263         /**
9264          * Value to specify if the user prefers the time zone
9265          * to be automatically fetched from the network (NITZ). 1=yes, 0=no
9266          */
9267         public static final String AUTO_TIME_ZONE = "auto_time_zone";
9268 
9269         /**
9270          * URI for the car dock "in" event sound.
9271          * @hide
9272          */
9273         public static final String CAR_DOCK_SOUND = "car_dock_sound";
9274 
9275         /**
9276          * URI for the car dock "out" event sound.
9277          * @hide
9278          */
9279         public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
9280 
9281         /**
9282          * URI for the desk dock "in" event sound.
9283          * @hide
9284          */
9285         public static final String DESK_DOCK_SOUND = "desk_dock_sound";
9286 
9287         /**
9288          * URI for the desk dock "out" event sound.
9289          * @hide
9290          */
9291         public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
9292 
9293         /**
9294          * Whether to play a sound for dock events.
9295          * @hide
9296          */
9297         public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
9298 
9299         /**
9300          * Whether to play a sound for dock events, only when an accessibility service is on.
9301          * @hide
9302          */
9303         public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility";
9304 
9305         /**
9306          * URI for the "device locked" (keyguard shown) sound.
9307          * @hide
9308          */
9309         public static final String LOCK_SOUND = "lock_sound";
9310 
9311         /**
9312          * URI for the "device unlocked" sound.
9313          * @hide
9314          */
9315         public static final String UNLOCK_SOUND = "unlock_sound";
9316 
9317         /**
9318          * URI for the "device is trusted" sound, which is played when the device enters the trusted
9319          * state without unlocking.
9320          * @hide
9321          */
9322         public static final String TRUSTED_SOUND = "trusted_sound";
9323 
9324         /**
9325          * URI for the low battery sound file.
9326          * @hide
9327          */
9328         public static final String LOW_BATTERY_SOUND = "low_battery_sound";
9329 
9330         /**
9331          * Whether to play a sound for low-battery alerts.
9332          * @hide
9333          */
9334         public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
9335 
9336         /**
9337          * URI for the "wireless charging started" sound.
9338          * @hide
9339          */
9340         public static final String WIRELESS_CHARGING_STARTED_SOUND =
9341                 "wireless_charging_started_sound";
9342 
9343         /**
9344          * URI for "wired charging started" sound.
9345          * @hide
9346          */
9347         public static final String CHARGING_STARTED_SOUND = "charging_started_sound";
9348 
9349         /**
9350          * Whether to play a sound for charging events.
9351          * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_SOUNDS_ENABLED} instead
9352          * @hide
9353          */
9354         @Deprecated
9355         public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
9356 
9357         /**
9358          * Whether to vibrate for wireless charging events.
9359          * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_VIBRATION_ENABLED}
9360          * @hide
9361          */
9362         @Deprecated
9363         public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled";
9364 
9365         /**
9366          * Whether we keep the device on while the device is plugged in.
9367          * Supported values are:
9368          * <ul>
9369          * <li>{@code 0} to never stay on while plugged in</li>
9370          * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
9371          * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
9372          * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
9373          * </ul>
9374          * These values can be OR-ed together.
9375          */
9376         public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
9377 
9378         /**
9379          * When the user has enable the option to have a "bug report" command
9380          * in the power menu.
9381          * @hide
9382          */
9383         public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
9384 
9385         /**
9386          * The package name for the custom bugreport handler app. This app must be whitelisted.
9387          * This is currently used only by Power Menu short press.
9388          *
9389          * @hide
9390          */
9391         public static final String CUSTOM_BUGREPORT_HANDLER_APP = "custom_bugreport_handler_app";
9392 
9393         /**
9394          * The user id for the custom bugreport handler app. This is currently used only by Power
9395          * Menu short press.
9396          *
9397          * @hide
9398          */
9399         public static final String CUSTOM_BUGREPORT_HANDLER_USER = "custom_bugreport_handler_user";
9400 
9401         /**
9402          * Whether ADB over USB is enabled.
9403          */
9404         public static final String ADB_ENABLED = "adb_enabled";
9405 
9406         /**
9407          * Whether ADB over Wifi is enabled.
9408          * @hide
9409          */
9410         public static final String ADB_WIFI_ENABLED = "adb_wifi_enabled";
9411 
9412         /**
9413          * Whether Views are allowed to save their attribute data.
9414          * @hide
9415          */
9416         public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
9417 
9418         /**
9419          * Which application package is allowed to save View attribute data.
9420          * @hide
9421          */
9422         public static final String DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE =
9423                 "debug_view_attributes_application_package";
9424 
9425         /**
9426          * Whether assisted GPS should be enabled or not.
9427          * @hide
9428          */
9429         public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
9430 
9431         /**
9432          * Whether bluetooth is enabled/disabled
9433          * 0=disabled. 1=enabled.
9434          */
9435         public static final String BLUETOOTH_ON = "bluetooth_on";
9436 
9437         /**
9438          * CDMA Cell Broadcast SMS
9439          *                            0 = CDMA Cell Broadcast SMS disabled
9440          *                            1 = CDMA Cell Broadcast SMS enabled
9441          * @hide
9442          */
9443         public static final String CDMA_CELL_BROADCAST_SMS =
9444                 "cdma_cell_broadcast_sms";
9445 
9446         /**
9447          * The CDMA roaming mode 0 = Home Networks, CDMA default
9448          *                       1 = Roaming on Affiliated networks
9449          *                       2 = Roaming on any networks
9450          * @hide
9451          */
9452         public static final String CDMA_ROAMING_MODE = "roaming_settings";
9453 
9454         /**
9455          * The CDMA subscription mode 0 = RUIM/SIM (default)
9456          *                                1 = NV
9457          * @hide
9458          */
9459         public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
9460 
9461         /**
9462          * The default value for whether background data is enabled or not.
9463          *
9464          * Used by {@code NetworkPolicyManagerService}.
9465          *
9466          * @hide
9467          */
9468         public static final String DEFAULT_RESTRICT_BACKGROUND_DATA =
9469                 "default_restrict_background_data";
9470 
9471         /** Inactivity timeout to track mobile data activity.
9472         *
9473         * If set to a positive integer, it indicates the inactivity timeout value in seconds to
9474         * infer the data activity of mobile network. After a period of no activity on mobile
9475         * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
9476         * intent is fired to indicate a transition of network status from "active" to "idle". Any
9477         * subsequent activity on mobile networks triggers the firing of {@code
9478         * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
9479         *
9480         * Network activity refers to transmitting or receiving data on the network interfaces.
9481         *
9482         * Tracking is disabled if set to zero or negative value.
9483         *
9484         * @hide
9485         */
9486        public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
9487 
9488        /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
9489         * but for Wifi network.
9490         * @hide
9491         */
9492        public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
9493 
9494        /**
9495         * Whether or not data roaming is enabled. (0 = false, 1 = true)
9496         */
9497        public static final String DATA_ROAMING = "data_roaming";
9498 
9499        /**
9500         * The value passed to a Mobile DataConnection via bringUp which defines the
9501         * number of retries to preform when setting up the initial connection. The default
9502         * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
9503         * @hide
9504         */
9505        public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
9506 
9507        /**
9508         * Whether any package can be on external storage. When this is true, any
9509         * package, regardless of manifest values, is a candidate for installing
9510         * or moving onto external storage. (0 = false, 1 = true)
9511         * @hide
9512         */
9513        public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external";
9514 
9515         /**
9516          * The default SM-DP+ configured for this device.
9517          *
9518          * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to
9519          * download profiles. If this value is set, the LPA will query this server for any profiles
9520          * available to this device. If any are available, they may be downloaded during device
9521          * provisioning or in settings without needing the user to enter an activation code.
9522          *
9523          * @see android.service.euicc.EuiccService
9524          * @hide
9525          */
9526         @SystemApi
9527         public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
9528 
9529         /**
9530          * Whether any profile has ever been downloaded onto a eUICC on the device.
9531          *
9532          * <p>Used to hide eUICC UI from users who have never made use of it and would only be
9533          * confused by seeing references to it in settings.
9534          * (0 = false, 1 = true)
9535          * @hide
9536          */
9537         @SystemApi
9538         public static final String EUICC_PROVISIONED = "euicc_provisioned";
9539 
9540         /**
9541          * List of ISO country codes in which eUICC UI is shown. Country codes should be separated
9542          * by comma.
9543          *
9544          * Note: if {@link #EUICC_SUPPORTED_COUNTRIES} is empty, then {@link
9545          * #EUICC_UNSUPPORTED_COUNTRIES} is used.
9546          *
9547          * <p>Used to hide eUICC UI from users who are currently in countries where no carriers
9548          * support eUICC.
9549          *
9550          * @hide
9551          */
9552         @SystemApi
9553         public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries";
9554 
9555         /**
9556          * List of ISO country codes in which eUICC UI is not shown. Country codes should be
9557          * separated by comma.
9558          *
9559          * Note: if {@link #EUICC_SUPPORTED_COUNTRIES} is empty, then {@link
9560          * #EUICC_UNSUPPORTED_COUNTRIES} is used.
9561          *
9562          * <p>Used to hide eUICC UI from users who are currently in countries where no carriers
9563          * support eUICC.
9564          *
9565          * @hide
9566          */
9567         @SystemApi
9568         public static final String EUICC_UNSUPPORTED_COUNTRIES = "euicc_unsupported_countries";
9569 
9570         /**
9571          * Whether any activity can be resized. When this is true, any
9572          * activity, regardless of manifest values, can be resized for multi-window.
9573          * (0 = false, 1 = true)
9574          * @hide
9575          */
9576         public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES
9577                 = "force_resizable_activities";
9578 
9579         /**
9580          * Whether to enable experimental freeform support for windows.
9581          * @hide
9582          */
9583         public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT
9584                 = "enable_freeform_support";
9585 
9586         /**
9587          * Whether to enable experimental desktop mode on secondary displays.
9588          * @hide
9589          */
9590         public static final String DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS =
9591                 "force_desktop_mode_on_external_displays";
9592 
9593         /**
9594          * Whether to allow non-resizable apps to be freeform.
9595          * @hide
9596          */
9597         public static final String DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM =
9598                 "enable_sizecompat_freeform";
9599 
9600         /**
9601          * If true, shadows drawn around the window will be rendered by the system compositor. If
9602          * false, shadows will be drawn by the client by setting an elevation on the root view and
9603          * the contents will be inset by the surface insets.
9604          * (0 = false, 1 = true)
9605          * @hide
9606          */
9607         public static final String DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR =
9608                 "render_shadows_in_compositor";
9609 
9610        /**
9611         * Whether user has enabled development settings.
9612         */
9613        public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
9614 
9615        /**
9616         * Whether the device has been provisioned (0 = false, 1 = true).
9617         * <p>On a multiuser device with a separate system user, the screen may be locked
9618         * as soon as this is set to true and further activities cannot be launched on the
9619         * system user unless they are marked to show over keyguard.
9620         */
9621        public static final String DEVICE_PROVISIONED = "device_provisioned";
9622 
9623         /**
9624          * Indicates whether mobile data should be allowed while the device is being provisioned.
9625          * This allows the provisioning process to turn off mobile data before the user
9626          * has an opportunity to set things up, preventing other processes from burning
9627          * precious bytes before wifi is setup.
9628          * <p>
9629          * Type: int (0 for false, 1 for true)
9630          *
9631          * @hide
9632          */
9633         @SystemApi
9634         public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED =
9635                 "device_provisioning_mobile_data";
9636 
9637        /**
9638         * The saved value for WindowManagerService.setForcedDisplaySize().
9639         * Two integers separated by a comma.  If unset, then use the real display size.
9640         * @hide
9641         */
9642        public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
9643 
9644        /**
9645         * The saved value for WindowManagerService.setForcedDisplayScalingMode().
9646         * 0 or unset if scaling is automatic, 1 if scaling is disabled.
9647         * @hide
9648         */
9649        public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
9650 
9651        /**
9652         * The maximum size, in bytes, of a download that the download manager will transfer over
9653         * a non-wifi connection.
9654         * @hide
9655         */
9656        public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
9657                "download_manager_max_bytes_over_mobile";
9658 
9659        /**
9660         * The recommended maximum size, in bytes, of a download that the download manager should
9661         * transfer over a non-wifi connection. Over this size, the use will be warned, but will
9662         * have the option to start the download over the mobile connection anyway.
9663         * @hide
9664         */
9665        public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
9666                "download_manager_recommended_max_bytes_over_mobile";
9667 
9668        /**
9669         * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
9670         */
9671        @Deprecated
9672        public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
9673 
9674        /**
9675         * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
9676         * sent or processed. (0 = false, 1 = true)
9677         * @hide
9678         */
9679        public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
9680 
9681         /**
9682          * Controls whether volume control commands via HDMI CEC are enabled. (0 = false, 1 =
9683          * true).
9684          *
9685          * <p>Effects on different device types:
9686          * <table>
9687          *     <tr><th>HDMI CEC device type</th><th>0: disabled</th><th>1: enabled</th></tr>
9688          *     <tr>
9689          *         <td>TV (type: 0)</td>
9690          *         <td>Per CEC specification.</td>
9691          *         <td>TV changes system volume. TV no longer reacts to incoming volume changes
9692          *         via {@code <User Control Pressed>}. TV no longer handles {@code <Report Audio
9693          *         Status>}.</td>
9694          *     </tr>
9695          *     <tr>
9696          *         <td>Playback device (type: 4)</td>
9697          *         <td>Device sends volume commands to TV/Audio system via {@code <User Control
9698          *         Pressed>}</td>
9699          *         <td>Device does not send volume commands via {@code <User Control Pressed>}.</td>
9700          *     </tr>
9701          *     <tr>
9702          *         <td>Audio device (type: 5)</td>
9703          *         <td>Full "System Audio Control" capabilities.</td>
9704          *         <td>Audio device no longer reacts to incoming {@code <User Control Pressed>}
9705          *         volume commands. Audio device no longer reports volume changes via {@code
9706          *         <Report Audio Status>}.</td>
9707          *     </tr>
9708          * </table>
9709          *
9710          * <p> Due to the resulting behavior, usage on TV and Audio devices is discouraged.
9711          *
9712          * @hide
9713          * @see android.hardware.hdmi.HdmiControlManager#setHdmiCecVolumeControlEnabled(boolean)
9714          */
9715         public static final String HDMI_CONTROL_VOLUME_CONTROL_ENABLED =
9716                 "hdmi_control_volume_control_enabled";
9717 
9718        /**
9719         * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on
9720         * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will
9721         * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be
9722         * activated.
9723         * @hide
9724         */
9725         public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED =
9726                 "hdmi_system_audio_control_enabled";
9727 
9728         /**
9729          * Whether HDMI Routing Control feature is enabled. If enabled, the switch device will
9730          * route to the correct input source on receiving Routing Control related messages. If
9731          * disabled, you can only switch the input via controls on this device.
9732          * @hide
9733          */
9734         public static final String HDMI_CEC_SWITCH_ENABLED =
9735                 "hdmi_cec_switch_enabled";
9736 
9737         /**
9738          * Whether TV will automatically turn on upon reception of the CEC command
9739          * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
9740          *
9741          * @hide
9742          */
9743         public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
9744                 "hdmi_control_auto_wakeup_enabled";
9745 
9746         /**
9747          * Whether TV will also turn off other CEC devices when it goes to standby mode.
9748          * (0 = false, 1 = true)
9749          *
9750          * @hide
9751          */
9752         public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
9753                 "hdmi_control_auto_device_off_enabled";
9754 
9755         /**
9756          * Whether or not media is shown automatically when bypassing as a heads up.
9757          * @hide
9758          */
9759         public static final String SHOW_MEDIA_ON_QUICK_SETTINGS =
9760                 "qs_media_player";
9761 
9762         /**
9763          * The interval in milliseconds at which location requests will be throttled when they are
9764          * coming from the background.
9765          *
9766          * @hide
9767          */
9768         public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS =
9769                 "location_background_throttle_interval_ms";
9770 
9771         /**
9772          * Most frequent location update interval in milliseconds that proximity alert is allowed
9773          * to request.
9774          * @hide
9775          */
9776         public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS =
9777                 "location_background_throttle_proximity_alert_interval_ms";
9778 
9779         /**
9780          * Packages that are whitelisted for background throttling (throttling will not be applied).
9781          * @hide
9782          */
9783         public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST =
9784             "location_background_throttle_package_whitelist";
9785 
9786         /**
9787          * Packages that are whitelisted for ignoring location settings (may retrieve location even
9788          * when user location settings are off), for emergency purposes.
9789          * @hide
9790          */
9791         @TestApi
9792         public static final String LOCATION_IGNORE_SETTINGS_PACKAGE_WHITELIST =
9793                 "location_ignore_settings_package_whitelist";
9794 
9795         /**
9796         * Whether TV will switch to MHL port when a mobile device is plugged in.
9797         * (0 = false, 1 = true)
9798         * @hide
9799         */
9800        public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
9801 
9802        /**
9803         * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
9804         * @hide
9805         */
9806        public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
9807 
9808        /**
9809         * Whether mobile data connections are allowed by the user.  See
9810         * ConnectivityManager for more info.
9811         * @hide
9812         */
9813        @UnsupportedAppUsage
9814        public static final String MOBILE_DATA = "mobile_data";
9815 
9816        /**
9817         * Whether the mobile data connection should remain active even when higher
9818         * priority networks like WiFi are active, to help make network switching faster.
9819         *
9820         * See ConnectivityService for more info.
9821         *
9822         * (0 = disabled, 1 = enabled)
9823         * @hide
9824         */
9825        public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
9826 
9827         /**
9828          * Whether the wifi data connection should remain active even when higher
9829          * priority networks like Ethernet are active, to keep both networks.
9830          * In the case where higher priority networks are connected, wifi will be
9831          * unused unless an application explicitly requests to use it.
9832          *
9833          * See ConnectivityService for more info.
9834          *
9835          * (0 = disabled, 1 = enabled)
9836          * @hide
9837          */
9838         public static final String WIFI_ALWAYS_REQUESTED = "wifi_always_requested";
9839 
9840         /**
9841          * Size of the event buffer for IP connectivity metrics.
9842          * @hide
9843          */
9844         public static final String CONNECTIVITY_METRICS_BUFFER_SIZE =
9845               "connectivity_metrics_buffer_size";
9846 
9847        /** {@hide} */
9848        public static final String NETSTATS_ENABLED = "netstats_enabled";
9849        /** {@hide} */
9850        public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
9851        /** {@hide} */
9852        @Deprecated
9853        public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
9854        /** {@hide} */
9855        public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
9856        /** {@hide} */
9857        public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
9858        /** {@hide} */
9859        public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled";
9860        /** {@hide} */
9861        public static final String NETSTATS_COMBINE_SUBTYPE_ENABLED = "netstats_combine_subtype_enabled";
9862 
9863        /** {@hide} */
9864        public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
9865        /** {@hide} */
9866        public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
9867        /** {@hide} */
9868        public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
9869        /** {@hide} */
9870        public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
9871 
9872        /** {@hide} */
9873        public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
9874        /** {@hide} */
9875        public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
9876        /** {@hide} */
9877        public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
9878        /** {@hide} */
9879        public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
9880 
9881        /** {@hide} */
9882        public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
9883        /** {@hide} */
9884        public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
9885        /** {@hide} */
9886        public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
9887        /** {@hide} */
9888        public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
9889 
9890        /** {@hide} */
9891        public static final String NETPOLICY_QUOTA_ENABLED = "netpolicy_quota_enabled";
9892        /** {@hide} */
9893        public static final String NETPOLICY_QUOTA_UNLIMITED = "netpolicy_quota_unlimited";
9894        /** {@hide} */
9895        public static final String NETPOLICY_QUOTA_LIMITED = "netpolicy_quota_limited";
9896        /** {@hide} */
9897        public static final String NETPOLICY_QUOTA_FRAC_JOBS = "netpolicy_quota_frac_jobs";
9898        /** {@hide} */
9899        public static final String NETPOLICY_QUOTA_FRAC_MULTIPATH = "netpolicy_quota_frac_multipath";
9900 
9901        /** {@hide} */
9902        public static final String NETPOLICY_OVERRIDE_ENABLED = "netpolicy_override_enabled";
9903 
9904        /**
9905         * User preference for which network(s) should be used. Only the
9906         * connectivity service should touch this.
9907         */
9908        public static final String NETWORK_PREFERENCE = "network_preference";
9909 
9910        /**
9911         * Which package name to use for network scoring. If null, or if the package is not a valid
9912         * scorer app, external network scores will neither be requested nor accepted.
9913         * @hide
9914         */
9915        @UnsupportedAppUsage
9916        public static final String NETWORK_SCORER_APP = "network_scorer_app";
9917 
9918         /**
9919          * Whether night display forced auto mode is available.
9920          * 0 = unavailable, 1 = available.
9921          * @hide
9922          */
9923         public static final String NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE =
9924                 "night_display_forced_auto_mode_available";
9925 
9926        /**
9927         * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
9928         * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
9929         * exceeded.
9930         * @hide
9931         */
9932        public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
9933 
9934        /**
9935         * The length of time in milli-seconds that automatic small adjustments to
9936         * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
9937         * @hide
9938         */
9939        public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
9940 
9941        /** Preferred NTP server. {@hide} */
9942        public static final String NTP_SERVER = "ntp_server";
9943        /** Timeout in milliseconds to wait for NTP server. {@hide} */
9944        public static final String NTP_TIMEOUT = "ntp_timeout";
9945 
9946        /** {@hide} */
9947        public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval";
9948 
9949         /**
9950          * Whether or not Settings should enable psd API.
9951          * {@hide}
9952          */
9953         public static final String SETTINGS_USE_PSD_API = "settings_use_psd_api";
9954 
9955         /**
9956          * Whether or not Settings should enable external provider API.
9957          * {@hide}
9958          */
9959         public static final String SETTINGS_USE_EXTERNAL_PROVIDER_API =
9960                 "settings_use_external_provider_api";
9961 
9962        /**
9963         * Sample validity in seconds to configure for the system DNS resolver.
9964         * {@hide}
9965         */
9966        public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS =
9967                "dns_resolver_sample_validity_seconds";
9968 
9969        /**
9970         * Success threshold in percent for use with the system DNS resolver.
9971         * {@hide}
9972         */
9973        public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT =
9974                 "dns_resolver_success_threshold_percent";
9975 
9976        /**
9977         * Minimum number of samples needed for statistics to be considered meaningful in the
9978         * system DNS resolver.
9979         * {@hide}
9980         */
9981        public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples";
9982 
9983        /**
9984         * Maximum number taken into account for statistics purposes in the system DNS resolver.
9985         * {@hide}
9986         */
9987        public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples";
9988 
9989        /**
9990         * Whether to disable the automatic scheduling of system updates.
9991         * 1 = system updates won't be automatically scheduled (will always
9992         * present notification instead).
9993         * 0 = system updates will be automatically scheduled. (default)
9994         * @hide
9995         */
9996        @SystemApi
9997        public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
9998 
9999        /** Timeout for package verification.
10000         * @hide */
10001        public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
10002 
10003         /** Timeout for app integrity verification.
10004          * @hide */
10005         public static final String APP_INTEGRITY_VERIFICATION_TIMEOUT =
10006                 "app_integrity_verification_timeout";
10007 
10008        /** Default response code for package verification.
10009         * @hide */
10010        public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
10011 
10012        /**
10013         * Show package verification setting in the Settings app.
10014         * 1 = show (default)
10015         * 0 = hide
10016         * @hide
10017         */
10018        public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
10019 
10020        /**
10021         * Run package verification on apps installed through ADB/ADT/USB
10022         * 1 = perform package verification on ADB installs (default)
10023         * 0 = bypass package verification on ADB installs
10024         * @hide
10025         */
10026        public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
10027 
10028         /**
10029          * Run integrity checks for integrity rule providers.
10030          * 0 = bypass integrity verification on installs from rule providers (default)
10031          * 1 = perform integrity verification on installs from rule providers
10032          * @hide
10033          */
10034         public static final String INTEGRITY_CHECK_INCLUDES_RULE_PROVIDER =
10035                 "verify_integrity_for_rule_provider";
10036 
10037        /**
10038         * Time since last fstrim (milliseconds) after which we force one to happen
10039         * during device startup.  If unset, the default is 3 days.
10040         * @hide
10041         */
10042        public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
10043 
10044        /**
10045         * The interval in milliseconds at which to check packet counts on the
10046         * mobile data interface when screen is on, to detect possible data
10047         * connection problems.
10048         * @hide
10049         */
10050        public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
10051                "pdp_watchdog_poll_interval_ms";
10052 
10053        /**
10054         * The interval in milliseconds at which to check packet counts on the
10055         * mobile data interface when screen is off, to detect possible data
10056         * connection problems.
10057         * @hide
10058         */
10059        public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
10060                "pdp_watchdog_long_poll_interval_ms";
10061 
10062        /**
10063         * The interval in milliseconds at which to check packet counts on the
10064         * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
10065         * outgoing packets has been reached without incoming packets.
10066         * @hide
10067         */
10068        public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
10069                "pdp_watchdog_error_poll_interval_ms";
10070 
10071        /**
10072         * The number of outgoing packets sent without seeing an incoming packet
10073         * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
10074         * device is logged to the event log
10075         * @hide
10076         */
10077        public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
10078                "pdp_watchdog_trigger_packet_count";
10079 
10080        /**
10081         * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
10082         * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
10083         * attempting data connection recovery.
10084         * @hide
10085         */
10086        public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
10087                "pdp_watchdog_error_poll_count";
10088 
10089        /**
10090         * The number of failed PDP reset attempts before moving to something more
10091         * drastic: re-registering to the network.
10092         * @hide
10093         */
10094        public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
10095                "pdp_watchdog_max_pdp_reset_fail_count";
10096 
10097        /**
10098         * URL to open browser on to allow user to manage a prepay account
10099         * @hide
10100         */
10101        public static final String SETUP_PREPAID_DATA_SERVICE_URL =
10102                "setup_prepaid_data_service_url";
10103 
10104        /**
10105         * URL to attempt a GET on to see if this is a prepay device
10106         * @hide
10107         */
10108        public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
10109                "setup_prepaid_detection_target_url";
10110 
10111        /**
10112         * Host to check for a redirect to after an attempt to GET
10113         * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
10114         * this is a prepaid device with zero balance.)
10115         * @hide
10116         */
10117        public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
10118                "setup_prepaid_detection_redir_host";
10119 
10120        /**
10121         * The interval in milliseconds at which to check the number of SMS sent out without asking
10122         * for use permit, to limit the un-authorized SMS usage.
10123         *
10124         * @hide
10125         */
10126        public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
10127                "sms_outgoing_check_interval_ms";
10128 
10129        /**
10130         * The number of outgoing SMS sent without asking for user permit (of {@link
10131         * #SMS_OUTGOING_CHECK_INTERVAL_MS}
10132         *
10133         * @hide
10134         */
10135        public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
10136                "sms_outgoing_check_max_count";
10137 
10138        /**
10139         * Used to disable SMS short code confirmation - defaults to true.
10140         * True indcates we will do the check, etc.  Set to false to disable.
10141         * @see com.android.internal.telephony.SmsUsageMonitor
10142         * @hide
10143         */
10144        public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
10145 
10146         /**
10147          * Used to select which country we use to determine premium sms codes.
10148          * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
10149          * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
10150          * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
10151          * @hide
10152          */
10153         public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
10154 
10155         /**
10156          * Used to select TCP's default initial receiver window size in segments - defaults to a
10157          * build config value.
10158          * @hide
10159          */
10160         public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
10161 
10162         /**
10163          * Used to disable Tethering on a device - defaults to true.
10164          * @hide
10165          */
10166         @SystemApi
10167         public static final String TETHER_SUPPORTED = "tether_supported";
10168 
10169         /**
10170          * Used to require DUN APN on the device or not - defaults to a build config value
10171          * which defaults to false.
10172          * @hide
10173          */
10174         public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
10175 
10176         /**
10177          * Used to hold a gservices-provisioned apn value for DUN.  If set, or the
10178          * corresponding build config values are set it will override the APN DB
10179          * values.
10180          * Consists of a comma separated list of strings:
10181          * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
10182          * note that empty fields can be omitted: "name,apn,,,,,,,,,310,260,,DUN"
10183          * @hide
10184          */
10185         public static final String TETHER_DUN_APN = "tether_dun_apn";
10186 
10187         /**
10188          * Used to disable trying to talk to any available tethering offload HAL.
10189          *
10190          * Integer values are interpreted as boolean, and the absence of an explicit setting
10191          * is interpreted as |false|.
10192          * @hide
10193          */
10194         @SystemApi
10195         @TestApi
10196         public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled";
10197 
10198         /**
10199          * Use the old dnsmasq DHCP server for tethering instead of the framework implementation.
10200          *
10201          * Integer values are interpreted as boolean, and the absence of an explicit setting
10202          * is interpreted as |false|.
10203          * @hide
10204          */
10205         public static final String TETHER_ENABLE_LEGACY_DHCP_SERVER =
10206                 "tether_enable_legacy_dhcp_server";
10207 
10208         /**
10209          * List of certificate (hex string representation of the application's certificate - SHA-1
10210          * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for
10211          * install when a sim card with matching UICC carrier privilege rules is inserted.  The
10212          * certificate is used as a key, so the certificate encoding here must be the same as the
10213          * certificate encoding used on the SIM.
10214          *
10215          * The value is "cert1:package1;cert2:package2;..."
10216          * @hide
10217          */
10218         @SystemApi
10219         public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
10220 
10221         /**
10222          * Map of package name to application names. The application names cannot and will not be
10223          * localized. App names may not contain colons or semicolons.
10224          *
10225          * The value is "packageName1:appName1;packageName2:appName2;..."
10226          * @hide
10227          */
10228         @SystemApi
10229         public static final String CARRIER_APP_NAMES = "carrier_app_names";
10230 
10231        /**
10232         * USB Mass Storage Enabled
10233         */
10234        public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
10235 
10236        /**
10237         * If this setting is set (to anything), then all references
10238         * to Gmail on the device must change to Google Mail.
10239         */
10240        public static final String USE_GOOGLE_MAIL = "use_google_mail";
10241 
10242         /**
10243          * Whether or not switching/creating users is enabled by user.
10244          * @hide
10245          */
10246         public static final String USER_SWITCHER_ENABLED = "user_switcher_enabled";
10247 
10248         /**
10249          * Webview Data reduction proxy key.
10250          * @hide
10251          */
10252         public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
10253                 "webview_data_reduction_proxy_key";
10254 
10255        /**
10256         * Whether or not the WebView fallback mechanism should be enabled.
10257         * 0=disabled, 1=enabled.
10258         * @hide
10259         */
10260        public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED =
10261                "webview_fallback_logic_enabled";
10262 
10263        /**
10264         * Name of the package used as WebView provider (if unset the provider is instead determined
10265         * by the system).
10266         * @hide
10267         */
10268        @UnsupportedAppUsage
10269        public static final String WEBVIEW_PROVIDER = "webview_provider";
10270 
10271        /**
10272         * Developer setting to enable WebView multiprocess rendering.
10273         * @hide
10274         */
10275        @SystemApi
10276        public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
10277 
10278        /**
10279         * The maximum number of notifications shown in 24 hours when switching networks.
10280         * @hide
10281         */
10282        public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT =
10283               "network_switch_notification_daily_limit";
10284 
10285        /**
10286         * The minimum time in milliseconds between notifications when switching networks.
10287         * @hide
10288         */
10289        public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS =
10290               "network_switch_notification_rate_limit_millis";
10291 
10292        /**
10293         * Whether to automatically switch away from wifi networks that lose Internet access.
10294         * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always
10295         * avoids such networks. Valid values are:
10296         *
10297         * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013.
10298         * null: Ask the user whether to switch away from bad wifi.
10299         * 1: Avoid bad wifi.
10300         *
10301         * @hide
10302         */
10303        public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi";
10304 
10305        /**
10306         * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be
10307         * overridden by the system based on device or application state. If null, the value
10308         * specified by config_networkMeteredMultipathPreference is used.
10309         *
10310         * @hide
10311         */
10312        public static final String NETWORK_METERED_MULTIPATH_PREFERENCE =
10313                "network_metered_multipath_preference";
10314 
10315         /**
10316          * Default daily multipath budget used by ConnectivityManager.getMultipathPreference()
10317          * on metered networks. This default quota is only used if quota could not be determined
10318          * from data plan or data limit/warning set by the user.
10319          * @hide
10320          */
10321         public static final String NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES =
10322                 "network_default_daily_multipath_quota_bytes";
10323 
10324         /**
10325          * Network watchlist last report time.
10326          * @hide
10327          */
10328         public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME =
10329                 "network_watchlist_last_report_time";
10330 
10331        /**
10332         * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of
10333         * colon-delimited key-value pairs. The key is the badging enum value defined in
10334         * android.net.ScoredNetwork and the value is the minimum sustained network throughput in
10335         * kbps required for the badge. For example: "10:3000,20:5000,30:25000"
10336         *
10337         * @hide
10338         */
10339        @SystemApi
10340        public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds";
10341 
10342        /**
10343         * Whether Wifi display is enabled/disabled
10344         * 0=disabled. 1=enabled.
10345         * @hide
10346         */
10347        public static final String WIFI_DISPLAY_ON = "wifi_display_on";
10348 
10349        /**
10350         * Whether Wifi display certification mode is enabled/disabled
10351         * 0=disabled. 1=enabled.
10352         * @hide
10353         */
10354        public static final String WIFI_DISPLAY_CERTIFICATION_ON =
10355                "wifi_display_certification_on";
10356 
10357        /**
10358         * WPS Configuration method used by Wifi display, this setting only
10359         * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
10360         *
10361         * Possible values are:
10362         *
10363         * WpsInfo.INVALID: use default WPS method chosen by framework
10364         * WpsInfo.PBC    : use Push button
10365         * WpsInfo.KEYPAD : use Keypad
10366         * WpsInfo.DISPLAY: use Display
10367         * @hide
10368         */
10369        public static final String WIFI_DISPLAY_WPS_CONFIG =
10370            "wifi_display_wps_config";
10371 
10372        /**
10373         * Whether to notify the user of open networks.
10374         * <p>
10375         * If not connected and the scan results have an open network, we will
10376         * put this notification up. If we attempt to connect to a network or
10377         * the open network(s) disappear, we remove the notification. When we
10378         * show the notification, we will not show it again for
10379         * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
10380         *
10381         * @deprecated This feature is no longer controlled by this setting in
10382         * {@link android.os.Build.VERSION_CODES#O}.
10383         */
10384        @Deprecated
10385        public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
10386                "wifi_networks_available_notification_on";
10387 
10388        /**
10389         * {@hide}
10390         */
10391        public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
10392                "wimax_networks_available_notification_on";
10393 
10394        /**
10395         * Delay (in seconds) before repeating the Wi-Fi networks available notification.
10396         * Connecting to a network will reset the timer.
10397         * @deprecated This is no longer used or set by the platform.
10398         */
10399        @Deprecated
10400        public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
10401                "wifi_networks_available_repeat_delay";
10402 
10403        /**
10404         * 802.11 country code in ISO 3166 format
10405         * @hide
10406         */
10407        public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
10408 
10409        /**
10410         * The interval in milliseconds to issue wake up scans when wifi needs
10411         * to connect. This is necessary to connect to an access point when
10412         * device is on the move and the screen is off.
10413         * @hide
10414         */
10415        public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
10416                "wifi_framework_scan_interval_ms";
10417 
10418        /**
10419         * The interval in milliseconds after which Wi-Fi is considered idle.
10420         * When idle, it is possible for the device to be switched from Wi-Fi to
10421         * the mobile data network.
10422         * @hide
10423         */
10424        public static final String WIFI_IDLE_MS = "wifi_idle_ms";
10425 
10426        /**
10427         * When the number of open networks exceeds this number, the
10428         * least-recently-used excess networks will be removed.
10429         * @deprecated This is no longer used or set by the platform.
10430         */
10431        @Deprecated
10432        public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
10433 
10434        /**
10435         * Whether the Wi-Fi should be on.  Only the Wi-Fi service should touch this.
10436         */
10437        public static final String WIFI_ON = "wifi_on";
10438 
10439        /**
10440         * Setting to allow scans to be enabled even wifi is turned off for connectivity.
10441         * @hide
10442         * @deprecated To be removed. Use {@link WifiManager#setScanAlwaysAvailable(boolean)} for
10443         * setting the value and {@link WifiManager#isScanAlwaysAvailable()} for query.
10444         */
10445        public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
10446                 "wifi_scan_always_enabled";
10447 
10448         /**
10449          * Indicate whether factory reset request is pending.
10450          *
10451          * Type: int (0 for false, 1 for true)
10452          * @hide
10453          * @deprecated To be removed.
10454          */
10455         public static final String WIFI_P2P_PENDING_FACTORY_RESET =
10456                 "wifi_p2p_pending_factory_reset";
10457 
10458         /**
10459          * Whether soft AP will shut down after a timeout period when no devices are connected.
10460          *
10461          * Type: int (0 for false, 1 for true)
10462          * @hide
10463          * @deprecated To be removed. Use {@link SoftApConfiguration.Builder#
10464          * setAutoShutdownEnabled(boolean)} for setting the value and {@link SoftApConfiguration#
10465          * isAutoShutdownEnabled()} for query.
10466          */
10467         public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled";
10468 
10469         /**
10470          * Value to specify if Wi-Fi Wakeup feature is enabled.
10471          *
10472          * Type: int (0 for false, 1 for true)
10473          * @hide
10474          * @deprecated Use {@link WifiManager#setAutoWakeupEnabled(boolean)} for setting the value
10475          * and {@link WifiManager#isAutoWakeupEnabled()} for query.
10476          */
10477         @Deprecated
10478         @SystemApi
10479         public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
10480 
10481         /**
10482          * Value to specify if wifi settings migration is complete or not.
10483          * Note: This should only be used from within {@link android.net.wifi.WifiMigration} class.
10484          *
10485          * Type: int (0 for false, 1 for true)
10486          * @hide
10487          */
10488         public static final String WIFI_MIGRATION_COMPLETED = "wifi_migration_completed";
10489 
10490         /**
10491          * Value to specify whether network quality scores and badging should be shown in the UI.
10492          *
10493          * Type: int (0 for false, 1 for true)
10494          * @hide
10495          */
10496         public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled";
10497 
10498         /**
10499          * Value to specify how long in milliseconds to retain seen score cache curves to be used
10500          * when generating SSID only bases score curves.
10501          *
10502          * Type: long
10503          * @hide
10504          */
10505         public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS =
10506                 "speed_label_cache_eviction_age_millis";
10507 
10508         /**
10509          * Value to specify if network recommendations from
10510          * {@link com.android.server.NetworkScoreService} are enabled.
10511          *
10512          * Type: int
10513          * Valid values:
10514          *   -1 = Forced off
10515          *    0 = Disabled
10516          *    1 = Enabled
10517          *
10518          * Most readers of this setting should simply check if value == 1 to determined the
10519          * enabled state.
10520          * @hide
10521          * @deprecated To be removed.
10522          */
10523         public static final String NETWORK_RECOMMENDATIONS_ENABLED =
10524                 "network_recommendations_enabled";
10525 
10526         /**
10527          * Which package name to use for network recommendations. If null, network recommendations
10528          * will neither be requested nor accepted.
10529          *
10530          * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and
10531          * {@link NetworkScoreManager#setActiveScorer(String)} to write it.
10532          *
10533          * Type: string - package name
10534          * @hide
10535          */
10536         public static final String NETWORK_RECOMMENDATIONS_PACKAGE =
10537                 "network_recommendations_package";
10538 
10539         /**
10540          * The package name of the application that connect and secures high quality open wifi
10541          * networks automatically.
10542          *
10543          * Type: string package name or null if the feature is either not provided or disabled.
10544          * @hide
10545          */
10546         @TestApi
10547         public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package";
10548 
10549         /**
10550          * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in
10551          * {@link com.android.server.wifi.RecommendedNetworkEvaluator}.
10552          *
10553          * Type: long
10554          * @hide
10555          */
10556         public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS =
10557                 "recommended_network_evaluator_cache_expiry_ms";
10558 
10559         /**
10560          * Whether wifi scan throttle is enabled or not.
10561          *
10562          * Type: int (0 for false, 1 for true)
10563          * @hide
10564          * @deprecated Use {@link WifiManager#setScanThrottleEnabled(boolean)} for setting the value
10565          * and {@link WifiManager#isScanThrottleEnabled()} for query.
10566          */
10567         public static final String WIFI_SCAN_THROTTLE_ENABLED = "wifi_scan_throttle_enabled";
10568 
10569         /**
10570         * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
10571         * connectivity.
10572         * @hide
10573         */
10574         public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled";
10575 
10576         /**
10577          * The length in milliseconds of a BLE scan window in a low-power scan mode.
10578          * @hide
10579          */
10580         public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms";
10581 
10582         /**
10583          * The length in milliseconds of a BLE scan window in a balanced scan mode.
10584          * @hide
10585          */
10586         public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms";
10587 
10588         /**
10589          * The length in milliseconds of a BLE scan window in a low-latency scan mode.
10590          * @hide
10591          */
10592         public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS =
10593                 "ble_scan_low_latency_window_ms";
10594 
10595         /**
10596          * The length in milliseconds of a BLE scan interval in a low-power scan mode.
10597          * @hide
10598          */
10599         public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS =
10600                 "ble_scan_low_power_interval_ms";
10601 
10602         /**
10603          * The length in milliseconds of a BLE scan interval in a balanced scan mode.
10604          * @hide
10605          */
10606         public static final String BLE_SCAN_BALANCED_INTERVAL_MS =
10607                 "ble_scan_balanced_interval_ms";
10608 
10609         /**
10610          * The length in milliseconds of a BLE scan interval in a low-latency scan mode.
10611          * @hide
10612          */
10613         public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS =
10614                 "ble_scan_low_latency_interval_ms";
10615 
10616         /**
10617          * The mode that BLE scanning clients will be moved to when in the background.
10618          * @hide
10619          */
10620         public static final String BLE_SCAN_BACKGROUND_MODE = "ble_scan_background_mode";
10621 
10622        /**
10623         * The interval in milliseconds to scan as used by the wifi supplicant
10624         * @hide
10625         */
10626        public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
10627                "wifi_supplicant_scan_interval_ms";
10628 
10629         /**
10630          * whether frameworks handles wifi auto-join
10631          * @hide
10632          */
10633        public static final String WIFI_ENHANCED_AUTO_JOIN =
10634                 "wifi_enhanced_auto_join";
10635 
10636         /**
10637          * whether settings show RSSI
10638          * @hide
10639          */
10640         public static final String WIFI_NETWORK_SHOW_RSSI =
10641                 "wifi_network_show_rssi";
10642 
10643         /**
10644         * The interval in milliseconds to scan at supplicant when p2p is connected
10645         * @hide
10646         */
10647        public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
10648                "wifi_scan_interval_p2p_connected_ms";
10649 
10650        /**
10651         * Whether the Wi-Fi watchdog is enabled.
10652         */
10653        public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
10654 
10655        /**
10656         * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
10657         * the setting needs to be set to 0 to disable it.
10658         * @hide
10659         */
10660        @UnsupportedAppUsage
10661        public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
10662                "wifi_watchdog_poor_network_test_enabled";
10663 
10664        /**
10665         * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1
10666         * will enable it. In the future, additional values may be supported.
10667         * @hide
10668         * @deprecated Use {@link WifiManager#setVerboseLoggingEnabled(boolean)} for setting the
10669         * value and {@link WifiManager#isVerboseLoggingEnabled()} for query.
10670         */
10671        public static final String WIFI_VERBOSE_LOGGING_ENABLED =
10672                "wifi_verbose_logging_enabled";
10673 
10674         /**
10675          * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and
10676          * setting to 1 will enable it. In the future, additional values may be supported.
10677          * @deprecated MAC randomization is now a per-network setting
10678          * @hide
10679          */
10680         @Deprecated
10681         public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED =
10682                 "wifi_connected_mac_randomization_enabled";
10683 
10684         /**
10685          * Parameters to adjust the performance of framework wifi scoring methods.
10686          * <p>
10687          * Encoded as a comma-separated key=value list, for example:
10688          *   "rssi5=-80:-77:-70:-57,rssi2=-83:-80:-73:-60,horizon=15"
10689          * This is intended for experimenting with new parameter values,
10690          * and is normally unset or empty. The example does not include all
10691          * parameters that may be honored.
10692          * Default values are provided by code or device configurations.
10693          * Errors in the parameters will cause the entire setting to be ignored.
10694          * @hide
10695          * @deprecated This is no longer used or set by the platform.
10696          */
10697         public static final String WIFI_SCORE_PARAMS =
10698                 "wifi_score_params";
10699 
10700        /**
10701         * The maximum number of times we will retry a connection to an access
10702         * point for which we have failed in acquiring an IP address from DHCP.
10703         * A value of N means that we will make N+1 connection attempts in all.
10704         */
10705        public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
10706 
10707        /**
10708         * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
10709         * data connectivity to be established after a disconnect from Wi-Fi.
10710         */
10711        public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
10712            "wifi_mobile_data_transition_wakelock_timeout_ms";
10713 
10714        /**
10715         * This setting controls whether WiFi configurations created by a Device Owner app
10716         * should be locked down (that is, be editable or removable only by the Device Owner App,
10717         * not even by Settings app).
10718         * This setting takes integer values. Non-zero values mean DO created configurations
10719         * are locked down. Value of zero means they are not. Default value in the absence of
10720         * actual value to this setting is 0.
10721         */
10722        public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN =
10723                "wifi_device_owner_configs_lockdown";
10724 
10725        /**
10726         * The operational wifi frequency band
10727         * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
10728         * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
10729         * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
10730         *
10731         * @hide
10732         */
10733        public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
10734 
10735        /**
10736         * The Wi-Fi peer-to-peer device name
10737         * @hide
10738         * @deprecated Use {@link WifiP2pManager#setDeviceName(WifiP2pManager.Channel, String,
10739         * WifiP2pManager.ActionListener)} for setting the value and
10740         * {@link android.net.wifi.p2p.WifiP2pDevice#deviceName} for query.
10741         */
10742        public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
10743 
10744        /**
10745         * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
10746         * from an ephemeral network if there is no BSSID for that network with a non-null score that
10747         * has been seen in this time period.
10748         *
10749         * If this is less than or equal to zero, we use a more conservative behavior and only check
10750         * for a non-null score from the currently connected or target BSSID.
10751         * @hide
10752         */
10753        public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
10754                "wifi_ephemeral_out_of_range_timeout_ms";
10755 
10756        /**
10757         * The number of milliseconds to delay when checking for data stalls during
10758         * non-aggressive detection. (screen is turned off.)
10759         * @hide
10760         */
10761        public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
10762                "data_stall_alarm_non_aggressive_delay_in_ms";
10763 
10764        /**
10765         * The number of milliseconds to delay when checking for data stalls during
10766         * aggressive detection. (screen on or suspected data stall)
10767         * @hide
10768         */
10769        public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
10770                "data_stall_alarm_aggressive_delay_in_ms";
10771 
10772        /**
10773         * The number of milliseconds to allow the provisioning apn to remain active
10774         * @hide
10775         */
10776        public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
10777                "provisioning_apn_alarm_delay_in_ms";
10778 
10779        /**
10780         * The interval in milliseconds at which to check gprs registration
10781         * after the first registration mismatch of gprs and voice service,
10782         * to detect possible data network registration problems.
10783         *
10784         * @hide
10785         */
10786        public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
10787                "gprs_register_check_period_ms";
10788 
10789        /**
10790         * Nonzero causes Log.wtf() to crash.
10791         * @hide
10792         */
10793        public static final String WTF_IS_FATAL = "wtf_is_fatal";
10794 
10795        /**
10796         * Ringer mode. This is used internally, changing this value will not
10797         * change the ringer mode. See AudioManager.
10798         */
10799        public static final String MODE_RINGER = "mode_ringer";
10800 
10801         /**
10802          * Overlay display devices setting.
10803          * The associated value is a specially formatted string that describes the
10804          * size and density of simulated secondary display devices.
10805          * <p>
10806          * Format:
10807          * <pre>
10808          * [display1];[display2];...
10809          * </pre>
10810          * with each display specified as:
10811          * <pre>
10812          * [mode1]|[mode2]|...,[flag1],[flag2],...
10813          * </pre>
10814          * with each mode specified as:
10815          * <pre>
10816          * [width]x[height]/[densityDpi]
10817          * </pre>
10818          * Supported flags:
10819          * <ul>
10820          * <li><pre>secure</pre>: creates a secure display</li>
10821          * <li><pre>own_content_only</pre>: only shows this display's own content</li>
10822          * <li><pre>should_show_system_decorations</pre>: supports system decorations</li>
10823          * </ul>
10824          * </p><p>
10825          * Example:
10826          * <ul>
10827          * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
10828          * <li><code>1920x1080/320,secure;1280x720/213</code>: make two overlays, the first at
10829          * 1080p and secure; the second at 720p.</li>
10830          * <li><code>1920x1080/320|3840x2160/640</code>: make one overlay that is 1920x1080 at
10831          * 213dpi by default, but can also be upscaled to 3840x2160 at 640dpi by the system if the
10832          * display device allows.</li>
10833          * <li>If the value is empty, then no overlay display devices are created.</li>
10834          * </ul></p>
10835          *
10836          * @hide
10837          */
10838         @UnsupportedAppUsage
10839         @TestApi
10840         public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
10841 
10842         /**
10843          * Threshold values for the duration and level of a discharge cycle,
10844          * under which we log discharge cycle info.
10845          *
10846          * @hide
10847          */
10848         public static final String
10849                 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
10850 
10851         /** @hide */
10852         public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
10853 
10854         /**
10855          * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
10856          * intents on application crashes and ANRs. If this is disabled, the
10857          * crash/ANR dialog will never display the "Report" button.
10858          * <p>
10859          * Type: int (0 = disallow, 1 = allow)
10860          *
10861          * @hide
10862          */
10863         public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
10864 
10865         /**
10866          * Maximum age of entries kept by {@link DropBoxManager}.
10867          *
10868          * @hide
10869          */
10870         public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
10871 
10872         /**
10873          * Maximum number of entry files which {@link DropBoxManager} will keep
10874          * around.
10875          *
10876          * @hide
10877          */
10878         public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
10879 
10880         /**
10881          * Maximum amount of disk space used by {@link DropBoxManager} no matter
10882          * what.
10883          *
10884          * @hide
10885          */
10886         public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
10887 
10888         /**
10889          * Percent of free disk (excluding reserve) which {@link DropBoxManager}
10890          * will use.
10891          *
10892          * @hide
10893          */
10894         public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
10895 
10896         /**
10897          * Percent of total disk which {@link DropBoxManager} will never dip
10898          * into.
10899          *
10900          * @hide
10901          */
10902         public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
10903 
10904         /**
10905          * Prefix for per-tag dropbox disable/enable settings.
10906          *
10907          * @hide
10908          */
10909         public static final String DROPBOX_TAG_PREFIX = "dropbox:";
10910 
10911         /**
10912          * Lines of logcat to include with system crash/ANR/etc. reports, as a
10913          * prefix of the dropbox tag of the report type. For example,
10914          * "logcat_for_system_server_anr" controls the lines of logcat captured
10915          * with system server ANR reports. 0 to disable.
10916          *
10917          * @hide
10918          */
10919         public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
10920 
10921         /**
10922          * Maximum number of bytes of a system crash/ANR/etc. report that
10923          * ActivityManagerService should send to DropBox, as a prefix of the
10924          * dropbox tag of the report type. For example,
10925          * "max_error_bytes_for_system_server_anr" controls the maximum
10926          * number of bytes captured with system server ANR reports.
10927          * <p>
10928          * Type: int (max size in bytes)
10929          *
10930          * @hide
10931          */
10932         public static final String MAX_ERROR_BYTES_PREFIX = "max_error_bytes_for_";
10933 
10934         /**
10935          * The interval in minutes after which the amount of free storage left
10936          * on the device is logged to the event log
10937          *
10938          * @hide
10939          */
10940         public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
10941 
10942         /**
10943          * Threshold for the amount of change in disk free space required to
10944          * report the amount of free space. Used to prevent spamming the logs
10945          * when the disk free space isn't changing frequently.
10946          *
10947          * @hide
10948          */
10949         public static final String
10950                 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
10951 
10952         /**
10953          * Minimum percentage of free storage on the device that is used to
10954          * determine if the device is running low on storage. The default is 10.
10955          * <p>
10956          * Say this value is set to 10, the device is considered running low on
10957          * storage if 90% or more of the device storage is filled up.
10958          *
10959          * @hide
10960          */
10961         public static final String
10962                 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
10963 
10964         /**
10965          * Maximum byte size of the low storage threshold. This is to ensure
10966          * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
10967          * overly large threshold for large storage devices. Currently this must
10968          * be less than 2GB. This default is 500MB.
10969          *
10970          * @hide
10971          */
10972         public static final String
10973                 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
10974 
10975         /**
10976          * Minimum bytes of free storage on the device before the data partition
10977          * is considered full. By default, 1 MB is reserved to avoid system-wide
10978          * SQLite disk full exceptions.
10979          *
10980          * @hide
10981          */
10982         public static final String
10983                 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
10984 
10985         /**
10986          * Minimum percentage of storage on the device that is reserved for
10987          * cached data.
10988          *
10989          * @hide
10990          */
10991         public static final String
10992                 SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage";
10993 
10994         /**
10995          * Maximum bytes of storage on the device that is reserved for cached
10996          * data.
10997          *
10998          * @hide
10999          */
11000         public static final String
11001                 SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes";
11002 
11003         /**
11004          * The maximum reconnect delay for short network outages or when the
11005          * network is suspended due to phone use.
11006          *
11007          * @hide
11008          */
11009         public static final String
11010                 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
11011 
11012         /**
11013          * The number of milliseconds to delay before sending out
11014          * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
11015          *
11016          * @hide
11017          */
11018         public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
11019 
11020 
11021         /**
11022          * Network sampling interval, in seconds. We'll generate link information
11023          * about bytes/packets sent and error rates based on data sampled in this interval
11024          *
11025          * @hide
11026          */
11027 
11028         public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
11029                 "connectivity_sampling_interval_in_seconds";
11030 
11031         /**
11032          * The series of successively longer delays used in retrying to download PAC file.
11033          * Last delay is used between successful PAC downloads.
11034          *
11035          * @hide
11036          */
11037         public static final String PAC_CHANGE_DELAY = "pac_change_delay";
11038 
11039         /**
11040          * Don't attempt to detect captive portals.
11041          *
11042          * @hide
11043          */
11044         public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0;
11045 
11046         /**
11047          * When detecting a captive portal, display a notification that
11048          * prompts the user to sign in.
11049          *
11050          * @hide
11051          */
11052         public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1;
11053 
11054         /**
11055          * When detecting a captive portal, immediately disconnect from the
11056          * network and do not reconnect to that network in the future.
11057          *
11058          * @hide
11059          */
11060         public static final int CAPTIVE_PORTAL_MODE_AVOID = 2;
11061 
11062         /**
11063          * What to do when connecting a network that presents a captive portal.
11064          * Must be one of the CAPTIVE_PORTAL_MODE_* constants above.
11065          *
11066          * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT.
11067          * @hide
11068          */
11069         public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
11070 
11071         /**
11072          * Setting to turn off captive portal detection. Feature is enabled by
11073          * default and the setting needs to be set to 0 to disable it.
11074          *
11075          * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection
11076          * @hide
11077          */
11078         @Deprecated
11079         public static final String
11080                 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
11081 
11082         /**
11083          * The server used for captive portal detection upon a new conection. A
11084          * 204 response code from the server is used for validation.
11085          * TODO: remove this deprecated symbol.
11086          *
11087          * @hide
11088          */
11089         public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
11090 
11091         /**
11092          * The URL used for HTTPS captive portal detection upon a new connection.
11093          * A 204 response code from the server is used for validation.
11094          *
11095          * @hide
11096          */
11097         public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
11098 
11099         /**
11100          * The URL used for HTTP captive portal detection upon a new connection.
11101          * A 204 response code from the server is used for validation.
11102          *
11103          * @hide
11104          */
11105         public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
11106 
11107         /**
11108          * The URL used for fallback HTTP captive portal detection when previous HTTP
11109          * and HTTPS captive portal detection attemps did not return a conclusive answer.
11110          *
11111          * @hide
11112          */
11113         public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
11114 
11115         /**
11116          * A comma separated list of URLs used for captive portal detection in addition to the
11117          * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings.
11118          *
11119          * @hide
11120          */
11121         public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS =
11122                 "captive_portal_other_fallback_urls";
11123 
11124         /**
11125          * A list of captive portal detection specifications used in addition to the fallback URLs.
11126          * Each spec has the format url@@/@@statusCodeRegex@@/@@contentRegex. Specs are separated
11127          * by "@@,@@".
11128          * @hide
11129          */
11130         public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS =
11131                 "captive_portal_fallback_probe_specs";
11132 
11133         /**
11134          * Whether to use HTTPS for network validation. This is enabled by default and the setting
11135          * needs to be set to 0 to disable it. This setting is a misnomer because captive portals
11136          * don't actually use HTTPS, but it's consistent with the other settings.
11137          *
11138          * @hide
11139          */
11140         public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
11141 
11142         /**
11143          * Which User-Agent string to use in the header of the captive portal detection probes.
11144          * The User-Agent field is unset when this setting has no value (HttpUrlConnection default).
11145          *
11146          * @hide
11147          */
11148         public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
11149 
11150         /**
11151          * Whether to try cellular data recovery when a bad network is reported.
11152          *
11153          * @hide
11154          */
11155         public static final String DATA_STALL_RECOVERY_ON_BAD_NETWORK =
11156                 "data_stall_recovery_on_bad_network";
11157 
11158         /**
11159          * Minumim duration in millisecodns between cellular data recovery attempts
11160          *
11161          * @hide
11162          */
11163         public static final String MIN_DURATION_BETWEEN_RECOVERY_STEPS_IN_MS =
11164                 "min_duration_between_recovery_steps";
11165         /**
11166          * Whether network service discovery is enabled.
11167          *
11168          * @hide
11169          */
11170         public static final String NSD_ON = "nsd_on";
11171 
11172         /**
11173          * Let user pick default install location.
11174          *
11175          * @hide
11176          */
11177         public static final String SET_INSTALL_LOCATION = "set_install_location";
11178 
11179         /**
11180          * Default install location value.
11181          * 0 = auto, let system decide
11182          * 1 = internal
11183          * 2 = sdcard
11184          * @hide
11185          */
11186         public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
11187 
11188         /**
11189          * ms during which to consume extra events related to Inet connection
11190          * condition after a transtion to fully-connected
11191          *
11192          * @hide
11193          */
11194         public static final String
11195                 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
11196 
11197         /**
11198          * ms during which to consume extra events related to Inet connection
11199          * condtion after a transtion to partly-connected
11200          *
11201          * @hide
11202          */
11203         public static final String
11204                 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
11205 
11206         /** {@hide} */
11207         public static final String
11208                 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
11209 
11210         /**
11211          * Host name and port for global http proxy. Uses ':' seperator for
11212          * between host and port.
11213          */
11214         public static final String HTTP_PROXY = "http_proxy";
11215 
11216         /**
11217          * Host name for global http proxy. Set via ConnectivityManager.
11218          *
11219          * @hide
11220          */
11221         public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
11222 
11223         /**
11224          * Integer host port for global http proxy. Set via ConnectivityManager.
11225          *
11226          * @hide
11227          */
11228         public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
11229 
11230         /**
11231          * Exclusion list for global proxy. This string contains a list of
11232          * comma-separated domains where the global proxy does not apply.
11233          * Domains should be listed in a comma- separated list. Example of
11234          * acceptable formats: ".domain1.com,my.domain2.com" Use
11235          * ConnectivityManager to set/get.
11236          *
11237          * @hide
11238          */
11239         public static final String
11240                 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
11241 
11242         /**
11243          * The location PAC File for the proxy.
11244          * @hide
11245          */
11246         public static final String
11247                 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
11248 
11249         /**
11250          * Enables the UI setting to allow the user to specify the global HTTP
11251          * proxy and associated exclusion list.
11252          *
11253          * @hide
11254          */
11255         public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
11256 
11257         /**
11258          * Setting for default DNS in case nobody suggests one
11259          *
11260          * @hide
11261          */
11262         public static final String DEFAULT_DNS_SERVER = "default_dns_server";
11263 
11264         /**
11265          * The requested Private DNS mode (string), and an accompanying specifier (string).
11266          *
11267          * Currently, the specifier holds the chosen provider name when the mode requests
11268          * a specific provider. It may be used to store the provider name even when the
11269          * mode changes so that temporarily disabling and re-enabling the specific
11270          * provider mode does not necessitate retyping the provider hostname.
11271          *
11272          * @hide
11273          */
11274         public static final String PRIVATE_DNS_MODE = "private_dns_mode";
11275 
11276         /**
11277          * @hide
11278          */
11279         public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier";
11280 
11281         /**
11282           * Forced override of the default mode (hardcoded as "automatic", nee "opportunistic").
11283           * This allows changing the default mode without effectively disabling other modes,
11284           * all of which require explicit user action to enable/configure. See also b/79719289.
11285           *
11286           * Value is a string, suitable for assignment to PRIVATE_DNS_MODE above.
11287           *
11288           * {@hide}
11289           */
11290         public static final String PRIVATE_DNS_DEFAULT_MODE = "private_dns_default_mode";
11291 
11292 
11293         /** {@hide} */
11294         public static final String
11295                 BLUETOOTH_BTSNOOP_DEFAULT_MODE = "bluetooth_btsnoop_default_mode";
11296         /** {@hide} */
11297         public static final String
11298                 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
11299         /** {@hide} */
11300         public static final String
11301                 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
11302         /** {@hide} */
11303         public static final String
11304                 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_";
11305         /** {@hide} */
11306         public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX =
11307                 "bluetooth_a2dp_supports_optional_codecs_";
11308         /** {@hide} */
11309         public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX =
11310                 "bluetooth_a2dp_optional_codecs_enabled_";
11311         /** {@hide} */
11312         public static final String
11313                 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
11314         /** {@hide} */
11315         public static final String
11316                 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
11317         /** {@hide} */
11318         public static final String
11319                 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_";
11320         /** {@hide} */
11321         public static final String
11322                 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_";
11323         /** {@hide} */
11324         public static final String
11325                 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
11326         /** {@hide} */
11327         public static final String
11328                 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_";
11329         /** {@hide} */
11330         public static final String
11331                 BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_";
11332 
11333         /**
11334          * Enable/disable radio bug detection
11335          *
11336          * {@hide}
11337          */
11338         public static final String
11339                 ENABLE_RADIO_BUG_DETECTION = "enable_radio_bug_detection";
11340 
11341         /**
11342          * Count threshold of RIL wakelock timeout for radio bug detection
11343          *
11344          * {@hide}
11345          */
11346         public static final String
11347                 RADIO_BUG_WAKELOCK_TIMEOUT_COUNT_THRESHOLD =
11348                 "radio_bug_wakelock_timeout_count_threshold";
11349 
11350         /**
11351          * Count threshold of RIL system error for radio bug detection
11352          *
11353          * {@hide}
11354          */
11355         public static final String
11356                 RADIO_BUG_SYSTEM_ERROR_COUNT_THRESHOLD =
11357                 "radio_bug_system_error_count_threshold";
11358 
11359         /**
11360          * Activity manager specific settings.
11361          * This is encoded as a key=value list, separated by commas. Ex:
11362          *
11363          * "gc_timeout=5000,max_cached_processes=24"
11364          *
11365          * The following keys are supported:
11366          *
11367          * <pre>
11368          * max_cached_processes                 (int)
11369          * background_settle_time               (long)
11370          * fgservice_min_shown_time             (long)
11371          * fgservice_min_report_time            (long)
11372          * fgservice_screen_on_before_time      (long)
11373          * fgservice_screen_on_after_time       (long)
11374          * content_provider_retain_time         (long)
11375          * gc_timeout                           (long)
11376          * gc_min_interval                      (long)
11377          * full_pss_min_interval                (long)
11378          * full_pss_lowered_interval            (long)
11379          * power_check_interval                 (long)
11380          * power_check_max_cpu_1                (int)
11381          * power_check_max_cpu_2                (int)
11382          * power_check_max_cpu_3                (int)
11383          * power_check_max_cpu_4                (int)
11384          * service_usage_interaction_time       (long)
11385          * usage_stats_interaction_interval     (long)
11386          * service_restart_duration             (long)
11387          * service_reset_run_duration           (long)
11388          * service_restart_duration_factor      (int)
11389          * service_min_restart_time_between     (long)
11390          * service_max_inactivity               (long)
11391          * service_bg_start_timeout             (long)
11392          * service_bg_activity_start_timeout    (long)
11393          * process_start_async                  (boolean)
11394          * </pre>
11395          *
11396          * <p>
11397          * Type: string
11398          * @hide
11399          * @see com.android.server.am.ActivityManagerConstants
11400          */
11401         public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants";
11402 
11403         /**
11404          * Feature flag to enable or disable the activity starts logging feature.
11405          * Type: int (0 for false, 1 for true)
11406          * Default: 1
11407          * @hide
11408          */
11409         public static final String ACTIVITY_STARTS_LOGGING_ENABLED
11410                 = "activity_starts_logging_enabled";
11411 
11412         /**
11413          * Feature flag to enable or disable the foreground service starts logging feature.
11414          * Type: int (0 for false, 1 for true)
11415          * Default: 1
11416          * @hide
11417          */
11418         public static final String FOREGROUND_SERVICE_STARTS_LOGGING_ENABLED =
11419                 "foreground_service_starts_logging_enabled";
11420 
11421         /**
11422          * @hide
11423          * @see com.android.server.appbinding.AppBindingConstants
11424          */
11425         public static final String APP_BINDING_CONSTANTS = "app_binding_constants";
11426 
11427         /**
11428          * App ops specific settings.
11429          * This is encoded as a key=value list, separated by commas. Ex:
11430          *
11431          * "state_settle_time=10000"
11432          *
11433          * The following keys are supported:
11434          *
11435          * <pre>
11436          * top_state_settle_time                (long)
11437          * fg_service_state_settle_time         (long)
11438          * bg_state_settle_time                 (long)
11439          * </pre>
11440          *
11441          * <p>
11442          * Type: string
11443          * @hide
11444          * @see com.android.server.AppOpsService.Constants
11445          */
11446         @TestApi
11447         public static final String APP_OPS_CONSTANTS = "app_ops_constants";
11448 
11449         /**
11450          * Device Idle (Doze) specific settings.
11451          * This is encoded as a key=value list, separated by commas. Ex:
11452          *
11453          * "inactive_to=60000,sensing_to=400000"
11454          *
11455          * The following keys are supported:
11456          *
11457          * <pre>
11458          * inactive_to                      (long)
11459          * sensing_to                       (long)
11460          * motion_inactive_to               (long)
11461          * idle_after_inactive_to           (long)
11462          * idle_pending_to                  (long)
11463          * max_idle_pending_to              (long)
11464          * idle_pending_factor              (float)
11465          * quick_doze_delay_to              (long)
11466          * idle_to                          (long)
11467          * max_idle_to                      (long)
11468          * idle_factor                      (float)
11469          * min_time_to_alarm                (long)
11470          * max_temp_app_whitelist_duration  (long)
11471          * notification_whitelist_duration  (long)
11472          * </pre>
11473          *
11474          * <p>
11475          * Type: string
11476          * @hide
11477          * @see com.android.server.DeviceIdleController.Constants
11478          */
11479         public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants";
11480 
11481         /**
11482          * Battery Saver specific settings
11483          * This is encoded as a key=value list, separated by commas. Ex:
11484          *
11485          * "vibration_disabled=true,adjust_brightness_factor=0.5"
11486          *
11487          * The following keys are supported:
11488          *
11489          * <pre>
11490          * advertise_is_enabled              (boolean)
11491          * datasaver_disabled                (boolean)
11492          * enable_night_mode                 (boolean)
11493          * launch_boost_disabled             (boolean)
11494          * vibration_disabled                (boolean)
11495          * animation_disabled                (boolean)
11496          * soundtrigger_disabled             (boolean)
11497          * fullbackup_deferred               (boolean)
11498          * keyvaluebackup_deferred           (boolean)
11499          * firewall_disabled                 (boolean)
11500          * gps_mode                          (int)
11501          * adjust_brightness_disabled        (boolean)
11502          * adjust_brightness_factor          (float)
11503          * force_all_apps_standby            (boolean)
11504          * force_background_check            (boolean)
11505          * optional_sensors_disabled         (boolean)
11506          * aod_disabled                      (boolean)
11507          * quick_doze_enabled                (boolean)
11508          * </pre>
11509          * @hide
11510          * @see com.android.server.power.batterysaver.BatterySaverPolicy
11511          */
11512         @UnsupportedAppUsage
11513         @TestApi
11514         public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants";
11515 
11516         /**
11517          * Battery Saver device specific settings
11518          * This is encoded as a key=value list, separated by commas.
11519          *
11520          * The following keys are supported:
11521          *
11522          * <pre>
11523          *     cpufreq-i (list of "core-number:frequency" pairs concatenated with /)
11524          *     cpufreq-n (list of "core-number:frequency" pairs concatenated with /)
11525          * </pre>
11526          *
11527          * See {@link com.android.server.power.batterysaver.BatterySaverPolicy} for the details.
11528          *
11529          * @hide
11530          */
11531         public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS =
11532                 "battery_saver_device_specific_constants";
11533 
11534         /**
11535          * Settings for adaptive Battery Saver mode. Uses the same flags as
11536          * {@link #BATTERY_SAVER_CONSTANTS}.
11537          *
11538          * @hide
11539          */
11540         public static final String BATTERY_SAVER_ADAPTIVE_CONSTANTS =
11541                 "battery_saver_adaptive_constants";
11542 
11543         /**
11544          * Device specific settings for adaptive Battery Saver mode. Uses the same flags as
11545          * {@link #BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS}.
11546          *
11547          * @hide
11548          */
11549         public static final String BATTERY_SAVER_ADAPTIVE_DEVICE_SPECIFIC_CONSTANTS =
11550                 "battery_saver_adaptive_device_specific_constants";
11551 
11552         /**
11553          * Battery tip specific settings
11554          * This is encoded as a key=value list, separated by commas. Ex:
11555          *
11556          * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true,"
11557          * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50,"
11558          * "high_usage_battery_draining=25,high_usage_period_ms=3000"
11559          *
11560          * The following keys are supported:
11561          *
11562          * <pre>
11563          * battery_tip_enabled              (boolean)
11564          * summary_enabled                  (boolean)
11565          * battery_saver_tip_enabled        (boolean)
11566          * high_usage_enabled               (boolean)
11567          * high_usage_app_count             (int)
11568          * high_usage_period_ms             (long)
11569          * high_usage_battery_draining      (int)
11570          * app_restriction_enabled          (boolean)
11571          * reduced_battery_enabled          (boolean)
11572          * reduced_battery_percent          (int)
11573          * low_battery_enabled              (boolean)
11574          * low_battery_hour                 (int)
11575          * </pre>
11576          * @hide
11577          */
11578         public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants";
11579 
11580         /**
11581          * Battery anomaly detection specific settings
11582          * This is encoded as a key=value list, separated by commas.
11583          * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via
11584          * {@link Uri#encode(String)}, separated by colons. Ex:
11585          *
11586          * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true,"
11587          * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon"
11588          *
11589          * The following keys are supported:
11590          *
11591          * <pre>
11592          * anomaly_detection_enabled       (boolean)
11593          * wakelock_enabled                (boolean)
11594          * wakelock_threshold              (long)
11595          * wakeup_alarm_enabled            (boolean)
11596          * wakeup_alarm_threshold          (long)
11597          * wakeup_blacklisted_tags         (string)
11598          * bluetooth_scan_enabled          (boolean)
11599          * bluetooth_scan_threshold        (long)
11600          * </pre>
11601          * @hide
11602          */
11603         public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants";
11604 
11605         /**
11606          * An integer to show the version of the anomaly config. Ex: 1, which means
11607          * current version is 1.
11608          * @hide
11609          */
11610         public static final String ANOMALY_CONFIG_VERSION = "anomaly_config_version";
11611 
11612         /**
11613          * A base64-encoded string represents anomaly stats config, used for
11614          * {@link android.app.StatsManager}.
11615          * @hide
11616          */
11617         public static final String ANOMALY_CONFIG = "anomaly_config";
11618 
11619         /**
11620          * Always on display(AOD) specific settings
11621          * This is encoded as a key=value list, separated by commas. Ex:
11622          *
11623          * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4"
11624          *
11625          * The following keys are supported:
11626          *
11627          * <pre>
11628          * screen_brightness_array         (int[])
11629          * dimming_scrim_array             (int[])
11630          * prox_screen_off_delay           (long)
11631          * prox_cooldown_trigger           (long)
11632          * prox_cooldown_period            (long)
11633          * </pre>
11634          * @hide
11635          */
11636         public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants";
11637 
11638         /**
11639         * System VDSO global setting. This links to the "sys.vdso" system property.
11640         * The following values are supported:
11641         * false  -> both 32 and 64 bit vdso disabled
11642         * 32     -> 32 bit vdso enabled
11643         * 64     -> 64 bit vdso enabled
11644         * Any other value defaults to both 32 bit and 64 bit true.
11645         * @hide
11646         */
11647         public static final String SYS_VDSO = "sys_vdso";
11648 
11649         /**
11650         * UidCpuPower global setting. This links the sys.uidcpupower system property.
11651         * The following values are supported:
11652         * 0 -> /proc/uid_cpupower/* are disabled
11653         * 1 -> /proc/uid_cpupower/* are enabled
11654         * Any other value defaults to enabled.
11655         * @hide
11656         */
11657         public static final String SYS_UIDCPUPOWER = "sys_uidcpupower";
11658 
11659         /**
11660         * traced global setting. This controls weather the deamons: traced and
11661         * traced_probes run. This links the sys.traced system property.
11662         * The following values are supported:
11663         * 0 -> traced and traced_probes are disabled
11664         * 1 -> traced and traced_probes are enabled
11665         * Any other value defaults to disabled.
11666         * @hide
11667         */
11668         public static final String SYS_TRACED = "sys_traced";
11669 
11670         /**
11671          * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the
11672          * device for this setting to take full effect.
11673          *
11674          * @hide
11675          */
11676         public static final String FPS_DEVISOR = "fps_divisor";
11677 
11678         /**
11679          * Flag to enable or disable display panel low power mode (lpm)
11680          * false -> Display panel power saving mode is disabled.
11681          * true  -> Display panel power saving mode is enabled.
11682          *
11683          * @hide
11684          */
11685         public static final String DISPLAY_PANEL_LPM = "display_panel_lpm";
11686 
11687         /**
11688          * App time limit usage source setting.
11689          * This controls which app in a task will be considered the source of usage when
11690          * calculating app usage time limits.
11691          *
11692          * 1 -> task root app
11693          * 2 -> current app
11694          * Any other value defaults to task root app.
11695          *
11696          * Need to reboot the device for this setting to take effect.
11697          * @hide
11698          */
11699         public static final String APP_TIME_LIMIT_USAGE_SOURCE = "app_time_limit_usage_source";
11700 
11701         /**
11702          * App standby (app idle) specific settings.
11703          * This is encoded as a key=value list, separated by commas. Ex:
11704          * <p>
11705          * "idle_duration=5000,prediction_timeout=4500,screen_thresholds=0/0/60000/120000"
11706          * <p>
11707          * All durations are in millis.
11708          * Array values are separated by forward slashes
11709          * The following keys are supported:
11710          *
11711          * <pre>
11712          * screen_thresholds                (long[4])
11713          * elapsed_thresholds               (long[4])
11714          * strong_usage_duration            (long)
11715          * notification_seen_duration       (long)
11716          * system_update_usage_duration     (long)
11717          * prediction_timeout               (long)
11718          * sync_adapter_duration            (long)
11719          * exempted_sync_duration           (long)
11720          * system_interaction_duration      (long)
11721          * initial_foreground_service_start_duration (long)
11722          * cross_profile_apps_share_standby_buckets  (boolean)
11723          * </pre>
11724          *
11725          * <p>
11726          * Type: string
11727          * @hide
11728          * @see com.android.server.usage.AppStandbyController
11729          */
11730         public static final String APP_IDLE_CONSTANTS = "app_idle_constants";
11731 
11732         /**
11733          * Enable ART bytecode verification verifications for debuggable apps.
11734          * 0 = disable, 1 = enable.
11735          * @hide
11736          */
11737         public static final String ART_VERIFIER_VERIFY_DEBUGGABLE =
11738                 "art_verifier_verify_debuggable";
11739 
11740         /**
11741          * Power manager specific settings.
11742          * This is encoded as a key=value list, separated by commas. Ex:
11743          *
11744          * "no_cached_wake_locks=1"
11745          *
11746          * The following keys are supported:
11747          *
11748          * <pre>
11749          * no_cached_wake_locks                 (boolean)
11750          * </pre>
11751          *
11752          * <p>
11753          * Type: string
11754          * @hide
11755          * @see com.android.server.power.PowerManagerConstants
11756          */
11757         public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants";
11758 
11759         /**
11760          * Alarm manager specific settings.
11761          * This is encoded as a key=value list, separated by commas. Ex:
11762          *
11763          * "min_futurity=5000,allow_while_idle_short_time=4500"
11764          *
11765          * The following keys are supported:
11766          *
11767          * <pre>
11768          * min_futurity                         (long)
11769          * min_interval                         (long)
11770          * allow_while_idle_short_time          (long)
11771          * allow_while_idle_long_time           (long)
11772          * allow_while_idle_whitelist_duration  (long)
11773          * </pre>
11774          *
11775          * <p>
11776          * Type: string
11777          * @hide
11778          * @see com.android.server.AlarmManagerService.Constants
11779          */
11780         public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants";
11781 
11782         /**
11783          * Job scheduler specific settings.
11784          * This is encoded as a key=value list, separated by commas. Ex:
11785          *
11786          * "min_ready_jobs_count=2,moderate_use_factor=.5"
11787          *
11788          * The following keys are supported:
11789          *
11790          * <pre>
11791          * min_idle_count                       (int)
11792          * min_charging_count                   (int)
11793          * min_connectivity_count               (int)
11794          * min_content_count                    (int)
11795          * min_ready_jobs_count                 (int)
11796          * heavy_use_factor                     (float)
11797          * moderate_use_factor                  (float)
11798          * fg_job_count                         (int)
11799          * bg_normal_job_count                  (int)
11800          * bg_moderate_job_count                (int)
11801          * bg_low_job_count                     (int)
11802          * bg_critical_job_count                (int)
11803          * </pre>
11804          *
11805          * <p>
11806          * Type: string
11807          * @hide
11808          * @see com.android.server.job.JobSchedulerService.Constants
11809          */
11810         public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants";
11811 
11812         /**
11813          * Job scheduler QuotaController specific settings.
11814          * This is encoded as a key=value list, separated by commas. Ex:
11815          *
11816          * "max_job_count_working=5,max_job_count_rare=2"
11817          *
11818          * <p>
11819          * Type: string
11820          *
11821          * @hide
11822          * @see com.android.server.job.JobSchedulerService.Constants
11823          */
11824         public static final String JOB_SCHEDULER_QUOTA_CONTROLLER_CONSTANTS =
11825                 "job_scheduler_quota_controller_constants";
11826 
11827         /**
11828          * Job scheduler TimeController specific settings.
11829          * This is encoded as a key=value list, separated by commas. Ex:
11830          *
11831          * "skip_not_ready_jobs=true5,other_key=2"
11832          *
11833          * <p>
11834          * Type: string
11835          *
11836          * @hide
11837          * @see com.android.server.job.JobSchedulerService.Constants
11838          */
11839         public static final String JOB_SCHEDULER_TIME_CONTROLLER_CONSTANTS =
11840                 "job_scheduler_time_controller_constants";
11841 
11842         /**
11843          * ShortcutManager specific settings.
11844          * This is encoded as a key=value list, separated by commas. Ex:
11845          *
11846          * "reset_interval_sec=86400,max_updates_per_interval=1"
11847          *
11848          * The following keys are supported:
11849          *
11850          * <pre>
11851          * reset_interval_sec              (long)
11852          * max_updates_per_interval        (int)
11853          * max_icon_dimension_dp           (int, DP)
11854          * max_icon_dimension_dp_lowram    (int, DP)
11855          * max_shortcuts                   (int)
11856          * icon_quality                    (int, 0-100)
11857          * icon_format                     (String)
11858          * </pre>
11859          *
11860          * <p>
11861          * Type: string
11862          * @hide
11863          * @see com.android.server.pm.ShortcutService.ConfigConstants
11864          */
11865         public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants";
11866 
11867         /**
11868          * DevicePolicyManager specific settings.
11869          * This is encoded as a key=value list, separated by commas. Ex:
11870          *
11871          * <pre>
11872          * das_died_service_reconnect_backoff_sec       (long)
11873          * das_died_service_reconnect_backoff_increase  (float)
11874          * das_died_service_reconnect_max_backoff_sec   (long)
11875          * </pre>
11876          *
11877          * <p>
11878          * Type: string
11879          * @hide
11880          * see also com.android.server.devicepolicy.DevicePolicyConstants
11881          */
11882         public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants";
11883 
11884         /**
11885          * TextClassifier specific settings.
11886          * This is encoded as a key=value list, separated by commas. String[] types like
11887          * entity_list_default use ":" as delimiter for values. Ex:
11888          *
11889          * <pre>
11890          * classify_text_max_range_length                   (int)
11891          * detect_language_from_text_enabled                (boolean)
11892          * entity_list_default                              (String[])
11893          * entity_list_editable                             (String[])
11894          * entity_list_not_editable                         (String[])
11895          * generate_links_log_sample_rate                   (int)
11896          * generate_links_max_text_length                   (int)
11897          * in_app_conversation_action_types_default         (String[])
11898          * lang_id_context_settings                         (float[])
11899          * lang_id_threshold_override                       (float)
11900          * local_textclassifier_enabled                     (boolean)
11901          * model_dark_launch_enabled                        (boolean)
11902          * notification_conversation_action_types_default   (String[])
11903          * smart_linkify_enabled                            (boolean)
11904          * smart_select_animation_enabled                   (boolean)
11905          * smart_selection_enabled                          (boolean)
11906          * smart_text_share_enabled                         (boolean)
11907          * suggest_selection_max_range_length               (int)
11908          * system_textclassifier_enabled                    (boolean)
11909          * template_intent_factory_enabled                  (boolean)
11910          * translate_in_classification_enabled              (boolean)
11911          * </pre>
11912          *
11913          * <p>
11914          * Type: string
11915          * @hide
11916          * see also android.view.textclassifier.TextClassificationConstants
11917          */
11918         public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants";
11919 
11920         /**
11921          * BatteryStats specific settings.
11922          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
11923          *
11924          * The following keys are supported:
11925          * <pre>
11926          * track_cpu_times_by_proc_state (boolean)
11927          * track_cpu_active_cluster_time (boolean)
11928          * read_binary_cpu_time          (boolean)
11929          * proc_state_cpu_times_read_delay_ms (long)
11930          * external_stats_collection_rate_limit_ms (long)
11931          * battery_level_collection_delay_ms (long)
11932          * max_history_files (int)
11933          * max_history_buffer_kb (int)
11934          * battery_charged_delay_ms (int)
11935          * </pre>
11936          *
11937          * <p>
11938          * Type: string
11939          * @hide
11940          * see also com.android.internal.os.BatteryStatsImpl.Constants
11941          */
11942         public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants";
11943 
11944         /**
11945          * SyncManager specific settings.
11946          *
11947          * <p>
11948          * Type: string
11949          * @hide
11950          * @see com.android.server.content.SyncManagerConstants
11951          */
11952         public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants";
11953 
11954         /**
11955          * Broadcast dispatch tuning parameters specific to foreground broadcasts.
11956          *
11957          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
11958          *
11959          * The following keys are supported:
11960          * <pre>
11961          * bcast_timeout                (long)
11962          * bcast_slow_time              (long)
11963          * bcast_deferral               (long)
11964          * bcast_deferral_decay_factor  (float)
11965          * bcast_deferral_floor         (long)
11966          * bcast_allow_bg_activity_start_timeout    (long)
11967          * </pre>
11968          *
11969          * @hide
11970          */
11971         public static final String BROADCAST_FG_CONSTANTS = "bcast_fg_constants";
11972 
11973         /**
11974          * Broadcast dispatch tuning parameters specific to background broadcasts.
11975          *
11976          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true".
11977          * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys.
11978          *
11979          * @hide
11980          */
11981         public static final String BROADCAST_BG_CONSTANTS = "bcast_bg_constants";
11982 
11983         /**
11984          * Broadcast dispatch tuning parameters specific to specific "offline" broadcasts.
11985          *
11986          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true".
11987          * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys.
11988          *
11989          * @hide
11990          */
11991         public static final String BROADCAST_OFFLOAD_CONSTANTS = "bcast_offload_constants";
11992 
11993         /**
11994          * Whether or not App Standby feature is enabled by system. This controls throttling of apps
11995          * based on usage patterns and predictions. Platform will turn on this feature if both this
11996          * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on.
11997          * Type: int (0 for false, 1 for true)
11998          * Default: 1
11999          * @hide
12000          * @see #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED
12001          */
12002         @SystemApi
12003         public static final String APP_STANDBY_ENABLED = "app_standby_enabled";
12004 
12005         /**
12006          * Whether or not adaptive battery feature is enabled by user. Platform will turn on this
12007          * feature if both this flag and {@link #APP_STANDBY_ENABLED} is on.
12008          * Type: int (0 for false, 1 for true)
12009          * Default: 1
12010          * @hide
12011          * @see #APP_STANDBY_ENABLED
12012          */
12013         public static final String ADAPTIVE_BATTERY_MANAGEMENT_ENABLED =
12014                 "adaptive_battery_management_enabled";
12015 
12016         /**
12017          * Whether or not apps are allowed into the
12018          * {@link android.app.usage.UsageStatsManager#STANDBY_BUCKET_RESTRICTED} bucket.
12019          * Type: int (0 for false, 1 for true)
12020          * Default: {@value #DEFAULT_ENABLE_RESTRICTED_BUCKET}
12021          *
12022          * @hide
12023          */
12024         public static final String ENABLE_RESTRICTED_BUCKET = "enable_restricted_bucket";
12025 
12026         /**
12027          * @see #ENABLE_RESTRICTED_BUCKET
12028          * @hide
12029          */
12030         public static final int DEFAULT_ENABLE_RESTRICTED_BUCKET = 0;
12031 
12032         /**
12033          * Whether or not app auto restriction is enabled. When it is enabled, settings app will
12034          * auto restrict the app if it has bad behavior (e.g. hold wakelock for long time).
12035          *
12036          * Type: boolean (0 for false, 1 for true)
12037          * Default: 1
12038          *
12039          * @hide
12040          */
12041         public static final String APP_AUTO_RESTRICTION_ENABLED =
12042                 "app_auto_restriction_enabled";
12043 
12044         /**
12045          * Feature flag to enable or disable the Forced App Standby feature.
12046          * Type: int (0 for false, 1 for true)
12047          * Default: 1
12048          * @hide
12049          */
12050         public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled";
12051 
12052         /**
12053          * Whether or not to enable Forced App Standby on small battery devices.
12054          * Type: int (0 for false, 1 for true)
12055          * Default: 0
12056          * @hide
12057          */
12058         public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED
12059                 = "forced_app_standby_for_small_battery_enabled";
12060 
12061         /**
12062          * Whether or not to enable the User Absent, Radios Off feature on small battery devices.
12063          * Type: int (0 for false, 1 for true)
12064          * Default: 0
12065          * @hide
12066          */
12067         public static final String USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED
12068                 = "user_absent_radios_off_for_small_battery_enabled";
12069 
12070         /**
12071          * Whether or not to enable the User Absent, Touch Off feature on small battery devices.
12072          * Type: int (0 for false, 1 for true)
12073          * Default: 0
12074          * @hide
12075          */
12076         public static final String USER_ABSENT_TOUCH_OFF_FOR_SMALL_BATTERY_ENABLED
12077                 = "user_absent_touch_off_for_small_battery_enabled";
12078 
12079         /**
12080          * Whether or not to turn on Wifi when proxy is disconnected.
12081          * Type: int (0 for false, 1 for true)
12082          * Default: 1
12083          * @hide
12084          */
12085         public static final String WIFI_ON_WHEN_PROXY_DISCONNECTED
12086                 = "wifi_on_when_proxy_disconnected";
12087 
12088         /**
12089          * Time Only Mode specific settings.
12090          * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
12091          *
12092          * The following keys are supported:
12093          *
12094          * <pre>
12095          * enabled                  (boolean)
12096          * disable_home             (boolean)
12097          * disable_tilt_to_wake     (boolean)
12098          * disable_touch_to_wake    (boolean)
12099          * </pre>
12100          * Type: string
12101          * @hide
12102          */
12103         public static final String TIME_ONLY_MODE_CONSTANTS
12104                 = "time_only_mode_constants";
12105 
12106         /**
12107          * Whether of not to send keycode sleep for ungaze when Home is the foreground activity on
12108          * watch type devices.
12109          * Type: int (0 for false, 1 for true)
12110          * Default: 0
12111          * @hide
12112          */
12113         public static final String UNGAZE_SLEEP_ENABLED = "ungaze_sleep_enabled";
12114 
12115         /**
12116          * Whether or not Network Watchlist feature is enabled.
12117          * Type: int (0 for false, 1 for true)
12118          * Default: 0
12119          * @hide
12120          */
12121         public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled";
12122 
12123         /**
12124          * Whether or not show hidden launcher icon apps feature is enabled.
12125          * Type: int (0 for false, 1 for true)
12126          * Default: 1
12127          * @hide
12128          */
12129         public static final String SHOW_HIDDEN_LAUNCHER_ICON_APPS_ENABLED =
12130                 "show_hidden_icon_apps_enabled";
12131 
12132         /**
12133          * Whether or not show new app installed notification is enabled.
12134          * Type: int (0 for false, 1 for true)
12135          * Default: 0
12136          * @hide
12137          */
12138         public static final String SHOW_NEW_APP_INSTALLED_NOTIFICATION_ENABLED =
12139                 "show_new_app_installed_notification_enabled";
12140 
12141         /**
12142          * Flag to keep background restricted profiles running after exiting. If disabled,
12143          * the restricted profile can be put into stopped state as soon as the user leaves it.
12144          * Type: int (0 for false, 1 for true)
12145          *
12146          * Overridden by the system based on device information. If null, the value specified
12147          * by {@code config_keepRestrictedProfilesInBackground} is used.
12148          *
12149          * @hide
12150          */
12151         public static final String KEEP_PROFILE_IN_BACKGROUND = "keep_profile_in_background";
12152 
12153         /**
12154          * The default time in ms within which a subsequent connection from an always allowed system
12155          * is allowed to reconnect without user interaction.
12156          *
12157          * @hide
12158          */
12159         public static final long DEFAULT_ADB_ALLOWED_CONNECTION_TIME = 604800000;
12160 
12161         /**
12162          * When the user first connects their device to a system a prompt is displayed to allow
12163          * the adb connection with an option to 'Always allow' connections from this system. If the
12164          * user selects this always allow option then the connection time is stored for the system.
12165          * This setting is the time in ms within which a subsequent connection from an always
12166          * allowed system is allowed to reconnect without user interaction.
12167          *
12168          * Type: long
12169          *
12170          * @hide
12171          */
12172         public static final String ADB_ALLOWED_CONNECTION_TIME =
12173                 "adb_allowed_connection_time";
12174 
12175         /**
12176          * Scaling factor for normal window animations. Setting to 0 will
12177          * disable window animations.
12178          */
12179         public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
12180 
12181         /**
12182          * Scaling factor for activity transition animations. Setting to 0 will
12183          * disable window animations.
12184          */
12185         public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
12186 
12187         /**
12188          * Scaling factor for Animator-based animations. This affects both the
12189          * start delay and duration of all such animations. Setting to 0 will
12190          * cause animations to end immediately. The default value is 1.
12191          */
12192         public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
12193 
12194         /**
12195          * Scaling factor for normal window animations. Setting to 0 will
12196          * disable window animations.
12197          *
12198          * @hide
12199          */
12200         public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
12201 
12202         /**
12203          * If 0, the compatibility mode is off for all applications.
12204          * If 1, older applications run under compatibility mode.
12205          * TODO: remove this settings before code freeze (bug/1907571)
12206          * @hide
12207          */
12208         public static final String COMPATIBILITY_MODE = "compatibility_mode";
12209 
12210         /**
12211          * CDMA only settings
12212          * Emergency Tone  0 = Off
12213          *                 1 = Alert
12214          *                 2 = Vibrate
12215          * @hide
12216          */
12217         public static final String EMERGENCY_TONE = "emergency_tone";
12218 
12219         /**
12220          * CDMA only settings
12221          * Whether the auto retry is enabled. The value is
12222          * boolean (1 or 0).
12223          * @hide
12224          */
12225         public static final String CALL_AUTO_RETRY = "call_auto_retry";
12226 
12227         /**
12228          * A setting that can be read whether the emergency affordance is currently needed.
12229          * The value is a boolean (1 or 0).
12230          * @hide
12231          */
12232         public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed";
12233 
12234         /**
12235          * Whether to enable automatic system server heap dumps. This only works on userdebug or
12236          * eng builds, not on user builds. This is set by the user and overrides the config value.
12237          * 1 means enable, 0 means disable.
12238          *
12239          * @hide
12240          */
12241         public static final String ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS =
12242                 "enable_automatic_system_server_heap_dumps";
12243 
12244         /**
12245          * See RIL_PreferredNetworkType in ril.h
12246          * @hide
12247          */
12248         @UnsupportedAppUsage
12249         public static final String PREFERRED_NETWORK_MODE =
12250                 "preferred_network_mode";
12251 
12252         /**
12253          * Name of an application package to be debugged.
12254          */
12255         public static final String DEBUG_APP = "debug_app";
12256 
12257         /**
12258          * If 1, when launching DEBUG_APP it will wait for the debugger before
12259          * starting user code.  If 0, it will run normally.
12260          */
12261         public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
12262 
12263         /**
12264          * Allow GPU debug layers?
12265          * 0 = no
12266          * 1 = yes
12267          * @hide
12268          */
12269         public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers";
12270 
12271         /**
12272          * App allowed to load GPU debug layers
12273          * @hide
12274          */
12275         public static final String GPU_DEBUG_APP = "gpu_debug_app";
12276 
12277         /**
12278          * Package containing ANGLE libraries other than system, which are only available
12279          * to dumpable apps that opt-in.
12280          * @hide
12281          */
12282         public static final String GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE =
12283                 "angle_debug_package";
12284 
12285         /**
12286          * Force all PKGs to use ANGLE, regardless of any other settings
12287          * The value is a boolean (1 or 0).
12288          * @hide
12289          */
12290         public static final String GLOBAL_SETTINGS_ANGLE_GL_DRIVER_ALL_ANGLE =
12291                 "angle_gl_driver_all_angle";
12292 
12293         /**
12294          * List of PKGs that have an OpenGL driver selected
12295          * @hide
12296          */
12297         public static final String GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_PKGS =
12298                 "angle_gl_driver_selection_pkgs";
12299 
12300         /**
12301          * List of selected OpenGL drivers, corresponding to the PKGs in GLOBAL_SETTINGS_DRIVER_PKGS
12302          * @hide
12303          */
12304         public static final String GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_VALUES =
12305                 "angle_gl_driver_selection_values";
12306 
12307         /**
12308          * List of package names that should check ANGLE rules
12309          * @hide
12310          */
12311         public static final String GLOBAL_SETTINGS_ANGLE_WHITELIST =
12312                 "angle_whitelist";
12313 
12314         /**
12315          * Show the "ANGLE In Use" dialog box to the user when ANGLE is the OpenGL driver.
12316          * The value is a boolean (1 or 0).
12317          * @hide
12318          */
12319         public static final String GLOBAL_SETTINGS_SHOW_ANGLE_IN_USE_DIALOG_BOX =
12320                 "show_angle_in_use_dialog_box";
12321 
12322         /**
12323          * Game Driver global preference for all Apps.
12324          * 0 = Default
12325          * 1 = All Apps use Game Driver
12326          * 2 = All Apps use system graphics driver
12327          * @hide
12328          */
12329         public static final String GAME_DRIVER_ALL_APPS = "game_driver_all_apps";
12330 
12331         /**
12332          * List of Apps selected to use Game Driver.
12333          * i.e. <pkg1>,<pkg2>,...,<pkgN>
12334          * @hide
12335          */
12336         public static final String GAME_DRIVER_OPT_IN_APPS = "game_driver_opt_in_apps";
12337 
12338         /**
12339          * List of Apps selected to use prerelease Game Driver.
12340          * i.e. <pkg1>,<pkg2>,...,<pkgN>
12341          * @hide
12342          */
12343         public static final String GAME_DRIVER_PRERELEASE_OPT_IN_APPS =
12344                 "game_driver_prerelease_opt_in_apps";
12345 
12346         /**
12347          * List of Apps selected not to use Game Driver.
12348          * i.e. <pkg1>,<pkg2>,...,<pkgN>
12349          * @hide
12350          */
12351         public static final String GAME_DRIVER_OPT_OUT_APPS = "game_driver_opt_out_apps";
12352 
12353         /**
12354          * Apps on the blacklist that are forbidden to use Game Driver.
12355          * @hide
12356          */
12357         public static final String GAME_DRIVER_BLACKLIST = "game_driver_blacklist";
12358 
12359         /**
12360          * List of blacklists, each blacklist is a blacklist for a specific version of Game Driver.
12361          * @hide
12362          */
12363         public static final String GAME_DRIVER_BLACKLISTS = "game_driver_blacklists";
12364 
12365         /**
12366          * Apps on the whitelist that are allowed to use Game Driver.
12367          * The string is a list of application package names, seperated by comma.
12368          * i.e. <apk1>,<apk2>,...,<apkN>
12369          * @hide
12370          */
12371         public static final String GAME_DRIVER_WHITELIST = "game_driver_whitelist";
12372 
12373         /**
12374          * List of libraries in sphal accessible by Game Driver
12375          * The string is a list of library names, separated by colon.
12376          * i.e. <lib1>:<lib2>:...:<libN>
12377          * @hide
12378          */
12379         public static final String GAME_DRIVER_SPHAL_LIBRARIES = "game_driver_sphal_libraries";
12380 
12381         /**
12382          * Ordered GPU debug layer list for Vulkan
12383          * i.e. <layer1>:<layer2>:...:<layerN>
12384          * @hide
12385          */
12386         public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers";
12387 
12388         /**
12389          * Ordered GPU debug layer list for GLES
12390          * i.e. <layer1>:<layer2>:...:<layerN>
12391          * @hide
12392          */
12393         public static final String GPU_DEBUG_LAYERS_GLES = "gpu_debug_layers_gles";
12394 
12395         /**
12396          * Addition app for GPU layer discovery
12397          * @hide
12398          */
12399         public static final String GPU_DEBUG_LAYER_APP = "gpu_debug_layer_app";
12400 
12401         /**
12402          * Control whether the process CPU usage meter should be shown.
12403          *
12404          * @deprecated This functionality is no longer available as of
12405          * {@link android.os.Build.VERSION_CODES#N_MR1}.
12406          */
12407         @Deprecated
12408         public static final String SHOW_PROCESSES = "show_processes";
12409 
12410         /**
12411          * If 1 low power mode (aka battery saver) is enabled.
12412          * @hide
12413          */
12414         @TestApi
12415         public static final String LOW_POWER_MODE = "low_power";
12416 
12417         /**
12418          * If 1, battery saver ({@link #LOW_POWER_MODE}) will be re-activated after the device
12419          * is unplugged from a charger or rebooted.
12420          * @hide
12421          */
12422         @TestApi
12423         public static final String LOW_POWER_MODE_STICKY = "low_power_sticky";
12424 
12425         /**
12426          * When a device is unplugged from a changer (or is rebooted), do not re-activate battery
12427          * saver even if {@link #LOW_POWER_MODE_STICKY} is 1, if the battery level is equal to or
12428          * above this threshold.
12429          *
12430          * @hide
12431          */
12432         public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL =
12433                 "low_power_sticky_auto_disable_level";
12434 
12435         /**
12436          * Whether sticky battery saver should be deactivated once the battery level has reached the
12437          * threshold specified by {@link #LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL}.
12438          *
12439          * @hide
12440          */
12441         public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED =
12442                 "low_power_sticky_auto_disable_enabled";
12443 
12444         /**
12445          * Battery level [1-100] at which low power mode automatically turns on.
12446          * If 0, it will not automatically turn on. For Q and newer, it will only automatically
12447          * turn on if the value is greater than 0 and the {@link #AUTOMATIC_POWER_SAVE_MODE}
12448          * setting is also set to
12449          * {@link android.os.PowerManager.AutoPowerSaveMode#POWER_SAVE_MODE_TRIGGER_PERCENTAGE}.
12450          * @see #AUTOMATIC_POWER_SAVE_MODE
12451          * @see android.os.PowerManager#getPowerSaveModeTrigger()
12452          * @hide
12453          */
12454         public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
12455 
12456         /**
12457          * Whether battery saver is currently set to trigger based on percentage, dynamic power
12458          * savings trigger, or none. See {@link AutoPowerSaveModeTriggers} for
12459          * accepted values.
12460          *
12461          *  @hide
12462          */
12463         @TestApi
12464         public static final String AUTOMATIC_POWER_SAVE_MODE = "automatic_power_save_mode";
12465 
12466         /**
12467          * The setting that backs the disable threshold for the setPowerSavingsWarning api in
12468          * PowerManager
12469          *
12470          * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int)
12471          * @hide
12472          */
12473         @TestApi
12474         public static final String DYNAMIC_POWER_SAVINGS_DISABLE_THRESHOLD =
12475                 "dynamic_power_savings_disable_threshold";
12476 
12477         /**
12478          * The setting which backs the setDynamicPowerSaveHint api in PowerManager.
12479          *
12480          * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int)
12481          * @hide
12482          */
12483         @TestApi
12484         public static final String DYNAMIC_POWER_SAVINGS_ENABLED = "dynamic_power_savings_enabled";
12485 
12486         /**
12487          * A long value indicating how much longer the system battery is estimated to last in
12488          * millis. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value
12489          * was updated.
12490          *
12491          * @hide
12492          */
12493         public static final String TIME_REMAINING_ESTIMATE_MILLIS =
12494                 "time_remaining_estimate_millis";
12495 
12496         /**
12497          * A boolean indicating whether {@link #TIME_REMAINING_ESTIMATE_MILLIS} is based customized
12498          * to the devices usage or using global models. See
12499          * {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value was updated.
12500          *
12501          * @hide
12502          */
12503         public static final String TIME_REMAINING_ESTIMATE_BASED_ON_USAGE =
12504                 "time_remaining_estimate_based_on_usage";
12505 
12506         /**
12507          * A long value indicating how long the system battery takes to deplete from 100% to 0% on
12508          * average based on historical drain rates. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME}
12509          * for the last time this value was updated.
12510          *
12511          * @hide
12512          */
12513         public static final String AVERAGE_TIME_TO_DISCHARGE = "average_time_to_discharge";
12514 
12515         /**
12516          * A long indicating the epoch time in milliseconds when
12517          * {@link #TIME_REMAINING_ESTIMATE_MILLIS}, {@link #TIME_REMAINING_ESTIMATE_BASED_ON_USAGE},
12518          * and {@link #AVERAGE_TIME_TO_DISCHARGE} were last updated.
12519          *
12520          * @hide
12521          */
12522         public static final String BATTERY_ESTIMATES_LAST_UPDATE_TIME =
12523                 "battery_estimates_last_update_time";
12524 
12525         /**
12526          * The max value for {@link #LOW_POWER_MODE_TRIGGER_LEVEL}. If this setting is not set
12527          * or the value is 0, the default max will be used.
12528          *
12529          * @hide
12530          */
12531         public static final String LOW_POWER_MODE_TRIGGER_LEVEL_MAX = "low_power_trigger_level_max";
12532 
12533         /**
12534          * See com.android.settingslib.fuelgauge.BatterySaverUtils.
12535          * @hide
12536          */
12537         public static final String LOW_POWER_MODE_SUGGESTION_PARAMS =
12538                 "low_power_mode_suggestion_params";
12539 
12540         /**
12541          * If not 0, the activity manager will aggressively finish activities and
12542          * processes as soon as they are no longer needed.  If 0, the normal
12543          * extended lifetime is used.
12544          */
12545         public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
12546 
12547         /**
12548          * If nonzero, all system error dialogs will be hidden.  For example, the
12549          * crash and ANR dialogs will not be shown, and the system will just proceed
12550          * as if they had been accepted by the user.
12551          * @hide
12552          */
12553         @TestApi
12554         public static final String HIDE_ERROR_DIALOGS = "hide_error_dialogs";
12555 
12556         /**
12557          * Use Dock audio output for media:
12558          *      0 = disabled
12559          *      1 = enabled
12560          * @hide
12561          */
12562         public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
12563 
12564         /**
12565          * The surround sound formats AC3, DTS or IEC61937 are
12566          * available for use if they are detected.
12567          * This is the default mode.
12568          *
12569          * Note that AUTO is equivalent to ALWAYS for Android TVs and other
12570          * devices that have an S/PDIF output. This is because S/PDIF
12571          * is unidirectional and the TV cannot know if a decoder is
12572          * connected. So it assumes they are always available.
12573          * @hide
12574          */
12575          public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0;
12576 
12577         /**
12578          * AC3, DTS or IEC61937 are NEVER available, even if they
12579          * are detected by the hardware. Those formats will not be
12580          * reported.
12581          *
12582          * An example use case would be an AVR reports that it is capable of
12583          * surround sound decoding but is broken. If NEVER is chosen
12584          * then apps must use PCM output instead of encoded output.
12585          * @hide
12586          */
12587          public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1;
12588 
12589         /**
12590          * AC3, DTS or IEC61937 are ALWAYS available, even if they
12591          * are not detected by the hardware. Those formats will be
12592          * reported as part of the HDMI output capability. Applications
12593          * are then free to use either PCM or encoded output.
12594          *
12595          * An example use case would be a when TV was connected over
12596          * TOS-link to an AVR. But the TV could not see it because TOS-link
12597          * is unidirectional.
12598          * @hide
12599          */
12600          public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2;
12601 
12602         /**
12603          * Surround sound formats are available according to the choice
12604          * of user, even if they are not detected by the hardware. Those
12605          * formats will be reported as part of the HDMI output capability.
12606          * Applications are then free to use either PCM or encoded output.
12607          *
12608          * An example use case would be an AVR that doesn't report a surround
12609          * format while the user knows the AVR does support it.
12610          * @hide
12611          */
12612         public static final int ENCODED_SURROUND_OUTPUT_MANUAL = 3;
12613 
12614         /**
12615          * Set to ENCODED_SURROUND_OUTPUT_AUTO,
12616          * ENCODED_SURROUND_OUTPUT_NEVER,
12617          * ENCODED_SURROUND_OUTPUT_ALWAYS or
12618          * ENCODED_SURROUND_OUTPUT_MANUAL
12619          * @hide
12620          */
12621         public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output";
12622 
12623         /**
12624          * Surround sounds formats that are enabled when ENCODED_SURROUND_OUTPUT is set to
12625          * ENCODED_SURROUND_OUTPUT_MANUAL. Encoded as comma separated list. Allowed values
12626          * are the format constants defined in AudioFormat.java. Ex:
12627          *
12628          * "5,6"
12629          *
12630          * @hide
12631          */
12632         public static final String ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS =
12633                 "encoded_surround_output_enabled_formats";
12634 
12635         /**
12636          * Persisted safe headphone volume management state by AudioService
12637          * @hide
12638          */
12639         public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
12640 
12641         /**
12642          * URL for tzinfo (time zone) updates
12643          * @hide
12644          */
12645         public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
12646 
12647         /**
12648          * URL for tzinfo (time zone) update metadata
12649          * @hide
12650          */
12651         public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
12652 
12653         /**
12654          * URL for selinux (mandatory access control) updates
12655          * @hide
12656          */
12657         public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
12658 
12659         /**
12660          * URL for selinux (mandatory access control) update metadata
12661          * @hide
12662          */
12663         public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
12664 
12665         /**
12666          * URL for sms short code updates
12667          * @hide
12668          */
12669         public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
12670                 "sms_short_codes_content_url";
12671 
12672         /**
12673          * URL for sms short code update metadata
12674          * @hide
12675          */
12676         public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
12677                 "sms_short_codes_metadata_url";
12678 
12679         /**
12680          * URL for apn_db updates
12681          * @hide
12682          */
12683         public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url";
12684 
12685         /**
12686          * URL for apn_db update metadata
12687          * @hide
12688          */
12689         public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url";
12690 
12691         /**
12692          * URL for cert pinlist updates
12693          * @hide
12694          */
12695         public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
12696 
12697         /**
12698          * URL for cert pinlist updates
12699          * @hide
12700          */
12701         public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
12702 
12703         /**
12704          * URL for intent firewall updates
12705          * @hide
12706          */
12707         public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
12708                 "intent_firewall_content_url";
12709 
12710         /**
12711          * URL for intent firewall update metadata
12712          * @hide
12713          */
12714         public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
12715                 "intent_firewall_metadata_url";
12716 
12717         /**
12718          * URL for lang id model updates
12719          * @hide
12720          */
12721         public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url";
12722 
12723         /**
12724          * URL for lang id model update metadata
12725          * @hide
12726          */
12727         public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url";
12728 
12729         /**
12730          * URL for smart selection model updates
12731          * @hide
12732          */
12733         public static final String SMART_SELECTION_UPDATE_CONTENT_URL =
12734                 "smart_selection_content_url";
12735 
12736         /**
12737          * URL for smart selection model update metadata
12738          * @hide
12739          */
12740         public static final String SMART_SELECTION_UPDATE_METADATA_URL =
12741                 "smart_selection_metadata_url";
12742 
12743         /**
12744          * URL for conversation actions model updates
12745          * @hide
12746          */
12747         public static final String CONVERSATION_ACTIONS_UPDATE_CONTENT_URL =
12748                 "conversation_actions_content_url";
12749 
12750         /**
12751          * URL for conversation actions model update metadata
12752          * @hide
12753          */
12754         public static final String CONVERSATION_ACTIONS_UPDATE_METADATA_URL =
12755                 "conversation_actions_metadata_url";
12756 
12757         /**
12758          * SELinux enforcement status. If 0, permissive; if 1, enforcing.
12759          * @hide
12760          */
12761         public static final String SELINUX_STATUS = "selinux_status";
12762 
12763         /**
12764          * Developer setting to force RTL layout.
12765          * @hide
12766          */
12767         public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
12768 
12769         /**
12770          * Milliseconds after screen-off after which low battery sounds will be silenced.
12771          *
12772          * If zero, battery sounds will always play.
12773          * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
12774          *
12775          * @hide
12776          */
12777         public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
12778 
12779         /**
12780          * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
12781          * the caller is done with this, they should call {@link ContentResolver#delete} to
12782          * clean up any value that they may have written.
12783          *
12784          * @hide
12785          */
12786         public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
12787 
12788         /**
12789          * Defines global runtime overrides to window policy.
12790          *
12791          * See {@link com.android.server.wm.PolicyControl} for value format.
12792          *
12793          * @hide
12794          */
12795         public static final String POLICY_CONTROL = "policy_control";
12796 
12797         /**
12798          * {@link android.view.DisplayCutout DisplayCutout} emulation mode.
12799          *
12800          * @hide
12801          */
12802         public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout";
12803 
12804         /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0;
12805         /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1;
12806 
12807         /**
12808          * A colon separated list of keys for Settings Slices.
12809          *
12810          * @hide
12811          */
12812         public static final String BLOCKED_SLICES = "blocked_slices";
12813 
12814         /**
12815          * Defines global zen mode.  ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
12816          * or ZEN_MODE_NO_INTERRUPTIONS.
12817          *
12818          * @hide
12819          */
12820         @UnsupportedAppUsage
12821         public static final String ZEN_MODE = "zen_mode";
12822 
12823         /** @hide */
12824         @UnsupportedAppUsage
12825         public static final int ZEN_MODE_OFF = 0;
12826         /** @hide */
12827         @UnsupportedAppUsage
12828         public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
12829         /** @hide */
12830         @UnsupportedAppUsage
12831         public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
12832         /** @hide */
12833         @UnsupportedAppUsage
12834         public static final int ZEN_MODE_ALARMS = 3;
12835 
zenModeToString(int mode)12836         /** @hide */ public static String zenModeToString(int mode) {
12837             if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
12838             if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
12839             if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
12840             return "ZEN_MODE_OFF";
12841         }
12842 
isValidZenMode(int value)12843         /** @hide */ public static boolean isValidZenMode(int value) {
12844             switch (value) {
12845                 case Global.ZEN_MODE_OFF:
12846                 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
12847                 case Global.ZEN_MODE_ALARMS:
12848                 case Global.ZEN_MODE_NO_INTERRUPTIONS:
12849                     return true;
12850                 default:
12851                     return false;
12852             }
12853         }
12854 
12855         /**
12856          * Value of the ringer before entering zen mode.
12857          *
12858          * @hide
12859          */
12860         public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level";
12861 
12862         /**
12863          * Opaque value, changes when persisted zen mode configuration changes.
12864          *
12865          * @hide
12866          */
12867         @UnsupportedAppUsage
12868         public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
12869 
12870         /**
12871          * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION} instead
12872          * @hide
12873          */
12874         @Deprecated
12875         public static final String ZEN_DURATION = "zen_duration";
12876 
12877         /**
12878          * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_PROMPT} instead
12879          * @hide
12880          */
12881         @Deprecated
12882         public static final int ZEN_DURATION_PROMPT = -1;
12883 
12884         /**
12885          * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_FOREVER} instead
12886          * @hide
12887          */
12888         @Deprecated
12889         public static final int ZEN_DURATION_FOREVER = 0;
12890 
12891         /**
12892          * Defines global heads up toggle.  One of HEADS_UP_OFF, HEADS_UP_ON.
12893          *
12894          * @hide
12895          */
12896         @UnsupportedAppUsage
12897         public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
12898                 "heads_up_notifications_enabled";
12899 
12900         /** @hide */
12901         @UnsupportedAppUsage
12902         public static final int HEADS_UP_OFF = 0;
12903         /** @hide */
12904         @UnsupportedAppUsage
12905         public static final int HEADS_UP_ON = 1;
12906 
12907         /**
12908          * The name of the device
12909          */
12910         public static final String DEVICE_NAME = "device_name";
12911 
12912         /**
12913          * Whether the NetworkScoringService has been first initialized.
12914          * <p>
12915          * Type: int (0 for false, 1 for true)
12916          * @hide
12917          */
12918         public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
12919 
12920         /**
12921          * Indicates whether the user wants to be prompted for password to decrypt the device on
12922          * boot. This only matters if the storage is encrypted.
12923          * <p>
12924          * Type: int (0 for false, 1 for true)
12925          *
12926          * @hide
12927          */
12928         @SystemApi
12929         public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
12930 
12931         /**
12932          * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config
12933          * value
12934          * {@link android.telephony.CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL}.
12935          * <p>
12936          * Type: int (0 for false, 1 for true)
12937          * @hide
12938          * @deprecated Use
12939          * {@link android.provider.Telephony.SimInfo#COLUMN_ENHANCED_4G_MODE_ENABLED} instead.
12940          */
12941         @Deprecated
12942         public static final String ENHANCED_4G_MODE_ENABLED =
12943                 Telephony.SimInfo.COLUMN_ENHANCED_4G_MODE_ENABLED;
12944 
12945         /**
12946          * Whether VT (Video Telephony over IMS) is enabled
12947          * <p>
12948          * Type: int (0 for false, 1 for true)
12949          *
12950          * @hide
12951          * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_VT_IMS_ENABLED} instead.
12952          */
12953         @Deprecated
12954         public static final String VT_IMS_ENABLED = Telephony.SimInfo.COLUMN_VT_IMS_ENABLED;
12955 
12956         /**
12957          * Whether WFC is enabled
12958          * <p>
12959          * Type: int (0 for false, 1 for true)
12960          *
12961          * @hide
12962          * @deprecated Use
12963          * {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ENABLED} instead.
12964          */
12965         @Deprecated
12966         public static final String WFC_IMS_ENABLED = Telephony.SimInfo.COLUMN_WFC_IMS_ENABLED;
12967 
12968         /**
12969          * WFC mode on home/non-roaming network.
12970          * <p>
12971          * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
12972          *
12973          * @hide
12974          * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_MODE} instead.
12975          */
12976         @Deprecated
12977         public static final String WFC_IMS_MODE = Telephony.SimInfo.COLUMN_WFC_IMS_MODE;
12978 
12979         /**
12980          * WFC mode on roaming network.
12981          * <p>
12982          * Type: int - see {@link #WFC_IMS_MODE} for values
12983          *
12984          * @hide
12985          * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ROAMING_MODE}
12986          * instead.
12987          */
12988         @Deprecated
12989         public static final String WFC_IMS_ROAMING_MODE =
12990                 Telephony.SimInfo.COLUMN_WFC_IMS_ROAMING_MODE;
12991 
12992         /**
12993          * Whether WFC roaming is enabled
12994          * <p>
12995          * Type: int (0 for false, 1 for true)
12996          *
12997          * @hide
12998          * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ROAMING_ENABLED}
12999          * instead
13000          */
13001         @Deprecated
13002         public static final String WFC_IMS_ROAMING_ENABLED =
13003                 Telephony.SimInfo.COLUMN_WFC_IMS_ROAMING_ENABLED;
13004 
13005         /**
13006          * Whether user can enable/disable LTE as a preferred network. A carrier might control
13007          * this via gservices, OMA-DM, carrier app, etc.
13008          * <p>
13009          * Type: int (0 for false, 1 for true)
13010          * @hide
13011          */
13012         public static final String LTE_SERVICE_FORCED = "lte_service_forced";
13013 
13014 
13015         /**
13016          * Specifies the behaviour the lid triggers when closed
13017          * <p>
13018          * See WindowManagerPolicy.WindowManagerFuncs
13019          * @hide
13020          */
13021         public static final String LID_BEHAVIOR = "lid_behavior";
13022 
13023         /**
13024          * Ephemeral app cookie max size in bytes.
13025          * <p>
13026          * Type: int
13027          * @hide
13028          */
13029         public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES =
13030                 "ephemeral_cookie_max_size_bytes";
13031 
13032         /**
13033          * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is
13034          * enabled. Set to zero to disable.
13035          * <p>
13036          * Type: int (0 for false, 1 for true)
13037          *
13038          * @hide
13039          */
13040         public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature";
13041 
13042         /**
13043          * Toggle to enable/disable dexopt for instant applications. The default is for dexopt
13044          * to be disabled.
13045          * <p>
13046          * Type: int (0 to disable, 1 to enable)
13047          *
13048          * @hide
13049          */
13050         public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled";
13051 
13052         /**
13053          * The min period for caching installed instant apps in milliseconds.
13054          * <p>
13055          * Type: long
13056          * @hide
13057          */
13058         public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
13059                 "installed_instant_app_min_cache_period";
13060 
13061         /**
13062          * The max period for caching installed instant apps in milliseconds.
13063          * <p>
13064          * Type: long
13065          * @hide
13066          */
13067         public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
13068                 "installed_instant_app_max_cache_period";
13069 
13070         /**
13071          * The min period for caching uninstalled instant apps in milliseconds.
13072          * <p>
13073          * Type: long
13074          * @hide
13075          */
13076         public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
13077                 "uninstalled_instant_app_min_cache_period";
13078 
13079         /**
13080          * The max period for caching uninstalled instant apps in milliseconds.
13081          * <p>
13082          * Type: long
13083          * @hide
13084          */
13085         public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
13086                 "uninstalled_instant_app_max_cache_period";
13087 
13088         /**
13089          * The min period for caching unused static shared libs in milliseconds.
13090          * <p>
13091          * Type: long
13092          * @hide
13093          */
13094         public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD =
13095                 "unused_static_shared_lib_min_cache_period";
13096 
13097         /**
13098          * Allows switching users when system user is locked.
13099          * <p>
13100          * Type: int
13101          * @hide
13102          */
13103         public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED =
13104                 "allow_user_switching_when_system_user_locked";
13105 
13106         /**
13107          * Boot count since the device starts running API level 24.
13108          * <p>
13109          * Type: int
13110          */
13111         public static final String BOOT_COUNT = "boot_count";
13112 
13113         /**
13114          * Whether the safe boot is disallowed.
13115          *
13116          * <p>This setting should have the identical value as the corresponding user restriction.
13117          * The purpose of the setting is to make the restriction available in early boot stages
13118          * before the user restrictions are loaded.
13119          * @hide
13120          */
13121         public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed";
13122 
13123         /**
13124          * Indicates whether this device is currently in retail demo mode. If true, the device
13125          * usage is severely limited.
13126          * <p>
13127          * Type: int (0 for false, 1 for true)
13128          *
13129          * @hide
13130          */
13131         @SystemApi
13132         public static final String DEVICE_DEMO_MODE = "device_demo_mode";
13133 
13134         /**
13135          * Indicates the maximum time that an app is blocked for the network rules to get updated.
13136          *
13137          * Type: long
13138          *
13139          * @hide
13140          */
13141         public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms";
13142 
13143         /**
13144          * The reason for the settings database being downgraded. This is only for
13145          * troubleshooting purposes and its value should not be interpreted in any way.
13146          *
13147          * Type: string
13148          *
13149          * @hide
13150          */
13151         public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason";
13152 
13153         /**
13154          * The build id of when the settings database was first created (or re-created due it
13155          * being missing).
13156          *
13157          * Type: string
13158          *
13159          * @hide
13160          */
13161         public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid";
13162 
13163         /**
13164          * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by
13165          * default. Set to 0 to disable.
13166          *
13167          * @hide
13168          */
13169         public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled";
13170 
13171         /**
13172          * Flag to enable the link to location permissions in location setting. Set to 0 to disable.
13173          *
13174          * @hide
13175          */
13176         public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED =
13177                 "location_settings_link_to_permissions_enabled";
13178 
13179         /**
13180          * Flag to set the waiting time for removing invisible euicc profiles inside System >
13181          * Settings.
13182          * Type: long
13183          *
13184          * @hide
13185          */
13186         public static final String EUICC_REMOVING_INVISIBLE_PROFILES_TIMEOUT_MILLIS =
13187                 "euicc_removing_invisible_profiles_timeout_millis";
13188 
13189         /**
13190          * Flag to set the waiting time for euicc factory reset inside System > Settings
13191          * Type: long
13192          *
13193          * @hide
13194          */
13195         public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS =
13196                 "euicc_factory_reset_timeout_millis";
13197 
13198         /**
13199          * Flag to set the timeout for when to refresh the storage settings cached data.
13200          * Type: long
13201          *
13202          * @hide
13203          */
13204         public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD =
13205                 "storage_settings_clobber_threshold";
13206 
13207         /**
13208          * If set to 1, {@link Secure#LOCATION_MODE} will be set to {@link Secure#LOCATION_MODE_OFF}
13209          * temporarily for all users.
13210          *
13211          * @hide
13212          */
13213         @TestApi
13214         public static final String LOCATION_GLOBAL_KILL_SWITCH =
13215                 "location_global_kill_switch";
13216 
13217         /**
13218          * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored
13219          * and restoring to lower version of platform API will be skipped.
13220          *
13221          * @hide
13222          */
13223         public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION =
13224                 "override_settings_provider_restore_any_version";
13225         /**
13226          * Flag to toggle whether system services report attribution chains when they attribute
13227          * battery use via a {@code WorkSource}.
13228          *
13229          * Type: int (0 to disable, 1 to enable)
13230          *
13231          * @hide
13232          */
13233         public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED =
13234                 "chained_battery_attribution_enabled";
13235 
13236         /**
13237          * Toggle to enable/disable the incremental ADB installation by default.
13238          * If not set, default adb installations are incremental; set to zero to use full ones.
13239          * Note: only ADB uses it, no usages in the Framework code.
13240          * <p>
13241          * Type: int (0 to disable, 1 to enable)
13242          *
13243          * @hide
13244          */
13245         public static final String ENABLE_ADB_INCREMENTAL_INSTALL_DEFAULT =
13246                 "enable_adb_incremental_install_default";
13247 
13248         /**
13249          * The packages whitelisted to be run in autofill compatibility mode. The list
13250          * of packages is {@code ":"} colon delimited, and each entry has the name of the
13251          * package and an optional list of url bar resource ids (the list is delimited by
13252          * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited).
13253          *
13254          * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where
13255          * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 }
13256          * have 2 ids {@code url_foo} and {@code url_bas}) would be
13257          * {@code p1[url_bar]:p2:p3[url_foo,url_bas]}
13258          *
13259          * @hide
13260          */
13261         @SystemApi
13262         @TestApi
13263         public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES =
13264                 "autofill_compat_mode_allowed_packages";
13265 
13266         /**
13267          * Level of autofill logging.
13268          *
13269          * <p>Valid values are
13270          * {@link android.view.autofill.AutofillManager#NO_LOGGING},
13271          * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_DEBUG}, or
13272          * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_VERBOSE}.
13273          *
13274          * @hide
13275          */
13276         public static final String AUTOFILL_LOGGING_LEVEL = "autofill_logging_level";
13277 
13278         /**
13279          * Maximum number of partitions that can be allowed in an autofill session.
13280          *
13281          * @hide
13282          */
13283         public static final String AUTOFILL_MAX_PARTITIONS_SIZE = "autofill_max_partitions_size";
13284 
13285         /**
13286          * Maximum number of visible datasets in the Autofill dataset picker UI, or {@code 0} to use
13287          * the default value from resources.
13288          *
13289          * @hide
13290          */
13291         public static final String AUTOFILL_MAX_VISIBLE_DATASETS = "autofill_max_visible_datasets";
13292 
13293         /**
13294          * Exemptions to the hidden API blacklist.
13295          *
13296          * @hide
13297          */
13298         @TestApi
13299         public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS =
13300                 "hidden_api_blacklist_exemptions";
13301 
13302         /**
13303          * Hidden API enforcement policy for apps.
13304          *
13305          * Values correspond to @{@link
13306          * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy}
13307          *
13308          * @hide
13309          */
13310         public static final String HIDDEN_API_POLICY = "hidden_api_policy";
13311 
13312         /**
13313          * Current version of signed configuration applied.
13314          *
13315          * @hide
13316          */
13317         public static final String SIGNED_CONFIG_VERSION = "signed_config_version";
13318 
13319         /**
13320          * Timeout for a single {@link android.media.soundtrigger.SoundTriggerDetectionService}
13321          * operation (in ms).
13322          *
13323          * @hide
13324          */
13325         public static final String SOUND_TRIGGER_DETECTION_SERVICE_OP_TIMEOUT =
13326                 "sound_trigger_detection_service_op_timeout";
13327 
13328         /**
13329          * Maximum number of {@link android.media.soundtrigger.SoundTriggerDetectionService}
13330          * operations per day.
13331          *
13332          * @hide
13333          */
13334         public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY =
13335                 "max_sound_trigger_detection_service_ops_per_day";
13336 
13337         /** {@hide} */
13338         public static final String ISOLATED_STORAGE_LOCAL = "isolated_storage_local";
13339         /** {@hide} */
13340         public static final String ISOLATED_STORAGE_REMOTE = "isolated_storage_remote";
13341 
13342         /**
13343          * Indicates whether aware is available in the current location.
13344          * @hide
13345          */
13346         public static final String AWARE_ALLOWED = "aware_allowed";
13347 
13348         /**
13349          * Overrides internal R.integer.config_longPressOnPowerBehavior.
13350          * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
13351          * Used by PhoneWindowManager.
13352          * @hide
13353          */
13354         public static final String POWER_BUTTON_LONG_PRESS =
13355                 "power_button_long_press";
13356 
13357         /**
13358          * Overrides internal R.integer.config_veryLongPressOnPowerBehavior.
13359          * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
13360          * Used by PhoneWindowManager.
13361          * @hide
13362          */
13363         public static final String POWER_BUTTON_VERY_LONG_PRESS =
13364                 "power_button_very_long_press";
13365 
13366         /**
13367          * Global settings that shouldn't be persisted.
13368          *
13369          * @hide
13370          */
13371         public static final String[] TRANSIENT_SETTINGS = {
13372                 LOCATION_GLOBAL_KILL_SWITCH,
13373         };
13374 
13375         /**
13376          * Keys we no longer back up under the current schema, but want to continue to
13377          * process when restoring historical backup datasets.
13378          *
13379          * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
13380          * otherwise they won't be restored.
13381          *
13382          * @hide
13383          */
13384         public static final String[] LEGACY_RESTORE_SETTINGS = {
13385         };
13386 
13387         @UnsupportedAppUsage
13388         private static final ContentProviderHolder sProviderHolder =
13389                 new ContentProviderHolder(CONTENT_URI);
13390 
13391         // Populated lazily, guarded by class object:
13392         @UnsupportedAppUsage
13393         private static final NameValueCache sNameValueCache = new NameValueCache(
13394                     CONTENT_URI,
13395                     CALL_METHOD_GET_GLOBAL,
13396                     CALL_METHOD_PUT_GLOBAL,
13397                     sProviderHolder);
13398 
13399         // Certain settings have been moved from global to the per-user secure namespace
13400         @UnsupportedAppUsage
13401         private static final HashSet<String> MOVED_TO_SECURE;
13402         static {
13403             MOVED_TO_SECURE = new HashSet<>(8);
13404             MOVED_TO_SECURE.add(Global.INSTALL_NON_MARKET_APPS);
13405             MOVED_TO_SECURE.add(Global.ZEN_DURATION);
13406             MOVED_TO_SECURE.add(Global.SHOW_ZEN_UPGRADE_NOTIFICATION);
13407             MOVED_TO_SECURE.add(Global.SHOW_ZEN_SETTINGS_SUGGESTION);
13408             MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_UPDATED);
13409             MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_SUGGESTION_VIEWED);
13410             MOVED_TO_SECURE.add(Global.CHARGING_SOUNDS_ENABLED);
13411             MOVED_TO_SECURE.add(Global.CHARGING_VIBRATION_ENABLED);
13412 
13413         }
13414 
13415         /** @hide */
getMovedToSecureSettings(Set<String> outKeySet)13416         public static void getMovedToSecureSettings(Set<String> outKeySet) {
13417             outKeySet.addAll(MOVED_TO_SECURE);
13418         }
13419 
13420         /** @hide */
clearProviderForTest()13421         public static void clearProviderForTest() {
13422             sProviderHolder.clearProviderForTest();
13423             sNameValueCache.clearGenerationTrackerForTest();
13424         }
13425 
13426         /**
13427          * Look up a name in the database.
13428          * @param resolver to access the database with
13429          * @param name to look up in the table
13430          * @return the corresponding value, or null if not present
13431          */
getString(ContentResolver resolver, String name)13432         public static String getString(ContentResolver resolver, String name) {
13433             return getStringForUser(resolver, name, resolver.getUserId());
13434         }
13435 
13436         /** @hide */
13437         @UnsupportedAppUsage
getStringForUser(ContentResolver resolver, String name, int userHandle)13438         public static String getStringForUser(ContentResolver resolver, String name,
13439                 int userHandle) {
13440             if (MOVED_TO_SECURE.contains(name)) {
13441                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
13442                         + " to android.provider.Settings.Secure, returning read-only value.");
13443                 return Secure.getStringForUser(resolver, name, userHandle);
13444             }
13445             return sNameValueCache.getStringForUser(resolver, name, userHandle);
13446         }
13447 
13448         /**
13449          * Store a name/value pair into the database.
13450          * @param resolver to access the database with
13451          * @param name to store
13452          * @param value to associate with the name
13453          * @return true if the value was set, false on database errors
13454          */
putString(ContentResolver resolver, String name, String value)13455         public static boolean putString(ContentResolver resolver,
13456                 String name, String value) {
13457             return putStringForUser(resolver, name, value, null, false, resolver.getUserId(),
13458                     DEFAULT_OVERRIDEABLE_BY_RESTORE);
13459         }
13460 
13461         /**
13462          * Store a name/value pair into the database.
13463          *
13464          * @param resolver to access the database with
13465          * @param name to store
13466          * @param value to associate with the name
13467          * @param tag to associated with the setting.
13468          * @param makeDefault whether to make the value the default one.
13469          * @param overrideableByRestore whether restore can override this value
13470          * @return true if the value was set, false on database errors
13471          *
13472          * @hide
13473          */
13474         @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, boolean overrideableByRestore)13475         public static boolean putString(@NonNull ContentResolver resolver,
13476                 @NonNull String name, @Nullable String value, @Nullable String tag,
13477                 boolean makeDefault, boolean overrideableByRestore) {
13478             return putStringForUser(resolver, name, value, tag, makeDefault,
13479                     resolver.getUserId(), overrideableByRestore);
13480         }
13481 
13482         /**
13483          * Store a name/value pair into the database.
13484          * <p>
13485          * The method takes an optional tag to associate with the setting
13486          * which can be used to clear only settings made by your package and
13487          * associated with this tag by passing the tag to {@link
13488          * #resetToDefaults(ContentResolver, String)}. Anyone can override
13489          * the current tag. Also if another package changes the setting
13490          * then the tag will be set to the one specified in the set call
13491          * which can be null. Also any of the settings setters that do not
13492          * take a tag as an argument effectively clears the tag.
13493          * </p><p>
13494          * For example, if you set settings A and B with tags T1 and T2 and
13495          * another app changes setting A (potentially to the same value), it
13496          * can assign to it a tag T3 (note that now the package that changed
13497          * the setting is not yours). Now if you reset your changes for T1 and
13498          * T2 only setting B will be reset and A not (as it was changed by
13499          * another package) but since A did not change you are in the desired
13500          * initial state. Now if the other app changes the value of A (assuming
13501          * you registered an observer in the beginning) you would detect that
13502          * the setting was changed by another app and handle this appropriately
13503          * (ignore, set back to some value, etc).
13504          * </p><p>
13505          * Also the method takes an argument whether to make the value the
13506          * default for this setting. If the system already specified a default
13507          * value, then the one passed in here will <strong>not</strong>
13508          * be set as the default.
13509          * </p>
13510          *
13511          * @param resolver to access the database with.
13512          * @param name to store.
13513          * @param value to associate with the name.
13514          * @param tag to associated with the setting.
13515          * @param makeDefault whether to make the value the default one.
13516          * @return true if the value was set, false on database errors.
13517          *
13518          * @see #resetToDefaults(ContentResolver, String)
13519          *
13520          * @hide
13521          */
13522         @SystemApi
13523         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)13524         public static boolean putString(@NonNull ContentResolver resolver,
13525                 @NonNull String name, @Nullable String value, @Nullable String tag,
13526                 boolean makeDefault) {
13527             return putStringForUser(resolver, name, value, tag, makeDefault,
13528                     resolver.getUserId(), DEFAULT_OVERRIDEABLE_BY_RESTORE);
13529         }
13530 
13531         /**
13532          * Reset the settings to their defaults. This would reset <strong>only</strong>
13533          * settings set by the caller's package. Think of it of a way to undo your own
13534          * changes to the secure settings. Passing in the optional tag will reset only
13535          * settings changed by your package and associated with this tag.
13536          *
13537          * @param resolver Handle to the content resolver.
13538          * @param tag Optional tag which should be associated with the settings to reset.
13539          *
13540          * @see #putString(ContentResolver, String, String, String, boolean)
13541          *
13542          * @hide
13543          */
13544         @SystemApi
13545         @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)13546         public static void resetToDefaults(@NonNull ContentResolver resolver,
13547                 @Nullable String tag) {
13548             resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
13549                     resolver.getUserId());
13550         }
13551 
13552         /**
13553          * Reset the settings to their defaults for a given user with a specific mode. The
13554          * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
13555          * allowing resetting the settings made by a package and associated with the tag.
13556          *
13557          * @param resolver Handle to the content resolver.
13558          * @param tag Optional tag which should be associated with the settings to reset.
13559          * @param mode The reset mode.
13560          * @param userHandle The user for which to reset to defaults.
13561          *
13562          * @see #RESET_MODE_PACKAGE_DEFAULTS
13563          * @see #RESET_MODE_UNTRUSTED_DEFAULTS
13564          * @see #RESET_MODE_UNTRUSTED_CHANGES
13565          * @see #RESET_MODE_TRUSTED_DEFAULTS
13566          *
13567          * @hide
13568          */
resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)13569         public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
13570                 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
13571             try {
13572                 Bundle arg = new Bundle();
13573                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
13574                 if (tag != null) {
13575                     arg.putString(CALL_METHOD_TAG_KEY, tag);
13576                 }
13577                 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
13578                 IContentProvider cp = sProviderHolder.getProvider(resolver);
13579                 cp.call(resolver.getPackageName(), resolver.getAttributionTag(),
13580                         sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_GLOBAL, null, arg);
13581             } catch (RemoteException e) {
13582                 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
13583             }
13584         }
13585 
13586         /** @hide */
13587         @UnsupportedAppUsage
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)13588         public static boolean putStringForUser(ContentResolver resolver,
13589                 String name, String value, int userHandle) {
13590             return putStringForUser(resolver, name, value, null, false, userHandle,
13591                     DEFAULT_OVERRIDEABLE_BY_RESTORE);
13592         }
13593 
13594         /** @hide */
putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore)13595         public static boolean putStringForUser(@NonNull ContentResolver resolver,
13596                 @NonNull String name, @Nullable String value, @Nullable String tag,
13597                 boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore) {
13598             if (LOCAL_LOGV) {
13599                 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
13600                         + " for " + userHandle);
13601             }
13602             // Global and Secure have the same access policy so we can forward writes
13603             if (MOVED_TO_SECURE.contains(name)) {
13604                 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
13605                         + " to android.provider.Settings.Secure, value is unchanged.");
13606                 return Secure.putStringForUser(resolver, name, value, tag,
13607                         makeDefault, userHandle, overrideableByRestore);
13608             }
13609             return sNameValueCache.putStringForUser(resolver, name, value, tag,
13610                     makeDefault, userHandle, overrideableByRestore);
13611         }
13612 
13613         /**
13614          * Construct the content URI for a particular name/value pair,
13615          * useful for monitoring changes with a ContentObserver.
13616          * @param name to look up in the table
13617          * @return the corresponding content URI, or null if not present
13618          */
getUriFor(String name)13619         public static Uri getUriFor(String name) {
13620             return getUriFor(CONTENT_URI, name);
13621         }
13622 
13623         /**
13624          * Convenience function for retrieving a single secure settings value
13625          * as an integer.  Note that internally setting values are always
13626          * stored as strings; this function converts the string to an integer
13627          * for you.  The default value will be returned if the setting is
13628          * not defined or not an integer.
13629          *
13630          * @param cr The ContentResolver to access.
13631          * @param name The name of the setting to retrieve.
13632          * @param def Value to return if the setting is not defined.
13633          *
13634          * @return The setting's current value, or 'def' if it is not defined
13635          * or not a valid integer.
13636          */
getInt(ContentResolver cr, String name, int def)13637         public static int getInt(ContentResolver cr, String name, int def) {
13638             String v = getString(cr, name);
13639             try {
13640                 return v != null ? Integer.parseInt(v) : def;
13641             } catch (NumberFormatException e) {
13642                 return def;
13643             }
13644         }
13645 
13646         /**
13647          * Convenience function for retrieving a single secure settings value
13648          * as an integer.  Note that internally setting values are always
13649          * stored as strings; this function converts the string to an integer
13650          * for you.
13651          * <p>
13652          * This version does not take a default value.  If the setting has not
13653          * been set, or the string value is not a number,
13654          * it throws {@link SettingNotFoundException}.
13655          *
13656          * @param cr The ContentResolver to access.
13657          * @param name The name of the setting to retrieve.
13658          *
13659          * @throws SettingNotFoundException Thrown if a setting by the given
13660          * name can't be found or the setting value is not an integer.
13661          *
13662          * @return The setting's current value.
13663          */
getInt(ContentResolver cr, String name)13664         public static int getInt(ContentResolver cr, String name)
13665                 throws SettingNotFoundException {
13666             String v = getString(cr, name);
13667             try {
13668                 return Integer.parseInt(v);
13669             } catch (NumberFormatException e) {
13670                 throw new SettingNotFoundException(name);
13671             }
13672         }
13673 
13674         /**
13675          * Convenience function for updating a single settings value as an
13676          * integer. This will either create a new entry in the table if the
13677          * given name does not exist, or modify the value of the existing row
13678          * with that name.  Note that internally setting values are always
13679          * stored as strings, so this function converts the given value to a
13680          * string before storing it.
13681          *
13682          * @param cr The ContentResolver to access.
13683          * @param name The name of the setting to modify.
13684          * @param value The new value for the setting.
13685          * @return true if the value was set, false on database errors
13686          */
putInt(ContentResolver cr, String name, int value)13687         public static boolean putInt(ContentResolver cr, String name, int value) {
13688             return putString(cr, name, Integer.toString(value));
13689         }
13690 
13691         /**
13692          * Convenience function for retrieving a single secure settings value
13693          * as a {@code long}.  Note that internally setting values are always
13694          * stored as strings; this function converts the string to a {@code long}
13695          * for you.  The default value will be returned if the setting is
13696          * not defined or not a {@code long}.
13697          *
13698          * @param cr The ContentResolver to access.
13699          * @param name The name of the setting to retrieve.
13700          * @param def Value to return if the setting is not defined.
13701          *
13702          * @return The setting's current value, or 'def' if it is not defined
13703          * or not a valid {@code long}.
13704          */
getLong(ContentResolver cr, String name, long def)13705         public static long getLong(ContentResolver cr, String name, long def) {
13706             String valString = getString(cr, name);
13707             long value;
13708             try {
13709                 value = valString != null ? Long.parseLong(valString) : def;
13710             } catch (NumberFormatException e) {
13711                 value = def;
13712             }
13713             return value;
13714         }
13715 
13716         /**
13717          * Convenience function for retrieving a single secure settings value
13718          * as a {@code long}.  Note that internally setting values are always
13719          * stored as strings; this function converts the string to a {@code long}
13720          * for you.
13721          * <p>
13722          * This version does not take a default value.  If the setting has not
13723          * been set, or the string value is not a number,
13724          * it throws {@link SettingNotFoundException}.
13725          *
13726          * @param cr The ContentResolver to access.
13727          * @param name The name of the setting to retrieve.
13728          *
13729          * @return The setting's current value.
13730          * @throws SettingNotFoundException Thrown if a setting by the given
13731          * name can't be found or the setting value is not an integer.
13732          */
getLong(ContentResolver cr, String name)13733         public static long getLong(ContentResolver cr, String name)
13734                 throws SettingNotFoundException {
13735             String valString = getString(cr, name);
13736             try {
13737                 return Long.parseLong(valString);
13738             } catch (NumberFormatException e) {
13739                 throw new SettingNotFoundException(name);
13740             }
13741         }
13742 
13743         /**
13744          * Convenience function for updating a secure settings value as a long
13745          * integer. This will either create a new entry in the table if the
13746          * given name does not exist, or modify the value of the existing row
13747          * with that name.  Note that internally setting values are always
13748          * stored as strings, so this function converts the given value to a
13749          * string before storing it.
13750          *
13751          * @param cr The ContentResolver to access.
13752          * @param name The name of the setting to modify.
13753          * @param value The new value for the setting.
13754          * @return true if the value was set, false on database errors
13755          */
putLong(ContentResolver cr, String name, long value)13756         public static boolean putLong(ContentResolver cr, String name, long value) {
13757             return putString(cr, name, Long.toString(value));
13758         }
13759 
13760         /**
13761          * Convenience function for retrieving a single secure settings value
13762          * as a floating point number.  Note that internally setting values are
13763          * always stored as strings; this function converts the string to an
13764          * float for you. The default value will be returned if the setting
13765          * is not defined or not a valid float.
13766          *
13767          * @param cr The ContentResolver to access.
13768          * @param name The name of the setting to retrieve.
13769          * @param def Value to return if the setting is not defined.
13770          *
13771          * @return The setting's current value, or 'def' if it is not defined
13772          * or not a valid float.
13773          */
getFloat(ContentResolver cr, String name, float def)13774         public static float getFloat(ContentResolver cr, String name, float def) {
13775             String v = getString(cr, name);
13776             try {
13777                 return v != null ? Float.parseFloat(v) : def;
13778             } catch (NumberFormatException e) {
13779                 return def;
13780             }
13781         }
13782 
13783         /**
13784          * Convenience function for retrieving a single secure settings value
13785          * as a float.  Note that internally setting values are always
13786          * stored as strings; this function converts the string to a float
13787          * for you.
13788          * <p>
13789          * This version does not take a default value.  If the setting has not
13790          * been set, or the string value is not a number,
13791          * it throws {@link SettingNotFoundException}.
13792          *
13793          * @param cr The ContentResolver to access.
13794          * @param name The name of the setting to retrieve.
13795          *
13796          * @throws SettingNotFoundException Thrown if a setting by the given
13797          * name can't be found or the setting value is not a float.
13798          *
13799          * @return The setting's current value.
13800          */
getFloat(ContentResolver cr, String name)13801         public static float getFloat(ContentResolver cr, String name)
13802                 throws SettingNotFoundException {
13803             String v = getString(cr, name);
13804             if (v == null) {
13805                 throw new SettingNotFoundException(name);
13806             }
13807             try {
13808                 return Float.parseFloat(v);
13809             } catch (NumberFormatException e) {
13810                 throw new SettingNotFoundException(name);
13811             }
13812         }
13813 
13814         /**
13815          * Convenience function for updating a single settings value as a
13816          * floating point number. This will either create a new entry in the
13817          * table if the given name does not exist, or modify the value of the
13818          * existing row with that name.  Note that internally setting values
13819          * are always stored as strings, so this function converts the given
13820          * value to a string before storing it.
13821          *
13822          * @param cr The ContentResolver to access.
13823          * @param name The name of the setting to modify.
13824          * @param value The new value for the setting.
13825          * @return true if the value was set, false on database errors
13826          */
putFloat(ContentResolver cr, String name, float value)13827         public static boolean putFloat(ContentResolver cr, String name, float value) {
13828             return putString(cr, name, Float.toString(value));
13829         }
13830 
13831         /**
13832           * Subscription Id to be used for voice call on a multi sim device.
13833           * @hide
13834           */
13835         public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
13836 
13837         /**
13838           * Used to provide option to user to select subscription during dial.
13839           * The supported values are 0 = disable or 1 = enable prompt.
13840           * @hide
13841           */
13842         @UnsupportedAppUsage
13843         public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
13844 
13845         /**
13846           * Subscription Id to be used for data call on a multi sim device.
13847           * @hide
13848           */
13849         public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
13850 
13851         /**
13852           * Subscription Id to be used for SMS on a multi sim device.
13853           * @hide
13854           */
13855         public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
13856 
13857         /**
13858           * Used to provide option to user to select subscription during send SMS.
13859           * The value 1 - enable, 0 - disable
13860           * @hide
13861           */
13862         public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
13863 
13864         /** User preferred subscriptions setting.
13865           * This holds the details of the user selected subscription from the card and
13866           * the activation status. Each settings string have the comma separated values
13867           * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
13868           * @hide
13869          */
13870         @UnsupportedAppUsage
13871         public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
13872                 "user_preferred_sub2","user_preferred_sub3"};
13873 
13874         /**
13875          * Which subscription is enabled for a physical slot.
13876          * @hide
13877          */
13878         public static final String ENABLED_SUBSCRIPTION_FOR_SLOT = "enabled_subscription_for_slot";
13879 
13880         /**
13881          * Whether corresponding logical modem is enabled for a physical slot.
13882          * The value 1 - enable, 0 - disable
13883          * @hide
13884          */
13885         public static final String MODEM_STACK_ENABLED_FOR_SLOT = "modem_stack_enabled_for_slot";
13886 
13887         /**
13888          * Whether to enable new contacts aggregator or not.
13889          * The value 1 - enable, 0 - disable
13890          * @hide
13891          */
13892         public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
13893 
13894         /**
13895          * Whether to enable contacts metadata syncing or not
13896          * The value 1 - enable, 0 - disable
13897          *
13898          * @removed
13899          */
13900         @Deprecated
13901         public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
13902 
13903         /**
13904          * Whether to enable contacts metadata syncing or not
13905          * The value 1 - enable, 0 - disable
13906          */
13907         public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled";
13908 
13909         /**
13910          * Whether to enable cellular on boot.
13911          * The value 1 - enable, 0 - disable
13912          * @hide
13913          */
13914         public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot";
13915 
13916         /**
13917          * The maximum allowed notification enqueue rate in Hertz.
13918          *
13919          * Should be a float, and includes updates only.
13920          * @hide
13921          */
13922         public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate";
13923 
13924         /**
13925          * Displays toasts when an app posts a notification that does not specify a valid channel.
13926          *
13927          * The value 1 - enable, 0 - disable
13928          * @hide
13929          */
13930         public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS =
13931                 "show_notification_channel_warnings";
13932 
13933         /**
13934          * Whether cell is enabled/disabled
13935          * @hide
13936          */
13937         public static final String CELL_ON = "cell_on";
13938 
13939         /**
13940          * Global settings which can be accessed by instant apps.
13941          * @hide
13942          */
13943         public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
13944         static {
13945             INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER);
13946             INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED);
13947             INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES);
13948             INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL);
13949             INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES);
13950             INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON);
13951             INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE);
13952             INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE);
13953             INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE);
13954             INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES);
13955             INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE);
13956             INSTANT_APP_SETTINGS.add(WTF_IS_FATAL);
13957             INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR);
13958             INSTANT_APP_SETTINGS.add(ZEN_MODE);
13959         }
13960 
13961         /**
13962          * Whether to show the high temperature warning notification.
13963          * @hide
13964          */
13965         public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning";
13966 
13967         /**
13968          * Whether to show the usb high temperature alarm notification.
13969          * @hide
13970          */
13971         public static final String SHOW_USB_TEMPERATURE_ALARM = "show_usb_temperature_alarm";
13972 
13973         /**
13974          * Temperature at which the high temperature warning notification should be shown.
13975          * @hide
13976          */
13977         public static final String WARNING_TEMPERATURE = "warning_temperature";
13978 
13979         /**
13980          * Whether the diskstats logging task is enabled/disabled.
13981          * @hide
13982          */
13983         public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging";
13984 
13985         /**
13986          * Whether the cache quota calculation task is enabled/disabled.
13987          * @hide
13988          */
13989         public static final String ENABLE_CACHE_QUOTA_CALCULATION =
13990                 "enable_cache_quota_calculation";
13991 
13992         /**
13993          * Whether the Deletion Helper no threshold toggle is available.
13994          * @hide
13995          */
13996         public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE =
13997                 "enable_deletion_helper_no_threshold_toggle";
13998 
13999         /**
14000          * The list of snooze options for notifications
14001          * This is encoded as a key=value list, separated by commas. Ex:
14002          *
14003          * "default=60,options_array=15:30:60:120"
14004          *
14005          * The following keys are supported:
14006          *
14007          * <pre>
14008          * default               (int)
14009          * options_array         (int[])
14010          * </pre>
14011          *
14012          * All delays in integer minutes. Array order is respected.
14013          * Options will be used in order up to the maximum allowed by the UI.
14014          * @hide
14015          */
14016         public static final String NOTIFICATION_SNOOZE_OPTIONS =
14017                 "notification_snooze_options";
14018 
14019         /**
14020          * Settings key for the ratio of notification dismissals to notification views - one of the
14021          * criteria for showing the notification blocking helper.
14022          *
14023          * <p>The value is a float ranging from 0.0 to 1.0 (the closer to 0.0, the more intrusive
14024          * the blocking helper will be).
14025          *
14026          * @hide
14027          */
14028         public static final String BLOCKING_HELPER_DISMISS_TO_VIEW_RATIO_LIMIT =
14029                 "blocking_helper_dismiss_to_view_ratio";
14030 
14031         /**
14032          * Settings key for the longest streak of dismissals  - one of the criteria for showing the
14033          * notification blocking helper.
14034          *
14035          * <p>The value is an integer greater than 0.
14036          *
14037          * @hide
14038          */
14039         public static final String BLOCKING_HELPER_STREAK_LIMIT = "blocking_helper_streak_limit";
14040 
14041         /**
14042          * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated
14043          * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF
14044          *
14045          * Supported keys:<br/>
14046          * <li>
14047          * <ul> {@code legacy_compatibility_wal_enabled} : A {code boolean} flag that determines
14048          * whether or not "compatibility WAL" mode is enabled by default. This is a legacy flag
14049          * and is honoured on Android Q and higher. This flag will be removed in a future release.
14050          * </ul>
14051          * <ul> {@code wal_syncmode} : A {@code String} representing the synchronization mode to use
14052          * when WAL is enabled, either via {@code legacy_compatibility_wal_enabled} or using the
14053          * obsolete {@code compatibility_wal_supported} flag.
14054          * </ul>
14055          * <ul> {@code truncate_size} : A {@code int} flag that specifies the truncate size of the
14056          * WAL journal.
14057          * </ul>
14058          * <ul> {@code compatibility_wal_supported} : A {code boolean} flag that specifies whether
14059          * the legacy "compatibility WAL" mode is enabled by default. This flag is obsolete and is
14060          * only supported on Android Pie.
14061          * </ul>
14062          * </li>
14063          *
14064          * @hide
14065          */
14066         public static final String SQLITE_COMPATIBILITY_WAL_FLAGS =
14067                 "sqlite_compatibility_wal_flags";
14068 
14069         /**
14070          * Enable GNSS Raw Measurements Full Tracking?
14071          * 0 = no
14072          * 1 = yes
14073          * @hide
14074          */
14075         public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING =
14076                 "enable_gnss_raw_meas_full_tracking";
14077 
14078         /**
14079          * Whether the notification should be ongoing (persistent) when a carrier app install is
14080          * required.
14081          *
14082          * The value is a boolean (1 or 0).
14083          * @hide
14084          */
14085         @SystemApi
14086         public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT =
14087                 "install_carrier_app_notification_persistent";
14088 
14089         /**
14090          * The amount of time (ms) to hide the install carrier app notification after the user has
14091          * ignored it. After this time passes, the notification will be shown again
14092          *
14093          * The value is a long
14094          * @hide
14095          */
14096         @SystemApi
14097         public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS =
14098                 "install_carrier_app_notification_sleep_millis";
14099 
14100         /**
14101          * Whether we've enabled zram on this device. Takes effect on
14102          * reboot. The value "1" enables zram; "0" disables it, and
14103          * everything else is unspecified.
14104          * @hide
14105          */
14106         public static final String ZRAM_ENABLED =
14107                 "zram_enabled";
14108 
14109         /**
14110          * Whether the app freezer is enabled on this device.
14111          * The value of "enabled" enables the app freezer, "disabled" disables it and
14112          * "device_default" will let the system decide whether to enable the freezer or not
14113          * @hide
14114          */
14115         public static final String CACHED_APPS_FREEZER_ENABLED = "cached_apps_freezer";
14116 
14117         /**
14118          * Configuration flags for smart replies in notifications.
14119          * This is encoded as a key=value list, separated by commas. Ex:
14120          *
14121          * "enabled=1,max_squeeze_remeasure_count=3"
14122          *
14123          * The following keys are supported:
14124          *
14125          * <pre>
14126          * enabled                           (boolean)
14127          * requires_targeting_p              (boolean)
14128          * max_squeeze_remeasure_attempts    (int)
14129          * edit_choices_before_sending       (boolean)
14130          * show_in_heads_up                  (boolean)
14131          * min_num_system_generated_replies  (int)
14132          * max_num_actions                   (int)
14133          * </pre>
14134          * @see com.android.systemui.statusbar.policy.SmartReplyConstants
14135          * @hide
14136          */
14137         public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS =
14138                 "smart_replies_in_notifications_flags";
14139 
14140         /**
14141          * Configuration flags for the automatic generation of smart replies and smart actions in
14142          * notifications. This is encoded as a key=value list, separated by commas. Ex:
14143          * "generate_replies=false,generate_actions=true".
14144          *
14145          * The following keys are supported:
14146          *
14147          * <pre>
14148          * generate_replies                 (boolean)
14149          * generate_actions                 (boolean)
14150          * </pre>
14151          * @hide
14152          */
14153         public static final String SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS =
14154                 "smart_suggestions_in_notifications_flags";
14155 
14156         /**
14157          * If nonzero, crashes in foreground processes will bring up a dialog.
14158          * Otherwise, the process will be silently killed.
14159          * @hide
14160          */
14161         public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog";
14162 
14163         /**
14164          * If nonzero, crash dialogs will show an option to restart the app.
14165          * @hide
14166          */
14167         public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog";
14168 
14169         /**
14170          * If nonzero, crash dialogs will show an option to mute all future crash dialogs for
14171          * this app.
14172          * @hide
14173          */
14174         public static final String SHOW_MUTE_IN_CRASH_DIALOG = "show_mute_in_crash_dialog";
14175 
14176 
14177         /**
14178          * If nonzero, will show the zen upgrade notification when the user toggles DND on/off.
14179          * @hide
14180          * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_UPGRADE_NOTIFICATION}
14181          */
14182         @Deprecated
14183         public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";
14184 
14185         /**
14186          * If nonzero, will show the zen update settings suggestion.
14187          * @hide
14188          * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_SETTINGS_SUGGESTION}
14189          */
14190         @Deprecated
14191         public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion";
14192 
14193         /**
14194          * If nonzero, zen has not been updated to reflect new changes.
14195          * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_UPDATED}
14196          * @hide
14197          */
14198         @Deprecated
14199         public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated";
14200 
14201         /**
14202          * If nonzero, zen setting suggestion has been viewed by user
14203          * @hide
14204          * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_SUGGESTION_VIEWED}
14205          */
14206         @Deprecated
14207         public static final String ZEN_SETTINGS_SUGGESTION_VIEWED =
14208                 "zen_settings_suggestion_viewed";
14209 
14210         /**
14211          * Backup and restore agent timeout parameters.
14212          * These parameters are represented by a comma-delimited key-value list.
14213          *
14214          * The following strings are supported as keys:
14215          * <pre>
14216          *     kv_backup_agent_timeout_millis         (long)
14217          *     full_backup_agent_timeout_millis       (long)
14218          *     shared_backup_agent_timeout_millis     (long)
14219          *     restore_agent_timeout_millis           (long)
14220          *     restore_agent_finished_timeout_millis  (long)
14221          * </pre>
14222          *
14223          * They map to milliseconds represented as longs.
14224          *
14225          * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000"
14226          *
14227          * @hide
14228          */
14229         public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS =
14230                 "backup_agent_timeout_parameters";
14231 
14232         /**
14233          * Blacklist of GNSS satellites.
14234          *
14235          * This is a list of integers separated by commas to represent pairs of (constellation,
14236          * svid). Thus, the number of integers should be even.
14237          *
14238          * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are
14239          * blacklisted. Note that svid=0 denotes all svids in the
14240          * constellation are blacklisted.
14241          *
14242          * @hide
14243          */
14244         public static final String GNSS_SATELLITE_BLACKLIST = "gnss_satellite_blacklist";
14245 
14246         /**
14247          * Duration of updates in millisecond for GNSS location request from HAL to framework.
14248          *
14249          * If zero, the GNSS location request feature is disabled.
14250          *
14251          * The value is a non-negative long.
14252          *
14253          * @hide
14254          */
14255         public static final String GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS =
14256                 "gnss_hal_location_request_duration_millis";
14257 
14258         /**
14259          * Binder call stats settings.
14260          *
14261          * The following strings are supported as keys:
14262          * <pre>
14263          *     enabled              (boolean)
14264          *     detailed_tracking    (boolean)
14265          *     upload_data          (boolean)
14266          *     sampling_interval    (int)
14267          * </pre>
14268          *
14269          * @hide
14270          */
14271         public static final String BINDER_CALLS_STATS = "binder_calls_stats";
14272 
14273         /**
14274          * Looper stats settings.
14275          *
14276          * The following strings are supported as keys:
14277          * <pre>
14278          *     enabled              (boolean)
14279          *     sampling_interval    (int)
14280          * </pre>
14281          *
14282          * @hide
14283          */
14284         public static final String LOOPER_STATS = "looper_stats";
14285 
14286         /**
14287          * Settings for collecting statistics on CPU usage per thread
14288          *
14289          * The following strings are supported as keys:
14290          * <pre>
14291          *     num_buckets          (int)
14292          *     collected_uids       (string)
14293          *     minimum_total_cpu_usage_millis (int)
14294          * </pre>
14295          *
14296          * @hide
14297          */
14298         public static final String KERNEL_CPU_THREAD_READER = "kernel_cpu_thread_reader";
14299 
14300         /**
14301          * Whether we've enabled native flags health check on this device. Takes effect on
14302          * reboot. The value "1" enables native flags health check; otherwise it's disabled.
14303          * @hide
14304          */
14305         public static final String NATIVE_FLAGS_HEALTH_CHECK_ENABLED =
14306                 "native_flags_health_check_enabled";
14307 
14308         /**
14309          * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the mode
14310          * in which the historical registry operates.
14311          *
14312          * @hide
14313          */
14314         public static final String APPOP_HISTORY_MODE = "mode";
14315 
14316         /**
14317          * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls how long
14318          * is the interval between snapshots in the base case i.e. the most recent
14319          * part of the history.
14320          *
14321          * @hide
14322          */
14323         public static final String APPOP_HISTORY_BASE_INTERVAL_MILLIS = "baseIntervalMillis";
14324 
14325         /**
14326          * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the base
14327          * for the logarithmic step when building app op history.
14328          *
14329          * @hide
14330          */
14331         public static final String APPOP_HISTORY_INTERVAL_MULTIPLIER = "intervalMultiplier";
14332 
14333         /**
14334          * Appop history parameters. These parameters are represented by
14335          * a comma-delimited key-value list.
14336          *
14337          * The following strings are supported as keys:
14338          * <pre>
14339          *     mode                  (int)
14340          *     baseIntervalMillis    (long)
14341          *     intervalMultiplier    (int)
14342          * </pre>
14343          *
14344          * Ex: "mode=HISTORICAL_MODE_ENABLED_ACTIVE,baseIntervalMillis=1000,intervalMultiplier=10"
14345          *
14346          * @see #APPOP_HISTORY_MODE
14347          * @see #APPOP_HISTORY_BASE_INTERVAL_MILLIS
14348          * @see #APPOP_HISTORY_INTERVAL_MULTIPLIER
14349          *
14350          * @hide
14351          */
14352         public static final String APPOP_HISTORY_PARAMETERS =
14353                 "appop_history_parameters";
14354 
14355         /**
14356          * Auto revoke parameters. These parameters are represented by
14357          * a comma-delimited key-value list.
14358          *
14359          * <pre>
14360          *     enabledForPreRApps    (bolean)
14361          *     unusedThresholdMs     (long)
14362          *     checkFrequencyMs      (long)
14363          * </pre>
14364          *
14365          * Ex: "enabledForPreRApps=false,unusedThresholdMs=7776000000,checkFrequencyMs=1296000000"
14366          *
14367          * @hide
14368          */
14369         public static final String AUTO_REVOKE_PARAMETERS =
14370                 "auto_revoke_parameters";
14371 
14372         /**
14373          * Delay for sending ACTION_CHARGING after device is plugged in.
14374          * This is used as an override for constants defined in BatteryStatsImpl for
14375          * ease of experimentation.
14376          *
14377          * @see com.android.internal.os.BatteryStatsImpl.Constants.KEY_BATTERY_CHARGED_DELAY_MS
14378          * @hide
14379          */
14380         public static final String BATTERY_CHARGING_STATE_UPDATE_DELAY =
14381                 "battery_charging_state_update_delay";
14382 
14383         /**
14384          * A serialized string of params that will be loaded into a text classifier action model.
14385          *
14386          * @hide
14387          */
14388         public static final String TEXT_CLASSIFIER_ACTION_MODEL_PARAMS =
14389                 "text_classifier_action_model_params";
14390 
14391         /**
14392          * The amount of time to suppress "power-off" from the power button after the device has
14393          * woken due to a gesture (lifting the phone).  Since users have learned to hit the power
14394          * button immediately when lifting their device, it can cause the device to turn off if a
14395          * gesture has just woken the device. This value tells us the milliseconds to wait after
14396          * a gesture before "power-off" via power-button is functional again. A value of 0 is no
14397          * delay, and reverts to the old behavior.
14398          *
14399          * @hide
14400          */
14401         public static final String POWER_BUTTON_SUPPRESSION_DELAY_AFTER_GESTURE_WAKE =
14402                 "power_button_suppression_delay_after_gesture_wake";
14403 
14404         /**
14405          * The usage amount of advanced battery. The value is 0~100.
14406          *
14407          * @hide
14408          */
14409         public static final String ADVANCED_BATTERY_USAGE_AMOUNT = "advanced_battery_usage_amount";
14410 
14411         /**
14412          * For 5G NSA capable devices, determines whether NR tracking indications are on
14413          * when the screen is off.
14414          *
14415          * Values are:
14416          * 0: off - All 5G NSA tracking indications are off when the screen is off.
14417          * 1: extended - All 5G NSA tracking indications are on when the screen is off as long as
14418          *    the device is camped on 5G NSA (5G icon is showing in status bar).
14419          *    If the device is not camped on 5G NSA, tracking indications are off.
14420          * 2: always on - All 5G NSA tracking indications are on whether the screen is on or off.
14421          * @hide
14422          */
14423         public static final String NR_NSA_TRACKING_SCREEN_OFF_MODE =
14424                 "nr_nsa_tracking_screen_off_mode";
14425     }
14426 
14427     /**
14428      * Configuration system settings, containing settings which are applied identically for all
14429      * defined users. Only Android can read these and only a specific configuration service can
14430      * write these.
14431      *
14432      * @hide
14433      */
14434     public static final class Config extends NameValueTable {
14435         private static final ContentProviderHolder sProviderHolder =
14436                 new ContentProviderHolder(DeviceConfig.CONTENT_URI);
14437 
14438         // Populated lazily, guarded by class object:
14439         private static final NameValueCache sNameValueCache = new NameValueCache(
14440                 DeviceConfig.CONTENT_URI,
14441                 CALL_METHOD_GET_CONFIG,
14442                 CALL_METHOD_PUT_CONFIG,
14443                 CALL_METHOD_LIST_CONFIG,
14444                 CALL_METHOD_SET_ALL_CONFIG,
14445                 sProviderHolder);
14446 
14447         /**
14448          * Look up a name in the database.
14449          * @param resolver to access the database with
14450          * @param name to look up in the table
14451          * @return the corresponding value, or null if not present
14452          *
14453          * @hide
14454          */
14455         @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG)
getString(ContentResolver resolver, String name)14456         static String getString(ContentResolver resolver, String name) {
14457             return sNameValueCache.getStringForUser(resolver, name, resolver.getUserId());
14458         }
14459 
14460         /**
14461          * Look up a list of names in the database, within the specified namespace.
14462          *
14463          * @param resolver to access the database with
14464          * @param namespace to which the names belong
14465          * @param names to look up in the table
14466          * @return a non null, but possibly empty, map from name to value for any of the names that
14467          *         were found during lookup.
14468          *
14469          * @hide
14470          */
14471         @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG)
getStrings(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull List<String> names)14472         public static Map<String, String> getStrings(@NonNull ContentResolver resolver,
14473                 @NonNull String namespace, @NonNull List<String> names) {
14474             List<String> compositeNames = new ArrayList<>(names.size());
14475             for (String name : names) {
14476                 compositeNames.add(createCompositeName(namespace, name));
14477             }
14478 
14479             String prefix = createPrefix(namespace);
14480             ArrayMap<String, String> rawKeyValues = sNameValueCache.getStringsForPrefix(
14481                     resolver, prefix, compositeNames);
14482             int size = rawKeyValues.size();
14483             int substringLength = prefix.length();
14484             ArrayMap<String, String> keyValues = new ArrayMap<>(size);
14485             for (int i = 0; i < size; ++i) {
14486                 keyValues.put(rawKeyValues.keyAt(i).substring(substringLength),
14487                         rawKeyValues.valueAt(i));
14488             }
14489             return keyValues;
14490         }
14491 
14492         /**
14493          * Store a name/value pair into the database within the specified namespace.
14494          * <p>
14495          * Also the method takes an argument whether to make the value the default for this setting.
14496          * If the system already specified a default value, then the one passed in here will
14497          * <strong>not</strong> be set as the default.
14498          * </p>
14499          *
14500          * @param resolver to access the database with.
14501          * @param namespace to store the name/value pair in.
14502          * @param name to store.
14503          * @param value to associate with the name.
14504          * @param makeDefault whether to make the value the default one.
14505          * @return true if the value was set, false on database errors.
14506          *
14507          * @see #resetToDefaults(ContentResolver, int, String)
14508          *
14509          * @hide
14510          */
14511         @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
putString(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull String name, @Nullable String value, boolean makeDefault)14512         static boolean putString(@NonNull ContentResolver resolver, @NonNull String namespace,
14513                 @NonNull String name, @Nullable String value, boolean makeDefault) {
14514             return sNameValueCache.putStringForUser(resolver, createCompositeName(namespace, name),
14515                     value, null, makeDefault, resolver.getUserId(),
14516                     DEFAULT_OVERRIDEABLE_BY_RESTORE);
14517         }
14518 
14519         /**
14520          * Clear all name/value pairs for the provided namespace and save new name/value pairs in
14521          * their place.
14522          *
14523          * @param resolver to access the database with.
14524          * @param namespace to which the names should be set.
14525          * @param keyValues map of key names (without the prefix) to values.
14526          * @return
14527          *
14528          * @hide
14529          */
14530         @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
setStrings(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull Map<String, String> keyValues)14531         public static boolean setStrings(@NonNull ContentResolver resolver,
14532                 @NonNull String namespace, @NonNull Map<String, String> keyValues)
14533                 throws DeviceConfig.BadConfigException {
14534             HashMap<String, String> compositeKeyValueMap = new HashMap<>(keyValues.keySet().size());
14535             for (Map.Entry<String, String> entry : keyValues.entrySet()) {
14536                 compositeKeyValueMap.put(
14537                         createCompositeName(namespace, entry.getKey()), entry.getValue());
14538             }
14539             // If can't set given configuration that means it's bad
14540             if (!sNameValueCache.setStringsForPrefix(resolver, createPrefix(namespace),
14541                     compositeKeyValueMap)) {
14542                 throw new DeviceConfig.BadConfigException();
14543             }
14544             return true;
14545         }
14546 
14547         /**
14548          * Reset the values to their defaults.
14549          * <p>
14550          * The method accepts an optional prefix parameter. If provided, only pairs with a name that
14551          * starts with the exact prefix will be reset. Otherwise all will be reset.
14552          *
14553          * @param resolver Handle to the content resolver.
14554          * @param resetMode The reset mode to use.
14555          * @param namespace Optionally, to limit which which namespace is reset.
14556          *
14557          * @see #putString(ContentResolver, String, String, String, boolean)
14558          *
14559          * @hide
14560          */
14561         @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
resetToDefaults(@onNull ContentResolver resolver, @ResetMode int resetMode, @Nullable String namespace)14562         static void resetToDefaults(@NonNull ContentResolver resolver, @ResetMode int resetMode,
14563                 @Nullable String namespace) {
14564             try {
14565                 Bundle arg = new Bundle();
14566                 arg.putInt(CALL_METHOD_USER_KEY, resolver.getUserId());
14567                 arg.putInt(CALL_METHOD_RESET_MODE_KEY, resetMode);
14568                 if (namespace != null) {
14569                     arg.putString(Settings.CALL_METHOD_PREFIX_KEY, createPrefix(namespace));
14570                 }
14571                 IContentProvider cp = sProviderHolder.getProvider(resolver);
14572                 cp.call(resolver.getPackageName(), resolver.getAttributionTag(),
14573                         sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_CONFIG, null, arg);
14574             } catch (RemoteException e) {
14575                 Log.w(TAG, "Can't reset to defaults for " + DeviceConfig.CONTENT_URI, e);
14576             }
14577         }
14578 
14579         /**
14580          * Register callback for monitoring Config table.
14581          *
14582          * @param resolver Handle to the content resolver.
14583          * @param callback callback to register
14584          *
14585          * @hide
14586          */
14587         @RequiresPermission(Manifest.permission.MONITOR_DEVICE_CONFIG_ACCESS)
registerMonitorCallback(@onNull ContentResolver resolver, @NonNull RemoteCallback callback)14588         public static void registerMonitorCallback(@NonNull ContentResolver resolver,
14589                 @NonNull RemoteCallback callback) {
14590             registerMonitorCallbackAsUser(resolver, resolver.getUserId(), callback);
14591         }
14592 
registerMonitorCallbackAsUser( @onNull ContentResolver resolver, @UserIdInt int userHandle, @NonNull RemoteCallback callback)14593         private static void registerMonitorCallbackAsUser(
14594                 @NonNull ContentResolver resolver, @UserIdInt int userHandle,
14595                 @NonNull RemoteCallback callback) {
14596             try {
14597                 Bundle arg = new Bundle();
14598                 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
14599                 arg.putParcelable(CALL_METHOD_MONITOR_CALLBACK_KEY, callback);
14600                 IContentProvider cp = sProviderHolder.getProvider(resolver);
14601                 cp.call(resolver.getPackageName(), resolver.getAttributionTag(),
14602                         sProviderHolder.mUri.getAuthority(),
14603                         CALL_METHOD_REGISTER_MONITOR_CALLBACK_CONFIG, null, arg);
14604             } catch (RemoteException e) {
14605                 Log.w(TAG, "Can't register config monitor callback", e);
14606             }
14607         }
14608 
14609         /** @hide */
clearProviderForTest()14610         public static void clearProviderForTest() {
14611             sProviderHolder.clearProviderForTest();
14612             sNameValueCache.clearGenerationTrackerForTest();
14613         }
14614 
createCompositeName(@onNull String namespace, @NonNull String name)14615         private static String createCompositeName(@NonNull String namespace, @NonNull String name) {
14616             Preconditions.checkNotNull(namespace);
14617             Preconditions.checkNotNull(name);
14618             return createPrefix(namespace) + name;
14619         }
14620 
createPrefix(@onNull String namespace)14621         private static String createPrefix(@NonNull String namespace) {
14622             Preconditions.checkNotNull(namespace);
14623             return namespace + "/";
14624         }
14625     }
14626 
14627     /**
14628      * User-defined bookmarks and shortcuts.  The target of each bookmark is an
14629      * Intent URL, allowing it to be either a web page or a particular
14630      * application activity.
14631      *
14632      * @hide
14633      */
14634     public static final class Bookmarks implements BaseColumns
14635     {
14636         private static final String TAG = "Bookmarks";
14637 
14638         /**
14639          * The content:// style URL for this table
14640          */
14641         @UnsupportedAppUsage
14642         public static final Uri CONTENT_URI =
14643             Uri.parse("content://" + AUTHORITY + "/bookmarks");
14644 
14645         /**
14646          * The row ID.
14647          * <p>Type: INTEGER</p>
14648          */
14649         public static final String ID = "_id";
14650 
14651         /**
14652          * Descriptive name of the bookmark that can be displayed to the user.
14653          * If this is empty, the title should be resolved at display time (use
14654          * {@link #getTitle(Context, Cursor)} any time you want to display the
14655          * title of a bookmark.)
14656          * <P>
14657          * Type: TEXT
14658          * </P>
14659          */
14660         public static final String TITLE = "title";
14661 
14662         /**
14663          * Arbitrary string (displayed to the user) that allows bookmarks to be
14664          * organized into categories.  There are some special names for
14665          * standard folders, which all start with '@'.  The label displayed for
14666          * the folder changes with the locale (via {@link #getLabelForFolder}) but
14667          * the folder name does not change so you can consistently query for
14668          * the folder regardless of the current locale.
14669          *
14670          * <P>Type: TEXT</P>
14671          *
14672          */
14673         public static final String FOLDER = "folder";
14674 
14675         /**
14676          * The Intent URL of the bookmark, describing what it points to.  This
14677          * value is given to {@link android.content.Intent#getIntent} to create
14678          * an Intent that can be launched.
14679          * <P>Type: TEXT</P>
14680          */
14681         public static final String INTENT = "intent";
14682 
14683         /**
14684          * Optional shortcut character associated with this bookmark.
14685          * <P>Type: INTEGER</P>
14686          */
14687         public static final String SHORTCUT = "shortcut";
14688 
14689         /**
14690          * The order in which the bookmark should be displayed
14691          * <P>Type: INTEGER</P>
14692          */
14693         public static final String ORDERING = "ordering";
14694 
14695         private static final String[] sIntentProjection = { INTENT };
14696         private static final String[] sShortcutProjection = { ID, SHORTCUT };
14697         private static final String sShortcutSelection = SHORTCUT + "=?";
14698 
14699         /**
14700          * Convenience function to retrieve the bookmarked Intent for a
14701          * particular shortcut key.
14702          *
14703          * @param cr The ContentResolver to query.
14704          * @param shortcut The shortcut key.
14705          *
14706          * @return Intent The bookmarked URL, or null if there is no bookmark
14707          *         matching the given shortcut.
14708          */
getIntentForShortcut(ContentResolver cr, char shortcut)14709         public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
14710         {
14711             Intent intent = null;
14712 
14713             Cursor c = cr.query(CONTENT_URI,
14714                     sIntentProjection, sShortcutSelection,
14715                     new String[] { String.valueOf((int) shortcut) }, ORDERING);
14716             // Keep trying until we find a valid shortcut
14717             try {
14718                 while (intent == null && c.moveToNext()) {
14719                     try {
14720                         String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
14721                         intent = Intent.parseUri(intentURI, 0);
14722                     } catch (java.net.URISyntaxException e) {
14723                         // The stored URL is bad...  ignore it.
14724                     } catch (IllegalArgumentException e) {
14725                         // Column not found
14726                         Log.w(TAG, "Intent column not found", e);
14727                     }
14728                 }
14729             } finally {
14730                 if (c != null) c.close();
14731             }
14732 
14733             return intent;
14734         }
14735 
14736         /**
14737          * Add a new bookmark to the system.
14738          *
14739          * @param cr The ContentResolver to query.
14740          * @param intent The desired target of the bookmark.
14741          * @param title Bookmark title that is shown to the user; null if none
14742          *            or it should be resolved to the intent's title.
14743          * @param folder Folder in which to place the bookmark; null if none.
14744          * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
14745          *            this is non-zero and there is an existing bookmark entry
14746          *            with this same shortcut, then that existing shortcut is
14747          *            cleared (the bookmark is not removed).
14748          * @return The unique content URL for the new bookmark entry.
14749          */
14750         @UnsupportedAppUsage
add(ContentResolver cr, Intent intent, String title, String folder, char shortcut, int ordering)14751         public static Uri add(ContentResolver cr,
14752                                            Intent intent,
14753                                            String title,
14754                                            String folder,
14755                                            char shortcut,
14756                                            int ordering)
14757         {
14758             // If a shortcut is supplied, and it is already defined for
14759             // another bookmark, then remove the old definition.
14760             if (shortcut != 0) {
14761                 cr.delete(CONTENT_URI, sShortcutSelection,
14762                         new String[] { String.valueOf((int) shortcut) });
14763             }
14764 
14765             ContentValues values = new ContentValues();
14766             if (title != null) values.put(TITLE, title);
14767             if (folder != null) values.put(FOLDER, folder);
14768             values.put(INTENT, intent.toUri(0));
14769             if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
14770             values.put(ORDERING, ordering);
14771             return cr.insert(CONTENT_URI, values);
14772         }
14773 
14774         /**
14775          * Return the folder name as it should be displayed to the user.  This
14776          * takes care of localizing special folders.
14777          *
14778          * @param r Resources object for current locale; only need access to
14779          *          system resources.
14780          * @param folder The value found in the {@link #FOLDER} column.
14781          *
14782          * @return CharSequence The label for this folder that should be shown
14783          *         to the user.
14784          */
getLabelForFolder(Resources r, String folder)14785         public static CharSequence getLabelForFolder(Resources r, String folder) {
14786             return folder;
14787         }
14788 
14789         /**
14790          * Return the title as it should be displayed to the user. This takes
14791          * care of localizing bookmarks that point to activities.
14792          *
14793          * @param context A context.
14794          * @param cursor A cursor pointing to the row whose title should be
14795          *        returned. The cursor must contain at least the {@link #TITLE}
14796          *        and {@link #INTENT} columns.
14797          * @return A title that is localized and can be displayed to the user,
14798          *         or the empty string if one could not be found.
14799          */
getTitle(Context context, Cursor cursor)14800         public static CharSequence getTitle(Context context, Cursor cursor) {
14801             int titleColumn = cursor.getColumnIndex(TITLE);
14802             int intentColumn = cursor.getColumnIndex(INTENT);
14803             if (titleColumn == -1 || intentColumn == -1) {
14804                 throw new IllegalArgumentException(
14805                         "The cursor must contain the TITLE and INTENT columns.");
14806             }
14807 
14808             String title = cursor.getString(titleColumn);
14809             if (!TextUtils.isEmpty(title)) {
14810                 return title;
14811             }
14812 
14813             String intentUri = cursor.getString(intentColumn);
14814             if (TextUtils.isEmpty(intentUri)) {
14815                 return "";
14816             }
14817 
14818             Intent intent;
14819             try {
14820                 intent = Intent.parseUri(intentUri, 0);
14821             } catch (URISyntaxException e) {
14822                 return "";
14823             }
14824 
14825             PackageManager packageManager = context.getPackageManager();
14826             ResolveInfo info = packageManager.resolveActivity(intent, 0);
14827             return info != null ? info.loadLabel(packageManager) : "";
14828         }
14829     }
14830 
14831     /**
14832      * <p>
14833      *     A Settings panel is floating UI that contains a fixed subset of settings to address a
14834      *     particular user problem. For example, the
14835      *     {@link #ACTION_INTERNET_CONNECTIVITY Internet Panel} surfaces settings related to
14836      *     connecting to the internet.
14837      * <p>
14838      *     Settings panels appear above the calling app to address the problem without
14839      *     the user needing to open Settings and thus leave their current screen.
14840      */
14841     public static final class Panel {
Panel()14842         private Panel() {
14843         }
14844 
14845         /**
14846          * Activity Action: Show a settings dialog containing settings to enable internet
14847          * connection.
14848          * <p>
14849          * Input: Nothing.
14850          * <p>
14851          * Output: Nothing.
14852          */
14853         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
14854         public static final String ACTION_INTERNET_CONNECTIVITY =
14855                 "android.settings.panel.action.INTERNET_CONNECTIVITY";
14856 
14857         /**
14858          * Activity Action: Show a settings dialog containing NFC-related settings.
14859          * <p>
14860          * Input: Nothing.
14861          * <p>
14862          * Output: Nothing.
14863          */
14864         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
14865         public static final String ACTION_NFC =
14866                 "android.settings.panel.action.NFC";
14867 
14868         /**
14869          * Activity Action: Show a settings dialog containing controls for Wifi.
14870          * <p>
14871          * Input: Nothing.
14872          * <p>
14873          * Output: Nothing.
14874          */
14875         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
14876         public static final String ACTION_WIFI =
14877                 "android.settings.panel.action.WIFI";
14878 
14879         /**
14880          * Activity Action: Show a settings dialog containing all volume streams.
14881          * <p>
14882          * Input: Nothing.
14883          * <p>
14884          * Output: Nothing.
14885          */
14886         @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
14887         public static final String ACTION_VOLUME =
14888                 "android.settings.panel.action.VOLUME";
14889     }
14890 
14891     /**
14892      * Activity Action: Show setting page to process the addition of Wi-Fi networks to the user's
14893      * saved network list. The app should send a new intent with an extra that holds a maximum
14894      * of five {@link android.net.wifi.WifiNetworkSuggestion} that specify credentials for the
14895      * networks to be added to the user's database. The Intent should be sent via the
14896      * {@link android.app.Activity#startActivityForResult(Intent, int)} API.
14897      * <p>
14898      * Note: The app sending the Intent to add the credentials doesn't get any ownership over the
14899      * newly added network(s). For the Wi-Fi stack, these networks will look like the user
14900      * manually added them from the Settings UI.
14901      * <p>
14902      * Input: The app should put parcelable array list of
14903      * {@link android.net.wifi.WifiNetworkSuggestion} into the {@link #EXTRA_WIFI_NETWORK_LIST}
14904      * extra.
14905      * <p>
14906      * Output: After {@link android.app.Activity#startActivityForResult(Intent, int)}, the
14907      * callback {@link android.app.Activity#onActivityResult(int, int, Intent)} will have a
14908      * result code {@link android.app.Activity#RESULT_OK} to indicate user pressed the save
14909      * button to save the networks or {@link android.app.Activity#RESULT_CANCELED} to indicate
14910      * that the user rejected the request. Additionally, an integer array list, stored in
14911      * {@link #EXTRA_WIFI_NETWORK_RESULT_LIST}, will indicate the process result of each network.
14912      */
14913     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
14914     public static final String ACTION_WIFI_ADD_NETWORKS =
14915             "android.settings.WIFI_ADD_NETWORKS";
14916 
14917     /**
14918      * A bundle extra of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that indicates the list
14919      * of the {@link android.net.wifi.WifiNetworkSuggestion} elements. The maximum count of the
14920      * {@link android.net.wifi.WifiNetworkSuggestion} elements in the list will be five.
14921      * <p>
14922      * For example:
14923      * To provide credentials for one open and one WPA2 networks:
14924      *
14925      * <pre>{@code
14926      * final WifiNetworkSuggestion suggestion1 =
14927      *       new WifiNetworkSuggestion.Builder()
14928      *       .setSsid("test111111")
14929      *       .build();
14930      * final WifiNetworkSuggestion suggestion2 =
14931      *       new WifiNetworkSuggestion.Builder()
14932      *       .setSsid("test222222")
14933      *       .setWpa2Passphrase("test123456")
14934      *       .build();
14935      * final List<WifiNetworkSuggestion> suggestionsList = new ArrayList<>;
14936      * suggestionsList.add(suggestion1);
14937      * suggestionsList.add(suggestion2);
14938      * Bundle bundle = new Bundle();
14939      * bundle.putParcelableArrayList(Settings.EXTRA_WIFI_NETWORK_LIST,(ArrayList<? extends
14940      * Parcelable>) suggestionsList);
14941      * final Intent intent = new Intent(Settings.ACTION_WIFI_ADD_NETWORKS);
14942      * intent.putExtras(bundle);
14943      * startActivityForResult(intent, 0);
14944      * }</pre>
14945      */
14946     public static final String EXTRA_WIFI_NETWORK_LIST =
14947             "android.provider.extra.WIFI_NETWORK_LIST";
14948 
14949     /**
14950      * A bundle extra of the result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that
14951      * indicates the action result of the saved {@link android.net.wifi.WifiNetworkSuggestion}.
14952      * Its value is a list of integers, and all the elements will be 1:1 mapping to the elements
14953      * in {@link #EXTRA_WIFI_NETWORK_LIST}, if user press cancel to cancel the add networks
14954      * request, then its value will be null.
14955      * <p>
14956      * Note: The integer value will be one of the {@link #ADD_WIFI_RESULT_SUCCESS},
14957      * {@link #ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED}, or {@link #ADD_WIFI_RESULT_ALREADY_EXISTS}}.
14958      */
14959     public static final String EXTRA_WIFI_NETWORK_RESULT_LIST =
14960             "android.provider.extra.WIFI_NETWORK_RESULT_LIST";
14961 
14962     /** @hide */
14963     @Retention(RetentionPolicy.SOURCE)
14964     @IntDef(prefix = {"ADD_WIFI_RESULT_"}, value = {
14965             ADD_WIFI_RESULT_SUCCESS,
14966             ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED,
14967             ADD_WIFI_RESULT_ALREADY_EXISTS
14968     })
14969     public @interface AddWifiResult {
14970     }
14971 
14972     /**
14973      * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that saving or updating the
14974      * corresponding Wi-Fi network was successful.
14975      */
14976     public static final int ADD_WIFI_RESULT_SUCCESS = 0;
14977 
14978     /**
14979      * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that saving the corresponding
14980      * Wi-Fi network failed.
14981      */
14982     public static final int ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED = 1;
14983 
14984     /**
14985      * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that indicates the Wi-Fi network
14986      * already exists.
14987      */
14988     public static final int ADD_WIFI_RESULT_ALREADY_EXISTS = 2;
14989 
14990     /**
14991      * Activity Action: Allows user to select current bug report handler.
14992      * <p>
14993      * Input: Nothing.
14994      * <p>
14995      * Output: Nothing.
14996      *
14997      * @hide
14998      */
14999     @SystemApi
15000     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
15001     public static final String ACTION_BUGREPORT_HANDLER_SETTINGS =
15002             "android.settings.BUGREPORT_HANDLER_SETTINGS";
15003 
15004     private static final String[] PM_WRITE_SETTINGS = {
15005         android.Manifest.permission.WRITE_SETTINGS
15006     };
15007     private static final String[] PM_CHANGE_NETWORK_STATE = {
15008         android.Manifest.permission.CHANGE_NETWORK_STATE,
15009         android.Manifest.permission.WRITE_SETTINGS
15010     };
15011     private static final String[] PM_SYSTEM_ALERT_WINDOW = {
15012         android.Manifest.permission.SYSTEM_ALERT_WINDOW
15013     };
15014 
15015     /**
15016      * Activity Action: Show screen for controlling which apps have access to manage external
15017      * storage.
15018      * <p>
15019      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
15020      * <p>
15021      * If you want to control a specific app's access to manage external storage, use
15022      * {@link #ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION} instead.
15023      * <p>
15024      * Output: Nothing.
15025      * @see #ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
15026      */
15027     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
15028     public static final String ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION =
15029             "android.settings.MANAGE_ALL_FILES_ACCESS_PERMISSION";
15030 
15031     /**
15032      * Activity Action: Show screen for controlling if the app specified in the data URI of the
15033      * intent can manage external storage.
15034      * <p>
15035      * Launching the corresponding activity requires the permission
15036      * {@link Manifest.permission#MANAGE_EXTERNAL_STORAGE}.
15037      * <p>
15038      * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
15039      * <p>
15040      * Input: The Intent's data URI MUST specify the application package name whose ability of
15041      * managing external storage you want to control.
15042      * For example "package:com.my.app".
15043      * <p>
15044      * Output: Nothing.
15045      * @see #ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION
15046      */
15047     @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
15048     public static final String ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION =
15049             "android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION";
15050 
15051     /**
15052      * Performs a strict and comprehensive check of whether a calling package is allowed to
15053      * write/modify system settings, as the condition differs for pre-M, M+, and
15054      * privileged/preinstalled apps. If the provided uid does not match the
15055      * callingPackage, a negative result will be returned.
15056      * @hide
15057      */
15058     @UnsupportedAppUsage
isCallingPackageAllowedToWriteSettings(Context context, int uid, String callingPackage, boolean throwException)15059     public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid,
15060             String callingPackage, boolean throwException) {
15061         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
15062                 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
15063                 PM_WRITE_SETTINGS, false);
15064     }
15065 
15066     /**
15067      * Performs a strict and comprehensive check of whether a calling package is allowed to
15068      * write/modify system settings, as the condition differs for pre-M, M+, and
15069      * privileged/preinstalled apps. If the provided uid does not match the
15070      * callingPackage, a negative result will be returned. The caller is expected to have
15071      * the WRITE_SETTINGS permission declared.
15072      *
15073      * Note: if the check is successful, the operation of this app will be updated to the
15074      * current time.
15075      * @hide
15076      */
15077     @SystemApi
checkAndNoteWriteSettingsOperation(@onNull Context context, int uid, @NonNull String callingPackage, boolean throwException)15078     public static boolean checkAndNoteWriteSettingsOperation(@NonNull Context context, int uid,
15079             @NonNull String callingPackage, boolean throwException) {
15080         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
15081                 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
15082                 PM_WRITE_SETTINGS, true);
15083     }
15084 
15085     /**
15086      * Performs a strict and comprehensive check of whether a calling package is allowed to
15087      * change the state of network, as the condition differs for pre-M, M+, and
15088      * privileged/preinstalled apps. The caller is expected to have either the
15089      * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these
15090      * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and
15091      * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal
15092      * permission and cannot be revoked. See http://b/23597341
15093      *
15094      * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation
15095      * of this app will be updated to the current time.
15096      * @hide
15097      */
checkAndNoteChangeNetworkStateOperation(Context context, int uid, String callingPackage, boolean throwException)15098     public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid,
15099             String callingPackage, boolean throwException) {
15100         if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE)
15101                 == PackageManager.PERMISSION_GRANTED) {
15102             return true;
15103         }
15104         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
15105                 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
15106                 PM_CHANGE_NETWORK_STATE, true);
15107     }
15108 
15109     /**
15110      * Performs a strict and comprehensive check of whether a calling package is allowed to
15111      * draw on top of other apps, as the conditions differs for pre-M, M+, and
15112      * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
15113      * a negative result will be returned.
15114      * @hide
15115      */
15116     @UnsupportedAppUsage
isCallingPackageAllowedToDrawOverlays(Context context, int uid, String callingPackage, boolean throwException)15117     public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid,
15118             String callingPackage, boolean throwException) {
15119         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
15120                 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
15121                 PM_SYSTEM_ALERT_WINDOW, false);
15122     }
15123 
15124     /**
15125      * Performs a strict and comprehensive check of whether a calling package is allowed to
15126      * draw on top of other apps, as the conditions differs for pre-M, M+, and
15127      * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
15128      * a negative result will be returned.
15129      *
15130      * Note: if the check is successful, the operation of this app will be updated to the
15131      * current time.
15132      * @hide
15133      */
checkAndNoteDrawOverlaysOperation(Context context, int uid, String callingPackage, boolean throwException)15134     public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String
15135             callingPackage, boolean throwException) {
15136         return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
15137                 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
15138                 PM_SYSTEM_ALERT_WINDOW, true);
15139     }
15140 
15141     /**
15142      * Helper method to perform a general and comprehensive check of whether an operation that is
15143      * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and
15144      * OP_WRITE_SETTINGS
15145      * @hide
15146      */
15147     @UnsupportedAppUsage
isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] permissions, boolean makeNote)15148     public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
15149             int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[]
15150             permissions, boolean makeNote) {
15151         if (callingPackage == null) {
15152             return false;
15153         }
15154 
15155         AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE);
15156         int mode = AppOpsManager.MODE_DEFAULT;
15157         if (makeNote) {
15158             mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage);
15159         } else {
15160             mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage);
15161         }
15162 
15163         switch (mode) {
15164             case AppOpsManager.MODE_ALLOWED:
15165                 return true;
15166 
15167             case AppOpsManager.MODE_DEFAULT:
15168                 // this is the default operating mode after an app's installation
15169                 // In this case we will check all associated static permission to see
15170                 // if it is granted during install time.
15171                 for (String permission : permissions) {
15172                     if (context.checkCallingOrSelfPermission(permission) == PackageManager
15173                             .PERMISSION_GRANTED) {
15174                         // if either of the permissions are granted, we will allow it
15175                         return true;
15176                     }
15177                 }
15178 
15179             default:
15180                 // this is for all other cases trickled down here...
15181                 if (!throwException) {
15182                     return false;
15183                 }
15184         }
15185 
15186         // prepare string to throw SecurityException
15187         StringBuilder exceptionMessage = new StringBuilder();
15188         exceptionMessage.append(callingPackage);
15189         exceptionMessage.append(" was not granted ");
15190         if (permissions.length > 1) {
15191             exceptionMessage.append(" either of these permissions: ");
15192         } else {
15193             exceptionMessage.append(" this permission: ");
15194         }
15195         for (int i = 0; i < permissions.length; i++) {
15196             exceptionMessage.append(permissions[i]);
15197             exceptionMessage.append((i == permissions.length - 1) ? "." : ", ");
15198         }
15199 
15200         throw new SecurityException(exceptionMessage.toString());
15201     }
15202 
15203     /**
15204      * Retrieves a correponding package name for a given uid. It will query all
15205      * packages that are associated with the given uid, but it will return only
15206      * the zeroth result.
15207      * Note: If package could not be found, a null is returned.
15208      * @hide
15209      */
getPackageNameForUid(Context context, int uid)15210     public static String getPackageNameForUid(Context context, int uid) {
15211         String[] packages = context.getPackageManager().getPackagesForUid(uid);
15212         if (packages == null) {
15213             return null;
15214         }
15215         return packages[0];
15216     }
15217 }
15218