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.CallbackExecutor;
21  import android.annotation.IntDef;
22  import android.annotation.IntRange;
23  import android.annotation.NonNull;
24  import android.annotation.Nullable;
25  import android.annotation.PermissionMethod;
26  import android.annotation.PermissionName;
27  import android.annotation.RequiresPermission;
28  import android.annotation.SdkConstant;
29  import android.annotation.SdkConstant.SdkConstantType;
30  import android.annotation.SuppressLint;
31  import android.annotation.SystemApi;
32  import android.annotation.TestApi;
33  import android.annotation.UserIdInt;
34  import android.app.Activity;
35  import android.app.ActivityThread;
36  import android.app.AppOpsManager;
37  import android.app.Application;
38  import android.app.AutomaticZenRule;
39  import android.app.NotificationChannel;
40  import android.app.NotificationManager;
41  import android.app.SearchManager;
42  import android.app.WallpaperManager;
43  import android.compat.annotation.UnsupportedAppUsage;
44  import android.content.ComponentName;
45  import android.content.ContentResolver;
46  import android.content.ContentValues;
47  import android.content.Context;
48  import android.content.IContentProvider;
49  import android.content.Intent;
50  import android.content.pm.ActivityInfo;
51  import android.content.pm.ApplicationInfo;
52  import android.content.pm.PackageManager;
53  import android.content.pm.ResolveInfo;
54  import android.content.res.Configuration;
55  import android.content.res.Resources;
56  import android.database.ContentObserver;
57  import android.database.Cursor;
58  import android.database.SQLException;
59  import android.location.ILocationManager;
60  import android.location.LocationManager;
61  import android.media.AudioManager;
62  import android.net.ConnectivityManager;
63  import android.net.NetworkScoreManager;
64  import android.net.Uri;
65  import android.net.wifi.SoftApConfiguration;
66  import android.net.wifi.WifiManager;
67  import android.net.wifi.p2p.WifiP2pManager;
68  import android.os.BatteryManager;
69  import android.os.Binder;
70  import android.os.Build;
71  import android.os.Build.VERSION_CODES;
72  import android.os.Bundle;
73  import android.os.DropBoxManager;
74  import android.os.IBinder;
75  import android.os.LocaleList;
76  import android.os.PowerManager;
77  import android.os.PowerManager.AutoPowerSaveModeTriggers;
78  import android.os.Process;
79  import android.os.RemoteCallback;
80  import android.os.RemoteException;
81  import android.os.ResultReceiver;
82  import android.os.ServiceManager;
83  import android.os.UserHandle;
84  import android.speech.tts.TextToSpeech;
85  import android.telephony.TelephonyManager;
86  import android.text.TextUtils;
87  import android.util.AndroidException;
88  import android.util.ArrayMap;
89  import android.util.ArraySet;
90  import android.util.Log;
91  import android.util.MemoryIntArray;
92  import android.util.Slog;
93  import android.view.Display;
94  import android.view.MotionEvent;
95  import android.view.ViewConfiguration;
96  import android.view.Window;
97  import android.view.WindowManager.LayoutParams;
98  import android.widget.Editor;
99  
100  import com.android.internal.annotations.GuardedBy;
101  import com.android.internal.util.Preconditions;
102  
103  import java.io.IOException;
104  import java.lang.annotation.ElementType;
105  import java.lang.annotation.Retention;
106  import java.lang.annotation.RetentionPolicy;
107  import java.lang.annotation.Target;
108  import java.lang.reflect.Field;
109  import java.net.URISyntaxException;
110  import java.util.ArrayList;
111  import java.util.HashMap;
112  import java.util.HashSet;
113  import java.util.List;
114  import java.util.Map;
115  import java.util.Objects;
116  import java.util.Set;
117  import java.util.concurrent.Executor;
118  import java.util.function.Consumer;
119  
120  /**
121   * The Settings provider contains global system-level device preferences.
122   */
123  public final class Settings {
124      /** @hide */
125      public static final boolean DEFAULT_OVERRIDEABLE_BY_RESTORE = false;
126  
127      // Intent actions for Settings
128  
129      /**
130       * Activity Action: Show system settings.
131       * <p>
132       * Input: Nothing.
133       * <p>
134       * Output: Nothing.
135       */
136      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
137      public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
138  
139      /**
140       * Activity Action: Show settings to allow configuration of APNs.
141       * <p>
142       * Input: Nothing.
143       * <p>
144       * Output: Nothing.
145       *
146       * <p class="note">
147       * In some cases, a matching Activity may not exist, so ensure you
148       * safeguard against this.
149       */
150      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
151      public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
152  
153      /**
154       * Activity Action: Show settings to allow configuration of current location
155       * sources.
156       * <p>
157       * In some cases, a matching Activity may not exist, so ensure you
158       * safeguard against this.
159       * <p>
160       * Input: Nothing.
161       * <p>
162       * Output: Nothing.
163       */
164      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
165      public static final String ACTION_LOCATION_SOURCE_SETTINGS =
166              "android.settings.LOCATION_SOURCE_SETTINGS";
167  
168      /**
169       * Activity Action: Show settings to allow configuration of location controller extra package.
170       * <p>
171       * In some cases, a matching Activity may not exist, so ensure you
172       * safeguard against this.
173       * <p>
174       * Input: Nothing.
175       * <p>
176       * Output: Nothing.
177       *
178       * @hide
179       */
180      @SystemApi
181      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
182      public static final String ACTION_LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS =
183              "android.settings.LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS";
184  
185      /**
186       * Activity Action: Show scanning settings to allow configuration of Wi-Fi
187       * and Bluetooth scanning settings.
188       * <p>
189       * In some cases, a matching Activity may not exist, so ensure you
190       * safeguard against this.
191       * <p>
192       * Input: Nothing.
193       * <p>
194       * Output: Nothing.
195       * @hide
196       */
197      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
198      public static final String ACTION_LOCATION_SCANNING_SETTINGS =
199              "android.settings.LOCATION_SCANNING_SETTINGS";
200  
201      /**
202       * Activity Action: Show settings to manage creation/deletion of cloned apps.
203       * <p>
204       * In some cases, a matching Activity may not exist, so ensure you
205       * safeguard against this.
206       * <p>
207       * Input: Nothing.
208       * <p>
209       * Output: Nothing.
210       * @hide
211       */
212      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
213      public static final String ACTION_MANAGE_CLONED_APPS_SETTINGS =
214              "android.settings.MANAGE_CLONED_APPS_SETTINGS";
215  
216      /**
217       * Activity Action: Show settings to allow configuration of users.
218       * <p>
219       * In some cases, a matching Activity may not exist, so ensure you
220       * safeguard against this.
221       * <p>
222       * Input: Nothing.
223       * <p>
224       * Output: Nothing.
225       * @hide
226       */
227      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
228      @SystemApi
229      public static final String ACTION_USER_SETTINGS =
230              "android.settings.USER_SETTINGS";
231  
232      /**
233       * Activity Action: Show settings to allow configuration of wireless controls
234       * such as Wi-Fi, Bluetooth and Mobile networks.
235       * <p>
236       * In some cases, a matching Activity may not exist, so ensure you
237       * safeguard against this.
238       * <p>
239       * Input: Nothing.
240       * <p>
241       * Output: Nothing.
242       */
243      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
244      public static final String ACTION_WIRELESS_SETTINGS =
245              "android.settings.WIRELESS_SETTINGS";
246  
247      /**
248       * Activity Action: Show tether provisioning activity.
249       *
250       * <p>
251       * In some cases, a matching Activity may not exist, so ensure you
252       * safeguard against this.
253       * <p>
254       * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type
255       * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should
256       * contain a {@link ResultReceiver} which will be called back with a tether result code.
257       * <p>
258       * Output: The result of the provisioning check.
259       * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful,
260       * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure.
261       *
262       * @hide
263       */
264      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
265      @SystemApi
266      public static final String ACTION_TETHER_PROVISIONING_UI =
267              "android.settings.TETHER_PROVISIONING_UI";
268  
269      /**
270       * Activity Action: Show a dialog activity to notify tethering is NOT supported by carrier.
271       *
272       * When {@link android.telephony.CarrierConfigManager#KEY_CARRIER_SUPPORTS_TETHERING_BOOL}
273       * is false, and tethering is started by Settings, this dialog activity will be started to
274       * tell the user that tethering is not supported by carrier.
275       *
276       * @hide
277       */
278      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
279      @SystemApi
280      public static final String ACTION_TETHER_UNSUPPORTED_CARRIER_UI =
281              "android.settings.TETHER_UNSUPPORTED_CARRIER_UI";
282  
283      /**
284       * Activity Action: Show settings to allow entering/exiting airplane mode.
285       * <p>
286       * In some cases, a matching Activity may not exist, so ensure you
287       * safeguard against this.
288       * <p>
289       * Input: Nothing.
290       * <p>
291       * Output: Nothing.
292       */
293      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
294      public static final String ACTION_AIRPLANE_MODE_SETTINGS =
295              "android.settings.AIRPLANE_MODE_SETTINGS";
296  
297      /**
298       * Activity Action: Show mobile data usage list.
299       * <p>
300       * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify
301       * how and what mobile data statistics should be collected.
302       * <p>
303       * Output: Nothing
304       * @hide
305       */
306      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
307      public static final String ACTION_MOBILE_DATA_USAGE =
308              "android.settings.MOBILE_DATA_USAGE";
309  
310      /** @hide */
311      public static final String EXTRA_NETWORK_TEMPLATE = "network_template";
312  
313      /**
314       * Activity Action: Show One-handed mode Settings page.
315       * <p>
316       * Input: Nothing
317       * <p>
318       * Output: Nothing
319       * @hide
320       */
321      public static final String ACTION_ONE_HANDED_SETTINGS =
322              "android.settings.action.ONE_HANDED_SETTINGS";
323      /**
324       * The return values for {@link Settings.Config#set}
325       * @hide
326       */
327      @IntDef(prefix = "SET_ALL_RESULT_",
328              value = { SET_ALL_RESULT_FAILURE, SET_ALL_RESULT_SUCCESS, SET_ALL_RESULT_DISABLED })
329      @Retention(RetentionPolicy.SOURCE)
330      @Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE})
331      public @interface SetAllResult {}
332  
333      /**
334       * A return value for {@link #KEY_CONFIG_SET_ALL_RETURN}, indicates failure.
335       * @hide
336       */
337      public static final int SET_ALL_RESULT_FAILURE = 0;
338  
339      /**
340       * A return value for {@link #KEY_CONFIG_SET_ALL_RETURN}, indicates success.
341       * @hide
342       */
343      public static final int SET_ALL_RESULT_SUCCESS = 1;
344  
345      /**
346       * A return value for {@link #KEY_CONFIG_SET_ALL_RETURN}, indicates a set all is disabled.
347       * @hide
348       */
349      public static final int SET_ALL_RESULT_DISABLED = 2;
350  
351      /** @hide */
352      public static final String KEY_CONFIG_SET_ALL_RETURN = "config_set_all_return";
353  
354      /** @hide */
355      public static final String KEY_CONFIG_GET_SYNC_DISABLED_MODE_RETURN =
356              "config_get_sync_disabled_mode_return";
357  
358      /**
359       * An int extra specifying a subscription ID.
360       *
361       * @see android.telephony.SubscriptionInfo#getSubscriptionId
362       */
363      public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID";
364  
365      /**
366       * Activity Action: Modify Airplane mode settings using a voice command.
367       * <p>
368       * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
369       * <p>
370       * This intent MUST be started using
371       * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
372       * startVoiceActivity}.
373       * <p>
374       * Note: The activity implementing this intent MUST verify that
375       * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
376       * modifying the setting.
377       * <p>
378       * Input: To tell which state airplane mode should be set to, add the
379       * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
380       * If the extra is not included, no changes will be made.
381       * <p>
382       * Output: Nothing.
383       */
384      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
385      public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
386              "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
387  
388      /**
389       * Activity Action: Show settings for accessibility modules.
390       * <p>
391       * In some cases, a matching Activity may not exist, so ensure you
392       * safeguard against this.
393       * <p>
394       * Input: Nothing.
395       * <p>
396       * Output: Nothing.
397       */
398      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
399      public static final String ACTION_ACCESSIBILITY_SETTINGS =
400              "android.settings.ACCESSIBILITY_SETTINGS";
401  
402      /**
403       * Activity Action: Show detail settings of a particular accessibility service.
404       * <p>
405       * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
406       * <p>
407       * Input: {@link Intent#EXTRA_COMPONENT_NAME} must specify the accessibility service component
408       * name to be shown.
409       * <p>
410       * Output: Nothing.
411       * @hide
412       **/
413      @SystemApi
414      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
415      public static final String ACTION_ACCESSIBILITY_DETAILS_SETTINGS =
416              "android.settings.ACCESSIBILITY_DETAILS_SETTINGS";
417  
418      /**
419       * Activity Action: Show settings to allow configuration of accessibility color and motion.
420       * <p>
421       * In some cases, a matching Activity may not exist, so ensure you
422       * safeguard against this.
423       * <p>
424       * Input: Nothing.
425       * <p>
426       * Output: Nothing.
427       * @hide
428       */
429      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
430      public static final String ACTION_ACCESSIBILITY_COLOR_MOTION_SETTINGS =
431              "android.settings.ACCESSIBILITY_COLOR_MOTION_SETTINGS";
432  
433      /**
434       * Activity Action: Show settings to allow configuration of Reduce Bright Colors.
435       * <p>
436       * In some cases, a matching Activity may not exist, so ensure you
437       * safeguard against this.
438       * <p>
439       * Input: Nothing.
440       * <p>
441       * Output: Nothing.
442       * @hide
443       */
444      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
445      public static final String ACTION_REDUCE_BRIGHT_COLORS_SETTINGS =
446              "android.settings.REDUCE_BRIGHT_COLORS_SETTINGS";
447  
448      /**
449       * Activity Action: Show settings to allow configuration of Color correction.
450       * <p>
451       * In some cases, a matching Activity may not exist, so ensure you
452       * safeguard against this.
453       * <p>
454       * Input: Nothing.
455       * <p>
456       * Output: Nothing.
457       * @hide
458       */
459      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
460      public static final String ACTION_COLOR_CORRECTION_SETTINGS =
461              "com.android.settings.ACCESSIBILITY_COLOR_SPACE_SETTINGS";
462  
463      /**
464       * Activity Action: Show settings to allow configuration of Color inversion.
465       * <p>
466       * In some cases, a matching Activity may not exist, so ensure you
467       * safeguard against this.
468       * <p>
469       * Input: Nothing.
470       * <p>
471       * Output: Nothing.
472       * @hide
473       */
474      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
475      public static final String ACTION_COLOR_INVERSION_SETTINGS =
476              "android.settings.COLOR_INVERSION_SETTINGS";
477  
478      /**
479       * Activity Action: Show settings to allow configuration of text reading.
480       * <p>
481       * In some cases, a matching Activity may not exist, so ensure you
482       * safeguard against this.
483       * <p>
484       * Input: Nothing.
485       * <p>
486       * Output: Nothing.
487       * @hide
488       */
489      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
490      public static final String ACTION_TEXT_READING_SETTINGS =
491              "android.settings.TEXT_READING_SETTINGS";
492  
493      /**
494       * Activity Action: Show settings to control access to usage information.
495       * <p>
496       * In some cases, a matching Activity may not exist, so ensure you
497       * safeguard against this.
498       * <p>
499       * Input: Nothing.
500       * <p>
501       * Output: Nothing.
502       */
503      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
504      public static final String ACTION_USAGE_ACCESS_SETTINGS =
505              "android.settings.USAGE_ACCESS_SETTINGS";
506  
507      /**
508       * Activity Category: Show application settings related to usage access.
509       * <p>
510       * An activity that provides a user interface for adjusting usage access related
511       * preferences for its containing application. Optional but recommended for apps that
512       * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}.
513       * <p>
514       * The activity may define meta-data to describe what usage access is
515       * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which
516       * will be displayed in Settings.
517       * <p>
518       * Input: Nothing.
519       * <p>
520       * Output: Nothing.
521       */
522      @SdkConstant(SdkConstantType.INTENT_CATEGORY)
523      public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG =
524              "android.intent.category.USAGE_ACCESS_CONFIG";
525  
526      /**
527       * Metadata key: Reason for needing usage access.
528       * <p>
529       * A key for metadata attached to an activity that receives action
530       * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the
531       * user as description of how the app uses usage access.
532       * <p>
533       */
534      public static final String METADATA_USAGE_ACCESS_REASON =
535              "android.settings.metadata.USAGE_ACCESS_REASON";
536  
537      /**
538       * Activity Action: Show settings to allow configuration of security and
539       * location privacy.
540       * <p>
541       * In some cases, a matching Activity may not exist, so ensure you
542       * safeguard against this.
543       * <p>
544       * Input: Nothing.
545       * <p>
546       * Output: Nothing.
547       */
548      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
549      public static final String ACTION_SECURITY_SETTINGS =
550              "android.settings.SECURITY_SETTINGS";
551  
552      /**
553       * Activity Action: Show settings to allow configuration of trusted external sources
554       *
555       * Input: Optionally, the Intent's data URI can specify the application package name to
556       * directly invoke the management GUI specific to the package name. For example
557       * "package:com.my.app".
558       * <p>
559       * Output: Nothing.
560       */
561      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
562      public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES =
563              "android.settings.MANAGE_UNKNOWN_APP_SOURCES";
564  
565      /**
566       * Activity Action: Show settings to allow configuration of
567       * {@link Manifest.permission#SCHEDULE_EXACT_ALARM} permission
568       *
569       * Input: Optionally, the Intent's data URI can specify the application package name to
570       * directly invoke the management GUI specific to the package name. For example
571       * "package:com.my.app".
572       * <p>
573       * Output: When a package data uri is passed as input, the activity result is set to
574       * {@link android.app.Activity#RESULT_OK} if the permission was granted to the app. Otherwise,
575       * the result is set to {@link android.app.Activity#RESULT_CANCELED}.
576       */
577      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
578      public static final String ACTION_REQUEST_SCHEDULE_EXACT_ALARM =
579              "android.settings.REQUEST_SCHEDULE_EXACT_ALARM";
580  
581      /**
582       * Activity Action: Show settings to allow configuration of
583       * {@link Manifest.permission#MANAGE_MEDIA} permission
584       *
585       * Input: Optionally, the Intent's data URI can specify the application package name to
586       * directly invoke the management GUI specific to the package name. For example
587       * "package:com.my.app".
588       * <p>
589       * Output: Nothing.
590       */
591      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
592      public static final String ACTION_REQUEST_MANAGE_MEDIA =
593              "android.settings.REQUEST_MANAGE_MEDIA";
594  
595      /**
596       * Activity Action: Show settings to allow configuration of
597       * {@link Manifest.permission#RUN_USER_INITIATED_JOBS} permission
598       *
599       * Input: Optionally, the Intent's data URI can specify the application package name to
600       * directly invoke the management GUI specific to the package name. For example
601       * "package:com.my.app".
602       * <p>
603       * Output: When a package data uri is passed as input, the activity result is set to
604       * {@link android.app.Activity#RESULT_OK} if the permission was granted to the app. Otherwise,
605       * the result is set to {@link android.app.Activity#RESULT_CANCELED}.
606       *
607       * @hide
608       */
609      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
610      public static final String ACTION_MANAGE_APP_LONG_RUNNING_JOBS =
611              "android.settings.MANAGE_APP_LONG_RUNNING_JOBS";
612  
613      /**
614       * Activity Action: Show settings to allow configuration of cross-profile access for apps
615       *
616       * Input: Optionally, the Intent's data URI can specify the application package name to
617       * directly invoke the management GUI specific to the package name. For example
618       * "package:com.my.app".
619       * <p>
620       * Output: Nothing.
621       *
622       * @hide
623       */
624      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
625      public static final String ACTION_MANAGE_CROSS_PROFILE_ACCESS =
626              "android.settings.MANAGE_CROSS_PROFILE_ACCESS";
627  
628      /**
629       * Activity Action: Show the "Open by Default" page in a particular application's details page.
630       * <p>
631       * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
632       * <p>
633       * Input: The Intent's data URI specifies the application package name
634       * to be shown, with the "package" scheme. That is "package:com.my.app".
635       * <p>
636       * Output: Nothing.
637       */
638      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
639      public static final String ACTION_APP_OPEN_BY_DEFAULT_SETTINGS =
640              "android.settings.APP_OPEN_BY_DEFAULT_SETTINGS";
641  
642      /**
643       * Activity Action: Show trusted credentials settings, opening to the user tab,
644       * to allow management of installed credentials.
645       * <p>
646       * In some cases, a matching Activity may not exist, so ensure you
647       * safeguard against this.
648       * <p>
649       * Input: Nothing.
650       * <p>
651       * Output: Nothing.
652       * @hide
653       */
654      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
655      @UnsupportedAppUsage
656      public static final String ACTION_TRUSTED_CREDENTIALS_USER =
657              "com.android.settings.TRUSTED_CREDENTIALS_USER";
658  
659      /**
660       * Activity Action: Show dialog explaining that an installed CA cert may enable
661       * monitoring of encrypted network traffic.
662       * <p>
663       * In some cases, a matching Activity may not exist, so ensure you
664       * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the
665       * number of certificates.
666       * <p>
667       * Input: Nothing.
668       * <p>
669       * Output: Nothing.
670       * @hide
671       */
672      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
673      public static final String ACTION_MONITORING_CERT_INFO =
674              "com.android.settings.MONITORING_CERT_INFO";
675  
676      /**
677       * Activity Action: Show settings to allow configuration of privacy options.
678       * <p>
679       * In some cases, a matching Activity may not exist, so ensure you
680       * safeguard against this.
681       * <p>
682       * Input: Nothing.
683       * <p>
684       * Output: Nothing.
685       */
686      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
687      public static final String ACTION_PRIVACY_SETTINGS =
688              "android.settings.PRIVACY_SETTINGS";
689  
690      /**
691       * Activity Action: Show settings to allow configuration of VPN.
692       * <p>
693       * In some cases, a matching Activity may not exist, so ensure you
694       * safeguard against this.
695       * <p>
696       * Input: Nothing.
697       * <p>
698       * Output: Nothing.
699       */
700      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
701      public static final String ACTION_VPN_SETTINGS =
702              "android.settings.VPN_SETTINGS";
703  
704      /**
705       * Activity Action: Show settings to allow configuration of Wi-Fi.
706       * <p>
707       * In some cases, a matching Activity may not exist, so ensure you
708       * safeguard against this.
709       * <p>
710       * Input: Nothing.
711       * <p>
712       * Output: Nothing.
713       */
714      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
715      public static final String ACTION_WIFI_SETTINGS =
716              "android.settings.WIFI_SETTINGS";
717  
718      /**
719       * Activity Action: Show settings to allow configuration of Advanced memory protection.
720       * <p>
721       * Memory Tagging Extension (MTE) is a CPU extension that allows to protect against certain
722       * classes of security problems at a small runtime performance cost overhead.
723       * <p>
724       * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
725       * <p>
726       * Input: Nothing.
727       * <p>
728       * Output: Nothing.
729       */
730      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
731      public static final String ACTION_ADVANCED_MEMORY_PROTECTION_SETTINGS =
732              "android.settings.ADVANCED_MEMORY_PROTECTION_SETTINGS";
733  
734      /**
735       * Activity Action: Show settings to allow configuration of a static IP
736       * address for Wi-Fi.
737       * <p>
738       * In some cases, a matching Activity may not exist, so ensure you safeguard
739       * against this.
740       * <p>
741       * Input: Nothing.
742       * <p>
743       * Output: Nothing.
744       */
745      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
746      public static final String ACTION_WIFI_IP_SETTINGS =
747              "android.settings.WIFI_IP_SETTINGS";
748  
749      /**
750       * Activity Action: Show setting page to process a Wi-Fi Easy Connect (aka DPP) URI and start
751       * configuration. This intent should be used when you want to use this device to take on the
752       * configurator role for an IoT/other device. When provided with a valid DPP URI
753       * string, Settings will open a Wi-Fi selection screen for the user to indicate which network
754       * they would like to configure the device specified in the DPP URI string and
755       * carry them through the rest of the flow for provisioning the device.
756       * <p>
757       * In some cases, a matching Activity may not exist, so ensure to safeguard against this by
758       * checking {@link WifiManager#isEasyConnectSupported()}.
759       * <p>
760       * Input: The Intent's data URI specifies bootstrapping information for authenticating and
761       * provisioning the peer, and uses a "DPP" scheme. The URI should be attached to the intent
762       * using {@link Intent#setData(Uri)}. The calling app can obtain a DPP URI in any
763       * way, e.g. by scanning a QR code or other out-of-band methods. The calling app may also
764       * attach the {@link #EXTRA_EASY_CONNECT_BAND_LIST} extra to provide information
765       * about the bands supported by the enrollee device.
766       * <p>
767       * Output: After calling {@link android.app.Activity#startActivityForResult}, the callback
768       * {@code onActivityResult} will have resultCode {@link android.app.Activity#RESULT_OK} if
769       * the Wi-Fi Easy Connect configuration succeeded and the user tapped the 'Done' button, or
770       * {@link android.app.Activity#RESULT_CANCELED} if the operation failed and user tapped the
771       * 'Cancel' button. In case the operation has failed, a status code from
772       * {@link android.net.wifi.EasyConnectStatusCallback} {@code EASY_CONNECT_EVENT_FAILURE_*} will
773       * be returned as an Extra {@link #EXTRA_EASY_CONNECT_ERROR_CODE}. Easy Connect R2
774       * Enrollees report additional details about the error they encountered, which will be
775       * provided in the {@link #EXTRA_EASY_CONNECT_ATTEMPTED_SSID},
776       * {@link #EXTRA_EASY_CONNECT_CHANNEL_LIST}, and {@link #EXTRA_EASY_CONNECT_BAND_LIST}.
777       */
778      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
779      public static final String ACTION_PROCESS_WIFI_EASY_CONNECT_URI =
780              "android.settings.PROCESS_WIFI_EASY_CONNECT_URI";
781  
782      /**
783       * Activity Extra: The Easy Connect operation error code
784       * <p>
785       * An extra returned on the result intent received when using the
786       * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation.
787       * This extra contains the integer error code of the operation - one of
788       * {@link android.net.wifi.EasyConnectStatusCallback} {@code EASY_CONNECT_EVENT_FAILURE_*}. If
789       * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK},
790       * then this extra is not attached to the result intent.
791       * <p>
792       * Use the {@link Intent#hasExtra(String)} to determine whether the extra is attached and
793       * {@link Intent#getIntExtra(String, int)} to obtain the error code data.
794       */
795      public static final String EXTRA_EASY_CONNECT_ERROR_CODE =
796              "android.provider.extra.EASY_CONNECT_ERROR_CODE";
797  
798      /**
799       * Activity Extra: The SSID that the Enrollee tried to connect to.
800       * <p>
801       * An extra returned on the result intent received when using the {@link
802       * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This
803       * extra contains the SSID of the Access Point that the remote Enrollee tried to connect to.
804       * This value is populated only by remote R2 devices, and only for the following error codes:
805       * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK}
806       * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION}.
807       * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. If
808       * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, then
809       * this extra is not attached to the result intent.
810       * <p>
811       * Use the {@link Intent#getStringExtra(String)} to obtain the SSID.
812       */
813      public static final String EXTRA_EASY_CONNECT_ATTEMPTED_SSID =
814              "android.provider.extra.EASY_CONNECT_ATTEMPTED_SSID";
815  
816      /**
817       * Activity Extra: The Channel List that the Enrollee used to scan a network.
818       * <p>
819       * An extra returned on the result intent received when using the {@link
820       * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This
821       * extra contains the channel list that the Enrollee scanned for a network. This value is
822       * populated only by remote R2 devices, and only for the following error code: {@link
823       * android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK}.
824       * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. If
825       * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, then
826       * this extra is not attached to the result intent. The list is JSON formatted, as an array
827       * (Wi-Fi global operating classes) of arrays (Wi-Fi channels).
828       * <p>
829       * Use the {@link Intent#getStringExtra(String)} to obtain the list.
830       */
831      public static final String EXTRA_EASY_CONNECT_CHANNEL_LIST =
832              "android.provider.extra.EASY_CONNECT_CHANNEL_LIST";
833  
834      /**
835       * Activity Extra: The Band List that the Enrollee supports.
836       * <p>
837       * This extra contains the bands the Enrollee supports, expressed as the Global Operating
838       * Class, see Table E-4 in IEEE Std 802.11-2016 Global operating classes. It is used both as
839       * input, to configure the Easy Connect operation and as output of the operation.
840       * <p>
841       * As input: an optional extra to be attached to the
842       * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI}. If attached, it indicates the bands which
843       * the remote device (enrollee, device-to-be-configured) supports. The Settings operation
844       * may take this into account when presenting the user with list of networks configurations
845       * to be used. The calling app may obtain this information in any out-of-band method. The
846       * information should be attached as an array of raw integers - using the
847       * {@link Intent#putExtra(String, int[])}.
848       * <p>
849       * As output: an extra returned on the result intent received when using the
850       * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation
851       * . This value is populated only by remote R2 devices, and only for the following error
852       * codes:
853       * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK},
854       * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION},
855       * or
856       * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_REJECTED_CONFIGURATION}.
857       * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}.
858       * If there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}
859       * , then this extra is not attached to the result intent.
860       * <p>
861       * Use the {@link Intent#getIntArrayExtra(String)} to obtain the list.
862       */
863      public static final String EXTRA_EASY_CONNECT_BAND_LIST =
864              "android.provider.extra.EASY_CONNECT_BAND_LIST";
865  
866      /**
867       * Activity Action: Show settings to allow configuration of data and view data usage.
868       * <p>
869       * In some cases, a matching Activity may not exist, so ensure you
870       * safeguard against this.
871       * <p>
872       * Input: Nothing.
873       * <p>
874       * Output: Nothing.
875       */
876      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
877      public static final String ACTION_DATA_USAGE_SETTINGS =
878              "android.settings.DATA_USAGE_SETTINGS";
879  
880      /**
881       * Activity Action: Show settings to allow configuration of Bluetooth.
882       * <p>
883       * In some cases, a matching Activity may not exist, so ensure you
884       * safeguard against this.
885       * <p>
886       * Input: Nothing.
887       * <p>
888       * Output: Nothing.
889       */
890      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
891      public static final String ACTION_BLUETOOTH_SETTINGS =
892              "android.settings.BLUETOOTH_SETTINGS";
893  
894      /**
895       * Activity action: Show Settings app search UI when this action is available for device.
896       * <p>
897       * Input: Nothing.
898       * <p>
899       * Output: Nothing.
900       */
901      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
902      public static final String ACTION_APP_SEARCH_SETTINGS = "android.settings.APP_SEARCH_SETTINGS";
903  
904      /**
905       * Activity Action: Show settings to allow configuration of Assist Gesture.
906       * <p>
907       * In some cases, a matching Activity may not exist, so ensure you
908       * safeguard against this.
909       * <p>
910       * Input: Nothing.
911       * <p>
912       * Output: Nothing.
913       * @hide
914       */
915      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
916      public static final String ACTION_ASSIST_GESTURE_SETTINGS =
917              "android.settings.ASSIST_GESTURE_SETTINGS";
918  
919      /**
920       * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if
921       * necessary.
922       * @deprecated See {@link #ACTION_BIOMETRIC_ENROLL}.
923       * <p>
924       * Input: Nothing.
925       * <p>
926       * Output: Nothing.
927       */
928      @Deprecated
929      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
930      public static final String ACTION_FINGERPRINT_ENROLL =
931              "android.settings.FINGERPRINT_ENROLL";
932  
933      /**
934       * Activity Action: Show settings to enroll biometrics, and setup PIN/Pattern/Pass if
935       * necessary. By default, this prompts the user to enroll biometrics with strength
936       * Weak or above, as defined by the CDD. Only biometrics that meet or exceed Strong, as defined
937       * in the CDD are allowed to participate in Keystore operations.
938       * <p>
939       * Input: extras {@link #EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED} as an integer, with
940       * constants defined in {@link android.hardware.biometrics.BiometricManager.Authenticators},
941       * e.g. {@link android.hardware.biometrics.BiometricManager.Authenticators#BIOMETRIC_STRONG}.
942       * If not specified, the default behavior is
943       * {@link android.hardware.biometrics.BiometricManager.Authenticators#BIOMETRIC_WEAK}.
944       * <p>
945       * Output: Nothing. Note that callers should still check
946       * {@link android.hardware.biometrics.BiometricManager#canAuthenticate(int)}
947       * afterwards to ensure that the user actually completed enrollment.
948       */
949      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
950      public static final String ACTION_BIOMETRIC_ENROLL =
951              "android.settings.BIOMETRIC_ENROLL";
952  
953      /**
954       * Activity Extra: The minimum strength to request enrollment for.
955       * <p>
956       * This can be passed as an extra field to the {@link #ACTION_BIOMETRIC_ENROLL} intent to
957       * indicate that only enrollment for sensors that meet these requirements should be shown. The
958       * value should be a combination of the constants defined in
959       * {@link android.hardware.biometrics.BiometricManager.Authenticators}.
960       */
961      public static final String EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED =
962              "android.provider.extra.BIOMETRIC_AUTHENTICATORS_ALLOWED";
963  
964      /**
965       * Activity Action: Show settings to allow configuration of cast endpoints.
966       * <p>
967       * In some cases, a matching Activity may not exist, so ensure you
968       * safeguard against this.
969       * <p>
970       * Input: Nothing.
971       * <p>
972       * Output: Nothing.
973       */
974      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
975      public static final String ACTION_CAST_SETTINGS =
976              "android.settings.CAST_SETTINGS";
977  
978      /**
979       * Activity Action: Show settings to allow configuration of date and time.
980       * <p>
981       * In some cases, a matching Activity may not exist, so ensure you
982       * safeguard against this.
983       * <p>
984       * Input: Nothing.
985       * <p>
986       * Output: Nothing.
987       */
988      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
989      public static final String ACTION_DATE_SETTINGS =
990              "android.settings.DATE_SETTINGS";
991  
992      /**
993       * Activity Action: Show settings to allow configuration of sound and volume.
994       * <p>
995       * In some cases, a matching Activity may not exist, so ensure you
996       * safeguard against this.
997       * <p>
998       * Input: Nothing.
999       * <p>
1000       * Output: Nothing.
1001       */
1002      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1003      public static final String ACTION_SOUND_SETTINGS =
1004              "android.settings.SOUND_SETTINGS";
1005  
1006      /**
1007       * Activity Action: Show settings to allow configuration of display.
1008       * <p>
1009       * In some cases, a matching Activity may not exist, so ensure you
1010       * safeguard against this.
1011       * <p>
1012       * Input: Nothing.
1013       * <p>
1014       * Output: Nothing.
1015       */
1016      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1017      public static final String ACTION_DISPLAY_SETTINGS =
1018              "android.settings.DISPLAY_SETTINGS";
1019  
1020      /**
1021       * Activity Action: Show Auto Rotate configuration settings.
1022       */
1023      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1024      public static final String ACTION_AUTO_ROTATE_SETTINGS =
1025              "android.settings.AUTO_ROTATE_SETTINGS";
1026  
1027      /**
1028       * Activity Action: Show settings to allow configuration of Night display.
1029       * <p>
1030       * In some cases, a matching Activity may not exist, so ensure you
1031       * safeguard against this.
1032       * <p>
1033       * Input: Nothing.
1034       * <p>
1035       * Output: Nothing.
1036       */
1037      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1038      public static final String ACTION_NIGHT_DISPLAY_SETTINGS =
1039              "android.settings.NIGHT_DISPLAY_SETTINGS";
1040  
1041      /**
1042       * Activity Action: Show settings to allow configuration of Dark theme.
1043       * <p>
1044       * In some cases, a matching Activity may not exist, so ensure you
1045       * safeguard against this.
1046       * <p>
1047       * Input: Nothing.
1048       * <p>
1049       * Output: Nothing.
1050       *
1051       * @hide
1052       */
1053      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1054      public static final String ACTION_DARK_THEME_SETTINGS =
1055              "android.settings.DARK_THEME_SETTINGS";
1056  
1057      /**
1058       * Activity Action: Show settings to allow configuration of locale.
1059       * <p>
1060       * In some cases, a matching Activity may not exist, so ensure you
1061       * safeguard against this.
1062       * <p>
1063       * Input: The optional {@code #EXTRA_EXPLICIT_LOCALES} with language tags that contains locales
1064       * to limit available locales. This is only supported when device is under demo mode.
1065       * If intent does not contain this extra, it will show system supported locale list.
1066       * <br/>
1067       * If {@code #EXTRA_EXPLICIT_LOCALES} contain a unsupported locale, it will still show this
1068       * locale on list, but may not be supported by the devcie.
1069       *
1070       * Output: Nothing.
1071       */
1072      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1073      public static final String ACTION_LOCALE_SETTINGS =
1074              "android.settings.LOCALE_SETTINGS";
1075  
1076      /**
1077       * Activity Extra: Show explicit locales in launched locale picker activity.
1078       *
1079       * This can be passed as an extra field in an Activity Intent with one or more language tags
1080       * as a {@link LocaleList}. This must be passed as an extra field to the
1081       * {@link #ACTION_LOCALE_SETTINGS}.
1082       *
1083       * @hide
1084       */
1085      public static final String EXTRA_EXPLICIT_LOCALES =
1086              "android.provider.extra.EXPLICIT_LOCALES";
1087  
1088      /**
1089       * Activity Action: Show settings to allow configuration of per application locale.
1090       * <p>
1091       * Input: The Intent's data URI can specify the application package name to directly invoke the
1092       * app locale details GUI specific to the package name.
1093       * For example "package:com.my.app".
1094       * <p>
1095       * Output: Nothing.
1096       */
1097      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1098      public static final String ACTION_APP_LOCALE_SETTINGS =
1099              "android.settings.APP_LOCALE_SETTINGS";
1100  
1101      /**
1102       * Activity Action: Show settings to allow configuration of regional preferences
1103       * <p>
1104       * Input: Nothing
1105       * <p>
1106       * Output: Nothing.
1107       */
1108      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1109      public static final String ACTION_REGIONAL_PREFERENCES_SETTINGS =
1110              "android.settings.REGIONAL_PREFERENCES_SETTINGS";
1111  
1112      /**
1113       * Activity Action: Show settings to allow configuration of lockscreen.
1114       * <p>
1115       * In some cases, a matching Activity may not exist, so ensure you
1116       * safeguard against this.
1117       * <p>
1118       * Input: Nothing.
1119       * <p>
1120       * Output: Nothing.
1121       *
1122       * @hide
1123       */
1124      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1125      public static final String ACTION_LOCKSCREEN_SETTINGS = "android.settings.LOCK_SCREEN_SETTINGS";
1126  
1127      /**
1128       * Activity Action: Show settings to allow pairing bluetooth devices.
1129       * <p>
1130       * In some cases, a matching Activity may not exist, so ensure you
1131       * safeguard against this.
1132       * <p>
1133       * Input: Nothing.
1134       * <p>
1135       * Output: Nothing.
1136       *
1137       * @hide
1138       */
1139      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1140      public static final String ACTION_BLUETOOTH_PAIRING_SETTINGS =
1141              "android.settings.BLUETOOTH_PAIRING_SETTINGS";
1142  
1143      /**
1144       * Activity Action: Show settings to configure input methods, in particular
1145       * allowing the user to enable input methods.
1146       * <p>
1147       * In some cases, a matching Activity may not exist, so ensure you
1148       * safeguard against this.
1149       * <p>
1150       * Input: Nothing.
1151       * <p>
1152       * Output: Nothing.
1153       */
1154      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1155      public static final String ACTION_VOICE_INPUT_SETTINGS =
1156              "android.settings.VOICE_INPUT_SETTINGS";
1157  
1158      /**
1159       * Activity Action: Show settings to configure input methods, in particular
1160       * allowing the user to enable input methods.
1161       * <p>
1162       * In some cases, a matching Activity may not exist, so ensure you
1163       * safeguard against this.
1164       * <p>
1165       * Input: Nothing.
1166       * <p>
1167       * Output: Nothing.
1168       */
1169      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1170      public static final String ACTION_INPUT_METHOD_SETTINGS =
1171              "android.settings.INPUT_METHOD_SETTINGS";
1172  
1173      /**
1174       * Activity Action: Show settings to enable/disable input method subtypes.
1175       * <p>
1176       * In some cases, a matching Activity may not exist, so ensure you
1177       * safeguard against this.
1178       * <p>
1179       * To tell which input method's subtypes are displayed in the settings, add
1180       * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
1181       * If there is no extra in this Intent, subtypes from all installed input methods
1182       * will be displayed in the settings.
1183       *
1184       * @see android.view.inputmethod.InputMethodInfo#getId
1185       * <p>
1186       * Input: Nothing.
1187       * <p>
1188       * Output: Nothing.
1189       */
1190      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1191      public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
1192              "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
1193  
1194      /**
1195       * Activity Action: Show settings to manage the user input dictionary.
1196       * <p>
1197       * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
1198       * it is guaranteed there will always be an appropriate implementation for this Intent action.
1199       * In prior releases of the platform this was optional, so ensure you safeguard against it.
1200       * <p>
1201       * Input: Nothing.
1202       * <p>
1203       * Output: Nothing.
1204       */
1205      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1206      public static final String ACTION_USER_DICTIONARY_SETTINGS =
1207              "android.settings.USER_DICTIONARY_SETTINGS";
1208  
1209      /**
1210       * Activity Action: Show settings to configure the hardware keyboard.
1211       * <p>
1212       * In some cases, a matching Activity may not exist, so ensure you
1213       * safeguard against this.
1214       * <p>
1215       * Input: Nothing.
1216       * <p>
1217       * Output: Nothing.
1218       */
1219      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1220      public static final String ACTION_HARD_KEYBOARD_SETTINGS =
1221              "android.settings.HARD_KEYBOARD_SETTINGS";
1222  
1223      /**
1224       * Activity Action: Adds a word to the user dictionary.
1225       * <p>
1226       * In some cases, a matching Activity may not exist, so ensure you
1227       * safeguard against this.
1228       * <p>
1229       * Input: An extra with key <code>word</code> that contains the word
1230       * that should be added to the dictionary.
1231       * <p>
1232       * Output: Nothing.
1233       *
1234       * @hide
1235       */
1236      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1237      @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
1238      public static final String ACTION_USER_DICTIONARY_INSERT =
1239              "com.android.settings.USER_DICTIONARY_INSERT";
1240  
1241      /**
1242       * Activity Action: Show settings to allow configuration of application-related settings.
1243       * <p>
1244       * In some cases, a matching Activity may not exist, so ensure you
1245       * safeguard against this.
1246       * <p>
1247       * Input: Nothing.
1248       * <p>
1249       * Output: Nothing.
1250       */
1251      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1252      public static final String ACTION_APPLICATION_SETTINGS =
1253              "android.settings.APPLICATION_SETTINGS";
1254  
1255      /**
1256       * Activity Action: Show settings to allow configuration of application
1257       * development-related settings.  As of
1258       * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
1259       * a required part of the platform.
1260       * <p>
1261       * Input: Nothing.
1262       * <p>
1263       * Output: Nothing.
1264       */
1265      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1266      public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
1267              "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
1268  
1269      /**
1270       * Activity Action: Show settings to allow configuration of quick launch shortcuts.
1271       * <p>
1272       * In some cases, a matching Activity may not exist, so ensure you
1273       * safeguard against this.
1274       * <p>
1275       * Input: Nothing.
1276       * <p>
1277       * Output: Nothing.
1278       */
1279      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1280      public static final String ACTION_QUICK_LAUNCH_SETTINGS =
1281              "android.settings.QUICK_LAUNCH_SETTINGS";
1282  
1283      /**
1284       * Activity Action: Show settings to manage installed applications.
1285       * <p>
1286       * In some cases, a matching Activity may not exist, so ensure you
1287       * safeguard against this.
1288       * <p>
1289       * Input: Nothing.
1290       * <p>
1291       * Output: Nothing.
1292       */
1293      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1294      public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
1295              "android.settings.MANAGE_APPLICATIONS_SETTINGS";
1296  
1297      /**
1298       * Activity Action: Show settings to manage all applications.
1299       * <p>
1300       * In some cases, a matching Activity may not exist, so ensure you
1301       * safeguard against this.
1302       * <p>
1303       * Input: Nothing.
1304       * <p>
1305       * Output: Nothing.
1306       */
1307      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1308      public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
1309              "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
1310  
1311      /**
1312       * Activity Action: Show settings to manage all SIM profiles.
1313       * <p>
1314       * In some cases, a matching Activity may not exist, so ensure you
1315       * safeguard against this.
1316       * <p>
1317       * Input: Nothing.
1318       * <p>
1319       * Output: Nothing.
1320       */
1321      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1322      public static final String ACTION_MANAGE_ALL_SIM_PROFILES_SETTINGS =
1323              "android.settings.MANAGE_ALL_SIM_PROFILES_SETTINGS";
1324  
1325      /**
1326       * Activity Action: Show screen for controlling which apps can draw on top of other apps.
1327       * <p>
1328       * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1329       * <p>
1330       * Input: Optionally, in versions of Android prior to {@link android.os.Build.VERSION_CODES#R},
1331       * the Intent's data URI can specify the application package name to directly invoke the
1332       * management GUI specific to the package name.
1333       * For example "package:com.my.app".
1334       * <p>
1335       * Output: Nothing.
1336       */
1337      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1338      public static final String ACTION_MANAGE_OVERLAY_PERMISSION =
1339              "android.settings.action.MANAGE_OVERLAY_PERMISSION";
1340  
1341      /**
1342       * Activity Action: Show screen for controlling if the app specified in the data URI of the
1343       * intent can draw on top of other apps.
1344       * <p>
1345       * Unlike {@link #ACTION_MANAGE_OVERLAY_PERMISSION}, which in Android {@link
1346       * android.os.Build.VERSION_CODES#R} can't be used to show a GUI for a specific package,
1347       * permission {@code android.permission.INTERNAL_SYSTEM_WINDOW} is needed to start an activity
1348       * with this intent.
1349       * <p>
1350       * In some cases, a matching Activity may not exist, so ensure you
1351       * safeguard against this.
1352       * <p>
1353       * Input: The Intent's data URI MUST specify the application package name whose ability of
1354       * drawing on top of other apps you want to control.
1355       * For example "package:com.my.app".
1356       * <p>
1357       * Output: Nothing.
1358       *
1359       * @hide
1360       */
1361      @SystemApi
1362      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1363      public static final String ACTION_MANAGE_APP_OVERLAY_PERMISSION =
1364              "android.settings.MANAGE_APP_OVERLAY_PERMISSION";
1365  
1366      /**
1367       * Activity Action: Show screen for controlling which apps are allowed to write/modify
1368       * system settings.
1369       * <p>
1370       * In some cases, a matching Activity may not exist, so ensure you
1371       * safeguard against this.
1372       * <p>
1373       * Input: Optionally, the Intent's data URI can specify the application package name to
1374       * directly invoke the management GUI specific to the package name. For example
1375       * "package:com.my.app".
1376       * <p>
1377       * Output: Nothing.
1378       */
1379      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1380      public static final String ACTION_MANAGE_WRITE_SETTINGS =
1381              "android.settings.action.MANAGE_WRITE_SETTINGS";
1382  
1383      /**
1384       * Activity Action: Show screen for controlling app usage properties for an app.
1385       * Input: Intent's extra {@link android.content.Intent#EXTRA_PACKAGE_NAME} must specify the
1386       * application package name.
1387       * Output: Nothing.
1388       */
1389      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1390      public static final String ACTION_APP_USAGE_SETTINGS =
1391              "android.settings.action.APP_USAGE_SETTINGS";
1392  
1393      /**
1394       * Activity Action: Show screen of details about a particular application.
1395       * <p>
1396       * In some cases, a matching Activity may not exist, so ensure you
1397       * safeguard against this.
1398       * <p>
1399       * Input: The Intent's data URI specifies the application package name
1400       * to be shown, with the "package" scheme.  That is "package:com.my.app".
1401       * <p>
1402       * Output: Nothing.
1403       */
1404      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1405      public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
1406              "android.settings.APPLICATION_DETAILS_SETTINGS";
1407  
1408      /**
1409       * Activity Action: Show list of applications that have been running
1410       * foreground services (to the user "running in the background").
1411       * <p>
1412       * Input: Extras "packages" is a string array of package names.
1413       * <p>
1414       * Output: Nothing.
1415       * @hide
1416       */
1417      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1418      public static final String ACTION_FOREGROUND_SERVICES_SETTINGS =
1419              "android.settings.FOREGROUND_SERVICES_SETTINGS";
1420  
1421      /**
1422       * Activity Action: Show screen for controlling which apps can ignore battery optimizations.
1423       * <p>
1424       * Input: Nothing.
1425       * <p>
1426       * Output: Nothing.
1427       * <p>
1428       * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
1429       * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
1430       * already ignoring optimizations.  You can use
1431       * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you
1432       * on this list.
1433       */
1434      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1435      public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS =
1436              "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS";
1437  
1438      /**
1439       * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is,
1440       * put them on the whitelist of apps shown by
1441       * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}).  For an app to use this, it also
1442       * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}
1443       * permission.
1444       * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities
1445       * provided by the platform for applications to operate correctly in the various power
1446       * saving modes.  This is only for unusual applications that need to deeply control their own
1447       * execution, at the potential expense of the user's battery life.  Note that these applications
1448       * greatly run the risk of showing to the user as high power consumers on their device.</p>
1449       * <p>
1450       * Input: The Intent's data URI must specify the application package name
1451       * to be shown, with the "package" scheme.  That is "package:com.my.app".
1452       * <p>
1453       * Output: Nothing.
1454       * <p>
1455       * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
1456       * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
1457       * already ignoring optimizations.
1458       */
1459      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1460      public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS =
1461              "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
1462  
1463      /**
1464       * Activity Action: Open the advanced power usage details page of an associated app.
1465       * <p>
1466       * Input: Intent's data URI set with an application name, using the
1467       * "package" schema (like "package:com.my.app")
1468       * <p>
1469       * Output: Nothing.
1470       *
1471       * @hide
1472       */
1473      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1474      public static final String ACTION_VIEW_ADVANCED_POWER_USAGE_DETAIL =
1475              "android.settings.VIEW_ADVANCED_POWER_USAGE_DETAIL";
1476  
1477      /**
1478       * Activity Action: Show screen for controlling background data
1479       * restrictions for a particular application.
1480       * <p>
1481       * Input: Intent's data URI set with an application name, using the
1482       * "package" schema (like "package:com.my.app").
1483       *
1484       * <p>
1485       * Output: Nothing.
1486       * <p>
1487       * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus
1488       * ConnectivityManager#getRestrictBackgroundStatus()} to determine the
1489       * status of the background data restrictions for them.
1490       *
1491       * <p class="note">
1492       * In some cases, a matching Activity may not exist, so ensure you
1493       * safeguard against this.
1494       */
1495      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1496      public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS =
1497              "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS";
1498  
1499      /**
1500       * @hide
1501       * Activity Action: Show the "app ops" settings screen.
1502       * <p>
1503       * Input: Nothing.
1504       * <p>
1505       * Output: Nothing.
1506       */
1507      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1508      public static final String ACTION_APP_OPS_SETTINGS =
1509              "android.settings.APP_OPS_SETTINGS";
1510  
1511      /**
1512       * Activity Action: Show settings for system update functionality.
1513       * <p>
1514       * In some cases, a matching Activity may not exist, so ensure you
1515       * safeguard against this.
1516       * <p>
1517       * Input: Nothing.
1518       * <p>
1519       * Output: Nothing.
1520       *
1521       * @hide
1522       */
1523      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1524      public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
1525              "android.settings.SYSTEM_UPDATE_SETTINGS";
1526  
1527      /**
1528       * Activity Action: Show settings for managed profile settings.
1529       * <p>
1530       * In some cases, a matching Activity may not exist, so ensure you
1531       * safeguard against this.
1532       * <p>
1533       * Input: Nothing.
1534       * <p>
1535       * Output: Nothing.
1536       *
1537       * @hide
1538       */
1539      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1540      public static final String ACTION_MANAGED_PROFILE_SETTINGS =
1541              "android.settings.MANAGED_PROFILE_SETTINGS";
1542  
1543      /**
1544       * Activity Action: Show settings to allow configuration of sync settings.
1545       * <p>
1546       * In some cases, a matching Activity may not exist, so ensure you
1547       * safeguard against this.
1548       * <p>
1549       * The account types available to add via the add account button may be restricted by adding an
1550       * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
1551       * authorities. Only account types which can sync with that content provider will be offered to
1552       * the user.
1553       * <p>
1554       * Input: Nothing.
1555       * <p>
1556       * Output: Nothing.
1557       */
1558      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1559      public static final String ACTION_SYNC_SETTINGS =
1560              "android.settings.SYNC_SETTINGS";
1561  
1562      /**
1563       * Activity Action: Show add account screen for creating a new account.
1564       * <p>
1565       * In some cases, a matching Activity may not exist, so ensure you
1566       * safeguard against this.
1567       * <p>
1568       * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
1569       * extra to the Intent with one or more syncable content provider's authorities.  Only account
1570       * types which can sync with that content provider will be offered to the user.
1571       * <p>
1572       * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
1573       * Intent with one or more account types.
1574       * <p>
1575       * Input: Nothing.
1576       * <p>
1577       * Output: Nothing.
1578       */
1579      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1580      public static final String ACTION_ADD_ACCOUNT =
1581              "android.settings.ADD_ACCOUNT_SETTINGS";
1582  
1583      /**
1584       * Activity Action: Show settings for enabling or disabling data saver
1585       * <p></p>
1586       * In some cases, a matching Activity may not exist, so ensure you
1587       * safeguard against this.
1588       * <p>
1589       * Input: Nothing.
1590       * <p>
1591       * Output: Nothing.
1592       *
1593       * @hide
1594       */
1595      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1596      public static final String ACTION_DATA_SAVER_SETTINGS =
1597              "android.settings.DATA_SAVER_SETTINGS";
1598  
1599      /**
1600       * Activity Action: Show settings for selecting the network operator.
1601       * <p>
1602       * In some cases, a matching Activity may not exist, so ensure you
1603       * safeguard against this.
1604       * <p>
1605       * The subscription ID of the subscription for which available network operators should be
1606       * displayed may be optionally specified with {@link #EXTRA_SUB_ID}.
1607       * <p>
1608       * Input: Nothing.
1609       * <p>
1610       * Output: Nothing.
1611       */
1612      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1613      public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
1614              "android.settings.NETWORK_OPERATOR_SETTINGS";
1615  
1616      /**
1617       * Activity Action: Show settings for selection of 2G/3G.
1618       * <p>
1619       * In some cases, a matching Activity may not exist, so ensure you
1620       * safeguard against this.
1621       * <p>
1622       * Input: Nothing.
1623       * <p>
1624       * Output: Nothing.
1625       */
1626      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1627      public static final String ACTION_DATA_ROAMING_SETTINGS =
1628              "android.settings.DATA_ROAMING_SETTINGS";
1629  
1630      /**
1631       * Activity Action: Show settings for internal storage.
1632       * <p>
1633       * In some cases, a matching Activity may not exist, so ensure you
1634       * safeguard against this.
1635       * <p>
1636       * Input: Nothing.
1637       * <p>
1638       * Output: Nothing.
1639       */
1640      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1641      public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
1642              "android.settings.INTERNAL_STORAGE_SETTINGS";
1643      /**
1644       * Activity Action: Show settings for memory card storage.
1645       * <p>
1646       * In some cases, a matching Activity may not exist, so ensure you
1647       * safeguard against this.
1648       * <p>
1649       * Input: Nothing.
1650       * <p>
1651       * Output: Nothing.
1652       */
1653      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1654      public static final String ACTION_MEMORY_CARD_SETTINGS =
1655              "android.settings.MEMORY_CARD_SETTINGS";
1656  
1657      /**
1658       * Activity Action: Show settings for global search.
1659       * <p>
1660       * In some cases, a matching Activity may not exist, so ensure you
1661       * safeguard against this.
1662       * <p>
1663       * Input: Nothing.
1664       * <p>
1665       * Output: Nothing
1666       */
1667      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1668      public static final String ACTION_SEARCH_SETTINGS =
1669          "android.search.action.SEARCH_SETTINGS";
1670  
1671      /**
1672       * Activity Action: Show general device information settings (serial
1673       * number, software version, phone number, etc.).
1674       * <p>
1675       * In some cases, a matching Activity may not exist, so ensure you
1676       * safeguard against this.
1677       * <p>
1678       * Input: Nothing.
1679       * <p>
1680       * Output: Nothing
1681       */
1682      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1683      public static final String ACTION_DEVICE_INFO_SETTINGS =
1684          "android.settings.DEVICE_INFO_SETTINGS";
1685  
1686      /**
1687       * Activity Action: Show NFC settings.
1688       * <p>
1689       * This shows UI that allows NFC to be turned on or off.
1690       * <p>
1691       * In some cases, a matching Activity may not exist, so ensure you
1692       * safeguard against this.
1693       * <p>
1694       * Input: Nothing.
1695       * <p>
1696       * Output: Nothing
1697       * @see android.nfc.NfcAdapter#isEnabled()
1698       */
1699      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1700      public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
1701  
1702      /**
1703       * Activity Action: Show NFC Sharing settings.
1704       * <p>
1705       * This shows UI that allows NDEF Push (Android Beam) to be turned on or
1706       * off.
1707       * <p>
1708       * In some cases, a matching Activity may not exist, so ensure you
1709       * safeguard against this.
1710       * <p>
1711       * Input: Nothing.
1712       * <p>
1713       * Output: Nothing
1714       */
1715      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1716      public static final String ACTION_NFCSHARING_SETTINGS =
1717          "android.settings.NFCSHARING_SETTINGS";
1718  
1719      /**
1720       * Activity Action: Show NFC Tap & Pay settings
1721       * <p>
1722       * This shows UI that allows the user to configure Tap&Pay
1723       * settings.
1724       * <p>
1725       * In some cases, a matching Activity may not exist, so ensure you
1726       * safeguard against this.
1727       * <p>
1728       * Input: Nothing.
1729       * <p>
1730       * Output: Nothing
1731       */
1732      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1733      public static final String ACTION_NFC_PAYMENT_SETTINGS =
1734          "android.settings.NFC_PAYMENT_SETTINGS";
1735  
1736      /**
1737       * Activity Action: Show Daydream settings.
1738       * <p>
1739       * In some cases, a matching Activity may not exist, so ensure you
1740       * safeguard against this.
1741       * <p>
1742       * Input: Nothing.
1743       * <p>
1744       * Output: Nothing.
1745       * @see android.service.dreams.DreamService
1746       */
1747      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1748      public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
1749  
1750      /**
1751       * Activity Action: Show Communal settings.
1752       * <p>
1753       * In some cases, a matching Activity may not exist, so ensure you
1754       * safeguard against this.
1755       * <p>
1756       * Input: Nothing.
1757       * <p>
1758       * Output: Nothing.
1759       *
1760       * @hide
1761       */
1762      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1763      public static final String ACTION_COMMUNAL_SETTING = "android.settings.COMMUNAL_SETTINGS";
1764  
1765      /**
1766       * Activity Action: Show Notification assistant settings.
1767       * <p>
1768       * In some cases, a matching Activity may not exist, so ensure you
1769       * safeguard against this.
1770       * <p>
1771       * Input: Nothing.
1772       * <p>
1773       * Output: Nothing.
1774       * @see android.service.notification.NotificationAssistantService
1775       */
1776      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1777      public static final String ACTION_NOTIFICATION_ASSISTANT_SETTINGS =
1778              "android.settings.NOTIFICATION_ASSISTANT_SETTINGS";
1779  
1780      /**
1781       * Activity Action: Show Notification listener settings.
1782       * <p>
1783       * In some cases, a matching Activity may not exist, so ensure you
1784       * safeguard against this.
1785       * <p>
1786       * Input: Nothing.
1787       * <p>
1788       * Output: Nothing.
1789       * @see android.service.notification.NotificationListenerService
1790       */
1791      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1792      public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
1793              = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
1794  
1795      /**
1796       * Activity Action: Show notification listener permission settings page for app.
1797       * <p>
1798       * Users can grant and deny access to notifications for a {@link ComponentName} from here.
1799       * See
1800       * {@link android.app.NotificationManager#isNotificationListenerAccessGranted(ComponentName)}
1801       * for more details.
1802       * <p>
1803       * Input: The extra {@link #EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME} containing the name
1804       * of the component to grant or revoke notification listener access to.
1805       * <p>
1806       * Output: Nothing.
1807       */
1808      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1809      public static final String ACTION_NOTIFICATION_LISTENER_DETAIL_SETTINGS =
1810              "android.settings.NOTIFICATION_LISTENER_DETAIL_SETTINGS";
1811  
1812      /**
1813       * Activity Extra: What component name to show the notification listener permission
1814       * page for.
1815       * <p>
1816       * A string extra containing a {@link ComponentName}. This must be passed as an extra field to
1817       * {@link #ACTION_NOTIFICATION_LISTENER_DETAIL_SETTINGS}.
1818       */
1819      public static final String EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME =
1820              "android.provider.extra.NOTIFICATION_LISTENER_COMPONENT_NAME";
1821  
1822      /**
1823       * Activity Action: Show Do Not Disturb access settings.
1824       * <p>
1825       * Users can grant and deny access to Do Not Disturb configuration from here. Managed
1826       * profiles cannot grant Do Not Disturb access.
1827       * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1828       * details.
1829       * <p>
1830       * Input: Nothing.
1831       * <p>
1832       * Output: Nothing.
1833       *
1834       * <p class="note">
1835       * In some cases, a matching Activity may not exist, so ensure you
1836       * safeguard against this.
1837       */
1838      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1839      public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
1840              = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
1841  
1842      /**
1843       * Activity Action: Show do not disturb setting page for app.
1844       * <p>
1845       * Users can grant and deny access to Do Not Disturb configuration for an app from here.
1846       * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
1847       * details.
1848       * <p>
1849       * Input: Intent's data URI set with an application name, using the
1850       * "package" schema (like "package:com.my.app").
1851       * <p>
1852       * Output: Nothing.
1853       *
1854       * @hide
1855       */
1856      @SystemApi
1857      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1858      public static final String ACTION_NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS =
1859              "android.settings.NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS";
1860  
1861      /**
1862       * Activity Action: Show the automatic do not disturb rule listing page
1863       * <p>
1864       *     Users can add, enable, disable, and remove automatic do not disturb rules from this
1865       *     screen. See {@link NotificationManager#addAutomaticZenRule(AutomaticZenRule)} for more
1866       *     details.
1867       * </p>
1868       * <p>
1869       *     Input: Nothing
1870       *     Output: Nothing
1871       * </p>
1872       *
1873       */
1874      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1875      public static final String ACTION_CONDITION_PROVIDER_SETTINGS
1876              = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
1877  
1878      /**
1879       * Activity Action: Show settings for video captioning.
1880       * <p>
1881       * In some cases, a matching Activity may not exist, so ensure you safeguard
1882       * against this.
1883       * <p>
1884       * Input: Nothing.
1885       * <p>
1886       * Output: Nothing.
1887       */
1888      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1889      public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
1890  
1891      /**
1892       * Activity Action: Show the top level print settings.
1893       * <p>
1894       * In some cases, a matching Activity may not exist, so ensure you
1895       * safeguard against this.
1896       * <p>
1897       * Input: Nothing.
1898       * <p>
1899       * Output: Nothing.
1900       */
1901      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1902      public static final String ACTION_PRINT_SETTINGS =
1903              "android.settings.ACTION_PRINT_SETTINGS";
1904  
1905      /**
1906       * Activity Action: Show Zen Mode configuration settings.
1907       *
1908       * @hide
1909       */
1910      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1911      public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
1912  
1913      /**
1914       * Activity Action: Show Zen Mode visual effects configuration settings.
1915       *
1916       * @hide
1917       */
1918      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1919      public static final String ZEN_MODE_BLOCKED_EFFECTS_SETTINGS =
1920              "android.settings.ZEN_MODE_BLOCKED_EFFECTS_SETTINGS";
1921  
1922      /**
1923       * Activity Action: Show Zen Mode onboarding activity.
1924       *
1925       * @hide
1926       */
1927      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1928      public static final String ZEN_MODE_ONBOARDING = "android.settings.ZEN_MODE_ONBOARDING";
1929  
1930      /**
1931       * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings.
1932       */
1933      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1934      public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
1935              = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
1936  
1937      /**
1938       * Activity Action: Show Zen Mode automation configuration settings.
1939       *
1940       * @hide
1941       */
1942      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1943      public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
1944              = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
1945  
1946      /**
1947       * Activity Action: Modify do not disturb mode settings.
1948       * <p>
1949       * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1950       * <p>
1951       * This intent MUST be started using
1952       * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1953       * startVoiceActivity}.
1954       * <p>
1955       * Note: The Activity implementing this intent MUST verify that
1956       * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
1957       * returns true before modifying the setting.
1958       * <p>
1959       * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
1960       * how long the user wishes to avoid interruptions for. The optional
1961       * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
1962       * enabling or disabling do not disturb mode. If either extra is not included, the
1963       * user maybe asked to provide the value.
1964       * <p>
1965       * Output: Nothing.
1966       */
1967      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1968      public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
1969              "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
1970  
1971      /**
1972       * Activity Action: Show Zen Mode schedule rule configuration settings.
1973       *
1974       * @hide
1975       */
1976      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1977      public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
1978              = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
1979  
1980      /**
1981       * Activity Action: Show Zen Mode event rule configuration settings.
1982       *
1983       * @hide
1984       */
1985      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1986      public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
1987              = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
1988  
1989      /**
1990       * Activity Action: Show Zen Mode external rule configuration settings.
1991       *
1992       * @hide
1993       */
1994      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1995      public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
1996              = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
1997  
1998      /**
1999       * Activity Action: Show the regulatory information screen for the device.
2000       * <p>
2001       * In some cases, a matching Activity may not exist, so ensure you safeguard
2002       * against this.
2003       * <p>
2004       * Input: Nothing.
2005       * <p>
2006       * Output: Nothing.
2007       */
2008      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2009      public static final String
2010              ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
2011  
2012      /**
2013       * Activity Action: Show Device Name Settings.
2014       * <p>
2015       * In some cases, a matching Activity may not exist, so ensure you safeguard
2016       * against this.
2017       *
2018       * @hide
2019       */
2020      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2021      public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
2022  
2023      /**
2024       * Activity Action: Show pairing settings.
2025       * <p>
2026       * In some cases, a matching Activity may not exist, so ensure you safeguard
2027       * against this.
2028       *
2029       * @hide
2030       */
2031      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2032      public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
2033  
2034      /**
2035       * Activity Action: Show battery saver settings.
2036       * <p>
2037       * In some cases, a matching Activity may not exist, so ensure you safeguard
2038       * against this.
2039       */
2040      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2041      public static final String ACTION_BATTERY_SAVER_SETTINGS
2042              = "android.settings.BATTERY_SAVER_SETTINGS";
2043  
2044      /**
2045       * Activity Action: Modify Battery Saver mode setting using a voice command.
2046       * <p>
2047       * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
2048       * <p>
2049       * This intent MUST be started using
2050       * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
2051       * startVoiceActivity}.
2052       * <p>
2053       * Note: The activity implementing this intent MUST verify that
2054       * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
2055       * modifying the setting.
2056       * <p>
2057       * Input: To tell which state batter saver mode should be set to, add the
2058       * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
2059       * If the extra is not included, no changes will be made.
2060       * <p>
2061       * Output: Nothing.
2062       */
2063      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2064      public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
2065              "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
2066  
2067      /**
2068       * Activity Action: Show Home selection settings. If there are multiple activities
2069       * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
2070       * to pick your preferred activity.
2071       */
2072      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2073      public static final String ACTION_HOME_SETTINGS
2074              = "android.settings.HOME_SETTINGS";
2075  
2076      /**
2077       * Activity Action: Show Default apps settings.
2078       * <p>
2079       * In some cases, a matching Activity may not exist, so ensure you
2080       * safeguard against this.
2081       * <p>
2082       * Input: Nothing.
2083       * <p>
2084       * Output: Nothing.
2085       */
2086      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2087      public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS
2088              = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS";
2089  
2090      /**
2091       * Activity Action: Show More default apps settings.
2092       * <p>
2093       * If a Settings activity handles this intent action, a "More defaults" entry will be shown in
2094       * the Default apps settings, and clicking it will launch that activity.
2095       * <p>
2096       * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
2097       * <p>
2098       * Input: Nothing.
2099       * <p>
2100       * Output: Nothing.
2101       *
2102       * @hide
2103       */
2104      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2105      @SystemApi
2106      public static final String ACTION_MANAGE_MORE_DEFAULT_APPS_SETTINGS =
2107              "android.settings.MANAGE_MORE_DEFAULT_APPS_SETTINGS";
2108  
2109      /**
2110       * Activity Action: Show app screen size list settings for user to override app aspect
2111       * ratio.
2112       * <p>
2113       * In some cases, a matching Activity may not exist, so ensure you
2114       * safeguard against this.
2115       * <p>
2116       * Can include the following extra {@link android.content.Intent#EXTRA_PACKAGE_NAME} specifying
2117       * the name of the package to scroll to in the page.
2118       * @hide
2119       */
2120      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2121      public static final String ACTION_MANAGE_USER_ASPECT_RATIO_SETTINGS =
2122              "android.settings.MANAGE_USER_ASPECT_RATIO_SETTINGS";
2123  
2124      /**
2125       * Activity Action: Show notification settings.
2126       *
2127       * @hide
2128       */
2129      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2130      public static final String ACTION_NOTIFICATION_SETTINGS
2131              = "android.settings.NOTIFICATION_SETTINGS";
2132  
2133      /**
2134       * Activity Action: Show conversation settings.
2135       *
2136       * @hide
2137       */
2138      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2139      public static final String ACTION_CONVERSATION_SETTINGS
2140              = "android.settings.CONVERSATION_SETTINGS";
2141  
2142      /**
2143       * Activity Action: Show notification history screen.
2144       *
2145       * @hide
2146       */
2147      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2148      public static final String ACTION_NOTIFICATION_HISTORY
2149              = "android.settings.NOTIFICATION_HISTORY";
2150  
2151      /**
2152       * Activity Action: Show app listing settings, filtered by those that send notifications.
2153       *
2154       */
2155      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2156      public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS =
2157              "android.settings.ALL_APPS_NOTIFICATION_SETTINGS";
2158  
2159      /**
2160       * Activity Action: Show app settings specifically for sending notifications. Same as
2161       * ALL_APPS_NOTIFICATION_SETTINGS but meant for internal use.
2162       * @hide
2163       */
2164      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2165      public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS_FOR_REVIEW =
2166              "android.settings.ALL_APPS_NOTIFICATION_SETTINGS_FOR_REVIEW";
2167  
2168      /**
2169       * Activity Action: Show notification settings for a single app.
2170       * <p>
2171       *     Input: {@link #EXTRA_APP_PACKAGE}, the package to display.
2172       * <p>
2173       * Output: Nothing.
2174       */
2175      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2176      public static final String ACTION_APP_NOTIFICATION_SETTINGS
2177              = "android.settings.APP_NOTIFICATION_SETTINGS";
2178  
2179      /**
2180       * Activity Action: Show notification settings for a single {@link NotificationChannel}.
2181       * <p>
2182       *     Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display.
2183       *     Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display.
2184       * <p>
2185       * Output: Nothing.
2186       */
2187      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2188      public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS
2189              = "android.settings.CHANNEL_NOTIFICATION_SETTINGS";
2190  
2191      /**
2192       * Activity Action: Show notification bubble settings for a single app.
2193       * See {@link NotificationManager#getBubblePreference()}.
2194       * <p>
2195       *     Input: {@link #EXTRA_APP_PACKAGE}, the package to display.
2196       * <p>
2197       * Output: Nothing.
2198       */
2199      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2200      public static final String ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS
2201              = "android.settings.APP_NOTIFICATION_BUBBLE_SETTINGS";
2202  
2203      /**
2204       * Intent Extra: The value of {@link android.app.settings.SettingsEnums#EntryPointType} for
2205       * settings metrics that logs the entry point about physical keyboard settings.
2206       * <p>
2207       * This must be passed as an extra field to the {@link #ACTION_HARD_KEYBOARD_SETTINGS}.
2208       * @hide
2209       */
2210      public static final String EXTRA_ENTRYPOINT =
2211              "com.android.settings.inputmethod.EXTRA_ENTRYPOINT";
2212  
2213      /**
2214       * Activity Extra: The package owner of the notification channel settings to display.
2215       * <p>
2216       * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
2217       */
2218      public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE";
2219  
2220      /**
2221       * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings
2222       * to display.
2223       * <p>
2224       * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}.
2225       */
2226      public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID";
2227  
2228      /**
2229       * Activity Extra: The {@link NotificationChannel#getConversationId()} of the notification
2230       * conversation settings to display.
2231       * <p>
2232       * This is an optional extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. If
2233       * included the system will first look up notification settings by channel and conversation id,
2234       * and will fall back to channel id if a specialized channel for this conversation doesn't
2235       * exist, similar to {@link NotificationManager#getNotificationChannel(String, String)}.
2236       */
2237      public static final String EXTRA_CONVERSATION_ID = "android.provider.extra.CONVERSATION_ID";
2238  
2239      /**
2240       * Activity Extra: An {@code Arraylist<String>} of {@link NotificationChannel} field names to
2241       * show on the Settings UI.
2242       *
2243       * <p>
2244       * This is an optional extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. If
2245       * included the system will filter out any Settings that doesn't appear in this list that
2246       * otherwise would display.
2247       */
2248      public static final String EXTRA_CHANNEL_FILTER_LIST
2249              = "android.provider.extra.CHANNEL_FILTER_LIST";
2250  
2251      /**
2252       * Activity Action: Show notification redaction settings.
2253       *
2254       * @hide
2255       */
2256      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2257      public static final String ACTION_APP_NOTIFICATION_REDACTION
2258              = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
2259  
2260      /** @hide */
2261      @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
2262      public static final String EXTRA_APP_UID = "app_uid";
2263  
2264      /**
2265       * Activity Action: Show power menu settings.
2266       *
2267       * @hide
2268       */
2269      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2270      public static final String ACTION_POWER_MENU_SETTINGS =
2271              "android.settings.ACTION_POWER_MENU_SETTINGS";
2272  
2273      /**
2274       * Activity Action: Show controls settings.
2275       *
2276       * @hide
2277       */
2278      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2279      public static final String ACTION_DEVICE_CONTROLS_SETTINGS =
2280              "android.settings.ACTION_DEVICE_CONTROLS_SETTINGS";
2281  
2282      /**
2283       * Activity Action: Show media control settings
2284       *
2285       * @hide
2286       */
2287      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2288      public static final String ACTION_MEDIA_CONTROLS_SETTINGS =
2289              "android.settings.ACTION_MEDIA_CONTROLS_SETTINGS";
2290  
2291      /**
2292       * Activity Action: Show a dialog with disabled by policy message.
2293       * <p> If an user action is disabled by policy, this dialog can be triggered to let
2294       * the user know about this.
2295       * <p>
2296       * Input: {@link Intent#EXTRA_USER}: The user of the admin.
2297       * <p>
2298       * Output: Nothing.
2299       *
2300       * @hide
2301       */
2302      // Intent#EXTRA_USER_ID can also be used
2303      @SystemApi
2304      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2305      public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS =
2306              "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
2307  
2308      /**
2309       * Intent extra: The id of a setting restricted by supervisors.
2310       * <p>
2311       * Type: Integer with a value from the one of the SUPERVISOR_VERIFICATION_* constants below.
2312       * <ul>
2313       * <li>{@see #SUPERVISOR_VERIFICATION_SETTING_UNKNOWN}
2314       * <li>{@see #SUPERVISOR_VERIFICATION_SETTING_BIOMETRICS}
2315       * </ul>
2316       * </p>
2317       */
2318      public static final String EXTRA_SUPERVISOR_RESTRICTED_SETTING_KEY =
2319              "android.provider.extra.SUPERVISOR_RESTRICTED_SETTING_KEY";
2320  
2321      /**
2322       * The unknown setting can usually be ignored and is used for compatibility with future
2323       * supervisor settings.
2324       */
2325      public static final int SUPERVISOR_VERIFICATION_SETTING_UNKNOWN = 0;
2326  
2327      /**
2328       * Settings for supervisors to control what kinds of biometric sensors, such a face and
2329       * fingerprint scanners, can be used on the device.
2330       */
2331      public static final int SUPERVISOR_VERIFICATION_SETTING_BIOMETRICS = 1;
2332  
2333      /**
2334       * Keys for {@link #EXTRA_SUPERVISOR_RESTRICTED_SETTING_KEY}.
2335       * @hide
2336       */
2337      @Retention(RetentionPolicy.SOURCE)
2338      @IntDef(prefix = { "SUPERVISOR_VERIFICATION_SETTING_" }, value = {
2339              SUPERVISOR_VERIFICATION_SETTING_UNKNOWN,
2340              SUPERVISOR_VERIFICATION_SETTING_BIOMETRICS,
2341      })
2342      public @interface SupervisorVerificationSetting {}
2343  
2344      /**
2345       * Activity action: Launch UI to manage a setting restricted by supervisors.
2346       * <p>
2347       * Input: {@link #EXTRA_SUPERVISOR_RESTRICTED_SETTING_KEY} specifies what setting to open.
2348       * </p>
2349       * <p>
2350       * Output: Nothing.
2351       * </p>
2352       */
2353      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2354      public static final String ACTION_MANAGE_SUPERVISOR_RESTRICTED_SETTING =
2355              "android.settings.MANAGE_SUPERVISOR_RESTRICTED_SETTING";
2356  
2357      /**
2358       * Activity Action: Show a dialog for remote bugreport flow.
2359       * <p>
2360       * Input: Nothing.
2361       * <p>
2362       * Output: Nothing.
2363       *
2364       * @hide
2365       */
2366      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2367      public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG
2368              = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG";
2369  
2370      /**
2371       * Activity Action: Show VR listener settings.
2372       * <p>
2373       * Input: Nothing.
2374       * <p>
2375       * Output: Nothing.
2376       *
2377       * @see android.service.vr.VrListenerService
2378       */
2379      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2380      public static final String ACTION_VR_LISTENER_SETTINGS
2381              = "android.settings.VR_LISTENER_SETTINGS";
2382  
2383      /**
2384       * Activity Action: Show Picture-in-picture settings.
2385       * <p>
2386       * Input: Nothing.
2387       * <p>
2388       * Output: Nothing.
2389       *
2390       * @hide
2391       */
2392      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2393      public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS
2394              = "android.settings.PICTURE_IN_PICTURE_SETTINGS";
2395  
2396      /**
2397       * Activity Action: Show Storage Manager settings.
2398       * <p>
2399       * Input: Nothing.
2400       * <p>
2401       * Output: Nothing.
2402       *
2403       * @hide
2404       */
2405      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2406      public static final String ACTION_STORAGE_MANAGER_SETTINGS
2407              = "android.settings.STORAGE_MANAGER_SETTINGS";
2408  
2409      /**
2410       * Activity Action: Allows user to select current webview implementation.
2411       * <p>
2412       * Input: Nothing.
2413       * <p>
2414       * Output: Nothing.
2415       * <p class="note">
2416       * In some cases, a matching Activity may not exist, so ensure you
2417       * safeguard against this.
2418  
2419       */
2420      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2421      public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS";
2422  
2423      /**
2424       * Activity Action: Show enterprise privacy section.
2425       * <p>
2426       * Input: Nothing.
2427       * <p>
2428       * Output: Nothing.
2429       * @hide
2430       */
2431      @SystemApi
2432      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2433      public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS
2434              = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
2435  
2436      /**
2437       * Activity Action: Show Work Policy info.
2438       * DPC apps can implement an activity that handles this intent in order to show device policies
2439       * associated with the work profile or managed device.
2440       * <p>
2441       * Input: Nothing.
2442       * <p>
2443       * Output: Nothing.
2444       *
2445       */
2446      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2447      public static final String ACTION_SHOW_WORK_POLICY_INFO =
2448              "android.settings.SHOW_WORK_POLICY_INFO";
2449  
2450      /**
2451       * Activity Action: Show screen that let user select its Autofill Service.
2452       * <p>
2453       * Input: Intent's data URI set with an application name, using the
2454       * "package" schema (like "package:com.my.app").
2455       *
2456       * <p>
2457       * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging
2458       * to the caller package.
2459       *
2460       * <p>
2461       * <b>NOTE: </b> Applications should call
2462       * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and
2463       * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action
2464       * to start an activity if they return {@code false} and {@code true} respectively.
2465       */
2466      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2467      public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE =
2468              "android.settings.REQUEST_SET_AUTOFILL_SERVICE";
2469  
2470      /**
2471       * Activity Action: Show screen for controlling the Quick Access Wallet.
2472       * <p>
2473       * In some cases, a matching Activity may not exist, so ensure you
2474       * safeguard against this.
2475       * <p>
2476       * Input: Nothing.
2477       * <p>
2478       * Output: Nothing.
2479       */
2480      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2481      public static final String ACTION_QUICK_ACCESS_WALLET_SETTINGS =
2482              "android.settings.QUICK_ACCESS_WALLET_SETTINGS";
2483  
2484      /**
2485       * Activity Action: Show screen for controlling which apps have access on volume directories.
2486       * <p>
2487       * Input: Nothing.
2488       * <p>
2489       * Output: Nothing.
2490       * <p>
2491       * Applications typically use this action to ask the user to revert the "Do not ask again"
2492       * status of directory access requests made by
2493       * {@link android.os.storage.StorageVolume#createAccessIntent(String)}.
2494       * @deprecated use {@link #ACTION_APPLICATION_DETAILS_SETTINGS} to manage storage permissions
2495       *             for a specific application
2496       */
2497      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2498      @Deprecated
2499      public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS =
2500              "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS";
2501  
2502  
2503      /**
2504       * Activity Action: Show screen that let user select enable (or disable) Content Capture.
2505       * <p>
2506       * Input: Nothing.
2507       *
2508       * <p>
2509       * Output: Nothing
2510       *
2511       * @hide
2512       */
2513      @SystemApi
2514      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2515      public static final String ACTION_REQUEST_ENABLE_CONTENT_CAPTURE =
2516              "android.settings.REQUEST_ENABLE_CONTENT_CAPTURE";
2517  
2518      /**
2519       * Activity Action: Show screen that let user manage how Android handles URL resolution.
2520       * <p>
2521       * Input: Nothing.
2522       * <p>
2523       * Output: Nothing
2524       *
2525       * @hide
2526       */
2527      @SystemApi
2528      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2529      public static final String ACTION_MANAGE_DOMAIN_URLS = "android.settings.MANAGE_DOMAIN_URLS";
2530  
2531      /**
2532       * Activity Action: Show screen that let user select enable (or disable) tethering.
2533       * <p>
2534       * Input: Nothing.
2535       * <p>
2536       * Output: Nothing
2537       *
2538       * @hide
2539       */
2540      @SystemApi
2541      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2542      public static final String ACTION_TETHER_SETTINGS = "android.settings.TETHER_SETTINGS";
2543  
2544      /**
2545       * Activity Action: Show screen that lets user configure wifi tethering.
2546       * <p>
2547       * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
2548       * <p>
2549       * Input: Nothing
2550       * <p>
2551       * Output: Nothing
2552       *
2553       * @hide
2554       */
2555      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2556      public static final String ACTION_WIFI_TETHER_SETTING =
2557              "com.android.settings.WIFI_TETHER_SETTINGS";
2558  
2559      /**
2560       * Broadcast to trigger notification of asking user to enable MMS.
2561       * Need to specify {@link #EXTRA_ENABLE_MMS_DATA_REQUEST_REASON} and {@link #EXTRA_SUB_ID}.
2562       *
2563       * @hide
2564       */
2565      @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
2566      public static final String ACTION_ENABLE_MMS_DATA_REQUEST =
2567              "android.settings.ENABLE_MMS_DATA_REQUEST";
2568  
2569      /**
2570       * Shows restrict settings dialog when settings is blocked.
2571       *
2572       * @hide
2573       */
2574      @SystemApi
2575      @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
2576      public static final String ACTION_SHOW_RESTRICTED_SETTING_DIALOG =
2577              "android.settings.SHOW_RESTRICTED_SETTING_DIALOG";
2578  
2579      /**
2580       * Integer value that specifies the reason triggering enable MMS data notification.
2581       * This must be passed as an extra field to the {@link #ACTION_ENABLE_MMS_DATA_REQUEST}.
2582       * Extra with value of EnableMmsDataReason interface.
2583       * @hide
2584       */
2585      public static final String EXTRA_ENABLE_MMS_DATA_REQUEST_REASON =
2586              "android.settings.extra.ENABLE_MMS_DATA_REQUEST_REASON";
2587  
2588      /** @hide */
2589      @Retention(RetentionPolicy.SOURCE)
2590      @IntDef(prefix = { "ENABLE_MMS_DATA_REQUEST_REASON_" }, value = {
2591              ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS,
2592              ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS,
2593      })
2594      public @interface EnableMmsDataReason{}
2595  
2596      /**
2597       * Requesting to enable MMS data because there's an incoming MMS.
2598       * @hide
2599       */
2600      public static final int ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS = 0;
2601  
2602      /**
2603       * Requesting to enable MMS data because user is sending MMS.
2604       * @hide
2605       */
2606      public static final int ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS = 1;
2607  
2608      /**
2609       * Activity Action: Show screen of a cellular subscription and highlight the
2610       * "enable MMS" toggle.
2611       * <p>
2612       * Input: {@link #EXTRA_SUB_ID}: Sub ID of the subscription.
2613       * <p>
2614       * Output: Nothing
2615       *
2616       * @hide
2617       */
2618      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2619      public static final String ACTION_MMS_MESSAGE_SETTING = "android.settings.MMS_MESSAGE_SETTING";
2620  
2621      /**
2622       * Activity Action: Show a screen of bedtime settings, which is provided by the wellbeing app.
2623       * <p>
2624       * The handler of this intent action may not exist.
2625       * <p>
2626       * To start an activity with this intent, apps should set the wellbeing package explicitly in
2627       * the intent together with this action. The wellbeing package is defined in
2628       * {@code com.android.internal.R.string.config_systemWellbeing}.
2629       * <p>
2630       * Output: Nothing
2631       *
2632       * @hide
2633       */
2634      @SystemApi
2635      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
2636      public static final String ACTION_BEDTIME_SETTINGS = "android.settings.BEDTIME_SETTINGS";
2637  
2638      // End of Intent actions for Settings
2639  
2640      /**
2641       * @hide - Private call() method on SettingsProvider to read from 'system' table.
2642       */
2643      public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
2644  
2645      /**
2646       * @hide - Private call() method on SettingsProvider to read from 'secure' table.
2647       */
2648      public static final String CALL_METHOD_GET_SECURE = "GET_secure";
2649  
2650      /**
2651       * @hide - Private call() method on SettingsProvider to read from 'global' table.
2652       */
2653      public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
2654  
2655      /**
2656       * @hide - Private call() method on SettingsProvider to read from 'config' table.
2657       */
2658      public static final String CALL_METHOD_GET_CONFIG = "GET_config";
2659  
2660      /**
2661       * @hide - Specifies that the caller of the fast-path call()-based flow tracks
2662       * the settings generation in order to cache values locally. If this key is
2663       * mapped to a <code>null</code> string extra in the request bundle, the response
2664       * bundle will contain the same key mapped to a parcelable extra which would be
2665       * an {@link android.util.MemoryIntArray}. The response will also contain an
2666       * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the
2667       * index in the array clients should use to lookup the generation. For efficiency
2668       * the caller should request the generation tracking memory array only if it
2669       * doesn't already have it.
2670       *
2671       * @see #CALL_METHOD_GENERATION_INDEX_KEY
2672       */
2673      public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation";
2674  
2675      /**
2676       * @hide Key with the location in the {@link android.util.MemoryIntArray} where
2677       * to look up the generation id of the backing table. The value is an integer.
2678       *
2679       * @see #CALL_METHOD_TRACK_GENERATION_KEY
2680       */
2681      public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index";
2682  
2683      /**
2684       * @hide Key with the settings table generation. The value is an integer.
2685       *
2686       * @see #CALL_METHOD_TRACK_GENERATION_KEY
2687       */
2688      public static final String CALL_METHOD_GENERATION_KEY = "_generation";
2689  
2690      /**
2691       * @hide - User handle argument extra to the fast-path call()-based requests
2692       */
2693      public static final String CALL_METHOD_USER_KEY = "_user";
2694  
2695      /**
2696       * @hide - Boolean argument extra to the fast-path call()-based requests
2697       */
2698      public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default";
2699  
2700      /**
2701       * @hide - User handle argument extra to the fast-path call()-based requests
2702       */
2703      public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode";
2704  
2705      /**
2706       * @hide - String argument extra to the fast-path call()-based requests
2707       */
2708      public static final String CALL_METHOD_TAG_KEY = "_tag";
2709  
2710      /**
2711       * @hide - String argument extra to the fast-path call()-based requests
2712       */
2713      public static final String CALL_METHOD_PREFIX_KEY = "_prefix";
2714  
2715      /**
2716       * @hide - String argument extra to the fast-path call()-based requests
2717       */
2718      public static final String CALL_METHOD_SYNC_DISABLED_MODE_KEY = "_disabled_mode";
2719  
2720      /**
2721       * @hide - RemoteCallback monitor callback argument extra to the fast-path call()-based requests
2722       */
2723      public static final String CALL_METHOD_MONITOR_CALLBACK_KEY = "_monitor_callback_key";
2724  
2725      /**
2726       * @hide - String argument extra to the fast-path call()-based requests
2727       */
2728      public static final String CALL_METHOD_FLAGS_KEY = "_flags";
2729  
2730      /**
2731       * @hide - String argument extra to the fast-path call()-based requests
2732       */
2733      public static final String CALL_METHOD_OVERRIDEABLE_BY_RESTORE_KEY = "_overrideable_by_restore";
2734  
2735      /** @hide - Private call() method to write to 'system' table */
2736      public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
2737  
2738      /** @hide - Private call() method to write to 'secure' table */
2739      public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
2740  
2741      /** @hide - Private call() method to write to 'global' table */
2742      public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
2743  
2744      /** @hide - Private call() method to write to 'configuration' table */
2745      public static final String CALL_METHOD_PUT_CONFIG = "PUT_config";
2746  
2747      /** @hide - Private call() method to write to and delete from the 'configuration' table */
2748      public static final String CALL_METHOD_SET_ALL_CONFIG = "SET_ALL_config";
2749  
2750      /** @hide - Private call() method to delete from the 'system' table */
2751      public static final String CALL_METHOD_DELETE_SYSTEM = "DELETE_system";
2752  
2753      /** @hide - Private call() method to delete from the 'secure' table */
2754      public static final String CALL_METHOD_DELETE_SECURE = "DELETE_secure";
2755  
2756      /** @hide - Private call() method to delete from the 'global' table */
2757      public static final String CALL_METHOD_DELETE_GLOBAL = "DELETE_global";
2758  
2759      /** @hide - Private call() method to reset to defaults the 'configuration' table */
2760      public static final String CALL_METHOD_DELETE_CONFIG = "DELETE_config";
2761  
2762      /** @hide - Private call() method to reset to defaults the 'secure' table */
2763      public static final String CALL_METHOD_RESET_SECURE = "RESET_secure";
2764  
2765      /** @hide - Private call() method to reset to defaults the 'global' table */
2766      public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global";
2767  
2768      /** @hide - Private call() method to reset to defaults the 'configuration' table */
2769      public static final String CALL_METHOD_RESET_CONFIG = "RESET_config";
2770  
2771      /** @hide - Private call() method to query the 'system' table */
2772      public static final String CALL_METHOD_LIST_SYSTEM = "LIST_system";
2773  
2774      /** @hide - Private call() method to query the 'secure' table */
2775      public static final String CALL_METHOD_LIST_SECURE = "LIST_secure";
2776  
2777      /** @hide - Private call() method to query the 'global' table */
2778      public static final String CALL_METHOD_LIST_GLOBAL = "LIST_global";
2779  
2780      /** @hide - Private call() method to reset to defaults the 'configuration' table */
2781      public static final String CALL_METHOD_LIST_CONFIG = "LIST_config";
2782  
2783      /** @hide - Private call() method to disable / re-enable syncs to the 'configuration' table */
2784      public static final String CALL_METHOD_SET_SYNC_DISABLED_MODE_CONFIG =
2785              "SET_SYNC_DISABLED_MODE_config";
2786  
2787      /**
2788       * @hide - Private call() method to return the current mode of sync disabling for the
2789       * 'configuration' table
2790       */
2791      public static final String CALL_METHOD_GET_SYNC_DISABLED_MODE_CONFIG =
2792              "GET_SYNC_DISABLED_MODE_config";
2793  
2794      /** @hide - Private call() method to register monitor callback for 'configuration' table */
2795      public static final String CALL_METHOD_REGISTER_MONITOR_CALLBACK_CONFIG =
2796              "REGISTER_MONITOR_CALLBACK_config";
2797  
2798      /** @hide - Private call() method to unregister monitor callback for 'configuration' table */
2799      public static final String CALL_METHOD_UNREGISTER_MONITOR_CALLBACK_CONFIG =
2800              "UNREGISTER_MONITOR_CALLBACK_config";
2801  
2802      /** @hide - String argument extra to the config monitor callback */
2803      public static final String EXTRA_MONITOR_CALLBACK_TYPE = "monitor_callback_type";
2804  
2805      /** @hide - String argument extra to the config monitor callback */
2806      public static final String EXTRA_ACCESS_CALLBACK = "access_callback";
2807  
2808      /** @hide - String argument extra to the config monitor callback */
2809      public static final String EXTRA_NAMESPACE_UPDATED_CALLBACK =
2810              "namespace_updated_callback";
2811  
2812      /** @hide - String argument extra to the config monitor callback */
2813      public static final String EXTRA_NAMESPACE = "namespace";
2814  
2815      /** @hide - String argument extra to the config monitor callback */
2816      public static final String EXTRA_CALLING_PACKAGE = "calling_package";
2817  
2818      /**
2819       * Activity Extra: Limit available options in launched activity based on the given authority.
2820       * <p>
2821       * This can be passed as an extra field in an Activity Intent with one or more syncable content
2822       * provider's authorities as a String[]. This field is used by some intents to alter the
2823       * behavior of the called activity.
2824       * <p>
2825       * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
2826       * on the authority given.
2827       */
2828      public static final String EXTRA_AUTHORITIES = "authorities";
2829  
2830      /**
2831       * Activity Extra: Limit available options in launched activity based on the given account
2832       * types.
2833       * <p>
2834       * This can be passed as an extra field in an Activity Intent with one or more account types
2835       * as a String[]. This field is used by some intents to alter the behavior of the called
2836       * activity.
2837       * <p>
2838       * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
2839       * list.
2840       */
2841      public static final String EXTRA_ACCOUNT_TYPES = "account_types";
2842  
2843      public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
2844  
2845      /**
2846       * Activity Extra: The device identifier to act upon.
2847       * <p>
2848       * This can be passed as an extra field in an Activity Intent with a single
2849       * InputDeviceIdentifier. This field is used by some activities to jump straight into the
2850       * settings for the given device.
2851       * <p>
2852       * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
2853       * dialog for the given device.
2854       * @hide
2855       */
2856      public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
2857  
2858      /**
2859       * Activity Extra: Enable or disable Airplane Mode.
2860       * <p>
2861       * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
2862       * intent as a boolean to indicate if it should be enabled.
2863       */
2864      public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
2865  
2866      /**
2867       * Activity Extra: Enable or disable Battery saver mode.
2868       * <p>
2869       * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
2870       * intent as a boolean to indicate if it should be enabled.
2871       */
2872      public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
2873              "android.settings.extra.battery_saver_mode_enabled";
2874  
2875      /**
2876       * Activity Extra: Enable or disable Do Not Disturb mode.
2877       * <p>
2878       * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
2879       * intent as a boolean to indicate if it should be enabled.
2880       */
2881      public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
2882              "android.settings.extra.do_not_disturb_mode_enabled";
2883  
2884      /**
2885       * Activity Extra: How many minutes to enable do not disturb mode for.
2886       * <p>
2887       * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
2888       * intent to indicate how long do not disturb mode should be enabled for.
2889       */
2890      public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
2891              "android.settings.extra.do_not_disturb_mode_minutes";
2892  
2893      /**
2894       * Reset mode: reset to defaults only settings changed by the
2895       * calling package. If there is a default set the setting
2896       * will be set to it, otherwise the setting will be deleted.
2897       * This is the only type of reset available to non-system clients.
2898       * @hide
2899       */
2900      @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
2901      @TestApi
2902      @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
2903      public static final int RESET_MODE_PACKAGE_DEFAULTS = 1;
2904  
2905      /**
2906       * Reset mode: reset all settings set by untrusted packages, which is
2907       * packages that aren't a part of the system, to the current defaults.
2908       * If there is a default set the setting will be set to it, otherwise
2909       * the setting will be deleted. This mode is only available to the system.
2910       * @hide
2911       */
2912      @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
2913      public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2;
2914  
2915      /**
2916       * Reset mode: delete all settings set by untrusted packages, which is
2917       * packages that aren't a part of the system. If a setting is set by an
2918       * untrusted package it will be deleted if its default is not provided
2919       * by the system, otherwise the setting will be set to its default.
2920       * This mode is only available to the system.
2921       * @hide
2922       */
2923      @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
2924      public static final int RESET_MODE_UNTRUSTED_CHANGES = 3;
2925  
2926      /**
2927       * Reset mode: reset all settings to defaults specified by trusted
2928       * packages, which is packages that are a part of the system, and
2929       * delete all settings set by untrusted packages. If a setting has
2930       * a default set by a system package it will be set to the default,
2931       * otherwise the setting will be deleted. This mode is only available
2932       * to the system.
2933       * @hide
2934       */
2935      @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
2936      public static final int RESET_MODE_TRUSTED_DEFAULTS = 4;
2937  
2938      /** @hide */
2939      @Retention(RetentionPolicy.SOURCE)
2940      @IntDef(prefix = { "RESET_MODE_" }, value = {
2941              RESET_MODE_PACKAGE_DEFAULTS,
2942              RESET_MODE_UNTRUSTED_DEFAULTS,
2943              RESET_MODE_UNTRUSTED_CHANGES,
2944              RESET_MODE_TRUSTED_DEFAULTS
2945      })
2946      public @interface ResetMode{}
2947  
2948      /**
2949       * Activity Extra: Number of certificates
2950       * <p>
2951       * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO}
2952       * intent to indicate the number of certificates
2953       * @hide
2954       */
2955      public static final String EXTRA_NUMBER_OF_CERTIFICATES =
2956              "android.settings.extra.number_of_certificates";
2957  
2958      private static final String SYSTEM_PACKAGE_NAME = "android";
2959  
2960      public static final String AUTHORITY = "settings";
2961  
2962      private static final String TAG = "Settings";
2963      private static final boolean LOCAL_LOGV = false;
2964  
2965      // Used in system server calling uid workaround in call()
2966      private static boolean sInSystemServer = false;
2967      private static final Object sInSystemServerLock = new Object();
2968  
2969      /** @hide */
setInSystemServer()2970      public static void setInSystemServer() {
2971          synchronized (sInSystemServerLock) {
2972              sInSystemServer = true;
2973          }
2974      }
2975  
2976      /** @hide */
isInSystemServer()2977      public static boolean isInSystemServer() {
2978          synchronized (sInSystemServerLock) {
2979              return sInSystemServer;
2980          }
2981      }
2982  
2983      public static class SettingNotFoundException extends AndroidException {
SettingNotFoundException(String msg)2984          public SettingNotFoundException(String msg) {
2985              super(msg);
2986          }
2987      }
2988  
2989      /**
2990       * Common base for tables of name/value settings.
2991       */
2992      public static class NameValueTable implements BaseColumns {
2993          public static final String NAME = "name";
2994          public static final String VALUE = "value";
2995          // A flag indicating whether the current value of a setting should be preserved during
2996          // restore.
2997          /** @hide */
2998          public static final String IS_PRESERVED_IN_RESTORE = "is_preserved_in_restore";
2999  
putString(ContentResolver resolver, Uri uri, String name, String value)3000          protected static boolean putString(ContentResolver resolver, Uri uri,
3001                  String name, String value) {
3002              // The database will take care of replacing duplicates.
3003              try {
3004                  ContentValues values = new ContentValues();
3005                  values.put(NAME, name);
3006                  values.put(VALUE, value);
3007                  resolver.insert(uri, values);
3008                  return true;
3009              } catch (SQLException e) {
3010                  Log.w(TAG, "Can't set key " + name + " in " + uri, e);
3011                  return false;
3012              }
3013          }
3014  
getUriFor(Uri uri, String name)3015          public static Uri getUriFor(Uri uri, String name) {
3016              return Uri.withAppendedPath(uri, name);
3017          }
3018      }
3019  
3020      private static final class GenerationTracker {
3021          @NonNull private final String mName;
3022          @NonNull private final MemoryIntArray mArray;
3023          @NonNull private final Consumer<String> mErrorHandler;
3024          private final int mIndex;
3025          private int mCurrentGeneration;
3026  
GenerationTracker(@onNull String name, @NonNull MemoryIntArray array, int index, int generation, Consumer<String> errorHandler)3027          GenerationTracker(@NonNull String name, @NonNull MemoryIntArray array, int index,
3028                  int generation, Consumer<String> errorHandler) {
3029              mName = name;
3030              mArray = array;
3031              mIndex = index;
3032              mErrorHandler = errorHandler;
3033              mCurrentGeneration = generation;
3034          }
3035  
3036          // This method also updates the obsolete generation code stored locally
isGenerationChanged()3037          public boolean isGenerationChanged() {
3038              final int currentGeneration = readCurrentGeneration();
3039              if (currentGeneration >= 0) {
3040                  if (currentGeneration == mCurrentGeneration) {
3041                      return false;
3042                  }
3043                  mCurrentGeneration = currentGeneration;
3044              }
3045              return true;
3046          }
3047  
getCurrentGeneration()3048          public int getCurrentGeneration() {
3049              return mCurrentGeneration;
3050          }
3051  
readCurrentGeneration()3052          private int readCurrentGeneration() {
3053              try {
3054                  return mArray.get(mIndex);
3055              } catch (IOException e) {
3056                  Log.e(TAG, "Error getting current generation", e);
3057                  mErrorHandler.accept(mName);
3058              }
3059              return -1;
3060          }
3061  
destroy()3062          public void destroy() {
3063              try {
3064                  // If this process is the system server process, mArray is the same object as
3065                  // the memory int array kept inside SettingsProvider, so skipping the close()
3066                  if (!Settings.isInSystemServer() && !mArray.isClosed()) {
3067                      mArray.close();
3068                  }
3069              } catch (IOException e) {
3070                  Log.e(TAG, "Error closing backing array", e);
3071              }
3072          }
3073  
3074          @Override
finalize()3075          protected void finalize() throws Throwable {
3076              try {
3077                  destroy();
3078              } finally {
3079                  super.finalize();
3080              }
3081          }
3082      }
3083  
3084      private static final class ContentProviderHolder {
3085          private final Object mLock = new Object();
3086  
3087          private final Uri mUri;
3088          @GuardedBy("mLock")
3089          @UnsupportedAppUsage
3090          private IContentProvider mContentProvider;
3091  
ContentProviderHolder(Uri uri)3092          public ContentProviderHolder(Uri uri) {
3093              mUri = uri;
3094          }
3095  
getProvider(ContentResolver contentResolver)3096          public IContentProvider getProvider(ContentResolver contentResolver) {
3097              synchronized (mLock) {
3098                  if (mContentProvider == null) {
3099                      mContentProvider = contentResolver
3100                              .acquireProvider(mUri.getAuthority());
3101                  }
3102                  return mContentProvider;
3103              }
3104          }
3105  
clearProviderForTest()3106          public void clearProviderForTest() {
3107              synchronized (mLock) {
3108                  mContentProvider = null;
3109              }
3110          }
3111      }
3112  
3113      // Thread-safe.
3114      private static class NameValueCache {
3115          private static final boolean DEBUG = false;
3116  
3117          private static final String[] SELECT_VALUE_PROJECTION = new String[] {
3118                  Settings.NameValueTable.VALUE
3119          };
3120  
3121          private static final String NAME_EQ_PLACEHOLDER = "name=?";
3122  
3123          // Must synchronize on 'this' to access mValues and mValuesVersion.
3124          private final ArrayMap<String, String> mValues = new ArrayMap<>();
3125  
3126          private final Uri mUri;
3127          @UnsupportedAppUsage
3128          private final ContentProviderHolder mProviderHolder;
3129  
3130          // The method we'll call (or null, to not use) on the provider
3131          // for the fast path of retrieving settings.
3132          private final String mCallGetCommand;
3133          private final String mCallSetCommand;
3134          private final String mCallDeleteCommand;
3135          private final String mCallListCommand;
3136          private final String mCallSetAllCommand;
3137  
3138          private final ArraySet<String> mReadableFields;
3139          private final ArraySet<String> mAllFields;
3140          private final ArrayMap<String, Integer> mReadableFieldsWithMaxTargetSdk;
3141  
3142          // Mapping from the name of a setting (or the prefix of a namespace) to a generation tracker
3143          @GuardedBy("this")
3144          private ArrayMap<String, GenerationTracker> mGenerationTrackers = new ArrayMap<>();
3145  
3146          private Consumer<String> mGenerationTrackerErrorHandler = (String name) -> {
3147              synchronized (NameValueCache.this) {
3148                  Log.e(TAG, "Error accessing generation tracker - removing");
3149                  final GenerationTracker tracker = mGenerationTrackers.get(name);
3150                  if (tracker != null) {
3151                      tracker.destroy();
3152                      mGenerationTrackers.remove(name);
3153                  }
3154                  mValues.remove(name);
3155              }
3156          };
3157  
NameValueCache(Uri uri, String getCommand, String setCommand, String deleteCommand, ContentProviderHolder providerHolder, Class<T> callerClass)3158          <T extends NameValueTable> NameValueCache(Uri uri, String getCommand,
3159                  String setCommand, String deleteCommand, ContentProviderHolder providerHolder,
3160                  Class<T> callerClass) {
3161              this(uri, getCommand, setCommand, deleteCommand, null, null, providerHolder,
3162                      callerClass);
3163          }
3164  
NameValueCache(Uri uri, String getCommand, String setCommand, String deleteCommand, String listCommand, String setAllCommand, ContentProviderHolder providerHolder, Class<T> callerClass)3165          private <T extends NameValueTable> NameValueCache(Uri uri, String getCommand,
3166                  String setCommand, String deleteCommand, String listCommand, String setAllCommand,
3167                  ContentProviderHolder providerHolder, Class<T> callerClass) {
3168              mUri = uri;
3169              mCallGetCommand = getCommand;
3170              mCallSetCommand = setCommand;
3171              mCallDeleteCommand = deleteCommand;
3172              mCallListCommand = listCommand;
3173              mCallSetAllCommand = setAllCommand;
3174              mProviderHolder = providerHolder;
3175              mReadableFields = new ArraySet<>();
3176              mAllFields = new ArraySet<>();
3177              mReadableFieldsWithMaxTargetSdk = new ArrayMap<>();
3178              getPublicSettingsForClass(callerClass, mAllFields, mReadableFields,
3179                      mReadableFieldsWithMaxTargetSdk);
3180          }
3181  
putStringForUser(ContentResolver cr, String name, String value, String tag, boolean makeDefault, final int userHandle, boolean overrideableByRestore)3182          public boolean putStringForUser(ContentResolver cr, String name, String value,
3183                  String tag, boolean makeDefault, final int userHandle,
3184                  boolean overrideableByRestore) {
3185              try {
3186                  Bundle arg = new Bundle();
3187                  arg.putString(Settings.NameValueTable.VALUE, value);
3188                  arg.putInt(CALL_METHOD_USER_KEY, userHandle);
3189                  if (tag != null) {
3190                      arg.putString(CALL_METHOD_TAG_KEY, tag);
3191                  }
3192                  if (makeDefault) {
3193                      arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true);
3194                  }
3195                  if (overrideableByRestore) {
3196                      arg.putBoolean(CALL_METHOD_OVERRIDEABLE_BY_RESTORE_KEY, true);
3197                  }
3198                  IContentProvider cp = mProviderHolder.getProvider(cr);
3199                  cp.call(cr.getAttributionSource(),
3200                          mProviderHolder.mUri.getAuthority(), mCallSetCommand, name, arg);
3201              } catch (RemoteException e) {
3202                  Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
3203                  return false;
3204              }
3205              return true;
3206          }
3207  
setStringsForPrefix(ContentResolver cr, String prefix, HashMap<String, String> keyValues)3208          public @SetAllResult int setStringsForPrefix(ContentResolver cr, String prefix,
3209                  HashMap<String, String> keyValues) {
3210              if (mCallSetAllCommand == null) {
3211                  // This NameValueCache does not support atomically setting multiple flags
3212                  return SET_ALL_RESULT_FAILURE;
3213              }
3214              try {
3215                  Bundle args = new Bundle();
3216                  args.putString(CALL_METHOD_PREFIX_KEY, prefix);
3217                  args.putSerializable(CALL_METHOD_FLAGS_KEY, keyValues);
3218                  IContentProvider cp = mProviderHolder.getProvider(cr);
3219                  Bundle bundle = cp.call(cr.getAttributionSource(),
3220                          mProviderHolder.mUri.getAuthority(),
3221                          mCallSetAllCommand, null, args);
3222                  return bundle.getInt(KEY_CONFIG_SET_ALL_RETURN);
3223              } catch (RemoteException e) {
3224                  // Not supported by the remote side
3225                  return SET_ALL_RESULT_FAILURE;
3226              }
3227          }
3228  
deleteStringForUser(ContentResolver cr, String name, final int userHandle)3229          public boolean deleteStringForUser(ContentResolver cr, String name, final int userHandle) {
3230              try {
3231                  Bundle arg = new Bundle();
3232                  arg.putInt(CALL_METHOD_USER_KEY, userHandle);
3233                  IContentProvider cp = mProviderHolder.getProvider(cr);
3234                  cp.call(cr.getAttributionSource(),
3235                          mProviderHolder.mUri.getAuthority(), mCallDeleteCommand, name, arg);
3236              } catch (RemoteException e) {
3237                  Log.w(TAG, "Can't delete key " + name + " in " + mUri, e);
3238                  return false;
3239              }
3240              return true;
3241          }
3242  
3243          @UnsupportedAppUsage
getStringForUser(ContentResolver cr, String name, final int userHandle)3244          public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
3245              final boolean isSelf = (userHandle == UserHandle.myUserId());
3246              final boolean useCache = isSelf && !isInSystemServer();
3247              boolean needsGenerationTracker = false;
3248              if (useCache) {
3249                  synchronized (NameValueCache.this) {
3250                      final GenerationTracker generationTracker = mGenerationTrackers.get(name);
3251                      if (generationTracker != null) {
3252                          if (generationTracker.isGenerationChanged()) {
3253                              if (DEBUG) {
3254                                  Log.i(TAG, "Generation changed for setting:" + name
3255                                          + " type:" + mUri.getPath()
3256                                          + " in package:" + cr.getPackageName()
3257                                          + " and user:" + userHandle);
3258                              }
3259                              // When a generation number changes, remove cached value, remove the old
3260                              // generation tracker and request a new one
3261                              mValues.remove(name);
3262                              generationTracker.destroy();
3263                              mGenerationTrackers.remove(name);
3264                          } else if (mValues.containsKey(name)) {
3265                              if (DEBUG) {
3266                                  Log.i(TAG, "Cache hit for setting:" + name);
3267                              }
3268                              return mValues.get(name);
3269                          }
3270                      }
3271                  }
3272                  if (DEBUG) {
3273                      Log.i(TAG, "Cache miss for setting:" + name + " for user:"
3274                              + userHandle);
3275                  }
3276                  // Generation tracker doesn't exist or the value isn't cached
3277                  needsGenerationTracker = true;
3278              } else {
3279                  if (DEBUG || LOCAL_LOGV) {
3280                      Log.v(TAG, "get setting for user " + userHandle
3281                              + " by user " + UserHandle.myUserId() + " so skipping cache");
3282                  }
3283              }
3284  
3285              // Check if the target settings key is readable. Reject if the caller is not system and
3286              // is trying to access a settings key defined in the Settings.Secure, Settings.System or
3287              // Settings.Global and is not annotated as @Readable.
3288              // Notice that a key string that is not defined in any of the Settings.* classes will
3289              // still be regarded as readable.
3290              if (!isCallerExemptFromReadableRestriction() && mAllFields.contains(name)) {
3291                  if (!mReadableFields.contains(name)) {
3292                      throw new SecurityException(
3293                              "Settings key: <" + name + "> is not readable. From S+, settings keys "
3294                                      + "annotated with @hide are restricted to system_server and "
3295                                      + "system apps only, unless they are annotated with @Readable."
3296                      );
3297                  } else {
3298                      // When the target settings key has @Readable annotation, if the caller app's
3299                      // target sdk is higher than the maxTargetSdk of the annotation, reject access.
3300                      if (mReadableFieldsWithMaxTargetSdk.containsKey(name)) {
3301                          final int maxTargetSdk = mReadableFieldsWithMaxTargetSdk.get(name);
3302                          final Application application = ActivityThread.currentApplication();
3303                          final boolean targetSdkCheckOk = application != null
3304                                  && application.getApplicationInfo() != null
3305                                  && application.getApplicationInfo().targetSdkVersion
3306                                  <= maxTargetSdk;
3307                          if (!targetSdkCheckOk) {
3308                              throw new SecurityException(
3309                                      "Settings key: <" + name + "> is only readable to apps with "
3310                                              + "targetSdkVersion lower than or equal to: "
3311                                              + maxTargetSdk
3312                              );
3313                          }
3314                      }
3315                  }
3316              }
3317  
3318              IContentProvider cp = mProviderHolder.getProvider(cr);
3319  
3320              // Try the fast path first, not using query().  If this
3321              // fails (alternate Settings provider that doesn't support
3322              // this interface?) then we fall back to the query/table
3323              // interface.
3324              if (mCallGetCommand != null) {
3325                  try {
3326                      Bundle args = new Bundle();
3327                      if (!isSelf) {
3328                          args.putInt(CALL_METHOD_USER_KEY, userHandle);
3329                      }
3330                      if (needsGenerationTracker) {
3331                          args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
3332                          if (DEBUG) {
3333                              Log.i(TAG, "Requested generation tracker for setting:" + name
3334                                      + " type:" + mUri.getPath()
3335                                      + " in package:" + cr.getPackageName()
3336                                      + " and user:" + userHandle);
3337                          }
3338                      }
3339                      Bundle b;
3340                      // If we're in system server and in a binder transaction we need to clear the
3341                      // calling uid. This works around code in system server that did not call
3342                      // clearCallingIdentity, previously this wasn't needed because reading settings
3343                      // did not do permission checking but thats no longer the case.
3344                      // Long term this should be removed and callers should properly call
3345                      // clearCallingIdentity or use a ContentResolver from the caller as needed.
3346                      if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
3347                          final long token = Binder.clearCallingIdentity();
3348                          try {
3349                              b = cp.call(cr.getAttributionSource(),
3350                                      mProviderHolder.mUri.getAuthority(), mCallGetCommand, name,
3351                                      args);
3352                          } finally {
3353                              Binder.restoreCallingIdentity(token);
3354                          }
3355                      } else {
3356                          b = cp.call(cr.getAttributionSource(),
3357                                  mProviderHolder.mUri.getAuthority(), mCallGetCommand, name, args);
3358                      }
3359                      if (b != null) {
3360                          String value = b.getString(Settings.NameValueTable.VALUE);
3361                          // Don't update our cache for reads of other users' data
3362                          if (isSelf) {
3363                              synchronized (NameValueCache.this) {
3364                                  if (needsGenerationTracker) {
3365                                      MemoryIntArray array = b.getParcelable(
3366                                              CALL_METHOD_TRACK_GENERATION_KEY, android.util.MemoryIntArray.class);
3367                                      final int index = b.getInt(
3368                                              CALL_METHOD_GENERATION_INDEX_KEY, -1);
3369                                      if (array != null && index >= 0) {
3370                                          final int generation = b.getInt(
3371                                                  CALL_METHOD_GENERATION_KEY, 0);
3372                                          if (DEBUG) {
3373                                              Log.i(TAG, "Received generation tracker for setting:"
3374                                                      + name
3375                                                      + " type:" + mUri.getPath()
3376                                                      + " in package:" + cr.getPackageName()
3377                                                      + " and user:" + userHandle
3378                                                      + " with index:" + index);
3379                                          }
3380                                          mGenerationTrackers.put(name, new GenerationTracker(name,
3381                                                  array, index, generation,
3382                                                  mGenerationTrackerErrorHandler));
3383                                      }
3384                                  }
3385                                  if (mGenerationTrackers.get(name) != null
3386                                          && !mGenerationTrackers.get(name).isGenerationChanged()) {
3387                                      if (DEBUG) {
3388                                          Log.i(TAG, "Updating cache for setting:" + name);
3389                                      }
3390                                      mValues.put(name, value);
3391                                  }
3392                              }
3393                          } else {
3394                              if (DEBUG || LOCAL_LOGV) {
3395                                  Log.i(TAG, "call-query of user " + userHandle
3396                                          + " by " + UserHandle.myUserId()
3397                                          + (isInSystemServer() ? " in system_server" : "")
3398                                          + " so not updating cache");
3399                              }
3400                          }
3401                          return value;
3402                      }
3403                      // If the response Bundle is null, we fall through
3404                      // to the query interface below.
3405                  } catch (RemoteException e) {
3406                      // Not supported by the remote side?  Fall through
3407                      // to query().
3408                  }
3409              }
3410  
3411              Cursor c = null;
3412              try {
3413                  Bundle queryArgs = ContentResolver.createSqlQueryBundle(
3414                          NAME_EQ_PLACEHOLDER, new String[]{name}, null);
3415                  // Same workaround as above.
3416                  if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) {
3417                      final long token = Binder.clearCallingIdentity();
3418                      try {
3419                          c = cp.query(cr.getAttributionSource(), mUri,
3420                                  SELECT_VALUE_PROJECTION, queryArgs, null);
3421                      } finally {
3422                          Binder.restoreCallingIdentity(token);
3423                      }
3424                  } else {
3425                      c = cp.query(cr.getAttributionSource(), mUri,
3426                              SELECT_VALUE_PROJECTION, queryArgs, null);
3427                  }
3428                  if (c == null) {
3429                      Log.w(TAG, "Can't get key " + name + " from " + mUri);
3430                      return null;
3431                  }
3432  
3433                  String value = c.moveToNext() ? c.getString(0) : null;
3434                  synchronized (NameValueCache.this) {
3435                      if (mGenerationTrackers.get(name) != null
3436                              && !mGenerationTrackers.get(name).isGenerationChanged()) {
3437                          if (DEBUG) {
3438                              Log.i(TAG, "Updating cache for setting:" + name + " using query");
3439                          }
3440                          mValues.put(name, value);
3441                      }
3442                  }
3443                  return value;
3444              } catch (RemoteException e) {
3445                  Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
3446                  return null;  // Return null, but don't cache it.
3447              } finally {
3448                  if (c != null) c.close();
3449              }
3450          }
3451  
isCallerExemptFromReadableRestriction()3452          private static boolean isCallerExemptFromReadableRestriction() {
3453              if (Settings.isInSystemServer()) {
3454                  return true;
3455              }
3456              if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) {
3457                  return true;
3458              }
3459              final Application application = ActivityThread.currentApplication();
3460              if (application == null || application.getApplicationInfo() == null) {
3461                  return false;
3462              }
3463              final ApplicationInfo applicationInfo = application.getApplicationInfo();
3464              final boolean isTestOnly =
3465                      (applicationInfo.flags & ApplicationInfo.FLAG_TEST_ONLY) != 0;
3466              return isTestOnly || applicationInfo.isSystemApp() || applicationInfo.isPrivilegedApp()
3467                      || applicationInfo.isSignedWithPlatformKey();
3468          }
3469  
getStringsForPrefix(ContentResolver cr, String prefix, List<String> names)3470          public ArrayMap<String, String> getStringsForPrefix(ContentResolver cr, String prefix,
3471                  List<String> names) {
3472              String namespace = prefix.substring(0, prefix.length() - 1);
3473              Config.enforceReadPermission(namespace);
3474              ArrayMap<String, String> keyValues = new ArrayMap<>();
3475              int currentGeneration = -1;
3476              boolean needsGenerationTracker = false;
3477  
3478              synchronized (NameValueCache.this) {
3479                  final GenerationTracker generationTracker = mGenerationTrackers.get(prefix);
3480                  if (generationTracker != null) {
3481                      if (generationTracker.isGenerationChanged()) {
3482                          if (DEBUG) {
3483                              Log.i(TAG, "Generation changed for prefix:" + prefix
3484                                      + " type:" + mUri.getPath()
3485                                      + " in package:" + cr.getPackageName());
3486                          }
3487                          for (int i = mValues.size() - 1; i >= 0; i--) {
3488                              String key = mValues.keyAt(i);
3489                              if (key.startsWith(prefix)) {
3490                                  mValues.remove(key);
3491                              }
3492                          }
3493                      } else {
3494                          boolean prefixCached = mValues.containsKey(prefix);
3495                          if (prefixCached) {
3496                              if (DEBUG) {
3497                                  Log.i(TAG, "Cache hit for prefix:" + prefix);
3498                              }
3499                              if (!names.isEmpty()) {
3500                                  for (String name : names) {
3501                                      if (mValues.containsKey(name)) {
3502                                          keyValues.put(name, mValues.get(name));
3503                                      }
3504                                  }
3505                              } else {
3506                                  for (int i = 0; i < mValues.size(); ++i) {
3507                                      String key = mValues.keyAt(i);
3508                                      // Explicitly exclude the prefix as it is only there to
3509                                      // signal that the prefix has been cached.
3510                                      if (key.startsWith(prefix) && !key.equals(prefix)) {
3511                                          keyValues.put(key, mValues.get(key));
3512                                      }
3513                                  }
3514                              }
3515                              return keyValues;
3516                          }
3517                      }
3518                      currentGeneration = generationTracker.getCurrentGeneration();
3519                  } else {
3520                      needsGenerationTracker = true;
3521                  }
3522              }
3523  
3524              if (mCallListCommand == null) {
3525                  // No list command specified, return empty map
3526                  return keyValues;
3527              }
3528              if (DEBUG) {
3529                  Log.i(TAG, "Cache miss for prefix:" + prefix);
3530              }
3531              IContentProvider cp = mProviderHolder.getProvider(cr);
3532  
3533              try {
3534                  Bundle args = new Bundle();
3535                  args.putString(Settings.CALL_METHOD_PREFIX_KEY, prefix);
3536                  if (needsGenerationTracker) {
3537                      args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
3538                      if (DEBUG) {
3539                          Log.i(TAG, "Requested generation tracker for prefix:" + prefix
3540                                  + " type: " + mUri.getPath()
3541                                  + " in package:" + cr.getPackageName());
3542                      }
3543                  }
3544  
3545                  Bundle b;
3546                  // b/252663068: if we're in system server and the caller did not call
3547                  // clearCallingIdentity, the read would fail due to mismatched AttributionSources.
3548                  // TODO(b/256013480): remove this bypass after fixing the callers in system server.
3549                  if (namespace.equals(DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER)
3550                          && Settings.isInSystemServer()
3551                          && Binder.getCallingUid() != Process.myUid()) {
3552                      final long token = Binder.clearCallingIdentity();
3553                      try {
3554                          // Fetch all flags for the namespace at once for caching purposes
3555                          b = cp.call(cr.getAttributionSource(),
3556                                  mProviderHolder.mUri.getAuthority(), mCallListCommand, null, args);
3557                      } finally {
3558                          Binder.restoreCallingIdentity(token);
3559                      }
3560                  } else {
3561                      // Fetch all flags for the namespace at once for caching purposes
3562                      b = cp.call(cr.getAttributionSource(),
3563                              mProviderHolder.mUri.getAuthority(), mCallListCommand, null, args);
3564                  }
3565                  if (b == null) {
3566                      // Invalid response, return an empty map
3567                      return keyValues;
3568                  }
3569  
3570                  // All flags for the namespace
3571                  Map<String, String> flagsToValues =
3572                          (HashMap) b.getSerializable(Settings.NameValueTable.VALUE, java.util.HashMap.class);
3573                  // Only the flags requested by the caller
3574                  if (!names.isEmpty()) {
3575                      for (Map.Entry<String, String> flag : flagsToValues.entrySet()) {
3576                          if (names.contains(flag.getKey())) {
3577                              keyValues.put(flag.getKey(), flag.getValue());
3578                          }
3579                      }
3580                  } else {
3581                      keyValues.putAll(flagsToValues);
3582                  }
3583  
3584                  synchronized (NameValueCache.this) {
3585                      if (needsGenerationTracker) {
3586                          MemoryIntArray array = b.getParcelable(
3587                                  CALL_METHOD_TRACK_GENERATION_KEY, android.util.MemoryIntArray.class);
3588                          final int index = b.getInt(
3589                                  CALL_METHOD_GENERATION_INDEX_KEY, -1);
3590                          if (array != null && index >= 0) {
3591                              final int generation = b.getInt(
3592                                      CALL_METHOD_GENERATION_KEY, 0);
3593                              if (DEBUG) {
3594                                  Log.i(TAG, "Received generation tracker for prefix:" + prefix
3595                                          + " type:" + mUri.getPath()
3596                                          + " in package:" + cr.getPackageName()
3597                                          + " with index:" + index);
3598                              }
3599                              mGenerationTrackers.put(prefix,
3600                                      new GenerationTracker(prefix, array, index, generation,
3601                                              mGenerationTrackerErrorHandler));
3602                              currentGeneration = generation;
3603                          }
3604                      }
3605                      if (mGenerationTrackers.get(prefix) != null && currentGeneration
3606                              == mGenerationTrackers.get(prefix).getCurrentGeneration()) {
3607                          if (DEBUG) {
3608                              Log.i(TAG, "Updating cache for prefix:" + prefix);
3609                          }
3610                          // cache the complete list of flags for the namespace
3611                          mValues.putAll(flagsToValues);
3612                          // Adding the prefix as a signal that the prefix is cached.
3613                          mValues.put(prefix, null);
3614                      }
3615                  }
3616                  return keyValues;
3617              } catch (RemoteException e) {
3618                  // Not supported by the remote side, return an empty map
3619                  return keyValues;
3620              }
3621          }
3622  
clearGenerationTrackerForTest()3623          public void clearGenerationTrackerForTest() {
3624              synchronized (NameValueCache.this) {
3625                  for (int i = 0; i < mGenerationTrackers.size(); i++) {
3626                      mGenerationTrackers.valueAt(i).destroy();
3627                  }
3628                  mGenerationTrackers.clear();
3629                  mValues.clear();
3630              }
3631          }
3632      }
3633  
3634      /**
3635       * Checks if the specified context can draw on top of other apps. As of API
3636       * level 23, an app cannot draw on top of other apps unless it declares the
3637       * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its
3638       * manifest, <em>and</em> the user specifically grants the app this
3639       * capability. To prompt the user to grant this approval, the app must send an
3640       * intent with the action
3641       * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which
3642       * causes the system to display a permission management screen.
3643       *
3644       * @param context App context.
3645       * @return true if the specified context can draw on top of other apps, false otherwise
3646       */
canDrawOverlays(Context context)3647      public static boolean canDrawOverlays(Context context) {
3648          return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(),
3649                  context.getOpPackageName(), false) || context.checkSelfPermission(
3650                  Manifest.permission.SYSTEM_APPLICATION_OVERLAY)
3651                  == PackageManager.PERMISSION_GRANTED;
3652      }
3653  
3654      /**
3655       * This annotation indicates that the value of a setting is allowed to be read
3656       * with the get* methods. The following settings should be readable:
3657       * 1) all the public settings
3658       * 2) all the hidden settings added before S
3659       */
3660      @Target({ ElementType.FIELD })
3661      @Retention(RetentionPolicy.RUNTIME)
3662      private @interface Readable {
maxTargetSdk()3663          int maxTargetSdk() default 0;
3664      }
3665  
getPublicSettingsForClass( Class<T> callerClass, Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> keysWithMaxTargetSdk)3666      private static <T extends NameValueTable> void getPublicSettingsForClass(
3667              Class<T> callerClass, Set<String> allKeys, Set<String> readableKeys,
3668              ArrayMap<String, Integer> keysWithMaxTargetSdk) {
3669          final Field[] allFields = callerClass.getDeclaredFields();
3670          try {
3671              for (int i = 0; i < allFields.length; i++) {
3672                  final Field field = allFields[i];
3673                  if (!field.getType().equals(String.class)) {
3674                      continue;
3675                  }
3676                  final Object value = field.get(callerClass);
3677                  if (!value.getClass().equals(String.class)) {
3678                      continue;
3679                  }
3680                  allKeys.add((String) value);
3681                  final Readable annotation = field.getAnnotation(Readable.class);
3682  
3683                  if (annotation != null) {
3684                      final String key = (String) value;
3685                      final int maxTargetSdk = annotation.maxTargetSdk();
3686                      readableKeys.add(key);
3687                      if (maxTargetSdk != 0) {
3688                          keysWithMaxTargetSdk.put(key, maxTargetSdk);
3689                      }
3690                  }
3691              }
3692          } catch (IllegalAccessException ignored) {
3693          }
3694      }
3695  
parseFloatSetting(String settingValue, String settingName)3696      private static float parseFloatSetting(String settingValue, String settingName)
3697              throws SettingNotFoundException {
3698          if (settingValue == null) {
3699              throw new SettingNotFoundException(settingName);
3700          }
3701          try {
3702              return Float.parseFloat(settingValue);
3703          } catch (NumberFormatException e) {
3704              throw new SettingNotFoundException(settingName);
3705          }
3706      }
3707  
parseFloatSettingWithDefault(String settingValue, float defaultValue)3708      private static float parseFloatSettingWithDefault(String settingValue, float defaultValue) {
3709          try {
3710              return settingValue != null ? Float.parseFloat(settingValue) : defaultValue;
3711          } catch (NumberFormatException e) {
3712              return defaultValue;
3713          }
3714      }
3715  
parseIntSetting(String settingValue, String settingName)3716      private static int parseIntSetting(String settingValue, String settingName)
3717              throws SettingNotFoundException {
3718          if (settingValue == null) {
3719              throw new SettingNotFoundException(settingName);
3720          }
3721          try {
3722              return Integer.parseInt(settingValue);
3723          } catch (NumberFormatException e) {
3724              throw new SettingNotFoundException(settingName);
3725          }
3726      }
3727  
parseIntSettingWithDefault(String settingValue, int defaultValue)3728      private static int parseIntSettingWithDefault(String settingValue, int defaultValue) {
3729          try {
3730              return settingValue != null ? Integer.parseInt(settingValue) : defaultValue;
3731          } catch (NumberFormatException e) {
3732              return defaultValue;
3733          }
3734      }
3735  
parseLongSetting(String settingValue, String settingName)3736      private static long parseLongSetting(String settingValue, String settingName)
3737              throws SettingNotFoundException {
3738          if (settingValue == null) {
3739              throw new SettingNotFoundException(settingName);
3740          }
3741          try {
3742              return Long.parseLong(settingValue);
3743          } catch (NumberFormatException e) {
3744              throw new SettingNotFoundException(settingName);
3745          }
3746      }
3747  
parseLongSettingWithDefault(String settingValue, long defaultValue)3748      private static long parseLongSettingWithDefault(String settingValue, long defaultValue) {
3749          try {
3750              return settingValue != null ? Long.parseLong(settingValue) : defaultValue;
3751          } catch (NumberFormatException e) {
3752              return defaultValue;
3753          }
3754      }
3755  
3756      /**
3757       * System settings, containing miscellaneous system preferences.  This
3758       * table holds simple name/value pairs.  There are convenience
3759       * functions for accessing individual settings entries.
3760       */
3761      public static final class System extends NameValueTable {
3762          // NOTE: If you add new settings here, be sure to add them to
3763          // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked.
3764  
3765          private static final float DEFAULT_FONT_SCALE = 1.0f;
3766          private static final int DEFAULT_FONT_WEIGHT = 0;
3767  
3768          /**
3769           * The content:// style URL for this table
3770           */
3771          public static final Uri CONTENT_URI =
3772              Uri.parse("content://" + AUTHORITY + "/system");
3773  
3774          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
3775          private static final ContentProviderHolder sProviderHolder =
3776                  new ContentProviderHolder(CONTENT_URI);
3777  
3778          @UnsupportedAppUsage
3779          private static final NameValueCache sNameValueCache = new NameValueCache(
3780                  CONTENT_URI,
3781                  CALL_METHOD_GET_SYSTEM,
3782                  CALL_METHOD_PUT_SYSTEM,
3783                  CALL_METHOD_DELETE_SYSTEM,
3784                  sProviderHolder,
3785                  System.class);
3786  
3787          @UnsupportedAppUsage
3788          private static final HashSet<String> MOVED_TO_SECURE;
3789          static {
3790              MOVED_TO_SECURE = new HashSet<>(30);
3791              MOVED_TO_SECURE.add(Secure.ADAPTIVE_SLEEP);
3792              MOVED_TO_SECURE.add(Secure.ANDROID_ID);
3793              MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
3794              MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
3795              MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
3796              MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
3797              MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
3798              MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
3799              MOVED_TO_SECURE.add(Secure.LOGGING_ID);
3800              MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
3801              MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
3802              MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
3803              MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
3804              MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
3805              MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
3806              MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
3807              MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
3808              MOVED_TO_SECURE.add(Secure.WIFI_ON);
3809              MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
3810              MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
3811              MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
3812              MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
3813              MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
3814              MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
3815              MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
3816              MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
3817              MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
3818              MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
3819              MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
3820  
3821              // At one time in System, then Global, but now back in Secure
3822              MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
3823          }
3824  
3825          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
3826          private static final HashSet<String> MOVED_TO_GLOBAL;
3827          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
3828          private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
3829          static {
3830              MOVED_TO_GLOBAL = new HashSet<>();
3831              MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>();
3832  
3833              // these were originally in system but migrated to secure in the past,
3834              // so are duplicated in the Secure.* namespace
3835              MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
3836              MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
3837              MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
3838              MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
3839              MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
3840              MOVED_TO_SECURE_THEN_GLOBAL.add(Global.NETWORK_PREFERENCE);
3841              MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
3842              MOVED_TO_SECURE_THEN_GLOBAL.add(Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
3843              MOVED_TO_SECURE_THEN_GLOBAL.add(Global.WIFI_MAX_DHCP_RETRY_COUNT);
3844  
3845              // these are moving directly from system to global
3846              MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
3847              MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
3848              MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
3849              MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
3850              MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
3851              MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
3852              MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
3853              MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
3854              MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
3855              MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
3856              MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
3857              MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
3858              MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
3859              MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
3860              MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
3861              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
3862              MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
3863              MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
3864              MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
3865              MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
3866              MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
3867              MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
3868              MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
3869              MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
3870              MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
3871              MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
3872              MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
3873              MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
3874              MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
3875              MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
3876              MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
3877              MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
3878              MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
3879              MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
3880              MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
3881              MOVED_TO_GLOBAL.add(Settings.Global.RADIO_NFC);
3882              MOVED_TO_GLOBAL.add(Settings.Global.RADIO_CELL);
3883              MOVED_TO_GLOBAL.add(Settings.Global.RADIO_WIFI);
3884              MOVED_TO_GLOBAL.add(Settings.Global.RADIO_BLUETOOTH);
3885              MOVED_TO_GLOBAL.add(Settings.Global.RADIO_WIMAX);
3886              MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
3887          }
3888  
3889          /** @hide */
getMovedToGlobalSettings(Set<String> outKeySet)3890          public static void getMovedToGlobalSettings(Set<String> outKeySet) {
3891              outKeySet.addAll(MOVED_TO_GLOBAL);
3892              outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
3893          }
3894  
3895          /** @hide */
getMovedToSecureSettings(Set<String> outKeySet)3896          public static void getMovedToSecureSettings(Set<String> outKeySet) {
3897              outKeySet.addAll(MOVED_TO_SECURE);
3898          }
3899  
3900          /** @hide */
getNonLegacyMovedKeys(HashSet<String> outKeySet)3901          public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
3902              outKeySet.addAll(MOVED_TO_GLOBAL);
3903          }
3904  
3905          /** @hide */
clearProviderForTest()3906          public static void clearProviderForTest() {
3907              sProviderHolder.clearProviderForTest();
3908              sNameValueCache.clearGenerationTrackerForTest();
3909          }
3910  
3911          /** @hide */
getPublicSettings(Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> readableKeysWithMaxTargetSdk)3912          public static void getPublicSettings(Set<String> allKeys, Set<String> readableKeys,
3913                  ArrayMap<String, Integer> readableKeysWithMaxTargetSdk) {
3914              getPublicSettingsForClass(System.class, allKeys, readableKeys,
3915                      readableKeysWithMaxTargetSdk);
3916          }
3917  
3918          /**
3919           * Look up a name in the database.
3920           * @param resolver to access the database with
3921           * @param name to look up in the table
3922           * @return the corresponding value, or null if not present
3923           */
getString(ContentResolver resolver, String name)3924          public static String getString(ContentResolver resolver, String name) {
3925              return getStringForUser(resolver, name, resolver.getUserId());
3926          }
3927  
3928          /** @hide */
3929          @UnsupportedAppUsage
getStringForUser(ContentResolver resolver, String name, int userHandle)3930          public static String getStringForUser(ContentResolver resolver, String name,
3931                  int userHandle) {
3932              if (MOVED_TO_SECURE.contains(name)) {
3933                  Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3934                          + " to android.provider.Settings.Secure, returning read-only value.");
3935                  return Secure.getStringForUser(resolver, name, userHandle);
3936              }
3937              if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
3938                  Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3939                          + " to android.provider.Settings.Global, returning read-only value.");
3940                  return Global.getStringForUser(resolver, name, userHandle);
3941              }
3942  
3943              return sNameValueCache.getStringForUser(resolver, name, userHandle);
3944          }
3945  
3946          /**
3947           * Store a name/value pair into the database.
3948           * @param resolver to access the database with
3949           * @param name to store
3950           * @param value to associate with the name
3951           * @return true if the value was set, false on database errors
3952           */
putString(ContentResolver resolver, String name, String value)3953          public static boolean putString(ContentResolver resolver, String name, String value) {
3954              return putStringForUser(resolver, name, value, resolver.getUserId());
3955          }
3956  
3957          /**
3958           * Store a name/value pair into the database. Values written by this method will be
3959           * overridden if a restore happens in the future.
3960           *
3961           * @param resolver to access the database with
3962           * @param name to store
3963           * @param value to associate with the name
3964           *
3965           * @return true if the value was set, false on database errors
3966           *
3967           * @hide
3968           */
3969          @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE)
3970          @SystemApi
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, boolean overrideableByRestore)3971          public static boolean putString(@NonNull ContentResolver resolver,
3972                  @NonNull String name, @Nullable String value, boolean overrideableByRestore) {
3973              return putStringForUser(resolver, name, value, resolver.getUserId(),
3974                     overrideableByRestore);
3975          }
3976  
3977          /** @hide */
3978          @UnsupportedAppUsage
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)3979          public static boolean putStringForUser(ContentResolver resolver, String name, String value,
3980                  int userHandle) {
3981              return putStringForUser(resolver, name, value, userHandle,
3982                      DEFAULT_OVERRIDEABLE_BY_RESTORE);
3983          }
3984  
putStringForUser(ContentResolver resolver, String name, String value, int userHandle, boolean overrideableByRestore)3985          private static boolean putStringForUser(ContentResolver resolver, String name, String value,
3986                  int userHandle, boolean overrideableByRestore) {
3987              return putStringForUser(resolver, name, value, /* tag= */ null,
3988                      /* makeDefault= */ false, userHandle, overrideableByRestore);
3989          }
3990  
putStringForUser(ContentResolver resolver, String name, String value, String tag, boolean makeDefault, int userHandle, boolean overrideableByRestore)3991          private static boolean putStringForUser(ContentResolver resolver, String name, String value,
3992                  String tag, boolean makeDefault, int userHandle, boolean overrideableByRestore) {
3993              if (LOCAL_LOGV) {
3994                  Log.v(TAG, "System.putString(name=" + name + ", value=" + value + ") for "
3995                          + userHandle);
3996              }
3997              if (MOVED_TO_SECURE.contains(name)) {
3998                  Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3999                          + " to android.provider.Settings.Secure, value is unchanged.");
4000                  return false;
4001              }
4002              if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
4003                  Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
4004                          + " to android.provider.Settings.Global, value is unchanged.");
4005                  return false;
4006              }
4007              return sNameValueCache.putStringForUser(resolver, name, value, tag, makeDefault,
4008                      userHandle, overrideableByRestore);
4009          }
4010  
4011          /**
4012           * Construct the content URI for a particular name/value pair,
4013           * useful for monitoring changes with a ContentObserver.
4014           * @param name to look up in the table
4015           * @return the corresponding content URI, or null if not present
4016           */
getUriFor(String name)4017          public static Uri getUriFor(String name) {
4018              if (MOVED_TO_SECURE.contains(name)) {
4019                  Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
4020                      + " to android.provider.Settings.Secure, returning Secure URI.");
4021                  return Secure.getUriFor(Secure.CONTENT_URI, name);
4022              }
4023              if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
4024                  Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
4025                          + " to android.provider.Settings.Global, returning read-only global URI.");
4026                  return Global.getUriFor(Global.CONTENT_URI, name);
4027              }
4028              return getUriFor(CONTENT_URI, name);
4029          }
4030  
4031          /**
4032           * Convenience function for retrieving a single system settings value
4033           * as an integer.  Note that internally setting values are always
4034           * stored as strings; this function converts the string to an integer
4035           * for you.  The default value will be returned if the setting is
4036           * not defined or not an integer.
4037           *
4038           * @param cr The ContentResolver to access.
4039           * @param name The name of the setting to retrieve.
4040           * @param def Value to return if the setting is not defined.
4041           *
4042           * @return The setting's current value, or 'def' if it is not defined
4043           * or not a valid integer.
4044           */
getInt(ContentResolver cr, String name, int def)4045          public static int getInt(ContentResolver cr, String name, int def) {
4046              return getIntForUser(cr, name, def, cr.getUserId());
4047          }
4048  
4049          /** @hide */
4050          @UnsupportedAppUsage
getIntForUser(ContentResolver cr, String name, int def, int userHandle)4051          public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
4052              String v = getStringForUser(cr, name, userHandle);
4053              return parseIntSettingWithDefault(v, def);
4054          }
4055  
4056          /**
4057           * Convenience function for retrieving a single system settings value
4058           * as an integer.  Note that internally setting values are always
4059           * stored as strings; this function converts the string to an integer
4060           * for you.
4061           * <p>
4062           * This version does not take a default value.  If the setting has not
4063           * been set, or the string value is not a number,
4064           * it throws {@link SettingNotFoundException}.
4065           *
4066           * @param cr The ContentResolver to access.
4067           * @param name The name of the setting to retrieve.
4068           *
4069           * @throws SettingNotFoundException Thrown if a setting by the given
4070           * name can't be found or the setting value is not an integer.
4071           *
4072           * @return The setting's current value.
4073           */
getInt(ContentResolver cr, String name)4074          public static int getInt(ContentResolver cr, String name)
4075                  throws SettingNotFoundException {
4076              return getIntForUser(cr, name, cr.getUserId());
4077          }
4078  
4079          /** @hide */
4080          @UnsupportedAppUsage
getIntForUser(ContentResolver cr, String name, int userHandle)4081          public static int getIntForUser(ContentResolver cr, String name, int userHandle)
4082                  throws SettingNotFoundException {
4083              String v = getStringForUser(cr, name, userHandle);
4084              return parseIntSetting(v, name);
4085          }
4086  
4087          /**
4088           * Convenience function for updating a single settings value as an
4089           * integer. This will either create a new entry in the table if the
4090           * given name does not exist, or modify the value of the existing row
4091           * with that name.  Note that internally setting values are always
4092           * stored as strings, so this function converts the given value to a
4093           * string before storing it.
4094           *
4095           * @param cr The ContentResolver to access.
4096           * @param name The name of the setting to modify.
4097           * @param value The new value for the setting.
4098           * @return true if the value was set, false on database errors
4099           */
putInt(ContentResolver cr, String name, int value)4100          public static boolean putInt(ContentResolver cr, String name, int value) {
4101              return putIntForUser(cr, name, value, cr.getUserId());
4102          }
4103  
4104          /** @hide */
4105          @UnsupportedAppUsage
putIntForUser(ContentResolver cr, String name, int value, int userHandle)4106          public static boolean putIntForUser(ContentResolver cr, String name, int value,
4107                  int userHandle) {
4108              return putStringForUser(cr, name, Integer.toString(value), userHandle);
4109          }
4110  
4111          /**
4112           * Convenience function for retrieving a single system settings value
4113           * as a {@code long}.  Note that internally setting values are always
4114           * stored as strings; this function converts the string to a {@code long}
4115           * for you.  The default value will be returned if the setting is
4116           * not defined or not a {@code long}.
4117           *
4118           * @param cr The ContentResolver to access.
4119           * @param name The name of the setting to retrieve.
4120           * @param def Value to return if the setting is not defined.
4121           *
4122           * @return The setting's current value, or 'def' if it is not defined
4123           * or not a valid {@code long}.
4124           */
getLong(ContentResolver cr, String name, long def)4125          public static long getLong(ContentResolver cr, String name, long def) {
4126              return getLongForUser(cr, name, def, cr.getUserId());
4127          }
4128  
4129          /** @hide */
getLongForUser(ContentResolver cr, String name, long def, int userHandle)4130          public static long getLongForUser(ContentResolver cr, String name, long def,
4131                  int userHandle) {
4132              String v = getStringForUser(cr, name, userHandle);
4133              return parseLongSettingWithDefault(v, def);
4134          }
4135  
4136          /**
4137           * Convenience function for retrieving a single system settings value
4138           * as a {@code long}.  Note that internally setting values are always
4139           * stored as strings; this function converts the string to a {@code long}
4140           * for you.
4141           * <p>
4142           * This version does not take a default value.  If the setting has not
4143           * been set, or the string value is not a number,
4144           * it throws {@link SettingNotFoundException}.
4145           *
4146           * @param cr The ContentResolver to access.
4147           * @param name The name of the setting to retrieve.
4148           *
4149           * @return The setting's current value.
4150           * @throws SettingNotFoundException Thrown if a setting by the given
4151           * name can't be found or the setting value is not an integer.
4152           */
getLong(ContentResolver cr, String name)4153          public static long getLong(ContentResolver cr, String name)
4154                  throws SettingNotFoundException {
4155              return getLongForUser(cr, name, cr.getUserId());
4156          }
4157  
4158          /** @hide */
getLongForUser(ContentResolver cr, String name, int userHandle)4159          public static long getLongForUser(ContentResolver cr, String name, int userHandle)
4160                  throws SettingNotFoundException {
4161              String v = getStringForUser(cr, name, userHandle);
4162              return parseLongSetting(v, name);
4163          }
4164  
4165          /**
4166           * Convenience function for updating a single settings value as a long
4167           * integer. This will either create a new entry in the table if the
4168           * given name does not exist, or modify the value of the existing row
4169           * with that name.  Note that internally setting values are always
4170           * stored as strings, so this function converts the given value to a
4171           * string before storing it.
4172           *
4173           * @param cr The ContentResolver to access.
4174           * @param name The name of the setting to modify.
4175           * @param value The new value for the setting.
4176           * @return true if the value was set, false on database errors
4177           */
putLong(ContentResolver cr, String name, long value)4178          public static boolean putLong(ContentResolver cr, String name, long value) {
4179              return putLongForUser(cr, name, value, cr.getUserId());
4180          }
4181  
4182          /** @hide */
putLongForUser(ContentResolver cr, String name, long value, int userHandle)4183          public static boolean putLongForUser(ContentResolver cr, String name, long value,
4184                  int userHandle) {
4185              return putStringForUser(cr, name, Long.toString(value), userHandle);
4186          }
4187  
4188          /**
4189           * Convenience function for retrieving a single system settings value
4190           * as a floating point number.  Note that internally setting values are
4191           * always stored as strings; this function converts the string to an
4192           * float for you. The default value will be returned if the setting
4193           * is not defined or not a valid float.
4194           *
4195           * @param cr The ContentResolver to access.
4196           * @param name The name of the setting to retrieve.
4197           * @param def Value to return if the setting is not defined.
4198           *
4199           * @return The setting's current value, or 'def' if it is not defined
4200           * or not a valid float.
4201           */
getFloat(ContentResolver cr, String name, float def)4202          public static float getFloat(ContentResolver cr, String name, float def) {
4203              return getFloatForUser(cr, name, def, cr.getUserId());
4204          }
4205  
4206          /** @hide */
getFloatForUser(ContentResolver cr, String name, float def, int userHandle)4207          public static float getFloatForUser(ContentResolver cr, String name, float def,
4208                  int userHandle) {
4209              String v = getStringForUser(cr, name, userHandle);
4210              return parseFloatSettingWithDefault(v, def);
4211          }
4212  
4213          /**
4214           * Convenience function for retrieving a single system settings value
4215           * as a float.  Note that internally setting values are always
4216           * stored as strings; this function converts the string to a float
4217           * for you.
4218           * <p>
4219           * This version does not take a default value.  If the setting has not
4220           * been set, or the string value is not a number,
4221           * it throws {@link SettingNotFoundException}.
4222           *
4223           * @param cr The ContentResolver to access.
4224           * @param name The name of the setting to retrieve.
4225           *
4226           * @throws SettingNotFoundException Thrown if a setting by the given
4227           * name can't be found or the setting value is not a float.
4228           *
4229           * @return The setting's current value.
4230           */
getFloat(ContentResolver cr, String name)4231          public static float getFloat(ContentResolver cr, String name)
4232                  throws SettingNotFoundException {
4233              return getFloatForUser(cr, name, cr.getUserId());
4234          }
4235  
4236          /** @hide */
getFloatForUser(ContentResolver cr, String name, int userHandle)4237          public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
4238                  throws SettingNotFoundException {
4239              String v = getStringForUser(cr, name, userHandle);
4240              return parseFloatSetting(v, name);
4241          }
4242  
4243          /**
4244           * Convenience function for updating a single settings value as a
4245           * floating point number. This will either create a new entry in the
4246           * table if the given name does not exist, or modify the value of the
4247           * existing row with that name.  Note that internally setting values
4248           * are always stored as strings, so this function converts the given
4249           * value to a string before storing it.
4250           *
4251           * @param cr The ContentResolver to access.
4252           * @param name The name of the setting to modify.
4253           * @param value The new value for the setting.
4254           * @return true if the value was set, false on database errors
4255           */
putFloat(ContentResolver cr, String name, float value)4256          public static boolean putFloat(ContentResolver cr, String name, float value) {
4257              return putFloatForUser(cr, name, value, cr.getUserId());
4258          }
4259  
4260          /** @hide */
putFloatForUser(ContentResolver cr, String name, float value, int userHandle)4261          public static boolean putFloatForUser(ContentResolver cr, String name, float value,
4262                  int userHandle) {
4263              return putStringForUser(cr, name, Float.toString(value), userHandle);
4264          }
4265  
4266          /**
4267           * Convenience function to read all of the current
4268           * configuration-related settings into a
4269           * {@link Configuration} object.
4270           *
4271           * @param cr The ContentResolver to access.
4272           * @param outConfig Where to place the configuration settings.
4273           */
getConfiguration(ContentResolver cr, Configuration outConfig)4274          public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
4275              adjustConfigurationForUser(cr, outConfig, cr.getUserId(),
4276                      false /* updateSettingsIfEmpty */);
4277          }
4278  
4279          /** @hide */
adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, int userHandle, boolean updateSettingsIfEmpty)4280          public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig,
4281                  int userHandle, boolean updateSettingsIfEmpty) {
4282              outConfig.fontScale = Settings.System.getFloatForUser(
4283                      cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle);
4284              if (outConfig.fontScale < 0) {
4285                  outConfig.fontScale = DEFAULT_FONT_SCALE;
4286              }
4287              outConfig.fontWeightAdjustment = Settings.Secure.getIntForUser(
4288                      cr, Settings.Secure.FONT_WEIGHT_ADJUSTMENT, DEFAULT_FONT_WEIGHT, userHandle);
4289  
4290              final String localeValue =
4291                      Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle);
4292              if (localeValue != null) {
4293                  outConfig.setLocales(LocaleList.forLanguageTags(localeValue));
4294              } else {
4295                  // Do not update configuration with emtpy settings since we need to take over the
4296                  // locale list of previous user if the settings value is empty. This happens when a
4297                  // new user is created.
4298  
4299                  if (updateSettingsIfEmpty) {
4300                      // Make current configuration persistent. This is necessary the first time a
4301                      // user log in. At the first login, the configuration settings are empty, so we
4302                      // need to store the adjusted configuration as the initial settings.
4303                      Settings.System.putStringForUser(
4304                              cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(),
4305                              userHandle, DEFAULT_OVERRIDEABLE_BY_RESTORE);
4306                  }
4307              }
4308          }
4309  
4310          /**
4311           * @hide Erase the fields in the Configuration that should be applied
4312           * by the settings.
4313           */
clearConfiguration(Configuration inoutConfig)4314          public static void clearConfiguration(Configuration inoutConfig) {
4315              inoutConfig.fontScale = 0;
4316              if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) {
4317                  inoutConfig.clearLocales();
4318              }
4319              inoutConfig.fontWeightAdjustment = Configuration.FONT_WEIGHT_ADJUSTMENT_UNDEFINED;
4320          }
4321  
4322          /**
4323           * Convenience function to write a batch of configuration-related
4324           * settings from a {@link Configuration} object.
4325           *
4326           * @param cr The ContentResolver to access.
4327           * @param config The settings to write.
4328           * @return true if the values were set, false on database errors
4329           */
putConfiguration(ContentResolver cr, Configuration config)4330          public static boolean putConfiguration(ContentResolver cr, Configuration config) {
4331              return putConfigurationForUser(cr, config, cr.getUserId());
4332          }
4333  
4334          /** @hide */
putConfigurationForUser(ContentResolver cr, Configuration config, int userHandle)4335          public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
4336                  int userHandle) {
4337              return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) &&
4338                      Settings.System.putStringForUser(
4339                              cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle,
4340                              DEFAULT_OVERRIDEABLE_BY_RESTORE);
4341          }
4342  
4343          /**
4344           * Convenience function for checking if settings should be overwritten with config changes.
4345           * @see #putConfigurationForUser(ContentResolver, Configuration, int)
4346           * @hide
4347           */
hasInterestingConfigurationChanges(int changes)4348          public static boolean hasInterestingConfigurationChanges(int changes) {
4349              return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 ||
4350                      (changes & ActivityInfo.CONFIG_LOCALE) != 0;
4351          }
4352  
4353          /** @deprecated - Do not use */
4354          @Deprecated
getShowGTalkServiceStatus(ContentResolver cr)4355          public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
4356              return getShowGTalkServiceStatusForUser(cr, cr.getUserId());
4357          }
4358  
4359          /**
4360           * @hide
4361           * @deprecated - Do not use
4362           */
4363          @Deprecated
getShowGTalkServiceStatusForUser(ContentResolver cr, int userHandle)4364          public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
4365                  int userHandle) {
4366              return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
4367          }
4368  
4369          /** @deprecated - Do not use */
4370          @Deprecated
setShowGTalkServiceStatus(ContentResolver cr, boolean flag)4371          public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
4372              setShowGTalkServiceStatusForUser(cr, flag, cr.getUserId());
4373          }
4374  
4375          /**
4376           * @hide
4377           * @deprecated - Do not use
4378           */
4379          @Deprecated
setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, int userHandle)4380          public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
4381                  int userHandle) {
4382              putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
4383          }
4384  
4385          /**
4386           * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
4387           */
4388          @Deprecated
4389          public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN;
4390  
4391          /**
4392           * What happens when the user presses the end call button if they're not
4393           * on a call.<br/>
4394           * <b>Values:</b><br/>
4395           * 0 - The end button does nothing.<br/>
4396           * 1 - The end button goes to the home screen.<br/>
4397           * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
4398           * 3 - The end button goes to the home screen.  If the user is already on the
4399           * home screen, it puts the device to sleep.
4400           */
4401          @Readable
4402          public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
4403  
4404          /**
4405           * END_BUTTON_BEHAVIOR value for "go home".
4406           * @hide
4407           */
4408          public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
4409  
4410          /**
4411           * END_BUTTON_BEHAVIOR value for "go to sleep".
4412           * @hide
4413           */
4414          public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
4415  
4416          /**
4417           * END_BUTTON_BEHAVIOR default value.
4418           * @hide
4419           */
4420          public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
4421  
4422          /**
4423           * Is advanced settings mode turned on. 0 == no, 1 == yes
4424           * @hide
4425           */
4426          @Readable
4427          public static final String ADVANCED_SETTINGS = "advanced_settings";
4428  
4429          /**
4430           * ADVANCED_SETTINGS default value.
4431           * @hide
4432           */
4433          public static final int ADVANCED_SETTINGS_DEFAULT = 0;
4434  
4435          /**
4436           * If the triple press gesture for toggling accessibility is enabled.
4437           * Set to 1 for true and 0 for false.
4438           *
4439           * This setting is used only internally.
4440           * @hide
4441           */
4442          public static final String WEAR_ACCESSIBILITY_GESTURE_ENABLED
4443                  = "wear_accessibility_gesture_enabled";
4444  
4445          /**
4446           * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
4447           */
4448          @Deprecated
4449          public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
4450  
4451          /**
4452           * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
4453           */
4454          @Deprecated
4455          public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
4456  
4457          /**
4458           * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
4459           */
4460          @Deprecated
4461          public static final String RADIO_WIFI = Global.RADIO_WIFI;
4462  
4463          /**
4464           * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
4465           * {@hide}
4466           */
4467          @Deprecated
4468          public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
4469  
4470          /**
4471           * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
4472           */
4473          @Deprecated
4474          public static final String RADIO_CELL = Global.RADIO_CELL;
4475  
4476          /**
4477           * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
4478           */
4479          @Deprecated
4480          public static final String RADIO_NFC = Global.RADIO_NFC;
4481  
4482          /**
4483           * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
4484           */
4485          @Deprecated
4486          public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
4487  
4488          /**
4489           * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
4490           *
4491           * {@hide}
4492           */
4493          @Deprecated
4494          @UnsupportedAppUsage
4495          public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
4496                  Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
4497  
4498          /**
4499           * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
4500           */
4501          @Deprecated
4502          public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
4503  
4504          /**
4505           * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
4506           */
4507          @Deprecated
4508          public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
4509  
4510          /**
4511           * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
4512           */
4513          @Deprecated
4514          public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
4515                  Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
4516  
4517          /**
4518           * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
4519           */
4520          @Deprecated
4521          public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
4522  
4523          /**
4524           * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
4525           */
4526          @Deprecated
4527          public static final String MODE_RINGER = Global.MODE_RINGER;
4528  
4529          /**
4530           * Whether to use static IP and other static network attributes.
4531           * <p>
4532           * Set to 1 for true and 0 for false.
4533           *
4534           * @deprecated Use {@link WifiManager} instead
4535           */
4536          @Deprecated
4537          @Readable
4538          public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
4539  
4540          /**
4541           * The static IP address.
4542           * <p>
4543           * Example: "192.168.1.51"
4544           *
4545           * @deprecated Use {@link WifiManager} instead
4546           */
4547          @Deprecated
4548          @Readable
4549          public static final String WIFI_STATIC_IP = "wifi_static_ip";
4550  
4551          /**
4552           * If using static IP, the gateway's IP address.
4553           * <p>
4554           * Example: "192.168.1.1"
4555           *
4556           * @deprecated Use {@link WifiManager} instead
4557           */
4558          @Deprecated
4559          @Readable
4560          public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
4561  
4562          /**
4563           * If using static IP, the net mask.
4564           * <p>
4565           * Example: "255.255.255.0"
4566           *
4567           * @deprecated Use {@link WifiManager} instead
4568           */
4569          @Deprecated
4570          @Readable
4571          public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
4572  
4573          /**
4574           * If using static IP, the primary DNS's IP address.
4575           * <p>
4576           * Example: "192.168.1.1"
4577           *
4578           * @deprecated Use {@link WifiManager} instead
4579           */
4580          @Deprecated
4581          @Readable
4582          public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
4583  
4584          /**
4585           * If using static IP, the secondary DNS's IP address.
4586           * <p>
4587           * Example: "192.168.1.2"
4588           *
4589           * @deprecated Use {@link WifiManager} instead
4590           */
4591          @Deprecated
4592          @Readable
4593          public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
4594  
4595          /**
4596           * Determines whether remote devices may discover and/or connect to
4597           * this device.
4598           * <P>Type: INT</P>
4599           * 2 -- discoverable and connectable
4600           * 1 -- connectable but not discoverable
4601           * 0 -- neither connectable nor discoverable
4602           */
4603          @Readable
4604          public static final String BLUETOOTH_DISCOVERABILITY =
4605              "bluetooth_discoverability";
4606  
4607          /**
4608           * Bluetooth discoverability timeout.  If this value is nonzero, then
4609           * Bluetooth becomes discoverable for a certain number of seconds,
4610           * after which is becomes simply connectable.  The value is in seconds.
4611           */
4612          @Readable
4613          public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
4614              "bluetooth_discoverability_timeout";
4615  
4616          /**
4617           * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
4618           * instead
4619           */
4620          @Deprecated
4621          public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
4622  
4623          /**
4624           * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
4625           * instead
4626           */
4627          @Deprecated
4628          public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
4629  
4630          /**
4631           * @deprecated Use
4632           * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
4633           * instead
4634           */
4635          @Deprecated
4636          public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
4637              "lock_pattern_tactile_feedback_enabled";
4638  
4639          /**
4640           * A formatted string of the next alarm that is set, or the empty string
4641           * if there is no alarm set.
4642           *
4643           * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
4644           */
4645          @Deprecated
4646          @Readable
4647          public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
4648  
4649          /**
4650           * Scaling factor for fonts, float.
4651           */
4652          @Readable
4653          public static final String FONT_SCALE = "font_scale";
4654  
4655          /**
4656           * The serialized system locale value.
4657           *
4658           * Do not use this value directory.
4659           * To get system locale, use {@link LocaleList#getDefault} instead.
4660           * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales}
4661           * instead.
4662           * @hide
4663           */
4664          @Readable
4665          public static final String SYSTEM_LOCALES = "system_locales";
4666  
4667  
4668          /**
4669           * Name of an application package to be debugged.
4670           *
4671           * @deprecated Use {@link Global#DEBUG_APP} instead
4672           */
4673          @Deprecated
4674          public static final String DEBUG_APP = Global.DEBUG_APP;
4675  
4676          /**
4677           * If 1, when launching DEBUG_APP it will wait for the debugger before
4678           * starting user code.  If 0, it will run normally.
4679           *
4680           * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
4681           */
4682          @Deprecated
4683          public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
4684  
4685          /**
4686           * Whether or not to dim the screen. 0=no  1=yes
4687           * @deprecated This setting is no longer used.
4688           */
4689          @Deprecated
4690          @Readable
4691          public static final String DIM_SCREEN = "dim_screen";
4692  
4693          /**
4694           * The display color mode.
4695           * @hide
4696           */
4697          @Readable
4698          public static final String DISPLAY_COLOR_MODE = "display_color_mode";
4699  
4700          /**
4701           * Hint to decide whether restored vendor color modes are compatible with the new device. If
4702           * unset or a match is not made, only the standard color modes will be restored.
4703           * @hide
4704           */
4705          public static final String DISPLAY_COLOR_MODE_VENDOR_HINT =
4706                  "display_color_mode_vendor_hint";
4707  
4708          /**
4709           * The user selected min refresh rate in frames per second.
4710           *
4711           * If this isn't set, 0 will be used.
4712           * @hide
4713           */
4714          @Readable
4715          public static final String MIN_REFRESH_RATE = "min_refresh_rate";
4716  
4717          /**
4718           * The user selected peak refresh rate in frames per second.
4719           *
4720           * If this isn't set, the system falls back to a device specific default.
4721           * @hide
4722           */
4723          @Readable
4724          public static final String PEAK_REFRESH_RATE = "peak_refresh_rate";
4725  
4726          /**
4727           * Control lock behavior on fold
4728           *
4729           * If this isn't set, the system falls back to a device specific default.
4730           * @hide
4731           */
4732          @Readable
4733          public static final String FOLD_LOCK_BEHAVIOR = "fold_lock_behavior_setting";
4734  
4735          /**
4736           * The amount of time in milliseconds before the device goes to sleep or begins
4737           * to dream after a period of inactivity.  This value is also known as the
4738           * user activity timeout period since the screen isn't necessarily turned off
4739           * when it expires.
4740           *
4741           * <p>
4742           * This value is bounded by maximum timeout set by
4743           * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}.
4744           */
4745          @Readable
4746          public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
4747  
4748          /**
4749           * The screen backlight brightness between 0 and 255.
4750           */
4751          @Readable
4752          public static final String SCREEN_BRIGHTNESS = "screen_brightness";
4753  
4754          /**
4755           * The screen backlight brightness between 0.0f and 1.0f.
4756           * @hide
4757           */
4758          @Readable
4759          public static final String SCREEN_BRIGHTNESS_FLOAT = "screen_brightness_float";
4760  
4761          /**
4762           * Control whether to enable automatic brightness mode.
4763           */
4764          @Readable
4765          public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
4766  
4767          /**
4768           * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
4769           * or less (<0.0 >-1.0) bright.
4770           * @hide
4771           */
4772          @UnsupportedAppUsage
4773          @Readable
4774          public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
4775  
4776          /**
4777           * SCREEN_BRIGHTNESS_MODE value for manual mode.
4778           */
4779          public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
4780  
4781          /**
4782           * SCREEN_BRIGHTNESS_MODE value for automatic mode.
4783           */
4784          public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
4785  
4786          /**
4787           * Control whether to enable adaptive sleep mode.
4788           * @deprecated Use {@link android.provider.Settings.Secure#ADAPTIVE_SLEEP} instead.
4789           * @hide
4790           */
4791          @Deprecated
4792          @Readable
4793          public static final String ADAPTIVE_SLEEP = "adaptive_sleep";
4794  
4795          /**
4796           * Control whether the process CPU usage meter should be shown.
4797           *
4798           * @deprecated This functionality is no longer available as of
4799           * {@link android.os.Build.VERSION_CODES#N_MR1}.
4800           */
4801          @Deprecated
4802          public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
4803  
4804          /**
4805           * If 1, the activity manager will aggressively finish activities and
4806           * processes as soon as they are no longer needed.  If 0, the normal
4807           * extended lifetime is used.
4808           *
4809           * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
4810           */
4811          @Deprecated
4812          public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
4813  
4814          /**
4815           * Determines which streams are affected by ringer and zen mode changes. The
4816           * stream type's bit should be set to 1 if it should be muted when going
4817           * into an inaudible ringer mode.
4818           */
4819          @Readable
4820          public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
4821  
4822          /**
4823            * Determines which streams are affected by mute. The
4824            * stream type's bit should be set to 1 if it should be muted when a mute request
4825            * is received.
4826            */
4827          @Readable
4828          public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
4829  
4830          /**
4831           * Whether vibrate is on for different events. This is used internally,
4832           * changing this value will not change the vibrate. See AudioManager.
4833           */
4834          @Readable
4835          public static final String VIBRATE_ON = "vibrate_on";
4836  
4837          /**
4838           * Whether applying ramping ringer on incoming phone call ringtone.
4839           * <p>1 = apply ramping ringer
4840           * <p>0 = do not apply ramping ringer
4841           * @hide
4842           */
4843          @Readable
4844          public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer";
4845  
4846          /**
4847           * If 1, redirects the system vibrator to all currently attached input devices
4848           * that support vibration.  If there are no such input devices, then the system
4849           * vibrator is used instead.
4850           * If 0, does not register the system vibrator.
4851           *
4852           * This setting is mainly intended to provide a compatibility mechanism for
4853           * applications that only know about the system vibrator and do not use the
4854           * input device vibrator API.
4855           *
4856           * @hide
4857           */
4858          @Readable
4859          public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
4860  
4861          /**
4862           * The intensity of alarm vibrations, if configurable.
4863           *
4864           * Not all devices are capable of changing their vibration intensity; on these devices
4865           * there will likely be no difference between the various vibration intensities except for
4866           * intensity 0 (off) and the rest.
4867           *
4868           * <b>Values:</b><br/>
4869           * 0 - Vibration is disabled<br/>
4870           * 1 - Weak vibrations<br/>
4871           * 2 - Medium vibrations<br/>
4872           * 3 - Strong vibrations
4873           * @hide
4874           */
4875          public static final String ALARM_VIBRATION_INTENSITY =
4876                  "alarm_vibration_intensity";
4877  
4878          /**
4879           * The intensity of media vibrations, if configurable.
4880           *
4881           * This includes any vibration that is part of media, such as music, movie, soundtrack,
4882           * game or animations.
4883           *
4884           * Not all devices are capable of changing their vibration intensity; on these devices
4885           * there will likely be no difference between the various vibration intensities except for
4886           * intensity 0 (off) and the rest.
4887           *
4888           * <b>Values:</b><br/>
4889           * 0 - Vibration is disabled<br/>
4890           * 1 - Weak vibrations<br/>
4891           * 2 - Medium vibrations<br/>
4892           * 3 - Strong vibrations
4893           * @hide
4894           */
4895          public static final String MEDIA_VIBRATION_INTENSITY =
4896                  "media_vibration_intensity";
4897  
4898          /**
4899           * The intensity of notification vibrations, if configurable.
4900           *
4901           * Not all devices are capable of changing their vibration intensity; on these devices
4902           * there will likely be no difference between the various vibration intensities except for
4903           * intensity 0 (off) and the rest.
4904           *
4905           * <b>Values:</b><br/>
4906           * 0 - Vibration is disabled<br/>
4907           * 1 - Weak vibrations<br/>
4908           * 2 - Medium vibrations<br/>
4909           * 3 - Strong vibrations
4910           * @hide
4911           */
4912          @Readable
4913          public static final String NOTIFICATION_VIBRATION_INTENSITY =
4914                  "notification_vibration_intensity";
4915  
4916          /**
4917           * The intensity of ringtone vibrations, if configurable.
4918           *
4919           * Not all devices are capable of changing their vibration intensity; on these devices
4920           * there will likely be no difference between the various vibration intensities except for
4921           * intensity 0 (off) and the rest.
4922           *
4923           * <b>Values:</b><br/>
4924           * 0 - Vibration is disabled<br/>
4925           * 1 - Weak vibrations<br/>
4926           * 2 - Medium vibrations<br/>
4927           * 3 - Strong vibrations
4928           * @hide
4929           */
4930          @Readable
4931          public static final String RING_VIBRATION_INTENSITY =
4932                  "ring_vibration_intensity";
4933  
4934          /**
4935           * The intensity of haptic feedback vibrations, if configurable.
4936           *
4937           * Not all devices are capable of changing their feedback intensity; on these devices
4938           * there will likely be no difference between the various vibration intensities except for
4939           * intensity 0 (off) and the rest.
4940           *
4941           * <b>Values:</b><br/>
4942           * 0 - Vibration is disabled<br/>
4943           * 1 - Weak vibrations<br/>
4944           * 2 - Medium vibrations<br/>
4945           * 3 - Strong vibrations
4946           * @hide
4947           */
4948          @Readable
4949          public static final String HAPTIC_FEEDBACK_INTENSITY =
4950                  "haptic_feedback_intensity";
4951  
4952          /**
4953           * The intensity of haptic feedback vibrations for interaction with hardware components from
4954           * the device, like buttons and sensors, if configurable.
4955           *
4956           * Not all devices are capable of changing their feedback intensity; on these devices
4957           * there will likely be no difference between the various vibration intensities except for
4958           * intensity 0 (off) and the rest.
4959           *
4960           * <b>Values:</b><br/>
4961           * 0 - Vibration is disabled<br/>
4962           * 1 - Weak vibrations<br/>
4963           * 2 - Medium vibrations<br/>
4964           * 3 - Strong vibrations
4965           * @hide
4966           */
4967          public static final String HARDWARE_HAPTIC_FEEDBACK_INTENSITY =
4968                  "hardware_haptic_feedback_intensity";
4969  
4970          /**
4971           * Ringer volume. This is used internally, changing this value will not
4972           * change the volume. See AudioManager.
4973           *
4974           * @removed Not used by anything since API 2.
4975           */
4976          @Readable
4977          public static final String VOLUME_RING = "volume_ring";
4978  
4979          /**
4980           * System/notifications volume. This is used internally, changing this
4981           * value will not change the volume. See AudioManager.
4982           *
4983           * @removed Not used by anything since API 2.
4984           */
4985          @Readable
4986          public static final String VOLUME_SYSTEM = "volume_system";
4987  
4988          /**
4989           * Voice call volume. This is used internally, changing this value will
4990           * not change the volume. See AudioManager.
4991           *
4992           * @removed Not used by anything since API 2.
4993           */
4994          @Readable
4995          public static final String VOLUME_VOICE = "volume_voice";
4996  
4997          /**
4998           * Music/media/gaming volume. This is used internally, changing this
4999           * value will not change the volume. See AudioManager.
5000           *
5001           * @removed Not used by anything since API 2.
5002           */
5003          @Readable
5004          public static final String VOLUME_MUSIC = "volume_music";
5005  
5006          /**
5007           * Alarm volume. This is used internally, changing this
5008           * value will not change the volume. See AudioManager.
5009           *
5010           * @removed Not used by anything since API 2.
5011           */
5012          @Readable
5013          public static final String VOLUME_ALARM = "volume_alarm";
5014  
5015          /**
5016           * Notification volume. This is used internally, changing this
5017           * value will not change the volume. See AudioManager.
5018           *
5019           * @removed Not used by anything since API 2.
5020           */
5021          @Readable
5022          public static final String VOLUME_NOTIFICATION = "volume_notification";
5023  
5024          /**
5025           * Bluetooth Headset volume. This is used internally, changing this value will
5026           * not change the volume. See AudioManager.
5027           *
5028           * @removed Not used by anything since API 2.
5029           */
5030          @Readable
5031          public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
5032  
5033          /**
5034           * @hide
5035           * Acessibility volume. This is used internally, changing this
5036           * value will not change the volume.
5037           */
5038          @Readable
5039          public static final String VOLUME_ACCESSIBILITY = "volume_a11y";
5040  
5041          /**
5042           * @hide
5043           * Volume index for virtual assistant.
5044           */
5045          @Readable
5046          public static final String VOLUME_ASSISTANT = "volume_assistant";
5047  
5048          /**
5049           * Master volume (float in the range 0.0f to 1.0f).
5050           *
5051           * @hide
5052           */
5053          @Readable
5054          public static final String VOLUME_MASTER = "volume_master";
5055  
5056          /**
5057           * Master mono (int 1 = mono, 0 = normal).
5058           *
5059           * @hide
5060           */
5061          @UnsupportedAppUsage
5062          @Readable
5063          public static final String MASTER_MONO = "master_mono";
5064  
5065          /**
5066           * Master balance (float -1.f = 100% left, 0.f = dead center, 1.f = 100% right).
5067           *
5068           * @hide
5069           */
5070          @Readable
5071          public static final String MASTER_BALANCE = "master_balance";
5072  
5073          /**
5074           * Whether the notifications should use the ring volume (value of 1) or
5075           * a separate notification volume (value of 0). In most cases, users
5076           * will have this enabled so the notification and ringer volumes will be
5077           * the same. However, power users can disable this and use the separate
5078           * notification volume control.
5079           * <p>
5080           * Note: This is a one-off setting that will be removed in the future
5081           * when there is profile support. For this reason, it is kept hidden
5082           * from the public APIs.
5083           *
5084           * @hide
5085           * @deprecated
5086           */
5087          @Deprecated
5088          @Readable
5089          public static final String NOTIFICATIONS_USE_RING_VOLUME =
5090              "notifications_use_ring_volume";
5091  
5092          /**
5093           * Whether silent mode should allow vibration feedback. This is used
5094           * internally in AudioService and the Sound settings activity to
5095           * coordinate decoupling of vibrate and silent modes. This setting
5096           * will likely be removed in a future release with support for
5097           * audio/vibe feedback profiles.
5098           *
5099           * Not used anymore. On devices with vibrator, the user explicitly selects
5100           * silent or vibrate mode.
5101           * Kept for use by legacy database upgrade code in DatabaseHelper.
5102           * @hide
5103           */
5104          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5105          @Readable
5106          public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
5107  
5108          /**
5109           * The mapping of stream type (integer) to its setting.
5110           *
5111           * @removed  Not used by anything since API 2.
5112           */
5113          public static final String[] VOLUME_SETTINGS = {
5114              VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
5115              VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
5116          };
5117  
5118          /**
5119           * @hide
5120           * The mapping of stream type (integer) to its setting.
5121           * Unlike the VOLUME_SETTINGS array, this one contains as many entries as
5122           * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes
5123           * are never persisted.
5124           */
5125          public static final String[] VOLUME_SETTINGS_INT = {
5126                  VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
5127                  VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO,
5128                  "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/,
5129                  "" /*STREAM_DTMF, no setting for this stream*/,
5130                  "" /*STREAM_TTS, no setting for this stream*/,
5131                  VOLUME_ACCESSIBILITY, VOLUME_ASSISTANT
5132              };
5133  
5134          /**
5135           * Appended to various volume related settings to record the previous
5136           * values before they the settings were affected by a silent/vibrate
5137           * ringer mode change.
5138           *
5139           * @removed  Not used by anything since API 2.
5140           */
5141          @Readable
5142          public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
5143  
5144          /**
5145           * Persistent store for the system-wide default ringtone URI.
5146           * <p>
5147           * If you need to play the default ringtone at any given time, it is recommended
5148           * you give {@link #DEFAULT_RINGTONE_URI} to the media player.  It will resolve
5149           * to the set default ringtone at the time of playing.
5150           *
5151           * @see #DEFAULT_RINGTONE_URI
5152           */
5153          @Readable
5154          public static final String RINGTONE = "ringtone";
5155  
5156          /**
5157           * A {@link Uri} that will point to the current default ringtone at any
5158           * given time.
5159           * <p>
5160           * If the current default ringtone is in the DRM provider and the caller
5161           * does not have permission, the exception will be a
5162           * FileNotFoundException.
5163           */
5164          public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
5165  
5166          /** {@hide} */
5167          public static final String RINGTONE_CACHE = "ringtone_cache";
5168          /** {@hide} */
5169          public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE);
5170  
5171          /**
5172           * Persistent store for the system-wide default notification sound.
5173           *
5174           * @see #RINGTONE
5175           * @see #DEFAULT_NOTIFICATION_URI
5176           */
5177          @Readable
5178          public static final String NOTIFICATION_SOUND = "notification_sound";
5179  
5180          /**
5181           * A {@link Uri} that will point to the current default notification
5182           * sound at any given time.
5183           *
5184           * @see #DEFAULT_RINGTONE_URI
5185           */
5186          public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
5187  
5188          /** {@hide} */
5189          @Readable
5190          public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache";
5191          /** {@hide} */
5192          public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE);
5193  
5194          /**
5195           * Persistent store for the system-wide default alarm alert.
5196           *
5197           * @see #RINGTONE
5198           * @see #DEFAULT_ALARM_ALERT_URI
5199           */
5200          @Readable
5201          public static final String ALARM_ALERT = "alarm_alert";
5202  
5203          /**
5204           * A {@link Uri} that will point to the current default alarm alert at
5205           * any given time.
5206           *
5207           * @see #DEFAULT_ALARM_ALERT_URI
5208           */
5209          public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
5210  
5211          /** {@hide} */
5212          @Readable
5213          public static final String ALARM_ALERT_CACHE = "alarm_alert_cache";
5214          /** {@hide} */
5215          public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE);
5216  
5217          /**
5218           * Persistent store for the system default media button event receiver.
5219           *
5220           * @hide
5221           */
5222          @Readable(maxTargetSdk = Build.VERSION_CODES.R)
5223          public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
5224  
5225          /**
5226           * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
5227           */
5228          @Readable
5229          public static final String TEXT_AUTO_REPLACE = "auto_replace";
5230  
5231          /**
5232           * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
5233           */
5234          @Readable
5235          public static final String TEXT_AUTO_CAPS = "auto_caps";
5236  
5237          /**
5238           * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
5239           * feature converts two spaces to a "." and space.
5240           */
5241          @Readable
5242          public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
5243  
5244          /**
5245           * Setting to showing password characters in text editors. 1 = On, 0 = Off
5246           */
5247          @Readable
5248          public static final String TEXT_SHOW_PASSWORD = "show_password";
5249  
5250          @Readable
5251          public static final String SHOW_GTALK_SERVICE_STATUS =
5252                  "SHOW_GTALK_SERVICE_STATUS";
5253  
5254          /**
5255           * Name of activity to use for wallpaper on the home screen.
5256           *
5257           * @deprecated Use {@link WallpaperManager} instead.
5258           */
5259          @Deprecated
5260          @Readable
5261          public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
5262  
5263          /**
5264           * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
5265           * instead
5266           */
5267          @Deprecated
5268          public static final String AUTO_TIME = Global.AUTO_TIME;
5269  
5270          /**
5271           * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
5272           * instead
5273           */
5274          @Deprecated
5275          public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
5276  
5277          /**
5278           * Display the user's times, e.g. in the status bar, as 12 or 24 hours.
5279           * <ul>
5280           *    <li>24 = 24 hour</li>
5281           *    <li>12 = 12 hour</li>
5282           *    <li>[unset] = use the device locale's default</li>
5283           * </ul>
5284           */
5285          @Readable
5286          public static final String TIME_12_24 = "time_12_24";
5287  
5288          /**
5289           * @deprecated No longer used. Use {@link #TIME_12_24} instead.
5290           */
5291          @Deprecated
5292          @Readable
5293          public static final String DATE_FORMAT = "date_format";
5294  
5295          /**
5296           * Whether the setup wizard has been run before (on first boot), or if
5297           * it still needs to be run.
5298           *
5299           * nonzero = it has been run in the past
5300           * 0 = it has not been run in the past
5301           */
5302          @Readable
5303          public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
5304  
5305          /**
5306           * Scaling factor for normal window animations. Setting to 0 will disable window
5307           * animations.
5308           *
5309           * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
5310           */
5311          @Deprecated
5312          public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
5313  
5314          /**
5315           * Scaling factor for activity transition animations. Setting to 0 will disable window
5316           * animations.
5317           *
5318           * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
5319           */
5320          @Deprecated
5321          public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
5322  
5323          /**
5324           * Scaling factor for Animator-based animations. This affects both the start delay and
5325           * duration of all such animations. Setting to 0 will cause animations to end immediately.
5326           * The default value is 1.
5327           *
5328           * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
5329           */
5330          @Deprecated
5331          public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
5332  
5333          /**
5334           * Control whether the accelerometer will be used to change screen
5335           * orientation.  If 0, it will not be used unless explicitly requested
5336           * by the application; if 1, it will be used by default unless explicitly
5337           * disabled by the application.
5338           */
5339          @Readable
5340          public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
5341  
5342          /**
5343           * Default screen rotation when no other policy applies.
5344           * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
5345           * preference, this rotation value will be used. Must be one of the
5346           * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
5347           *
5348           * @see Display#getRotation
5349           */
5350          @Readable
5351          public static final String USER_ROTATION = "user_rotation";
5352  
5353          /**
5354           * Control whether the rotation lock toggle in the System UI should be hidden.
5355           * Typically this is done for accessibility purposes to make it harder for
5356           * the user to accidentally toggle the rotation lock while the display rotation
5357           * has been locked for accessibility.
5358           *
5359           * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
5360           * unavailable for other reasons).  If 1, then the rotation lock toggle is hidden.
5361           *
5362           * @hide
5363           */
5364          @UnsupportedAppUsage
5365          @Readable
5366          public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
5367                  "hide_rotation_lock_toggle_for_accessibility";
5368  
5369          /**
5370           * Whether the phone vibrates when it is ringing due to an incoming call. This will
5371           * be used by Phone and Setting apps; it shouldn't affect other apps.
5372           * The value is boolean (1 or 0).
5373           *
5374           * Note: this is not same as "vibrate on ring", which had been available until ICS.
5375           * It was about AudioManager's setting and thus affected all the applications which
5376           * relied on the setting, while this is purely about the vibration setting for incoming
5377           * calls.
5378           *
5379           * @deprecated Replaced by using {@link android.os.VibrationAttributes#USAGE_RINGTONE} on
5380           * vibrations for incoming calls. User settings are applied automatically by the service and
5381           * should not be applied by individual apps.
5382           */
5383          @Deprecated
5384          @Readable
5385          public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
5386  
5387          /**
5388           * When {@code 1}, Telecom enhanced call blocking functionality is enabled.  When
5389           * {@code 0}, enhanced call blocking functionality is disabled.
5390           * @hide
5391           */
5392          @Readable
5393          public static final String DEBUG_ENABLE_ENHANCED_CALL_BLOCKING =
5394                  "debug.enable_enhanced_calling";
5395  
5396          /**
5397           * Whether the audible DTMF tones are played by the dialer when dialing. The value is
5398           * boolean (1 or 0).
5399           */
5400          @Readable
5401          public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
5402  
5403          /**
5404           * CDMA only settings
5405           * DTMF tone type played by the dialer when dialing.
5406           *                 0 = Normal
5407           *                 1 = Long
5408           */
5409          @Readable
5410          public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
5411  
5412          /**
5413           * Whether the hearing aid is enabled. The value is
5414           * boolean (1 or 0).
5415           * @hide
5416           */
5417          @UnsupportedAppUsage
5418          @Readable
5419          public static final String HEARING_AID = "hearing_aid";
5420  
5421          /**
5422           * CDMA only settings
5423           * TTY Mode
5424           * 0 = OFF
5425           * 1 = FULL
5426           * 2 = VCO
5427           * 3 = HCO
5428           * @hide
5429           */
5430          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5431          @Readable
5432          public static final String TTY_MODE = "tty_mode";
5433  
5434          /**
5435           * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
5436           * boolean (1 or 0).
5437           */
5438          @Readable
5439          public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
5440  
5441          /**
5442           * Whether haptic feedback (Vibrate on tap) is enabled. The value is
5443           * boolean (1 or 0).
5444           *
5445           * @deprecated Replaced by using {@link android.os.VibrationAttributes#USAGE_TOUCH} on
5446           * vibrations. User settings are applied automatically by the service and should not be
5447           * applied by individual apps.
5448           */
5449          @Deprecated
5450          @Readable
5451          public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
5452  
5453          /**
5454           * @deprecated Each application that shows web suggestions should have its own
5455           * setting for this.
5456           */
5457          @Deprecated
5458          @Readable
5459          public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
5460  
5461          /**
5462           * Whether the notification LED should repeatedly flash when a notification is
5463           * pending. The value is boolean (1 or 0).
5464           * @hide
5465           */
5466          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5467          @Readable
5468          public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
5469  
5470          /**
5471           * Show pointer location on screen?
5472           * 0 = no
5473           * 1 = yes
5474           * @hide
5475           */
5476          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5477          @Readable
5478          public static final String POINTER_LOCATION = "pointer_location";
5479  
5480          /**
5481           * Show touch positions on screen?
5482           * 0 = no
5483           * 1 = yes
5484           * @hide
5485           */
5486          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5487          @Readable
5488          public static final String SHOW_TOUCHES = "show_touches";
5489  
5490          /**
5491           * Show key presses and other events dispatched to focused windows on the screen.
5492           * 0 = no
5493           * 1 = yes
5494           * @hide
5495           */
5496          public static final String SHOW_KEY_PRESSES = "show_key_presses";
5497  
5498          /**
5499           * Log raw orientation data from
5500           * {@link com.android.server.policy.WindowOrientationListener} for use with the
5501           * orientationplot.py tool.
5502           * 0 = no
5503           * 1 = yes
5504           * @hide
5505           */
5506          @Readable
5507          public static final String WINDOW_ORIENTATION_LISTENER_LOG =
5508                  "window_orientation_listener_log";
5509  
5510          /**
5511           * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
5512           * instead
5513           * @hide
5514           */
5515          @Deprecated
5516          public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
5517  
5518          /**
5519           * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
5520           * instead
5521           * @hide
5522           */
5523          @Deprecated
5524          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5525          public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
5526  
5527          /**
5528           * Whether to play sounds when the keyguard is shown and dismissed.
5529           * @hide
5530           */
5531          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5532          @Readable
5533          public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
5534  
5535          /**
5536           * Whether the lockscreen should be completely disabled.
5537           * @hide
5538           */
5539          @Readable
5540          public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
5541  
5542          /**
5543           * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
5544           * instead
5545           * @hide
5546           */
5547          @Deprecated
5548          public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
5549  
5550          /**
5551           * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
5552           * instead
5553           * @hide
5554           */
5555          @Deprecated
5556          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5557          public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
5558  
5559          /**
5560           * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
5561           * instead
5562           * @hide
5563           */
5564          @Deprecated
5565          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5566          public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
5567  
5568          /**
5569           * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
5570           * instead
5571           * @hide
5572           */
5573          @Deprecated
5574          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5575          public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
5576  
5577          /**
5578           * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
5579           * instead
5580           * @hide
5581           */
5582          @Deprecated
5583          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5584          public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
5585  
5586          /**
5587           * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
5588           * instead
5589           * @hide
5590           */
5591          @Deprecated
5592          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5593          public static final String LOCK_SOUND = Global.LOCK_SOUND;
5594  
5595          /**
5596           * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
5597           * instead
5598           * @hide
5599           */
5600          @Deprecated
5601          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5602          public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
5603  
5604          /**
5605           * Receive incoming SIP calls?
5606           * 0 = no
5607           * 1 = yes
5608           * @hide
5609           */
5610          @Readable
5611          public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
5612  
5613          /**
5614           * Call Preference String.
5615           * "SIP_ALWAYS" : Always use SIP with network access
5616           * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
5617           * @hide
5618           */
5619          @Readable
5620          public static final String SIP_CALL_OPTIONS = "sip_call_options";
5621  
5622          /**
5623           * One of the sip call options: Always use SIP with network access.
5624           * @hide
5625           */
5626          @Readable
5627          public static final String SIP_ALWAYS = "SIP_ALWAYS";
5628  
5629          /**
5630           * One of the sip call options: Only if destination is a SIP address.
5631           * @hide
5632           */
5633          @Readable
5634          public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
5635  
5636          /**
5637           * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead.  Formerly used to indicate that
5638           * the user should be prompted each time a call is made whether it should be placed using
5639           * SIP.  The {@link com.android.providers.settings.DatabaseHelper} replaces this with
5640           * SIP_ADDRESS_ONLY.
5641           * @hide
5642           */
5643          @Deprecated
5644          @Readable
5645          public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
5646  
5647          /**
5648           * Pointer speed setting.
5649           * This is an integer value in a range between -7 and +7, so there are 15 possible values.
5650           *   -7 = slowest
5651           *    0 = default speed
5652           *   +7 = fastest
5653           * @hide
5654           */
5655          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5656          @Readable
5657          public static final String POINTER_SPEED = "pointer_speed";
5658  
5659          /**
5660           * Touchpad pointer speed setting.
5661           * This is an integer value in a range between -7 and +7, so there are 15 possible values.
5662           *   -7 = slowest
5663           *    0 = default speed
5664           *   +7 = fastest
5665           * @hide
5666           */
5667          public static final String TOUCHPAD_POINTER_SPEED = "touchpad_pointer_speed";
5668  
5669          /**
5670           * Whether to invert the touchpad scrolling direction.
5671           *
5672           * If set to 1 (the default), moving two fingers downwards on the touchpad will scroll
5673           * upwards, consistent with normal touchscreen scrolling. If set to 0, moving two fingers
5674           * downwards will scroll downwards.
5675           *
5676           * @hide
5677           */
5678          public static final String TOUCHPAD_NATURAL_SCROLLING = "touchpad_natural_scrolling";
5679  
5680          /**
5681           * Whether to enable tap-to-click on touchpads.
5682           *
5683           * @hide
5684           */
5685          public static final String TOUCHPAD_TAP_TO_CLICK = "touchpad_tap_to_click";
5686  
5687          /**
5688           * Whether to enable a right-click zone on touchpads.
5689           *
5690           * When set to 1, pressing to click in a section on the right-hand side of the touchpad will
5691           * result in a context click (a.k.a. right click).
5692           *
5693           * @hide
5694           */
5695          public static final String TOUCHPAD_RIGHT_CLICK_ZONE = "touchpad_right_click_zone";
5696  
5697          /**
5698           * Whether lock-to-app will be triggered by long-press on recents.
5699           * @hide
5700           */
5701          @Readable
5702          public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
5703  
5704          /**
5705           * I am the lolrus.
5706           * <p>
5707           * Nonzero values indicate that the user has a bukkit.
5708           * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
5709           * @hide
5710           */
5711          @Readable
5712          public static final String EGG_MODE = "egg_mode";
5713  
5714          /**
5715           * Setting to determine whether or not to show the battery percentage in the status bar.
5716           *    0 - Don't show percentage
5717           *    1 - Show percentage
5718           * @hide
5719           */
5720          @Readable
5721          public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent";
5722  
5723          /**
5724           * Whether or not to enable multiple audio focus.
5725           * When enabled, requires more management by user over application playback activity,
5726           * for instance pausing media apps when another starts.
5727           * @hide
5728           */
5729          @Readable
5730          public static final String MULTI_AUDIO_FOCUS_ENABLED = "multi_audio_focus_enabled";
5731  
5732          /**
5733           * Whether desktop mode is enabled or not.
5734           * 0 = off
5735           * 1 = on
5736           * @hide
5737           */
5738          @Readable
5739          public static final String DESKTOP_MODE = "desktop_mode";
5740  
5741          /**
5742           * The information of locale preference. This records user's preference to avoid
5743           * unsynchronized and existing locale preference in
5744           * {@link Locale#getDefault(Locale.Category)}.
5745           *
5746           * <p><b>Note:</b> The format follow the
5747           * <a href="https://www.rfc-editor.org/rfc/bcp/bcp47.txt">IETF BCP47 expression</a>
5748           *
5749           * E.g. : und-u-ca-gregorian-hc-h23
5750           * @hide
5751           */
5752          public static final String LOCALE_PREFERENCES = "locale_preferences";
5753  
5754          /**
5755           * Setting to enable camera flash notification feature.
5756           * <ul>
5757           *     <li> 0 = Off
5758           *     <li> 1 = On
5759           * </ul>
5760           * @hide
5761           */
5762          public static final String CAMERA_FLASH_NOTIFICATION = "camera_flash_notification";
5763  
5764          /**
5765           * Setting to enable screen flash notification feature.
5766           * <ul>
5767           *     <li> 0 = Off
5768           *     <li> 1 = On
5769           * </ul>
5770           *  @hide
5771           */
5772          public static final String SCREEN_FLASH_NOTIFICATION = "screen_flash_notification";
5773  
5774          /**
5775           * Integer property that specifes the color for screen flash notification as a
5776           * packed 32-bit color.
5777           *
5778           * @see android.graphics.Color#argb
5779           * @hide
5780           */
5781          public static final String SCREEN_FLASH_NOTIFICATION_COLOR =
5782                  "screen_flash_notification_color_global";
5783  
5784          /**
5785           * IMPORTANT: If you add a new public settings you also have to add it to
5786           * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
5787           * it to PRIVATE_SETTINGS below. Also add a validator that can validate
5788           * the setting value. See an example above.
5789           */
5790  
5791          /**
5792           * Keys we no longer back up under the current schema, but want to continue to
5793           * process when restoring historical backup datasets.
5794           *
5795           * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
5796           * otherwise they won't be restored.
5797           *
5798           * @hide
5799           */
5800          public static final String[] LEGACY_RESTORE_SETTINGS = {
5801          };
5802  
5803          /**
5804           * These are all public system settings
5805           *
5806           * @hide
5807           */
5808          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5809          public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
5810          static {
5811              PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
5812              PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
5813              PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
5814              PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
5815              PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
5816              PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
5817              PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
5818              PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
5819              PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
5820              PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
5821              PUBLIC_SETTINGS.add(FONT_SCALE);
5822              PUBLIC_SETTINGS.add(SYSTEM_LOCALES);
5823              PUBLIC_SETTINGS.add(DIM_SCREEN);
5824              PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
5825              PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
5826              PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FLOAT);
5827              PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
5828              PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
5829              PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
5830              PUBLIC_SETTINGS.add(VIBRATE_ON);
5831              PUBLIC_SETTINGS.add(VOLUME_RING);
5832              PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
5833              PUBLIC_SETTINGS.add(VOLUME_VOICE);
5834              PUBLIC_SETTINGS.add(VOLUME_MUSIC);
5835              PUBLIC_SETTINGS.add(VOLUME_ALARM);
5836              PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
5837              PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
5838              PUBLIC_SETTINGS.add(VOLUME_ASSISTANT);
5839              PUBLIC_SETTINGS.add(RINGTONE);
5840              PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
5841              PUBLIC_SETTINGS.add(ALARM_ALERT);
5842              PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
5843              PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
5844              PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
5845              PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
5846              PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
5847              PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
5848              PUBLIC_SETTINGS.add(TIME_12_24);
5849              PUBLIC_SETTINGS.add(DATE_FORMAT);
5850              PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
5851              PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
5852              PUBLIC_SETTINGS.add(USER_ROTATION);
5853              PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
5854              PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
5855              PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
5856              PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
5857              PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING);
5858              PUBLIC_SETTINGS.add(APPLY_RAMPING_RINGER);
5859          }
5860  
5861          /**
5862           * These are all hidden system settings.
5863           *
5864           * @hide
5865           */
5866          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5867          public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
5868          static {
5869              PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
5870              PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
5871              PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
5872              PRIVATE_SETTINGS.add(WEAR_ACCESSIBILITY_GESTURE_ENABLED);
5873              PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
5874              PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
5875              PRIVATE_SETTINGS.add(VOLUME_MASTER);
5876              PRIVATE_SETTINGS.add(MASTER_MONO);
5877              PRIVATE_SETTINGS.add(MASTER_BALANCE);
5878              PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
5879              PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
5880              PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
5881              PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
5882              PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
5883              PRIVATE_SETTINGS.add(HEARING_AID);
5884              PRIVATE_SETTINGS.add(TTY_MODE);
5885              PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
5886              PRIVATE_SETTINGS.add(POINTER_LOCATION);
5887              PRIVATE_SETTINGS.add(SHOW_TOUCHES);
5888              PRIVATE_SETTINGS.add(SHOW_KEY_PRESSES);
5889              PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
5890              PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
5891              PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
5892              PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
5893              PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
5894              PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
5895              PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
5896              PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
5897              PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
5898              PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
5899              PRIVATE_SETTINGS.add(LOCK_SOUND);
5900              PRIVATE_SETTINGS.add(UNLOCK_SOUND);
5901              PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
5902              PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
5903              PRIVATE_SETTINGS.add(SIP_ALWAYS);
5904              PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
5905              PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
5906              PRIVATE_SETTINGS.add(POINTER_SPEED);
5907              PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
5908              PRIVATE_SETTINGS.add(EGG_MODE);
5909              PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT);
5910              PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE);
5911              PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE_VENDOR_HINT);
5912              PRIVATE_SETTINGS.add(DESKTOP_MODE);
5913              PRIVATE_SETTINGS.add(LOCALE_PREFERENCES);
5914              PRIVATE_SETTINGS.add(TOUCHPAD_POINTER_SPEED);
5915              PRIVATE_SETTINGS.add(TOUCHPAD_NATURAL_SCROLLING);
5916              PRIVATE_SETTINGS.add(TOUCHPAD_TAP_TO_CLICK);
5917              PRIVATE_SETTINGS.add(TOUCHPAD_RIGHT_CLICK_ZONE);
5918              PRIVATE_SETTINGS.add(CAMERA_FLASH_NOTIFICATION);
5919              PRIVATE_SETTINGS.add(SCREEN_FLASH_NOTIFICATION);
5920              PRIVATE_SETTINGS.add(SCREEN_FLASH_NOTIFICATION_COLOR);
5921          }
5922  
5923          /**
5924           * These entries are considered common between the personal and the managed profile,
5925           * since the managed profile doesn't get to change them.
5926           */
5927          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
5928          private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
5929          static {
5930              CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
5931              CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
5932              CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
5933              CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
5934              CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
5935          }
5936  
5937          /** @hide */
getCloneToManagedProfileSettings(Set<String> outKeySet)5938          public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
5939              outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
5940          }
5941  
5942          /**
5943           * These entries should be cloned from this profile's parent only if the dependency's
5944           * value is true ("1")
5945           *
5946           * Note: the dependencies must be Secure settings
5947           *
5948           * @hide
5949           */
5950          public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>();
5951          static {
CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS)5952              CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS);
CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS)5953              CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS);
CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS)5954              CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS);
5955          }
5956  
5957          /** @hide */
getCloneFromParentOnValueSettings(Map<String, String> outMap)5958          public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) {
5959              outMap.putAll(CLONE_FROM_PARENT_ON_VALUE);
5960          }
5961  
5962          /**
5963           * System settings which can be accessed by instant apps.
5964           * @hide
5965           */
5966          public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
5967          static {
5968              INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE);
5969              INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS);
5970              INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
5971              INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD);
5972              INSTANT_APP_SETTINGS.add(DATE_FORMAT);
5973              INSTANT_APP_SETTINGS.add(FONT_SCALE);
5974              INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
5975              INSTANT_APP_SETTINGS.add(TIME_12_24);
5976              INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED);
5977              INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION);
5978          }
5979  
5980          /**
5981           * When to use Wi-Fi calling
5982           *
5983           * @see android.telephony.TelephonyManager.WifiCallingChoices
5984           * @hide
5985           */
5986          @Readable
5987          public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
5988  
5989          /** Controls whether bluetooth is on or off on wearable devices.
5990           *
5991           * <p>The valid values for this key are: 0 (disabled) or 1 (enabled).
5992           *
5993           * @hide
5994           */
5995          public static final String CLOCKWORK_BLUETOOTH_SETTINGS_PREF = "cw_bt_settings_pref";
5996  
5997          /**
5998           * Controls whether the unread notification dot indicator is shown on wearable devices.
5999           *
6000           * <p>The valid values for this key are: 0 (disabled) or 1 (enabled).
6001           *
6002           * @hide
6003           */
6004          public static final String UNREAD_NOTIFICATION_DOT_INDICATOR =
6005                  "unread_notification_dot_indicator";
6006  
6007          /**
6008           * Controls whether auto-launching media controls is enabled on wearable devices.
6009           *
6010           * <p>The valid values for this key are: 0 (disabled) or 1 (enabled).
6011           *
6012           * @hide
6013           */
6014          public static final String AUTO_LAUNCH_MEDIA_CONTROLS = "auto_launch_media_controls";
6015  
6016          // Settings moved to Settings.Secure
6017  
6018          /**
6019           * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
6020           * instead
6021           */
6022          @Deprecated
6023          public static final String ADB_ENABLED = Global.ADB_ENABLED;
6024  
6025          /**
6026           * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
6027           */
6028          @Deprecated
6029          public static final String ANDROID_ID = Secure.ANDROID_ID;
6030  
6031          /**
6032           * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
6033           */
6034          @Deprecated
6035          public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
6036  
6037          /**
6038           * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
6039           */
6040          @Deprecated
6041          public static final String DATA_ROAMING = Global.DATA_ROAMING;
6042  
6043          /**
6044           * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
6045           */
6046          @Deprecated
6047          public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
6048  
6049          /**
6050           * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
6051           */
6052          @Deprecated
6053          public static final String HTTP_PROXY = Global.HTTP_PROXY;
6054  
6055          /**
6056           * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
6057           */
6058          @Deprecated
6059          public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
6060  
6061          /**
6062           * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
6063           * instead
6064           */
6065          @Deprecated
6066          public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
6067  
6068          /**
6069           * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
6070           */
6071          @Deprecated
6072          public static final String LOGGING_ID = Secure.LOGGING_ID;
6073  
6074          /**
6075           * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
6076           */
6077          @Deprecated
6078          public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
6079  
6080          /**
6081           * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
6082           * instead
6083           */
6084          @Deprecated
6085          public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
6086  
6087          /**
6088           * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
6089           * instead
6090           */
6091          @Deprecated
6092          public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
6093  
6094          /**
6095           * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
6096           * instead
6097           */
6098          @Deprecated
6099          public static final String PARENTAL_CONTROL_REDIRECT_URL =
6100              Secure.PARENTAL_CONTROL_REDIRECT_URL;
6101  
6102          /**
6103           * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
6104           */
6105          @Deprecated
6106          public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
6107  
6108          /**
6109           * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
6110           */
6111          @Deprecated
6112          public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
6113  
6114          /**
6115           * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
6116           */
6117          @Deprecated
6118          public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
6119  
6120         /**
6121           * @deprecated Use
6122           * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
6123           */
6124          @Deprecated
6125          public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
6126  
6127          /**
6128           * @deprecated Use
6129           * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
6130           */
6131          @Deprecated
6132          public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
6133                  Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
6134  
6135          /**
6136           * @deprecated Use
6137           * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
6138           */
6139          @Deprecated
6140          public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6141                  Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
6142  
6143          /**
6144           * @deprecated Use
6145           * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
6146           */
6147          @Deprecated
6148          public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
6149                  Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
6150  
6151          /**
6152           * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
6153           * instead
6154           */
6155          @Deprecated
6156          public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
6157  
6158          /**
6159           * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
6160           */
6161          @Deprecated
6162          public static final String WIFI_ON = Global.WIFI_ON;
6163  
6164          /**
6165           * @deprecated Use
6166           * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
6167           * instead
6168           */
6169          @Deprecated
6170          @Readable
6171          public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
6172                  Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
6173  
6174          /**
6175           * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
6176           */
6177          @Deprecated
6178          public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
6179  
6180          /**
6181           * @deprecated Use
6182           * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
6183           */
6184          @Deprecated
6185          @Readable
6186          public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
6187                  Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
6188  
6189          /**
6190           * @deprecated Use
6191           * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
6192           */
6193          @Deprecated
6194          @Readable
6195          public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
6196                  Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
6197  
6198          /**
6199           * @deprecated Use
6200           * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
6201           * instead
6202           */
6203          @Deprecated
6204          @Readable
6205          public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
6206                  Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
6207  
6208          /**
6209           * @deprecated Use
6210           * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
6211           */
6212          @Deprecated
6213          @Readable
6214          public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
6215              Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
6216  
6217          /**
6218           * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
6219           * instead
6220           */
6221          @Deprecated
6222          public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
6223  
6224          /**
6225           * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
6226           */
6227          @Deprecated
6228          public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
6229  
6230          /**
6231           * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
6232           */
6233          @Deprecated
6234          public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
6235  
6236          /**
6237           * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
6238           * instead
6239           */
6240          @Deprecated
6241          public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
6242  
6243          /**
6244           * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
6245           * instead
6246           */
6247          @Deprecated
6248          @Readable
6249          public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
6250              Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
6251  
6252          /**
6253           * Checks if the specified app can modify system settings. As of API
6254           * level 23, an app cannot modify system settings unless it declares the
6255           * {@link android.Manifest.permission#WRITE_SETTINGS}
6256           * permission in its manifest, <em>and</em> the user specifically grants
6257           * the app this capability. To prompt the user to grant this approval,
6258           * the app must send an intent with the action {@link
6259           * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes
6260           * the system to display a permission management screen.
6261           *
6262           * @param context App context.
6263           * @return true if the calling app can write to system settings, false otherwise
6264           */
canWrite(Context context)6265          public static boolean canWrite(Context context) {
6266              return isCallingPackageAllowedToWriteSettings(context, Process.myUid(),
6267                      context.getOpPackageName(), false);
6268          }
6269      }
6270  
6271      /**
6272       * Secure system settings, containing system preferences that applications
6273       * can read but are not allowed to write.  These are for preferences that
6274       * the user must explicitly modify through the UI of a system app. Normal
6275       * applications cannot modify the secure settings database, either directly
6276       * or by calling the "put" methods that this class contains.
6277       */
6278      public static final class Secure extends NameValueTable {
6279          // NOTE: If you add new settings here, be sure to add them to
6280          // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked.
6281  
6282          /**
6283           * The content:// style URL for this table
6284           */
6285          public static final Uri CONTENT_URI =
6286              Uri.parse("content://" + AUTHORITY + "/secure");
6287  
6288          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
6289          private static final ContentProviderHolder sProviderHolder =
6290                  new ContentProviderHolder(CONTENT_URI);
6291  
6292          // Populated lazily, guarded by class object:
6293          @UnsupportedAppUsage
6294          private static final NameValueCache sNameValueCache = new NameValueCache(
6295                  CONTENT_URI,
6296                  CALL_METHOD_GET_SECURE,
6297                  CALL_METHOD_PUT_SECURE,
6298                  CALL_METHOD_DELETE_SECURE,
6299                  sProviderHolder,
6300                  Secure.class);
6301  
6302          @UnsupportedAppUsage
6303          private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
6304          @UnsupportedAppUsage
6305          private static final HashSet<String> MOVED_TO_GLOBAL;
6306          static {
6307              MOVED_TO_LOCK_SETTINGS = new HashSet<>(3);
6308              MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
6309              MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
6310              MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
6311  
6312              MOVED_TO_GLOBAL = new HashSet<>();
6313              MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
6314              MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
6315              MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
6316              MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
6317              MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
6318              MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
6319              MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
6320              MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
6321              MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
6322              MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
6323              MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
6324              MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
6325              MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
6326              MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
6327              MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
6328              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
6329              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
6330              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
6331              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
6332              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
6333              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
6334              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
6335              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
6336              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
6337              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
6338              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
6339              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
6340              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
6341              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
6342              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
6343              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
6344              MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
6345              MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
6346              MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
6347              MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
6348              MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
6349              MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
6350              MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
6351              MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
6352              MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
6353              MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
6354              MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
6355              MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
6356              MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
6357              MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
6358              MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
6359              MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
6360              MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
6361              MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
6362              MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
6363              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
6364              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
6365              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
6366              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
6367              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
6368              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
6369              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
6370              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
6371              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
6372              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
6373              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
6374              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
6375              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED);
6376              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
6377              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
6378              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
6379              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
6380              MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_PENDING_FACTORY_RESET);
6381              MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
6382              MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
6383              MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
6384              MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
6385              MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
6386              MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
6387              MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
6388              MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
6389              MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
6390              MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
6391              MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
6392              MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
6393              MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
6394              MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
6395              MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
6396              MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
6397              MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
6398              MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
6399              MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
6400              MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
6401              MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
6402              MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
6403              MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
6404              MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
6405              MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
6406              MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
6407              MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
6408              MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
6409              MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
6410              MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
6411              MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
6412              MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
6413              MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
6414              MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
6415              MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
6416              MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
6417              MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
6418              MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
6419              MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
6420              MOVED_TO_GLOBAL.add(Settings.Global.SECURE_FRP_MODE);
6421          }
6422  
6423          /** @hide */
getMovedToGlobalSettings(Set<String> outKeySet)6424          public static void getMovedToGlobalSettings(Set<String> outKeySet) {
6425              outKeySet.addAll(MOVED_TO_GLOBAL);
6426          }
6427  
6428          /** @hide */
getMovedToSystemSettings(Set<String> outKeySet)6429          public static void getMovedToSystemSettings(Set<String> outKeySet) {
6430          }
6431  
6432          /** @hide */
clearProviderForTest()6433          public static void clearProviderForTest() {
6434              sProviderHolder.clearProviderForTest();
6435              sNameValueCache.clearGenerationTrackerForTest();
6436          }
6437  
6438          /** @hide */
getPublicSettings(Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> readableKeysWithMaxTargetSdk)6439          public static void getPublicSettings(Set<String> allKeys, Set<String> readableKeys,
6440                  ArrayMap<String, Integer> readableKeysWithMaxTargetSdk) {
6441              getPublicSettingsForClass(Secure.class, allKeys, readableKeys,
6442                      readableKeysWithMaxTargetSdk);
6443          }
6444  
6445          /**
6446           * Look up a name in the database.
6447           * @param resolver to access the database with
6448           * @param name to look up in the table
6449           * @return the corresponding value, or null if not present
6450           */
getString(ContentResolver resolver, String name)6451          public static String getString(ContentResolver resolver, String name) {
6452              return getStringForUser(resolver, name, resolver.getUserId());
6453          }
6454  
6455          /** @hide */
6456          @UnsupportedAppUsage
getStringForUser(ContentResolver resolver, String name, int userHandle)6457          public static String getStringForUser(ContentResolver resolver, String name,
6458                  int userHandle) {
6459              if (MOVED_TO_GLOBAL.contains(name)) {
6460                  Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
6461                          + " to android.provider.Settings.Global.");
6462                  return Global.getStringForUser(resolver, name, userHandle);
6463              }
6464  
6465              if (MOVED_TO_LOCK_SETTINGS.contains(name) && Process.myUid() != Process.SYSTEM_UID) {
6466                  // No context; use the ActivityThread's context as an approximation for
6467                  // determining the target API level.
6468                  Application application = ActivityThread.currentApplication();
6469  
6470                  boolean isPreMnc = application != null
6471                      && application.getApplicationInfo() != null
6472                      && application.getApplicationInfo().targetSdkVersion
6473                      <= VERSION_CODES.LOLLIPOP_MR1;
6474                  if (isPreMnc) {
6475                      // Old apps used to get the three deprecated LOCK_PATTERN_* settings from
6476                      // ILockSettings.getString().  For security reasons, we now just return a
6477                      // stubbed-out value.  Note: the only one of these three settings actually known
6478                      // to have been used was LOCK_PATTERN_ENABLED, and ILockSettings.getString()
6479                      // already always returned "0" for that starting in Android 11.
6480                      return "0";
6481                  }
6482                  throw new SecurityException("Settings.Secure." + name + " is deprecated and no" +
6483                          " longer accessible. See API documentation for potential replacements.");
6484              }
6485  
6486              return sNameValueCache.getStringForUser(resolver, name, userHandle);
6487          }
6488  
6489          /**
6490           * Store a name/value pair into the database. Values written by this method will be
6491           * overridden if a restore happens in the future.
6492           *
6493           * @param resolver to access the database with
6494           * @param name to store
6495           * @param value to associate with the name
6496           * @return true if the value was set, false on database errors
6497           *
6498           * @hide
6499           */
6500          @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE)
putString(ContentResolver resolver, String name, String value, boolean overrideableByRestore)6501          public static boolean putString(ContentResolver resolver, String name,
6502                  String value, boolean overrideableByRestore) {
6503              return putStringForUser(resolver, name, value, /* tag */ null, /* makeDefault */ false,
6504                      resolver.getUserId(), overrideableByRestore);
6505          }
6506  
6507          /**
6508           * Store a name/value pair into the database.
6509           * @param resolver to access the database with
6510           * @param name to store
6511           * @param value to associate with the name
6512           * @return true if the value was set, false on database errors
6513           */
putString(ContentResolver resolver, String name, String value)6514          public static boolean putString(ContentResolver resolver, String name, String value) {
6515              return putStringForUser(resolver, name, value, resolver.getUserId());
6516          }
6517  
6518          /** @hide */
6519          @UnsupportedAppUsage
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)6520          public static boolean putStringForUser(ContentResolver resolver, String name, String value,
6521                  int userHandle) {
6522              return putStringForUser(resolver, name, value, null, false, userHandle,
6523                      DEFAULT_OVERRIDEABLE_BY_RESTORE);
6524          }
6525  
6526          /** @hide */
6527          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore)6528          public static boolean putStringForUser(@NonNull ContentResolver resolver,
6529                  @NonNull String name, @Nullable String value, @Nullable String tag,
6530                  boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore) {
6531              if (LOCAL_LOGV) {
6532                  Log.v(TAG, "Secure.putString(name=" + name + ", value=" + value + ") for "
6533                          + userHandle);
6534              }
6535              if (MOVED_TO_GLOBAL.contains(name)) {
6536                  Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
6537                          + " to android.provider.Settings.Global");
6538                  return Global.putStringForUser(resolver, name, value,
6539                          tag, makeDefault, userHandle, DEFAULT_OVERRIDEABLE_BY_RESTORE);
6540              }
6541              return sNameValueCache.putStringForUser(resolver, name, value, tag,
6542                      makeDefault, userHandle, overrideableByRestore);
6543          }
6544  
6545          /**
6546           * Store a name/value pair into the database.
6547           * <p>
6548           * The method takes an optional tag to associate with the setting
6549           * which can be used to clear only settings made by your package and
6550           * associated with this tag by passing the tag to {@link
6551           * #resetToDefaults(ContentResolver, String)}. Anyone can override
6552           * the current tag. Also if another package changes the setting
6553           * then the tag will be set to the one specified in the set call
6554           * which can be null. Also any of the settings setters that do not
6555           * take a tag as an argument effectively clears the tag.
6556           * </p><p>
6557           * For example, if you set settings A and B with tags T1 and T2 and
6558           * another app changes setting A (potentially to the same value), it
6559           * can assign to it a tag T3 (note that now the package that changed
6560           * the setting is not yours). Now if you reset your changes for T1 and
6561           * T2 only setting B will be reset and A not (as it was changed by
6562           * another package) but since A did not change you are in the desired
6563           * initial state. Now if the other app changes the value of A (assuming
6564           * you registered an observer in the beginning) you would detect that
6565           * the setting was changed by another app and handle this appropriately
6566           * (ignore, set back to some value, etc).
6567           * </p><p>
6568           * Also the method takes an argument whether to make the value the
6569           * default for this setting. If the system already specified a default
6570           * value, then the one passed in here will <strong>not</strong>
6571           * be set as the default.
6572           * </p>
6573           *
6574           * @param resolver to access the database with.
6575           * @param name to store.
6576           * @param value to associate with the name.
6577           * @param tag to associate with the setting.
6578           * @param makeDefault whether to make the value the default one.
6579           * @return true if the value was set, false on database errors.
6580           *
6581           * @see #resetToDefaults(ContentResolver, String)
6582           *
6583           * @hide
6584           */
6585          @SystemApi
6586          @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)6587          public static boolean putString(@NonNull ContentResolver resolver,
6588                  @NonNull String name, @Nullable String value, @Nullable String tag,
6589                  boolean makeDefault) {
6590              return putStringForUser(resolver, name, value, tag, makeDefault,
6591                      resolver.getUserId(), DEFAULT_OVERRIDEABLE_BY_RESTORE);
6592          }
6593  
6594          /**
6595           * Reset the settings to their defaults. This would reset <strong>only</strong>
6596           * settings set by the caller's package. Think of it of a way to undo your own
6597           * changes to the global settings. Passing in the optional tag will reset only
6598           * settings changed by your package and associated with this tag.
6599           *
6600           * @param resolver Handle to the content resolver.
6601           * @param tag Optional tag which should be associated with the settings to reset.
6602           *
6603           * @see #putString(ContentResolver, String, String, String, boolean)
6604           *
6605           * @hide
6606           */
6607          @SystemApi
6608          @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)6609          public static void resetToDefaults(@NonNull ContentResolver resolver,
6610                  @Nullable String tag) {
6611              resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
6612                      resolver.getUserId());
6613          }
6614  
6615          /**
6616           *
6617           * Reset the settings to their defaults for a given user with a specific mode. The
6618           * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
6619           * allowing resetting the settings made by a package and associated with the tag.
6620           *
6621           * @param resolver Handle to the content resolver.
6622           * @param tag Optional tag which should be associated with the settings to reset.
6623           * @param mode The reset mode.
6624           * @param userHandle The user for which to reset to defaults.
6625           *
6626           * @see #RESET_MODE_PACKAGE_DEFAULTS
6627           * @see #RESET_MODE_UNTRUSTED_DEFAULTS
6628           * @see #RESET_MODE_UNTRUSTED_CHANGES
6629           * @see #RESET_MODE_TRUSTED_DEFAULTS
6630           *
6631           * @hide
6632           */
resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)6633          public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
6634                  @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
6635              try {
6636                  Bundle arg = new Bundle();
6637                  arg.putInt(CALL_METHOD_USER_KEY, userHandle);
6638                  if (tag != null) {
6639                      arg.putString(CALL_METHOD_TAG_KEY, tag);
6640                  }
6641                  arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
6642                  IContentProvider cp = sProviderHolder.getProvider(resolver);
6643                  cp.call(resolver.getAttributionSource(),
6644                          sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_SECURE, null, arg);
6645              } catch (RemoteException e) {
6646                  Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
6647              }
6648          }
6649  
6650          /**
6651           * Construct the content URI for a particular name/value pair,
6652           * useful for monitoring changes with a ContentObserver.
6653           * @param name to look up in the table
6654           * @return the corresponding content URI, or null if not present
6655           */
getUriFor(String name)6656          public static Uri getUriFor(String name) {
6657              if (MOVED_TO_GLOBAL.contains(name)) {
6658                  Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
6659                          + " to android.provider.Settings.Global, returning global URI.");
6660                  return Global.getUriFor(Global.CONTENT_URI, name);
6661              }
6662              return getUriFor(CONTENT_URI, name);
6663          }
6664  
6665          /**
6666           * Convenience function for retrieving a single secure settings value
6667           * as an integer.  Note that internally setting values are always
6668           * stored as strings; this function converts the string to an integer
6669           * for you.  The default value will be returned if the setting is
6670           * not defined or not an integer.
6671           *
6672           * @param cr The ContentResolver to access.
6673           * @param name The name of the setting to retrieve.
6674           * @param def Value to return if the setting is not defined.
6675           *
6676           * @return The setting's current value, or 'def' if it is not defined
6677           * or not a valid integer.
6678           */
getInt(ContentResolver cr, String name, int def)6679          public static int getInt(ContentResolver cr, String name, int def) {
6680              return getIntForUser(cr, name, def, cr.getUserId());
6681          }
6682  
6683          /** @hide */
6684          @UnsupportedAppUsage
getIntForUser(ContentResolver cr, String name, int def, int userHandle)6685          public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
6686              String v = getStringForUser(cr, name, userHandle);
6687              return parseIntSettingWithDefault(v, def);
6688          }
6689  
6690          /**
6691           * Convenience function for retrieving a single secure settings value
6692           * as an integer.  Note that internally setting values are always
6693           * stored as strings; this function converts the string to an integer
6694           * for you.
6695           * <p>
6696           * This version does not take a default value.  If the setting has not
6697           * been set, or the string value is not a number,
6698           * it throws {@link SettingNotFoundException}.
6699           *
6700           * @param cr The ContentResolver to access.
6701           * @param name The name of the setting to retrieve.
6702           *
6703           * @throws SettingNotFoundException Thrown if a setting by the given
6704           * name can't be found or the setting value is not an integer.
6705           *
6706           * @return The setting's current value.
6707           */
getInt(ContentResolver cr, String name)6708          public static int getInt(ContentResolver cr, String name)
6709                  throws SettingNotFoundException {
6710              return getIntForUser(cr, name, cr.getUserId());
6711          }
6712  
6713          /** @hide */
getIntForUser(ContentResolver cr, String name, int userHandle)6714          public static int getIntForUser(ContentResolver cr, String name, int userHandle)
6715                  throws SettingNotFoundException {
6716              String v = getStringForUser(cr, name, userHandle);
6717              return parseIntSetting(v, name);
6718          }
6719  
6720          /**
6721           * Convenience function for updating a single settings value as an
6722           * integer. This will either create a new entry in the table if the
6723           * given name does not exist, or modify the value of the existing row
6724           * with that name.  Note that internally setting values are always
6725           * stored as strings, so this function converts the given value to a
6726           * string before storing it.
6727           *
6728           * @param cr The ContentResolver to access.
6729           * @param name The name of the setting to modify.
6730           * @param value The new value for the setting.
6731           * @return true if the value was set, false on database errors
6732           */
putInt(ContentResolver cr, String name, int value)6733          public static boolean putInt(ContentResolver cr, String name, int value) {
6734              return putIntForUser(cr, name, value, cr.getUserId());
6735          }
6736  
6737          /** @hide */
6738          @UnsupportedAppUsage
putIntForUser(ContentResolver cr, String name, int value, int userHandle)6739          public static boolean putIntForUser(ContentResolver cr, String name, int value,
6740                  int userHandle) {
6741              return putStringForUser(cr, name, Integer.toString(value), userHandle);
6742          }
6743  
6744          /**
6745           * Convenience function for retrieving a single secure settings value
6746           * as a {@code long}.  Note that internally setting values are always
6747           * stored as strings; this function converts the string to a {@code long}
6748           * for you.  The default value will be returned if the setting is
6749           * not defined or not a {@code long}.
6750           *
6751           * @param cr The ContentResolver to access.
6752           * @param name The name of the setting to retrieve.
6753           * @param def Value to return if the setting is not defined.
6754           *
6755           * @return The setting's current value, or 'def' if it is not defined
6756           * or not a valid {@code long}.
6757           */
getLong(ContentResolver cr, String name, long def)6758          public static long getLong(ContentResolver cr, String name, long def) {
6759              return getLongForUser(cr, name, def, cr.getUserId());
6760          }
6761  
6762          /** @hide */
6763          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
getLongForUser(ContentResolver cr, String name, long def, int userHandle)6764          public static long getLongForUser(ContentResolver cr, String name, long def,
6765                  int userHandle) {
6766              String v = getStringForUser(cr, name, userHandle);
6767              return parseLongSettingWithDefault(v, def);
6768          }
6769  
6770          /**
6771           * Convenience function for retrieving a single secure settings value
6772           * as a {@code long}.  Note that internally setting values are always
6773           * stored as strings; this function converts the string to a {@code long}
6774           * for you.
6775           * <p>
6776           * This version does not take a default value.  If the setting has not
6777           * been set, or the string value is not a number,
6778           * it throws {@link SettingNotFoundException}.
6779           *
6780           * @param cr The ContentResolver to access.
6781           * @param name The name of the setting to retrieve.
6782           *
6783           * @return The setting's current value.
6784           * @throws SettingNotFoundException Thrown if a setting by the given
6785           * name can't be found or the setting value is not an integer.
6786           */
getLong(ContentResolver cr, String name)6787          public static long getLong(ContentResolver cr, String name)
6788                  throws SettingNotFoundException {
6789              return getLongForUser(cr, name, cr.getUserId());
6790          }
6791  
6792          /** @hide */
getLongForUser(ContentResolver cr, String name, int userHandle)6793          public static long getLongForUser(ContentResolver cr, String name, int userHandle)
6794                  throws SettingNotFoundException {
6795              String v = getStringForUser(cr, name, userHandle);
6796              return parseLongSetting(v, name);
6797          }
6798  
6799          /**
6800           * Convenience function for updating a secure settings value as a long
6801           * integer. This will either create a new entry in the table if the
6802           * given name does not exist, or modify the value of the existing row
6803           * with that name.  Note that internally setting values are always
6804           * stored as strings, so this function converts the given value to a
6805           * string before storing it.
6806           *
6807           * @param cr The ContentResolver to access.
6808           * @param name The name of the setting to modify.
6809           * @param value The new value for the setting.
6810           * @return true if the value was set, false on database errors
6811           */
putLong(ContentResolver cr, String name, long value)6812          public static boolean putLong(ContentResolver cr, String name, long value) {
6813              return putLongForUser(cr, name, value, cr.getUserId());
6814          }
6815  
6816          /** @hide */
6817          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
putLongForUser(ContentResolver cr, String name, long value, int userHandle)6818          public static boolean putLongForUser(ContentResolver cr, String name, long value,
6819                  int userHandle) {
6820              return putStringForUser(cr, name, Long.toString(value), userHandle);
6821          }
6822  
6823          /**
6824           * Convenience function for retrieving a single secure settings value
6825           * as a floating point number.  Note that internally setting values are
6826           * always stored as strings; this function converts the string to an
6827           * float for you. The default value will be returned if the setting
6828           * is not defined or not a valid float.
6829           *
6830           * @param cr The ContentResolver to access.
6831           * @param name The name of the setting to retrieve.
6832           * @param def Value to return if the setting is not defined.
6833           *
6834           * @return The setting's current value, or 'def' if it is not defined
6835           * or not a valid float.
6836           */
getFloat(ContentResolver cr, String name, float def)6837          public static float getFloat(ContentResolver cr, String name, float def) {
6838              return getFloatForUser(cr, name, def, cr.getUserId());
6839          }
6840  
6841          /** @hide */
getFloatForUser(ContentResolver cr, String name, float def, int userHandle)6842          public static float getFloatForUser(ContentResolver cr, String name, float def,
6843                  int userHandle) {
6844              String v = getStringForUser(cr, name, userHandle);
6845              return parseFloatSettingWithDefault(v, def);
6846          }
6847  
6848          /**
6849           * Convenience function for retrieving a single secure settings value
6850           * as a float.  Note that internally setting values are always
6851           * stored as strings; this function converts the string to a float
6852           * for you.
6853           * <p>
6854           * This version does not take a default value.  If the setting has not
6855           * been set, or the string value is not a number,
6856           * it throws {@link SettingNotFoundException}.
6857           *
6858           * @param cr The ContentResolver to access.
6859           * @param name The name of the setting to retrieve.
6860           *
6861           * @throws SettingNotFoundException Thrown if a setting by the given
6862           * name can't be found or the setting value is not a float.
6863           *
6864           * @return The setting's current value.
6865           */
getFloat(ContentResolver cr, String name)6866          public static float getFloat(ContentResolver cr, String name)
6867                  throws SettingNotFoundException {
6868              return getFloatForUser(cr, name, cr.getUserId());
6869          }
6870  
6871          /** @hide */
getFloatForUser(ContentResolver cr, String name, int userHandle)6872          public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
6873                  throws SettingNotFoundException {
6874              String v = getStringForUser(cr, name, userHandle);
6875              return parseFloatSetting(v, name);
6876          }
6877  
6878          /**
6879           * Convenience function for updating a single settings value as a
6880           * floating point number. This will either create a new entry in the
6881           * table if the given name does not exist, or modify the value of the
6882           * existing row with that name.  Note that internally setting values
6883           * are always stored as strings, so this function converts the given
6884           * value to a string before storing it.
6885           *
6886           * @param cr The ContentResolver to access.
6887           * @param name The name of the setting to modify.
6888           * @param value The new value for the setting.
6889           * @return true if the value was set, false on database errors
6890           */
putFloat(ContentResolver cr, String name, float value)6891          public static boolean putFloat(ContentResolver cr, String name, float value) {
6892              return putFloatForUser(cr, name, value, cr.getUserId());
6893          }
6894  
6895          /** @hide */
putFloatForUser(ContentResolver cr, String name, float value, int userHandle)6896          public static boolean putFloatForUser(ContentResolver cr, String name, float value,
6897                  int userHandle) {
6898              return putStringForUser(cr, name, Float.toString(value), userHandle);
6899          }
6900  
6901          /**
6902           * Control whether to enable adaptive sleep mode.
6903           * @hide
6904           */
6905          @Readable
6906          public static final String ADAPTIVE_SLEEP = "adaptive_sleep";
6907  
6908          /**
6909           * Setting key to indicate whether camera-based autorotate is enabled.
6910           *
6911           * @hide
6912           */
6913          public static final String CAMERA_AUTOROTATE = "camera_autorotate";
6914  
6915          /**
6916           * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
6917           * instead
6918           */
6919          @Deprecated
6920          public static final String DEVELOPMENT_SETTINGS_ENABLED =
6921                  Global.DEVELOPMENT_SETTINGS_ENABLED;
6922  
6923          /**
6924           * When the user has enable the option to have a "bug report" command
6925           * in the power menu.
6926           * @hide
6927           */
6928          @Readable
6929          public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
6930  
6931          /**
6932           * The package name for the custom bugreport handler app. This app must be bugreport
6933           * allow-listed. This is currently used only by Power Menu short press.
6934           * @hide
6935           */
6936          public static final String CUSTOM_BUGREPORT_HANDLER_APP = "custom_bugreport_handler_app";
6937  
6938          /**
6939           * The user id for the custom bugreport handler app. This is currently used only by Power
6940           * Menu short press.
6941           * @hide
6942           */
6943          public static final String CUSTOM_BUGREPORT_HANDLER_USER = "custom_bugreport_handler_user";
6944  
6945          /**
6946           * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
6947           */
6948          @Deprecated
6949          public static final String ADB_ENABLED = Global.ADB_ENABLED;
6950  
6951          /**
6952           * Setting to allow mock locations and location provider status to be injected into the
6953           * LocationManager service for testing purposes during application development.  These
6954           * locations and status values  override actual location and status information generated
6955           * by network, gps, or other location providers.
6956           *
6957           * @deprecated This settings is not used anymore.
6958           */
6959          @Deprecated
6960          @Readable
6961          public static final String ALLOW_MOCK_LOCATION = "mock_location";
6962  
6963          /**
6964           * This is used by Bluetooth Manager to store adapter name
6965           * @hide
6966           */
6967          @Readable(maxTargetSdk = Build.VERSION_CODES.S)
6968          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
6969          @SuppressLint("NoSettingsProvider")
6970          public static final String BLUETOOTH_NAME = "bluetooth_name";
6971  
6972          /**
6973           * This is used by Bluetooth Manager to store adapter address
6974           * @hide
6975           */
6976          @Readable(maxTargetSdk = Build.VERSION_CODES.S)
6977          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
6978          @SuppressLint("NoSettingsProvider")
6979          public static final String BLUETOOTH_ADDRESS = "bluetooth_address";
6980  
6981          /**
6982           * This is used by Bluetooth Manager to store whether adapter address is valid
6983           * @hide
6984           */
6985          @Readable(maxTargetSdk = Build.VERSION_CODES.S)
6986          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
6987          @SuppressLint("NoSettingsProvider")
6988          public static final String BLUETOOTH_ADDR_VALID = "bluetooth_addr_valid";
6989  
6990          /**
6991           * This is used by LocalBluetoothLeBroadcast to store the broadcast program info.
6992           * @hide
6993           */
6994          public static final String BLUETOOTH_LE_BROADCAST_PROGRAM_INFO =
6995                  "bluetooth_le_broadcast_program_info";
6996  
6997          /**
6998           * This is used by LocalBluetoothLeBroadcast to store the broadcast code.
6999           * @hide
7000           */
7001          public static final String BLUETOOTH_LE_BROADCAST_CODE = "bluetooth_le_broadcast_code";
7002  
7003          /**
7004           * This is used by LocalBluetoothLeBroadcast to store the app source name.
7005           * @hide
7006           */
7007          public static final String BLUETOOTH_LE_BROADCAST_APP_SOURCE_NAME =
7008                  "bluetooth_le_broadcast_app_source_name";
7009  
7010          /**
7011           * Ringtone routing value for hearing aid. It routes ringtone to hearing aid or device
7012           * speaker.
7013           * <ul>
7014           *     <li> 0 = Default
7015           *     <li> 1 = Route to hearing aid
7016           *     <li> 2 = Route to device speaker
7017           * </ul>
7018           * @hide
7019           */
7020          public static final String HEARING_AID_RINGTONE_ROUTING =
7021                  "hearing_aid_ringtone_routing";
7022  
7023          /**
7024           * Phone call routing value for hearing aid. It routes phone call to hearing aid or
7025           * device speaker.
7026           * <ul>
7027           *     <li> 0 = Default
7028           *     <li> 1 = Route to hearing aid
7029           *     <li> 2 = Route to device speaker
7030           * </ul>
7031           * @hide
7032           */
7033          public static final String HEARING_AID_CALL_ROUTING =
7034                  "hearing_aid_call_routing";
7035  
7036          /**
7037           * Media routing value for hearing aid. It routes media to hearing aid or device
7038           * speaker.
7039           * <ul>
7040           *     <li> 0 = Default
7041           *     <li> 1 = Route to hearing aid
7042           *     <li> 2 = Route to device speaker
7043           * </ul>
7044           * @hide
7045           */
7046          public static final String HEARING_AID_MEDIA_ROUTING =
7047                  "hearing_aid_media_routing";
7048  
7049          /**
7050           * System sounds routing value for hearing aid. It routes system sounds to hearing aid
7051           * or device speaker.
7052           * <ul>
7053           *     <li> 0 = Default
7054           *     <li> 1 = Route to hearing aid
7055           *     <li> 2 = Route to device speaker
7056           * </ul>
7057           * @hide
7058           */
7059          public static final String HEARING_AID_SYSTEM_SOUNDS_ROUTING =
7060                  "hearing_aid_system_sounds_routing";
7061  
7062          /**
7063           * Setting to indicate that on device captions are enabled.
7064           *
7065           * @hide
7066           */
7067          @SystemApi
7068          @Readable
7069          public static final String ODI_CAPTIONS_ENABLED = "odi_captions_enabled";
7070  
7071  
7072          /**
7073           * Setting to indicate live caption button show or hide in the volume
7074           * rocker.
7075           *
7076           * @hide
7077           */
7078          public static final String ODI_CAPTIONS_VOLUME_UI_ENABLED =
7079                  "odi_captions_volume_ui_enabled";
7080  
7081          /**
7082           * On Android 8.0 (API level 26) and higher versions of the platform,
7083           * a 64-bit number (expressed as a hexadecimal string), unique to
7084           * each combination of app-signing key, user, and device.
7085           * Values of {@code ANDROID_ID} are scoped by signing key and user.
7086           * The value may change if a factory reset is performed on the
7087           * device or if an APK signing key changes.
7088           *
7089           * For more information about how the platform handles {@code ANDROID_ID}
7090           * in Android 8.0 (API level 26) and higher, see <a
7091           * href="{@docRoot}about/versions/oreo/android-8.0-changes.html#privacy-all">
7092           * Android 8.0 Behavior Changes</a>.
7093           *
7094           * <p class="note"><strong>Note:</strong> For apps that were installed
7095           * prior to updating the device to a version of Android 8.0
7096           * (API level 26) or higher, the value of {@code ANDROID_ID} changes
7097           * if the app is uninstalled and then reinstalled after the OTA.
7098           * To preserve values across uninstalls after an OTA to Android 8.0
7099           * or higher, developers can use
7100           * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html">
7101           * Key/Value Backup</a>.</p>
7102           *
7103           * <p>In versions of the platform lower than Android 8.0 (API level 26),
7104           * a 64-bit number (expressed as a hexadecimal string) that is randomly
7105           * generated when the user first sets up the device and should remain
7106           * constant for the lifetime of the user's device.
7107           *
7108           * On devices that have
7109           * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">
7110           * multiple users</a>, each user appears as a
7111           * completely separate device, so the {@code ANDROID_ID} value is
7112           * unique to each user.</p>
7113           *
7114           * <p class="note"><strong>Note:</strong> If the caller is an Instant App the ID is scoped
7115           * to the Instant App, it is generated when the Instant App is first installed and reset if
7116           * the user clears the Instant App.
7117           */
7118          @Readable
7119          public static final String ANDROID_ID = "android_id";
7120  
7121          /**
7122           * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
7123           */
7124          @Deprecated
7125          public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
7126  
7127          /**
7128           * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
7129           */
7130          @Deprecated
7131          public static final String DATA_ROAMING = Global.DATA_ROAMING;
7132  
7133          /**
7134           * Stores {@link android.view.inputmethod.InputMethodInfo#getId()} of the input method
7135           * service that is currently selected.
7136           *
7137           * <p>Although the name {@link #DEFAULT_INPUT_METHOD} implies that there is a concept of
7138           * <i>default</i> input method, in reality this setting is no more or less than the
7139           * <strong>currently selected</strong> input method. This setting can be updated at any
7140           * time as a result of user-initiated and system-initiated input method switching.</p>
7141           *
7142           * <p>Use {@link ComponentName#unflattenFromString(String)} to parse the stored value.</p>
7143           */
7144          @Readable
7145          public static final String DEFAULT_INPUT_METHOD = "default_input_method";
7146  
7147          /**
7148           * Setting to record the input method subtype used by default, holding the ID
7149           * of the desired method.
7150           */
7151          @Readable
7152          public static final String SELECTED_INPUT_METHOD_SUBTYPE =
7153                  "selected_input_method_subtype";
7154  
7155          /**
7156           * The {@link android.view.inputmethod.InputMethodInfo.InputMethodInfo#getId() ID} of the
7157           * default voice input method.
7158           * <p>
7159           * This stores the last known default voice IME. If the related system config value changes,
7160           * this is reset by InputMethodManagerService.
7161           * <p>
7162           * This IME is not necessarily in the enabled IME list. That state is still stored in
7163           * {@link #ENABLED_INPUT_METHODS}.
7164           *
7165           * @hide
7166           */
7167          public static final String DEFAULT_VOICE_INPUT_METHOD = "default_voice_input_method";
7168  
7169          /**
7170           * Setting to record the history of input method subtype, holding the pair of ID of IME
7171           * and its last used subtype.
7172           * @hide
7173           */
7174          @Readable
7175          public static final String INPUT_METHODS_SUBTYPE_HISTORY =
7176                  "input_methods_subtype_history";
7177  
7178          /**
7179           * Setting to record the visibility of input method selector
7180           */
7181          @Readable
7182          public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
7183                  "input_method_selector_visibility";
7184  
7185          /**
7186           * Toggle for enabling stylus handwriting. When enabled, current Input method receives
7187           * stylus {@link MotionEvent}s if an {@link Editor} is focused.
7188           *
7189           * @see #STYLUS_HANDWRITING_DEFAULT_VALUE
7190           * @hide
7191           */
7192          @TestApi
7193          @Readable
7194          @SuppressLint("NoSettingsProvider")
7195          public static final String STYLUS_HANDWRITING_ENABLED = "stylus_handwriting_enabled";
7196  
7197          /**
7198           * Default value for {@link #STYLUS_HANDWRITING_ENABLED}.
7199           *
7200           * @hide
7201           */
7202          @TestApi
7203          @Readable
7204          @SuppressLint("NoSettingsProvider")
7205          public static final int STYLUS_HANDWRITING_DEFAULT_VALUE = 1;
7206  
7207          /**
7208           * The currently selected voice interaction service flattened ComponentName.
7209           * @hide
7210           */
7211          @TestApi
7212          @Readable
7213          public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
7214  
7215  
7216          /**
7217           * The currently selected credential service(s) flattened ComponentName.
7218           *
7219           * @hide
7220           */
7221          public static final String CREDENTIAL_SERVICE = "credential_service";
7222  
7223          /**
7224           * The currently selected primary credential service flattened ComponentName.
7225           *
7226           * @hide
7227           */
7228          public static final String CREDENTIAL_SERVICE_PRIMARY = "credential_service_primary";
7229  
7230          /**
7231           * The currently selected autofill service flattened ComponentName.
7232           * @hide
7233           */
7234          @TestApi
7235          @Readable
7236          public static final String AUTOFILL_SERVICE = "autofill_service";
7237  
7238          /**
7239           * Boolean indicating if Autofill supports field classification.
7240           *
7241           * @see android.service.autofill.AutofillService
7242           *
7243           * @hide
7244           */
7245          @SystemApi
7246          @Readable
7247          public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION =
7248                  "autofill_field_classification";
7249  
7250          /**
7251           * Boolean indicating if the dark mode dialog shown on first toggle has been seen.
7252           *
7253           * @hide
7254           */
7255          @Readable
7256          public static final String DARK_MODE_DIALOG_SEEN =
7257                  "dark_mode_dialog_seen";
7258  
7259          /**
7260           * Custom time when Dark theme is scheduled to activate.
7261           * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
7262           * @hide
7263           */
7264          @Readable
7265          public static final String DARK_THEME_CUSTOM_START_TIME =
7266                  "dark_theme_custom_start_time";
7267  
7268          /**
7269           * Custom time when Dark theme is scheduled to deactivate.
7270           * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
7271           * @hide
7272           */
7273          @Readable
7274          public static final String DARK_THEME_CUSTOM_END_TIME =
7275                  "dark_theme_custom_end_time";
7276  
7277          /**
7278           * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}.
7279           *
7280           * @hide
7281           */
7282          @SystemApi
7283          @Readable
7284          public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE =
7285                  "autofill_user_data_max_user_data_size";
7286  
7287          /**
7288           * Defines value returned by
7289           * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}.
7290           *
7291           * @hide
7292           */
7293          @SystemApi
7294          @Readable
7295          public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE =
7296                  "autofill_user_data_max_field_classification_size";
7297  
7298          /**
7299           * Defines value returned by
7300           * {@link android.service.autofill.UserData#getMaxCategoryCount()}.
7301           *
7302           * @hide
7303           */
7304          @SystemApi
7305          @Readable
7306          public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT =
7307                  "autofill_user_data_max_category_count";
7308  
7309          /**
7310           * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}.
7311           *
7312           * @hide
7313           */
7314          @SystemApi
7315          @Readable
7316          public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH =
7317                  "autofill_user_data_max_value_length";
7318  
7319          /**
7320           * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}.
7321           *
7322           * @hide
7323           */
7324          @SystemApi
7325          @Readable
7326          public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH =
7327                  "autofill_user_data_min_value_length";
7328  
7329          /**
7330           * Defines whether Content Capture is enabled for the user.
7331           *
7332           * <p>Type: {@code int} ({@code 0} for disabled, {@code 1} for enabled).
7333           * <p>Default: enabled
7334           *
7335           * @hide
7336           */
7337          @TestApi
7338          @Readable
7339          public static final String CONTENT_CAPTURE_ENABLED = "content_capture_enabled";
7340  
7341          /**
7342           * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
7343           */
7344          @Deprecated
7345          public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
7346  
7347          /**
7348           * Indicates whether a DPC has been downloaded during provisioning.
7349           *
7350           * <p>Type: int (0 for false, 1 for true)
7351           *
7352           * <p>If this is true, then any attempts to begin setup again should result in factory reset
7353           *
7354           * @hide
7355           */
7356          @Readable
7357          public static final String MANAGED_PROVISIONING_DPC_DOWNLOADED =
7358                  "managed_provisioning_dpc_downloaded";
7359  
7360          /**
7361           * Indicates whether the device is under restricted secure FRP mode.
7362           * Secure FRP mode is enabled when the device is under FRP. On solving of FRP challenge,
7363           * device is removed from this mode.
7364           * <p>
7365           * Type: int (0 for false, 1 for true)
7366           *
7367           * @deprecated Use Global.SECURE_FRP_MODE
7368           */
7369          @Deprecated
7370          @Readable
7371          public static final String SECURE_FRP_MODE = "secure_frp_mode";
7372  
7373          /**
7374           * Indicates whether the current user has completed setup via the setup wizard.
7375           * <p>
7376           * Type: int (0 for false, 1 for true)
7377           *
7378           * @hide
7379           */
7380          @SystemApi
7381          @Readable
7382          public static final String USER_SETUP_COMPLETE = "user_setup_complete";
7383  
7384          /**
7385           * Indicates that the user has not started setup personalization.
7386           * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
7387           *
7388           * @hide
7389           */
7390          @SystemApi
7391          public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0;
7392  
7393          /**
7394           * Indicates that the user has not yet completed setup personalization.
7395           * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
7396           *
7397           * @hide
7398           */
7399          @SystemApi
7400          public static final int USER_SETUP_PERSONALIZATION_STARTED = 1;
7401  
7402          /**
7403           * Indicates that the user has snoozed personalization and will complete it later.
7404           * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
7405           *
7406           * @hide
7407           */
7408          @SystemApi
7409          public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2;
7410  
7411          /**
7412           * Indicates that the user has completed setup personalization.
7413           * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}.
7414           *
7415           * @hide
7416           */
7417          @SystemApi
7418          public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10;
7419  
7420          /** @hide */
7421          @Retention(RetentionPolicy.SOURCE)
7422          @IntDef({
7423                  USER_SETUP_PERSONALIZATION_NOT_STARTED,
7424                  USER_SETUP_PERSONALIZATION_STARTED,
7425                  USER_SETUP_PERSONALIZATION_PAUSED,
7426                  USER_SETUP_PERSONALIZATION_COMPLETE
7427          })
7428          public @interface UserSetupPersonalization {}
7429  
7430          /**
7431           * Defines the user's current state of device personalization.
7432           * The possible states are defined in {@link UserSetupPersonalization}.
7433           *
7434           * @hide
7435           */
7436          @SystemApi
7437          @Readable
7438          public static final String USER_SETUP_PERSONALIZATION_STATE =
7439                  "user_setup_personalization_state";
7440  
7441          /**
7442           * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
7443           * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0
7444           * in case SetupWizard has been re-enabled on TV devices.
7445           *
7446           * @hide
7447           */
7448          @Readable
7449          public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete";
7450  
7451          /**
7452           * The prefix for a category name that indicates whether a suggested action from that
7453           * category was marked as completed.
7454           * <p>
7455           * Type: int (0 for false, 1 for true)
7456           *
7457           * @hide
7458           */
7459          @SystemApi
7460          @Readable
7461          public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
7462  
7463          /**
7464           * Whether or not compress blocks should be released on install.
7465           * <p>The setting only determines if the platform will attempt to release
7466           * compress blocks; it does not guarantee that the files will have their
7467           * compress blocks released. Compression is currently only supported on
7468           * some f2fs filesystems.
7469           * <p>
7470           * Type: int (0 for false, 1 for true)
7471           *
7472           * @hide
7473           */
7474          public static final String RELEASE_COMPRESS_BLOCKS_ON_INSTALL =
7475                  "release_compress_blocks_on_install";
7476  
7477          /**
7478           * List of input methods that are currently enabled.  This is a string
7479           * containing the IDs of all enabled input methods, each ID separated
7480           * by ':'.
7481           *
7482           * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0"
7483           * where imeId is ComponentName and subtype is int32.
7484           *
7485           * <p>Note: This setting is not readable to the app targeting API level 34 or higher. use
7486           * {@link android.view.inputmethod.InputMethodManager#getEnabledInputMethodList()} instead.
7487           */
7488          @Readable(maxTargetSdk = Build.VERSION_CODES.TIRAMISU)
7489          public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
7490  
7491          /**
7492           * List of system input methods that are currently disabled.  This is a string
7493           * containing the IDs of all disabled input methods, each ID separated
7494           * by ':'.
7495           * @hide
7496           */
7497          @Readable(maxTargetSdk = Build.VERSION_CODES.TIRAMISU)
7498          public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
7499  
7500          /**
7501           * Whether to show the IME when a hard keyboard is connected. This is a boolean that
7502           * determines if the IME should be shown when a hard keyboard is attached.
7503           * @hide
7504           */
7505          @TestApi
7506          @Readable
7507          @SuppressLint("NoSettingsProvider")
7508          public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
7509  
7510          /**
7511           * Whether stylus button presses are disabled. This is a boolean that
7512           * determines if stylus buttons are ignored.
7513           *
7514           * @hide
7515           */
7516          @TestApi
7517          @Readable
7518          @SuppressLint("NoSettingsProvider")
7519          public static final String STYLUS_BUTTONS_ENABLED = "stylus_buttons_enabled";
7520  
7521          /**
7522           * Preferred default user profile to use with the notes task button shortcut.
7523           *
7524           * @hide
7525           */
7526          @SuppressLint("NoSettingsProvider")
7527          public static final String DEFAULT_NOTE_TASK_PROFILE = "default_note_task_profile";
7528  
7529          /**
7530           * Host name and port for global http proxy. Uses ':' seperator for
7531           * between host and port.
7532           *
7533           * @deprecated Use {@link Global#HTTP_PROXY}
7534           */
7535          @Deprecated
7536          public static final String HTTP_PROXY = Global.HTTP_PROXY;
7537  
7538          /**
7539           * Package designated as always-on VPN provider.
7540           *
7541           * @hide
7542           */
7543          public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app";
7544  
7545          /**
7546           * Whether to block networking outside of VPN connections while always-on is set.
7547           * @see #ALWAYS_ON_VPN_APP
7548           *
7549           * @hide
7550           */
7551          @Readable
7552          public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown";
7553  
7554          /**
7555           * Comma separated list of packages that are allowed to access the network when VPN is in
7556           * lockdown mode but not running.
7557           * @see #ALWAYS_ON_VPN_LOCKDOWN
7558           *
7559           * @hide
7560           */
7561          @Readable(maxTargetSdk = Build.VERSION_CODES.S)
7562          public static final String ALWAYS_ON_VPN_LOCKDOWN_WHITELIST =
7563                  "always_on_vpn_lockdown_whitelist";
7564  
7565          /**
7566           * Whether applications can be installed for this user via the system's
7567           * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
7568           *
7569           * <p>1 = permit app installation via the system package installer intent
7570           * <p>0 = do not allow use of the package installer
7571           * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use
7572           * {@link PackageManager#canRequestPackageInstalls()}
7573           * @see PackageManager#canRequestPackageInstalls()
7574           */
7575          @Deprecated
7576          @Readable
7577          public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
7578  
7579          /**
7580           * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that
7581           * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it
7582           * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES}
7583           * on behalf of the profile owner if needed to make the change transparent for profile
7584           * owners.
7585           *
7586           * @hide
7587           */
7588          @Readable
7589          public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED =
7590                  "unknown_sources_default_reversed";
7591  
7592          /**
7593           * Comma-separated list of location providers that are enabled. Do not rely on this value
7594           * being present or correct, or on ContentObserver notifications on the corresponding Uri.
7595           *
7596           * @deprecated This setting no longer exists from Android S onwards as it no longer is
7597           * capable of realistically reflecting location settings. Use {@link
7598           * LocationManager#isProviderEnabled(String)} or {@link LocationManager#isLocationEnabled()}
7599           * instead.
7600           */
7601          @Deprecated
7602          @Readable
7603          public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
7604  
7605          /**
7606           * The current location mode of the device. Do not rely on this value being present or on
7607           * ContentObserver notifications on the corresponding Uri.
7608           *
7609           * @deprecated The preferred methods for checking location mode and listening for changes
7610           * are via {@link LocationManager#isLocationEnabled()} and
7611           * {@link LocationManager#MODE_CHANGED_ACTION}.
7612           */
7613          @Deprecated
7614          @Readable
7615          public static final String LOCATION_MODE = "location_mode";
7616  
7617          /**
7618           * The App or module that changes the location mode.
7619           * @hide
7620           */
7621          @Readable
7622          public static final String LOCATION_CHANGER = "location_changer";
7623  
7624          /**
7625           * The location changer is unknown or unable to detect.
7626           * @hide
7627           */
7628          public static final int LOCATION_CHANGER_UNKNOWN = 0;
7629  
7630          /**
7631           * Location settings in system settings.
7632           * @hide
7633           */
7634          public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1;
7635  
7636          /**
7637           * The location icon in drop down notification drawer.
7638           * @hide
7639           */
7640          public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2;
7641  
7642          /**
7643           * Location mode is off.
7644           */
7645          public static final int LOCATION_MODE_OFF = 0;
7646  
7647          /**
7648           * This mode no longer has any distinct meaning, but is interpreted as the location mode is
7649           * on.
7650           *
7651           * @deprecated See {@link #LOCATION_MODE}.
7652           */
7653          @Deprecated
7654          public static final int LOCATION_MODE_SENSORS_ONLY = 1;
7655  
7656          /**
7657           * This mode no longer has any distinct meaning, but is interpreted as the location mode is
7658           * on.
7659           *
7660           * @deprecated See {@link #LOCATION_MODE}.
7661           */
7662          @Deprecated
7663          public static final int LOCATION_MODE_BATTERY_SAVING = 2;
7664  
7665          /**
7666           * This mode no longer has any distinct meaning, but is interpreted as the location mode is
7667           * on.
7668           *
7669           * @deprecated See {@link #LOCATION_MODE}.
7670           */
7671          @Deprecated
7672          public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
7673  
7674          /**
7675           * Location mode is on.
7676           *
7677           * @hide
7678           */
7679          @SystemApi
7680          public static final int LOCATION_MODE_ON = LOCATION_MODE_HIGH_ACCURACY;
7681  
7682          /**
7683           * The current location time zone detection enabled state for the user.
7684           *
7685           * See {@link android.app.time.TimeManager#getTimeZoneCapabilitiesAndConfig} for access.
7686           * See {@link android.app.time.TimeManager#updateTimeZoneConfiguration} to update.
7687           * @hide
7688           */
7689          public static final String LOCATION_TIME_ZONE_DETECTION_ENABLED =
7690                  "location_time_zone_detection_enabled";
7691  
7692          /**
7693           * The accuracy in meters used for coarsening location for clients with only the coarse
7694           * location permission.
7695           *
7696           * @hide
7697           */
7698          @Readable
7699          public static final String LOCATION_COARSE_ACCURACY_M = "locationCoarseAccuracy";
7700  
7701          /**
7702           * Whether or not to show display system location accesses.
7703           * @hide
7704           */
7705          public static final String LOCATION_SHOW_SYSTEM_OPS = "locationShowSystemOps";
7706  
7707          /**
7708           * A flag containing settings used for biometric weak
7709           * @hide
7710           */
7711          @Deprecated
7712          @Readable
7713          public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
7714                  "lock_biometric_weak_flags";
7715  
7716          /**
7717           * Whether lock-to-app will lock the keyguard when exiting.
7718           * @hide
7719           */
7720          @Readable
7721          public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
7722  
7723          /**
7724           * Whether autolock is enabled (0 = false, 1 = true)
7725           *
7726           * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
7727           *             level of the keyguard. Accessing this setting from an app that is targeting
7728           *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
7729           */
7730          @Deprecated
7731          @Readable
7732          public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
7733  
7734          /**
7735           * Whether lock pattern is visible as user enters (0 = false, 1 = true)
7736           *
7737           * @deprecated Accessing this setting from an app that is targeting
7738           *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
7739           */
7740          @Deprecated
7741          @Readable
7742          public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
7743  
7744          /**
7745           * Whether lock pattern will vibrate as user enters (0 = false, 1 =
7746           * true)
7747           *
7748           * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
7749           *             lockscreen uses
7750           *             {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
7751           *             Accessing this setting from an app that is targeting
7752           *             {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
7753           */
7754          @Deprecated
7755          @Readable
7756          public static final String
7757                  LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
7758  
7759          /**
7760           * This preference allows the device to be locked given time after screen goes off,
7761           * subject to current DeviceAdmin policy limits.
7762           * @hide
7763           */
7764          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
7765          @Readable
7766          public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
7767  
7768  
7769          /**
7770           * This preference contains the string that shows for owner info on LockScreen.
7771           * @hide
7772           * @deprecated
7773           */
7774          @Deprecated
7775          @Readable
7776          public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
7777  
7778          /**
7779           * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
7780           * @hide
7781           */
7782          @Deprecated
7783          @Readable
7784          public static final String LOCK_SCREEN_APPWIDGET_IDS =
7785              "lock_screen_appwidget_ids";
7786  
7787          /**
7788           * Id of the appwidget shown on the lock screen when appwidgets are disabled.
7789           * @hide
7790           */
7791          @Deprecated
7792          @Readable
7793          public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
7794              "lock_screen_fallback_appwidget_id";
7795  
7796          /**
7797           * Index of the lockscreen appwidget to restore, -1 if none.
7798           * @hide
7799           */
7800          @Deprecated
7801          @Readable
7802          public static final String LOCK_SCREEN_STICKY_APPWIDGET =
7803              "lock_screen_sticky_appwidget";
7804  
7805          /**
7806           * This preference enables showing the owner info on LockScreen.
7807           * @hide
7808           * @deprecated
7809           */
7810          @Deprecated
7811          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
7812          @Readable
7813          public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
7814              "lock_screen_owner_info_enabled";
7815  
7816          /**
7817           * Indicates whether the user has allowed notifications to be shown atop a securely locked
7818           * screen in their full "private" form (same as when the device is unlocked).
7819           * <p>
7820           * Type: int (0 for false, 1 for true)
7821           *
7822           * @hide
7823           */
7824          @SystemApi
7825          @Readable
7826          public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
7827                  "lock_screen_allow_private_notifications";
7828  
7829          /**
7830           * When set by a user, allows notification remote input atop a securely locked screen
7831           * without having to unlock
7832           * @hide
7833           */
7834          @Readable
7835          public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT =
7836                  "lock_screen_allow_remote_input";
7837  
7838          /**
7839           * Indicates which clock face to show on lock screen and AOD formatted as a serialized
7840           * {@link org.json.JSONObject} with the format:
7841           *     {"clock": id, "_applied_timestamp": timestamp}
7842           * @hide
7843           */
7844          @Readable
7845          public static final String LOCK_SCREEN_CUSTOM_CLOCK_FACE = "lock_screen_custom_clock_face";
7846  
7847          /**
7848           * Indicates which clock face to show on lock screen and AOD while docked.
7849           * @hide
7850           */
7851          @Readable
7852          public static final String DOCKED_CLOCK_FACE = "docked_clock_face";
7853  
7854          /**
7855           * Set by the system to track if the user needs to see the call to action for
7856           * the lockscreen notification policy.
7857           * @hide
7858           */
7859          @Readable
7860          public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
7861                  "show_note_about_notification_hiding";
7862  
7863          /**
7864           * Set to 1 by the system after trust agents have been initialized.
7865           * @hide
7866           */
7867          @Readable
7868          public static final String TRUST_AGENTS_INITIALIZED =
7869                  "trust_agents_initialized";
7870  
7871          /**
7872           * Set to 1 by the system after the list of known trust agents have been initialized.
7873           * @hide
7874           */
7875          public static final String KNOWN_TRUST_AGENTS_INITIALIZED =
7876                  "known_trust_agents_initialized";
7877  
7878          /**
7879           * The Logging ID (a unique 64-bit value) as a hex string.
7880           * Used as a pseudonymous identifier for logging.
7881           * @deprecated This identifier is poorly initialized and has
7882           * many collisions.  It should not be used.
7883           */
7884          @Deprecated
7885          @Readable
7886          public static final String LOGGING_ID = "logging_id";
7887  
7888          /**
7889           * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
7890           */
7891          @Deprecated
7892          public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
7893  
7894          /**
7895           * No longer supported.
7896           */
7897          @Readable
7898          public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
7899  
7900          /**
7901           * No longer supported.
7902           */
7903          @Readable
7904          public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
7905  
7906          /**
7907           * No longer supported.
7908           */
7909          @Readable
7910          public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
7911  
7912          /**
7913           * Settings classname to launch when Settings is clicked from All
7914           * Applications.  Needed because of user testing between the old
7915           * and new Settings apps.
7916           */
7917          // TODO: 881807
7918          @Readable
7919          public static final String SETTINGS_CLASSNAME = "settings_classname";
7920  
7921          /**
7922           * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
7923           */
7924          @Deprecated
7925          public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
7926  
7927          /**
7928           * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
7929           */
7930          @Deprecated
7931          public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
7932  
7933          /**
7934           * If accessibility is enabled.
7935           */
7936          @Readable
7937          public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
7938  
7939          /**
7940           * Whether select sound track with audio description by default.
7941           * @hide
7942           */
7943          public static final String ENABLED_ACCESSIBILITY_AUDIO_DESCRIPTION_BY_DEFAULT =
7944                  "enabled_accessibility_audio_description_by_default";
7945  
7946          /**
7947           * Setting specifying if the accessibility shortcut is enabled.
7948           * @hide
7949           */
7950          @Readable
7951          public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN =
7952                  "accessibility_shortcut_on_lock_screen";
7953  
7954          /**
7955           * Setting specifying if the accessibility shortcut dialog has been shown to this user.
7956           * @hide
7957           */
7958          @Readable
7959          public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN =
7960                  "accessibility_shortcut_dialog_shown";
7961  
7962          /**
7963           * Setting specifying if the timeout restriction
7964           * {@link ViewConfiguration#getAccessibilityShortcutKeyTimeout()}
7965           * of the accessibility shortcut dialog is skipped.
7966           *
7967           * @hide
7968           */
7969          public static final String SKIP_ACCESSIBILITY_SHORTCUT_DIALOG_TIMEOUT_RESTRICTION =
7970                  "skip_accessibility_shortcut_dialog_timeout_restriction";
7971  
7972          /**
7973           * Setting specifying the accessibility services, accessibility shortcut targets,
7974           * or features to be toggled via the accessibility shortcut.
7975           *
7976           * <p> This is a colon-separated string list which contains the flattened
7977           * {@link ComponentName} and the class name of a system class implementing a supported
7978           * accessibility feature.
7979           * @hide
7980           */
7981          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
7982          @TestApi
7983          @Readable
7984          public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE =
7985                  "accessibility_shortcut_target_service";
7986  
7987          /**
7988           * Setting specifying the accessibility service or feature to be toggled via the
7989           * accessibility button in the navigation bar. This is either a flattened
7990           * {@link ComponentName} or the class name of a system class implementing a supported
7991           * accessibility feature.
7992           * @hide
7993           */
7994          @Readable
7995          public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT =
7996                  "accessibility_button_target_component";
7997  
7998          /**
7999           * Setting specifying the accessibility services, accessibility shortcut targets,
8000           * or features to be toggled via the accessibility button in the navigation bar.
8001           *
8002           * <p> This is a colon-separated string list which contains the flattened
8003           * {@link ComponentName} and the class name of a system class implementing a supported
8004           * accessibility feature.
8005           * @hide
8006           */
8007          @Readable
8008          public static final String ACCESSIBILITY_BUTTON_TARGETS = "accessibility_button_targets";
8009  
8010          /**
8011           * The system class name of magnification controller which is a target to be toggled via
8012           * accessibility shortcut or accessibility button.
8013           *
8014           * @hide
8015           */
8016          @Readable
8017          public static final String ACCESSIBILITY_SHORTCUT_TARGET_MAGNIFICATION_CONTROLLER =
8018                  "com.android.server.accessibility.MagnificationController";
8019  
8020          /**
8021           * If touch exploration is enabled.
8022           */
8023          @Readable
8024          public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
8025  
8026          /**
8027           * List of the enabled accessibility providers.
8028           */
8029          @Readable
8030          public static final String ENABLED_ACCESSIBILITY_SERVICES =
8031              "enabled_accessibility_services";
8032  
8033          /**
8034           * List of the notified non-accessibility category accessibility services.
8035           *
8036           * @hide
8037           */
8038          @Readable
8039          public static final String NOTIFIED_NON_ACCESSIBILITY_CATEGORY_SERVICES =
8040                  "notified_non_accessibility_category_services";
8041  
8042          /**
8043           * List of the accessibility services to which the user has granted
8044           * permission to put the device into touch exploration mode.
8045           *
8046           * @hide
8047           */
8048          @Readable
8049          public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
8050              "touch_exploration_granted_accessibility_services";
8051  
8052          /**
8053           * Is talkback service enabled or not. 0 == no, 1 == yes
8054           *
8055           * @hide
8056           */
8057          public static final String WEAR_TALKBACK_ENABLED = "wear_talkback_enabled";
8058  
8059          /**
8060           * Whether the Global Actions Panel is enabled.
8061           * @hide
8062           */
8063          @Readable
8064          public static final String GLOBAL_ACTIONS_PANEL_ENABLED = "global_actions_panel_enabled";
8065  
8066          /**
8067           * Whether the Global Actions Panel can be toggled on or off in Settings.
8068           * @hide
8069           */
8070          @Readable
8071          public static final String GLOBAL_ACTIONS_PANEL_AVAILABLE =
8072                  "global_actions_panel_available";
8073  
8074          /**
8075           * Enables debug mode for the Global Actions Panel.
8076           * @hide
8077           */
8078          @Readable
8079          public static final String GLOBAL_ACTIONS_PANEL_DEBUG_ENABLED =
8080                  "global_actions_panel_debug_enabled";
8081  
8082          /**
8083           * Whether the hush gesture has ever been used
8084           * @hide
8085           */
8086          @SystemApi
8087          @Readable
8088          public static final String HUSH_GESTURE_USED = "hush_gesture_used";
8089  
8090          /**
8091           * Number of times the user has manually clicked the ringer toggle
8092           * @hide
8093           */
8094          @Readable
8095          public static final String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count";
8096  
8097          /**
8098           * Whether to play a sound for charging events.
8099           * @hide
8100           */
8101          @Readable
8102          public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
8103  
8104          /**
8105           * Whether to vibrate for charging events.
8106           * @hide
8107           */
8108          @Readable
8109          public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled";
8110  
8111          /**
8112           * If 0, turning on dnd manually will last indefinitely.
8113           * Else if non-negative, turning on dnd manually will last for this many minutes.
8114           * Else (if negative), turning on dnd manually will surface a dialog that prompts
8115           * user to specify a duration.
8116           * @hide
8117           */
8118          @Readable
8119          public static final String ZEN_DURATION = "zen_duration";
8120  
8121          /** @hide */ public static final int ZEN_DURATION_PROMPT = -1;
8122          /** @hide */ public static final int ZEN_DURATION_FOREVER = 0;
8123  
8124          /**
8125           * If nonzero, will show the zen upgrade notification when the user toggles DND on/off.
8126           * @hide
8127           */
8128          @Readable
8129          public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";
8130  
8131          /**
8132           * If nonzero, will show the zen update settings suggestion.
8133           * @hide
8134           */
8135          @Readable
8136          public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion";
8137  
8138          /**
8139           * If nonzero, zen has not been updated to reflect new changes.
8140           * @hide
8141           */
8142          @Readable
8143          public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated";
8144  
8145          /**
8146           * If nonzero, zen setting suggestion has been viewed by user
8147           * @hide
8148           */
8149          @Readable
8150          public static final String ZEN_SETTINGS_SUGGESTION_VIEWED =
8151                  "zen_settings_suggestion_viewed";
8152  
8153          /**
8154           * Whether the in call notification is enabled to play sound during calls.  The value is
8155           * boolean (1 or 0).
8156           * @hide
8157           */
8158          @Readable
8159          public static final String IN_CALL_NOTIFICATION_ENABLED = "in_call_notification_enabled";
8160  
8161          /**
8162           * Uri of the slice that's presented on the keyguard.
8163           * Defaults to a slice with the date and next alarm.
8164           *
8165           * @hide
8166           */
8167          @Readable
8168          public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri";
8169  
8170          /**
8171           * The adjustment in font weight. This is used to draw text in bold.
8172           *
8173           * <p> This value can be negative. To display bolded text, the adjustment used is 300,
8174           * which is the difference between
8175           * {@link android.graphics.fonts.FontStyle#FONT_WEIGHT_NORMAL} and
8176           * {@link android.graphics.fonts.FontStyle#FONT_WEIGHT_BOLD}.
8177           *
8178           * @hide
8179           */
8180          @Readable
8181          public static final String FONT_WEIGHT_ADJUSTMENT = "font_weight_adjustment";
8182  
8183          /**
8184           * Whether to speak passwords while in accessibility mode.
8185           *
8186           * @deprecated The speaking of passwords is controlled by individual accessibility services.
8187           * Apps should ignore this setting and provide complete information to accessibility
8188           * at all times, which was the behavior when this value was {@code true}.
8189           */
8190          @Deprecated
8191          @Readable
8192          public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
8193  
8194          /**
8195           * Whether to draw text with high contrast while in accessibility mode.
8196           *
8197           * @hide
8198           */
8199          @Readable
8200          public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
8201                  "high_text_contrast_enabled";
8202  
8203          /**
8204           * The color contrast, float in [-1, 1], 1 being the highest contrast.
8205           *
8206           * @hide
8207           */
8208          public static final String CONTRAST_LEVEL = "contrast_level";
8209  
8210          /**
8211           * Setting that specifies whether the display magnification is enabled via a system-wide
8212           * triple tap gesture. Display magnifications allows the user to zoom in the display content
8213           * and is targeted to low vision users. The current magnification scale is controlled by
8214           * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
8215           *
8216           * @hide
8217           */
8218          @UnsupportedAppUsage
8219          @TestApi
8220          @Readable
8221          public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
8222                  "accessibility_display_magnification_enabled";
8223  
8224          /**
8225           * Setting that specifies whether the display magnification is enabled via a shortcut
8226           * affordance within the system's navigation area. Display magnifications allows the user to
8227           * zoom in the display content and is targeted to low vision users. The current
8228           * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
8229           *
8230           * @deprecated Use {@link #ACCESSIBILITY_BUTTON_TARGETS} instead.
8231           * {@link #ACCESSIBILITY_BUTTON_TARGETS} holds the magnification system class name
8232           * when navigation bar magnification is enabled.
8233           * @hide
8234           */
8235          @SystemApi
8236          @Readable
8237          public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED =
8238                  "accessibility_display_magnification_navbar_enabled";
8239  
8240          /**
8241           * Setting that specifies what the display magnification scale is.
8242           * Display magnifications allows the user to zoom in the display
8243           * content and is targeted to low vision users. Whether a display
8244           * magnification is performed is controlled by
8245           * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and
8246           * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED}
8247           *
8248           * @hide
8249           */
8250          @Readable
8251          public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
8252                  "accessibility_display_magnification_scale";
8253  
8254          /**
8255           * Unused mangnification setting
8256           *
8257           * @hide
8258           * @deprecated
8259           */
8260          @Deprecated
8261          @Readable
8262          public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
8263                  "accessibility_display_magnification_auto_update";
8264  
8265          /**
8266           * Accessibility Window Magnification Allow diagonal scrolling value. The value is boolean.
8267           * 1 : on, 0 : off
8268           *
8269           * @hide
8270           */
8271          public static final String ACCESSIBILITY_ALLOW_DIAGONAL_SCROLLING =
8272                  "accessibility_allow_diagonal_scrolling";
8273  
8274  
8275          /**
8276           * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be
8277           * modified from an AccessibilityService using the SoftKeyboardController.
8278           *
8279           * @hide
8280           */
8281          @Readable
8282          public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE =
8283                  "accessibility_soft_keyboard_mode";
8284  
8285          /**
8286           * Default soft keyboard behavior.
8287           *
8288           * @hide
8289           */
8290          public static final int SHOW_MODE_AUTO = 0;
8291  
8292          /**
8293           * Soft keyboard is never shown.
8294           *
8295           * @hide
8296           */
8297          public static final int SHOW_MODE_HIDDEN = 1;
8298  
8299          /**
8300           * Setting that specifies whether timed text (captions) should be
8301           * displayed in video content. Text display properties are controlled by
8302           * the following settings:
8303           * <ul>
8304           * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
8305           * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
8306           * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
8307           * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
8308           * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
8309           * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
8310           * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
8311           * </ul>
8312           *
8313           * @hide
8314           */
8315          @Readable
8316          public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
8317                  "accessibility_captioning_enabled";
8318  
8319          /**
8320           * Setting that specifies the language for captions as a locale string,
8321           * e.g. en_US.
8322           *
8323           * @see java.util.Locale#toString
8324           * @hide
8325           */
8326          @Readable
8327          public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
8328                  "accessibility_captioning_locale";
8329  
8330          /**
8331           * Integer property that specifies the preset style for captions, one
8332           * of:
8333           * <ul>
8334           * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
8335           * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
8336           * </ul>
8337           *
8338           * @see java.util.Locale#toString
8339           * @hide
8340           */
8341          @Readable
8342          public static final String ACCESSIBILITY_CAPTIONING_PRESET =
8343                  "accessibility_captioning_preset";
8344  
8345          /**
8346           * Integer property that specifes the background color for captions as a
8347           * packed 32-bit color.
8348           *
8349           * @see android.graphics.Color#argb
8350           * @hide
8351           */
8352          @Readable
8353          public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
8354                  "accessibility_captioning_background_color";
8355  
8356          /**
8357           * Integer property that specifes the foreground color for captions as a
8358           * packed 32-bit color.
8359           *
8360           * @see android.graphics.Color#argb
8361           * @hide
8362           */
8363          @Readable
8364          public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
8365                  "accessibility_captioning_foreground_color";
8366  
8367          /**
8368           * Integer property that specifes the edge type for captions, one of:
8369           * <ul>
8370           * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
8371           * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
8372           * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
8373           * </ul>
8374           *
8375           * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
8376           * @hide
8377           */
8378          @Readable
8379          public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
8380                  "accessibility_captioning_edge_type";
8381  
8382          /**
8383           * Integer property that specifes the edge color for captions as a
8384           * packed 32-bit color.
8385           *
8386           * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
8387           * @see android.graphics.Color#argb
8388           * @hide
8389           */
8390          @Readable
8391          public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
8392                  "accessibility_captioning_edge_color";
8393  
8394          /**
8395           * Integer property that specifes the window color for captions as a
8396           * packed 32-bit color.
8397           *
8398           * @see android.graphics.Color#argb
8399           * @hide
8400           */
8401          @Readable
8402          public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
8403                  "accessibility_captioning_window_color";
8404  
8405          /**
8406           * String property that specifies the typeface for captions, one of:
8407           * <ul>
8408           * <li>DEFAULT
8409           * <li>MONOSPACE
8410           * <li>SANS_SERIF
8411           * <li>SERIF
8412           * </ul>
8413           *
8414           * @see android.graphics.Typeface
8415           * @hide
8416           */
8417          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8418          @Readable
8419          public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
8420                  "accessibility_captioning_typeface";
8421  
8422          /**
8423           * Floating point property that specifies font scaling for captions.
8424           *
8425           * @hide
8426           */
8427          @Readable
8428          public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
8429                  "accessibility_captioning_font_scale";
8430  
8431          /**
8432           * Setting that specifies whether display color inversion is enabled.
8433           */
8434          @Readable
8435          public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
8436                  "accessibility_display_inversion_enabled";
8437  
8438          /**
8439           * Flag that specifies whether font size has been changed. The flag will
8440           * be set when users change the scaled value of font size for the first time.
8441           * @hide
8442           */
8443          @Readable
8444          public static final String ACCESSIBILITY_FONT_SCALING_HAS_BEEN_CHANGED =
8445                  "accessibility_font_scaling_has_been_changed";
8446  
8447          /**
8448           * Setting that specifies whether display color space adjustment is
8449           * enabled.
8450           *
8451           * @hide
8452           */
8453          @UnsupportedAppUsage
8454          @Readable
8455          public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
8456                  "accessibility_display_daltonizer_enabled";
8457  
8458          /**
8459           * Integer property that specifies the type of color space adjustment to
8460           * perform. Valid values are defined in AccessibilityManager and Settings arrays.xml:
8461           * - AccessibilityManager.DALTONIZER_DISABLED = -1
8462           * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0
8463           * - <item>@string/daltonizer_mode_protanomaly</item> = 11
8464           * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY and
8465           *       <item>@string/daltonizer_mode_deuteranomaly</item> = 12
8466           * - <item>@string/daltonizer_mode_tritanomaly</item> = 13
8467           *
8468           * @hide
8469           */
8470          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8471          @Readable
8472          public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
8473                  "accessibility_display_daltonizer";
8474  
8475          /**
8476           * Setting that specifies whether automatic click when the mouse pointer stops moving is
8477           * enabled.
8478           *
8479           * @hide
8480           */
8481          @UnsupportedAppUsage
8482          @Readable
8483          public static final String ACCESSIBILITY_AUTOCLICK_ENABLED =
8484                  "accessibility_autoclick_enabled";
8485  
8486          /**
8487           * Integer setting specifying amount of time in ms the mouse pointer has to stay still
8488           * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set.
8489           *
8490           * @see #ACCESSIBILITY_AUTOCLICK_ENABLED
8491           * @hide
8492           */
8493          @Readable
8494          public static final String ACCESSIBILITY_AUTOCLICK_DELAY =
8495                  "accessibility_autoclick_delay";
8496  
8497          /**
8498           * Whether or not larger size icons are used for the pointer of mouse/trackpad for
8499           * accessibility.
8500           * (0 = false, 1 = true)
8501           * @hide
8502           */
8503          @UnsupportedAppUsage
8504          @Readable
8505          public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
8506                  "accessibility_large_pointer_icon";
8507  
8508          /**
8509           * The timeout for considering a press to be a long press in milliseconds.
8510           * @hide
8511           */
8512          @UnsupportedAppUsage
8513          @Readable
8514          public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
8515  
8516          /**
8517           * The duration in milliseconds between the first tap's up event and the second tap's
8518           * down event for an interaction to be considered part of the same multi-press.
8519           * @hide
8520           */
8521          @Readable
8522          public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout";
8523  
8524          /**
8525           * Setting that specifies recommended timeout in milliseconds for controls
8526           * which don't need user's interactions.
8527           *
8528           * @hide
8529           */
8530          @Readable
8531          public static final String ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS =
8532                  "accessibility_non_interactive_ui_timeout_ms";
8533  
8534          /**
8535           * Setting that specifies recommended timeout in milliseconds for controls
8536           * which need user's interactions.
8537           *
8538           * @hide
8539           */
8540          @Readable
8541          public static final String ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS =
8542                  "accessibility_interactive_ui_timeout_ms";
8543  
8544  
8545          /**
8546           * Setting that specifies whether Reduce Bright Colors, or brightness dimming by color
8547           * adjustment, is enabled.
8548           *
8549           * @hide
8550           */
8551          public static final String REDUCE_BRIGHT_COLORS_ACTIVATED =
8552                  "reduce_bright_colors_activated";
8553  
8554          /**
8555           * Setting that specifies the level of Reduce Bright Colors in intensity. The range is
8556           * [0, 100].
8557           *
8558           * @hide
8559           */
8560          public static final String REDUCE_BRIGHT_COLORS_LEVEL =
8561                  "reduce_bright_colors_level";
8562  
8563          /**
8564           * Setting that specifies whether Reduce Bright Colors should persist across reboots.
8565           *
8566           * @hide
8567           */
8568          public static final String REDUCE_BRIGHT_COLORS_PERSIST_ACROSS_REBOOTS =
8569                  "reduce_bright_colors_persist_across_reboots";
8570  
8571          /**
8572           * List of the enabled print services.
8573           *
8574           * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade
8575           * from pre-N.
8576           *
8577           * @hide
8578           */
8579          @UnsupportedAppUsage
8580          @Readable
8581          public static final String ENABLED_PRINT_SERVICES =
8582              "enabled_print_services";
8583  
8584          /**
8585           * List of the disabled print services.
8586           *
8587           * @hide
8588           */
8589          @TestApi
8590          @Readable
8591          public static final String DISABLED_PRINT_SERVICES =
8592              "disabled_print_services";
8593  
8594          /**
8595           * The saved value for WindowManagerService.setForcedDisplayDensity()
8596           * formatted as a single integer representing DPI. If unset, then use
8597           * the real display density.
8598           *
8599           * @hide
8600           */
8601          @Readable
8602          public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
8603  
8604          /**
8605           * Setting to always use the default text-to-speech settings regardless
8606           * of the application settings.
8607           * 1 = override application settings,
8608           * 0 = use application settings (if specified).
8609           *
8610           * @deprecated  The value of this setting is no longer respected by
8611           * the framework text to speech APIs as of the Ice Cream Sandwich release.
8612           */
8613          @Deprecated
8614          @Readable
8615          public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
8616  
8617          /**
8618           * Default text-to-speech engine speech rate. 100 = 1x
8619           */
8620          @Readable
8621          public static final String TTS_DEFAULT_RATE = "tts_default_rate";
8622  
8623          /**
8624           * Default text-to-speech engine pitch. 100 = 1x
8625           */
8626          @Readable
8627          public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
8628  
8629          /**
8630           * Default text-to-speech engine.
8631           */
8632          @Readable
8633          public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
8634  
8635          /**
8636           * Default text-to-speech language.
8637           *
8638           * @deprecated this setting is no longer in use, as of the Ice Cream
8639           * Sandwich release. Apps should never need to read this setting directly,
8640           * instead can query the TextToSpeech framework classes for the default
8641           * locale. {@link TextToSpeech#getLanguage()}.
8642           */
8643          @Deprecated
8644          @Readable
8645          public static final String TTS_DEFAULT_LANG = "tts_default_lang";
8646  
8647          /**
8648           * Default text-to-speech country.
8649           *
8650           * @deprecated this setting is no longer in use, as of the Ice Cream
8651           * Sandwich release. Apps should never need to read this setting directly,
8652           * instead can query the TextToSpeech framework classes for the default
8653           * locale. {@link TextToSpeech#getLanguage()}.
8654           */
8655          @Deprecated
8656          @Readable
8657          public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
8658  
8659          /**
8660           * Default text-to-speech locale variant.
8661           *
8662           * @deprecated this setting is no longer in use, as of the Ice Cream
8663           * Sandwich release. Apps should never need to read this setting directly,
8664           * instead can query the TextToSpeech framework classes for the
8665           * locale that is in use {@link TextToSpeech#getLanguage()}.
8666           */
8667          @Deprecated
8668          @Readable
8669          public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
8670  
8671          /**
8672           * Stores the default tts locales on a per engine basis. Stored as
8673           * a comma seperated list of values, each value being of the form
8674           * {@code engine_name:locale} for example,
8675           * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
8676           * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
8677           * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
8678           * setting directly, and can query the TextToSpeech framework classes
8679           * for the locale that is in use.
8680           *
8681           * @hide
8682           */
8683          @Readable
8684          public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
8685  
8686          /**
8687           * Space delimited list of plugin packages that are enabled.
8688           */
8689          @Readable
8690          public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
8691  
8692          /**
8693           * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
8694           * instead.
8695           */
8696          @Deprecated
8697          public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
8698                  Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
8699  
8700          /**
8701           * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
8702           * instead.
8703           */
8704          @Deprecated
8705          public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
8706                  Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
8707  
8708          /**
8709           * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
8710           * instead.
8711           */
8712          @Deprecated
8713          public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
8714                  Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
8715  
8716          /**
8717           * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
8718           * instead.
8719           */
8720          @Deprecated
8721          public static final String WIFI_ON = Global.WIFI_ON;
8722  
8723          /**
8724           * The acceptable packet loss percentage (range 0 - 100) before trying
8725           * another AP on the same network.
8726           * @deprecated This setting is not used.
8727           */
8728          @Deprecated
8729          @Readable
8730          public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
8731                  "wifi_watchdog_acceptable_packet_loss_percentage";
8732  
8733          /**
8734           * The number of access points required for a network in order for the
8735           * watchdog to monitor it.
8736           * @deprecated This setting is not used.
8737           */
8738          @Deprecated
8739          @Readable
8740          public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
8741  
8742          /**
8743           * The delay between background checks.
8744           * @deprecated This setting is not used.
8745           */
8746          @Deprecated
8747          @Readable
8748          public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
8749                  "wifi_watchdog_background_check_delay_ms";
8750  
8751          /**
8752           * Whether the Wi-Fi watchdog is enabled for background checking even
8753           * after it thinks the user has connected to a good access point.
8754           * @deprecated This setting is not used.
8755           */
8756          @Deprecated
8757          @Readable
8758          public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
8759                  "wifi_watchdog_background_check_enabled";
8760  
8761          /**
8762           * The timeout for a background ping
8763           * @deprecated This setting is not used.
8764           */
8765          @Deprecated
8766          @Readable
8767          public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
8768                  "wifi_watchdog_background_check_timeout_ms";
8769  
8770          /**
8771           * The number of initial pings to perform that *may* be ignored if they
8772           * fail. Again, if these fail, they will *not* be used in packet loss
8773           * calculation. For example, one network always seemed to time out for
8774           * the first couple pings, so this is set to 3 by default.
8775           * @deprecated This setting is not used.
8776           */
8777          @Deprecated
8778          @Readable
8779          public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
8780              "wifi_watchdog_initial_ignored_ping_count";
8781  
8782          /**
8783           * The maximum number of access points (per network) to attempt to test.
8784           * If this number is reached, the watchdog will no longer monitor the
8785           * initial connection state for the network. This is a safeguard for
8786           * networks containing multiple APs whose DNS does not respond to pings.
8787           * @deprecated This setting is not used.
8788           */
8789          @Deprecated
8790          @Readable
8791          public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
8792  
8793          /**
8794           * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
8795           */
8796          @Deprecated
8797          @Readable
8798          public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
8799  
8800          /**
8801           * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
8802           * @deprecated This setting is not used.
8803           */
8804          @Deprecated
8805          @Readable
8806          public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
8807  
8808          /**
8809           * The number of pings to test if an access point is a good connection.
8810           * @deprecated This setting is not used.
8811           */
8812          @Deprecated
8813          @Readable
8814          public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
8815  
8816          /**
8817           * The delay between pings.
8818           * @deprecated This setting is not used.
8819           */
8820          @Deprecated
8821          @Readable
8822          public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
8823  
8824          /**
8825           * The timeout per ping.
8826           * @deprecated This setting is not used.
8827           */
8828          @Deprecated
8829          @Readable
8830          public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
8831  
8832          /**
8833           * @deprecated Use
8834           * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
8835           */
8836          @Deprecated
8837          public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
8838  
8839          /**
8840           * @deprecated Use
8841           * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
8842           */
8843          @Deprecated
8844          public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
8845                  Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
8846  
8847          /**
8848           * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
8849           * the receivers of the PendingIntent an opportunity to make a new network request before
8850           * the Network satisfying the request is potentially removed.
8851           *
8852           * @hide
8853           */
8854          @Readable
8855          public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
8856                  "connectivity_release_pending_intent_delay_ms";
8857  
8858          /**
8859           * Whether background data usage is allowed.
8860           *
8861           * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
8862           *             availability of background data depends on several
8863           *             combined factors. When background data is unavailable,
8864           *             {@link ConnectivityManager#getActiveNetworkInfo()} will
8865           *             now appear disconnected.
8866           */
8867          @Deprecated
8868          @Readable
8869          public static final String BACKGROUND_DATA = "background_data";
8870  
8871          /**
8872           * Origins for which browsers should allow geolocation by default.
8873           * The value is a space-separated list of origins.
8874           */
8875          @Readable
8876          public static final String ALLOWED_GEOLOCATION_ORIGINS
8877                  = "allowed_geolocation_origins";
8878  
8879          /**
8880           * The preferred TTY mode     0 = TTy Off, CDMA default
8881           *                            1 = TTY Full
8882           *                            2 = TTY HCO
8883           *                            3 = TTY VCO
8884           * @hide
8885           */
8886          @Readable
8887          public static final String PREFERRED_TTY_MODE =
8888                  "preferred_tty_mode";
8889  
8890          /**
8891           * Whether the enhanced voice privacy mode is enabled.
8892           * 0 = normal voice privacy
8893           * 1 = enhanced voice privacy
8894           * @hide
8895           */
8896          @Readable
8897          public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
8898  
8899          /**
8900           * Whether the TTY mode mode is enabled.
8901           * 0 = disabled
8902           * 1 = enabled
8903           * @hide
8904           */
8905          @Readable
8906          public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
8907  
8908          /**
8909           * User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT
8910           * calls when supported by the device and carrier. Boolean value.
8911           * 0 = OFF
8912           * 1 = ON
8913           */
8914          @Readable
8915          public static final String RTT_CALLING_MODE = "rtt_calling_mode";
8916  
8917          /**
8918          /**
8919           * Controls whether settings backup is enabled.
8920           * Type: int ( 0 = disabled, 1 = enabled )
8921           * @hide
8922           */
8923          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8924          @Readable
8925          public static final String BACKUP_ENABLED = "backup_enabled";
8926  
8927          /**
8928           * Controls whether application data is automatically restored from backup
8929           * at install time.
8930           * Type: int ( 0 = disabled, 1 = enabled )
8931           * @hide
8932           */
8933          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8934          @Readable
8935          public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
8936  
8937          /**
8938           * Controls whether framework backup scheduling is enabled.
8939           * @hide
8940           */
8941          public static final String BACKUP_SCHEDULING_ENABLED = "backup_scheduling_enabled";
8942  
8943          /**
8944           * Indicates whether settings backup has been fully provisioned.
8945           * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
8946           * @hide
8947           */
8948          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8949          @Readable
8950          public static final String BACKUP_PROVISIONED = "backup_provisioned";
8951  
8952          /**
8953           * Component of the transport to use for backup/restore.
8954           * @hide
8955           */
8956          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
8957          @Readable
8958          public static final String BACKUP_TRANSPORT = "backup_transport";
8959  
8960          /**
8961           * Indicates the version for which the setup wizard was last shown. The version gets
8962           * bumped for each release when there is new setup information to show.
8963           *
8964           * @hide
8965           */
8966          @SystemApi
8967          @Readable
8968          public static final String LAST_SETUP_SHOWN = "last_setup_shown";
8969  
8970          /**
8971           * The interval in milliseconds after which Wi-Fi is considered idle.
8972           * When idle, it is possible for the device to be switched from Wi-Fi to
8973           * the mobile data network.
8974           * @hide
8975           * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
8976           * instead.
8977           */
8978          @Deprecated
8979          public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
8980  
8981          /**
8982           * The global search provider chosen by the user (if multiple global
8983           * search providers are installed). This will be the provider returned
8984           * by {@link SearchManager#getGlobalSearchActivity()} if it's still
8985           * installed. This setting is stored as a flattened component name as
8986           * per {@link ComponentName#flattenToString()}.
8987           *
8988           * @hide
8989           */
8990          @Readable
8991          public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
8992                  "search_global_search_activity";
8993  
8994          /**
8995           * The number of promoted sources in GlobalSearch.
8996           * @hide
8997           */
8998          @Readable
8999          public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
9000          /**
9001           * The maximum number of suggestions returned by GlobalSearch.
9002           * @hide
9003           */
9004          @Readable
9005          public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
9006          /**
9007           * The number of suggestions GlobalSearch will ask each non-web search source for.
9008           * @hide
9009           */
9010          @Readable
9011          public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
9012          /**
9013           * The number of suggestions the GlobalSearch will ask the web search source for.
9014           * @hide
9015           */
9016          @Readable
9017          public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
9018                  "search_web_results_override_limit";
9019          /**
9020           * The number of milliseconds that GlobalSearch will wait for suggestions from
9021           * promoted sources before continuing with all other sources.
9022           * @hide
9023           */
9024          @Readable
9025          public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
9026                  "search_promoted_source_deadline_millis";
9027          /**
9028           * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
9029           * @hide
9030           */
9031          @Readable
9032          public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
9033          /**
9034           * The maximum number of milliseconds that GlobalSearch shows the previous results
9035           * after receiving a new query.
9036           * @hide
9037           */
9038          @Readable
9039          public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
9040          /**
9041           * The maximum age of log data used for shortcuts in GlobalSearch.
9042           * @hide
9043           */
9044          @Readable
9045          public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
9046          /**
9047           * The maximum age of log data used for source ranking in GlobalSearch.
9048           * @hide
9049           */
9050          @Readable
9051          public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
9052                  "search_max_source_event_age_millis";
9053          /**
9054           * The minimum number of impressions needed to rank a source in GlobalSearch.
9055           * @hide
9056           */
9057          @Readable
9058          public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
9059                  "search_min_impressions_for_source_ranking";
9060          /**
9061           * The minimum number of clicks needed to rank a source in GlobalSearch.
9062           * @hide
9063           */
9064          @Readable
9065          public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
9066                  "search_min_clicks_for_source_ranking";
9067          /**
9068           * The maximum number of shortcuts shown by GlobalSearch.
9069           * @hide
9070           */
9071          @Readable
9072          public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
9073          /**
9074           * The size of the core thread pool for suggestion queries in GlobalSearch.
9075           * @hide
9076           */
9077          @Readable
9078          public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
9079                  "search_query_thread_core_pool_size";
9080          /**
9081           * The maximum size of the thread pool for suggestion queries in GlobalSearch.
9082           * @hide
9083           */
9084          @Readable
9085          public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
9086                  "search_query_thread_max_pool_size";
9087          /**
9088           * The size of the core thread pool for shortcut refreshing in GlobalSearch.
9089           * @hide
9090           */
9091          @Readable
9092          public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
9093                  "search_shortcut_refresh_core_pool_size";
9094          /**
9095           * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
9096           * @hide
9097           */
9098          @Readable
9099          public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
9100                  "search_shortcut_refresh_max_pool_size";
9101          /**
9102           * The maximun time that excess threads in the GlobalSeach thread pools will
9103           * wait before terminating.
9104           * @hide
9105           */
9106          @Readable
9107          public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
9108                  "search_thread_keepalive_seconds";
9109          /**
9110           * The maximum number of concurrent suggestion queries to each source.
9111           * @hide
9112           */
9113          @Readable
9114          public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
9115                  "search_per_source_concurrent_query_limit";
9116  
9117          /**
9118           * Whether or not alert sounds are played on StorageManagerService events.
9119           * (0 = false, 1 = true)
9120           * @hide
9121           */
9122          @Readable
9123          public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
9124  
9125          /**
9126           * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
9127           * @hide
9128           */
9129          @Readable
9130          public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
9131  
9132          /**
9133           * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
9134           * @hide
9135           */
9136          @Readable
9137          public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
9138  
9139          /**
9140           * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
9141           * @hide
9142           */
9143          @Readable
9144          public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
9145  
9146          /**
9147           * If nonzero, ANRs in invisible background processes bring up a dialog.
9148           * Otherwise, the process will be silently killed.
9149           *
9150           * Also prevents ANRs and crash dialogs from being suppressed.
9151           * @hide
9152           */
9153          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9154          @TestApi
9155          @Readable
9156          @SuppressLint("NoSettingsProvider")
9157          public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
9158  
9159          /**
9160           * If nonzero, crashes in foreground processes will bring up a dialog.
9161           * Otherwise, the process will be silently killed.
9162           * @hide
9163           */
9164          @TestApi
9165          @Readable
9166          @SuppressLint("NoSettingsProvider")
9167          public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION =
9168                  "show_first_crash_dialog_dev_option";
9169  
9170          /**
9171           * The {@link ComponentName} string of the service to be used as the voice recognition
9172           * service.
9173           *
9174           * @hide
9175           */
9176          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9177          @Readable
9178          public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
9179  
9180          /**
9181           * The {@link ComponentName} string of the selected spell checker service which is
9182           * one of the services managed by the text service manager.
9183           *
9184           * @hide
9185           */
9186          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9187          @TestApi
9188          @Readable
9189          @SuppressLint("NoSettingsProvider")
9190          public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
9191  
9192          /**
9193           * {@link android.view.textservice.SpellCheckerSubtype#hashCode()} of the selected subtype
9194           * of the selected spell checker service which is one of the services managed by the text
9195           * service manager.
9196           *
9197           * @hide
9198           */
9199          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9200          @TestApi
9201          @Readable
9202          @SuppressLint("NoSettingsProvider")
9203          public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
9204                  "selected_spell_checker_subtype";
9205  
9206          /**
9207           * Whether spell checker is enabled or not.
9208           *
9209           * @hide
9210           */
9211          @Readable
9212          public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
9213  
9214          /**
9215           * What happens when the user presses the Power button while in-call
9216           * and the screen is on.<br/>
9217           * <b>Values:</b><br/>
9218           * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
9219           * 2 - The Power button hangs up the current call.<br/>
9220           *
9221           * @hide
9222           */
9223          @UnsupportedAppUsage
9224          @Readable
9225          public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
9226  
9227          /**
9228           * Whether the user allows minimal post processing or not.
9229           *
9230           * <p>Values:
9231           * 0 - Not allowed. Any preferences set through the Window.setPreferMinimalPostProcessing
9232           *     API will be ignored.
9233           * 1 - Allowed. Any preferences set through the Window.setPreferMinimalPostProcessing API
9234           *     will be respected and the appropriate signals will be sent to display.
9235           *     (Default behaviour)
9236           *
9237           * @hide
9238           */
9239          @Readable
9240          public static final String MINIMAL_POST_PROCESSING_ALLOWED =
9241                  "minimal_post_processing_allowed";
9242  
9243          /**
9244           * No mode switching will happen.
9245           *
9246           * @see #MATCH_CONTENT_FRAME_RATE
9247           * @hide
9248           */
9249          public static final int MATCH_CONTENT_FRAMERATE_NEVER = 0;
9250  
9251          /**
9252           * Allow only refresh rate switching between modes in the same configuration group.
9253           * This way only switches without visual interruptions for the user will be allowed.
9254           *
9255           * @see #MATCH_CONTENT_FRAME_RATE
9256           * @hide
9257           */
9258          public static final int MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY = 1;
9259  
9260          /**
9261           * Allow refresh rate switching between all refresh rates even if the switch will have
9262           * visual interruptions for the user.
9263           *
9264           * @see #MATCH_CONTENT_FRAME_RATE
9265           * @hide
9266           */
9267          public static final int MATCH_CONTENT_FRAMERATE_ALWAYS = 2;
9268  
9269          /**
9270           * User's preference for refresh rate switching.
9271           *
9272           * <p>Values:
9273           * 0 - Never switch refresh rates.
9274           * 1 - Switch refresh rates only when it can be done seamlessly. (Default behaviour)
9275           * 2 - Always prefer refresh rate switching even if it's going to have visual interruptions
9276           *     for the user.
9277           *
9278           * @see android.view.Surface#setFrameRate
9279           * @see #MATCH_CONTENT_FRAMERATE_NEVER
9280           * @see #MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY
9281           * @see #MATCH_CONTENT_FRAMERATE_ALWAYS
9282           * @hide
9283           */
9284          public static final String MATCH_CONTENT_FRAME_RATE =
9285                  "match_content_frame_rate";
9286  
9287          /**
9288           * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
9289           * @hide
9290           */
9291          public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
9292  
9293          /**
9294           * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
9295           * @hide
9296           */
9297          public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
9298  
9299          /**
9300           * INCALL_POWER_BUTTON_BEHAVIOR default value.
9301           * @hide
9302           */
9303          public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
9304                  INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
9305  
9306          /**
9307           * What happens when the user presses the Back button while in-call
9308           * and the screen is on.<br/>
9309           * <b>Values:</b><br/>
9310           * 0 - The Back buttons does nothing different.<br/>
9311           * 1 - The Back button hangs up the current call.<br/>
9312           *
9313           * @hide
9314           */
9315          @Readable
9316          public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior";
9317  
9318          /**
9319           * INCALL_BACK_BUTTON_BEHAVIOR value for no action.
9320           * @hide
9321           */
9322          public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0;
9323  
9324          /**
9325           * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up".
9326           * @hide
9327           */
9328          public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1;
9329  
9330          /**
9331           * INCALL_POWER_BUTTON_BEHAVIOR default value.
9332           * @hide
9333           */
9334          public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT =
9335                  INCALL_BACK_BUTTON_BEHAVIOR_NONE;
9336  
9337          /**
9338           * Whether the device should wake when the wake gesture sensor detects motion.
9339           * @hide
9340           */
9341          @Readable
9342          public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
9343  
9344          /**
9345           * Whether the device should doze if configured.
9346           * @hide
9347           */
9348          @UnsupportedAppUsage
9349          @Readable
9350          public static final String DOZE_ENABLED = "doze_enabled";
9351  
9352          /**
9353           * Indicates whether doze should be always on.
9354           * <p>
9355           * Type: int (0 for false, 1 for true)
9356           *
9357           * @hide
9358           */
9359          @SystemApi
9360          @Readable
9361          public static final String DOZE_ALWAYS_ON = "doze_always_on";
9362  
9363          /**
9364           * Whether the device should pulse on pick up gesture.
9365           * @hide
9366           */
9367          @Readable
9368          public static final String DOZE_PICK_UP_GESTURE = "doze_pulse_on_pick_up";
9369  
9370          /**
9371           * Whether the device should pulse on long press gesture.
9372           * @hide
9373           */
9374          @Readable
9375          public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press";
9376  
9377          /**
9378           * Whether the device should pulse on double tap gesture.
9379           * @hide
9380           */
9381          @Readable
9382          public static final String DOZE_DOUBLE_TAP_GESTURE = "doze_pulse_on_double_tap";
9383  
9384          /**
9385           * Whether the device should respond to the SLPI tap gesture.
9386           * @hide
9387           */
9388          @Readable
9389          public static final String DOZE_TAP_SCREEN_GESTURE = "doze_tap_gesture";
9390  
9391          /**
9392           * Gesture that wakes up the display, showing some version of the lock screen.
9393           * @hide
9394           */
9395          @Readable
9396          public static final String DOZE_WAKE_LOCK_SCREEN_GESTURE = "doze_wake_screen_gesture";
9397  
9398          /**
9399           * Gesture that wakes up the display, toggling between {@link Display.STATE_OFF} and
9400           * {@link Display.STATE_DOZE}.
9401           * @hide
9402           */
9403          @Readable
9404          public static final String DOZE_WAKE_DISPLAY_GESTURE = "doze_wake_display_gesture";
9405  
9406          /**
9407           * Gesture that wakes up the display on quick pickup, toggling between
9408           * {@link Display.STATE_OFF} and {@link Display.STATE_DOZE}.
9409           * @hide
9410           */
9411          public static final String DOZE_QUICK_PICKUP_GESTURE = "doze_quick_pickup_gesture";
9412  
9413          /**
9414           * Whether the device should suppress the current doze configuration and disable dozing.
9415           * @hide
9416           */
9417          @Readable
9418          public static final String SUPPRESS_DOZE = "suppress_doze";
9419  
9420          /**
9421           * Gesture that skips media.
9422           * @hide
9423           */
9424          @Readable
9425          public static final String SKIP_GESTURE = "skip_gesture";
9426  
9427          /**
9428           * Count of successful gestures.
9429           * @hide
9430           */
9431          @Readable
9432          public static final String SKIP_GESTURE_COUNT = "skip_gesture_count";
9433  
9434          /**
9435           * Count of non-gesture interaction.
9436           * @hide
9437           */
9438          @Readable
9439          public static final String SKIP_TOUCH_COUNT = "skip_touch_count";
9440  
9441          /**
9442           * Direction to advance media for skip gesture
9443           * @hide
9444           */
9445          @Readable
9446          public static final String SKIP_DIRECTION = "skip_gesture_direction";
9447  
9448          /**
9449           * Gesture that silences sound (alarms, notification, calls).
9450           * @hide
9451           */
9452          @Readable
9453          public static final String SILENCE_GESTURE = "silence_gesture";
9454  
9455          /**
9456           * Count of successful silence alarms gestures.
9457           * @hide
9458           */
9459          @Readable
9460          public static final String SILENCE_ALARMS_GESTURE_COUNT = "silence_alarms_gesture_count";
9461  
9462          /**
9463           * Count of successful silence timer gestures.
9464           * @hide
9465           */
9466          @Readable
9467          public static final String SILENCE_TIMER_GESTURE_COUNT = "silence_timer_gesture_count";
9468  
9469          /**
9470           * Count of successful silence call gestures.
9471           * @hide
9472           */
9473          @Readable
9474          public static final String SILENCE_CALL_GESTURE_COUNT = "silence_call_gesture_count";
9475  
9476          /**
9477           * Count of non-gesture interaction.
9478           * @hide
9479           */
9480          @Readable
9481          public static final String SILENCE_ALARMS_TOUCH_COUNT = "silence_alarms_touch_count";
9482  
9483          /**
9484           * Count of non-gesture interaction.
9485           * @hide
9486           */
9487          @Readable
9488          public static final String SILENCE_TIMER_TOUCH_COUNT = "silence_timer_touch_count";
9489  
9490          /**
9491           * Count of non-gesture interaction.
9492           * @hide
9493           */
9494          @Readable
9495          public static final String SILENCE_CALL_TOUCH_COUNT = "silence_call_touch_count";
9496  
9497          /**
9498           * Number of successful "Motion Sense" tap gestures to pause media.
9499           * @hide
9500           */
9501          @Readable
9502          public static final String AWARE_TAP_PAUSE_GESTURE_COUNT = "aware_tap_pause_gesture_count";
9503  
9504          /**
9505           * Number of touch interactions to pause media when a "Motion Sense" gesture could
9506           * have been used.
9507           * @hide
9508           */
9509          @Readable
9510          public static final String AWARE_TAP_PAUSE_TOUCH_COUNT = "aware_tap_pause_touch_count";
9511  
9512          /**
9513           * For user preference if swipe bottom to expand notification gesture enabled.
9514           * @hide
9515           */
9516          public static final String SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED =
9517                  "swipe_bottom_to_notification_enabled";
9518  
9519          /**
9520           * Controls whether One-Handed mode is currently activated.
9521           * @hide
9522           */
9523          public static final String ONE_HANDED_MODE_ACTIVATED = "one_handed_mode_activated";
9524  
9525          /**
9526           * For user preference if One-Handed Mode enabled.
9527           * @hide
9528           */
9529          public static final String ONE_HANDED_MODE_ENABLED = "one_handed_mode_enabled";
9530  
9531          /**
9532           * For user preference if One-Handed Mode timeout.
9533           * @hide
9534           */
9535          public static final String ONE_HANDED_MODE_TIMEOUT = "one_handed_mode_timeout";
9536  
9537          /**
9538           * For user taps app to exit One-Handed Mode.
9539           * @hide
9540           */
9541          public static final String TAPS_APP_TO_EXIT = "taps_app_to_exit";
9542  
9543          /**
9544           * Internal use, one handed mode tutorial showed times.
9545           * @hide
9546           */
9547          public static final String ONE_HANDED_TUTORIAL_SHOW_COUNT =
9548                  "one_handed_tutorial_show_count";
9549  
9550          /**
9551           * Toggle to enable/disable for the apps to use the Ui translation for Views. The value
9552           * indicates whether the Ui translation is enabled by the user.
9553           * <p>
9554           * Type: {@code int} ({@code 0} for disabled, {@code 1} for enabled)
9555           *
9556           * @hide
9557           */
9558          @SystemApi
9559          @Readable
9560          @SuppressLint("NoSettingsProvider")
9561          public static final String UI_TRANSLATION_ENABLED = "ui_translation_enabled";
9562  
9563          /**
9564           * The current night mode that has been selected by the user.  Owned
9565           * and controlled by UiModeManagerService.  Constants are as per
9566           * UiModeManager.
9567           * @hide
9568           */
9569          @Readable
9570          public static final String UI_NIGHT_MODE = "ui_night_mode";
9571  
9572          /**
9573           * The current night mode custom type that has been selected by the user.  Owned
9574           * and controlled by UiModeManagerService. Constants are as per UiModeManager.
9575           * @hide
9576           */
9577          @Readable
9578          @SuppressLint("NoSettingsProvider")
9579          public static final String UI_NIGHT_MODE_CUSTOM_TYPE = "ui_night_mode_custom_type";
9580  
9581          /**
9582           * The current night mode that has been overridden to turn on by the system.  Owned
9583           * and controlled by UiModeManagerService.  Constants are as per
9584           * UiModeManager.
9585           * @hide
9586           */
9587          @Readable
9588          public static final String UI_NIGHT_MODE_OVERRIDE_ON = "ui_night_mode_override_on";
9589  
9590          /**
9591           * The last computed night mode bool the last time the phone was on
9592           * @hide
9593           */
9594          public static final String UI_NIGHT_MODE_LAST_COMPUTED = "ui_night_mode_last_computed";
9595  
9596          /**
9597           * The current night mode that has been overridden to turn off by the system.  Owned
9598           * and controlled by UiModeManagerService.  Constants are as per
9599           * UiModeManager.
9600           * @hide
9601           */
9602          @Readable
9603          public static final String UI_NIGHT_MODE_OVERRIDE_OFF = "ui_night_mode_override_off";
9604  
9605          /**
9606           * Whether screensavers are enabled.
9607           * @hide
9608           */
9609          @Readable
9610          public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
9611  
9612          /**
9613           * The user's chosen screensaver components.
9614           *
9615           * These will be launched by the PhoneWindowManager after a timeout when not on
9616           * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
9617           * @hide
9618           */
9619          @Readable
9620          public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
9621  
9622          /**
9623           * If screensavers are enabled, whether the screensaver should be automatically launched
9624           * when the device is inserted into a (desk) dock.
9625           * @hide
9626           */
9627          @Readable
9628          public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
9629  
9630          /**
9631           * If screensavers are enabled, whether the screensaver should be automatically launched
9632           * when the screen times out when not on battery.
9633           * @hide
9634           */
9635          @Readable
9636          public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
9637  
9638          /**
9639           * If screensavers are enabled, the default screensaver component.
9640           * @hide
9641           */
9642          @Readable
9643          public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
9644  
9645          /**
9646           * Whether complications are enabled to be shown over the screensaver by the user.
9647           *
9648           * @hide
9649           */
9650          public static final String SCREENSAVER_COMPLICATIONS_ENABLED =
9651                  "screensaver_complications_enabled";
9652  
9653          /**
9654           * Whether home controls are enabled to be shown over the screensaver by the user.
9655           *
9656           * @hide
9657           */
9658          public static final String SCREENSAVER_HOME_CONTROLS_ENABLED =
9659                  "screensaver_home_controls_enabled";
9660  
9661  
9662          /**
9663           * Default, indicates that the user has not yet started the dock setup flow.
9664           *
9665           * @hide
9666           */
9667          public static final int DOCK_SETUP_NOT_STARTED = 0;
9668  
9669          /**
9670           * Indicates that the user has started but not yet completed dock setup.
9671           * One of the possible states for {@link #DOCK_SETUP_STATE}.
9672           *
9673           * @hide
9674           */
9675          public static final int DOCK_SETUP_STARTED = 1;
9676  
9677          /**
9678           * Indicates that the user has snoozed dock setup and will complete it later.
9679           * One of the possible states for {@link #DOCK_SETUP_STATE}.
9680           *
9681           * @hide
9682           */
9683          public static final int DOCK_SETUP_PAUSED = 2;
9684  
9685          /**
9686           * Indicates that the user has been prompted to start dock setup.
9687           * One of the possible states for {@link #DOCK_SETUP_STATE}.
9688           *
9689           * @hide
9690           */
9691          public static final int DOCK_SETUP_PROMPTED = 3;
9692  
9693          /**
9694           * Indicates that the user has started dock setup but never finished it.
9695           * One of the possible states for {@link #DOCK_SETUP_STATE}.
9696           *
9697           * @hide
9698           */
9699          public static final int DOCK_SETUP_INCOMPLETE = 4;
9700  
9701          /**
9702           * Indicates that the user has completed dock setup.
9703           * One of the possible states for {@link #DOCK_SETUP_STATE}.
9704           *
9705           * @hide
9706           */
9707          public static final int DOCK_SETUP_COMPLETED = 10;
9708  
9709          /**
9710           * Indicates that dock setup timed out before the user could complete it.
9711           * One of the possible states for {@link #DOCK_SETUP_STATE}.
9712           *
9713           * @hide
9714           */
9715          public static final int DOCK_SETUP_TIMED_OUT = 11;
9716  
9717          /** @hide */
9718          @Retention(RetentionPolicy.SOURCE)
9719          @IntDef({
9720                  DOCK_SETUP_NOT_STARTED,
9721                  DOCK_SETUP_STARTED,
9722                  DOCK_SETUP_PAUSED,
9723                  DOCK_SETUP_PROMPTED,
9724                  DOCK_SETUP_INCOMPLETE,
9725                  DOCK_SETUP_COMPLETED,
9726                  DOCK_SETUP_TIMED_OUT
9727          })
9728          public @interface DockSetupState {
9729          }
9730  
9731          /**
9732           * Defines the user's current state of dock setup.
9733           * The possible states are defined in {@link DockSetupState}.
9734           *
9735           * @hide
9736           */
9737          public static final String DOCK_SETUP_STATE = "dock_setup_state";
9738  
9739          /**
9740           * The default NFC payment component
9741           * @hide
9742           */
9743          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9744          public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
9745  
9746          /**
9747           * Whether NFC payment is handled by the foreground application or a default.
9748           * @hide
9749           */
9750          @Readable
9751          public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
9752  
9753          /**
9754           * Specifies the package name currently configured to be the primary sms application
9755           * @hide
9756           */
9757          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9758          @Readable
9759          public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
9760  
9761          /**
9762           * Specifies the package name currently configured to be the default dialer application
9763           * @hide
9764           */
9765          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9766          @Readable
9767          public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
9768  
9769          /**
9770           * Specifies the component name currently configured to be the default call screening
9771           * application
9772           * @hide
9773           */
9774          @Readable
9775          public static final String CALL_SCREENING_DEFAULT_COMPONENT =
9776                  "call_screening_default_component";
9777  
9778          /**
9779           * Specifies the package name currently configured to be the emergency assistance application
9780           *
9781           * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
9782           *
9783           * @hide
9784           */
9785          @Readable
9786          public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
9787  
9788          /**
9789           * Specifies whether the current app context on scren (assist data) will be sent to the
9790           * assist application (active voice interaction service).
9791           *
9792           * @hide
9793           */
9794          @Readable
9795          public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
9796  
9797          /**
9798           * Specifies whether a screenshot of the screen contents will be sent to the assist
9799           * application (active voice interaction service).
9800           *
9801           * @hide
9802           */
9803          @Readable
9804          public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";
9805  
9806          /**
9807           * Specifies whether the screen will show an animation if screen contents are sent to the
9808           * assist application (active voice interaction service).
9809           *
9810           * Note that the disclosure will be forced for third-party assistants or if the device
9811           * does not support disabling it.
9812           *
9813           * @hide
9814           */
9815          @Readable
9816          public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled";
9817  
9818          /**
9819           * Control if rotation suggestions are sent to System UI when in rotation locked mode.
9820           * Done to enable screen rotation while the screen rotation is locked. Enabling will
9821           * poll the accelerometer in rotation locked mode.
9822           *
9823           * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent.
9824           *
9825           * @hide
9826           */
9827          @Readable
9828          public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions";
9829  
9830          /**
9831           * The disabled state of SHOW_ROTATION_SUGGESTIONS.
9832           * @hide
9833           */
9834          public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0;
9835  
9836          /**
9837           * The enabled state of SHOW_ROTATION_SUGGESTIONS.
9838           * @hide
9839           */
9840          public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1;
9841  
9842          /**
9843           * The default state of SHOW_ROTATION_SUGGESTIONS.
9844           * @hide
9845           */
9846          public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT =
9847                  SHOW_ROTATION_SUGGESTIONS_ENABLED;
9848  
9849          /**
9850           * The number of accepted rotation suggestions. Used to determine if the user has been
9851           * introduced to rotation suggestions.
9852           * @hide
9853           */
9854          @Readable
9855          public static final String NUM_ROTATION_SUGGESTIONS_ACCEPTED =
9856                  "num_rotation_suggestions_accepted";
9857  
9858          /**
9859           * Read only list of the service components that the current user has explicitly allowed to
9860           * see and assist with all of the user's notifications.
9861           *
9862           * @deprecated Use
9863           * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}.
9864           * @hide
9865           */
9866          @Deprecated
9867          @Readable
9868          public static final String ENABLED_NOTIFICATION_ASSISTANT =
9869                  "enabled_notification_assistant";
9870  
9871          /**
9872           * Read only list of the service components that the current user has explicitly allowed to
9873           * see all of the user's notifications, separated by ':'.
9874           *
9875           * @hide
9876           * @deprecated Use
9877           * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}.
9878           */
9879          @Deprecated
9880          @UnsupportedAppUsage
9881          @Readable
9882          public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
9883  
9884          /**
9885           * Read only list of the packages that the current user has explicitly allowed to
9886           * manage do not disturb, separated by ':'.
9887           *
9888           * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}.
9889           * @hide
9890           */
9891          @Deprecated
9892          @TestApi
9893          @Readable
9894          public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES =
9895                  "enabled_notification_policy_access_packages";
9896  
9897          /**
9898           * Defines whether managed profile ringtones should be synced from it's parent profile
9899           * <p>
9900           * 0 = ringtones are not synced
9901           * 1 = ringtones are synced from the profile's parent (default)
9902           * <p>
9903           * This value is only used for managed profiles.
9904           * @hide
9905           */
9906          @TestApi
9907          @Readable
9908          @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
9909          public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds";
9910  
9911          /**
9912           * @hide
9913           */
9914          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
9915          @TestApi
9916          @Readable
9917          public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
9918  
9919          /**
9920           * This is the query URI for finding a print service to install.
9921           *
9922           * @hide
9923           */
9924          @Readable
9925          public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
9926  
9927          /**
9928           * This is the query URI for finding a NFC payment service to install.
9929           *
9930           * @hide
9931           */
9932          @Readable
9933          public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
9934  
9935          /**
9936           * This is the query URI for finding a auto fill service to install.
9937           *
9938           * @hide
9939           */
9940          @Readable
9941          public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri";
9942  
9943          /**
9944           * If enabled, apps should try to skip any introductory hints on first launch. This might
9945           * apply to users that are already familiar with the environment or temporary users.
9946           * <p>
9947           * Type : int (0 to show hints, 1 to skip showing hints)
9948           */
9949          @Readable
9950          public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
9951  
9952          /**
9953           * Persisted playback time after a user confirmation of an unsafe volume level.
9954           *
9955           * @hide
9956           */
9957          @Readable
9958          public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
9959  
9960          /**
9961           * Indicates whether the spatial audio feature was enabled for this user.
9962           *
9963           * Type : int (0 disabled, 1 enabled)
9964           *
9965           * @hide
9966           */
9967          public static final String SPATIAL_AUDIO_ENABLED = "spatial_audio_enabled";
9968  
9969          /**
9970           * Internal collection of audio device inventory items
9971           * The device item stored are {@link com.android.server.audio.AdiDeviceState}
9972           * @hide
9973           */
9974          public static final String AUDIO_DEVICE_INVENTORY = "audio_device_inventory";
9975  
9976          /**
9977           * Stores a boolean that defines whether the CSD as a feature is enabled or not.
9978           * @hide
9979           */
9980          public static final String AUDIO_SAFE_CSD_AS_A_FEATURE_ENABLED =
9981                  "audio_safe_csd_as_a_feature_enabled";
9982  
9983          /**
9984           * Indicates whether notification display on the lock screen is enabled.
9985           * <p>
9986           * Type: int (0 for false, 1 for true)
9987           *
9988           * @hide
9989           */
9990          @SystemApi
9991          @Readable
9992          public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
9993                  "lock_screen_show_notifications";
9994  
9995          /**
9996           * Indicates whether the lock screen should display silent notifications.
9997           * <p>
9998           * Type: int (0 for false, 1 for true)
9999           *
10000           * @hide
10001           */
10002          @Readable
10003          public static final String LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS =
10004                  "lock_screen_show_silent_notifications";
10005  
10006          /**
10007           * Indicates whether "seen" notifications should be suppressed from the lockscreen.
10008           * <p>
10009           * Type: int (0 for unset, 1 for true, 2 for false)
10010           *
10011           * @hide
10012           */
10013          public static final String LOCK_SCREEN_SHOW_ONLY_UNSEEN_NOTIFICATIONS =
10014                  "lock_screen_show_only_unseen_notifications";
10015  
10016          /**
10017           * Indicates whether snooze options should be shown on notifications
10018           * <p>
10019           * Type: int (0 for false, 1 for true)
10020           *
10021           * @hide
10022           */
10023          @Readable
10024          public static final String SHOW_NOTIFICATION_SNOOZE = "show_notification_snooze";
10025  
10026          /**
10027           * List of TV inputs that are currently hidden. This is a string
10028           * containing the IDs of all hidden TV inputs. Each ID is encoded by
10029           * {@link android.net.Uri#encode(String)} and separated by ':'.
10030           * @hide
10031           */
10032          @Readable
10033          public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
10034  
10035          /**
10036           * List of custom TV input labels. This is a string containing <TV input id, custom name>
10037           * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
10038           * and separated by ','. Each pair is separated by ':'.
10039           * @hide
10040           */
10041          @Readable
10042          public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
10043  
10044          /**
10045           * Whether TV app uses non-system inputs.
10046           *
10047           * <p>
10048           * The value is boolean (1 or 0), where 1 means non-system TV inputs are allowed,
10049           * and 0 means non-system TV inputs are not allowed.
10050           *
10051           * <p>
10052           * Devices such as sound bars may have changed the system property allow_third_party_inputs
10053           * to false so the TV Application only uses HDMI and other built in inputs. This setting
10054           * allows user to override the default and have the TV Application use third party TV inputs
10055           * available on play store.
10056           *
10057           * @hide
10058           */
10059          @Readable
10060          public static final String TV_APP_USES_NON_SYSTEM_INPUTS = "tv_app_uses_non_system_inputs";
10061  
10062          /**
10063           * Whether automatic routing of system audio to USB audio peripheral is disabled.
10064           * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
10065           * and 0 means automatic routing is enabled.
10066           *
10067           * @hide
10068           */
10069          @Readable
10070          public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
10071                  "usb_audio_automatic_routing_disabled";
10072  
10073          /**
10074           * The timeout in milliseconds before the device fully goes to sleep after
10075           * a period of inactivity.  This value sets an upper bound on how long the device
10076           * will stay awake or dreaming without user activity.  It should generally
10077           * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
10078           * will sleep before it ever has a chance to dream.
10079           * <p>
10080           * Use -1 to disable this timeout.
10081           * </p>
10082           *
10083           * @hide
10084           */
10085          @Readable
10086          public static final String SLEEP_TIMEOUT = "sleep_timeout";
10087  
10088          /**
10089           * The timeout in milliseconds before the device goes to sleep due to user inattentiveness,
10090           * even if the system is holding wakelocks. It should generally be longer than {@code
10091           * config_attentiveWarningDuration}, as otherwise the device will show the attentive
10092           * warning constantly. Small timeouts are discouraged, as they will cause the device to
10093           * go to sleep quickly after waking up.
10094           * <p>
10095           * Use -1 to disable this timeout.
10096           * </p>
10097           *
10098           * @hide
10099           */
10100          @Readable
10101          public static final String ATTENTIVE_TIMEOUT = "attentive_timeout";
10102  
10103          /**
10104           * Controls whether double tap to wake is enabled.
10105           * @hide
10106           */
10107          @Readable
10108          public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
10109  
10110          /**
10111           * The current assistant component. It could be a voice interaction service,
10112           * or an activity that handles ACTION_ASSIST, or empty which means using the default
10113           * handling.
10114           *
10115           * <p>This should be set indirectly by setting the {@link
10116           * android.app.role.RoleManager#ROLE_ASSISTANT assistant role}.
10117           *
10118           * @hide
10119           */
10120          @UnsupportedAppUsage
10121          @Readable
10122          public static final String ASSISTANT = "assistant";
10123  
10124          /**
10125           * Whether the camera launch gesture should be disabled.
10126           *
10127           * @hide
10128           */
10129          @Readable
10130          public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled";
10131  
10132          /**
10133           * Whether the emergency gesture should be enabled.
10134           *
10135           * @hide
10136           */
10137          public static final String EMERGENCY_GESTURE_ENABLED = "emergency_gesture_enabled";
10138  
10139          /**
10140           * Whether the emergency gesture sound should be enabled.
10141           *
10142           * @hide
10143           */
10144          public static final String EMERGENCY_GESTURE_SOUND_ENABLED =
10145                  "emergency_gesture_sound_enabled";
10146  
10147          /**
10148           * Whether the emergency gesture UI is currently showing.
10149           *
10150           * @hide
10151           */
10152          public static final String EMERGENCY_GESTURE_UI_SHOWING = "emergency_gesture_ui_showing";
10153  
10154          /**
10155           * The last time the emergency gesture UI was started.
10156           *
10157           * @hide
10158           */
10159          public static final String EMERGENCY_GESTURE_UI_LAST_STARTED_MILLIS =
10160                  "emergency_gesture_ui_last_started_millis";
10161  
10162          /**
10163           * Whether the camera launch gesture to double tap the power button when the screen is off
10164           * should be disabled.
10165           *
10166           * @hide
10167           */
10168          @Readable
10169          public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED =
10170                  "camera_double_tap_power_gesture_disabled";
10171  
10172          /**
10173           * Whether the camera double twist gesture to flip between front and back mode should be
10174           * enabled.
10175           *
10176           * @hide
10177           */
10178          @Readable
10179          public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED =
10180                  "camera_double_twist_to_flip_enabled";
10181  
10182          /**
10183           * Whether or not the smart camera lift trigger that launches the camera when the user moves
10184           * the phone into a position for taking photos should be enabled.
10185           *
10186           * @hide
10187           */
10188          @Readable
10189          public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled";
10190  
10191          /**
10192           * The default enable state of the camera lift trigger.
10193           *
10194           * @hide
10195           */
10196          public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1;
10197  
10198          /**
10199           * Whether or not the flashlight (camera torch mode) is available required to turn
10200           * on flashlight.
10201           *
10202           * @hide
10203           */
10204          @Readable
10205          public static final String FLASHLIGHT_AVAILABLE = "flashlight_available";
10206  
10207          /**
10208           * Whether or not flashlight is enabled.
10209           *
10210           * @hide
10211           */
10212          @Readable
10213          public static final String FLASHLIGHT_ENABLED = "flashlight_enabled";
10214  
10215          /**
10216           * Whether or not face unlock is allowed on Keyguard.
10217           * @hide
10218           */
10219          @Readable
10220          public static final String FACE_UNLOCK_KEYGUARD_ENABLED = "face_unlock_keyguard_enabled";
10221  
10222          /**
10223           * Whether or not face unlock dismisses the keyguard.
10224           * @hide
10225           */
10226          @Readable
10227          public static final String FACE_UNLOCK_DISMISSES_KEYGUARD =
10228                  "face_unlock_dismisses_keyguard";
10229  
10230          /**
10231           * Whether or not media is shown automatically when bypassing as a heads up.
10232           * @hide
10233           */
10234          @Readable
10235          public static final String SHOW_MEDIA_WHEN_BYPASSING =
10236                  "show_media_when_bypassing";
10237  
10238          /**
10239           * Whether or not face unlock requires attention. This is a cached value, the source of
10240           * truth is obtained through the HAL.
10241           * @hide
10242           */
10243          @Readable
10244          public static final String FACE_UNLOCK_ATTENTION_REQUIRED =
10245                  "face_unlock_attention_required";
10246  
10247          /**
10248           * Whether or not face unlock requires a diverse set of poses during enrollment. This is a
10249           * cached value, the source of truth is obtained through the HAL.
10250           * @hide
10251           */
10252          @Readable
10253          public static final String FACE_UNLOCK_DIVERSITY_REQUIRED =
10254                  "face_unlock_diversity_required";
10255  
10256  
10257          /**
10258           * Whether or not face unlock is allowed for apps (through BiometricPrompt).
10259           * @hide
10260           */
10261          @Readable
10262          public static final String FACE_UNLOCK_APP_ENABLED = "face_unlock_app_enabled";
10263  
10264          /**
10265           * Whether or not face unlock always requires user confirmation, meaning {@link
10266           * android.hardware.biometrics.BiometricPrompt.Builder#setConfirmationRequired(boolean)}
10267           * is always 'true'. This overrides the behavior that apps choose in the
10268           * setConfirmationRequired API.
10269           * @hide
10270           */
10271          @Readable
10272          public static final String FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION =
10273                  "face_unlock_always_require_confirmation";
10274  
10275          /**
10276           * Whether or not a user should re enroll their face.
10277           *
10278           * Face unlock re enroll.
10279           *  0 = No re enrollment.
10280           *  1 = Re enrollment is required.
10281           *
10282           * @hide
10283           */
10284          @Readable
10285          public static final String FACE_UNLOCK_RE_ENROLL = "face_unlock_re_enroll";
10286  
10287          /**
10288           * The time (in millis) to wait for a power button before sending a
10289           * successful auth in to keyguard(for side fingerprint)
10290           * @hide
10291           */
10292          @Readable
10293          public static final String FINGERPRINT_SIDE_FPS_KG_POWER_WINDOW =
10294                  "fingerprint_side_fps_kg_power_window";
10295  
10296          /**
10297           * The time (in millis) to wait for a power button before sending
10298           * a successful auth in biometric prompt(for side fingerprint)
10299           * @hide
10300           */
10301          @Readable
10302          public static final String FINGERPRINT_SIDE_FPS_BP_POWER_WINDOW =
10303                  "fingerprint_side_fps_bp_power_window";
10304  
10305          /**
10306           * The time (in millis) that a finger tap will wait for a power button
10307           * before dismissing the power dialog during enrollment(for side
10308           * fingerprint)
10309           * @hide
10310           */
10311          @Readable
10312          public static final String FINGERPRINT_SIDE_FPS_ENROLL_TAP_WINDOW =
10313                  "fingerprint_side_fps_enroll_tap_window";
10314  
10315          /**
10316           * The time (in millis) that a power event will ignore future authentications
10317           * (for side fingerprint)
10318           * @hide
10319           */
10320          @Readable
10321          public static final String FINGERPRINT_SIDE_FPS_AUTH_DOWNTIME =
10322                  "fingerprint_side_fps_auth_downtime";
10323  
10324          /**
10325           * Whether or not a SFPS device is enabling the performant auth setting.
10326           * The "_V2" suffix was added to re-introduce the default behavior for
10327           * users. See b/265264294 fore more details.
10328           * @hide
10329           */
10330          public static final String SFPS_PERFORMANT_AUTH_ENABLED = "sfps_performant_auth_enabled_v2";
10331  
10332          /**
10333           * Whether or not debugging is enabled.
10334           * @hide
10335           */
10336          @Readable
10337          public static final String BIOMETRIC_DEBUG_ENABLED =
10338                  "biometric_debug_enabled";
10339  
10340          /**
10341           * Whether or not virtual sensors are enabled.
10342           * @hide
10343           */
10344          @TestApi
10345          @Readable
10346          public static final String BIOMETRIC_VIRTUAL_ENABLED = "biometric_virtual_enabled";
10347  
10348          /**
10349           * Whether or not biometric is allowed on Keyguard.
10350           * @hide
10351           */
10352          @Readable
10353          public static final String BIOMETRIC_KEYGUARD_ENABLED = "biometric_keyguard_enabled";
10354  
10355          /**
10356           * Whether or not biometric is allowed for apps (through BiometricPrompt).
10357           * @hide
10358           */
10359          @Readable
10360          public static final String BIOMETRIC_APP_ENABLED = "biometric_app_enabled";
10361  
10362          /**
10363           * Whether or not active unlock triggers on wake.
10364           * @hide
10365           */
10366          public static final String ACTIVE_UNLOCK_ON_WAKE = "active_unlock_on_wake";
10367  
10368          /**
10369           * Whether or not active unlock triggers on unlock intent.
10370           * @hide
10371           */
10372          public static final String ACTIVE_UNLOCK_ON_UNLOCK_INTENT =
10373                  "active_unlock_on_unlock_intent";
10374  
10375          /**
10376           * Whether or not active unlock triggers on biometric failure.
10377           * @hide
10378           */
10379          public static final String ACTIVE_UNLOCK_ON_BIOMETRIC_FAIL =
10380                  "active_unlock_on_biometric_fail";
10381  
10382          /**
10383           * If active unlock triggers on biometric failures, include the following error codes
10384           * as a biometric failure. See {@link android.hardware.biometrics.BiometricFaceConstants}.
10385           * Error codes should be separated by a pipe. For example: "1|4|5". If active unlock
10386           * should never trigger on any face errors, this should be set to an empty string.
10387           * A null value will use the system default value (TIMEOUT).
10388           * @hide
10389           */
10390          public static final String ACTIVE_UNLOCK_ON_FACE_ERRORS =
10391                  "active_unlock_on_face_errors";
10392  
10393          /**
10394           * If active unlock triggers on biometric failures, include the following acquired info
10395           * as a "biometric failure". See {@link android.hardware.biometrics.BiometricFaceConstants}.
10396           * Acquired codes should be separated by a pipe. For example: "1|4|5". If active unlock
10397           * should never on trigger on any acquired info messages, this should be
10398           * set to an empty string. A null value will use the system default value (none).
10399           * @hide
10400           */
10401          public static final String ACTIVE_UNLOCK_ON_FACE_ACQUIRE_INFO =
10402                  "active_unlock_on_face_acquire_info";
10403  
10404          /**
10405           * If active unlock triggers on biometric failures, then also request active unlock on
10406           * unlock intent when each setting (BiometricType) is the only biometric type enrolled.
10407           * Biometric types should be separated by a pipe. For example: "0|3" or "0". If this
10408           * setting should be disabled, then this should be set to an empty string. A null value
10409           * will use the system default value (0 / None).
10410           *   0 = None, 1 = Any face, 2 = Any fingerprint, 3 = Under display fingerprint
10411           * @hide
10412           */
10413          public static final String ACTIVE_UNLOCK_ON_UNLOCK_INTENT_WHEN_BIOMETRIC_ENROLLED =
10414                  "active_unlock_on_unlock_intent_when_biometric_enrolled";
10415  
10416          /**
10417           * If active unlock triggers on unlock intents, then also request active unlock on
10418           * these wake-up reasons. See {@link PowerManager.WakeReason} for value mappings.
10419           * WakeReasons should be separated by a pipe. For example: "0|3" or "0". If this
10420           * setting should be disabled, then this should be set to an empty string. A null value
10421           * will use the system default value (WAKE_REASON_UNFOLD_DEVICE).
10422           * @hide
10423           */
10424          public static final String ACTIVE_UNLOCK_WAKEUPS_CONSIDERED_UNLOCK_INTENTS =
10425                  "active_unlock_wakeups_considered_unlock_intents";
10426  
10427          /**
10428           * If active unlock triggers and succeeds on these wakeups, force dismiss keyguard on
10429           * these wake reasons. See {@link PowerManager#WakeReason} for value mappings.
10430           * WakeReasons should be separated by a pipe. For example: "0|3" or "0". If this
10431           * setting should be disabled, then this should be set to an empty string. A null value
10432           * will use the system default value (WAKE_REASON_UNFOLD_DEVICE).
10433           * @hide
10434           */
10435          public static final String ACTIVE_UNLOCK_WAKEUPS_TO_FORCE_DISMISS_KEYGUARD =
10436                  "active_unlock_wakeups_to_force_dismiss_keyguard";
10437  
10438          /**
10439           * Whether the assist gesture should be enabled.
10440           *
10441           * @hide
10442           */
10443          @Readable
10444          public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled";
10445  
10446          /**
10447           * Sensitivity control for the assist gesture.
10448           *
10449           * @hide
10450           */
10451          @Readable
10452          public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity";
10453  
10454          /**
10455           * Whether the assist gesture should silence alerts.
10456           *
10457           * @hide
10458           */
10459          @Readable
10460          public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED =
10461                  "assist_gesture_silence_alerts_enabled";
10462  
10463          /**
10464           * Whether the assist gesture should wake the phone.
10465           *
10466           * @hide
10467           */
10468          @Readable
10469          public static final String ASSIST_GESTURE_WAKE_ENABLED =
10470                  "assist_gesture_wake_enabled";
10471  
10472          /**
10473           * Indicates whether the Assist Gesture Deferred Setup has been completed.
10474           * <p>
10475           * Type: int (0 for false, 1 for true)
10476           *
10477           * @hide
10478           */
10479          @SystemApi
10480          @Readable
10481          public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
10482  
10483          /**
10484           * Whether the assistant can be triggered by a touch gesture.
10485           *
10486           * @hide
10487           */
10488          public static final String ASSIST_TOUCH_GESTURE_ENABLED =
10489                  "assist_touch_gesture_enabled";
10490  
10491          /**
10492           * Whether the assistant can be triggered by long-pressing the home button
10493           *
10494           * @hide
10495           */
10496          public static final String ASSIST_LONG_PRESS_HOME_ENABLED =
10497                  "assist_long_press_home_enabled";
10498  
10499          /**
10500           * Whether press and hold on nav handle can trigger search.
10501           *
10502           * @hide
10503           */
10504          public static final String SEARCH_PRESS_HOLD_NAV_HANDLE_ENABLED =
10505                  "search_press_hold_nav_handle_enabled";
10506  
10507          /**
10508           * Whether long-pressing on the home button can trigger search.
10509           *
10510           * @hide
10511           */
10512          public static final String SEARCH_LONG_PRESS_HOME_ENABLED =
10513                  "search_long_press_home_enabled";
10514  
10515          /**
10516           * Control whether Trust Agents are in active unlock or extend unlock mode.
10517           * @hide
10518           */
10519          @Readable
10520          public static final String TRUST_AGENTS_EXTEND_UNLOCK = "trust_agents_extend_unlock";
10521  
10522          /**
10523           * Control whether the screen locks when trust is lost.
10524           * @hide
10525           */
10526          @Readable
10527          public static final String LOCK_SCREEN_WHEN_TRUST_LOST = "lock_screen_when_trust_lost";
10528  
10529          /**
10530           * Control whether Night display is currently activated.
10531           * @hide
10532           */
10533          @Readable
10534          public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated";
10535  
10536          /**
10537           * Control whether Night display will automatically activate/deactivate.
10538           * @hide
10539           */
10540          @Readable
10541          public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode";
10542  
10543          /**
10544           * Control the color temperature of Night Display, represented in Kelvin.
10545           * @hide
10546           */
10547          @Readable
10548          public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE =
10549                  "night_display_color_temperature";
10550  
10551          /**
10552           * Custom time when Night display is scheduled to activate.
10553           * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
10554           * @hide
10555           */
10556          @Readable
10557          public static final String NIGHT_DISPLAY_CUSTOM_START_TIME =
10558                  "night_display_custom_start_time";
10559  
10560          /**
10561           * Custom time when Night display is scheduled to deactivate.
10562           * Represented as milliseconds from midnight (e.g. 21600000 == 6am).
10563           * @hide
10564           */
10565          @Readable
10566          public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time";
10567  
10568          /**
10569           * A String representing the LocalDateTime when Night display was last activated. Use to
10570           * decide whether to apply the current activated state after a reboot or user change. In
10571           * legacy cases, this is represented by the time in milliseconds (since epoch).
10572           * @hide
10573           */
10574          @Readable
10575          public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME =
10576                  "night_display_last_activated_time";
10577  
10578          /**
10579           * Control whether display white balance is currently enabled.
10580           * @hide
10581           */
10582          @Readable
10583          public static final String DISPLAY_WHITE_BALANCE_ENABLED = "display_white_balance_enabled";
10584  
10585          /**
10586           * Names of the service components that the current user has explicitly allowed to
10587           * be a VR mode listener, separated by ':'.
10588           *
10589           * @hide
10590           */
10591          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
10592          @TestApi
10593          @Readable
10594          public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners";
10595  
10596          /**
10597           * Behavior of the display while in VR mode.
10598           *
10599           * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}.
10600           *
10601           * @hide
10602           */
10603          @Readable
10604          public static final String VR_DISPLAY_MODE = "vr_display_mode";
10605  
10606          /**
10607           * Lower the display persistence while the system is in VR mode.
10608           *
10609           * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
10610           *
10611           * @hide.
10612           */
10613          public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0;
10614  
10615          /**
10616           * Do not alter the display persistence while the system is in VR mode.
10617           *
10618           * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
10619           *
10620           * @hide.
10621           */
10622          public static final int VR_DISPLAY_MODE_OFF = 1;
10623  
10624          /**
10625           * The latest SDK version that CarrierAppUtils#disableCarrierAppsUntilPrivileged has been
10626           * executed for.
10627           *
10628           * <p>This is used to ensure that we only take one pass which will disable apps that are not
10629           * privileged (if any). From then on, we only want to enable apps (when a matching SIM is
10630           * inserted), to avoid disabling an app that the user might actively be using.
10631           *
10632           * <p>Will be set to {@link android.os.Build.VERSION#SDK_INT} once executed. Note that older
10633           * SDK versions prior to R set 1 for this value.
10634           *
10635           * @hide
10636           */
10637          @Readable
10638          public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled";
10639  
10640          /**
10641           * Whether parent user can access remote contact in managed profile.
10642           *
10643           * @hide
10644           */
10645          @Readable
10646          public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH =
10647                  "managed_profile_contact_remote_search";
10648  
10649          /**
10650           * Whether parent profile can access remote calendar data in managed profile.
10651           *
10652           * @hide
10653           */
10654          @Readable
10655          public static final String CROSS_PROFILE_CALENDAR_ENABLED =
10656                  "cross_profile_calendar_enabled";
10657  
10658          /**
10659           * Whether or not the automatic storage manager is enabled and should run on the device.
10660           *
10661           * @hide
10662           */
10663          @Readable
10664          public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED =
10665                  "automatic_storage_manager_enabled";
10666  
10667          /**
10668           * How many days of information for the automatic storage manager to retain on the device.
10669           *
10670           * @hide
10671           */
10672          @Readable
10673          public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN =
10674                  "automatic_storage_manager_days_to_retain";
10675  
10676          /**
10677           * Default number of days of information for the automatic storage manager to retain.
10678           *
10679           * @hide
10680           */
10681          public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90;
10682  
10683          /**
10684           * How many bytes the automatic storage manager has cleared out.
10685           *
10686           * @hide
10687           */
10688          @Readable
10689          public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED =
10690                  "automatic_storage_manager_bytes_cleared";
10691  
10692          /**
10693           * Last run time for the automatic storage manager.
10694           *
10695           * @hide
10696           */
10697          @Readable
10698          public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN =
10699                  "automatic_storage_manager_last_run";
10700          /**
10701           * If the automatic storage manager has been disabled by policy. Note that this doesn't
10702           * mean that the automatic storage manager is prevented from being re-enabled -- this only
10703           * means that it was turned off by policy at least once.
10704           *
10705           * @hide
10706           */
10707          @Readable
10708          public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY =
10709                  "automatic_storage_manager_turned_off_by_policy";
10710  
10711          /**
10712           * Whether SystemUI navigation keys is enabled.
10713           * @hide
10714           */
10715          @Readable
10716          public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
10717                  "system_navigation_keys_enabled";
10718  
10719          /**
10720           * Holds comma separated list of ordering of QS tiles.
10721           *
10722           * @hide
10723           */
10724          @Readable(maxTargetSdk = VERSION_CODES.TIRAMISU)
10725          public static final String QS_TILES = "sysui_qs_tiles";
10726  
10727          /**
10728           * Whether this user has enabled Quick controls.
10729           *
10730           * 0 indicates disabled and 1 indicates enabled. A non existent value should be treated as
10731           * enabled.
10732           *
10733           * @deprecated Controls are migrated to Quick Settings, rendering this unnecessary and will
10734           *             be removed in a future release.
10735           * @hide
10736           */
10737          @Readable
10738          @Deprecated
10739          public static final String CONTROLS_ENABLED = "controls_enabled";
10740  
10741          /**
10742           * Whether power menu content (cards, passes, controls) will be shown when device is locked.
10743           *
10744           * 0 indicates hide and 1 indicates show. A non existent value will be treated as hide.
10745           * @hide
10746           */
10747          @TestApi
10748          @Readable
10749          public static final String POWER_MENU_LOCKED_SHOW_CONTENT =
10750                  "power_menu_locked_show_content";
10751  
10752          /**
10753           * Whether home controls should be accessible from the lockscreen
10754           *
10755           * @hide
10756           */
10757          public static final String LOCKSCREEN_SHOW_CONTROLS = "lockscreen_show_controls";
10758  
10759          /**
10760           * Whether trivial home controls can be used without authentication
10761           *
10762           * @hide
10763           */
10764          public static final String LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS =
10765                  "lockscreen_allow_trivial_controls";
10766  
10767          /**
10768           * Whether wallet should be accessible from the lockscreen
10769           *
10770           * @hide
10771           */
10772          public static final String LOCKSCREEN_SHOW_WALLET = "lockscreen_show_wallet";
10773  
10774          /**
10775           * Whether to use the lockscreen double-line clock
10776           *
10777           * @hide
10778           */
10779          public static final String LOCKSCREEN_USE_DOUBLE_LINE_CLOCK =
10780                  "lockscreen_use_double_line_clock";
10781  
10782          /**
10783           * Whether to show the vibrate icon in the Status Bar (default off)
10784           *
10785           * @hide
10786           */
10787          public static final String STATUS_BAR_SHOW_VIBRATE_ICON = "status_bar_show_vibrate_icon";
10788  
10789          /**
10790           * Specifies whether the web action API is enabled.
10791           *
10792           * @hide
10793           */
10794          @SystemApi
10795          @Readable
10796          public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled";
10797  
10798          /**
10799           * Whether qr code scanner should be accessible from the lockscreen
10800           *
10801           * @hide
10802           */
10803          public static final String LOCK_SCREEN_SHOW_QR_CODE_SCANNER =
10804                  "lock_screen_show_qr_code_scanner";
10805  
10806          /**
10807           * Whether or not to enable qr code code scanner setting to enable/disable lockscreen
10808           * entry point. Any value apart from null means setting needs to be enabled
10809           *
10810           * @hide
10811           */
10812          public static final String SHOW_QR_CODE_SCANNER_SETTING =
10813                  "show_qr_code_scanner_setting";
10814  
10815          /**
10816           * Has this pairable device been paired or upgraded from a previously paired system.
10817           * @hide
10818           */
10819          @Readable
10820          public static final String DEVICE_PAIRED = "device_paired";
10821  
10822          /**
10823           * Specifies additional package name for broadcasting the CMAS messages.
10824           * @hide
10825           */
10826          @Readable
10827          public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg";
10828  
10829          /**
10830           * Whether the launcher should show any notification badges.
10831           * The value is boolean (1 or 0).
10832           * @hide
10833           */
10834          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
10835          @TestApi
10836          @Readable
10837          public static final String NOTIFICATION_BADGING = "notification_badging";
10838  
10839          /**
10840           * When enabled the system will maintain a rolling history of received notifications. When
10841           * disabled the history will be disabled and deleted.
10842           *
10843           * The value 1 - enable, 0 - disable
10844           * @hide
10845           */
10846          @Readable
10847          public static final String NOTIFICATION_HISTORY_ENABLED = "notification_history_enabled";
10848  
10849          /**
10850           * When enabled conversations marked as favorites will be set to bubble.
10851           *
10852           * The value 1 - enable, 0 - disable
10853           * @hide
10854           */
10855          @Readable
10856          public static final String BUBBLE_IMPORTANT_CONVERSATIONS
10857                  = "bubble_important_conversations";
10858  
10859          /**
10860           * When enabled, notifications able to bubble will display an affordance allowing the user
10861           * to bubble them.
10862           * The value is boolean (1 to enable or 0 to disable).
10863           *
10864           * @hide
10865           */
10866          @TestApi
10867          @SuppressLint("NoSettingsProvider")
10868          @Readable
10869          public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
10870  
10871          /**
10872           * Whether notifications are dismissed by a right-to-left swipe (instead of a left-to-right
10873           * swipe).
10874           *
10875           * @hide
10876           */
10877          @Readable
10878          public static final String NOTIFICATION_DISMISS_RTL = "notification_dismiss_rtl";
10879  
10880          /**
10881           * Comma separated list of QS tiles that have been auto-added already.
10882           * @hide
10883           */
10884          @Readable
10885          public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles";
10886  
10887          /**
10888           * The duration of timeout, in milliseconds, to switch from a non-Dock User to the
10889           * Dock User when the device is docked.
10890           * @hide
10891           */
10892          public static final String TIMEOUT_TO_DOCK_USER = "timeout_to_dock_user";
10893  
10894          /**
10895           * Backup manager behavioral parameters.
10896           * This is encoded as a key=value list, separated by commas. Ex:
10897           *
10898           * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true"
10899           *
10900           * The following keys are supported:
10901           *
10902           * <pre>
10903           * key_value_backup_interval_milliseconds  (long)
10904           * key_value_backup_fuzz_milliseconds      (long)
10905           * key_value_backup_require_charging       (boolean)
10906           * key_value_backup_required_network_type  (int)
10907           * full_backup_interval_milliseconds       (long)
10908           * full_backup_require_charging            (boolean)
10909           * full_backup_required_network_type       (int)
10910           * backup_finished_notification_receivers  (String[])
10911           * </pre>
10912           *
10913           * backup_finished_notification_receivers uses ":" as delimeter for values.
10914           *
10915           * <p>
10916           * Type: string
10917           * @hide
10918           */
10919          @Readable
10920          public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants";
10921  
10922  
10923          /**
10924           * Local transport parameters so we can configure it for tests.
10925           * This is encoded as a key=value list, separated by commas.
10926           *
10927           * The following keys are supported:
10928           *
10929           * <pre>
10930           * fake_encryption_flag  (boolean)
10931           * </pre>
10932           *
10933           * <p>
10934           * Type: string
10935           * @hide
10936           */
10937          @Readable
10938          public static final String BACKUP_LOCAL_TRANSPORT_PARAMETERS =
10939                  "backup_local_transport_parameters";
10940  
10941          /**
10942           * Flag to set if the system should predictively attempt to re-enable Bluetooth while
10943           * the user is driving.
10944           * @hide
10945           */
10946          @Readable
10947          public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving";
10948  
10949          /**
10950           * What behavior should be invoked when the volume hush gesture is triggered
10951           * One of VOLUME_HUSH_OFF, VOLUME_HUSH_VIBRATE, VOLUME_HUSH_MUTE.
10952           *
10953           * @hide
10954           */
10955          @SystemApi
10956          @Readable
10957          public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture";
10958  
10959          /** @hide */
10960          @SystemApi
10961          public static final int VOLUME_HUSH_OFF = 0;
10962          /** @hide */
10963          @SystemApi
10964          public static final int VOLUME_HUSH_VIBRATE = 1;
10965          /** @hide */
10966          @SystemApi
10967          public static final int VOLUME_HUSH_MUTE = 2;
10968  
10969          /**
10970           * The number of times (integer) the user has manually enabled battery saver.
10971           * @hide
10972           */
10973          @Readable
10974          public static final String LOW_POWER_MANUAL_ACTIVATION_COUNT =
10975                  "low_power_manual_activation_count";
10976  
10977          /**
10978           * Whether the "first time battery saver warning" dialog needs to be shown (0: default)
10979           * or not (1).
10980           *
10981           * @hide
10982           */
10983          @Readable
10984          public static final String LOW_POWER_WARNING_ACKNOWLEDGED =
10985                  "low_power_warning_acknowledged";
10986  
10987          /**
10988           * Whether the "first time extra battery saver warning" dialog needs to be shown
10989           * (0: default) or not (1).
10990           *
10991           * @hide
10992           */
10993          public static final String EXTRA_LOW_POWER_WARNING_ACKNOWLEDGED =
10994                  "extra_low_power_warning_acknowledged";
10995  
10996          /**
10997           * 0 (default) Auto battery saver suggestion has not been suppressed. 1) it has been
10998           * suppressed.
10999           * @hide
11000           */
11001          @Readable
11002          public static final String SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION =
11003                  "suppress_auto_battery_saver_suggestion";
11004  
11005          /**
11006           * List of packages, which data need to be unconditionally cleared before full restore.
11007           * Type: string
11008           * @hide
11009           */
11010          @Readable
11011          public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE =
11012                  "packages_to_clear_data_before_full_restore";
11013  
11014          /**
11015           * How often to check for location access.
11016           * @hide
11017           *
11018           * @deprecated This has been moved to DeviceConfig property
11019           * {@link LocationAccessCheck#PROPERTY_LOCATION_ACCESS_PERIODIC_INTERVAL_MILLIS} in a T
11020           * module update
11021           *
11022           * Before Android T set this property to control the interval for the check
11023           * On Android T set this and the DeviceConfig property
11024           * After Android T set the DeviceConfig property
11025           */
11026          @SystemApi
11027          @Deprecated
11028          @Readable
11029          public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS =
11030                  "location_access_check_interval_millis";
11031  
11032          /**
11033           * Delay between granting location access and checking it.
11034           * @hide
11035           *
11036           * @deprecated This has been moved to DeviceConfig property
11037           * {@link LocationAccessCheck#PROPERTY_LOCATION_ACCESS_CHECK_DELAY_MILLIS} in a T module
11038           * update
11039           *
11040           * Before Android T set this property to control the delay for the check
11041           * On Android T set this and the DeviceConfig property
11042           * After Android T set the DeviceConfig property
11043           */
11044          @SystemApi
11045          @Deprecated
11046          @Readable
11047          public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS =
11048                  "location_access_check_delay_millis";
11049  
11050          /**
11051           * @deprecated This setting does not have any effect anymore
11052           * @hide
11053           */
11054          @SystemApi
11055          @Deprecated
11056          @Readable
11057          public static final String LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE =
11058                  "location_permissions_upgrade_to_q_mode";
11059  
11060          /**
11061           * Whether or not the system Auto Revoke feature is disabled.
11062           * @hide
11063           */
11064          @SystemApi
11065          @Readable
11066          public static final String AUTO_REVOKE_DISABLED = "auto_revoke_disabled";
11067  
11068          /**
11069           * Map of android.theme.customization.* categories to the enabled overlay package for that
11070           * category, formatted as a serialized {@link org.json.JSONObject}. If there is no
11071           * corresponding package included for a category, then all overlay packages in that
11072           * category must be disabled.
11073           *
11074           * A few category keys have special meaning and are used for Material You theming.
11075           *
11076           * A {@code FabricatedOverlay} containing Material You tonal palettes will be generated
11077           * in case {@code android.theme.customization.system_palette} contains a
11078           * {@link android.annotation.ColorInt}.
11079           *
11080           * The strategy used for generating the tonal palettes can be defined with the
11081           * {@code android.theme.customization.theme_style} key, with one of the following options:
11082           * <ul>
11083           *   <li> {@code TONAL_SPOT} is a mid vibrancy palette that uses an accent 3 analogous to
11084           *   accent 1.</li>
11085           *   <li> {@code VIBRANT} is a high vibrancy palette that harmoniously blends subtle shifts
11086           *   between colors.</li>
11087           *   <li> {@code EXPRESSIVE} is a high vibrancy palette that pairs unexpected and unique
11088           *   accents colors together.</li>
11089           *   <li> {@code SPRITZ} is a low vibrancy palette that creates a soft wash between
11090           *   colors.</li>
11091           *   <li> {@code RAINBOW} uses both chromatic accents and neutral surfaces to create a more
11092           *   subtle color experience for users.</li>
11093           *   <li> {@code FRUIT_SALAD} experiments with the concept of "two tone colors" to give
11094           *   users more expression.</li>
11095           * </ul>
11096           *
11097           * Example of valid fabricated theme specification:
11098           * <pre>
11099           * {
11100           *     "android.theme.customization.system_palette":"B1611C",
11101           *     "android.theme.customization.theme_style":"EXPRESSIVE"
11102           * }
11103           * </pre>
11104           * @hide
11105           */
11106          @SystemApi
11107          @Readable
11108          public static final String THEME_CUSTOMIZATION_OVERLAY_PACKAGES =
11109                  "theme_customization_overlay_packages";
11110  
11111          /**
11112           * Indicates whether the nav bar is forced to always be visible, even in immersive mode.
11113           * <p>Type: int (0 for false, 1 for true)
11114           *
11115           * @hide
11116           */
11117          public static final String NAV_BAR_FORCE_VISIBLE = "nav_bar_force_visible";
11118  
11119          /**
11120           * Indicates whether the device is in kids nav mode.
11121           * <p>Type: int (0 for false, 1 for true)
11122           *
11123           * @hide
11124           */
11125          public static final String NAV_BAR_KIDS_MODE = "nav_bar_kids_mode";
11126  
11127          /**
11128           * Navigation bar mode.
11129           *  0 = 3 button
11130           *  1 = 2 button
11131           *  2 = fully gestural
11132           * @hide
11133           */
11134          @Readable
11135          public static final String NAVIGATION_MODE =
11136                  "navigation_mode";
11137  
11138          /**
11139           * The value is from another(source) device's {@link #NAVIGATION_MODE} during restore.
11140           * It's supposed to be written only by
11141           * {@link com.android.providers.settings.SettingsHelper}.
11142           * This setting should not be added into backup array.
11143           * <p>Value: -1 = Can't get value from restore(default),
11144           *  0 = 3 button,
11145           *  1 = 2 button,
11146           *  2 = fully gestural.
11147           * @hide
11148           */
11149          public static final String NAVIGATION_MODE_RESTORE = "navigation_mode_restore";
11150  
11151          /**
11152           * Scale factor for the back gesture inset size on the left side of the screen.
11153           * @hide
11154           */
11155          @Readable
11156          public static final String BACK_GESTURE_INSET_SCALE_LEFT =
11157                  "back_gesture_inset_scale_left";
11158  
11159          /**
11160           * Scale factor for the back gesture inset size on the right side of the screen.
11161           * @hide
11162           */
11163          @Readable
11164          public static final String BACK_GESTURE_INSET_SCALE_RIGHT =
11165                  "back_gesture_inset_scale_right";
11166  
11167          /**
11168           * Indicates whether the trackpad back gesture is enabled.
11169           * <p>Type: int (0 for false, 1 for true)
11170           *
11171           * @hide
11172           */
11173          public static final String TRACKPAD_GESTURE_BACK_ENABLED = "trackpad_gesture_back_enabled";
11174  
11175          /**
11176           * Indicates whether the trackpad home gesture is enabled.
11177           * <p>Type: int (0 for false, 1 for true)
11178           *
11179           * @hide
11180           */
11181          public static final String TRACKPAD_GESTURE_HOME_ENABLED = "trackpad_gesture_home_enabled";
11182  
11183          /**
11184           * Indicates whether the trackpad overview gesture is enabled.
11185           * <p>Type: int (0 for false, 1 for true)
11186           *
11187           * @hide
11188           */
11189          public static final String TRACKPAD_GESTURE_OVERVIEW_ENABLED =
11190                  "trackpad_gesture_overview_enabled";
11191  
11192          /**
11193           * Indicates whether the trackpad notification gesture is enabled.
11194           * <p>Type: int (0 for false, 1 for true)
11195           *
11196           * @hide
11197           */
11198          public static final String TRACKPAD_GESTURE_NOTIFICATION_ENABLED =
11199                  "trackpad_gesture_notification_enabled";
11200  
11201          /**
11202           * Indicates whether the trackpad quick switch gesture is enabled.
11203           * <p>Type: int (0 for false, 1 for true)
11204           *
11205           * @hide
11206           */
11207          public static final String TRACKPAD_GESTURE_QUICK_SWITCH_ENABLED =
11208                  "trackpad_gesture_quick_switch_enabled";
11209  
11210          /**
11211           * Current provider of proximity-based sharing services.
11212           * Default value in @string/config_defaultNearbySharingComponent.
11213           * No VALIDATOR as this setting will not be backed up.
11214           * @hide
11215           */
11216          @Readable
11217          public static final String NEARBY_SHARING_COMPONENT = "nearby_sharing_component";
11218  
11219          /**
11220           * Nearby Sharing Slice URI for the SliceProvider to
11221           * read Nearby Sharing scan results and then draw the UI.
11222           * @hide
11223           */
11224          public static final String NEARBY_SHARING_SLICE_URI = "nearby_sharing_slice_uri";
11225  
11226          /**
11227           * Current provider of Fast Pair saved devices page.
11228           * Default value in @string/config_defaultNearbyFastPairSettingsDevicesComponent.
11229           * No VALIDATOR as this setting will not be backed up.
11230           * @hide
11231           */
11232          public static final String NEARBY_FAST_PAIR_SETTINGS_DEVICES_COMPONENT =
11233                  "nearby_fast_pair_settings_devices_component";
11234  
11235          /**
11236           * Current provider of the component for requesting ambient context consent.
11237           * Default value in @string/config_defaultAmbientContextConsentComponent.
11238           * No VALIDATOR as this setting will not be backed up.
11239           * @hide
11240           */
11241          public static final String AMBIENT_CONTEXT_CONSENT_COMPONENT =
11242                  "ambient_context_consent_component";
11243  
11244          /**
11245           * Current provider of the intent extra key for the caller's package name while
11246           * requesting ambient context consent.
11247           * No VALIDATOR as this setting will not be backed up.
11248           * @hide
11249           */
11250          public static final String AMBIENT_CONTEXT_PACKAGE_NAME_EXTRA_KEY =
11251                  "ambient_context_package_name_key";
11252  
11253          /**
11254           * Current provider of the intent extra key for the event code int array while
11255           * requesting ambient context consent.
11256           * Default value in @string/config_ambientContextEventArrayExtraKey.
11257           * No VALIDATOR as this setting will not be backed up.
11258           * @hide
11259           */
11260          public static final String AMBIENT_CONTEXT_EVENT_ARRAY_EXTRA_KEY =
11261                  "ambient_context_event_array_key";
11262  
11263          /**
11264           * Controls whether aware is enabled.
11265           * @hide
11266           */
11267          @Readable
11268          public static final String AWARE_ENABLED = "aware_enabled";
11269  
11270          /**
11271           * Controls whether aware_lock is enabled.
11272           * @hide
11273           */
11274          @Readable
11275          public static final String AWARE_LOCK_ENABLED = "aware_lock_enabled";
11276  
11277          /**
11278           * Controls whether tap gesture is enabled.
11279           * @hide
11280           */
11281          @Readable
11282          public static final String TAP_GESTURE = "tap_gesture";
11283  
11284          /**
11285           * Controls whether the people strip is enabled.
11286           * @hide
11287           */
11288          @Readable
11289          public static final String PEOPLE_STRIP = "people_strip";
11290  
11291          /**
11292           * Whether or not to enable media resumption
11293           * When enabled, media controls in quick settings will populate on boot and persist if
11294           * resumable via a MediaBrowserService.
11295           * @see Settings.Global#SHOW_MEDIA_ON_QUICK_SETTINGS
11296           * @hide
11297           */
11298          @Readable
11299          public static final String MEDIA_CONTROLS_RESUME = "qs_media_resumption";
11300  
11301          /**
11302           * Whether to enable media controls on lock screen.
11303           * When enabled, media controls will appear on lock screen.
11304           * @hide
11305           */
11306          public static final String MEDIA_CONTROLS_LOCK_SCREEN = "media_controls_lock_screen";
11307  
11308          /**
11309           * Controls whether contextual suggestions can be shown in the media controls.
11310           * @hide
11311           */
11312          public static final String MEDIA_CONTROLS_RECOMMENDATION = "qs_media_recommend";
11313  
11314          /**
11315           * Controls magnification mode when magnification is enabled via a system-wide triple tap
11316           * gesture or the accessibility shortcut.
11317           *
11318           * @see #ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN
11319           * @see #ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW
11320           * @hide
11321           */
11322          @TestApi
11323          @Readable
11324          public static final String ACCESSIBILITY_MAGNIFICATION_MODE =
11325                  "accessibility_magnification_mode";
11326  
11327          /**
11328           * Magnification mode value that is a default value for the magnification logging feature.
11329           * @hide
11330           */
11331          public static final int ACCESSIBILITY_MAGNIFICATION_MODE_NONE = 0x0;
11332  
11333          /**
11334           * Magnification mode value that magnifies whole display.
11335           * @hide
11336           */
11337          @TestApi
11338          public static final int ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN = 0x1;
11339  
11340          /**
11341           * Magnification mode value that magnifies magnify particular region in a window
11342           * @hide
11343           */
11344          @TestApi
11345          public static final int ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW = 0x2;
11346  
11347          /**
11348           * Magnification mode value that is capable of magnifying whole display and particular
11349           * region in a window.
11350           * @hide
11351           */
11352          @TestApi
11353          public static final int ACCESSIBILITY_MAGNIFICATION_MODE_ALL = 0x3;
11354  
11355          /**
11356           * Whether the magnification always on feature is enabled. If true, the magnifier will not
11357           * deactivate on Activity transitions; it will only zoom out to 100%.
11358           *
11359           * @hide
11360           */
11361          public static final String ACCESSIBILITY_MAGNIFICATION_ALWAYS_ON_ENABLED =
11362                  "accessibility_magnification_always_on_enabled";
11363  
11364          /**
11365           * Whether the following typing focus feature for magnification is enabled.
11366           * @hide
11367           */
11368          public static final String ACCESSIBILITY_MAGNIFICATION_FOLLOW_TYPING_ENABLED =
11369                  "accessibility_magnification_follow_typing_enabled";
11370  
11371          /**
11372           * Whether the magnification joystick controller feature is enabled.
11373           * @hide
11374           */
11375          public static final String ACCESSIBILITY_MAGNIFICATION_JOYSTICK_ENABLED =
11376                  "accessibility_magnification_joystick_enabled";
11377  
11378          /**
11379           * Controls magnification capability. Accessibility magnification is capable of at least one
11380           * of the magnification modes.
11381           *
11382           * @see #ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN
11383           * @see #ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW
11384           * @see #ACCESSIBILITY_MAGNIFICATION_MODE_ALL
11385           * @hide
11386           */
11387          @TestApi
11388          @Readable
11389          public static final String ACCESSIBILITY_MAGNIFICATION_CAPABILITY =
11390                  "accessibility_magnification_capability";
11391  
11392          /**
11393           *  Whether to show the window magnification prompt dialog when the user uses full-screen
11394           *  magnification first time after database is upgraded.
11395           *
11396           * @hide
11397           */
11398          public static final String ACCESSIBILITY_SHOW_WINDOW_MAGNIFICATION_PROMPT =
11399                  "accessibility_show_window_magnification_prompt";
11400  
11401          /**
11402           * Controls the accessibility button mode. System will force-set the value to {@link
11403           * #ACCESSIBILITY_BUTTON_MODE_GESTURE} if {@link #NAVIGATION_MODE} is button; force-set the
11404           * value to {@link ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR} if {@link #NAVIGATION_MODE} is
11405           * gestural; otherwise, remain the option.
11406           * <ul>
11407           *    <li> 0 = button in navigation bar </li>
11408           *    <li> 1 = button floating on the display </li>
11409           *    <li> 2 = button using gesture to trigger </li>
11410           * </ul>
11411           *
11412           * @see #ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR
11413           * @see #ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU
11414           * @see #ACCESSIBILITY_BUTTON_MODE_GESTURE
11415           * @hide
11416           */
11417          public static final String ACCESSIBILITY_BUTTON_MODE =
11418                  "accessibility_button_mode";
11419  
11420          /**
11421           * Accessibility button mode value that specifying the accessibility service or feature to
11422           * be toggled via the button in the navigation bar.
11423           *
11424           * @hide
11425           */
11426          public static final int ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR = 0x0;
11427  
11428          /**
11429           * Accessibility button mode value that specifying the accessibility service or feature to
11430           * be toggled via the button floating on the display.
11431           *
11432           * @hide
11433           */
11434          public static final int ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU = 0x1;
11435  
11436          /**
11437           * Accessibility button mode value that specifying the accessibility service or feature to
11438           * be toggled via the gesture.
11439           *
11440           * @hide
11441           */
11442          public static final int ACCESSIBILITY_BUTTON_MODE_GESTURE = 0x2;
11443  
11444          /**
11445           * The size of the accessibility floating menu.
11446           * <ul>
11447           *     <li> 0 = small size
11448           *     <li> 1 = large size
11449           * </ul>
11450           *
11451           * @hide
11452           */
11453          public static final String ACCESSIBILITY_FLOATING_MENU_SIZE =
11454                  "accessibility_floating_menu_size";
11455  
11456          /**
11457           * The icon type of the accessibility floating menu.
11458           * <ul>
11459           *     <li> 0 = full circle type
11460           *     <li> 1 = half circle type
11461           * </ul>
11462           *
11463           * @hide
11464           */
11465          public static final String ACCESSIBILITY_FLOATING_MENU_ICON_TYPE =
11466                  "accessibility_floating_menu_icon_type";
11467  
11468          /**
11469           * Whether the fade effect for the accessibility floating menu is enabled.
11470           *
11471           * @hide
11472           */
11473          public static final String ACCESSIBILITY_FLOATING_MENU_FADE_ENABLED =
11474                  "accessibility_floating_menu_fade_enabled";
11475  
11476          /**
11477           * The opacity value for the accessibility floating menu fade out effect, from 0.0
11478           * (transparent) to 1.0 (opaque).
11479           *
11480           * @hide
11481           */
11482          public static final String ACCESSIBILITY_FLOATING_MENU_OPACITY =
11483                  "accessibility_floating_menu_opacity";
11484  
11485          /**
11486           * Prompts the user to the Accessibility button is replaced with the floating menu.
11487           * <ul>
11488           *    <li> 0 = disabled </li>
11489           *    <li> 1 = enabled </li>
11490           * </ul>
11491           *
11492           * @hide
11493           */
11494          public static final String ACCESSIBILITY_FLOATING_MENU_MIGRATION_TOOLTIP_PROMPT =
11495                  "accessibility_floating_menu_migration_tooltip_prompt";
11496  
11497          /**
11498           * Whether the Adaptive connectivity option is enabled.
11499           *
11500           * @hide
11501           */
11502          public static final String ADAPTIVE_CONNECTIVITY_ENABLED = "adaptive_connectivity_enabled";
11503  
11504          /**
11505           * Controls the 'Sunlight boost' toggle in wearable devices (high brightness mode).
11506           *
11507           * Valid values for this key are: '0' (disabled) or '1' (enabled).
11508           *
11509           * @hide
11510           */
11511          public static final String HBM_SETTING_KEY =
11512                  "com.android.server.display.HBM_SETTING_KEY";
11513  
11514          /**
11515           * Keys we no longer back up under the current schema, but want to continue to
11516           * process when restoring historical backup datasets.
11517           *
11518           * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
11519           * otherwise they won't be restored.
11520           *
11521           * @hide
11522           */
11523          @Readable
11524          public static final String[] LEGACY_RESTORE_SETTINGS = {
11525                  ENABLED_NOTIFICATION_LISTENERS,
11526                  ENABLED_NOTIFICATION_ASSISTANT,
11527                  ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES
11528          };
11529  
11530          /**
11531           * How long Assistant handles have enabled in milliseconds.
11532           *
11533           * @hide
11534           */
11535          public static final String ASSIST_HANDLES_LEARNING_TIME_ELAPSED_MILLIS =
11536                  "reminder_exp_learning_time_elapsed";
11537  
11538          /**
11539           * How many times the Assistant has been triggered using the touch gesture.
11540           *
11541           * @hide
11542           */
11543          public static final String ASSIST_HANDLES_LEARNING_EVENT_COUNT =
11544                  "reminder_exp_learning_event_count";
11545  
11546          /**
11547           * Whether to show clipboard access notifications.
11548           *
11549           * @hide
11550           */
11551          public static final String CLIPBOARD_SHOW_ACCESS_NOTIFICATIONS =
11552                  "clipboard_show_access_notifications";
11553  
11554          /**
11555           * If nonzero, nas has not been updated to reflect new changes.
11556           * @hide
11557           */
11558          @Readable
11559          public static final String NAS_SETTINGS_UPDATED = "nas_settings_updated";
11560  
11561          /**
11562           * Control whether Game Dashboard shortcut is always on for all games.
11563           * @hide
11564           */
11565          @Readable
11566          public static final String GAME_DASHBOARD_ALWAYS_ON = "game_dashboard_always_on";
11567  
11568  
11569          /**
11570           * For this device state, no specific auto-rotation lock setting should be applied.
11571           * If the user toggles the auto-rotate lock in this state, the setting will apply to the
11572           * previously valid device state.
11573           * @hide
11574           */
11575          public static final int DEVICE_STATE_ROTATION_LOCK_IGNORED = 0;
11576          /**
11577           * For this device state, the setting for auto-rotation is locked.
11578           * @hide
11579           */
11580          public static final int DEVICE_STATE_ROTATION_LOCK_LOCKED = 1;
11581          /**
11582           * For this device state, the setting for auto-rotation is unlocked.
11583           * @hide
11584           */
11585          public static final int DEVICE_STATE_ROTATION_LOCK_UNLOCKED = 2;
11586  
11587          /**
11588           * The different settings that can be used as values with
11589           * {@link #DEVICE_STATE_ROTATION_LOCK}.
11590           * @hide
11591           */
11592          @IntDef(prefix = {"DEVICE_STATE_ROTATION_LOCK_"}, value = {
11593                  DEVICE_STATE_ROTATION_LOCK_IGNORED,
11594                  DEVICE_STATE_ROTATION_LOCK_LOCKED,
11595                  DEVICE_STATE_ROTATION_LOCK_UNLOCKED,
11596          })
11597          @Retention(RetentionPolicy.SOURCE)
11598          public @interface DeviceStateRotationLockSetting {
11599          }
11600  
11601          /** @hide */
11602          public static final int DEVICE_STATE_ROTATION_KEY_UNKNOWN = -1;
11603          /** @hide */
11604          public static final int DEVICE_STATE_ROTATION_KEY_FOLDED = 0;
11605          /** @hide */
11606          public static final int DEVICE_STATE_ROTATION_KEY_HALF_FOLDED = 1;
11607          /** @hide */
11608          public static final int DEVICE_STATE_ROTATION_KEY_UNFOLDED = 2;
11609          /** @hide */
11610          public static final int DEVICE_STATE_ROTATION_KEY_REAR_DISPLAY = 3;
11611  
11612          /**
11613           * The different postures that can be used as keys with
11614           * {@link #DEVICE_STATE_ROTATION_LOCK}.
11615           * @hide
11616           */
11617          @IntDef(prefix = {"DEVICE_STATE_ROTATION_KEY_"}, value = {
11618                  DEVICE_STATE_ROTATION_KEY_UNKNOWN,
11619                  DEVICE_STATE_ROTATION_KEY_FOLDED,
11620                  DEVICE_STATE_ROTATION_KEY_HALF_FOLDED,
11621                  DEVICE_STATE_ROTATION_KEY_UNFOLDED,
11622                  DEVICE_STATE_ROTATION_KEY_REAR_DISPLAY,
11623          })
11624          @Retention(RetentionPolicy.SOURCE)
11625          public @interface DeviceStateRotationLockKey {
11626          }
11627  
11628          /**
11629           * Rotation lock setting keyed on device state.
11630           *
11631           * This holds a serialized map using int keys that represent postures in
11632           * {@link DeviceStateRotationLockKey} and value of
11633           * {@link DeviceStateRotationLockSetting} representing the rotation lock setting for that
11634           * posture.
11635           *
11636           * Serialized as key0:value0:key1:value1:...:keyN:valueN.
11637           *
11638           * Example: "0:1:1:2:2:1"
11639           * This example represents a map of:
11640           * <ul>
11641           *     <li>DEVICE_STATE_ROTATION_KEY_FOLDED -> DEVICE_STATE_ROTATION_LOCK_LOCKED</li>
11642           *     <li>DEVICE_STATE_ROTATION_KEY_HALF_FOLDED -> DEVICE_STATE_ROTATION_LOCK_UNLOCKED</li>
11643           *     <li>DEVICE_STATE_ROTATION_KEY_UNFOLDED -> DEVICE_STATE_ROTATION_LOCK_IGNORED</li>
11644           * </ul>
11645           *
11646           * @hide
11647           */
11648          public static final String DEVICE_STATE_ROTATION_LOCK =
11649                  "device_state_rotation_lock";
11650  
11651          /**
11652           * Control whether communal mode is allowed on this device.
11653           *
11654           * @hide
11655           */
11656          public static final String COMMUNAL_MODE_ENABLED = "communal_mode_enabled";
11657  
11658          /**
11659           * An array of SSIDs of Wi-Fi networks that, when connected, are considered safe to enable
11660           * the communal mode.
11661           *
11662           * @hide
11663           */
11664          public static final String COMMUNAL_MODE_TRUSTED_NETWORKS =
11665                  "communal_mode_trusted_networks";
11666  
11667          /**
11668           * Setting to store denylisted system languages by the CEC {@code <Set Menu Language>}
11669           * confirmation dialog.
11670           *
11671           * @hide
11672           */
11673          public static final String HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST =
11674                  "hdmi_cec_set_menu_language_denylist";
11675  
11676          /**
11677           * Whether the Taskbar Education is about to be shown or is currently showing.
11678           *
11679           * <p>1 if true, 0 or unset otherwise.
11680           *
11681           * <p>This setting is used to inform other components that the Taskbar Education is
11682           * currently showing, which can prevent them from showing something else to the user.
11683           *
11684           * @hide
11685           */
11686          public static final String LAUNCHER_TASKBAR_EDUCATION_SHOWING =
11687                  "launcher_taskbar_education_showing";
11688  
11689          /**
11690           * Whether or not adaptive charging feature is enabled by user.
11691           * Type: int (0 for false, 1 for true)
11692           * Default: 1
11693           *
11694           * @hide
11695           */
11696          public static final String ADAPTIVE_CHARGING_ENABLED = "adaptive_charging_enabled";
11697  
11698          /**
11699           * Whether battery saver is currently set to different schedule mode.
11700           *
11701           * @hide
11702           */
11703          public static final String EXTRA_AUTOMATIC_POWER_SAVE_MODE =
11704                  "extra_automatic_power_save_mode";
11705  
11706          /**
11707           * Whether lockscreen weather is enabled.
11708           *
11709           * @hide
11710           */
11711          public static final String LOCK_SCREEN_WEATHER_ENABLED = "lockscreen_weather_enabled";
11712  
11713          /**
11714           * These entries are considered common between the personal and the managed profile,
11715           * since the managed profile doesn't get to change them.
11716           */
11717          private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
11718  
11719          static {
11720              CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
11721              CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
11722              CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
11723              CLONE_TO_MANAGED_PROFILE.add(CONTENT_CAPTURE_ENABLED);
11724              CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
11725              CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER);
11726              CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
11727              CLONE_TO_MANAGED_PROFILE.add(SHOW_IME_WITH_HARD_KEYBOARD);
11728              CLONE_TO_MANAGED_PROFILE.add(NOTIFICATION_BUBBLES);
11729          }
11730  
11731          /** @hide */
getCloneToManagedProfileSettings(Set<String> outKeySet)11732          public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
11733              outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
11734          }
11735  
11736          /**
11737           * Secure settings which can be accessed by instant apps.
11738           * @hide
11739           */
11740          public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
11741          static {
11742              INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES);
11743              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD);
11744              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED);
11745              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED);
11746              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET);
11747              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE);
11748              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR);
11749              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE);
11750              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR);
11751              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR);
11752              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE);
11753              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE);
11754              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR);
11755              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED);
11756              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER);
11757              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY);
11758              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED);
11759              INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON);
11760  
11761              INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD);
11762              INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS);
11763  
11764              INSTANT_APP_SETTINGS.add(ANDROID_ID);
11765  
11766              INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION);
11767          }
11768  
11769          /**
11770           * Helper method for determining if a location provider is enabled.
11771           *
11772           * @param cr the content resolver to use
11773           * @param provider the location provider to query
11774           * @return true if the provider is enabled
11775           *
11776           * @deprecated use {@link LocationManager#isProviderEnabled(String)}
11777           */
11778          @Deprecated
isLocationProviderEnabled(ContentResolver cr, String provider)11779          public static boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
11780              IBinder binder = ServiceManager.getService(Context.LOCATION_SERVICE);
11781              ILocationManager lm = Objects.requireNonNull(ILocationManager.Stub.asInterface(binder));
11782              try {
11783                  return lm.isProviderEnabledForUser(provider, cr.getUserId());
11784              } catch (RemoteException e) {
11785                  throw e.rethrowFromSystemServer();
11786              }
11787          }
11788  
11789          /**
11790           * Thread-safe method for enabling or disabling a single location provider. This will have
11791           * no effect on Android Q and above.
11792           * @param cr the content resolver to use
11793           * @param provider the location provider to enable or disable
11794           * @param enabled true if the provider should be enabled
11795           * @deprecated This API is deprecated
11796           */
11797          @Deprecated
setLocationProviderEnabled(ContentResolver cr, String provider, boolean enabled)11798          public static void setLocationProviderEnabled(ContentResolver cr,
11799                  String provider, boolean enabled) {
11800          }
11801      }
11802  
11803      /**
11804       * Global system settings, containing preferences that always apply identically
11805       * to all defined users.  Applications can read these but are not allowed to write;
11806       * like the "Secure" settings, these are for preferences that the user must
11807       * explicitly modify through the system UI or specialized APIs for those values.
11808       */
11809      public static final class Global extends NameValueTable {
11810          // NOTE: If you add new settings here, be sure to add them to
11811          // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked.
11812  
11813          /**
11814           * The content:// style URL for global secure settings items.  Not public.
11815           */
11816          public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
11817  
11818          /**
11819           * Whether the notification bubbles are globally enabled
11820           * The value is boolean (1 or 0).
11821           * @hide
11822           * @deprecated moved to secure settings.
11823           */
11824          @Deprecated
11825          @TestApi
11826          @Readable
11827          public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
11828  
11829          /**
11830           * Whether users are allowed to add more users or guest from lockscreen.
11831           * <p>
11832           * Type: int
11833           * @hide
11834           */
11835          @Readable
11836          public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
11837  
11838          /**
11839           * Whether guest user should be removed on exit from guest mode.
11840           * <p>
11841           * Type: int
11842           * @hide
11843           */
11844          public static final String REMOVE_GUEST_ON_EXIT = "remove_guest_on_exit";
11845  
11846          /**
11847           * Whether applying ramping ringer on incoming phone call ringtone.
11848           * <p>1 = apply ramping ringer
11849           * <p>0 = do not apply ramping ringer
11850           * @deprecated Use {@link AudioManager#isRampingRingerEnabled()} instead
11851           */
11852          @Deprecated
11853          @Readable
11854          public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer";
11855  
11856          /**
11857           * Setting whether the global gesture for enabling accessibility is enabled.
11858           * If this gesture is enabled the user will be able to perfrom it to enable
11859           * the accessibility state without visiting the settings app.
11860           *
11861           * @hide
11862           * No longer used. Should be removed once all dependencies have been updated.
11863           */
11864          @UnsupportedAppUsage
11865          @Readable
11866          public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
11867                  "enable_accessibility_global_gesture_enabled";
11868  
11869          /**
11870           * Whether Airplane Mode is on.
11871           */
11872          @Readable
11873          public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
11874  
11875          /**
11876           * Whether Theater Mode is on.
11877           * {@hide}
11878           */
11879          @SystemApi
11880          @Readable
11881          public static final String THEATER_MODE_ON = "theater_mode_on";
11882  
11883          /**
11884           * Constant for use in AIRPLANE_MODE_RADIOS or SATELLITE_MODE_RADIOS to specify Bluetooth
11885           * radio.
11886           */
11887          @Readable
11888          public static final String RADIO_BLUETOOTH = "bluetooth";
11889  
11890          /**
11891           * Constant for use in AIRPLANE_MODE_RADIOS or SATELLITE_MODE_RADIOS to specify Wi-Fi radio.
11892           */
11893          @Readable
11894          public static final String RADIO_WIFI = "wifi";
11895  
11896          /**
11897           * {@hide}
11898           */
11899          @Readable
11900          public static final String RADIO_WIMAX = "wimax";
11901          /**
11902           * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
11903           */
11904          @Readable
11905          public static final String RADIO_CELL = "cell";
11906  
11907          /**
11908           * Constant for use in AIRPLANE_MODE_RADIOS or SATELLITE_MODE_RADIOS to specify NFC radio.
11909           */
11910          @Readable
11911          public static final String RADIO_NFC = "nfc";
11912  
11913          /**
11914           * Constant for use in SATELLITE_MODE_RADIOS to specify UWB radio.
11915           *
11916           * {@hide}
11917           */
11918          public static final String RADIO_UWB = "uwb";
11919  
11920  
11921          /**
11922           * A comma separated list of radios that need to be disabled when satellite mode is on.
11923           *
11924           * {@hide}
11925           */
11926          @Readable
11927          public static final String SATELLITE_MODE_RADIOS = "satellite_mode_radios";
11928  
11929          /**
11930           * The satellite mode is enabled for the user. When the satellite mode is enabled, the
11931           * satellite radio will be turned on and all other radios will be turned off. When the
11932           * satellite mode is disabled, the satellite radio will be turned off and the states of
11933           * other radios will be restored.
11934           * <p>
11935           * When this setting is set to 0, it means the satellite mode is disabled. When this
11936           * setting is set to 1, it means the satellite mode is enabled.
11937           *
11938           * {@hide}
11939           */
11940          @Readable
11941          public static final String SATELLITE_MODE_ENABLED = "satellite_mode_enabled";
11942  
11943          /**
11944           * A comma separated list of radios that need to be disabled when airplane mode
11945           * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
11946           * included in the comma separated list.
11947           */
11948          @Readable
11949          public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
11950  
11951          /**
11952           * A comma separated list of radios that should to be disabled when airplane mode
11953           * is on, but can be manually reenabled by the user.  For example, if RADIO_WIFI is
11954           * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
11955           * will be turned off when entering airplane mode, but the user will be able to reenable
11956           * Wifi in the Settings app.
11957           * @hide
11958           */
11959          @SystemApi
11960          @Readable
11961          public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
11962  
11963          /**
11964           * An integer representing the Bluetooth Class of Device (CoD).
11965           *
11966           * @hide
11967           */
11968          @Readable
11969          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
11970          @SuppressLint("NoSettingsProvider")
11971          public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device";
11972  
11973          /**
11974           * A Long representing a bitmap of profiles that should be disabled when bluetooth starts.
11975           * See {@link android.bluetooth.BluetoothProfile}.
11976           * {@hide}
11977           */
11978          @Readable
11979          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
11980          @SuppressLint("NoSettingsProvider")
11981          public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";
11982  
11983          /**
11984           * A semi-colon separated list of Bluetooth interoperability workarounds.
11985           * Each entry is a partial Bluetooth device address string and an integer representing
11986           * the feature to be disabled, separated by a comma. The integer must correspond
11987           * to a interoperability feature as defined in "interop.h" in /system/bt.
11988           * <p>
11989           * Example: <br/>
11990           *   "00:11:22,0;01:02:03:04,2"
11991           * @hide
11992           */
11993          @Readable
11994         public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";
11995  
11996          /**
11997           * The policy for deciding when Wi-Fi should go to sleep (which will in
11998           * turn switch to using the mobile data as an Internet connection).
11999           * <p>
12000           * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
12001           * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
12002           * {@link #WIFI_SLEEP_POLICY_NEVER}.
12003           * @deprecated This is no longer used or set by the platform.
12004           */
12005          @Deprecated
12006          @Readable
12007          public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
12008  
12009          /**
12010           * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
12011           * policy, which is to sleep shortly after the turning off
12012           * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
12013           * @deprecated This is no longer used by the platform.
12014           */
12015          @Deprecated
12016          public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
12017  
12018          /**
12019           * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
12020           * the device is on battery, and never go to sleep when the device is
12021           * plugged in.
12022           * @deprecated This is no longer used by the platform.
12023           */
12024          @Deprecated
12025          public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
12026  
12027          /**
12028           * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
12029           * @deprecated This is no longer used by the platform.
12030           */
12031          @Deprecated
12032          public static final int WIFI_SLEEP_POLICY_NEVER = 2;
12033  
12034          /**
12035           * Value to specify if the device's UTC system clock should be set automatically, e.g. using
12036           * telephony signals like NITZ, or other sources like GNSS or NTP.
12037           *
12038           * <p>Prefer {@link android.app.time.TimeManager} API calls to determine the state of
12039           * automatic time detection instead of directly observing this setting as it may be ignored
12040           * by the time_detector service under various conditions.
12041           *
12042           * <p>1=yes, 0=no (manual)
12043           */
12044          @Readable
12045          public static final String AUTO_TIME = "auto_time";
12046  
12047          /**
12048           * Value to specify if the device's time zone system property should be set automatically,
12049           * e.g. using telephony signals like MCC and NITZ, or other mechanisms like the location.
12050           *
12051           * <p>Prefer {@link android.app.time.TimeManager} API calls to determine the state of
12052           * automatic time zone detection instead of directly observing this setting as it may be
12053           * ignored by the time_zone_detector service under various conditions.
12054           *
12055           * <p>1=yes, 0=no (manual).
12056           */
12057          @Readable
12058          public static final String AUTO_TIME_ZONE = "auto_time_zone";
12059  
12060          /**
12061           * Records whether an explicit preference for {@link #AUTO_TIME_ZONE} has been expressed
12062           * instead of the current value being the default. This value is used to tell if the {@link
12063           * #AUTO_TIME_ZONE} value can be influenced by experiment flags that alter the setting's
12064           * value for internal testers: once the user indicates a preference they leave the
12065           * experiment, only users that are still using the default will be affected by the flag.
12066           *
12067           * <p>Since {@link #AUTO_TIME_ZONE} can be altered by components besides the system server,
12068           * and not just via the time_zone_detector logic that sets this value, this isn't guaranteed
12069           * to be set when the device diverges from the default in all cases. Important AOSP system
12070           * components like SettingsUI do use the time_zone_detector APIs.
12071           *
12072           * <p>1="has been set explicitly"
12073           *
12074           * @hide
12075           */
12076          public static final String AUTO_TIME_ZONE_EXPLICIT = "auto_time_zone_explicit";
12077  
12078          /**
12079           * URI for the car dock "in" event sound.
12080           * @hide
12081           */
12082          @Readable
12083          public static final String CAR_DOCK_SOUND = "car_dock_sound";
12084  
12085          /**
12086           * URI for the car dock "out" event sound.
12087           * @hide
12088           */
12089          @Readable
12090          public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
12091  
12092          /**
12093           * URI for the desk dock "in" event sound.
12094           * @hide
12095           */
12096          @Readable
12097          public static final String DESK_DOCK_SOUND = "desk_dock_sound";
12098  
12099          /**
12100           * URI for the desk dock "out" event sound.
12101           * @hide
12102           */
12103          @Readable
12104          public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
12105  
12106          /**
12107           * Whether to play a sound for dock events.
12108           * @hide
12109           */
12110          @Readable
12111          public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
12112  
12113          /**
12114           * Whether to play a sound for dock events, only when an accessibility service is on.
12115           * @hide
12116           */
12117          @Readable
12118          public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility";
12119  
12120          /**
12121           * URI for the "device locked" (keyguard shown) sound.
12122           * @hide
12123           */
12124          @Readable
12125          public static final String LOCK_SOUND = "lock_sound";
12126  
12127          /**
12128           * URI for the "device unlocked" sound.
12129           * @hide
12130           */
12131          @Readable
12132          public static final String UNLOCK_SOUND = "unlock_sound";
12133  
12134          /**
12135           * URI for the "device is trusted" sound, which is played when the device enters the trusted
12136           * state without unlocking.
12137           * @hide
12138           */
12139          @Readable
12140          public static final String TRUSTED_SOUND = "trusted_sound";
12141  
12142          /**
12143           * URI for the low battery sound file.
12144           * @hide
12145           */
12146          @Readable
12147          public static final String LOW_BATTERY_SOUND = "low_battery_sound";
12148  
12149          /**
12150           * Whether to play a sound for low-battery alerts.
12151           * @hide
12152           */
12153          @Readable
12154          public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
12155  
12156          /**
12157           * URI for the "wireless charging started" sound.
12158           * @hide
12159           */
12160          @Readable
12161          public static final String WIRELESS_CHARGING_STARTED_SOUND =
12162                  "wireless_charging_started_sound";
12163  
12164          /**
12165           * URI for "wired charging started" sound.
12166           * @hide
12167           */
12168          @Readable
12169          public static final String CHARGING_STARTED_SOUND = "charging_started_sound";
12170  
12171          /**
12172           * Whether to play a sound for charging events.
12173           * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_SOUNDS_ENABLED} instead
12174           * @hide
12175           */
12176          @Deprecated
12177          public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
12178  
12179          /**
12180           * Whether to vibrate for wireless charging events.
12181           * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_VIBRATION_ENABLED}
12182           * @hide
12183           */
12184          @Deprecated
12185          public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled";
12186  
12187          /**
12188           * Whether we keep the device on while the device is plugged in.
12189           * Supported values are:
12190           * <ul>
12191           * <li>{@code 0} to never stay on while plugged in</li>
12192           * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
12193           * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
12194           * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
12195           * <li>{@link BatteryManager#BATTERY_PLUGGED_DOCK} to stay on for dock charger</li>
12196           * </ul>
12197           * These values can be OR-ed together.
12198           */
12199          @Readable
12200          public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
12201  
12202          /**
12203           * When the user has enable the option to have a "bug report" command
12204           * in the power menu.
12205           * @deprecated Use {@link android.provider.Settings.Secure#BUGREPORT_IN_POWER_MENU} instead
12206           * @hide
12207           */
12208          @Deprecated
12209          @Readable
12210          public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
12211  
12212          /**
12213           * The package name for the custom bugreport handler app. This app must be whitelisted.
12214           * This is currently used only by Power Menu short press.
12215           * @deprecated Use {@link android.provider.Settings.Secure#CUSTOM_BUGREPORT_HANDLER_APP}
12216           * instead
12217           * @hide
12218           */
12219          @Deprecated
12220          @Readable
12221          public static final String CUSTOM_BUGREPORT_HANDLER_APP = "custom_bugreport_handler_app";
12222  
12223          /**
12224           * The user id for the custom bugreport handler app. This is currently used only by Power
12225           * Menu short press.
12226           * @deprecated Use {@link android.provider.Settings.Secure#CUSTOM_BUGREPORT_HANDLER_USER}
12227           * instead
12228           * @hide
12229           */
12230          @Deprecated
12231          @Readable
12232          public static final String CUSTOM_BUGREPORT_HANDLER_USER = "custom_bugreport_handler_user";
12233  
12234          /**
12235           * Whether ADB over USB is enabled.
12236           */
12237          @Readable
12238          public static final String ADB_ENABLED = "adb_enabled";
12239  
12240          /**
12241           * Whether ADB over Wifi is enabled.
12242           * @hide
12243           */
12244          @Readable
12245          public static final String ADB_WIFI_ENABLED = "adb_wifi_enabled";
12246  
12247          /**
12248           * Whether existing ADB sessions over both USB and Wifi should be terminated when the user
12249           * revokes debugging authorizations.
12250           * @hide
12251           */
12252          public static final String ADB_DISCONNECT_SESSIONS_ON_REVOKE =
12253                  "adb_disconnect_sessions_on_revoke";
12254  
12255          /**
12256           * Whether Views are allowed to save their attribute data.
12257           * @hide
12258           */
12259          @Readable
12260          public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
12261  
12262          /**
12263           * Which application package is allowed to save View attribute data.
12264           * @hide
12265           */
12266          @Readable
12267          public static final String DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE =
12268                  "debug_view_attributes_application_package";
12269  
12270          /**
12271           * Whether assisted GPS should be enabled or not.
12272           * @hide
12273           */
12274          @Readable
12275          public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
12276  
12277          /**
12278           * Whether bluetooth is enabled/disabled
12279           * 0=disabled. 1=enabled.
12280           */
12281          @Readable
12282          public static final String BLUETOOTH_ON = "bluetooth_on";
12283  
12284          /**
12285           * CDMA Cell Broadcast SMS
12286           *                            0 = CDMA Cell Broadcast SMS disabled
12287           *                            1 = CDMA Cell Broadcast SMS enabled
12288           * @hide
12289           */
12290          @Readable
12291          public static final String CDMA_CELL_BROADCAST_SMS =
12292                  "cdma_cell_broadcast_sms";
12293  
12294          /**
12295           * The CDMA roaming mode 0 = Home Networks, CDMA default
12296           *                       1 = Roaming on Affiliated networks
12297           *                       2 = Roaming on any networks
12298           * @hide
12299           */
12300          @Readable
12301          public static final String CDMA_ROAMING_MODE = "roaming_settings";
12302  
12303          /**
12304           * The CDMA subscription mode 0 = RUIM/SIM (default)
12305           *                                1 = NV
12306           * @hide
12307           */
12308          @Readable
12309          public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
12310  
12311          /**
12312           * The default value for whether background data is enabled or not.
12313           *
12314           * Used by {@code NetworkPolicyManagerService}.
12315           *
12316           * @hide
12317           */
12318          @Readable
12319          public static final String DEFAULT_RESTRICT_BACKGROUND_DATA =
12320                  "default_restrict_background_data";
12321  
12322          /** Inactivity timeout to track mobile data activity.
12323           *
12324           * If set to a positive integer, it indicates the inactivity timeout value in seconds to
12325           * infer the data activity of mobile network. After a period of no activity on mobile
12326           * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
12327           * intent is fired to indicate a transition of network status from "active" to "idle". Any
12328           * subsequent activity on mobile networks triggers the firing of {@code
12329           * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
12330           *
12331           * Network activity refers to transmitting or receiving data on the network interfaces.
12332           *
12333           * Tracking is disabled if set to zero or negative value.
12334           *
12335           * @hide
12336           */
12337          @Readable
12338          public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
12339  
12340          /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
12341           * but for Wifi network.
12342           * @hide
12343           */
12344          @Readable
12345          public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
12346  
12347          /**
12348           * Whether or not data roaming is enabled. (0 = false, 1 = true)
12349           * Use {@link TelephonyManager#isDataRoamingEnabled} instead of calling via settings.
12350           */
12351          @Readable(maxTargetSdk = Build.VERSION_CODES.S_V2)
12352          public static final String DATA_ROAMING = "data_roaming";
12353  
12354          /**
12355           * The value passed to a Mobile DataConnection via bringUp which defines the
12356           * number of retries to perform when setting up the initial connection. The default
12357           * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
12358           * @hide
12359           */
12360          @Readable
12361          public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
12362  
12363          /**
12364           * Whether any package can be on external storage. When this is true, any
12365           * package, regardless of manifest values, is a candidate for installing
12366           * or moving onto external storage. (0 = false, 1 = true)
12367           * @hide
12368           */
12369          @Readable
12370          public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external";
12371  
12372          /**
12373           * The default SM-DP+ configured for this device.
12374           *
12375           * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to
12376           * download profiles. If this value is set, the LPA will query this server for any profiles
12377           * available to this device. If any are available, they may be downloaded during device
12378           * provisioning or in settings without needing the user to enter an activation code.
12379           *
12380           * @see android.service.euicc.EuiccService
12381           * @hide
12382           */
12383          @SystemApi
12384          @Readable
12385          public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
12386  
12387          /**
12388           * Whether any profile has ever been downloaded onto a eUICC on the device.
12389           *
12390           * <p>Used to hide eUICC UI from users who have never made use of it and would only be
12391           * confused by seeing references to it in settings.
12392           * (0 = false, 1 = true)
12393           * @hide
12394           */
12395          @SystemApi
12396          @Readable
12397          public static final String EUICC_PROVISIONED = "euicc_provisioned";
12398  
12399          /**
12400           * List of ISO country codes in which eUICC UI is shown. Country codes should be separated
12401           * by comma.
12402           *
12403           * Note: if {@link #EUICC_SUPPORTED_COUNTRIES} is empty, then {@link
12404           * #EUICC_UNSUPPORTED_COUNTRIES} is used.
12405           *
12406           * <p>Used to hide eUICC UI from users who are currently in countries where no carriers
12407           * support eUICC.
12408           *
12409           * @hide
12410           */
12411          @SystemApi
12412          @Readable
12413          public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries";
12414  
12415          /**
12416           * List of ISO country codes in which eUICC UI is not shown. Country codes should be
12417           * separated by comma.
12418           *
12419           * Note: if {@link #EUICC_SUPPORTED_COUNTRIES} is empty, then {@link
12420           * #EUICC_UNSUPPORTED_COUNTRIES} is used.
12421           *
12422           * <p>Used to hide eUICC UI from users who are currently in countries where no carriers
12423           * support eUICC.
12424           *
12425           * @hide
12426           */
12427          @SystemApi
12428          @Readable
12429          public static final String EUICC_UNSUPPORTED_COUNTRIES = "euicc_unsupported_countries";
12430  
12431          /**
12432           * Whether any activity can be resized. When this is true, any
12433           * activity, regardless of manifest values, can be resized for multi-window.
12434           * (0 = false, 1 = true)
12435           * @hide
12436           */
12437          @Readable
12438          public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES
12439                  = "force_resizable_activities";
12440  
12441          /**
12442           * Whether to enable experimental freeform support for windows.
12443           * @hide
12444           */
12445          @Readable
12446          public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT
12447                  = "enable_freeform_support";
12448  
12449          /**
12450           * Whether to enable experimental desktop mode on secondary displays.
12451           * @hide
12452           */
12453          @Readable
12454          public static final String DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS =
12455                  "force_desktop_mode_on_external_displays";
12456  
12457          /**
12458           * Whether to allow non-resizable apps to be shown in multi-window. The app will be
12459           * letterboxed if the request orientation is not met, and will be shown in size-compat
12460           * mode if the container size has changed.
12461           * @hide
12462           */
12463          @TestApi
12464          @Readable
12465          @SuppressLint("NoSettingsProvider")
12466          public static final String DEVELOPMENT_ENABLE_NON_RESIZABLE_MULTI_WINDOW =
12467                  "enable_non_resizable_multi_window";
12468  
12469          /**
12470           * If true, shadows drawn around the window will be rendered by the system compositor. If
12471           * false, shadows will be drawn by the client by setting an elevation on the root view and
12472           * the contents will be inset by the surface insets.
12473           * (0 = false, 1 = true)
12474           * @hide
12475           */
12476          @Readable
12477          public static final String DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR =
12478                  "render_shadows_in_compositor";
12479  
12480          /**
12481           * If true, submit buffers using blast in ViewRootImpl.
12482           * (0 = false, 1 = true)
12483           * @hide
12484           */
12485          @Readable
12486          public static final String DEVELOPMENT_USE_BLAST_ADAPTER_VR =
12487                  "use_blast_adapter_vr";
12488  
12489          /**
12490           * Path to the WindowManager display settings file. If unset, the default file path will
12491           * be used.
12492           *
12493           * @hide
12494           */
12495          public static final String DEVELOPMENT_WM_DISPLAY_SETTINGS_PATH =
12496                  "wm_display_settings_path";
12497  
12498          /**
12499          * Whether user has enabled development settings.
12500          */
12501          @Readable
12502          public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
12503  
12504          /**
12505          * Whether the device has been provisioned (0 = false, 1 = true).
12506          * <p>On a multiuser device with a separate system user, the screen may be locked
12507          * as soon as this is set to true and further activities cannot be launched on the
12508          * system user unless they are marked to show over keyguard.
12509          */
12510          @Readable
12511          public static final String DEVICE_PROVISIONED = "device_provisioned";
12512  
12513          /**
12514           * Indicates whether the device is under restricted secure FRP mode.
12515           * Secure FRP mode is enabled when the device is under FRP. On solving of FRP challenge,
12516           * device is removed from this mode.
12517           * <p>
12518           * Type: int (0 for false, 1 for true)
12519           *
12520           */
12521          @Readable
12522          @SuppressLint("NoSettingsProvider")
12523          public static final String SECURE_FRP_MODE = "secure_frp_mode";
12524  
12525          /**
12526           * Whether bypassing the device policy management role holder qualification is allowed,
12527           * (0 = false, 1 = true).
12528           *
12529           * @hide
12530           */
12531          public static final String BYPASS_DEVICE_POLICY_MANAGEMENT_ROLE_QUALIFICATIONS =
12532                  "bypass_device_policy_management_role_qualifications";
12533  
12534          /**
12535           * Whether work profile telephony feature is enabled for non
12536           * {@link android.app.role.RoleManager#ROLE_DEVICE_POLICY_MANAGEMENT} holders.
12537           * ("0" = false, "1" = true).
12538           *
12539           * @hide
12540           */
12541          @Readable
12542          public static final String ALLOW_WORK_PROFILE_TELEPHONY_FOR_NON_DPM_ROLE_HOLDERS =
12543                  "allow_work_profile_telephony_for_non_dpm_role_holders";
12544  
12545          /**
12546           * Indicates whether mobile data should be allowed while the device is being provisioned.
12547           * This allows the provisioning process to turn off mobile data before the user
12548           * has an opportunity to set things up, preventing other processes from burning
12549           * precious bytes before wifi is setup.
12550           * <p>
12551           * Type: int (0 for false, 1 for true)
12552           *
12553           * @hide
12554           */
12555          @SystemApi
12556          @Readable
12557          public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED =
12558                  "device_provisioning_mobile_data";
12559  
12560          /**
12561          * The saved value for WindowManagerService.setForcedDisplaySize().
12562          * Two integers separated by a comma.  If unset, then use the real display size.
12563          * @hide
12564          */
12565          @Readable
12566          public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
12567  
12568          /**
12569          * The saved value for WindowManagerService.setForcedDisplayScalingMode().
12570          * 0 or unset if scaling is automatic, 1 if scaling is disabled.
12571          * @hide
12572          */
12573          @Readable
12574          public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
12575  
12576          /**
12577          * The maximum size, in bytes, of a download that the download manager will transfer over
12578          * a non-wifi connection.
12579          * @hide
12580          */
12581          @Readable
12582          public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
12583                 "download_manager_max_bytes_over_mobile";
12584  
12585          /**
12586          * The recommended maximum size, in bytes, of a download that the download manager should
12587          * transfer over a non-wifi connection. Over this size, the use will be warned, but will
12588          * have the option to start the download over the mobile connection anyway.
12589          * @hide
12590          */
12591          @Readable
12592          public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
12593                 "download_manager_recommended_max_bytes_over_mobile";
12594  
12595          /**
12596          * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
12597          */
12598          @Deprecated
12599          public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
12600  
12601          /**
12602           * Whether or not media is shown automatically when bypassing as a heads up.
12603           * @hide
12604           */
12605          @Readable
12606          public static final String SHOW_MEDIA_ON_QUICK_SETTINGS =
12607                  "qs_media_controls";
12608  
12609          /**
12610           * The interval in milliseconds at which location requests will be throttled when they are
12611           * coming from the background.
12612           *
12613           * @hide
12614           */
12615          @Readable
12616          public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS =
12617                  "location_background_throttle_interval_ms";
12618  
12619          /**
12620           * Most frequent location update interval in milliseconds that proximity alert is allowed
12621           * to request.
12622           * @hide
12623           */
12624          @Readable
12625          public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS =
12626                  "location_background_throttle_proximity_alert_interval_ms";
12627  
12628          /**
12629           * Packages that are whitelisted for background throttling (throttling will not be applied).
12630           * @hide
12631           */
12632          @Readable
12633          public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST =
12634              "location_background_throttle_package_whitelist";
12635  
12636          /**
12637           * Packages that are whitelisted for ignoring location settings (may retrieve location even
12638           * when user location settings are off), for emergency purposes.
12639           * @deprecated No longer used from Android 12+
12640           * @hide
12641           */
12642          @TestApi
12643          @Readable
12644          @Deprecated
12645          public static final String LOCATION_IGNORE_SETTINGS_PACKAGE_WHITELIST =
12646                  "location_ignore_settings_package_whitelist";
12647  
12648          /**
12649           * Whether to throttle location when the device is in doze and still.
12650           * @hide
12651           */
12652          public static final String LOCATION_ENABLE_STATIONARY_THROTTLE =
12653                  "location_enable_stationary_throttle";
12654  
12655          /**
12656          * Whether TV will switch to MHL port when a mobile device is plugged in.
12657          * (0 = false, 1 = true)
12658          * @hide
12659          */
12660          @Readable
12661          public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
12662  
12663          /**
12664          * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
12665          * @hide
12666          */
12667          @Readable
12668          public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
12669  
12670          /**
12671          * Whether mobile data connections are allowed by the user.  See
12672          * ConnectivityManager for more info.
12673          * @hide
12674          */
12675          @UnsupportedAppUsage
12676          @Readable
12677          public static final String MOBILE_DATA = "mobile_data";
12678  
12679          /**
12680          * Whether the mobile data connection should remain active even when higher
12681          * priority networks like WiFi are active, to help make network switching faster.
12682          *
12683          * See ConnectivityService for more info.
12684          *
12685          * (0 = disabled, 1 = enabled)
12686          * @hide
12687          */
12688          @Readable
12689          public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
12690  
12691          /**
12692           * The duration in milliseconds of each action, separated by commas. Ex:
12693           *
12694           * "18000,18000,18000,18000,0"
12695           *
12696           * See com.android.internal.telephony.data.DataStallRecoveryManager for more info
12697           * @hide
12698           */
12699          public static final String DSRM_DURATION_MILLIS = "dsrm_duration_millis";
12700  
12701          /**
12702           * The list of DSRM enabled actions, separated by commas. Ex:
12703           *
12704           * "true,true,false,true,true"
12705           *
12706           * See com.android.internal.telephony.data.DataStallRecoveryManager for more info
12707           * @hide
12708           */
12709          public static final String DSRM_ENABLED_ACTIONS = "dsrm_enabled_actions";
12710  
12711          /**
12712           * Whether the wifi data connection should remain active even when higher
12713           * priority networks like Ethernet are active, to keep both networks.
12714           * In the case where higher priority networks are connected, wifi will be
12715           * unused unless an application explicitly requests to use it.
12716           *
12717           * See ConnectivityService for more info.
12718           *
12719           * (0 = disabled, 1 = enabled)
12720           * @hide
12721           */
12722          @Readable
12723          public static final String WIFI_ALWAYS_REQUESTED = "wifi_always_requested";
12724  
12725          /**
12726           * Size of the event buffer for IP connectivity metrics.
12727           * @hide
12728           */
12729          @Readable
12730          public static final String CONNECTIVITY_METRICS_BUFFER_SIZE =
12731                "connectivity_metrics_buffer_size";
12732  
12733          /** {@hide} */
12734          @Readable
12735          public static final String NETSTATS_ENABLED = "netstats_enabled";
12736          /** {@hide} */
12737          @Readable
12738          public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
12739          /**
12740           * @deprecated
12741           * {@hide}
12742           */
12743          @Deprecated
12744          @Readable
12745          public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
12746          /** {@hide} */
12747          @Readable
12748          public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
12749          /** {@hide} */
12750          @Readable
12751          public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
12752          /** {@hide} */
12753          @Readable
12754          public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled";
12755          /** {@hide} */
12756          @Readable
12757          public static final String NETSTATS_COMBINE_SUBTYPE_ENABLED =
12758                  "netstats_combine_subtype_enabled";
12759  
12760          /** {@hide} */
12761          @Readable
12762          public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
12763          /** {@hide} */
12764          @Readable
12765          public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
12766          /** {@hide} */
12767          @Readable
12768          public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
12769          /** {@hide} */
12770          @Readable
12771          public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
12772  
12773          /** {@hide} */
12774          @Readable
12775          public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
12776          /** {@hide} */
12777          @Readable
12778          public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
12779          /** {@hide} */
12780          @Readable
12781          public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
12782          /** {@hide} */
12783          @Readable
12784          public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
12785  
12786          /** {@hide} */
12787          @Readable
12788          public static final String NETSTATS_UID_TAG_BUCKET_DURATION =
12789                  "netstats_uid_tag_bucket_duration";
12790          /** {@hide} */
12791          @Readable
12792          public static final String NETSTATS_UID_TAG_PERSIST_BYTES =
12793                  "netstats_uid_tag_persist_bytes";
12794          /** {@hide} */
12795          @Readable
12796          public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
12797          /** {@hide} */
12798          @Readable
12799          public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
12800  
12801          /** {@hide} */
12802          @Readable
12803          public static final String NETPOLICY_QUOTA_ENABLED = "netpolicy_quota_enabled";
12804          /** {@hide} */
12805          @Readable
12806          public static final String NETPOLICY_QUOTA_UNLIMITED = "netpolicy_quota_unlimited";
12807          /** {@hide} */
12808          @Readable
12809          public static final String NETPOLICY_QUOTA_LIMITED = "netpolicy_quota_limited";
12810          /** {@hide} */
12811          @Readable
12812          public static final String NETPOLICY_QUOTA_FRAC_JOBS = "netpolicy_quota_frac_jobs";
12813          /** {@hide} */
12814          @Readable
12815          public static final String NETPOLICY_QUOTA_FRAC_MULTIPATH =
12816                  "netpolicy_quota_frac_multipath";
12817  
12818          /** {@hide} */
12819          @Readable
12820          public static final String NETPOLICY_OVERRIDE_ENABLED = "netpolicy_override_enabled";
12821  
12822          /**
12823          * User preference for which network(s) should be used. Only the
12824          * connectivity service should touch this.
12825          */
12826          @Readable
12827          public static final String NETWORK_PREFERENCE = "network_preference";
12828  
12829          /**
12830          * Which package name to use for network scoring. If null, or if the package is not a valid
12831          * scorer app, external network scores will neither be requested nor accepted.
12832          * @hide
12833          */
12834          @Readable
12835          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
12836          public static final String NETWORK_SCORER_APP = "network_scorer_app";
12837  
12838          /**
12839           * Whether night display forced auto mode is available.
12840           * 0 = unavailable, 1 = available.
12841           * @hide
12842           */
12843          @Readable
12844          public static final String NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE =
12845                  "night_display_forced_auto_mode_available";
12846  
12847          /**
12848           * If Unix epoch time between two NITZ signals is greater than this value then the second
12849           * signal cannot be ignored.
12850           *
12851           * <p>This value is in milliseconds. It is used for telephony-based time and time zone
12852           * detection.
12853           * @hide
12854           */
12855          @Readable
12856          public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
12857  
12858          /**
12859           * If the elapsed realtime between two NITZ signals is greater than this value then the
12860           * second signal cannot be ignored.
12861           *
12862           * <p>This value is in milliseconds. It is used for telephony-based time and time zone
12863           * detection.
12864           * @hide
12865           */
12866          @Readable
12867          public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
12868  
12869          /**
12870           * If the device connects to a telephony network and was disconnected from a telephony
12871           * network for less than this time, a previously received NITZ signal can be restored.
12872           *
12873           * <p>This value is in milliseconds. It is used for telephony-based time and time zone
12874           * detection.
12875           * @hide
12876           */
12877          public static final String NITZ_NETWORK_DISCONNECT_RETENTION =
12878                  "nitz_network_disconnect_retention";
12879  
12880          /**
12881           * SNTP client config: The preferred NTP server. This setting overrides the static
12882           * config.xml configuration when present and valid.
12883           *
12884           * <p>The legacy form is the NTP server name as a string.
12885           * <p>Newer code should use the form: ntp://{server name}[:port] (the standard NTP port,
12886           * 123, is used if not specified).
12887           *
12888           * <p>The settings value can consist of a pipe ("|") delimited list of server names or
12889           * ntp:// URIs. When present, all server name / ntp:// URIs must be valid or the entire
12890           * setting value will be ignored and Android's xml config will be used.
12891           *
12892           * <p>For example, the following examples are valid:
12893           * <ul>
12894           *     <li>"time.android.com"</li>
12895           *     <li>"ntp://time.android.com"</li>
12896           *     <li>"ntp://time.android.com:123"</li>
12897           *     <li>"time.android.com|time.other"</li>
12898           *     <li>"ntp://time.android.com:123|ntp://time.other:123"</li>
12899           *     <li>"time.android.com|ntp://time.other:123"</li>
12900           * </ul>
12901           *
12902           * @hide
12903           */
12904          @Readable
12905          public static final String NTP_SERVER = "ntp_server";
12906  
12907          /**
12908           * SNTP client config: Timeout to wait for an NTP server response. This setting overrides
12909           * the static config.xml configuration when present and valid.
12910           *
12911           * <p>The value is the timeout in milliseconds. It must be > 0.
12912           *
12913           * @hide
12914           */
12915          @Readable
12916          public static final String NTP_TIMEOUT = "ntp_timeout";
12917  
12918          /** {@hide} */
12919          @Readable
12920          public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval";
12921  
12922          /**
12923           * Whether or not Settings should enable psd API.
12924           * {@hide}
12925           */
12926          @Readable
12927          public static final String SETTINGS_USE_PSD_API = "settings_use_psd_api";
12928  
12929          /**
12930           * Whether or not Settings should enable external provider API.
12931           * {@hide}
12932           */
12933          @Readable
12934          public static final String SETTINGS_USE_EXTERNAL_PROVIDER_API =
12935                  "settings_use_external_provider_api";
12936  
12937          /**
12938          * Sample validity in seconds to configure for the system DNS resolver.
12939          * {@hide}
12940          */
12941          @Readable
12942          public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS =
12943                 "dns_resolver_sample_validity_seconds";
12944  
12945          /**
12946          * Success threshold in percent for use with the system DNS resolver.
12947          * {@hide}
12948          */
12949          @Readable
12950          public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT =
12951                  "dns_resolver_success_threshold_percent";
12952  
12953          /**
12954          * Minimum number of samples needed for statistics to be considered meaningful in the
12955          * system DNS resolver.
12956          * {@hide}
12957          */
12958          @Readable
12959          public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples";
12960  
12961          /**
12962          * Maximum number taken into account for statistics purposes in the system DNS resolver.
12963          * {@hide}
12964          */
12965          @Readable
12966          public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples";
12967  
12968          /**
12969          * Whether to disable the automatic scheduling of system updates.
12970          * 1 = system updates won't be automatically scheduled (will always
12971          * present notification instead).
12972          * 0 = system updates will be automatically scheduled. (default)
12973          * @hide
12974          */
12975          @SystemApi
12976          @Readable
12977          public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
12978  
12979          /** Timeout for package verification.
12980          * @hide */
12981          @Readable
12982          public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
12983  
12984          /** Timeout for package verification during streaming installations.
12985           * @hide */
12986          @Readable
12987          public static final String PACKAGE_STREAMING_VERIFIER_TIMEOUT =
12988                  "streaming_verifier_timeout";
12989  
12990          /** Timeout for app integrity verification.
12991           * @hide */
12992          @Readable
12993          public static final String APP_INTEGRITY_VERIFICATION_TIMEOUT =
12994                  "app_integrity_verification_timeout";
12995  
12996          /** Default response code for package verification.
12997          * @hide */
12998          @Readable
12999          public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
13000  
13001          /**
13002          * Show package verification setting in the Settings app.
13003          * 1 = show (default)
13004          * 0 = hide
13005          * @hide
13006          */
13007          @Readable
13008          public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
13009  
13010          /**
13011          * Run package verification on apps installed through ADB/ADT/USB
13012          * 1 = perform package verification on ADB installs (default)
13013          * 0 = bypass package verification on ADB installs
13014          * @hide
13015          */
13016          @Readable
13017          public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
13018  
13019          /**
13020           * Run integrity checks for integrity rule providers.
13021           * 0 = bypass integrity verification on installs from rule providers (default)
13022           * 1 = perform integrity verification on installs from rule providers
13023           * @hide
13024           */
13025          @Readable
13026          public static final String INTEGRITY_CHECK_INCLUDES_RULE_PROVIDER =
13027                  "verify_integrity_for_rule_provider";
13028  
13029          /**
13030          * Time since last fstrim (milliseconds) after which we force one to happen
13031          * during device startup.  If unset, the default is 3 days.
13032          * @hide
13033          */
13034          @Readable
13035          public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
13036  
13037          /**
13038          * The interval in milliseconds at which to check packet counts on the
13039          * mobile data interface when screen is on, to detect possible data
13040          * connection problems.
13041          * @hide
13042          */
13043          @Readable
13044          public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
13045                 "pdp_watchdog_poll_interval_ms";
13046  
13047          /**
13048          * The interval in milliseconds at which to check packet counts on the
13049          * mobile data interface when screen is off, to detect possible data
13050          * connection problems.
13051          * @hide
13052          */
13053          @Readable
13054          public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
13055                 "pdp_watchdog_long_poll_interval_ms";
13056  
13057          /**
13058          * The interval in milliseconds at which to check packet counts on the
13059          * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
13060          * outgoing packets has been reached without incoming packets.
13061          * @hide
13062          */
13063          @Readable
13064          public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
13065                 "pdp_watchdog_error_poll_interval_ms";
13066  
13067          /**
13068          * The number of outgoing packets sent without seeing an incoming packet
13069          * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
13070          * device is logged to the event log
13071          * @hide
13072          */
13073          @Readable
13074          public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
13075                 "pdp_watchdog_trigger_packet_count";
13076  
13077          /**
13078          * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
13079          * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
13080          * attempting data connection recovery.
13081          * @hide
13082          */
13083          @Readable
13084          public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
13085                 "pdp_watchdog_error_poll_count";
13086  
13087          /**
13088          * The number of failed PDP reset attempts before moving to something more
13089          * drastic: re-registering to the network.
13090          * @hide
13091          */
13092          @Readable
13093          public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
13094                 "pdp_watchdog_max_pdp_reset_fail_count";
13095  
13096          /**
13097          * URL to open browser on to allow user to manage a prepay account
13098          * @hide
13099          */
13100          @Readable
13101          public static final String SETUP_PREPAID_DATA_SERVICE_URL =
13102                 "setup_prepaid_data_service_url";
13103  
13104          /**
13105          * URL to attempt a GET on to see if this is a prepay device
13106          * @hide
13107          */
13108          @Readable
13109          public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
13110                 "setup_prepaid_detection_target_url";
13111  
13112          /**
13113          * Host to check for a redirect to after an attempt to GET
13114          * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
13115          * this is a prepaid device with zero balance.)
13116          * @hide
13117          */
13118          @Readable
13119          public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
13120                 "setup_prepaid_detection_redir_host";
13121  
13122          /**
13123          * The interval in milliseconds at which to check the number of SMS sent out without asking
13124          * for use permit, to limit the un-authorized SMS usage.
13125          *
13126          * @hide
13127          */
13128          @Readable
13129          public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
13130                 "sms_outgoing_check_interval_ms";
13131  
13132          /**
13133          * The number of outgoing SMS sent without asking for user permit (of {@link
13134          * #SMS_OUTGOING_CHECK_INTERVAL_MS}
13135          *
13136          * @hide
13137          */
13138          @Readable
13139          public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
13140                 "sms_outgoing_check_max_count";
13141  
13142          /**
13143          * Used to disable SMS short code confirmation - defaults to true.
13144          * True indcates we will do the check, etc.  Set to false to disable.
13145          * @see com.android.internal.telephony.SmsUsageMonitor
13146          * @hide
13147          */
13148          @Readable
13149          public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
13150  
13151          /**
13152           * Used to select which country we use to determine premium sms codes.
13153           * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
13154           * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
13155           * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
13156           * @hide
13157           */
13158          @Readable
13159          public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
13160  
13161          /**
13162           * Used to select TCP's default initial receiver window size in segments - defaults to a
13163           * build config value.
13164           * @hide
13165           */
13166          @Readable
13167          public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
13168  
13169          /**
13170           * Used to disable Tethering on a device - defaults to true.
13171           * @hide
13172           */
13173          @SystemApi
13174          @Readable
13175          public static final String TETHER_SUPPORTED = "tether_supported";
13176  
13177          /**
13178           * Used to require DUN APN on the device or not - defaults to a build config value
13179           * which defaults to false.
13180           * @hide
13181           */
13182          @Readable
13183          public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
13184  
13185          /**
13186           * Used to hold a gservices-provisioned apn value for DUN.  If set, or the
13187           * corresponding build config values are set it will override the APN DB
13188           * values.
13189           * Consists of a comma separated list of strings:
13190           * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
13191           * note that empty fields can be omitted: "name,apn,,,,,,,,,310,260,,DUN"
13192           * @hide
13193           */
13194          @Readable
13195          public static final String TETHER_DUN_APN = "tether_dun_apn";
13196  
13197          /**
13198           * Used to disable trying to talk to any available tethering offload HAL.
13199           *
13200           * Integer values are interpreted as boolean, and the absence of an explicit setting
13201           * is interpreted as |false|.
13202           * @hide
13203           */
13204          @SystemApi
13205          @Readable
13206          public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled";
13207  
13208          /**
13209           * Use the old dnsmasq DHCP server for tethering instead of the framework implementation.
13210           *
13211           * Integer values are interpreted as boolean, and the absence of an explicit setting
13212           * is interpreted as |false|.
13213           * @hide
13214           */
13215          @Readable
13216          public static final String TETHER_ENABLE_LEGACY_DHCP_SERVER =
13217                  "tether_enable_legacy_dhcp_server";
13218  
13219          /**
13220           * List of certificate (hex string representation of the application's certificate - SHA-1
13221           * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for
13222           * install when a sim card with matching UICC carrier privilege rules is inserted.  The
13223           * certificate is used as a key, so the certificate encoding here must be the same as the
13224           * certificate encoding used on the SIM.
13225           *
13226           * The value is "cert1:package1;cert2:package2;..."
13227           * @hide
13228           */
13229          @SystemApi
13230          @Readable
13231          public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
13232  
13233          /**
13234           * Map of package name to application names. The application names cannot and will not be
13235           * localized. App names may not contain colons or semicolons.
13236           *
13237           * The value is "packageName1:appName1;packageName2:appName2;..."
13238           * @hide
13239           */
13240          @SystemApi
13241          @Readable
13242          public static final String CARRIER_APP_NAMES = "carrier_app_names";
13243  
13244          /**
13245          * USB Mass Storage Enabled
13246          */
13247          @Readable
13248          public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
13249  
13250          /**
13251          * If this setting is set (to anything), then all references
13252          * to Gmail on the device must change to Google Mail.
13253          */
13254          @Readable
13255          public static final String USE_GOOGLE_MAIL = "use_google_mail";
13256  
13257          /**
13258           * Whether or not switching/creating users is enabled by user.
13259           * @hide
13260           */
13261          @Readable
13262          public static final String USER_SWITCHER_ENABLED = "user_switcher_enabled";
13263  
13264          /**
13265           * Webview Data reduction proxy key.
13266           * @hide
13267           */
13268          @Readable
13269          public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
13270                  "webview_data_reduction_proxy_key";
13271  
13272          /**
13273          * Name of the package used as WebView provider (if unset the provider is instead determined
13274          * by the system).
13275          * @hide
13276          */
13277          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
13278          @Readable
13279          public static final String WEBVIEW_PROVIDER = "webview_provider";
13280  
13281          /**
13282          * Developer setting to enable WebView multiprocess rendering.
13283          * @hide
13284          */
13285          @SystemApi
13286          @Readable
13287          public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
13288  
13289          /**
13290          * The maximum number of notifications shown in 24 hours when switching networks.
13291          * @hide
13292          */
13293          @Readable
13294          public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT =
13295                "network_switch_notification_daily_limit";
13296  
13297          /**
13298          * The minimum time in milliseconds between notifications when switching networks.
13299          * @hide
13300          */
13301          @Readable
13302          public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS =
13303                "network_switch_notification_rate_limit_millis";
13304  
13305          /**
13306          * Whether to automatically switch away from wifi networks that lose Internet access.
13307          * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always
13308          * avoids such networks. Valid values are:
13309          *
13310          * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013.
13311          * null: Ask the user whether to switch away from bad wifi.
13312          * 1: Avoid bad wifi.
13313          *
13314          * @hide
13315          */
13316          @Readable
13317          public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi";
13318  
13319          /**
13320          * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be
13321          * overridden by the system based on device or application state. If null, the value
13322          * specified by config_networkMeteredMultipathPreference is used.
13323          *
13324          * @hide
13325          */
13326          @Readable
13327          public static final String NETWORK_METERED_MULTIPATH_PREFERENCE =
13328                 "network_metered_multipath_preference";
13329  
13330          /**
13331           * Default daily multipath budget used by ConnectivityManager.getMultipathPreference()
13332           * on metered networks. This default quota is only used if quota could not be determined
13333           * from data plan or data limit/warning set by the user.
13334           * @hide
13335           */
13336          @Readable
13337          public static final String NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES =
13338                  "network_default_daily_multipath_quota_bytes";
13339  
13340          /**
13341           * Network watchlist last report time.
13342           * @hide
13343           */
13344          @Readable
13345          public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME =
13346                  "network_watchlist_last_report_time";
13347  
13348          /**
13349          * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of
13350          * colon-delimited key-value pairs. The key is the badging enum value defined in
13351          * android.net.ScoredNetwork and the value is the minimum sustained network throughput in
13352          * kbps required for the badge. For example: "10:3000,20:5000,30:25000"
13353          *
13354          * @hide
13355          */
13356          @SystemApi
13357          @Readable
13358          public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds";
13359  
13360          /**
13361          * Whether Wifi display is enabled/disabled
13362          * 0=disabled. 1=enabled.
13363          * @hide
13364          */
13365          @Readable
13366          public static final String WIFI_DISPLAY_ON = "wifi_display_on";
13367  
13368          /**
13369          * Whether Wifi display certification mode is enabled/disabled
13370          * 0=disabled. 1=enabled.
13371          * @hide
13372          */
13373          @Readable
13374          public static final String WIFI_DISPLAY_CERTIFICATION_ON =
13375                 "wifi_display_certification_on";
13376  
13377          /**
13378          * WPS Configuration method used by Wifi display, this setting only
13379          * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
13380          *
13381          * Possible values are:
13382          *
13383          * WpsInfo.INVALID: use default WPS method chosen by framework
13384          * WpsInfo.PBC    : use Push button
13385          * WpsInfo.KEYPAD : use Keypad
13386          * WpsInfo.DISPLAY: use Display
13387          * @hide
13388          */
13389          @Readable
13390          public static final String WIFI_DISPLAY_WPS_CONFIG =
13391             "wifi_display_wps_config";
13392  
13393          /**
13394          * Whether to notify the user of open networks.
13395          * <p>
13396          * If not connected and the scan results have an open network, we will
13397          * put this notification up. If we attempt to connect to a network or
13398          * the open network(s) disappear, we remove the notification. When we
13399          * show the notification, we will not show it again for
13400          * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
13401          *
13402          * @deprecated This feature is no longer controlled by this setting in
13403          * {@link android.os.Build.VERSION_CODES#O}.
13404          */
13405          @Deprecated
13406          @Readable
13407          public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
13408                 "wifi_networks_available_notification_on";
13409  
13410          /**
13411          * {@hide}
13412          */
13413          @Readable
13414          public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
13415                 "wimax_networks_available_notification_on";
13416  
13417          /**
13418          * Delay (in seconds) before repeating the Wi-Fi networks available notification.
13419          * Connecting to a network will reset the timer.
13420          * @deprecated This is no longer used or set by the platform.
13421          */
13422          @Deprecated
13423          @Readable
13424          public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
13425                 "wifi_networks_available_repeat_delay";
13426  
13427          /**
13428          * 802.11 country code in ISO 3166 format
13429          * @hide
13430          */
13431          @Readable
13432          public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
13433  
13434          /**
13435          * The interval in milliseconds to issue wake up scans when wifi needs
13436          * to connect. This is necessary to connect to an access point when
13437          * device is on the move and the screen is off.
13438          * @hide
13439          */
13440          @Readable
13441          public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
13442                 "wifi_framework_scan_interval_ms";
13443  
13444          /**
13445          * The interval in milliseconds after which Wi-Fi is considered idle.
13446          * When idle, it is possible for the device to be switched from Wi-Fi to
13447          * the mobile data network.
13448          * @hide
13449          */
13450          @Readable
13451          public static final String WIFI_IDLE_MS = "wifi_idle_ms";
13452  
13453          /**
13454          * When the number of open networks exceeds this number, the
13455          * least-recently-used excess networks will be removed.
13456          * @deprecated This is no longer used or set by the platform.
13457          */
13458          @Deprecated
13459          @Readable
13460          public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
13461  
13462          /**
13463          * Whether the Wi-Fi should be on.  Only the Wi-Fi service should touch this.
13464          */
13465          @Readable
13466          public static final String WIFI_ON = "wifi_on";
13467  
13468          /**
13469          * Setting to allow scans to be enabled even wifi is turned off for connectivity.
13470          * @hide
13471          * @deprecated To be removed. Use {@link WifiManager#setScanAlwaysAvailable(boolean)} for
13472          * setting the value and {@link WifiManager#isScanAlwaysAvailable()} for query.
13473          */
13474          @Deprecated
13475          @Readable
13476          public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
13477                  "wifi_scan_always_enabled";
13478  
13479          /**
13480           * Indicate whether factory reset request is pending.
13481           *
13482           * Type: int (0 for false, 1 for true)
13483           * @hide
13484           * @deprecated To be removed.
13485           */
13486          @Deprecated
13487          @Readable
13488          public static final String WIFI_P2P_PENDING_FACTORY_RESET =
13489                  "wifi_p2p_pending_factory_reset";
13490  
13491          /**
13492           * Whether soft AP will shut down after a timeout period when no devices are connected.
13493           *
13494           * Type: int (0 for false, 1 for true)
13495           * @hide
13496           * @deprecated To be removed. Use {@link SoftApConfiguration.Builder#
13497           * setAutoShutdownEnabled(boolean)} for setting the value and {@link SoftApConfiguration#
13498           * isAutoShutdownEnabled()} for query.
13499           */
13500          @Deprecated
13501          @Readable
13502          public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled";
13503  
13504          /**
13505           * Value to specify if Wi-Fi Wakeup feature is enabled.
13506           *
13507           * Type: int (0 for false, 1 for true)
13508           * @hide
13509           * @deprecated Use {@link WifiManager#setAutoWakeupEnabled(boolean)} for setting the value
13510           * and {@link WifiManager#isAutoWakeupEnabled()} for query.
13511           */
13512          @Deprecated
13513          @SystemApi
13514          @Readable
13515          public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
13516  
13517          /**
13518           * Value to specify if wifi settings migration is complete or not.
13519           * Note: This should only be used from within {@link android.net.wifi.WifiMigration} class.
13520           *
13521           * Type: int (0 for false, 1 for true)
13522           * @hide
13523           */
13524          @Readable
13525          public static final String WIFI_MIGRATION_COMPLETED = "wifi_migration_completed";
13526  
13527          /**
13528           * Whether UWB should be enabled.
13529           * @hide
13530           */
13531          public static final String UWB_ENABLED = "uwb_enabled";
13532  
13533          /**
13534           * Value to specify whether network quality scores and badging should be shown in the UI.
13535           *
13536           * Type: int (0 for false, 1 for true)
13537           * @deprecated {@link NetworkScoreManager} is deprecated.
13538           * @hide
13539           */
13540          @Deprecated
13541          @Readable
13542          public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled";
13543  
13544          /**
13545           * Value to specify how long in milliseconds to retain seen score cache curves to be used
13546           * when generating SSID only bases score curves.
13547           *
13548           * Type: long
13549           * @deprecated {@link NetworkScoreManager} is deprecated.
13550           * @hide
13551           */
13552          @Deprecated
13553          @Readable
13554          public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS =
13555                  "speed_label_cache_eviction_age_millis";
13556  
13557          /**
13558           * Value to specify if network recommendations from
13559           * {@link com.android.server.NetworkScoreService} are enabled.
13560           *
13561           * Type: int
13562           * Valid values:
13563           *   -1 = Forced off
13564           *    0 = Disabled
13565           *    1 = Enabled
13566           *
13567           * Most readers of this setting should simply check if value == 1 to determine the
13568           * enabled state.
13569           * @hide
13570           * @deprecated To be removed.
13571           */
13572          @Deprecated
13573          @Readable
13574          public static final String NETWORK_RECOMMENDATIONS_ENABLED =
13575                  "network_recommendations_enabled";
13576  
13577          /**
13578           * Which package name to use for network recommendations. If null, network recommendations
13579           * will neither be requested nor accepted.
13580           *
13581           * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and
13582           * {@link NetworkScoreManager#setActiveScorer(String)} to write it.
13583           *
13584           * Type: string - package name
13585           * @deprecated {@link NetworkScoreManager} is deprecated.
13586           * @hide
13587           */
13588          @Deprecated
13589          @Readable
13590          public static final String NETWORK_RECOMMENDATIONS_PACKAGE =
13591                  "network_recommendations_package";
13592  
13593          /**
13594           * The package name of the application that connect and secures high quality open wifi
13595           * networks automatically.
13596           *
13597           * Type: string package name or null if the feature is either not provided or disabled.
13598           * @deprecated {@link NetworkScoreManager} is deprecated.
13599           * @hide
13600           */
13601          @Deprecated
13602          @TestApi
13603          @Readable
13604          public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package";
13605  
13606          /**
13607           * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in
13608           * {@link com.android.server.wifi.RecommendedNetworkEvaluator}.
13609           *
13610           * Type: long
13611           * @deprecated {@link NetworkScoreManager} is deprecated.
13612           * @hide
13613           */
13614          @Deprecated
13615          @Readable
13616          public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS =
13617                  "recommended_network_evaluator_cache_expiry_ms";
13618  
13619          /**
13620           * Whether wifi scan throttle is enabled or not.
13621           *
13622           * Type: int (0 for false, 1 for true)
13623           * @hide
13624           * @deprecated Use {@link WifiManager#setScanThrottleEnabled(boolean)} for setting the value
13625           * and {@link WifiManager#isScanThrottleEnabled()} for query.
13626           */
13627          @Deprecated
13628          @Readable
13629          public static final String WIFI_SCAN_THROTTLE_ENABLED = "wifi_scan_throttle_enabled";
13630  
13631          /**
13632          * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
13633          * connectivity.
13634          * @hide
13635          */
13636          @Readable
13637          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
13638          @SuppressLint("NoSettingsProvider")
13639          public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled";
13640  
13641          /**
13642           * The length in milliseconds of a BLE scan window in a low-power scan mode.
13643           * @hide
13644           */
13645          @Readable
13646          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
13647          @SuppressLint("NoSettingsProvider")
13648          public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms";
13649  
13650          /**
13651           * The length in milliseconds of a BLE scan window in a balanced scan mode.
13652           * @hide
13653           */
13654          @Readable
13655          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
13656          @SuppressLint("NoSettingsProvider")
13657          public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms";
13658  
13659          /**
13660           * The length in milliseconds of a BLE scan window in a low-latency scan mode.
13661           * @hide
13662           */
13663          @Readable
13664          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
13665          @SuppressLint("NoSettingsProvider")
13666          public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS =
13667                  "ble_scan_low_latency_window_ms";
13668  
13669          /**
13670           * The length in milliseconds of a BLE scan interval in a low-power scan mode.
13671           * @hide
13672           */
13673          @Readable
13674          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
13675          @SuppressLint("NoSettingsProvider")
13676          public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS =
13677                  "ble_scan_low_power_interval_ms";
13678  
13679          /**
13680           * The length in milliseconds of a BLE scan interval in a balanced scan mode.
13681           * @hide
13682           */
13683          @Readable
13684          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
13685          @SuppressLint("NoSettingsProvider")
13686          public static final String BLE_SCAN_BALANCED_INTERVAL_MS =
13687                  "ble_scan_balanced_interval_ms";
13688  
13689          /**
13690           * The length in milliseconds of a BLE scan interval in a low-latency scan mode.
13691           * @hide
13692           */
13693          @Readable
13694          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
13695          @SuppressLint("NoSettingsProvider")
13696          public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS =
13697                  "ble_scan_low_latency_interval_ms";
13698  
13699          /**
13700           * The mode that BLE scanning clients will be moved to when in the background.
13701           * @hide
13702           */
13703          @Readable
13704          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
13705          @SuppressLint("NoSettingsProvider")
13706          public static final String BLE_SCAN_BACKGROUND_MODE = "ble_scan_background_mode";
13707  
13708          /**
13709          * The interval in milliseconds to scan as used by the wifi supplicant
13710          * @hide
13711          */
13712          @Readable
13713          public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
13714                 "wifi_supplicant_scan_interval_ms";
13715  
13716          /**
13717           * whether frameworks handles wifi auto-join
13718           * @hide
13719           */
13720          @Readable
13721          public static final String WIFI_ENHANCED_AUTO_JOIN =
13722                  "wifi_enhanced_auto_join";
13723  
13724          /**
13725           * whether settings show RSSI
13726           * @hide
13727           */
13728          @Readable
13729          public static final String WIFI_NETWORK_SHOW_RSSI =
13730                  "wifi_network_show_rssi";
13731  
13732          /**
13733          * The interval in milliseconds to scan at supplicant when p2p is connected
13734          * @hide
13735          */
13736          @Readable
13737          public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
13738                 "wifi_scan_interval_p2p_connected_ms";
13739  
13740          /**
13741          * Whether the Wi-Fi watchdog is enabled.
13742          */
13743          @Readable
13744          public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
13745  
13746          /**
13747          * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
13748          * the setting needs to be set to 0 to disable it.
13749          * @hide
13750          */
13751          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
13752          @Readable
13753          public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
13754                 "wifi_watchdog_poor_network_test_enabled";
13755  
13756          /**
13757          * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1
13758          * will enable it. In the future, additional values may be supported.
13759          * @hide
13760          * @deprecated Use {@link WifiManager#setVerboseLoggingEnabled(boolean)} for setting the
13761          * value and {@link WifiManager#isVerboseLoggingEnabled()} for query.
13762          */
13763          @Deprecated
13764          @Readable
13765          public static final String WIFI_VERBOSE_LOGGING_ENABLED =
13766                 "wifi_verbose_logging_enabled";
13767  
13768          /**
13769           * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and
13770           * setting to 1 will enable it. In the future, additional values may be supported.
13771           * @deprecated MAC randomization is now a per-network setting
13772           * @hide
13773           */
13774          @Deprecated
13775          @Readable
13776          public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED =
13777                  "wifi_connected_mac_randomization_enabled";
13778  
13779          /**
13780           * Parameters to adjust the performance of framework wifi scoring methods.
13781           * <p>
13782           * Encoded as a comma-separated key=value list, for example:
13783           *   "rssi5=-80:-77:-70:-57,rssi2=-83:-80:-73:-60,horizon=15"
13784           * This is intended for experimenting with new parameter values,
13785           * and is normally unset or empty. The example does not include all
13786           * parameters that may be honored.
13787           * Default values are provided by code or device configurations.
13788           * Errors in the parameters will cause the entire setting to be ignored.
13789           * @hide
13790           * @deprecated This is no longer used or set by the platform.
13791           */
13792          @Deprecated
13793          @Readable
13794          public static final String WIFI_SCORE_PARAMS =
13795                  "wifi_score_params";
13796  
13797          /**
13798          * The maximum number of times we will retry a connection to an access
13799          * point for which we have failed in acquiring an IP address from DHCP.
13800          * A value of N means that we will make N+1 connection attempts in all.
13801          */
13802          @Readable
13803          public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
13804  
13805          /**
13806          * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
13807          * data connectivity to be established after a disconnect from Wi-Fi.
13808          */
13809          @Readable
13810          public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
13811             "wifi_mobile_data_transition_wakelock_timeout_ms";
13812  
13813          /**
13814          * This setting controls whether WiFi configurations created by a Device Owner app
13815          * should be locked down (that is, be editable or removable only by the Device Owner App,
13816          * not even by Settings app).
13817          * This setting takes integer values. Non-zero values mean DO created configurations
13818          * are locked down. Value of zero means they are not. Default value in the absence of
13819          * actual value to this setting is 0.
13820          */
13821          @Readable
13822          public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN =
13823                 "wifi_device_owner_configs_lockdown";
13824  
13825          /**
13826          * The operational wifi frequency band
13827          * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
13828          * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
13829          * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
13830          *
13831          * @hide
13832          */
13833          @Readable
13834          public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
13835  
13836          /**
13837          * The Wi-Fi peer-to-peer device name
13838          * @hide
13839          * @deprecated Use {@link WifiP2pManager#setDeviceName(WifiP2pManager.Channel, String,
13840          * WifiP2pManager.ActionListener)} for setting the value and
13841          * {@link android.net.wifi.p2p.WifiP2pDevice#deviceName} for query.
13842          */
13843          @Deprecated
13844          @Readable
13845          public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
13846  
13847          /**
13848          * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
13849          * from an ephemeral network if there is no BSSID for that network with a non-null score that
13850          * has been seen in this time period.
13851          *
13852          * If this is less than or equal to zero, we use a more conservative behavior and only check
13853          * for a non-null score from the currently connected or target BSSID.
13854          * @hide
13855          */
13856          @Readable
13857          public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
13858                 "wifi_ephemeral_out_of_range_timeout_ms";
13859  
13860          /**
13861          * The number of milliseconds to delay when checking for data stalls during
13862          * non-aggressive detection. (screen is turned off.)
13863          * @hide
13864          */
13865          @Readable
13866          public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
13867                 "data_stall_alarm_non_aggressive_delay_in_ms";
13868  
13869          /**
13870          * The number of milliseconds to delay when checking for data stalls during
13871          * aggressive detection. (screen on or suspected data stall)
13872          * @hide
13873          */
13874          @Readable
13875          public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
13876                 "data_stall_alarm_aggressive_delay_in_ms";
13877  
13878          /**
13879          * The number of milliseconds to allow the provisioning apn to remain active
13880          * @hide
13881          */
13882          @Readable
13883          public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
13884                 "provisioning_apn_alarm_delay_in_ms";
13885  
13886          /**
13887          * The interval in milliseconds at which to check gprs registration
13888          * after the first registration mismatch of gprs and voice service,
13889          * to detect possible data network registration problems.
13890          *
13891          * @hide
13892          */
13893          @Readable
13894          public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
13895                 "gprs_register_check_period_ms";
13896  
13897          /**
13898          * Nonzero causes Log.wtf() to crash.
13899          * @hide
13900          */
13901          @Readable
13902          public static final String WTF_IS_FATAL = "wtf_is_fatal";
13903  
13904          /**
13905          * Ringer mode. This is used internally, changing this value will not
13906          * change the ringer mode. See AudioManager.
13907          */
13908          @Readable
13909          public static final String MODE_RINGER = "mode_ringer";
13910  
13911          /**
13912           * Overlay display devices setting.
13913           * The associated value is a specially formatted string that describes the
13914           * size and density of simulated secondary display devices.
13915           * <p>
13916           * Format:
13917           * <pre>
13918           * [display1];[display2];...
13919           * </pre>
13920           * with each display specified as:
13921           * <pre>
13922           * [mode1]|[mode2]|...,[flag1],[flag2],...
13923           * </pre>
13924           * with each mode specified as:
13925           * <pre>
13926           * [width]x[height]/[densityDpi]
13927           * </pre>
13928           * Supported flags:
13929           * <ul>
13930           * <li><pre>secure</pre>: creates a secure display</li>
13931           * <li><pre>own_content_only</pre>: only shows this display's own content</li>
13932           * <li><pre>should_show_system_decorations</pre>: supports system decorations</li>
13933           * </ul>
13934           * </p><p>
13935           * Example:
13936           * <ul>
13937           * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
13938           * <li><code>1920x1080/320,secure;1280x720/213</code>: make two overlays, the first at
13939           * 1080p and secure; the second at 720p.</li>
13940           * <li><code>1920x1080/320|3840x2160/640</code>: make one overlay that is 1920x1080 at
13941           * 213dpi by default, but can also be upscaled to 3840x2160 at 640dpi by the system if the
13942           * display device allows.</li>
13943           * <li>If the value is empty, then no overlay display devices are created.</li>
13944           * </ul></p>
13945           *
13946           * @hide
13947           */
13948          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
13949          @TestApi
13950          @Readable
13951          public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
13952  
13953          /**
13954           * Threshold values for the duration and level of a discharge cycle,
13955           * under which we log discharge cycle info.
13956           *
13957           * @hide
13958           */
13959          @Readable
13960          public static final String
13961                  BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
13962  
13963          /** @hide */
13964          @Readable
13965          public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
13966  
13967          /**
13968           * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
13969           * intents on application crashes and ANRs. If this is disabled, the
13970           * crash/ANR dialog will never display the "Report" button.
13971           * <p>
13972           * Type: int (0 = disallow, 1 = allow)
13973           *
13974           * @hide
13975           */
13976          @Readable
13977          public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
13978  
13979          /**
13980           * Maximum age of entries kept by {@link DropBoxManager}.
13981           *
13982           * @hide
13983           */
13984          @Readable
13985          public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
13986  
13987          /**
13988           * Maximum number of entry files which {@link DropBoxManager} will keep
13989           * around.
13990           *
13991           * @hide
13992           */
13993          @Readable
13994          public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
13995  
13996          /**
13997           * Maximum amount of disk space used by {@link DropBoxManager} no matter
13998           * what.
13999           *
14000           * @hide
14001           */
14002          @Readable
14003          public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
14004  
14005          /**
14006           * Percent of free disk (excluding reserve) which {@link DropBoxManager}
14007           * will use.
14008           *
14009           * @hide
14010           */
14011          @Readable
14012          public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
14013  
14014          /**
14015           * Percent of total disk which {@link DropBoxManager} will never dip
14016           * into.
14017           *
14018           * @hide
14019           */
14020          @Readable
14021          public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
14022  
14023          /**
14024           * Prefix for per-tag dropbox disable/enable settings.
14025           *
14026           * @hide
14027           */
14028          @Readable
14029          public static final String DROPBOX_TAG_PREFIX = "dropbox:";
14030  
14031          /**
14032           * Lines of logcat to include with system crash/ANR/etc. reports, as a
14033           * prefix of the dropbox tag of the report type. For example,
14034           * "logcat_for_system_server_anr" controls the lines of logcat captured
14035           * with system server ANR reports. 0 to disable.
14036           *
14037           * @hide
14038           */
14039          @Readable
14040          public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
14041  
14042          /**
14043           * Maximum number of bytes of a system crash/ANR/etc. report that
14044           * ActivityManagerService should send to DropBox, as a prefix of the
14045           * dropbox tag of the report type. For example,
14046           * "max_error_bytes_for_system_server_anr" controls the maximum
14047           * number of bytes captured with system server ANR reports.
14048           * <p>
14049           * Type: int (max size in bytes)
14050           *
14051           * @hide
14052           */
14053          @Readable
14054          public static final String MAX_ERROR_BYTES_PREFIX = "max_error_bytes_for_";
14055  
14056          /**
14057           * The interval in minutes after which the amount of free storage left
14058           * on the device is logged to the event log
14059           *
14060           * @hide
14061           */
14062          @Readable
14063          public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
14064  
14065          /**
14066           * Threshold for the amount of change in disk free space required to
14067           * report the amount of free space. Used to prevent spamming the logs
14068           * when the disk free space isn't changing frequently.
14069           *
14070           * @hide
14071           */
14072          @Readable
14073          public static final String
14074                  DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
14075  
14076          /**
14077           * Minimum percentage of free storage on the device that is used to
14078           * determine if the device is running low on storage. The default is 10.
14079           * <p>
14080           * Say this value is set to 10, the device is considered running low on
14081           * storage if 90% or more of the device storage is filled up.
14082           *
14083           * @hide
14084           */
14085          @Readable
14086          public static final String
14087                  SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
14088  
14089          /**
14090           * Maximum byte size of the low storage threshold. This is to ensure
14091           * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
14092           * overly large threshold for large storage devices. Currently this must
14093           * be less than 2GB. This default is 500MB.
14094           *
14095           * @hide
14096           */
14097          @Readable
14098          public static final String
14099                  SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
14100  
14101          /**
14102           * Minimum bytes of free storage on the device before the data partition
14103           * is considered full. By default, 1 MB is reserved to avoid system-wide
14104           * SQLite disk full exceptions.
14105           *
14106           * @hide
14107           */
14108          @Readable
14109          public static final String
14110                  SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
14111  
14112          /**
14113           * Minimum percentage of storage on the device that is reserved for
14114           * cached data.
14115           *
14116           * @hide
14117           */
14118          @Readable
14119          public static final String
14120                  SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage";
14121  
14122          /**
14123           * The maximum reconnect delay for short network outages or when the
14124           * network is suspended due to phone use.
14125           *
14126           * @hide
14127           */
14128          @Readable
14129          public static final String
14130                  SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
14131  
14132          /**
14133           * The number of milliseconds to delay before sending out
14134           * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
14135           *
14136           * @hide
14137           */
14138          @Readable
14139          public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
14140  
14141  
14142          /**
14143           * Network sampling interval, in seconds. We'll generate link information
14144           * about bytes/packets sent and error rates based on data sampled in this interval
14145           *
14146           * @hide
14147           */
14148          @Readable
14149          public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
14150                  "connectivity_sampling_interval_in_seconds";
14151  
14152          /**
14153           * The series of successively longer delays used in retrying to download PAC file.
14154           * Last delay is used between successful PAC downloads.
14155           *
14156           * @hide
14157           */
14158          @Readable
14159          public static final String PAC_CHANGE_DELAY = "pac_change_delay";
14160  
14161          /**
14162           * Don't attempt to detect captive portals.
14163           *
14164           * @hide
14165           */
14166          public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0;
14167  
14168          /**
14169           * When detecting a captive portal, display a notification that
14170           * prompts the user to sign in.
14171           *
14172           * @hide
14173           */
14174          public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1;
14175  
14176          /**
14177           * When detecting a captive portal, immediately disconnect from the
14178           * network and do not reconnect to that network in the future.
14179           *
14180           * @hide
14181           */
14182          public static final int CAPTIVE_PORTAL_MODE_AVOID = 2;
14183  
14184          /**
14185           * What to do when connecting a network that presents a captive portal.
14186           * Must be one of the CAPTIVE_PORTAL_MODE_* constants above.
14187           *
14188           * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT.
14189           * @hide
14190           */
14191          @Readable
14192          public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
14193  
14194          /**
14195           * Setting to turn off captive portal detection. Feature is enabled by
14196           * default and the setting needs to be set to 0 to disable it.
14197           *
14198           * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection
14199           * @hide
14200           */
14201          @Deprecated
14202          @Readable
14203          public static final String
14204                  CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
14205  
14206          /**
14207           * The server used for captive portal detection upon a new conection. A
14208           * 204 response code from the server is used for validation.
14209           * TODO: remove this deprecated symbol.
14210           *
14211           * @hide
14212           */
14213          @Readable
14214          public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
14215  
14216          /**
14217           * The URL used for HTTPS captive portal detection upon a new connection.
14218           * A 204 response code from the server is used for validation.
14219           *
14220           * @hide
14221           */
14222          @Readable
14223          public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
14224  
14225          /**
14226           * The URL used for HTTP captive portal detection upon a new connection.
14227           * A 204 response code from the server is used for validation.
14228           *
14229           * @hide
14230           */
14231          @Readable
14232          public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
14233  
14234          /**
14235           * The URL used for fallback HTTP captive portal detection when previous HTTP
14236           * and HTTPS captive portal detection attemps did not return a conclusive answer.
14237           *
14238           * @hide
14239           */
14240          @Readable
14241          public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
14242  
14243          /**
14244           * A comma separated list of URLs used for captive portal detection in addition to the
14245           * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings.
14246           *
14247           * @hide
14248           */
14249          @Readable
14250          public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS =
14251                  "captive_portal_other_fallback_urls";
14252  
14253          /**
14254           * A list of captive portal detection specifications used in addition to the fallback URLs.
14255           * Each spec has the format url@@/@@statusCodeRegex@@/@@contentRegex. Specs are separated
14256           * by "@@,@@".
14257           * @hide
14258           */
14259          @Readable
14260          public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS =
14261                  "captive_portal_fallback_probe_specs";
14262  
14263          /**
14264           * Whether to use HTTPS for network validation. This is enabled by default and the setting
14265           * needs to be set to 0 to disable it. This setting is a misnomer because captive portals
14266           * don't actually use HTTPS, but it's consistent with the other settings.
14267           *
14268           * @hide
14269           */
14270          @Readable
14271          public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
14272  
14273          /**
14274           * Which User-Agent string to use in the header of the captive portal detection probes.
14275           * The User-Agent field is unset when this setting has no value (HttpUrlConnection default).
14276           *
14277           * @hide
14278           */
14279          @Readable
14280          public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
14281  
14282          /**
14283           * Whether to try cellular data recovery when a bad network is reported.
14284           *
14285           * @hide
14286           */
14287          @Readable
14288          public static final String DATA_STALL_RECOVERY_ON_BAD_NETWORK =
14289                  "data_stall_recovery_on_bad_network";
14290  
14291          /**
14292           * Minumim duration in millisecodns between cellular data recovery attempts
14293           *
14294           * @hide
14295           */
14296          @Readable
14297          public static final String MIN_DURATION_BETWEEN_RECOVERY_STEPS_IN_MS =
14298                  "min_duration_between_recovery_steps";
14299  
14300          /**
14301           * Let user pick default install location.
14302           *
14303           * @hide
14304           */
14305          @Readable
14306          public static final String SET_INSTALL_LOCATION = "set_install_location";
14307  
14308          /**
14309           * Default install location value.
14310           * 0 = auto, let system decide
14311           * 1 = internal
14312           * 2 = sdcard
14313           * @hide
14314           */
14315          @Readable
14316          public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
14317  
14318          /**
14319           * ms during which to consume extra events related to Inet connection
14320           * condition after a transtion to fully-connected
14321           *
14322           * @hide
14323           */
14324          @Readable
14325          public static final String
14326                  INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
14327  
14328          /**
14329           * ms during which to consume extra events related to Inet connection
14330           * condtion after a transtion to partly-connected
14331           *
14332           * @hide
14333           */
14334          @Readable
14335          public static final String
14336                  INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
14337  
14338          /** {@hide} */
14339          @Readable
14340          public static final String
14341                  READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
14342  
14343          /**
14344           * Host name and port for global http proxy. Uses ':' seperator for
14345           * between host and port.
14346           */
14347          @Readable
14348          public static final String HTTP_PROXY = "http_proxy";
14349  
14350          /**
14351           * Host name for global http proxy. Set via ConnectivityManager.
14352           *
14353           * @hide
14354           */
14355          @Readable
14356          public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
14357  
14358          /**
14359           * Integer host port for global http proxy. Set via ConnectivityManager.
14360           *
14361           * @hide
14362           */
14363          @Readable
14364          public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
14365  
14366          /**
14367           * Exclusion list for global proxy. This string contains a list of
14368           * comma-separated domains where the global proxy does not apply.
14369           * Domains should be listed in a comma- separated list. Example of
14370           * acceptable formats: ".domain1.com,my.domain2.com" Use
14371           * ConnectivityManager to set/get.
14372           *
14373           * @hide
14374           */
14375          @Readable
14376          public static final String
14377                  GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
14378  
14379          /**
14380           * The location PAC File for the proxy.
14381           * @hide
14382           */
14383          @Readable
14384          public static final String
14385                  GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
14386  
14387          /**
14388           * Enables the UI setting to allow the user to specify the global HTTP
14389           * proxy and associated exclusion list.
14390           *
14391           * @hide
14392           */
14393          @Readable
14394          public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
14395  
14396          /**
14397           * Setting for default DNS in case nobody suggests one
14398           *
14399           * @hide
14400           */
14401          @Readable
14402          public static final String DEFAULT_DNS_SERVER = "default_dns_server";
14403  
14404          /**
14405           * The requested Private DNS mode (string), and an accompanying specifier (string).
14406           *
14407           * Currently, the specifier holds the chosen provider name when the mode requests
14408           * a specific provider. It may be used to store the provider name even when the
14409           * mode changes so that temporarily disabling and re-enabling the specific
14410           * provider mode does not necessitate retyping the provider hostname.
14411           *
14412           * @hide
14413           */
14414          @Readable
14415          public static final String PRIVATE_DNS_MODE = "private_dns_mode";
14416  
14417          /**
14418           * @hide
14419           */
14420          @Readable
14421          public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier";
14422  
14423          /**
14424            * Forced override of the default mode (hardcoded as "automatic", nee "opportunistic").
14425            * This allows changing the default mode without effectively disabling other modes,
14426            * all of which require explicit user action to enable/configure. See also b/79719289.
14427            *
14428            * Value is a string, suitable for assignment to PRIVATE_DNS_MODE above.
14429            *
14430            * {@hide}
14431            */
14432          @Readable
14433          public static final String PRIVATE_DNS_DEFAULT_MODE = "private_dns_default_mode";
14434  
14435  
14436          /** {@hide} */
14437          @Readable
14438          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
14439          @SuppressLint("NoSettingsProvider")
14440          public static final String
14441                  BLUETOOTH_BTSNOOP_DEFAULT_MODE = "bluetooth_btsnoop_default_mode";
14442          /** {@hide} */
14443          @Readable
14444          public static final String
14445                  BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
14446          /** {@hide} */
14447          @Readable
14448          public static final String
14449                  BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
14450          /** {@hide} */
14451          @Readable
14452          public static final String
14453                  BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_";
14454          /** {@hide} */
14455          @Readable
14456          public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX =
14457                  "bluetooth_a2dp_supports_optional_codecs_";
14458          /** {@hide} */
14459          @Readable
14460          public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX =
14461                  "bluetooth_a2dp_optional_codecs_enabled_";
14462          /** {@hide} */
14463          @Readable
14464          public static final String
14465                  BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
14466          /** {@hide} */
14467          @Readable
14468          public static final String
14469                  BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
14470          /** {@hide} */
14471          @Readable
14472          public static final String
14473                  BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_";
14474          /** {@hide} */
14475          @Readable
14476          public static final String
14477                  BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_";
14478          /** {@hide} */
14479          @Readable
14480          public static final String
14481                  BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
14482          /** {@hide} */
14483          @Readable
14484          public static final String
14485                  BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_";
14486          /** {@hide} */
14487          @Readable
14488          public static final String
14489                  BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_";
14490  
14491          /**
14492           * Enable/disable radio bug detection
14493           *
14494           * {@hide}
14495           */
14496          @Readable
14497          public static final String
14498                  ENABLE_RADIO_BUG_DETECTION = "enable_radio_bug_detection";
14499  
14500          /**
14501           * Count threshold of RIL wakelock timeout for radio bug detection
14502           *
14503           * {@hide}
14504           */
14505          @Readable
14506          public static final String
14507                  RADIO_BUG_WAKELOCK_TIMEOUT_COUNT_THRESHOLD =
14508                  "radio_bug_wakelock_timeout_count_threshold";
14509  
14510          /**
14511           * Count threshold of RIL system error for radio bug detection
14512           *
14513           * {@hide}
14514           */
14515          @Readable
14516          public static final String
14517                  RADIO_BUG_SYSTEM_ERROR_COUNT_THRESHOLD =
14518                  "radio_bug_system_error_count_threshold";
14519  
14520          /**
14521           * Activity manager specific settings.
14522           * This is encoded as a key=value list, separated by commas. Ex:
14523           *
14524           * "gc_timeout=5000,max_cached_processes=24"
14525           *
14526           * The following keys are supported:
14527           *
14528           * <pre>
14529           * max_cached_processes                 (int)
14530           * background_settle_time               (long)
14531           * fgservice_min_shown_time             (long)
14532           * fgservice_min_report_time            (long)
14533           * fgservice_screen_on_before_time      (long)
14534           * fgservice_screen_on_after_time       (long)
14535           * content_provider_retain_time         (long)
14536           * gc_timeout                           (long)
14537           * gc_min_interval                      (long)
14538           * full_pss_min_interval                (long)
14539           * full_pss_lowered_interval            (long)
14540           * power_check_interval                 (long)
14541           * power_check_max_cpu_1                (int)
14542           * power_check_max_cpu_2                (int)
14543           * power_check_max_cpu_3                (int)
14544           * power_check_max_cpu_4                (int)
14545           * service_usage_interaction_time       (long)
14546           * usage_stats_interaction_interval     (long)
14547           * service_restart_duration             (long)
14548           * service_reset_run_duration           (long)
14549           * service_restart_duration_factor      (int)
14550           * service_min_restart_time_between     (long)
14551           * service_max_inactivity               (long)
14552           * service_bg_start_timeout             (long)
14553           * service_bg_activity_start_timeout    (long)
14554           * process_start_async                  (boolean)
14555           * </pre>
14556           *
14557           * <p>
14558           * Type: string
14559           * @hide
14560           * @see com.android.server.am.ActivityManagerConstants
14561           */
14562          @Readable
14563          public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants";
14564  
14565          /**
14566           * Feature flag to enable or disable the activity starts logging feature.
14567           * Type: int (0 for false, 1 for true)
14568           * Default: 1
14569           * @hide
14570           */
14571          @Readable
14572          public static final String ACTIVITY_STARTS_LOGGING_ENABLED
14573                  = "activity_starts_logging_enabled";
14574  
14575          /**
14576           * Feature flag to enable or disable the foreground service starts logging feature.
14577           * Type: int (0 for false, 1 for true)
14578           * Default: 1
14579           * @hide
14580           */
14581          @Readable
14582          public static final String FOREGROUND_SERVICE_STARTS_LOGGING_ENABLED =
14583                  "foreground_service_starts_logging_enabled";
14584  
14585          /**
14586           * @hide
14587           * @see com.android.server.appbinding.AppBindingConstants
14588           */
14589          @Readable
14590          public static final String APP_BINDING_CONSTANTS = "app_binding_constants";
14591  
14592          /**
14593           * App ops specific settings.
14594           * This is encoded as a key=value list, separated by commas. Ex:
14595           *
14596           * "state_settle_time=10000"
14597           *
14598           * The following keys are supported:
14599           *
14600           * <pre>
14601           * top_state_settle_time                (long)
14602           * fg_service_state_settle_time         (long)
14603           * bg_state_settle_time                 (long)
14604           * </pre>
14605           *
14606           * <p>
14607           * Type: string
14608           * @hide
14609           * @see com.android.server.AppOpsService.Constants
14610           */
14611          @TestApi
14612          @Readable
14613          public static final String APP_OPS_CONSTANTS = "app_ops_constants";
14614  
14615          /**
14616           * Battery Saver specific settings
14617           * This is encoded as a key=value list, separated by commas. Ex:
14618           *
14619           * "vibration_disabled=true,adjust_brightness_factor=0.5"
14620           *
14621           * The following keys are supported:
14622           *
14623           * <pre>
14624           * advertise_is_enabled              (boolean)
14625           * datasaver_disabled                (boolean)
14626           * enable_night_mode                 (boolean)
14627           * launch_boost_disabled             (boolean)
14628           * vibration_disabled                (boolean)
14629           * animation_disabled                (boolean)
14630           * soundtrigger_disabled             (boolean)
14631           * fullbackup_deferred               (boolean)
14632           * keyvaluebackup_deferred           (boolean)
14633           * firewall_disabled                 (boolean)
14634           * gps_mode                          (int)
14635           * adjust_brightness_disabled        (boolean)
14636           * adjust_brightness_factor          (float)
14637           * force_all_apps_standby            (boolean)
14638           * force_background_check            (boolean)
14639           * optional_sensors_disabled         (boolean)
14640           * aod_disabled                      (boolean)
14641           * quick_doze_enabled                (boolean)
14642           * </pre>
14643           * @hide
14644           * @see com.android.server.power.batterysaver.BatterySaverPolicy
14645           */
14646          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
14647          @TestApi
14648          @Readable
14649          public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants";
14650  
14651          /**
14652           * Battery Saver device specific settings
14653           * This is encoded as a key=value list, separated by commas.
14654           *
14655           * The following keys are supported:
14656           *
14657           * <pre>
14658           *     cpufreq-i (list of "core-number:frequency" pairs concatenated with /)
14659           *     cpufreq-n (list of "core-number:frequency" pairs concatenated with /)
14660           * </pre>
14661           *
14662           * See {@link com.android.server.power.batterysaver.BatterySaverPolicy} for the details.
14663           *
14664           * @hide
14665           */
14666          @Readable
14667          public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS =
14668                  "battery_saver_device_specific_constants";
14669  
14670          /**
14671           * Battery tip specific settings
14672           * This is encoded as a key=value list, separated by commas. Ex:
14673           *
14674           * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true,"
14675           * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50,"
14676           * "high_usage_battery_draining=25,high_usage_period_ms=3000"
14677           *
14678           * The following keys are supported:
14679           *
14680           * <pre>
14681           * battery_tip_enabled              (boolean)
14682           * summary_enabled                  (boolean)
14683           * battery_saver_tip_enabled        (boolean)
14684           * high_usage_enabled               (boolean)
14685           * high_usage_app_count             (int)
14686           * high_usage_period_ms             (long)
14687           * high_usage_battery_draining      (int)
14688           * app_restriction_enabled          (boolean)
14689           * reduced_battery_enabled          (boolean)
14690           * reduced_battery_percent          (int)
14691           * low_battery_enabled              (boolean)
14692           * low_battery_hour                 (int)
14693           * </pre>
14694           * @hide
14695           */
14696          @Readable
14697          public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants";
14698  
14699          /**
14700           * Battery anomaly detection specific settings
14701           * This is encoded as a key=value list, separated by commas.
14702           * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via
14703           * {@link Uri#encode(String)}, separated by colons. Ex:
14704           *
14705           * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true,"
14706           * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon"
14707           *
14708           * The following keys are supported:
14709           *
14710           * <pre>
14711           * anomaly_detection_enabled       (boolean)
14712           * wakelock_enabled                (boolean)
14713           * wakelock_threshold              (long)
14714           * wakeup_alarm_enabled            (boolean)
14715           * wakeup_alarm_threshold          (long)
14716           * wakeup_blacklisted_tags         (string)
14717           * bluetooth_scan_enabled          (boolean)
14718           * bluetooth_scan_threshold        (long)
14719           * </pre>
14720           * @hide
14721           */
14722          @Readable
14723          public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants";
14724  
14725          /**
14726           * An integer to show the version of the anomaly config. Ex: 1, which means
14727           * current version is 1.
14728           * @hide
14729           */
14730          @Readable
14731          public static final String ANOMALY_CONFIG_VERSION = "anomaly_config_version";
14732  
14733          /**
14734           * A base64-encoded string represents anomaly stats config, used for
14735           * {@link android.app.StatsManager}.
14736           * @hide
14737           */
14738          @Readable
14739          public static final String ANOMALY_CONFIG = "anomaly_config";
14740  
14741          /**
14742           * Always on display(AOD) specific settings
14743           * This is encoded as a key=value list, separated by commas. Ex:
14744           *
14745           * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4"
14746           *
14747           * The following keys are supported:
14748           *
14749           * <pre>
14750           * screen_brightness_array         (int[])
14751           * dimming_scrim_array             (int[])
14752           * prox_screen_off_delay           (long)
14753           * prox_cooldown_trigger           (long)
14754           * prox_cooldown_period            (long)
14755           * </pre>
14756           * @hide
14757           */
14758          @Readable
14759          public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants";
14760  
14761          /**
14762          * UidCpuPower global setting. This links the sys.uidcpupower system property.
14763          * The following values are supported:
14764          * 0 -> /proc/uid_cpupower/* are disabled
14765          * 1 -> /proc/uid_cpupower/* are enabled
14766          * Any other value defaults to enabled.
14767          * @hide
14768          */
14769          @Readable
14770          public static final String SYS_UIDCPUPOWER = "sys_uidcpupower";
14771  
14772          /**
14773          * traced global setting. This controls weather the deamons: traced and
14774          * traced_probes run. This links the sys.traced system property.
14775          * The following values are supported:
14776          * 0 -> traced and traced_probes are disabled
14777          * 1 -> traced and traced_probes are enabled
14778          * Any other value defaults to disabled.
14779          * @hide
14780          */
14781          @Readable
14782          public static final String SYS_TRACED = "sys_traced";
14783  
14784          /**
14785           * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the
14786           * device for this setting to take full effect.
14787           *
14788           * @hide
14789           */
14790          @Readable
14791          public static final String FPS_DEVISOR = "fps_divisor";
14792  
14793          /**
14794           * Flag to enable or disable display panel low power mode (lpm)
14795           * false -> Display panel power saving mode is disabled.
14796           * true  -> Display panel power saving mode is enabled.
14797           *
14798           * @hide
14799           */
14800          @Readable
14801          public static final String DISPLAY_PANEL_LPM = "display_panel_lpm";
14802  
14803          /**
14804           * App time limit usage source setting.
14805           * This controls which app in a task will be considered the source of usage when
14806           * calculating app usage time limits.
14807           *
14808           * 1 -> task root app
14809           * 2 -> current app
14810           * Any other value defaults to task root app.
14811           *
14812           * Need to reboot the device for this setting to take effect.
14813           * @hide
14814           */
14815          @Readable
14816          public static final String APP_TIME_LIMIT_USAGE_SOURCE = "app_time_limit_usage_source";
14817  
14818          /**
14819           * Enable ART bytecode verification verifications for debuggable apps.
14820           * 0 = disable, 1 = enable.
14821           * @hide
14822           */
14823          @Readable
14824          public static final String ART_VERIFIER_VERIFY_DEBUGGABLE =
14825                  "art_verifier_verify_debuggable";
14826  
14827          /**
14828           * Power manager specific settings.
14829           * This is encoded as a key=value list, separated by commas. Ex:
14830           *
14831           * "no_cached_wake_locks=1"
14832           *
14833           * The following keys are supported:
14834           *
14835           * <pre>
14836           * no_cached_wake_locks                 (boolean)
14837           * </pre>
14838           *
14839           * <p>
14840           * Type: string
14841           * @hide
14842           * @see com.android.server.power.PowerManagerConstants
14843           */
14844          @Readable
14845          public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants";
14846  
14847          /**
14848           * ShortcutManager specific settings.
14849           * This is encoded as a key=value list, separated by commas. Ex:
14850           *
14851           * "reset_interval_sec=86400,max_updates_per_interval=1"
14852           *
14853           * The following keys are supported:
14854           *
14855           * <pre>
14856           * reset_interval_sec              (long)
14857           * max_updates_per_interval        (int)
14858           * max_icon_dimension_dp           (int, DP)
14859           * max_icon_dimension_dp_lowram    (int, DP)
14860           * max_shortcuts                   (int)
14861           * icon_quality                    (int, 0-100)
14862           * icon_format                     (String)
14863           * </pre>
14864           *
14865           * <p>
14866           * Type: string
14867           * @hide
14868           * @see com.android.server.pm.ShortcutService.ConfigConstants
14869           */
14870          @Readable
14871          public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants";
14872  
14873          /**
14874           * DevicePolicyManager specific settings.
14875           * This is encoded as a key=value list, separated by commas. Ex:
14876           *
14877           * <pre>
14878           * das_died_service_reconnect_backoff_sec       (long)
14879           * das_died_service_reconnect_backoff_increase  (float)
14880           * das_died_service_reconnect_max_backoff_sec   (long)
14881           * </pre>
14882           *
14883           * <p>
14884           * Type: string
14885           * @hide
14886           * see also com.android.server.devicepolicy.DevicePolicyConstants
14887           */
14888          @Readable
14889          public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants";
14890  
14891          /**
14892           * TextClassifier specific settings.
14893           * This is encoded as a key=value list, separated by commas. String[] types like
14894           * entity_list_default use ":" as delimiter for values. Ex:
14895           *
14896           * <pre>
14897           * classify_text_max_range_length                   (int)
14898           * detect_language_from_text_enabled                (boolean)
14899           * entity_list_default                              (String[])
14900           * entity_list_editable                             (String[])
14901           * entity_list_not_editable                         (String[])
14902           * generate_links_log_sample_rate                   (int)
14903           * generate_links_max_text_length                   (int)
14904           * in_app_conversation_action_types_default         (String[])
14905           * lang_id_context_settings                         (float[])
14906           * lang_id_threshold_override                       (float)
14907           * local_textclassifier_enabled                     (boolean)
14908           * model_dark_launch_enabled                        (boolean)
14909           * notification_conversation_action_types_default   (String[])
14910           * smart_linkify_enabled                            (boolean)
14911           * smart_select_animation_enabled                   (boolean)
14912           * smart_selection_enabled                          (boolean)
14913           * smart_text_share_enabled                         (boolean)
14914           * suggest_selection_max_range_length               (int)
14915           * system_textclassifier_enabled                    (boolean)
14916           * template_intent_factory_enabled                  (boolean)
14917           * translate_in_classification_enabled              (boolean)
14918           * </pre>
14919           *
14920           * <p>
14921           * Type: string
14922           * @hide
14923           * see also android.view.textclassifier.TextClassificationConstants
14924           */
14925          @Readable
14926          public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants";
14927  
14928          /**
14929           * BatteryStats specific settings.
14930           * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
14931           *
14932           * The following keys are supported:
14933           * <pre>
14934           * track_cpu_times_by_proc_state (boolean)
14935           * track_cpu_active_cluster_time (boolean)
14936           * read_binary_cpu_time          (boolean)
14937           * proc_state_cpu_times_read_delay_ms (long)
14938           * external_stats_collection_rate_limit_ms (long)
14939           * battery_level_collection_delay_ms (long)
14940           * max_history_files (int)
14941           * max_history_buffer_kb (int)
14942           * battery_charged_delay_ms (int)
14943           * </pre>
14944           *
14945           * <p>
14946           * Type: string
14947           * @hide
14948           * see also com.android.internal.os.BatteryStatsImpl.Constants
14949           */
14950          @Readable
14951          public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants";
14952  
14953          /**
14954           * SyncManager specific settings.
14955           *
14956           * <p>
14957           * Type: string
14958           * @hide
14959           * @see com.android.server.content.SyncManagerConstants
14960           */
14961          @Readable
14962          public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants";
14963  
14964          /**
14965           * Broadcast dispatch tuning parameters specific to foreground broadcasts.
14966           *
14967           * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
14968           *
14969           * The following keys are supported:
14970           * <pre>
14971           * bcast_timeout                (long)
14972           * bcast_slow_time              (long)
14973           * bcast_deferral               (long)
14974           * bcast_deferral_decay_factor  (float)
14975           * bcast_deferral_floor         (long)
14976           * bcast_allow_bg_activity_start_timeout    (long)
14977           * </pre>
14978           *
14979           * @hide
14980           */
14981          @Readable
14982          public static final String BROADCAST_FG_CONSTANTS = "bcast_fg_constants";
14983  
14984          /**
14985           * Broadcast dispatch tuning parameters specific to background broadcasts.
14986           *
14987           * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true".
14988           * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys.
14989           *
14990           * @hide
14991           */
14992          @Readable
14993          public static final String BROADCAST_BG_CONSTANTS = "bcast_bg_constants";
14994  
14995          /**
14996           * Broadcast dispatch tuning parameters specific to specific "offline" broadcasts.
14997           *
14998           * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true".
14999           * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys.
15000           *
15001           * @hide
15002           */
15003          @Readable
15004          public static final String BROADCAST_OFFLOAD_CONSTANTS = "bcast_offload_constants";
15005  
15006          /**
15007           * Whether or not App Standby feature is enabled by system. This controls throttling of apps
15008           * based on usage patterns and predictions. Platform will turn on this feature if both this
15009           * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on.
15010           * Type: int (0 for false, 1 for true)
15011           * Default: 1
15012           * @hide
15013           * @see #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED
15014           */
15015          @SystemApi
15016          @Readable
15017          public static final String APP_STANDBY_ENABLED = "app_standby_enabled";
15018  
15019          /**
15020           * Whether or not adaptive battery feature is enabled by user. Platform will turn on this
15021           * feature if both this flag and {@link #APP_STANDBY_ENABLED} is on.
15022           * Type: int (0 for false, 1 for true)
15023           * Default: 1
15024           * @hide
15025           * @see #APP_STANDBY_ENABLED
15026           */
15027          @Readable
15028          public static final String ADAPTIVE_BATTERY_MANAGEMENT_ENABLED =
15029                  "adaptive_battery_management_enabled";
15030  
15031          /**
15032           * Whether or not app auto restriction is enabled. When it is enabled, settings app will
15033           * auto restrict the app if it has bad behavior (e.g. hold wakelock for long time).
15034           *
15035           * Type: boolean (0 for false, 1 for true)
15036           * Default: 1
15037           *
15038           * @hide
15039           */
15040          @Readable
15041          public static final String APP_AUTO_RESTRICTION_ENABLED =
15042                  "app_auto_restriction_enabled";
15043  
15044          /**
15045           * Whether or not to enable Forced App Standby on small battery devices.
15046           * Type: int (0 for false, 1 for true)
15047           * Default: 0
15048           * @hide
15049           */
15050          @Readable
15051          public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED
15052                  = "forced_app_standby_for_small_battery_enabled";
15053  
15054          /**
15055           * Whether to enable the TARE subsystem or not.
15056           * Valid values are
15057           * {@link android.app.tare.EconomyManager#ENABLE_TARE_ON EconomyManager.ENABLE_TARE_*}.
15058           *
15059           * @hide
15060           */
15061          public static final String ENABLE_TARE = "enable_tare";
15062  
15063          /**
15064           * Whether to show the TARE page in Developer Options or not.
15065           * 1 = true, everything else = false
15066           *
15067           * @hide
15068           */
15069          public static final String SHOW_TARE_DEVELOPER_OPTIONS = "show_tare_developer_options";
15070  
15071          /**
15072           * Settings for AlarmManager's TARE EconomicPolicy (list of its economic factors).
15073           *
15074           * Keys are listed in {@link android.app.tare.EconomyManager}.
15075           *
15076           * @hide
15077           */
15078          public static final String TARE_ALARM_MANAGER_CONSTANTS = "tare_alarm_manager_constants";
15079  
15080          /**
15081           * Settings for JobScheduler's TARE EconomicPolicy (list of its economic factors).
15082           *
15083           * Keys are listed in {@link android.app.tare.EconomyManager}.
15084           *
15085           * @hide
15086           */
15087          public static final String TARE_JOB_SCHEDULER_CONSTANTS = "tare_job_scheduler_constants";
15088  
15089          /**
15090           * Whether or not to enable the User Absent, Radios Off feature on small battery devices.
15091           * Type: int (0 for false, 1 for true)
15092           * Default: 0
15093           * @hide
15094           */
15095          @Readable
15096          public static final String USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED
15097                  = "user_absent_radios_off_for_small_battery_enabled";
15098  
15099          /**
15100           * Whether or not to enable the User Absent, Touch Off feature on small battery devices.
15101           * Type: int (0 for false, 1 for true)
15102           * Default: 0
15103           * @hide
15104           */
15105          @Readable
15106          public static final String USER_ABSENT_TOUCH_OFF_FOR_SMALL_BATTERY_ENABLED
15107                  = "user_absent_touch_off_for_small_battery_enabled";
15108  
15109          /**
15110           * Whether or not to turn on Wifi when proxy is disconnected.
15111           * Type: int (0 for false, 1 for true)
15112           * Default: 1
15113           * @hide
15114           */
15115          @Readable
15116          public static final String WIFI_ON_WHEN_PROXY_DISCONNECTED
15117                  = "wifi_on_when_proxy_disconnected";
15118  
15119          /**
15120           * Time Only Mode specific settings.
15121           * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true"
15122           *
15123           * The following keys are supported:
15124           *
15125           * <pre>
15126           * enabled                  (boolean)
15127           * disable_home             (boolean)
15128           * disable_tilt_to_wake     (boolean)
15129           * disable_touch_to_wake    (boolean)
15130           * </pre>
15131           * Type: string
15132           * @hide
15133           */
15134          @Readable
15135          public static final String TIME_ONLY_MODE_CONSTANTS
15136                  = "time_only_mode_constants";
15137  
15138          /**
15139           * Whether of not to send keycode sleep for ungaze when Home is the foreground activity on
15140           * watch type devices.
15141           * Type: int (0 for false, 1 for true)
15142           * Default: 1
15143           * @hide
15144           */
15145          @Readable
15146          public static final String UNGAZE_SLEEP_ENABLED = "ungaze_sleep_enabled";
15147  
15148          /**
15149           * Whether or not Network Watchlist feature is enabled.
15150           * Type: int (0 for false, 1 for true)
15151           * Default: 0
15152           * @hide
15153           */
15154          @Readable
15155          public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled";
15156  
15157          /**
15158           * Whether or not show hidden launcher icon apps feature is enabled.
15159           * Type: int (0 for false, 1 for true)
15160           * Default: 1
15161           * @hide
15162           */
15163          @Readable
15164          public static final String SHOW_HIDDEN_LAUNCHER_ICON_APPS_ENABLED =
15165                  "show_hidden_icon_apps_enabled";
15166  
15167          /**
15168           * Whether or not show new app installed notification is enabled.
15169           * Type: int (0 for false, 1 for true)
15170           * Default: 0
15171           * @hide
15172           */
15173          @Readable
15174          public static final String SHOW_NEW_APP_INSTALLED_NOTIFICATION_ENABLED =
15175                  "show_new_app_installed_notification_enabled";
15176  
15177          /**
15178           * Flag to keep background restricted profiles running after exiting. If disabled,
15179           * the restricted profile can be put into stopped state as soon as the user leaves it.
15180           * Type: int (0 for false, 1 for true)
15181           *
15182           * Overridden by the system based on device information. If null, the value specified
15183           * by {@code config_keepRestrictedProfilesInBackground} is used.
15184           *
15185           * @hide
15186           */
15187          @Readable
15188          public static final String KEEP_PROFILE_IN_BACKGROUND = "keep_profile_in_background";
15189  
15190          /**
15191           * The default time in ms within which a subsequent connection from an always allowed system
15192           * is allowed to reconnect without user interaction.
15193           *
15194           * @hide
15195           */
15196          public static final long DEFAULT_ADB_ALLOWED_CONNECTION_TIME = 604800000;
15197  
15198          /**
15199           * When the user first connects their device to a system a prompt is displayed to allow
15200           * the adb connection with an option to 'Always allow' connections from this system. If the
15201           * user selects this always allow option then the connection time is stored for the system.
15202           * This setting is the time in ms within which a subsequent connection from an always
15203           * allowed system is allowed to reconnect without user interaction.
15204           *
15205           * Type: long
15206           *
15207           * @hide
15208           */
15209          @Readable
15210          public static final String ADB_ALLOWED_CONNECTION_TIME =
15211                  "adb_allowed_connection_time";
15212  
15213          /**
15214           * Scaling factor for normal window animations.
15215           *
15216           * The value is a float. Setting to 0.0f will disable window animations.
15217           */
15218          @Readable
15219          public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
15220  
15221          /**
15222           * Setting to disable cross-window blurs. This includes window blur behind, (see
15223           *  {@link LayoutParams#setBlurBehindRadius}) and window background blur (see
15224           *  {@link Window#setBackgroundBlurRadius}).
15225           *
15226           * The value is a boolean (1 or 0).
15227           * @hide
15228           */
15229          @TestApi
15230          @Readable
15231          @SuppressLint("NoSettingsProvider")
15232          public static final String DISABLE_WINDOW_BLURS = "disable_window_blurs";
15233  
15234          /**
15235           * Scaling factor for activity transition animations.
15236           *
15237           * The value is a float. Setting to 0.0f will disable window animations.
15238           */
15239          @Readable
15240          public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
15241  
15242          /**
15243           * Scaling factor for Animator-based animations. This affects both the
15244           * start delay and duration of all such animations.
15245           *
15246           * The value is a float. Setting to 0.0f will cause animations to end immediately.
15247           * The default value is 1.0f.
15248           */
15249          @Readable
15250          public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
15251  
15252          /**
15253           * Scaling factor for normal window animations. Setting to 0 will
15254           * disable window animations.
15255           *
15256           * @hide
15257           */
15258          @Readable
15259          public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
15260  
15261          /**
15262           * If 0, the compatibility mode is off for all applications.
15263           * If 1, older applications run under compatibility mode.
15264           * TODO: remove this settings before code freeze (bug/1907571)
15265           * @hide
15266           */
15267          @Readable
15268          public static final String COMPATIBILITY_MODE = "compatibility_mode";
15269  
15270          /**
15271           * CDMA only settings
15272           * Emergency Tone  0 = Off
15273           *                 1 = Alert
15274           *                 2 = Vibrate
15275           * @hide
15276           */
15277          @Readable
15278          public static final String EMERGENCY_TONE = "emergency_tone";
15279  
15280          /**
15281           * CDMA only settings
15282           * Whether the auto retry is enabled. The value is
15283           * boolean (1 or 0).
15284           * @hide
15285           */
15286          @Readable
15287          public static final String CALL_AUTO_RETRY = "call_auto_retry";
15288  
15289          /**
15290           * A setting that can be read whether the emergency affordance is currently needed.
15291           * The value is a boolean (1 or 0).
15292           * @hide
15293           */
15294          @Readable
15295          public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed";
15296  
15297          /**
15298           * The power button "cooldown" period in milliseconds after the Emergency gesture is
15299           * triggered, during which single-key actions on the power button are suppressed. Cooldown
15300           * period is disabled if set to zero.
15301           *
15302           * @hide
15303           */
15304          public static final String EMERGENCY_GESTURE_POWER_BUTTON_COOLDOWN_PERIOD_MS =
15305                  "emergency_gesture_power_button_cooldown_period_ms";
15306  
15307          /**
15308           * The minimum time in milliseconds to perform the emergency gesture.
15309           *
15310           * @hide
15311           */
15312          public static final String EMERGENCY_GESTURE_TAP_DETECTION_MIN_TIME_MS =
15313                  "emergency_gesture_tap_detection_min_time_ms";
15314  
15315          /**
15316           * The maximum duration in milliseconds for which the emergency gesture UI can stay
15317           * "sticky", where the notification pull-down shade and navigation gestures/buttons are
15318           *  temporarily disabled. The feature is disabled completely if the value is set to zero.
15319           *
15320           * @hide
15321           */
15322          public static final String EMERGENCY_GESTURE_STICKY_UI_MAX_DURATION_MILLIS =
15323                  "emergency_gesture_sticky_ui_max_duration_millis";
15324  
15325          /**
15326           * Whether to enable automatic system server heap dumps. This only works on userdebug or
15327           * eng builds, not on user builds. This is set by the user and overrides the config value.
15328           * 1 means enable, 0 means disable.
15329           *
15330           * @hide
15331           */
15332          @Readable
15333          public static final String ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS =
15334                  "enable_automatic_system_server_heap_dumps";
15335  
15336          /**
15337           * See RIL_PreferredNetworkType in ril.h
15338           * @hide
15339           */
15340          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
15341          @Readable
15342          public static final String PREFERRED_NETWORK_MODE =
15343                  "preferred_network_mode";
15344  
15345          /**
15346           * Name of an application package to be debugged.
15347           */
15348          @Readable
15349          public static final String DEBUG_APP = "debug_app";
15350  
15351          /**
15352           * If 1, when launching DEBUG_APP it will wait for the debugger before
15353           * starting user code.  If 0, it will run normally.
15354           */
15355          @Readable
15356          public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
15357  
15358          /**
15359           * Allow GPU debug layers?
15360           * 0 = no
15361           * 1 = yes
15362           * @hide
15363           */
15364          @Readable
15365          public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers";
15366  
15367          /**
15368           * App allowed to load GPU debug layers
15369           * @hide
15370           */
15371          @Readable
15372          public static final String GPU_DEBUG_APP = "gpu_debug_app";
15373  
15374          /**
15375           * Package containing ANGLE libraries other than system, which are only available
15376           * to dumpable apps that opt-in.
15377           * @hide
15378           */
15379          @Readable
15380          public static final String ANGLE_DEBUG_PACKAGE = "angle_debug_package";
15381  
15382          /**
15383           * Force all PKGs to use ANGLE, regardless of any other settings
15384           * The value is a boolean (1 or 0).
15385           * @hide
15386           */
15387          @Readable
15388          public static final String ANGLE_GL_DRIVER_ALL_ANGLE = "angle_gl_driver_all_angle";
15389  
15390          /**
15391           * List of PKGs that have an OpenGL driver selected
15392           * @hide
15393           */
15394          @Readable
15395          public static final String ANGLE_GL_DRIVER_SELECTION_PKGS =
15396                  "angle_gl_driver_selection_pkgs";
15397  
15398          /**
15399           * List of selected OpenGL drivers, corresponding to the PKGs in GLOBAL_SETTINGS_DRIVER_PKGS
15400           * @hide
15401           */
15402          @Readable
15403          public static final String ANGLE_GL_DRIVER_SELECTION_VALUES =
15404                  "angle_gl_driver_selection_values";
15405  
15406          /**
15407           * Lists of ANGLE EGL features for debugging.
15408           * Each list of features is separated by a comma, each feature in each list is separated by
15409           * a colon.
15410           * e.g. feature1:feature2:feature3,feature1:feature3:feature5
15411           * @hide
15412           */
15413          @Readable
15414          public static final String ANGLE_EGL_FEATURES = "angle_egl_features";
15415  
15416          /**
15417           * Show the "ANGLE In Use" dialog box to the user when ANGLE is the OpenGL driver.
15418           * The value is a boolean (1 or 0).
15419           * @hide
15420           */
15421          @Readable
15422          public static final String SHOW_ANGLE_IN_USE_DIALOG_BOX = "show_angle_in_use_dialog_box";
15423  
15424          /**
15425           * Updatable driver global preference for all Apps.
15426           * 0 = Default
15427           * 1 = All Apps use updatable production driver
15428           * 2 = All apps use updatable prerelease driver
15429           * 3 = All Apps use system graphics driver
15430           * @hide
15431           */
15432          @Readable
15433          public static final String UPDATABLE_DRIVER_ALL_APPS = "updatable_driver_all_apps";
15434  
15435          /**
15436           * List of Apps selected to use updatable production driver.
15437           * i.e. <pkg1>,<pkg2>,...,<pkgN>
15438           * @hide
15439           */
15440          @Readable
15441          public static final String UPDATABLE_DRIVER_PRODUCTION_OPT_IN_APPS =
15442                  "updatable_driver_production_opt_in_apps";
15443  
15444          /**
15445           * List of Apps selected to use updatable prerelease driver.
15446           * i.e. <pkg1>,<pkg2>,...,<pkgN>
15447           * @hide
15448           */
15449          @Readable
15450          public static final String UPDATABLE_DRIVER_PRERELEASE_OPT_IN_APPS =
15451                  "updatable_driver_prerelease_opt_in_apps";
15452  
15453          /**
15454           * List of Apps selected not to use updatable production driver.
15455           * i.e. <pkg1>,<pkg2>,...,<pkgN>
15456           * @hide
15457           */
15458          @Readable
15459          public static final String UPDATABLE_DRIVER_PRODUCTION_OPT_OUT_APPS =
15460                  "updatable_driver_production_opt_out_apps";
15461  
15462          /**
15463           * Apps on the denylist that are forbidden to use updatable production driver.
15464           * @hide
15465           */
15466          @Readable
15467          public static final String UPDATABLE_DRIVER_PRODUCTION_DENYLIST =
15468                  "updatable_driver_production_denylist";
15469  
15470          /**
15471           * List of denylists, each denylist is a denylist for a specific version of
15472           * updatable production driver.
15473           * @hide
15474           */
15475          @Readable
15476          public static final String UPDATABLE_DRIVER_PRODUCTION_DENYLISTS =
15477                  "updatable_driver_production_denylists";
15478  
15479          /**
15480           * Apps on the allowlist that are allowed to use updatable production driver.
15481           * The string is a list of application package names, seperated by comma.
15482           * i.e. <apk1>,<apk2>,...,<apkN>
15483           * @hide
15484           */
15485          @Readable
15486          public static final String UPDATABLE_DRIVER_PRODUCTION_ALLOWLIST =
15487                  "updatable_driver_production_allowlist";
15488  
15489          /**
15490           * List of libraries in sphal accessible by updatable driver
15491           * The string is a list of library names, separated by colon.
15492           * i.e. <lib1>:<lib2>:...:<libN>
15493           * @hide
15494           */
15495          @Readable
15496          public static final String UPDATABLE_DRIVER_SPHAL_LIBRARIES =
15497                  "updatable_driver_sphal_libraries";
15498  
15499          /**
15500           * Ordered GPU debug layer list for Vulkan
15501           * i.e. <layer1>:<layer2>:...:<layerN>
15502           * @hide
15503           */
15504          @Readable
15505          public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers";
15506  
15507          /**
15508           * Ordered GPU debug layer list for GLES
15509           * i.e. <layer1>:<layer2>:...:<layerN>
15510           * @hide
15511           */
15512          @Readable
15513          public static final String GPU_DEBUG_LAYERS_GLES = "gpu_debug_layers_gles";
15514  
15515          /**
15516           * Addition app for GPU layer discovery
15517           * @hide
15518           */
15519          @Readable
15520          public static final String GPU_DEBUG_LAYER_APP = "gpu_debug_layer_app";
15521  
15522          /**
15523           * Control whether the process CPU usage meter should be shown.
15524           *
15525           * @deprecated This functionality is no longer available as of
15526           * {@link android.os.Build.VERSION_CODES#N_MR1}.
15527           */
15528          @Deprecated
15529          @Readable
15530          public static final String SHOW_PROCESSES = "show_processes";
15531  
15532          /**
15533           * If 1 low power mode (aka battery saver) is enabled.
15534           * @hide
15535           */
15536          @TestApi
15537          @Readable
15538          public static final String LOW_POWER_MODE = "low_power";
15539  
15540          /**
15541           * If 1 extra low power mode is enabled.
15542           * @hide
15543           */
15544          public static final String EXTRA_LOW_POWER_MODE = "extra_low_power";
15545  
15546          /**
15547           * If 1, battery saver ({@link #LOW_POWER_MODE}) will be re-activated after the device
15548           * is unplugged from a charger or rebooted.
15549           * @hide
15550           */
15551          @TestApi
15552          @Readable
15553          public static final String LOW_POWER_MODE_STICKY = "low_power_sticky";
15554  
15555          /**
15556           * When a device is unplugged from a changer (or is rebooted), do not re-activate battery
15557           * saver even if {@link #LOW_POWER_MODE_STICKY} is 1, if the battery level is equal to or
15558           * above this threshold.
15559           *
15560           * @hide
15561           */
15562          @Readable
15563          public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL =
15564                  "low_power_sticky_auto_disable_level";
15565  
15566          /**
15567           * Whether sticky battery saver should be deactivated once the battery level has reached the
15568           * threshold specified by {@link #LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL}.
15569           *
15570           * @hide
15571           */
15572          @Readable
15573          public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED =
15574                  "low_power_sticky_auto_disable_enabled";
15575  
15576          /**
15577           * Battery level [1-100] at which low power mode automatically turns on.
15578           * If 0, it will not automatically turn on. For Q and newer, it will only automatically
15579           * turn on if the value is greater than 0 and the {@link #AUTOMATIC_POWER_SAVE_MODE}
15580           * setting is also set to
15581           * {@link android.os.PowerManager.AutoPowerSaveMode#POWER_SAVE_MODE_TRIGGER_PERCENTAGE}.
15582           * @see #AUTOMATIC_POWER_SAVE_MODE
15583           * @see android.os.PowerManager#getPowerSaveModeTrigger()
15584           * @hide
15585           */
15586          @Readable
15587          public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
15588  
15589          /**
15590           * Whether battery saver is currently set to trigger based on percentage, dynamic power
15591           * savings trigger, or none. See {@link AutoPowerSaveModeTriggers} for
15592           * accepted values.
15593           *
15594           *  @hide
15595           */
15596          @TestApi
15597          @Readable
15598          public static final String AUTOMATIC_POWER_SAVE_MODE = "automatic_power_save_mode";
15599  
15600          /**
15601           * The setting that backs the disable threshold for the setPowerSavingsWarning api in
15602           * PowerManager
15603           *
15604           * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int)
15605           * @hide
15606           */
15607          @TestApi
15608          @Readable
15609          public static final String DYNAMIC_POWER_SAVINGS_DISABLE_THRESHOLD =
15610                  "dynamic_power_savings_disable_threshold";
15611  
15612          /**
15613           * The setting which backs the setDynamicPowerSaveHint api in PowerManager.
15614           *
15615           * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int)
15616           * @hide
15617           */
15618          @TestApi
15619          @Readable
15620          public static final String DYNAMIC_POWER_SAVINGS_ENABLED = "dynamic_power_savings_enabled";
15621  
15622          /**
15623           * A long value indicating how much longer the system battery is estimated to last in
15624           * millis. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value
15625           * was updated.
15626           *
15627           * @deprecated Use {@link PowerManager#getBatteryDischargePrediction()} instead.
15628           * @hide
15629           */
15630          @Deprecated
15631          @Readable
15632          public static final String TIME_REMAINING_ESTIMATE_MILLIS =
15633                  "time_remaining_estimate_millis";
15634  
15635          /**
15636           * A boolean indicating whether {@link #TIME_REMAINING_ESTIMATE_MILLIS} is customized
15637           * to the device's usage or using global models. See
15638           * {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value was updated.
15639           *
15640           * @deprecated Use {@link PowerManager#isBatteryDischargePredictionPersonalized()} instead.
15641           *
15642           * @hide
15643           */
15644          @Deprecated
15645          @Readable
15646          public static final String TIME_REMAINING_ESTIMATE_BASED_ON_USAGE =
15647                  "time_remaining_estimate_based_on_usage";
15648  
15649          /**
15650           * A long value indicating how long the system battery takes to deplete from 100% to 0% on
15651           * average based on historical drain rates. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME}
15652           * for the last time this value was updated.
15653           *
15654           * @deprecated Use {@link PowerManager#getHistoricalDischargeTime()} instead.
15655           * @hide
15656           */
15657          @Deprecated
15658          @Readable
15659          public static final String AVERAGE_TIME_TO_DISCHARGE = "average_time_to_discharge";
15660  
15661          /**
15662           * A long indicating the epoch time in milliseconds when
15663           * {@link #TIME_REMAINING_ESTIMATE_MILLIS}, {@link #TIME_REMAINING_ESTIMATE_BASED_ON_USAGE},
15664           * and {@link #AVERAGE_TIME_TO_DISCHARGE} were last updated.
15665           *
15666           * @hide
15667           * @deprecated No longer needed due to {@link PowerManager#getBatteryDischargePrediction}.
15668           */
15669          @Deprecated
15670          @Readable
15671          public static final String BATTERY_ESTIMATES_LAST_UPDATE_TIME =
15672                  "battery_estimates_last_update_time";
15673  
15674          /**
15675           * The max value for {@link #LOW_POWER_MODE_TRIGGER_LEVEL}. If this setting is not set
15676           * or the value is 0, the default max will be used.
15677           *
15678           * @hide
15679           */
15680          @Readable
15681          public static final String LOW_POWER_MODE_TRIGGER_LEVEL_MAX = "low_power_trigger_level_max";
15682  
15683          /**
15684           * See com.android.settingslib.fuelgauge.BatterySaverUtils.
15685           * @hide
15686           */
15687          @Readable
15688          public static final String LOW_POWER_MODE_SUGGESTION_PARAMS =
15689                  "low_power_mode_suggestion_params";
15690  
15691          /**
15692           * Whether low power mode reminder is enabled. If this value is 0, the device will not
15693           * receive low power notification.
15694           *
15695           * @hide
15696           */
15697          public static final String LOW_POWER_MODE_REMINDER_ENABLED =
15698                  "low_power_mode_reminder_enabled";
15699  
15700          /**
15701           * If not 0, the activity manager will aggressively finish activities and
15702           * processes as soon as they are no longer needed.  If 0, the normal
15703           * extended lifetime is used.
15704           */
15705          @Readable
15706          public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
15707  
15708          /**
15709           * If nonzero, all system error dialogs will be hidden.  For example, the
15710           * crash and ANR dialogs will not be shown, and the system will just proceed
15711           * as if they had been accepted by the user.
15712           * @hide
15713           */
15714          @TestApi
15715          @Readable
15716          public static final String HIDE_ERROR_DIALOGS = "hide_error_dialogs";
15717  
15718          /**
15719           * Use Dock audio output for media:
15720           *      0 = disabled
15721           *      1 = enabled
15722           * @hide
15723           */
15724          @Readable
15725          public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
15726  
15727          /**
15728           * The surround sound formats AC3, DTS or IEC61937 are
15729           * available for use if they are detected.
15730           * This is the default mode.
15731           *
15732           * Note that AUTO is equivalent to ALWAYS for Android TVs and other
15733           * devices that have an S/PDIF output. This is because S/PDIF
15734           * is unidirectional and the TV cannot know if a decoder is
15735           * connected. So it assumes they are always available.
15736           * @hide
15737           */
15738           public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0;
15739  
15740          /**
15741           * AC3, DTS or IEC61937 are NEVER available, even if they
15742           * are detected by the hardware. Those formats will not be
15743           * reported.
15744           *
15745           * An example use case would be an AVR reports that it is capable of
15746           * surround sound decoding but is broken. If NEVER is chosen
15747           * then apps must use PCM output instead of encoded output.
15748           * @hide
15749           */
15750           public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1;
15751  
15752          /**
15753           * AC3, DTS or IEC61937 are ALWAYS available, even if they
15754           * are not detected by the hardware. Those formats will be
15755           * reported as part of the HDMI output capability. Applications
15756           * are then free to use either PCM or encoded output.
15757           *
15758           * An example use case would be a when TV was connected over
15759           * TOS-link to an AVR. But the TV could not see it because TOS-link
15760           * is unidirectional.
15761           * @hide
15762           */
15763           public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2;
15764  
15765          /**
15766           * Surround sound formats are available according to the choice
15767           * of user, even if they are not detected by the hardware. Those
15768           * formats will be reported as part of the HDMI output capability.
15769           * Applications are then free to use either PCM or encoded output.
15770           *
15771           * An example use case would be an AVR that doesn't report a surround
15772           * format while the user knows the AVR does support it.
15773           * @hide
15774           */
15775          public static final int ENCODED_SURROUND_OUTPUT_MANUAL = 3;
15776  
15777          /**
15778           * The maximum value for surround sound output mode in Android S.
15779           * @hide
15780           */
15781          public static final int ENCODED_SURROUND_SC_MAX = ENCODED_SURROUND_OUTPUT_MANUAL;
15782  
15783          /**
15784           * Set to ENCODED_SURROUND_OUTPUT_AUTO,
15785           * ENCODED_SURROUND_OUTPUT_NEVER,
15786           * ENCODED_SURROUND_OUTPUT_ALWAYS or
15787           * ENCODED_SURROUND_OUTPUT_MANUAL
15788           * @hide
15789           */
15790          @Readable
15791          public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output";
15792  
15793          /**
15794           * Surround sounds formats that are enabled when ENCODED_SURROUND_OUTPUT is set to
15795           * ENCODED_SURROUND_OUTPUT_MANUAL. Encoded as comma separated list. Allowed values
15796           * are the format constants defined in AudioFormat.java. Ex:
15797           *
15798           * "5,6"
15799           *
15800           * @hide
15801           */
15802          @Readable
15803          public static final String ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS =
15804                  "encoded_surround_output_enabled_formats";
15805  
15806          /**
15807           * Persisted safe headphone volume management state by AudioService
15808           * @hide
15809           */
15810          @Readable
15811          public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
15812  
15813          /**
15814           * Persisted safe hearding current CSD value. Values are stored as float percentages where
15815           * 1.f represents 100% sound dose has been reached.
15816           * @hide
15817           */
15818          public static final String AUDIO_SAFE_CSD_CURRENT_VALUE = "audio_safe_csd_current_value";
15819  
15820          /**
15821           * Persisted safe hearding next CSD warning value. Values are stored as float percentages.
15822           * @hide
15823           */
15824          public static final String AUDIO_SAFE_CSD_NEXT_WARNING = "audio_safe_csd_next_warning";
15825  
15826          /**
15827           * Persisted safe hearding dose records (see {@link android.media.SoundDoseRecord})
15828           * @hide
15829           */
15830          public static final String AUDIO_SAFE_CSD_DOSE_RECORDS = "audio_safe_csd_dose_records";
15831  
15832          /**
15833           * URL for tzinfo (time zone) updates
15834           * @hide
15835           */
15836          @Readable
15837          public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
15838  
15839          /**
15840           * URL for tzinfo (time zone) update metadata
15841           * @hide
15842           */
15843          @Readable
15844          public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
15845  
15846          /**
15847           * URL for selinux (mandatory access control) updates
15848           * @hide
15849           */
15850          @Readable
15851          public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
15852  
15853          /**
15854           * URL for selinux (mandatory access control) update metadata
15855           * @hide
15856           */
15857          @Readable
15858          public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
15859  
15860          /**
15861           * URL for sms short code updates
15862           * @hide
15863           */
15864          @Readable
15865          public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
15866                  "sms_short_codes_content_url";
15867  
15868          /**
15869           * URL for sms short code update metadata
15870           * @hide
15871           */
15872          @Readable
15873          public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
15874                  "sms_short_codes_metadata_url";
15875  
15876          /**
15877           * URL for apn_db updates
15878           * @hide
15879           */
15880          @Readable
15881          public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url";
15882  
15883          /**
15884           * URL for apn_db update metadata
15885           * @hide
15886           */
15887          @Readable
15888          public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url";
15889  
15890          /**
15891           * URL for cert pinlist updates
15892           * @hide
15893           */
15894          @Readable
15895          public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
15896  
15897          /**
15898           * URL for cert pinlist updates
15899           * @hide
15900           */
15901          @Readable
15902          public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
15903  
15904          /**
15905           * URL for intent firewall updates
15906           * @hide
15907           */
15908          @Readable
15909          public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
15910                  "intent_firewall_content_url";
15911  
15912          /**
15913           * URL for intent firewall update metadata
15914           * @hide
15915           */
15916          @Readable
15917          public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
15918                  "intent_firewall_metadata_url";
15919  
15920          /**
15921           * URL for lang id model updates
15922           * @hide
15923           */
15924          @Readable
15925          public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url";
15926  
15927          /**
15928           * URL for lang id model update metadata
15929           * @hide
15930           */
15931          @Readable
15932          public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url";
15933  
15934          /**
15935           * URL for smart selection model updates
15936           * @hide
15937           */
15938          @Readable
15939          public static final String SMART_SELECTION_UPDATE_CONTENT_URL =
15940                  "smart_selection_content_url";
15941  
15942          /**
15943           * URL for smart selection model update metadata
15944           * @hide
15945           */
15946          @Readable
15947          public static final String SMART_SELECTION_UPDATE_METADATA_URL =
15948                  "smart_selection_metadata_url";
15949  
15950          /**
15951           * URL for conversation actions model updates
15952           * @hide
15953           */
15954          @Readable
15955          public static final String CONVERSATION_ACTIONS_UPDATE_CONTENT_URL =
15956                  "conversation_actions_content_url";
15957  
15958          /**
15959           * URL for conversation actions model update metadata
15960           * @hide
15961           */
15962          @Readable
15963          public static final String CONVERSATION_ACTIONS_UPDATE_METADATA_URL =
15964                  "conversation_actions_metadata_url";
15965  
15966          /**
15967           * SELinux enforcement status. If 0, permissive; if 1, enforcing.
15968           * @hide
15969           */
15970          @Readable
15971          public static final String SELINUX_STATUS = "selinux_status";
15972  
15973          /**
15974           * Developer setting to force RTL layout.
15975           * @hide
15976           */
15977          @Readable
15978          public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
15979  
15980          /**
15981           * Milliseconds after screen-off after which low battery sounds will be silenced.
15982           *
15983           * If zero, battery sounds will always play.
15984           * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
15985           *
15986           * @hide
15987           */
15988          @Readable
15989          public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
15990  
15991          /**
15992           * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
15993           * the caller is done with this, they should call {@link ContentResolver#delete} to
15994           * clean up any value that they may have written.
15995           *
15996           * @hide
15997           */
15998          @Readable
15999          public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
16000  
16001          /**
16002           * Defines global runtime overrides to window policy.
16003           *
16004           * See {@link com.android.server.wm.PolicyControl} for value format.
16005           *
16006           * @hide
16007           */
16008          @Readable
16009          public static final String POLICY_CONTROL = "policy_control";
16010  
16011          /**
16012           * {@link android.view.DisplayCutout DisplayCutout} emulation mode.
16013           *
16014           * @hide
16015           */
16016          @Readable
16017          public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout";
16018  
16019          /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0;
16020          /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1;
16021  
16022          /**
16023           * A colon separated list of keys for Settings Slices.
16024           *
16025           * @hide
16026           */
16027          @Readable
16028          public static final String BLOCKED_SLICES = "blocked_slices";
16029  
16030          /**
16031           * Defines global zen mode.  ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
16032           * or ZEN_MODE_NO_INTERRUPTIONS.
16033           *
16034           * @hide
16035           */
16036          @UnsupportedAppUsage
16037          @Readable
16038          public static final String ZEN_MODE = "zen_mode";
16039  
16040          /** @hide */
16041          @UnsupportedAppUsage
16042          public static final int ZEN_MODE_OFF = 0;
16043          /** @hide */
16044          @UnsupportedAppUsage
16045          public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
16046          /** @hide */
16047          @UnsupportedAppUsage
16048          public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
16049          /** @hide */
16050          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
16051          public static final int ZEN_MODE_ALARMS = 3;
16052  
16053          /**
16054           * A comma-separated list of HDR formats that have been disabled by the user.
16055           * <p>
16056           * If present, these formats will not be reported to apps, even if the display supports
16057           * them. This list is treated as empty if the ARE_USER_DISABLED_HDR_FORMATS_ALLOWED setting
16058           * is '1'.
16059           * </p>
16060           * @hide
16061           */
16062          @TestApi
16063          @Readable
16064          @SuppressLint("NoSettingsProvider")
16065          public static final String USER_DISABLED_HDR_FORMATS = "user_disabled_hdr_formats";
16066  
16067          /**
16068           * Whether or not user-disabled HDR formats are allowed.
16069           * <p>
16070           * The value is boolean (1 or 0). The value '1' means the user preference for disabling a
16071           * format is ignored, and the disabled formats are still reported to apps (if supported
16072           * by the display). The value '0' means the user-disabled formats are not reported to
16073           * apps, even if the display supports them.
16074           * </p><p>
16075           * The list of formats disabled by the user are contained in the
16076           * USER_DISABLED_HDR_FORMATS setting. This list is treated as empty when the value of
16077           * this setting is '1'.
16078           * </p>
16079           * @hide
16080           */
16081          @TestApi
16082          @Readable
16083          @SuppressLint("NoSettingsProvider")
16084          public static final String ARE_USER_DISABLED_HDR_FORMATS_ALLOWED =
16085                  "are_user_disabled_hdr_formats_allowed";
16086  
16087          /**
16088           * Whether or not syncs (bulk set operations) for {@link DeviceConfig} are currently
16089           * persistently disabled. This is only used for the {@link
16090           * Config#SYNC_DISABLED_MODE_PERSISTENT persistent} mode, {@link
16091           * Config#SYNC_DISABLED_MODE_UNTIL_REBOOT until_reboot} mode is not stored in settings.
16092           * The value is boolean (1 or 0). The value '1' means that {@link
16093           * DeviceConfig#setProperties(DeviceConfig.Properties)} will return {@code false}.
16094           *
16095           * @hide
16096           */
16097          public static final String DEVICE_CONFIG_SYNC_DISABLED = "device_config_sync_disabled";
16098  
16099  
16100          /**
16101           * Whether back preview animations are played when user does a back gesture or presses
16102           * the back button.
16103           * @hide
16104           */
16105          public static final String ENABLE_BACK_ANIMATION = "enable_back_animation";
16106  
zenModeToString(int mode)16107          /** @hide */ public static String zenModeToString(int mode) {
16108              if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
16109              if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
16110              if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
16111              return "ZEN_MODE_OFF";
16112          }
16113  
isValidZenMode(int value)16114          /** @hide */ public static boolean isValidZenMode(int value) {
16115              switch (value) {
16116                  case Global.ZEN_MODE_OFF:
16117                  case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
16118                  case Global.ZEN_MODE_ALARMS:
16119                  case Global.ZEN_MODE_NO_INTERRUPTIONS:
16120                      return true;
16121                  default:
16122                      return false;
16123              }
16124          }
16125  
16126          /**
16127           * Value of the ringer before entering zen mode.
16128           *
16129           * @hide
16130           */
16131          @Readable
16132          public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level";
16133  
16134          /**
16135           * Opaque value, changes when persisted zen mode configuration changes.
16136           *
16137           * @hide
16138           */
16139          @UnsupportedAppUsage
16140          @Readable
16141          public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
16142  
16143          /**
16144           * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION} instead
16145           * @hide
16146           */
16147          @Deprecated
16148          public static final String ZEN_DURATION = "zen_duration";
16149  
16150          /**
16151           * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_PROMPT} instead
16152           * @hide
16153           */
16154          @Deprecated
16155          public static final int ZEN_DURATION_PROMPT = -1;
16156  
16157          /**
16158           * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_FOREVER} instead
16159           * @hide
16160           */
16161          @Deprecated
16162          public static final int ZEN_DURATION_FOREVER = 0;
16163  
16164          /**
16165           * Defines global heads up toggle.  One of HEADS_UP_OFF, HEADS_UP_ON.
16166           *
16167           * @hide
16168           */
16169          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
16170          @Readable
16171          public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
16172                  "heads_up_notifications_enabled";
16173  
16174          /** @hide */
16175          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
16176          public static final int HEADS_UP_OFF = 0;
16177          /** @hide */
16178          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
16179          public static final int HEADS_UP_ON = 1;
16180  
16181          /**
16182           * The refresh rate chosen by the user.
16183           *
16184           * @hide
16185           */
16186          @TestApi
16187          @Readable
16188          @SuppressLint("NoSettingsProvider")
16189          public static final String USER_PREFERRED_REFRESH_RATE = "user_preferred_refresh_rate";
16190  
16191          /**
16192           * The resolution height chosen by the user.
16193           *
16194           * @hide
16195           */
16196          @TestApi
16197          @Readable
16198          @SuppressLint("NoSettingsProvider")
16199          public static final String USER_PREFERRED_RESOLUTION_HEIGHT =
16200                  "user_preferred_resolution_height";
16201  
16202          /**
16203           * The resolution width chosen by the user.
16204           *
16205           * @hide
16206           */
16207          @TestApi
16208          @Readable
16209          @SuppressLint("NoSettingsProvider")
16210          public static final String USER_PREFERRED_RESOLUTION_WIDTH =
16211                  "user_preferred_resolution_width";
16212  
16213          /**
16214           * The HDR output mode chosen by the user. This is one of:
16215           * {@link android.hardware.display.HdrConversionMode#HDR_CONVERSION_PASSTHROUGH},
16216           * {@link android.hardware.display.HdrConversionMode#HDR_CONVERSION_SYSTEM},
16217           * {@link android.hardware.display.HdrConversionMode#HDR_CONVERSION_FORCE}.
16218           *
16219           * @hide
16220           */
16221          @TestApi
16222          @Readable
16223          public static final String HDR_CONVERSION_MODE = "hdr_conversion_mode";
16224  
16225          /**
16226           * The output HDR type chosen by the user in case when {@link #HDR_CONVERSION_MODE} is
16227           * {@link #HDR_CONVERSION_FORCE}. This is one of:
16228           * {@link android.view.Display.HdrCapabilities#HDR_TYPE_INVALID},
16229           * {@link android.view.Display.HdrCapabilities#HDR_TYPE_DOLBY_VISION},
16230           * {@link android.view.Display.HdrCapabilities#HDR_TYPE_HDR10},
16231           * {@link android.view.Display.HdrCapabilities#HDR_TYPE_HLG},
16232           * {@link android.view.Display.HdrCapabilities#HDR_TYPE_HDR10_PLUS}
16233           * <p>
16234           * The value is {@link android.view.Display.HdrCapabilities#HDR_TYPE_INVALID} when user
16235           * chooses SDR output type. </p>
16236           *
16237           * @hide
16238           */
16239          @TestApi
16240          @Readable
16241          public static final String HDR_FORCE_CONVERSION_TYPE = "hdr_force_conversion_type";
16242  
16243          /**
16244           * The name of the device
16245           */
16246          @Readable
16247          public static final String DEVICE_NAME = "device_name";
16248  
16249          /**
16250           * Whether the NetworkScoringService has been first initialized.
16251           * <p>
16252           * Type: int (0 for false, 1 for true)
16253           * @hide
16254           */
16255          @Readable
16256          public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
16257  
16258          /**
16259           * On devices that use full-disk encryption, indicates whether the primary user's lockscreen
16260           * credential is required to decrypt the device on boot.
16261           * <p>
16262           * This setting does not do anything on devices that use file-based encryption.  With
16263           * file-based encryption, the device boots without a credential being needed, but the
16264           * lockscreen credential is required to unlock credential-encrypted storage.  All devices
16265           * that launched with Android 10 or higher use file-based encryption.
16266           * <p>
16267           * Type: int (0 for false, 1 for true)
16268           *
16269           * @hide
16270           */
16271          @SystemApi
16272          @Readable
16273          public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
16274  
16275          /**
16276           * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config
16277           * value
16278           * {@link android.telephony.CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL}.
16279           * <p>
16280           * Type: int (0 for false, 1 for true)
16281           * @hide
16282           * @deprecated Use
16283           * {@link android.provider.Telephony.SimInfo#COLUMN_ENHANCED_4G_MODE_ENABLED} instead.
16284           */
16285          @Deprecated
16286          @Readable
16287          public static final String ENHANCED_4G_MODE_ENABLED =
16288                  Telephony.SimInfo.COLUMN_ENHANCED_4G_MODE_ENABLED;
16289  
16290          /**
16291           * Whether VT (Video Telephony over IMS) is enabled
16292           * <p>
16293           * Type: int (0 for false, 1 for true)
16294           *
16295           * @hide
16296           * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_VT_IMS_ENABLED} instead.
16297           */
16298          @Deprecated
16299          @Readable
16300          public static final String VT_IMS_ENABLED = Telephony.SimInfo.COLUMN_VT_IMS_ENABLED;
16301  
16302          /**
16303           * Whether WFC is enabled
16304           * <p>
16305           * Type: int (0 for false, 1 for true)
16306           *
16307           * @hide
16308           * @deprecated Use
16309           * {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ENABLED} instead.
16310           */
16311          @Deprecated
16312          @Readable
16313          public static final String WFC_IMS_ENABLED = Telephony.SimInfo.COLUMN_WFC_IMS_ENABLED;
16314  
16315          /**
16316           * WFC mode on home/non-roaming network.
16317           * <p>
16318           * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
16319           *
16320           * @hide
16321           * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_MODE} instead.
16322           */
16323          @Deprecated
16324          @Readable
16325          public static final String WFC_IMS_MODE = Telephony.SimInfo.COLUMN_WFC_IMS_MODE;
16326  
16327          /**
16328           * WFC mode on roaming network.
16329           * <p>
16330           * Type: int - see {@link #WFC_IMS_MODE} for values
16331           *
16332           * @hide
16333           * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ROAMING_MODE}
16334           * instead.
16335           */
16336          @Deprecated
16337          @Readable
16338          public static final String WFC_IMS_ROAMING_MODE =
16339                  Telephony.SimInfo.COLUMN_WFC_IMS_ROAMING_MODE;
16340  
16341          /**
16342           * Whether WFC roaming is enabled
16343           * <p>
16344           * Type: int (0 for false, 1 for true)
16345           *
16346           * @hide
16347           * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ROAMING_ENABLED}
16348           * instead
16349           */
16350          @Deprecated
16351          @Readable
16352          public static final String WFC_IMS_ROAMING_ENABLED =
16353                  Telephony.SimInfo.COLUMN_WFC_IMS_ROAMING_ENABLED;
16354  
16355          /**
16356           * Whether user can enable/disable LTE as a preferred network. A carrier might control
16357           * this via gservices, OMA-DM, carrier app, etc.
16358           * <p>
16359           * Type: int (0 for false, 1 for true)
16360           * @hide
16361           */
16362          @Readable
16363          public static final String LTE_SERVICE_FORCED = "lte_service_forced";
16364  
16365  
16366          /**
16367           * Specifies the behaviour the lid triggers when closed
16368           * <p>
16369           * See WindowManagerPolicy.WindowManagerFuncs
16370           * @hide
16371           */
16372          @Readable
16373          public static final String LID_BEHAVIOR = "lid_behavior";
16374  
16375          /**
16376           * Ephemeral app cookie max size in bytes.
16377           * <p>
16378           * Type: int
16379           * @hide
16380           */
16381          @Readable
16382          public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES =
16383                  "ephemeral_cookie_max_size_bytes";
16384  
16385          /**
16386           * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is
16387           * enabled. Set to zero to disable.
16388           * <p>
16389           * Type: int (0 for false, 1 for true)
16390           *
16391           * @hide
16392           */
16393          @Readable
16394          public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature";
16395  
16396          /**
16397           * Toggle to enable/disable dexopt for instant applications. The default is for dexopt
16398           * to be disabled.
16399           * <p>
16400           * Type: int (0 to disable, 1 to enable)
16401           *
16402           * @hide
16403           */
16404          @Readable
16405          public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled";
16406  
16407          /**
16408           * The min period for caching installed instant apps in milliseconds.
16409           * <p>
16410           * Type: long
16411           * @hide
16412           */
16413          @Readable
16414          public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
16415                  "installed_instant_app_min_cache_period";
16416  
16417          /**
16418           * The max period for caching installed instant apps in milliseconds.
16419           * <p>
16420           * Type: long
16421           * @hide
16422           */
16423          @Readable
16424          public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
16425                  "installed_instant_app_max_cache_period";
16426  
16427          /**
16428           * The min period for caching uninstalled instant apps in milliseconds.
16429           * <p>
16430           * Type: long
16431           * @hide
16432           */
16433          @Readable
16434          public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD =
16435                  "uninstalled_instant_app_min_cache_period";
16436  
16437          /**
16438           * The max period for caching uninstalled instant apps in milliseconds.
16439           * <p>
16440           * Type: long
16441           * @hide
16442           */
16443          @Readable
16444          public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD =
16445                  "uninstalled_instant_app_max_cache_period";
16446  
16447          /**
16448           * The min period for caching unused static shared libs in milliseconds.
16449           * <p>
16450           * Type: long
16451           * @hide
16452           */
16453          @Readable
16454          public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD =
16455                  "unused_static_shared_lib_min_cache_period";
16456  
16457          /**
16458           * Allows switching users when system user is locked.
16459           * <p>
16460           * Type: int
16461           * @hide
16462           */
16463          @Readable
16464          public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED =
16465                  "allow_user_switching_when_system_user_locked";
16466  
16467          /**
16468           * Boot count since the device starts running API level 24.
16469           * <p>
16470           * Type: int
16471           */
16472          @Readable
16473          public static final String BOOT_COUNT = "boot_count";
16474  
16475          /**
16476           * Whether the safe boot is disallowed.
16477           *
16478           * <p>This setting should have the identical value as the corresponding user restriction.
16479           * The purpose of the setting is to make the restriction available in early boot stages
16480           * before the user restrictions are loaded.
16481           * @hide
16482           */
16483          @Readable
16484          public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed";
16485  
16486          /**
16487           * Indicates whether this device is currently in retail demo mode. If true, the device
16488           * usage is severely limited.
16489           * <p>
16490           * Type: int (0 for false, 1 for true)
16491           *
16492           * @hide
16493           */
16494          @SystemApi
16495          @Readable
16496          public static final String DEVICE_DEMO_MODE = "device_demo_mode";
16497  
16498          /**
16499           * The reason for the settings database being downgraded. This is only for
16500           * troubleshooting purposes and its value should not be interpreted in any way.
16501           *
16502           * Type: string
16503           *
16504           * @hide
16505           */
16506          @Readable
16507          public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason";
16508  
16509          /**
16510           * The build id of when the settings database was first created (or re-created due it
16511           * being missing).
16512           *
16513           * Type: string
16514           *
16515           * @hide
16516           */
16517          @Readable
16518          public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid";
16519  
16520          /**
16521           * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by
16522           * default. Set to 0 to disable.
16523           *
16524           * @hide
16525           */
16526          @Readable
16527          public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled";
16528  
16529          /**
16530           * Flag to enable the link to location permissions in location setting. Set to 0 to disable.
16531           *
16532           * @hide
16533           */
16534          @Readable
16535          public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED =
16536                  "location_settings_link_to_permissions_enabled";
16537  
16538          /**
16539           * Flag to set the waiting time for removing invisible euicc profiles inside System >
16540           * Settings.
16541           * Type: long
16542           *
16543           * @hide
16544           */
16545          @Readable
16546          public static final String EUICC_REMOVING_INVISIBLE_PROFILES_TIMEOUT_MILLIS =
16547                  "euicc_removing_invisible_profiles_timeout_millis";
16548  
16549          /**
16550           * Flag to set the waiting time for euicc factory reset inside System > Settings
16551           * Type: long
16552           *
16553           * @hide
16554           */
16555          @Readable
16556          public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS =
16557                  "euicc_factory_reset_timeout_millis";
16558  
16559          /**
16560           * Flag to set the waiting time for euicc slot switch.
16561           * Type: long
16562           *
16563           * @hide
16564           */
16565          public static final String EUICC_SWITCH_SLOT_TIMEOUT_MILLIS =
16566                  "euicc_switch_slot_timeout_millis";
16567  
16568          /**
16569           * Flag to set the waiting time for enabling multi SIM slot.
16570           * Type: long
16571           *
16572           * @hide
16573           */
16574          public static final String ENABLE_MULTI_SLOT_TIMEOUT_MILLIS =
16575                  "enable_multi_slot_timeout_millis";
16576  
16577          /**
16578           * Flag to set the timeout for when to refresh the storage settings cached data.
16579           * Type: long
16580           *
16581           * @hide
16582           */
16583          @Readable
16584          public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD =
16585                  "storage_settings_clobber_threshold";
16586  
16587          /**
16588           * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored
16589           * and restoring to lower version of platform API will be skipped.
16590           *
16591           * @hide
16592           */
16593          @Readable
16594          public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION =
16595                  "override_settings_provider_restore_any_version";
16596          /**
16597           * Flag to toggle whether system services report attribution chains when they attribute
16598           * battery use via a {@code WorkSource}.
16599           *
16600           * Type: int (0 to disable, 1 to enable)
16601           *
16602           * @hide
16603           */
16604          @Readable
16605          public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED =
16606                  "chained_battery_attribution_enabled";
16607  
16608          /**
16609           * Toggle to enable/disable the incremental ADB installation by default.
16610           * If not set, default adb installations are incremental; set to zero to use full ones.
16611           * Note: only ADB uses it, no usages in the Framework code.
16612           * <p>
16613           * Type: int (0 to disable, 1 to enable)
16614           *
16615           * @hide
16616           */
16617          @Readable
16618          public static final String ENABLE_ADB_INCREMENTAL_INSTALL_DEFAULT =
16619                  "enable_adb_incremental_install_default";
16620  
16621          /**
16622           * The packages whitelisted to be run in autofill compatibility mode. The list
16623           * of packages is {@code ":"} colon delimited, and each entry has the name of the
16624           * package and an optional list of url bar resource ids (the list is delimited by
16625           * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited).
16626           *
16627           * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where
16628           * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 }
16629           * have 2 ids {@code url_foo} and {@code url_bas}) would be
16630           * {@code p1[url_bar]:p2:p3[url_foo,url_bas]}
16631           *
16632           * @hide
16633           * @deprecated Use {@link android.view.autofill.AutofillManager
16634           * #DEVICE_CONFIG_AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES} instead.
16635           */
16636          @Deprecated
16637          @SystemApi
16638          @Readable
16639          public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES =
16640                  "autofill_compat_mode_allowed_packages";
16641  
16642          /**
16643           * Level of autofill logging.
16644           *
16645           * <p>Valid values are
16646           * {@link android.view.autofill.AutofillManager#NO_LOGGING},
16647           * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_DEBUG}, or
16648           * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_VERBOSE}.
16649           *
16650           * @hide
16651           */
16652          @Readable
16653          public static final String AUTOFILL_LOGGING_LEVEL = "autofill_logging_level";
16654  
16655          /**
16656           * Maximum number of partitions that can be allowed in an autofill session.
16657           *
16658           * @hide
16659           */
16660          @Readable
16661          public static final String AUTOFILL_MAX_PARTITIONS_SIZE = "autofill_max_partitions_size";
16662  
16663          /**
16664           * Maximum number of visible datasets in the Autofill dataset picker UI, or {@code 0} to use
16665           * the default value from resources.
16666           *
16667           * @hide
16668           */
16669          @Readable
16670          public static final String AUTOFILL_MAX_VISIBLE_DATASETS = "autofill_max_visible_datasets";
16671  
16672          /**
16673           * Indicates whether a stylus has ever been used on the device.
16674           *
16675           * @hide
16676           */
16677          @Readable
16678          @SuppressLint("NoSettingsProvider")
16679          public static final String STYLUS_EVER_USED = "stylus_ever_used";
16680  
16681          /**
16682           * Exemptions to the hidden API blacklist.
16683           *
16684           * @hide
16685           */
16686          @TestApi
16687          @Readable
16688          public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS =
16689                  "hidden_api_blacklist_exemptions";
16690  
16691          /**
16692           * Hidden API enforcement policy for apps.
16693           *
16694           * Values correspond to @{@link
16695           * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy}
16696           *
16697           * @hide
16698           */
16699          @TestApi
16700          @Readable
16701          public static final String HIDDEN_API_POLICY = "hidden_api_policy";
16702  
16703          /**
16704           * Flag for forcing {@link com.android.server.compat.OverrideValidatorImpl}
16705           * to consider this a non-debuggable build.
16706           *
16707           * @hide
16708           */
16709          public static final String FORCE_NON_DEBUGGABLE_FINAL_BUILD_FOR_COMPAT =
16710                  "force_non_debuggable_final_build_for_compat";
16711  
16712  
16713          /**
16714           * Current version of signed configuration applied.
16715           *
16716           * @hide
16717           */
16718          @Readable
16719          public static final String SIGNED_CONFIG_VERSION = "signed_config_version";
16720  
16721          /**
16722           * Timeout for a single {@link android.media.soundtrigger.SoundTriggerDetectionService}
16723           * operation (in ms).
16724           *
16725           * @hide
16726           */
16727          @Readable
16728          public static final String SOUND_TRIGGER_DETECTION_SERVICE_OP_TIMEOUT =
16729                  "sound_trigger_detection_service_op_timeout";
16730  
16731          /**
16732           * Maximum number of {@link android.media.soundtrigger.SoundTriggerDetectionService}
16733           * operations per day.
16734           *
16735           * @hide
16736           */
16737          @Readable
16738          public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY =
16739                  "max_sound_trigger_detection_service_ops_per_day";
16740  
16741          /**
16742           * Setting to determine if the Clockwork Home application is ready.
16743           *
16744           * <p>
16745           * Set to 1 when the Clockwork Home application has finished starting up.
16746           * </p>
16747           *
16748           * @hide
16749           */
16750          public static final String CLOCKWORK_HOME_READY = "clockwork_home_ready";
16751  
16752          /**
16753           * Indicates whether aware is available in the current location.
16754           * @hide
16755           */
16756          @Readable
16757          public static final String AWARE_ALLOWED = "aware_allowed";
16758  
16759          /**
16760           * Overrides internal R.integer.config_longPressOnPowerBehavior.
16761           * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
16762           * Used by PhoneWindowManager.
16763           * @hide
16764           */
16765          @Readable
16766          public static final String POWER_BUTTON_LONG_PRESS =
16767                  "power_button_long_press";
16768  
16769          /**
16770           * Override internal R.integer.config_longPressOnPowerDurationMs. It determines the length
16771           * of power button press to be considered a long press in milliseconds.
16772           * Used by PhoneWindowManager.
16773           * @hide
16774           */
16775          @Readable
16776          public static final String POWER_BUTTON_LONG_PRESS_DURATION_MS =
16777                  "power_button_long_press_duration_ms";
16778  
16779          /**
16780           * Overrides internal R.integer.config_veryLongPressOnPowerBehavior.
16781           * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
16782           * Used by PhoneWindowManager.
16783           * @hide
16784           */
16785          @Readable
16786          public static final String POWER_BUTTON_VERY_LONG_PRESS =
16787                  "power_button_very_long_press";
16788  
16789          /**
16790           * Overrides internal R.integer.config_keyChordPowerVolumeUp.
16791           * Allowable values detailed in frameworks/base/core/res/res/values/config.xml.
16792           * Used by PhoneWindowManager.
16793           * @hide
16794           */
16795          @Readable
16796          public static final String KEY_CHORD_POWER_VOLUME_UP =
16797                  "key_chord_power_volume_up";
16798  
16799          /**
16800           * Record audio from near-field microphone (ie. TV remote)
16801           * Allows audio recording regardless of sensor privacy state,
16802           * as it is an intentional user interaction: hold-to-talk
16803           *
16804           * Type: int (0 to disable, 1 to enable)
16805           *
16806           * @hide
16807           */
16808          public static final String RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO_ENABLED =
16809                  "receive_explicit_user_interaction_audio_enabled";
16810  
16811          /**
16812           * Keyguard should be on the left hand side of the screen, for wide screen layouts.
16813           *
16814           * @hide
16815           */
16816          public static final int ONE_HANDED_KEYGUARD_SIDE_LEFT = 0;
16817  
16818          /**
16819           * Keyguard should be on the right hand side of the screen, for wide screen layouts.
16820           *
16821           * @hide
16822           */
16823          public static final int ONE_HANDED_KEYGUARD_SIDE_RIGHT = 1;
16824          /**
16825           * In one handed mode, which side the keyguard should be on. Allowable values are one of
16826           * the ONE_HANDED_KEYGUARD_SIDE_* constants.
16827           *
16828           * @hide
16829           */
16830          public static final String ONE_HANDED_KEYGUARD_SIDE = "one_handed_keyguard_side";
16831  
16832          /**
16833           * Global settings that shouldn't be persisted.
16834           *
16835           * @hide
16836           */
16837          public static final String[] TRANSIENT_SETTINGS = {
16838                  CLOCKWORK_HOME_READY,
16839          };
16840  
16841          /**
16842           * Keys we no longer back up under the current schema, but want to continue to
16843           * process when restoring historical backup datasets.
16844           *
16845           * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator,
16846           * otherwise they won't be restored.
16847           *
16848           * @hide
16849           */
16850          public static final String[] LEGACY_RESTORE_SETTINGS = {
16851          };
16852  
16853          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
16854          private static final ContentProviderHolder sProviderHolder =
16855                  new ContentProviderHolder(CONTENT_URI);
16856  
16857          // Populated lazily, guarded by class object:
16858          @UnsupportedAppUsage
16859          private static final NameValueCache sNameValueCache = new NameValueCache(
16860                      CONTENT_URI,
16861                      CALL_METHOD_GET_GLOBAL,
16862                      CALL_METHOD_PUT_GLOBAL,
16863                      CALL_METHOD_DELETE_GLOBAL,
16864                      sProviderHolder,
16865                      Global.class);
16866  
16867          // Certain settings have been moved from global to the per-user secure namespace
16868          @UnsupportedAppUsage
16869          private static final HashSet<String> MOVED_TO_SECURE;
16870          static {
16871              MOVED_TO_SECURE = new HashSet<>(8);
16872              MOVED_TO_SECURE.add(Global.INSTALL_NON_MARKET_APPS);
16873              MOVED_TO_SECURE.add(Global.ZEN_DURATION);
16874              MOVED_TO_SECURE.add(Global.SHOW_ZEN_UPGRADE_NOTIFICATION);
16875              MOVED_TO_SECURE.add(Global.SHOW_ZEN_SETTINGS_SUGGESTION);
16876              MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_UPDATED);
16877              MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_SUGGESTION_VIEWED);
16878              MOVED_TO_SECURE.add(Global.CHARGING_SOUNDS_ENABLED);
16879              MOVED_TO_SECURE.add(Global.CHARGING_VIBRATION_ENABLED);
16880              MOVED_TO_SECURE.add(Global.NOTIFICATION_BUBBLES);
16881              MOVED_TO_SECURE.add(Global.BUGREPORT_IN_POWER_MENU);
16882              MOVED_TO_SECURE.add(Global.CUSTOM_BUGREPORT_HANDLER_APP);
16883              MOVED_TO_SECURE.add(Global.CUSTOM_BUGREPORT_HANDLER_USER);
16884          }
16885  
16886          // Certain settings have been moved from global to the per-user system namespace
16887          private static final HashSet<String> MOVED_TO_SYSTEM;
16888          static {
16889              MOVED_TO_SYSTEM = new HashSet<>(1);
16890              MOVED_TO_SYSTEM.add(Global.APPLY_RAMPING_RINGER);
16891          }
16892  
16893          /** @hide */
getMovedToSecureSettings(Set<String> outKeySet)16894          public static void getMovedToSecureSettings(Set<String> outKeySet) {
16895              outKeySet.addAll(MOVED_TO_SECURE);
16896          }
16897  
16898          /** @hide */
getMovedToSystemSettings(Set<String> outKeySet)16899          public static void getMovedToSystemSettings(Set<String> outKeySet) {
16900              outKeySet.addAll(MOVED_TO_SYSTEM);
16901          }
16902  
16903          /** @hide */
clearProviderForTest()16904          public static void clearProviderForTest() {
16905              sProviderHolder.clearProviderForTest();
16906              sNameValueCache.clearGenerationTrackerForTest();
16907          }
16908  
16909          /** @hide */
getPublicSettings(Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> readableKeysWithMaxTargetSdk)16910          public static void getPublicSettings(Set<String> allKeys, Set<String> readableKeys,
16911                  ArrayMap<String, Integer> readableKeysWithMaxTargetSdk) {
16912              getPublicSettingsForClass(Global.class, allKeys, readableKeys,
16913                      readableKeysWithMaxTargetSdk);
16914          }
16915  
16916          /**
16917           * Look up a name in the database.
16918           * @param resolver to access the database with
16919           * @param name to look up in the table
16920           * @return the corresponding value, or null if not present
16921           */
getString(ContentResolver resolver, String name)16922          public static String getString(ContentResolver resolver, String name) {
16923              return getStringForUser(resolver, name, resolver.getUserId());
16924          }
16925  
16926          /** @hide */
16927          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
getStringForUser(ContentResolver resolver, String name, int userHandle)16928          public static String getStringForUser(ContentResolver resolver, String name,
16929                  int userHandle) {
16930              if (MOVED_TO_SECURE.contains(name)) {
16931                  Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
16932                          + " to android.provider.Settings.Secure, returning read-only value.");
16933                  return Secure.getStringForUser(resolver, name, userHandle);
16934              }
16935              if (MOVED_TO_SYSTEM.contains(name)) {
16936                  Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
16937                          + " to android.provider.Settings.System, returning read-only value.");
16938                  return System.getStringForUser(resolver, name, userHandle);
16939              }
16940              return sNameValueCache.getStringForUser(resolver, name, userHandle);
16941          }
16942  
16943          /**
16944           * Store a name/value pair into the database.
16945           * @param resolver to access the database with
16946           * @param name to store
16947           * @param value to associate with the name
16948           * @return true if the value was set, false on database errors
16949           */
putString(ContentResolver resolver, String name, String value)16950          public static boolean putString(ContentResolver resolver,
16951                  String name, String value) {
16952              return putStringForUser(resolver, name, value, null, false, resolver.getUserId(),
16953                      DEFAULT_OVERRIDEABLE_BY_RESTORE);
16954          }
16955  
16956          /**
16957           * Store a name/value pair into the database.
16958           *
16959           * @param resolver to access the database with
16960           * @param name to store
16961           * @param value to associate with the name
16962           * @param tag to associated with the setting.
16963           * @param makeDefault whether to make the value the default one.
16964           * @param overrideableByRestore whether restore can override this value
16965           * @return true if the value was set, false on database errors
16966           *
16967           * @hide
16968           */
16969          @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)16970          public static boolean putString(@NonNull ContentResolver resolver,
16971                  @NonNull String name, @Nullable String value, @Nullable String tag,
16972                  boolean makeDefault, boolean overrideableByRestore) {
16973              return putStringForUser(resolver, name, value, tag, makeDefault,
16974                      resolver.getUserId(), overrideableByRestore);
16975          }
16976  
16977          /**
16978           * Store a name/value pair into the database.
16979           * <p>
16980           * The method takes an optional tag to associate with the setting
16981           * which can be used to clear only settings made by your package and
16982           * associated with this tag by passing the tag to {@link
16983           * #resetToDefaults(ContentResolver, String)}. Anyone can override
16984           * the current tag. Also if another package changes the setting
16985           * then the tag will be set to the one specified in the set call
16986           * which can be null. Also any of the settings setters that do not
16987           * take a tag as an argument effectively clears the tag.
16988           * </p><p>
16989           * For example, if you set settings A and B with tags T1 and T2 and
16990           * another app changes setting A (potentially to the same value), it
16991           * can assign to it a tag T3 (note that now the package that changed
16992           * the setting is not yours). Now if you reset your changes for T1 and
16993           * T2 only setting B will be reset and A not (as it was changed by
16994           * another package) but since A did not change you are in the desired
16995           * initial state. Now if the other app changes the value of A (assuming
16996           * you registered an observer in the beginning) you would detect that
16997           * the setting was changed by another app and handle this appropriately
16998           * (ignore, set back to some value, etc).
16999           * </p><p>
17000           * Also the method takes an argument whether to make the value the
17001           * default for this setting. If the system already specified a default
17002           * value, then the one passed in here will <strong>not</strong>
17003           * be set as the default.
17004           * </p>
17005           *
17006           * @param resolver to access the database with.
17007           * @param name to store.
17008           * @param value to associate with the name.
17009           * @param tag to associated with the setting.
17010           * @param makeDefault whether to make the value the default one.
17011           * @return true if the value was set, false on database errors.
17012           *
17013           * @see #resetToDefaults(ContentResolver, String)
17014           *
17015           * @hide
17016           */
17017          @SystemApi
17018          @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)17019          public static boolean putString(@NonNull ContentResolver resolver,
17020                  @NonNull String name, @Nullable String value, @Nullable String tag,
17021                  boolean makeDefault) {
17022              return putStringForUser(resolver, name, value, tag, makeDefault,
17023                      resolver.getUserId(), DEFAULT_OVERRIDEABLE_BY_RESTORE);
17024          }
17025  
17026          /**
17027           * Reset the settings to their defaults. This would reset <strong>only</strong>
17028           * settings set by the caller's package. Think of it of a way to undo your own
17029           * changes to the secure settings. Passing in the optional tag will reset only
17030           * settings changed by your package and associated with this tag.
17031           *
17032           * @param resolver Handle to the content resolver.
17033           * @param tag Optional tag which should be associated with the settings to reset.
17034           *
17035           * @see #putString(ContentResolver, String, String, String, boolean)
17036           *
17037           * @hide
17038           */
17039          @SystemApi
17040          @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS)
resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)17041          public static void resetToDefaults(@NonNull ContentResolver resolver,
17042                  @Nullable String tag) {
17043              resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS,
17044                      resolver.getUserId());
17045          }
17046  
17047          /**
17048           * Reset the settings to their defaults for a given user with a specific mode. The
17049           * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS}
17050           * allowing resetting the settings made by a package and associated with the tag.
17051           *
17052           * @param resolver Handle to the content resolver.
17053           * @param tag Optional tag which should be associated with the settings to reset.
17054           * @param mode The reset mode.
17055           * @param userHandle The user for which to reset to defaults.
17056           *
17057           * @see #RESET_MODE_PACKAGE_DEFAULTS
17058           * @see #RESET_MODE_UNTRUSTED_DEFAULTS
17059           * @see #RESET_MODE_UNTRUSTED_CHANGES
17060           * @see #RESET_MODE_TRUSTED_DEFAULTS
17061           *
17062           * @hide
17063           */
resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)17064          public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver,
17065                  @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) {
17066              try {
17067                  Bundle arg = new Bundle();
17068                  arg.putInt(CALL_METHOD_USER_KEY, userHandle);
17069                  if (tag != null) {
17070                      arg.putString(CALL_METHOD_TAG_KEY, tag);
17071                  }
17072                  arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode);
17073                  IContentProvider cp = sProviderHolder.getProvider(resolver);
17074                  cp.call(resolver.getAttributionSource(),
17075                          sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_GLOBAL, null, arg);
17076              } catch (RemoteException e) {
17077                  Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e);
17078              }
17079          }
17080  
17081          /** @hide */
17082          @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
putStringForUser(ContentResolver resolver, String name, String value, int userHandle)17083          public static boolean putStringForUser(ContentResolver resolver,
17084                  String name, String value, int userHandle) {
17085              return putStringForUser(resolver, name, value, null, false, userHandle,
17086                      DEFAULT_OVERRIDEABLE_BY_RESTORE);
17087          }
17088  
17089          /** @hide */
putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore)17090          public static boolean putStringForUser(@NonNull ContentResolver resolver,
17091                  @NonNull String name, @Nullable String value, @Nullable String tag,
17092                  boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore) {
17093              if (LOCAL_LOGV) {
17094                  Log.v(TAG, "Global.putString(name=" + name + ", value=" + value + ") for "
17095                          + userHandle);
17096              }
17097              // Global and Secure have the same access policy so we can forward writes
17098              if (MOVED_TO_SECURE.contains(name)) {
17099                  Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
17100                          + " to android.provider.Settings.Secure, value is unchanged.");
17101                  return Secure.putStringForUser(resolver, name, value, tag,
17102                          makeDefault, userHandle, overrideableByRestore);
17103              }
17104              // Global and System have the same access policy so we can forward writes
17105              if (MOVED_TO_SYSTEM.contains(name)) {
17106                  Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
17107                          + " to android.provider.Settings.System, value is unchanged.");
17108                  return System.putStringForUser(resolver, name, value, tag,
17109                          makeDefault, userHandle, overrideableByRestore);
17110              }
17111              return sNameValueCache.putStringForUser(resolver, name, value, tag,
17112                      makeDefault, userHandle, overrideableByRestore);
17113          }
17114  
17115          /**
17116           * Construct the content URI for a particular name/value pair,
17117           * useful for monitoring changes with a ContentObserver.
17118           * @param name to look up in the table
17119           * @return the corresponding content URI, or null if not present
17120           */
getUriFor(String name)17121          public static Uri getUriFor(String name) {
17122              return getUriFor(CONTENT_URI, name);
17123          }
17124  
17125          /**
17126           * Convenience function for retrieving a single secure settings value
17127           * as an integer.  Note that internally setting values are always
17128           * stored as strings; this function converts the string to an integer
17129           * for you.  The default value will be returned if the setting is
17130           * not defined or not an integer.
17131           *
17132           * @param cr The ContentResolver to access.
17133           * @param name The name of the setting to retrieve.
17134           * @param def Value to return if the setting is not defined.
17135           *
17136           * @return The setting's current value, or 'def' if it is not defined
17137           * or not a valid integer.
17138           */
getInt(ContentResolver cr, String name, int def)17139          public static int getInt(ContentResolver cr, String name, int def) {
17140              String v = getString(cr, name);
17141              return parseIntSettingWithDefault(v, def);
17142          }
17143  
17144          /**
17145           * Convenience function for retrieving a single secure settings value
17146           * as an integer.  Note that internally setting values are always
17147           * stored as strings; this function converts the string to an integer
17148           * for you.
17149           * <p>
17150           * This version does not take a default value.  If the setting has not
17151           * been set, or the string value is not a number,
17152           * it throws {@link SettingNotFoundException}.
17153           *
17154           * @param cr The ContentResolver to access.
17155           * @param name The name of the setting to retrieve.
17156           *
17157           * @throws SettingNotFoundException Thrown if a setting by the given
17158           * name can't be found or the setting value is not an integer.
17159           *
17160           * @return The setting's current value.
17161           */
getInt(ContentResolver cr, String name)17162          public static int getInt(ContentResolver cr, String name)
17163                  throws SettingNotFoundException {
17164              String v = getString(cr, name);
17165              return parseIntSetting(v, name);
17166          }
17167  
17168          /**
17169           * Convenience function for updating a single settings value as an
17170           * integer. This will either create a new entry in the table if the
17171           * given name does not exist, or modify the value of the existing row
17172           * with that name.  Note that internally setting values are always
17173           * stored as strings, so this function converts the given value to a
17174           * string before storing it.
17175           *
17176           * @param cr The ContentResolver to access.
17177           * @param name The name of the setting to modify.
17178           * @param value The new value for the setting.
17179           * @return true if the value was set, false on database errors
17180           */
putInt(ContentResolver cr, String name, int value)17181          public static boolean putInt(ContentResolver cr, String name, int value) {
17182              return putString(cr, name, Integer.toString(value));
17183          }
17184  
17185          /**
17186           * Convenience function for retrieving a single secure settings value
17187           * as a {@code long}.  Note that internally setting values are always
17188           * stored as strings; this function converts the string to a {@code long}
17189           * for you.  The default value will be returned if the setting is
17190           * not defined or not a {@code long}.
17191           *
17192           * @param cr The ContentResolver to access.
17193           * @param name The name of the setting to retrieve.
17194           * @param def Value to return if the setting is not defined.
17195           *
17196           * @return The setting's current value, or 'def' if it is not defined
17197           * or not a valid {@code long}.
17198           */
getLong(ContentResolver cr, String name, long def)17199          public static long getLong(ContentResolver cr, String name, long def) {
17200              String v = getString(cr, name);
17201              return parseLongSettingWithDefault(v, def);
17202          }
17203  
17204          /**
17205           * Convenience function for retrieving a single secure settings value
17206           * as a {@code long}.  Note that internally setting values are always
17207           * stored as strings; this function converts the string to a {@code long}
17208           * for you.
17209           * <p>
17210           * This version does not take a default value.  If the setting has not
17211           * been set, or the string value is not a number,
17212           * it throws {@link SettingNotFoundException}.
17213           *
17214           * @param cr The ContentResolver to access.
17215           * @param name The name of the setting to retrieve.
17216           *
17217           * @return The setting's current value.
17218           * @throws SettingNotFoundException Thrown if a setting by the given
17219           * name can't be found or the setting value is not an integer.
17220           */
getLong(ContentResolver cr, String name)17221          public static long getLong(ContentResolver cr, String name)
17222                  throws SettingNotFoundException {
17223              String v = getString(cr, name);
17224              return parseLongSetting(v, name);
17225          }
17226  
17227          /**
17228           * Convenience function for updating a secure settings value as a long
17229           * integer. This will either create a new entry in the table if the
17230           * given name does not exist, or modify the value of the existing row
17231           * with that name.  Note that internally setting values are always
17232           * stored as strings, so this function converts the given value to a
17233           * string before storing it.
17234           *
17235           * @param cr The ContentResolver to access.
17236           * @param name The name of the setting to modify.
17237           * @param value The new value for the setting.
17238           * @return true if the value was set, false on database errors
17239           */
putLong(ContentResolver cr, String name, long value)17240          public static boolean putLong(ContentResolver cr, String name, long value) {
17241              return putString(cr, name, Long.toString(value));
17242          }
17243  
17244          /**
17245           * Convenience function for retrieving a single secure settings value
17246           * as a floating point number.  Note that internally setting values are
17247           * always stored as strings; this function converts the string to an
17248           * float for you. The default value will be returned if the setting
17249           * is not defined or not a valid float.
17250           *
17251           * @param cr The ContentResolver to access.
17252           * @param name The name of the setting to retrieve.
17253           * @param def Value to return if the setting is not defined.
17254           *
17255           * @return The setting's current value, or 'def' if it is not defined
17256           * or not a valid float.
17257           */
getFloat(ContentResolver cr, String name, float def)17258          public static float getFloat(ContentResolver cr, String name, float def) {
17259              String v = getString(cr, name);
17260              return parseFloatSettingWithDefault(v, def);
17261          }
17262  
17263          /**
17264           * Convenience function for retrieving a single secure settings value
17265           * as a float.  Note that internally setting values are always
17266           * stored as strings; this function converts the string to a float
17267           * for you.
17268           * <p>
17269           * This version does not take a default value.  If the setting has not
17270           * been set, or the string value is not a number,
17271           * it throws {@link SettingNotFoundException}.
17272           *
17273           * @param cr The ContentResolver to access.
17274           * @param name The name of the setting to retrieve.
17275           *
17276           * @throws SettingNotFoundException Thrown if a setting by the given
17277           * name can't be found or the setting value is not a float.
17278           *
17279           * @return The setting's current value.
17280           */
getFloat(ContentResolver cr, String name)17281          public static float getFloat(ContentResolver cr, String name)
17282                  throws SettingNotFoundException {
17283              String v = getString(cr, name);
17284              return parseFloatSetting(v, name);
17285          }
17286  
17287          /**
17288           * Convenience function for updating a single settings value as a
17289           * floating point number. This will either create a new entry in the
17290           * table if the given name does not exist, or modify the value of the
17291           * existing row with that name.  Note that internally setting values
17292           * are always stored as strings, so this function converts the given
17293           * value to a string before storing it.
17294           *
17295           * @param cr The ContentResolver to access.
17296           * @param name The name of the setting to modify.
17297           * @param value The new value for the setting.
17298           * @return true if the value was set, false on database errors
17299           */
putFloat(ContentResolver cr, String name, float value)17300          public static boolean putFloat(ContentResolver cr, String name, float value) {
17301              return putString(cr, name, Float.toString(value));
17302          }
17303  
17304          /**
17305            * Subscription Id to be used for voice call on a multi sim device.
17306            * @hide
17307            */
17308          @Readable
17309          public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
17310  
17311          /**
17312            * Used to provide option to user to select subscription during dial.
17313            * The supported values are 0 = disable or 1 = enable prompt.
17314            * @hide
17315            */
17316          @UnsupportedAppUsage
17317          @Readable
17318          public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
17319  
17320          /**
17321            * Subscription Id to be used for data call on a multi sim device.
17322            * @hide
17323            */
17324          @Readable
17325          public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
17326  
17327          /**
17328            * Subscription Id to be used for SMS on a multi sim device.
17329            * @hide
17330            */
17331          @Readable
17332          public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
17333  
17334          /**
17335            * Used to provide option to user to select subscription during send SMS.
17336            * The value 1 - enable, 0 - disable
17337            * @hide
17338            */
17339          @Readable
17340          public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
17341  
17342          /** User preferred subscriptions setting.
17343            * This holds the details of the user selected subscription from the card and
17344            * the activation status. Each settings string have the comma separated values
17345            * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
17346            * @hide
17347           */
17348          @UnsupportedAppUsage
17349          @Readable
17350          public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
17351                  "user_preferred_sub2","user_preferred_sub3"};
17352  
17353          /**
17354           * Which subscription is enabled for a physical slot.
17355           * @hide
17356           */
17357          @Readable
17358          public static final String ENABLED_SUBSCRIPTION_FOR_SLOT = "enabled_subscription_for_slot";
17359  
17360          /**
17361           * Whether corresponding logical modem is enabled for a physical slot.
17362           * The value 1 - enable, 0 - disable
17363           * @hide
17364           */
17365          @Readable
17366          public static final String MODEM_STACK_ENABLED_FOR_SLOT = "modem_stack_enabled_for_slot";
17367  
17368          /**
17369           * Whether to enable new contacts aggregator or not.
17370           * The value 1 - enable, 0 - disable
17371           * @hide
17372           */
17373          @Readable
17374          public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
17375  
17376          /**
17377           * Whether to enable contacts metadata syncing or not
17378           * The value 1 - enable, 0 - disable
17379           *
17380           * @removed
17381           */
17382          @Deprecated
17383          @Readable
17384          public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
17385  
17386          /**
17387           * Whether to enable contacts metadata syncing or not
17388           * The value 1 - enable, 0 - disable
17389           */
17390          @Readable
17391          public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled";
17392  
17393          /**
17394           * Whether to enable cellular on boot.
17395           * The value 1 - enable, 0 - disable
17396           * @hide
17397           */
17398          @Readable
17399          public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot";
17400  
17401          /**
17402           * The maximum allowed notification enqueue rate in Hertz.
17403           *
17404           * Should be a float, and includes updates only.
17405           * @hide
17406           */
17407          @Readable
17408          public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate";
17409  
17410          /**
17411           * Displays toasts when an app posts a notification that does not specify a valid channel.
17412           *
17413           * The value 1 - enable, 0 - disable
17414           * @hide
17415           */
17416          @Readable
17417          public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS =
17418                  "show_notification_channel_warnings";
17419  
17420          /**
17421           * Whether cell is enabled/disabled
17422           * @hide
17423           */
17424          @Readable
17425          public static final String CELL_ON = "cell_on";
17426  
17427          /**
17428           * Global settings which can be accessed by instant apps.
17429           * @hide
17430           */
17431          public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>();
17432          static {
17433              INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER);
17434              INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED);
17435              INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES);
17436              INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL);
17437              INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES);
17438              INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON);
17439              INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE);
17440              INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE);
17441              INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE);
17442              INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES);
17443              INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE);
17444              INSTANT_APP_SETTINGS.add(WTF_IS_FATAL);
17445              INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR);
17446              INSTANT_APP_SETTINGS.add(ZEN_MODE);
17447          }
17448  
17449          /**
17450           * Whether to show the high temperature warning notification.
17451           * @hide
17452           */
17453          @Readable
17454          public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning";
17455  
17456          /**
17457           * Whether to show the usb high temperature alarm notification.
17458           * @hide
17459           */
17460          @Readable
17461          public static final String SHOW_USB_TEMPERATURE_ALARM = "show_usb_temperature_alarm";
17462  
17463          /**
17464           * Temperature at which the high temperature warning notification should be shown.
17465           * @hide
17466           */
17467          @Readable
17468          public static final String WARNING_TEMPERATURE = "warning_temperature";
17469  
17470          /**
17471           * Whether the diskstats logging task is enabled/disabled.
17472           * @hide
17473           */
17474          @Readable
17475          public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging";
17476  
17477          /**
17478           * Whether the cache quota calculation task is enabled/disabled.
17479           * @hide
17480           */
17481          @Readable
17482          public static final String ENABLE_CACHE_QUOTA_CALCULATION =
17483                  "enable_cache_quota_calculation";
17484  
17485          /**
17486           * Whether the Deletion Helper no threshold toggle is available.
17487           * @hide
17488           */
17489          @Readable
17490          public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE =
17491                  "enable_deletion_helper_no_threshold_toggle";
17492  
17493          /**
17494           * The list of snooze options for notifications
17495           * This is encoded as a key=value list, separated by commas. Ex:
17496           *
17497           * "default=60,options_array=15:30:60:120"
17498           *
17499           * The following keys are supported:
17500           *
17501           * <pre>
17502           * default               (int)
17503           * options_array         (int[])
17504           * </pre>
17505           *
17506           * All delays in integer minutes. Array order is respected.
17507           * Options will be used in order up to the maximum allowed by the UI.
17508           * @hide
17509           */
17510          @Readable
17511          public static final String NOTIFICATION_SNOOZE_OPTIONS =
17512                  "notification_snooze_options";
17513  
17514          /**
17515           * When enabled, notifications the notification assistant service has modified will show an
17516           * indicator. When tapped, this indicator will describe the adjustment made and solicit
17517           * feedback. This flag will also add a "automatic" option to the long press menu.
17518           *
17519           * The value 1 - enable, 0 - disable
17520           * @hide
17521           */
17522          public static final String NOTIFICATION_FEEDBACK_ENABLED = "notification_feedback_enabled";
17523  
17524          /**
17525           * Settings key for the ratio of notification dismissals to notification views - one of the
17526           * criteria for showing the notification blocking helper.
17527           *
17528           * <p>The value is a float ranging from 0.0 to 1.0 (the closer to 0.0, the more intrusive
17529           * the blocking helper will be).
17530           *
17531           * @hide
17532           */
17533          @Readable
17534          public static final String BLOCKING_HELPER_DISMISS_TO_VIEW_RATIO_LIMIT =
17535                  "blocking_helper_dismiss_to_view_ratio";
17536  
17537          /**
17538           * Settings key for the longest streak of dismissals  - one of the criteria for showing the
17539           * notification blocking helper.
17540           *
17541           * <p>The value is an integer greater than 0.
17542           *
17543           * @hide
17544           */
17545          @Readable
17546          public static final String BLOCKING_HELPER_STREAK_LIMIT = "blocking_helper_streak_limit";
17547  
17548          /**
17549           * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated
17550           * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF
17551           *
17552           * Supported keys:<br/>
17553           * <li>
17554           * <ul> {@code legacy_compatibility_wal_enabled} : A {code boolean} flag that determines
17555           * whether or not "compatibility WAL" mode is enabled by default. This is a legacy flag
17556           * and is honoured on Android Q and higher. This flag will be removed in a future release.
17557           * </ul>
17558           * <ul> {@code wal_syncmode} : A {@code String} representing the synchronization mode to use
17559           * when WAL is enabled, either via {@code legacy_compatibility_wal_enabled} or using the
17560           * obsolete {@code compatibility_wal_supported} flag.
17561           * </ul>
17562           * <ul> {@code truncate_size} : A {@code int} flag that specifies the truncate size of the
17563           * WAL journal.
17564           * </ul>
17565           * <ul> {@code compatibility_wal_supported} : A {code boolean} flag that specifies whether
17566           * the legacy "compatibility WAL" mode is enabled by default. This flag is obsolete and is
17567           * only supported on Android Pie.
17568           * </ul>
17569           * </li>
17570           *
17571           * @hide
17572           */
17573          @Readable
17574          public static final String SQLITE_COMPATIBILITY_WAL_FLAGS =
17575                  "sqlite_compatibility_wal_flags";
17576  
17577          /**
17578           * Enable GNSS Raw Measurements Full Tracking?
17579           * 0 = no
17580           * 1 = yes
17581           * @hide
17582           */
17583          @Readable
17584          public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING =
17585                  "enable_gnss_raw_meas_full_tracking";
17586  
17587          /**
17588           * Whether the notification should be ongoing (persistent) when a carrier app install is
17589           * required.
17590           *
17591           * The value is a boolean (1 or 0).
17592           * @hide
17593           */
17594          @SystemApi
17595          @Readable
17596          public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT =
17597                  "install_carrier_app_notification_persistent";
17598  
17599          /**
17600           * The amount of time (ms) to hide the install carrier app notification after the user has
17601           * ignored it. After this time passes, the notification will be shown again
17602           *
17603           * The value is a long
17604           * @hide
17605           */
17606          @SystemApi
17607          @Readable
17608          public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS =
17609                  "install_carrier_app_notification_sleep_millis";
17610  
17611          /**
17612           * Whether we've enabled zram on this device. Takes effect on
17613           * reboot. The value "1" enables zram; "0" disables it, and
17614           * everything else is unspecified.
17615           * @hide
17616           */
17617          @Readable
17618          public static final String ZRAM_ENABLED =
17619                  "zram_enabled";
17620  
17621          /**
17622           * Whether the app freezer is enabled on this device.
17623           * The value of "enabled" enables the app freezer, "disabled" disables it and
17624           * "device_default" will let the system decide whether to enable the freezer or not
17625           * @hide
17626           */
17627          @Readable
17628          public static final String CACHED_APPS_FREEZER_ENABLED = "cached_apps_freezer";
17629  
17630          /**
17631           * Configuration flags for smart replies in notifications.
17632           * This is encoded as a key=value list, separated by commas. Ex:
17633           *
17634           * "enabled=1,max_squeeze_remeasure_count=3"
17635           *
17636           * The following keys are supported:
17637           *
17638           * <pre>
17639           * enabled                           (boolean)
17640           * requires_targeting_p              (boolean)
17641           * max_squeeze_remeasure_attempts    (int)
17642           * edit_choices_before_sending       (boolean)
17643           * show_in_heads_up                  (boolean)
17644           * min_num_system_generated_replies  (int)
17645           * max_num_actions                   (int)
17646           * </pre>
17647           * @see com.android.systemui.statusbar.policy.SmartReplyConstants
17648           * @hide
17649           */
17650          @Readable
17651          public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS =
17652                  "smart_replies_in_notifications_flags";
17653  
17654          /**
17655           * Configuration flags for the automatic generation of smart replies and smart actions in
17656           * notifications. This is encoded as a key=value list, separated by commas. Ex:
17657           * "generate_replies=false,generate_actions=true".
17658           *
17659           * The following keys are supported:
17660           *
17661           * <pre>
17662           * generate_replies                 (boolean)
17663           * generate_actions                 (boolean)
17664           * </pre>
17665           * @hide
17666           */
17667          @Readable
17668          public static final String SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS =
17669                  "smart_suggestions_in_notifications_flags";
17670  
17671          /**
17672           * If nonzero, crashes in foreground processes will bring up a dialog.
17673           * Otherwise, the process will be silently killed.
17674           * @hide
17675           */
17676          @TestApi
17677          @Readable
17678          @SuppressLint("NoSettingsProvider")
17679          public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog";
17680  
17681          /**
17682           * If nonzero, crash dialogs will show an option to restart the app.
17683           * @hide
17684           */
17685          @Readable
17686          public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog";
17687  
17688          /**
17689           * If nonzero, crash dialogs will show an option to mute all future crash dialogs for
17690           * this app.
17691           * @hide
17692           */
17693          @Readable
17694          public static final String SHOW_MUTE_IN_CRASH_DIALOG = "show_mute_in_crash_dialog";
17695  
17696  
17697          /**
17698           * If nonzero, will show the zen upgrade notification when the user toggles DND on/off.
17699           * @hide
17700           * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_UPGRADE_NOTIFICATION}
17701           */
17702          @Deprecated
17703          public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification";
17704  
17705          /**
17706           * If nonzero, will show the zen update settings suggestion.
17707           * @hide
17708           * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_SETTINGS_SUGGESTION}
17709           */
17710          @Deprecated
17711          public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion";
17712  
17713          /**
17714           * If nonzero, zen has not been updated to reflect new changes.
17715           * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_UPDATED}
17716           * @hide
17717           */
17718          @Deprecated
17719          public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated";
17720  
17721          /**
17722           * If nonzero, zen setting suggestion has been viewed by user
17723           * @hide
17724           * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_SUGGESTION_VIEWED}
17725           */
17726          @Deprecated
17727          public static final String ZEN_SETTINGS_SUGGESTION_VIEWED =
17728                  "zen_settings_suggestion_viewed";
17729  
17730          /**
17731           * Backup and restore agent timeout parameters.
17732           * These parameters are represented by a comma-delimited key-value list.
17733           *
17734           * The following strings are supported as keys:
17735           * <pre>
17736           *     kv_backup_agent_timeout_millis         (long)
17737           *     full_backup_agent_timeout_millis       (long)
17738           *     shared_backup_agent_timeout_millis     (long)
17739           *     restore_agent_timeout_millis           (long)
17740           *     restore_agent_finished_timeout_millis  (long)
17741           * </pre>
17742           *
17743           * They map to milliseconds represented as longs.
17744           *
17745           * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000"
17746           *
17747           * @hide
17748           */
17749          @Readable
17750          public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS =
17751                  "backup_agent_timeout_parameters";
17752  
17753          /**
17754           * Blocklist of GNSS satellites.
17755           *
17756           * This is a list of integers separated by commas to represent pairs of (constellation,
17757           * svid). Thus, the number of integers should be even.
17758           *
17759           * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are
17760           * blocklisted. Note that svid=0 denotes all svids in the constellation are blocklisted.
17761           *
17762           * @hide
17763           */
17764          public static final String GNSS_SATELLITE_BLOCKLIST = "gnss_satellite_blocklist";
17765  
17766          /**
17767           * Duration of updates in millisecond for GNSS location request from HAL to framework.
17768           *
17769           * If zero, the GNSS location request feature is disabled.
17770           *
17771           * The value is a non-negative long.
17772           *
17773           * @hide
17774           */
17775          @Readable
17776          public static final String GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS =
17777                  "gnss_hal_location_request_duration_millis";
17778  
17779          /**
17780           * Binder call stats settings.
17781           *
17782           * The following strings are supported as keys:
17783           * <pre>
17784           *     enabled              (boolean)
17785           *     detailed_tracking    (boolean)
17786           *     upload_data          (boolean)
17787           *     sampling_interval    (int)
17788           * </pre>
17789           *
17790           * @hide
17791           */
17792          @Readable
17793          public static final String BINDER_CALLS_STATS = "binder_calls_stats";
17794  
17795          /**
17796           * Looper stats settings.
17797           *
17798           * The following strings are supported as keys:
17799           * <pre>
17800           *     enabled              (boolean)
17801           *     sampling_interval    (int)
17802           * </pre>
17803           *
17804           * @hide
17805           */
17806          @Readable
17807          public static final String LOOPER_STATS = "looper_stats";
17808  
17809          /**
17810           * Settings for collecting statistics on CPU usage per thread
17811           *
17812           * The following strings are supported as keys:
17813           * <pre>
17814           *     num_buckets          (int)
17815           *     collected_uids       (string)
17816           *     minimum_total_cpu_usage_millis (int)
17817           * </pre>
17818           *
17819           * @hide
17820           */
17821          @Readable
17822          public static final String KERNEL_CPU_THREAD_READER = "kernel_cpu_thread_reader";
17823  
17824          /**
17825           * Whether we've enabled native flags health check on this device. Takes effect on
17826           * reboot. The value "1" enables native flags health check; otherwise it's disabled.
17827           * @hide
17828           */
17829          @Readable
17830          public static final String NATIVE_FLAGS_HEALTH_CHECK_ENABLED =
17831                  "native_flags_health_check_enabled";
17832  
17833          /**
17834           * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the mode
17835           * in which the historical registry operates.
17836           *
17837           * @hide
17838           */
17839          @Readable
17840          public static final String APPOP_HISTORY_MODE = "mode";
17841  
17842          /**
17843           * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls how long
17844           * is the interval between snapshots in the base case i.e. the most recent
17845           * part of the history.
17846           *
17847           * @hide
17848           */
17849          @Readable
17850          public static final String APPOP_HISTORY_BASE_INTERVAL_MILLIS = "baseIntervalMillis";
17851  
17852          /**
17853           * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the base
17854           * for the logarithmic step when building app op history.
17855           *
17856           * @hide
17857           */
17858          @Readable
17859          public static final String APPOP_HISTORY_INTERVAL_MULTIPLIER = "intervalMultiplier";
17860  
17861          /**
17862           * Appop history parameters. These parameters are represented by
17863           * a comma-delimited key-value list.
17864           *
17865           * The following strings are supported as keys:
17866           * <pre>
17867           *     mode                  (int)
17868           *     baseIntervalMillis    (long)
17869           *     intervalMultiplier    (int)
17870           * </pre>
17871           *
17872           * Ex: "mode=HISTORICAL_MODE_ENABLED_ACTIVE,baseIntervalMillis=1000,intervalMultiplier=10"
17873           *
17874           * @see #APPOP_HISTORY_MODE
17875           * @see #APPOP_HISTORY_BASE_INTERVAL_MILLIS
17876           * @see #APPOP_HISTORY_INTERVAL_MULTIPLIER
17877           *
17878           * @hide
17879           */
17880          @Readable
17881          public static final String APPOP_HISTORY_PARAMETERS =
17882                  "appop_history_parameters";
17883  
17884          /**
17885           * Auto revoke parameters. These parameters are represented by
17886           * a comma-delimited key-value list.
17887           *
17888           * <pre>
17889           *     enabledForPreRApps    (bolean)
17890           *     unusedThresholdMs     (long)
17891           *     checkFrequencyMs      (long)
17892           * </pre>
17893           *
17894           * Ex: "enabledForPreRApps=false,unusedThresholdMs=7776000000,checkFrequencyMs=1296000000"
17895           *
17896           * @hide
17897           */
17898          @Readable
17899          public static final String AUTO_REVOKE_PARAMETERS =
17900                  "auto_revoke_parameters";
17901  
17902          /**
17903           * Delay for sending ACTION_CHARGING after device is plugged in.
17904           * This is used as an override for constants defined in BatteryStatsImpl for
17905           * ease of experimentation.
17906           *
17907           * @see com.android.internal.os.BatteryStatsImpl.Constants.KEY_BATTERY_CHARGED_DELAY_MS
17908           * @hide
17909           */
17910          @Readable
17911          public static final String BATTERY_CHARGING_STATE_UPDATE_DELAY =
17912                  "battery_charging_state_update_delay";
17913  
17914          /**
17915           * A serialized string of params that will be loaded into a text classifier action model.
17916           *
17917           * @hide
17918           */
17919          @Readable
17920          public static final String TEXT_CLASSIFIER_ACTION_MODEL_PARAMS =
17921                  "text_classifier_action_model_params";
17922  
17923          /**
17924           * The amount of time to suppress "power-off" from the power button after the device has
17925           * woken due to a gesture (lifting the phone).  Since users have learned to hit the power
17926           * button immediately when lifting their device, it can cause the device to turn off if a
17927           * gesture has just woken the device. This value tells us the milliseconds to wait after
17928           * a gesture before "power-off" via power-button is functional again. A value of 0 is no
17929           * delay, and reverts to the old behavior.
17930           *
17931           * @hide
17932           */
17933          @Readable
17934          public static final String POWER_BUTTON_SUPPRESSION_DELAY_AFTER_GESTURE_WAKE =
17935                  "power_button_suppression_delay_after_gesture_wake";
17936  
17937          /**
17938           * The usage amount of advanced battery. The value is 0~100.
17939           *
17940           * @hide
17941           */
17942          @Readable
17943          public static final String ADVANCED_BATTERY_USAGE_AMOUNT = "advanced_battery_usage_amount";
17944  
17945          /**
17946           * For 5G NSA capable devices, determines whether NR tracking indications are on
17947           * when the screen is off.
17948           *
17949           * Values are:
17950           * 0: off - All 5G NSA tracking indications are off when the screen is off.
17951           * 1: extended - All 5G NSA tracking indications are on when the screen is off as long as
17952           *    the device is camped on 5G NSA (5G icon is showing in status bar).
17953           *    If the device is not camped on 5G NSA, tracking indications are off.
17954           * 2: always on - All 5G NSA tracking indications are on whether the screen is on or off.
17955           * @hide
17956           */
17957          @Readable
17958          public static final String NR_NSA_TRACKING_SCREEN_OFF_MODE =
17959                  "nr_nsa_tracking_screen_off_mode";
17960  
17961          /**
17962           * Whether to show People Space.
17963           * Values are:
17964           * 0: Disabled (default)
17965           * 1: Enabled
17966           * @hide
17967           */
17968          public static final String SHOW_PEOPLE_SPACE = "show_people_space";
17969  
17970          /**
17971           * Which types of conversation(s) to show in People Space.
17972           * Values are:
17973           * 0: Single user-selected conversation (default)
17974           * 1: Priority conversations only
17975           * 2: All conversations
17976           * @hide
17977           */
17978          public static final String PEOPLE_SPACE_CONVERSATION_TYPE =
17979                  "people_space_conversation_type";
17980  
17981          /**
17982           * Whether to show new notification dismissal.
17983           * Values are:
17984           * 0: Disabled
17985           * 1: Enabled
17986           * @hide
17987           */
17988          public static final String SHOW_NEW_NOTIF_DISMISS = "show_new_notif_dismiss";
17989  
17990          /**
17991           * The maximum allowed obscuring opacity by UID to propagate touches.
17992           *
17993           * For certain window types (eg. SAWs), the decision of honoring {@link LayoutParams
17994           * #FLAG_NOT_TOUCHABLE} or not depends on the combined obscuring opacity of the windows
17995           * above the touch-consuming window.
17996           *
17997           * For a certain UID:
17998           * <ul>
17999           *     <li>If it's the same as the UID of the touch-consuming window, allow it to propagate
18000           *     the touch.
18001           *     <li>Otherwise take all its windows of eligible window types above the touch-consuming
18002           *     window, compute their combined obscuring opacity considering that {@code
18003           *     opacity(A, B) = 1 - (1 - opacity(A))*(1 - opacity(B))}. If the computed value is
18004           *     lesser than or equal to this setting and there are no other windows preventing the
18005           *     touch, allow the UID to propagate the touch.
18006           * </ul>
18007           *
18008           * @see android.hardware.input.InputManager#getMaximumObscuringOpacityForTouch()
18009           * @see android.hardware.input.InputManager#setMaximumObscuringOpacityForTouch(float)
18010           *
18011           * @hide
18012           */
18013          @Readable
18014          public static final String MAXIMUM_OBSCURING_OPACITY_FOR_TOUCH =
18015                  "maximum_obscuring_opacity_for_touch";
18016  
18017          /**
18018           * Used to enable / disable the Restricted Networking Mode in which network access is
18019           * restricted to apps holding the CONNECTIVITY_USE_RESTRICTED_NETWORKS permission.
18020           *
18021           * Values are:
18022           * 0: disabled
18023           * 1: enabled
18024           * @hide
18025           */
18026          public static final String RESTRICTED_NETWORKING_MODE = "restricted_networking_mode";
18027  
18028          /**
18029           * Setting indicating whether Low Power Standby is enabled, if supported.
18030           *
18031           * Values are:
18032           * 0: disabled
18033           * 1: enabled
18034           *
18035           * @hide
18036           */
18037          public static final String LOW_POWER_STANDBY_ENABLED = "low_power_standby_enabled";
18038  
18039          /**
18040           * Setting indicating whether Low Power Standby is allowed to be active during doze
18041           * maintenance mode.
18042           *
18043           * Values are:
18044           * 0: Low Power Standby will be disabled during doze maintenance mode
18045           * 1: Low Power Standby can be active during doze maintenance mode
18046           *
18047           * @hide
18048           */
18049          public static final String LOW_POWER_STANDBY_ACTIVE_DURING_MAINTENANCE =
18050                  "low_power_standby_active_during_maintenance";
18051  
18052          /**
18053           * Timeout for the system server watchdog.
18054           *
18055           * @see {@link com.android.server.Watchdog}.
18056           *
18057           * @hide
18058           */
18059          public static final String WATCHDOG_TIMEOUT_MILLIS =
18060                  "system_server_watchdog_timeout_ms";
18061  
18062          /**
18063           * Whether to enable managed device provisioning via the role holder.
18064           *
18065           * @hide
18066           */
18067          public static final String MANAGED_PROVISIONING_DEFER_PROVISIONING_TO_ROLE_HOLDER =
18068                  "managed_provisioning_defer_provisioning_to_role_holder";
18069  
18070          /**
18071           * State of whether review notification permissions notification needs to
18072           * be shown the user, and whether the user has interacted.
18073           *
18074           * Valid values:
18075           *   -1 = UNKNOWN
18076           *    0 = SHOULD_SHOW
18077           *    1 = USER_INTERACTED
18078           *    2 = DISMISSED
18079           *    3 = RESHOWN
18080           * @hide
18081           */
18082          public static final String REVIEW_PERMISSIONS_NOTIFICATION_STATE =
18083                  "review_permissions_notification_state";
18084  
18085          /**
18086           * Whether repair mode is active on the device.
18087           * <p>
18088           * Set to 1 for true and 0 for false.
18089           *
18090           * @hide
18091           */
18092          public static final String REPAIR_MODE_ACTIVE = "repair_mode_active";
18093  
18094          /**
18095           * Settings migrated from Wear OS settings provider.
18096           * @hide
18097           */
18098          public static class Wearable {
18099              /**
18100               * Whether the user has any pay tokens on their watch.
18101               * @hide
18102               */
18103              public static final String HAS_PAY_TOKENS = "has_pay_tokens";
18104  
18105              /**
18106               * Gcm checkin timeout in minutes.
18107               * @hide
18108               */
18109              public static final String GMS_CHECKIN_TIMEOUT_MIN = "gms_checkin_timeout_min";
18110  
18111              /**
18112               * If hotword detection should be enabled.
18113               * @hide
18114               */
18115              public static final String HOTWORD_DETECTION_ENABLED = "hotword_detection_enabled";
18116  
18117              /**
18118               * Whether Smart Replies are enabled within Wear.
18119               * @hide
18120               */
18121              public static final String SMART_REPLIES_ENABLED = "smart_replies_enabled";
18122  
18123              /**
18124               * The default vibration pattern.
18125               * @hide
18126               */
18127              public static final String DEFAULT_VIBRATION = "default_vibration";
18128  
18129              /**
18130               * If FLP should obtain location data from the paired device.
18131               * @hide
18132               */
18133              public static final String OBTAIN_PAIRED_DEVICE_LOCATION =
18134                      "obtain_paired_device_location";
18135  
18136              /**
18137               * The play store availability on companion phone.
18138               * @hide
18139               */
18140              public static final String PHONE_PLAY_STORE_AVAILABILITY =
18141                      "phone_play_store_availability";
18142  
18143              // Possible phone play store availability states
18144              /** @hide */
18145              public static final int PHONE_PLAY_STORE_AVAILABILITY_UNKNOWN = 0;
18146              /** @hide */
18147              public static final int PHONE_PLAY_STORE_AVAILABLE = 1;
18148              /** @hide */
18149              public static final int PHONE_PLAY_STORE_UNAVAILABLE = 2;
18150  
18151              /**
18152               * Whether the bug report is enabled.
18153               * @hide
18154               */
18155              public static final String BUG_REPORT = "bug_report";
18156  
18157              // Possible bug report states
18158              /** @hide */
18159              public static final int BUG_REPORT_DISABLED = 0;
18160              /** @hide */
18161              public static final int BUG_REPORT_ENABLED = 1;
18162  
18163              /**
18164               * The enabled/disabled state of the SmartIlluminate.
18165               * @hide
18166               */
18167              public static final String SMART_ILLUMINATE_ENABLED = "smart_illuminate_enabled";
18168  
18169              /**
18170               * Whether automatic time is enabled on the watch.
18171               * @hide
18172               */
18173              public static final String CLOCKWORK_AUTO_TIME = "clockwork_auto_time";
18174  
18175              // Possible clockwork auto time states
18176              /** @hide */
18177              public static final int SYNC_TIME_FROM_PHONE = 0;
18178              /** @hide */
18179              public static final int SYNC_TIME_FROM_NETWORK = 1;
18180              /** @hide */
18181              public static final int AUTO_TIME_OFF = 2;
18182              /** @hide */
18183              public static final int INVALID_AUTO_TIME_STATE = 3;
18184  
18185  
18186              /**
18187               * Whether automatic time zone is enabled on the watch.
18188               * @hide
18189               */
18190              public static final String CLOCKWORK_AUTO_TIME_ZONE = "clockwork_auto_time_zone";
18191  
18192              // Possible clockwork auto time zone states
18193              /** @hide */
18194              public static final int SYNC_TIME_ZONE_FROM_PHONE = 0;
18195              /** @hide */
18196              public static final int SYNC_TIME_ZONE_FROM_NETWORK = 1;
18197              /** @hide */
18198              public static final int AUTO_TIME_ZONE_OFF = 2;
18199              /** @hide */
18200              public static final int INVALID_AUTO_TIME_ZONE_STATE = 3;
18201  
18202              /**
18203               * Whether 24 hour time format is enabled on the watch.
18204               * @hide
18205               */
18206              public static final String CLOCKWORK_24HR_TIME = "clockwork_24hr_time";
18207  
18208              /**
18209               * Whether the auto wifi toggle setting is enabled.
18210               * @hide
18211               */
18212              public static final String AUTO_WIFI = "auto_wifi";
18213  
18214              // Possible force wifi on states
18215              /** @hide */
18216              public static final int AUTO_WIFI_DISABLED = 0;
18217              /** @hide */
18218              public static final int AUTO_WIFI_ENABLED = 1;
18219  
18220              /**
18221               * The number of minutes after the WiFi enters power save mode.
18222               * @hide
18223               */
18224              public static final String WIFI_POWER_SAVE = "wifi_power_save";
18225  
18226              /**
18227               * The time at which we should no longer skip the wifi requirement check (we skip the
18228               * wifi requirement until this time). The time is in millis since epoch.
18229               * @hide
18230               */
18231              public static final String ALT_BYPASS_WIFI_REQUIREMENT_TIME_MILLIS =
18232                      "alt_bypass_wifi_requirement_time_millis";
18233  
18234              /**
18235               * Whether the setup was skipped.
18236               * @hide
18237               */
18238              public static final String SETUP_SKIPPED = "setup_skipped";
18239  
18240              // Possible setup_skipped states
18241              /** @hide */
18242              public static final int SETUP_SKIPPED_UNKNOWN = 0;
18243              /** @hide */
18244              public static final int SETUP_SKIPPED_YES = 1;
18245              /** @hide */
18246              public static final int SETUP_SKIPPED_NO = 2;
18247  
18248              /**
18249               * The last requested call forwarding action.
18250               * @hide
18251               */
18252              public static final String LAST_CALL_FORWARD_ACTION = "last_call_forward_action";
18253  
18254              // Possible call forwarding actions
18255              /** @hide */
18256              public static final int CALL_FORWARD_ACTION_ON = 1;
18257              /** @hide */
18258              public static final int CALL_FORWARD_ACTION_OFF = 2;
18259              /** @hide */
18260              public static final int CALL_FORWARD_NO_LAST_ACTION = -1;
18261  
18262              // Stem button settings.
18263              /** @hide */
18264              public static final String STEM_1_TYPE = "STEM_1_TYPE";
18265              /** @hide */
18266              public static final String STEM_1_DATA = "STEM_1_DATA";
18267              /** @hide */
18268              public static final String STEM_1_DEFAULT_DATA = "STEM_1_DEFAULT_DATA";
18269              /** @hide */
18270              public static final String STEM_2_TYPE = "STEM_2_TYPE";
18271              /** @hide */
18272              public static final String STEM_2_DATA = "STEM_2_DATA";
18273              /** @hide */
18274              public static final String STEM_2_DEFAULT_DATA = "STEM_2_DEFAULT_DATA";
18275              /** @hide */
18276              public static final String STEM_3_TYPE = "STEM_3_TYPE";
18277              /** @hide */
18278              public static final String STEM_3_DATA = "STEM_3_DATA";
18279              /** @hide */
18280              public static final String STEM_3_DEFAULT_DATA = "STEM_3_DEFAULT_DATA";
18281  
18282              // Stem types
18283              /** @hide */
18284              public static final int STEM_TYPE_UNKNOWN = -1;
18285              /** @hide */
18286              public static final int STEM_TYPE_APP_LAUNCH = 0;
18287              /** @hide */
18288              public static final int STEM_TYPE_CONTACT_LAUNCH = 1;
18289  
18290              /**
18291               * If the device should be muted when off body.
18292               * @hide
18293               */
18294              public static final String MUTE_WHEN_OFF_BODY_ENABLED = "obtain_mute_when_off_body";
18295  
18296              /**
18297               * Wear OS version string.
18298               * @hide
18299               */
18300              public static final String WEAR_OS_VERSION_STRING = "wear_os_version_string";
18301  
18302              /**
18303               * Whether there is a side button.
18304               * @hide
18305               */
18306              public static final String SIDE_BUTTON = "side_button";
18307  
18308              /**
18309               * The android wear system version.
18310               * @hide
18311               */
18312              public static final String ANDROID_WEAR_VERSION = "android_wear_version";
18313  
18314              /**
18315               * The wear system capabiltiies.
18316               * @hide
18317               */
18318              public static final String SYSTEM_CAPABILITIES = "system_capabilities";
18319  
18320              /**
18321               * The android wear system edition.
18322               * @hide
18323               */
18324              public static final String SYSTEM_EDITION = "android_wear_system_edition";
18325  
18326              /**
18327               * The Wear platform MR number.
18328               * @hide
18329               */
18330              public static final String WEAR_PLATFORM_MR_NUMBER = "wear_platform_mr_number";
18331  
18332              /**
18333               * The mobile signal detector setting.
18334               * @hide
18335               */
18336              public static final String MOBILE_SIGNAL_DETECTOR = "mobile_signal_detector";
18337  
18338  
18339              /**
18340               * Whether ambient is currently enabled.
18341               * @hide
18342               */
18343              public static final String AMBIENT_ENABLED = "ambient_enabled";
18344  
18345              /**
18346               * Whether ambient tilt to wake is enabled.
18347               * @hide
18348               */
18349              public static final String AMBIENT_TILT_TO_WAKE = "ambient_tilt_to_wake";
18350  
18351              /**
18352               * Whether ambient low bit mode is enabled by developer options.
18353               * @hide
18354               */
18355              public static final String AMBIENT_LOW_BIT_ENABLED_DEV = "ambient_low_bit_enabled_dev";
18356  
18357              /**
18358               * Whether ambient touch to wake is enabled.
18359               * @hide
18360               */
18361              public static final String AMBIENT_TOUCH_TO_WAKE = "ambient_touch_to_wake";
18362  
18363              /**
18364               * Whether ambient tilt to bright is enabled.
18365               * @hide
18366               */
18367              public static final String AMBIENT_TILT_TO_BRIGHT = "ambient_tilt_to_bright";
18368  
18369              /**
18370               * Whether touch and hold to edit WF is enabled
18371               * @hide
18372               */
18373              public static final String GESTURE_TOUCH_AND_HOLD_WATCH_FACE_ENABLED =
18374                      "gesture_touch_and_hold_watchface_enabled";
18375  
18376              /**
18377               * Whether screenshot is enabled.
18378               * @hide
18379               */
18380              public static final String SCREENSHOT_ENABLED = "screenshot_enabled";
18381  
18382              /**
18383               * Whether bedtime mode is enabled.
18384               * @hide
18385               */
18386              public static final String BEDTIME_MODE = "bedtime_mode";
18387  
18388              /**
18389               * Whether hard bedtime mode is active thus limiting user interactions.
18390               */
18391              public static final String BEDTIME_HARD_MODE = "bedtime_hard_mode";
18392  
18393              /**
18394               * Whether the current watchface is decomposable.
18395               * @hide
18396               */
18397              public static final String DECOMPOSABLE_WATCHFACE = "current_watchface_decomposable";
18398  
18399              /**
18400               * Whether to force ambient when docked.
18401               * @hide
18402               */
18403              public static final String AMBIENT_FORCE_WHEN_DOCKED = "ambient_force_when_docked";
18404  
18405              /**
18406               * Whether the ambient low bit mode is enabled.
18407               * @hide
18408               */
18409              public static final String AMBIENT_LOW_BIT_ENABLED = "ambient_low_bit_enabled";
18410  
18411              /**
18412               * The timeout duration in minutes of ambient mode when plugged in.
18413               * @hide
18414               */
18415              public static final String AMBIENT_PLUGGED_TIMEOUT_MIN = "ambient_plugged_timeout_min";
18416  
18417              /**
18418               * What OS does paired device has.
18419               * @hide
18420               */
18421              public static final String PAIRED_DEVICE_OS_TYPE = "paired_device_os_type";
18422  
18423              // Possible values of PAIRED_DEVICE_OS_TYPE
18424              /** @hide */
18425              public static final int PAIRED_DEVICE_OS_TYPE_UNKNOWN = 0;
18426              /** @hide */
18427              public static final int PAIRED_DEVICE_OS_TYPE_ANDROID = 1;
18428              /** @hide */
18429              public static final int PAIRED_DEVICE_OS_TYPE_IOS = 2;
18430  
18431              /**
18432               * The bluetooth settings selected BLE role for the companion.
18433               * @hide
18434               */
18435              public static final String COMPANION_BLE_ROLE = "companion_ble_role";
18436  
18437              // Possible values of COMPANION_BLE_ROLE
18438              /** @hide */
18439              public static final int BLUETOOTH_ROLE_CENTRAL = 1;
18440              /** @hide */
18441              public static final int BLUETOOTH_ROLE_PERIPHERAL = 2;
18442  
18443              /**
18444               * The bluetooth settings stored companion device name.
18445               * @hide
18446               */
18447              public static final String COMPANION_NAME = "companion_bt_name";
18448  
18449              /**
18450               * The user's last setting for hfp client.
18451               * @hide
18452               */
18453              public static final String USER_HFP_CLIENT_SETTING = "user_hfp_client_setting";
18454  
18455              // Possible hfp client user setting values
18456              /** @hide */
18457              public static final int HFP_CLIENT_UNSET = 0;
18458              /** @hide */
18459              public static final int HFP_CLIENT_ENABLED = 1;
18460              /** @hide */
18461              public static final int HFP_CLIENT_DISABLED = 2;
18462  
18463              /**
18464               * The companion phone's android version.
18465               * @hide
18466               */
18467              public static final String COMPANION_OS_VERSION = "wear_companion_os_version";
18468  
18469              // Companion os version constants
18470              /** @hide */
18471              public static final int COMPANION_OS_VERSION_UNDEFINED = -1;
18472  
18473              /**
18474               * The companion App name.
18475               * @hide
18476               */
18477              public static final String COMPANION_APP_NAME = "wear_companion_app_name";
18478  
18479              /**
18480               * A boolean value to indicate if we want to support all languages in LE edition on
18481               * wear. 1 for supporting, 0 for not supporting.
18482               * @hide
18483               */
18484              public static final String ENABLE_ALL_LANGUAGES = "enable_all_languages";
18485  
18486              /**
18487               * The Locale (as language tag) the user chose at startup.
18488               * @hide
18489               */
18490              public static final String SETUP_LOCALE = "setup_locale";
18491  
18492              /**
18493               * The version of oem setup present.
18494               * @hide
18495               */
18496              public static final String OEM_SETUP_VERSION = "oem_setup_version";
18497  
18498              /**
18499               * The key to indicate to Setup Wizard if OEM setup is completed in Wear Services.
18500               * @hide
18501               */
18502              public static final String OEM_SETUP_COMPLETED_STATUS = "oem_setup_completed_status";
18503  
18504               /**
18505                * Constant provided to Setup Wizard to inform about failure of OEM setup in Wear
18506                * Services. The value should be provided with setting name {@link
18507                * #OEM_SETUP_COMPLETED_STATUS}.
18508                * @hide
18509                */
18510              public static final int OEM_SETUP_COMPLETED_FAILURE = 0;
18511  
18512              /**
18513               * Constant provided to Setup Wizard to inform about successful completion of OEM setup
18514               * in Wear Services. The value should be provided with setting name {@link
18515               * #OEM_SETUP_COMPLETED_STATUS}.
18516               * @hide
18517               */
18518              public static final int OEM_SETUP_COMPLETED_SUCCESS = 1;
18519  
18520              /**
18521               * Controls the gestures feature.
18522               * @hide
18523               */
18524              public static final String MASTER_GESTURES_ENABLED = "master_gestures_enabled";
18525  
18526              /**
18527               * Whether or not ungaze is enabled.
18528               * @hide
18529               */
18530              public static final String UNGAZE_ENABLED = "ungaze_enabled";
18531  
18532              /**
18533               * The device's battery saver mode, which can be one of the following:
18534               * -{@link BATTERY_SAVER_MODE_NONE}
18535               * -{@link BATTERY_SAVER_MODE_LIGHT}
18536               * -{@link BATTERY_SAVER_MODE_TRADITIONAL_WATCH}
18537               * -{@link BATTERY_SAVER_MODE_TIME_ONLY}
18538               * -{@link BATTERY_SAVER_MODE_CUSTOM}
18539               * @hide
18540               */
18541              public static final String BATTERY_SAVER_MODE = "battery_saver_mode";
18542  
18543              /**
18544               * Not in Battery Saver Mode
18545               * @hide
18546               */
18547              public static final int BATTERY_SAVER_MODE_NONE = 0;
18548              /**
18549               * In Lightweight Battery Saver Mode
18550               * @hide
18551               */
18552              public static final int BATTERY_SAVER_MODE_LIGHT = 1;
18553              /**
18554               * In Traditional Watch Mode Battery Saver Mode
18555               * @hide
18556               */
18557              public static final int BATTERY_SAVER_MODE_TRADITIONAL_WATCH = 2;
18558              /**
18559               * In Time-only Mode Battery Saver Mode
18560               * @hide
18561               */
18562              public static final int BATTERY_SAVER_MODE_TIME_ONLY = 3;
18563              /**
18564               * Partner's Battery Saver implementation is being used
18565               * @hide
18566               */
18567              public static final int BATTERY_SAVER_MODE_CUSTOM = 4;
18568  
18569              /**
18570               * The maximum ambient mode duration when an activity is allowed to auto resume.
18571               * @hide
18572               */
18573              public static final String WEAR_ACTIVITY_AUTO_RESUME_TIMEOUT_MS =
18574                      "wear_activity_auto_resume_timeout_ms";
18575  
18576              /**
18577               * If the current {@code WEAR_ACTIVITY_AUTO_RESUME_TIMEOUT_MS} value is set by user.
18578               * 1 for true, 0 for false.
18579               * @hide
18580               */
18581              public static final String WEAR_ACTIVITY_AUTO_RESUME_TIMEOUT_SET_BY_USER =
18582                      "wear_activity_auto_resume_timeout_set_by_user";
18583  
18584              /**
18585               * If burn in protection is enabled.
18586               * @hide
18587               */
18588              public static final String BURN_IN_PROTECTION_ENABLED = "burn_in_protection";
18589  
18590              /**
18591               * Whether the device has combined location setting enabled.
18592               *
18593               * @deprecated Use LocationManager as the source of truth for all location states.
18594               *
18595               * @hide
18596               */
18597              @Deprecated
18598              public static final String COMBINED_LOCATION_ENABLED = "combined_location_enable";
18599  
18600              /**
18601               * The wrist orientation mode of the device
18602               * Valid values - LEFT_WRIST_ROTATION_0 = "0" (default), LEFT_WRIST_ROTATION_180 = "1",
18603               *          RIGHT_WRIST_ROTATION_0 = "2", RIGHT_WRIST_ROTATION_180 = "3"
18604               * @hide
18605               */
18606              public static final String WRIST_ORIENTATION_MODE = "wear_wrist_orientation_mode";
18607  
18608              /**
18609               * Current lock screen state of the device
18610               * (null = default value of this setting (lockscreen is never set),
18611               * 0 = {@link #LOCK_SCREEN_STATE_NONE},
18612               * 1 = {@link #LOCK_SCREEN_STATE_PIN},
18613               * 2 = {@link #LOCK_SCREEN_STATE_PATTERN})
18614               * @hide
18615               */
18616              public static final String LOCK_SCREEN_STATE = "lock_screen_state";
18617  
18618              /**
18619               * No lock screen set
18620               * One of the possible states for {@link #LOCK_SCREEN_STATE}.
18621               * @hide
18622               */
18623              public static final int LOCK_SCREEN_STATE_NONE = 0;
18624  
18625              /**
18626               * Lock screen set as a pin
18627               * One of the possible states for {@link #LOCK_SCREEN_STATE}.
18628               * @hide
18629               */
18630              public static final int LOCK_SCREEN_STATE_PIN = 1;
18631  
18632              /**
18633               * Lock screen set as a pattern
18634               * One of the possible states for {@link #LOCK_SCREEN_STATE}.
18635               * @hide
18636               */
18637              public static final int LOCK_SCREEN_STATE_PATTERN = 2;
18638  
18639              /**
18640               * Setting indicating the name of the Wear OS app package containing the device's sysui.
18641               *
18642               * @hide
18643               */
18644              public static final String CLOCKWORK_SYSUI_PACKAGE = "clockwork_sysui_package";
18645  
18646              /**
18647               * Setting indicating the name of the main activity of the Wear OS sysui.
18648               *
18649               * @hide
18650               */
18651              public static final String CLOCKWORK_SYSUI_MAIN_ACTIVITY =
18652                      "clockwork_sysui_main_activity";
18653  
18654              /**
18655               * Setting to disable power button long press launching Assistant. It's boolean, i.e.
18656               * enabled = 1, disabled = 0. By default, this setting is enabled.
18657               *
18658               * @hide
18659               */
18660              public static final String CLOCKWORK_LONG_PRESS_TO_ASSISTANT_ENABLED =
18661                      "clockwork_long_press_to_assistant_enabled";
18662  
18663              /**
18664               * Whether the device has Cooldown Mode enabled.
18665               * @hide
18666               */
18667              public static final String COOLDOWN_MODE_ON = "cooldown_mode_on";
18668  
18669              /**
18670               * Whether the device has Wet Mode/ Touch Lock Mode enabled.
18671               * @hide
18672               */
18673              public static final String WET_MODE_ON = "wet_mode_on";
18674  
18675              /**
18676               * Whether the RSB wake feature is enabled.
18677               * @hide
18678               */
18679              public static final String RSB_WAKE_ENABLED = "rsb_wake_enabled";
18680  
18681              /**
18682               * Whether the screen-unlock (keyguard) sound is enabled.
18683               * @hide
18684               */
18685              public static final String SCREEN_UNLOCK_SOUND_ENABLED = "screen_unlock_sound_enabled";
18686  
18687              /**
18688               * Whether charging sounds are enabled.
18689               * @hide
18690               */
18691              public static final String CHARGING_SOUNDS_ENABLED = "wear_charging_sounds_enabled";
18692  
18693              /**
18694               * Whether dynamic color theming (e.g. Material You) is enabled for apps which support
18695               * it.
18696               *
18697               * @hide
18698               */
18699              public static final String DYNAMIC_COLOR_THEME_ENABLED = "dynamic_color_theme_enabled";
18700  
18701              /**
18702               * Current state of accessibility vibration watch feature
18703               * (0 = false, 1 = true)
18704               *
18705               * @hide
18706               */
18707              public static final String ACCESSIBILITY_VIBRATION_WATCH_ENABLED =
18708                      "a11y_vibration_watch_enabled";
18709  
18710              /**
18711               * Stores current type of accessibility vibration
18712               * (0 = {@link #ACCESSIBILITY_VIBRATION_WATCH_TYPE_DIGIT},
18713               * 1 = {@link #ACCESSIBILITY_VIBRATION_WATCH_TYPE_TERSE)
18714               *
18715               * @hide
18716               */
18717              public static final String ACCESSIBILITY_VIBRATION_WATCH_TYPE =
18718                      "a11y_vibration_watch_type";
18719  
18720              /**
18721               * Vibration watch type digit
18722               * One of the possible states for {@link #ACCESSIBILITY_VIBRATION_WATCH_TYPE}.
18723               *
18724               * @hide
18725               */
18726              public static final int ACCESSIBILITY_VIBRATION_WATCH_TYPE_DIGIT = 0;
18727  
18728              /**
18729               * Vibration watch type terse
18730               * One of the possible states for {@link #ACCESSIBILITY_VIBRATION_WATCH_TYPE}.
18731               *
18732               * @hide
18733               */
18734              public static final int ACCESSIBILITY_VIBRATION_WATCH_TYPE_TERSE = 1;
18735  
18736              /**
18737               * Stores current accessibility vibration watch speed
18738               * (0 = {@link #ACCESSIBILITY_VIBRATION_WATCH_SPEED_VERY_SLOW},
18739               * 1 = {@link #ACCESSIBILITY_VIBRATION_WATCH_SPEED_SLOW},
18740               * 2 = {@link #ACCESSIBILITY_VIBRATION_WATCH_SPEED_MEDIUM},
18741               * 3 = {@link #ACCESSIBILITY_VIBRATION_WATCH_SPEED_FAST},
18742               * 4 = {@link #ACCESSIBILITY_VIBRATION_WATCH_SPEED_VERY_FAST})
18743               */
18744              public static final String ACCESSIBILITY_VIBRATION_WATCH_SPEED = "vibration_speed";
18745  
18746              /**
18747               * Vibration watch speed type very slow
18748               * One of the possible states for {@link #ACCESSIBILITY_VIBRATION_WATCH_SPEED}.
18749               *
18750               * @hide
18751               */
18752              public static final int ACCESSIBILITY_VIBRATION_WATCH_SPEED_VERY_SLOW = 0;
18753  
18754              /**
18755               * Vibration watch speed type slow
18756               * One of the possible states for {@link #ACCESSIBILITY_VIBRATION_WATCH_SPEED}.
18757               *
18758               * @hide
18759               */
18760              public static final int ACCESSIBILITY_VIBRATION_WATCH_SPEED_SLOW = 1;
18761  
18762              /**
18763               * Vibration watch speed type medium
18764               * One of the possible states for {@link #ACCESSIBILITY_VIBRATION_WATCH_SPEED}.
18765               *
18766               * @hide
18767               */
18768              public static final int ACCESSIBILITY_VIBRATION_WATCH_SPEED_MEDIUM = 2;
18769  
18770              /**
18771               * Vibration watch speed type fast
18772               * One of the possible states for {@link #ACCESSIBILITY_VIBRATION_WATCH_SPEED}.
18773               *
18774               * @hide
18775               */
18776              public static final int ACCESSIBILITY_VIBRATION_WATCH_SPEED_FAST = 3;
18777  
18778              /**
18779               * Vibration watch speed type very fast
18780               * One of the possible states for {@link #ACCESSIBILITY_VIBRATION_WATCH_SPEED}.
18781               *
18782               * @hide
18783               */
18784              public static final int ACCESSIBILITY_VIBRATION_WATCH_SPEED_VERY_FAST = 4;
18785  
18786              /**
18787               * The key to indicate the data migration status on device upgrade in Wear Services.
18788               * @hide
18789               */
18790              public static final String UPGRADE_DATA_MIGRATION_STATUS =
18791                      "upgrade_data_migration_status";
18792  
18793              /**
18794               * Constant indicating that the data migration is not needed.
18795               *
18796               * The value should be provided with setting name {@link
18797               * #UPGRADE_DATA_MIGRATION_STATUS}.
18798               * @hide
18799               */
18800              public static final int UPGRADE_DATA_MIGRATION_NOT_NEEDED = 0;
18801  
18802              /**
18803               * Constant indicating that the data migration is not yet finished.
18804               *
18805               * The value should be provided with setting name {@link
18806               * #UPGRADE_DATA_MIGRATION_STATUS}.
18807               * @hide
18808               */
18809              public static final int UPGRADE_DATA_MIGRATION_PENDING = 1;
18810  
18811              /**
18812               * Constant indicating that the data migration is finished.
18813               *
18814               * The value should be provided with setting name {@link
18815               * #UPGRADE_DATA_MIGRATION_STATUS}.
18816               * @hide
18817               */
18818              public static final int UPGRADE_DATA_MIGRATION_DONE = 2;
18819  
18820              /**
18821               * Whether to disable AOD while plugged.
18822               * (0 = false, 1 = true)
18823               * @hide
18824               */
18825              public static final String DISABLE_AOD_WHILE_PLUGGED = "disable_aod_while_plugged";
18826  
18827              /**
18828               * Whether the user has consented for network location provider (NLP).
18829               * This setting key will only be used once during OOBE to set NLP initial value through
18830               * the companion app ToS. This setting key will be synced over from Companion and
18831               * corresponding toggle in GMS will be enabled.
18832               * @hide
18833               */
18834              public static final String NETWORK_LOCATION_OPT_IN = "network_location_opt_in";
18835  
18836              /**
18837               * The custom foreground color.
18838               * @hide
18839               */
18840              public static final String CUSTOM_COLOR_FOREGROUND = "custom_foreground_color";
18841  
18842              /**
18843               * The custom background color.
18844               * @hide
18845               */
18846              public static final String CUSTOM_COLOR_BACKGROUND = "custom_background_color";
18847  
18848              /** The status of the phone switching process.
18849               * @hide
18850               */
18851              public static final String PHONE_SWITCHING_STATUS = "phone_switching_status";
18852  
18853              /**
18854               * Phone switching not started
18855               * @hide
18856               */
18857              public static final int PHONE_SWITCHING_STATUS_NOT_STARTED = 0;
18858  
18859              /**
18860               * Phone switching started
18861               * @hide
18862               */
18863              public static final int PHONE_SWITCHING_STATUS_STARTED = 1;
18864  
18865              /**
18866               * Phone switching completed and was successful
18867               * @hide
18868               */
18869              public static final int PHONE_SWITCHING_STATUS_SUCCESS = 2;
18870  
18871              /**
18872               * Phone switching was cancelled
18873               * @hide
18874               */
18875              public static final int PHONE_SWITCHING_STATUS_CANCELLED = 3;
18876  
18877              /**
18878               * Phone switching failed
18879               * @hide
18880               */
18881              public static final int PHONE_SWITCHING_STATUS_FAILED = 4;
18882  
18883              /**
18884               * Phone switching is in progress of advertising to new companion device.
18885               * @hide
18886               */
18887              public static final int PHONE_SWITCHING_STATUS_IN_PROGRESS_ADVERTISING = 5;
18888  
18889              /**
18890               * Phone switching successfully bonded with new companion device.
18891               * @hide
18892               */
18893              public static final int PHONE_SWITCHING_STATUS_IN_PROGRESS_BONDED = 6;
18894  
18895              /**
18896               * Phone switching successfully completed on phone side.
18897               * @hide
18898               */
18899              public static final int PHONE_SWITCHING_STATUS_IN_PROGRESS_PHONE_COMPLETE = 7;
18900  
18901              /**
18902               * Connection config migration in progress.
18903               * @hide
18904               */
18905              public static final int PHONE_SWITCHING_STATUS_IN_PROGRESS_MIGRATION = 8;
18906  
18907              /**
18908               * Connection config migration failed.
18909               * @hide
18910               */
18911              public static final int PHONE_SWITCHING_STATUS_IN_PROGRESS_MIGRATION_FAILED = 9;
18912  
18913              /**
18914               * Connection config migration cancellation in progress.
18915               * @hide
18916               */
18917              public static final int PHONE_SWITCHING_STATUS_IN_PROGRESS_MIGRATION_CANCELLED = 10;
18918  
18919              /**
18920               * Connection config migration success.
18921               * @hide
18922               */
18923              public static final int PHONE_SWITCHING_STATUS_IN_PROGRESS_MIGRATION_SUCCESS = 11;
18924  
18925  
18926              /**
18927               * Whether the device has enabled the feature to reduce motion and animation
18928               * (0 = false, 1 = true)
18929               * @hide
18930               */
18931              public static final String REDUCE_MOTION = "reduce_motion";
18932  
18933              /**
18934               * Whether RTL swipe-to-dismiss is enabled by developer options.
18935               * (0 = false, 1 = true)
18936               * @hide
18937               */
18938              public static final String RTL_SWIPE_TO_DISMISS_ENABLED_DEV =
18939                      "rtl_swipe_to_dismiss_enabled_dev";
18940  
18941              /**
18942               * Tethered Configuration state.
18943               * @hide
18944               */
18945              public static final String TETHER_CONFIG_STATE = "tethered_config_state";
18946  
18947              /**
18948               * Tethered configuration state is unknown.
18949               * @hide
18950               */
18951              public static final int TETHERED_CONFIG_UNKNOWN = 0;
18952  
18953              /**
18954               * Device is set into standalone mode.
18955               * @hide
18956               */
18957              public static final int TETHERED_CONFIG_STANDALONE = 1;
18958  
18959              /**
18960               * Device is set in tethered mode.
18961               * @hide
18962               */
18963              public static final int TETHERED_CONFIG_TETHERED = 2;
18964  
18965  
18966              /**
18967               * Whether phone switching is supported.
18968               *
18969               * (0 = false, 1 = true)
18970               * @hide
18971               */
18972              public static final String PHONE_SWITCHING_SUPPORTED = "phone_switching_supported";
18973  
18974              /**
18975               * Setting indicating the name of the Wear OS package that hosts the Media Controls UI.
18976               *
18977               * @hide
18978               */
18979              public static final String WEAR_MEDIA_CONTROLS_PACKAGE = "wear_media_controls_package";
18980  
18981              /**
18982               * Setting indicating the name of the Wear OS package responsible for bridging media.
18983               *
18984               * @hide
18985               */
18986              public static final String WEAR_MEDIA_SESSIONS_PACKAGE = "wear_media_sessions_package";
18987          }
18988      }
18989  
18990      /**
18991       * Configuration system settings, containing settings which are applied identically for all
18992       * defined users. Only Android can read these and only a specific configuration service can
18993       * write these.
18994       *
18995       * @hide
18996       */
18997      @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
18998      public static final class Config extends NameValueTable {
18999  
19000          /**
19001           * The modes that can be used when disabling syncs to the 'config' settings.
19002           * @hide
19003           */
19004          @IntDef(prefix = "SYNC_DISABLED_MODE_",
19005                  value = { SYNC_DISABLED_MODE_NONE, SYNC_DISABLED_MODE_PERSISTENT,
19006                          SYNC_DISABLED_MODE_UNTIL_REBOOT })
19007          @Retention(RetentionPolicy.SOURCE)
19008          @Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE})
19009          public @interface SyncDisabledMode {}
19010  
19011          /**
19012           * Sync is not disabled.
19013           *
19014           * @deprecated use the constant in DeviceConfig
19015           *
19016           * @hide
19017           */
19018          @Deprecated
19019          public static final int SYNC_DISABLED_MODE_NONE = DeviceConfig.SYNC_DISABLED_MODE_NONE;
19020  
19021          /**
19022           * Disabling of Config bulk update / syncing is persistent, i.e. it survives a device
19023           * reboot.
19024           *
19025           * @deprecated use the constant in DeviceConfig
19026           *
19027           * @hide
19028           */
19029          @Deprecated
19030          public static final int SYNC_DISABLED_MODE_PERSISTENT =
19031                  DeviceConfig.SYNC_DISABLED_MODE_PERSISTENT;
19032  
19033          /**
19034           * Disabling of Config bulk update / syncing is not persistent, i.e. it will not survive a
19035           * device reboot.
19036           *
19037           * @deprecated use the constant in DeviceConfig
19038           *
19039           * @hide
19040           */
19041          @Deprecated
19042          public static final int SYNC_DISABLED_MODE_UNTIL_REBOOT =
19043                  DeviceConfig.SYNC_DISABLED_MODE_UNTIL_REBOOT;
19044  
19045          /**
19046           * The content:// style URL for the config table.
19047           *
19048           * @hide
19049           */
19050          public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/config");
19051  
19052          private static final ContentProviderHolder sProviderHolder =
19053                  new ContentProviderHolder(CONTENT_URI);
19054  
19055          // Populated lazily, guarded by class object:
19056          private static final NameValueCache sNameValueCache = new NameValueCache(
19057                  CONTENT_URI,
19058                  CALL_METHOD_GET_CONFIG,
19059                  CALL_METHOD_PUT_CONFIG,
19060                  CALL_METHOD_DELETE_CONFIG,
19061                  CALL_METHOD_LIST_CONFIG,
19062                  CALL_METHOD_SET_ALL_CONFIG,
19063                  sProviderHolder,
19064                  Config.class);
19065  
19066          // Should never be invoked
Config()19067          private Config() {
19068          }
19069  
19070          /**
19071           * Look up a name in the database.
19072           * @param name to look up in the table
19073           * @return the corresponding value, or null if not present
19074           *
19075           * @hide
19076           */
19077          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
19078          @Nullable
19079          @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG)
getString(@onNull String name)19080          public static String getString(@NonNull String name) {
19081              ContentResolver resolver = getContentResolver();
19082              return sNameValueCache.getStringForUser(resolver, name, resolver.getUserId());
19083          }
19084  
19085          /**
19086           * Look up a list of names in the database, within the specified namespace.
19087           *
19088           * @param namespace to which the names belong
19089           * @param names to look up in the table
19090           * @return a non null, but possibly empty, map from name to value for any of the names that
19091           *         were found during lookup.
19092           *
19093           * @hide
19094           */
19095          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
19096          @NonNull
19097          @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG)
getStrings(@onNull String namespace, @NonNull List<String> names)19098          public static Map<String, String> getStrings(@NonNull String namespace,
19099                  @NonNull List<String> names) {
19100              return getStrings(getContentResolver(), namespace, names);
19101          }
19102  
19103          /**
19104           * Look up a list of names in the database, within the specified namespace.
19105           *
19106           * @param resolver to access the database with
19107           * @param namespace to which the names belong
19108           * @param names to look up in the table
19109           * @return a non null, but possibly empty, map from name to value for any of the names that
19110           *         were found during lookup.
19111           *
19112           * @hide
19113           */
19114          @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG)
getStrings(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull List<String> names)19115          public static Map<String, String> getStrings(@NonNull ContentResolver resolver,
19116                  @NonNull String namespace, @NonNull List<String> names) {
19117              List<String> compositeNames = new ArrayList<>(names.size());
19118              for (String name : names) {
19119                  compositeNames.add(createCompositeName(namespace, name));
19120              }
19121  
19122              String prefix = createPrefix(namespace);
19123              ArrayMap<String, String> rawKeyValues = sNameValueCache.getStringsForPrefix(
19124                      resolver, prefix, compositeNames);
19125              int size = rawKeyValues.size();
19126              int substringLength = prefix.length();
19127              ArrayMap<String, String> keyValues = new ArrayMap<>(size);
19128              for (int i = 0; i < size; ++i) {
19129                  keyValues.put(rawKeyValues.keyAt(i).substring(substringLength),
19130                          rawKeyValues.valueAt(i));
19131              }
19132              return keyValues;
19133          }
19134  
19135          /**
19136           * Store a name/value pair into the database within the specified namespace.
19137           * <p>
19138           * Also the method takes an argument whether to make the value the default for this setting.
19139           * If the system already specified a default value, then the one passed in here will
19140           * <strong>not</strong> be set as the default.
19141           * </p>
19142           *
19143           * @param namespace to store the name/value pair in.
19144           * @param name to store.
19145           * @param value to associate with the name.
19146           * @param makeDefault whether to make the value the default one.
19147           * @return true if the value was set, false on database errors.
19148           *
19149           * @see #resetToDefaults(ContentResolver, int, String)
19150           *
19151           * @hide
19152           */
19153          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
19154          @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
putString(@onNull String namespace, @NonNull String name, @Nullable String value, boolean makeDefault)19155          public static boolean putString(@NonNull String namespace,
19156                  @NonNull String name, @Nullable String value, boolean makeDefault) {
19157              ContentResolver resolver = getContentResolver();
19158              return sNameValueCache.putStringForUser(resolver, createCompositeName(namespace, name),
19159                      value, null, makeDefault, resolver.getUserId(),
19160                      DEFAULT_OVERRIDEABLE_BY_RESTORE);
19161          }
19162  
19163          /**
19164           * Clear all name/value pairs for the provided namespace and save new name/value pairs in
19165           * their place.
19166           *
19167           * @param namespace to which the names should be set.
19168           * @param keyValues map of key names (without the prefix) to values.
19169           * @return true if the name/value pairs were set, false if setting was blocked
19170           *
19171           * @hide
19172           */
19173          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
19174          @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
setStrings(@onNull String namespace, @NonNull Map<String, String> keyValues)19175          public static boolean setStrings(@NonNull String namespace,
19176                  @NonNull Map<String, String> keyValues)
19177                  throws DeviceConfig.BadConfigException {
19178              return setStrings(getContentResolver(), namespace, keyValues);
19179          }
19180  
19181          /**
19182           * Clear all name/value pairs for the provided namespace and save new name/value pairs in
19183           * their place.
19184           *
19185           * @param resolver to access the database with.
19186           * @param namespace to which the names should be set.
19187           * @param keyValues map of key names (without the prefix) to values.
19188           * @return true if the name/value pairs were set, false if setting was blocked
19189           *
19190           * @hide
19191           */
19192          @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
setStrings(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull Map<String, String> keyValues)19193          public static boolean setStrings(@NonNull ContentResolver resolver,
19194                  @NonNull String namespace, @NonNull Map<String, String> keyValues)
19195                  throws DeviceConfig.BadConfigException {
19196              HashMap<String, String> compositeKeyValueMap = new HashMap<>(keyValues.keySet().size());
19197              for (Map.Entry<String, String> entry : keyValues.entrySet()) {
19198                  compositeKeyValueMap.put(
19199                          createCompositeName(namespace, entry.getKey()), entry.getValue());
19200              }
19201              int result = sNameValueCache.setStringsForPrefix(
19202                      resolver, createPrefix(namespace), compositeKeyValueMap);
19203              if (result == SET_ALL_RESULT_SUCCESS) {
19204                  return true;
19205              } else if (result == SET_ALL_RESULT_DISABLED) {
19206                  return false;
19207              }
19208              // If can't set given configuration that means it's bad
19209              throw new DeviceConfig.BadConfigException();
19210          }
19211  
19212          /**
19213           * Delete a name/value pair from the database for the specified namespace.
19214           *
19215           * @param namespace to delete the name/value pair from.
19216           * @param name to delete.
19217           * @return true if the value was deleted, false on database errors. If the name/value pair
19218           * did not exist, return True.
19219           *
19220           * @see #resetToDefaults(ContentResolver, int, String)
19221           *
19222           * @hide
19223           */
19224          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
19225          @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
deleteString(@onNull String namespace, @NonNull String name)19226          public static boolean deleteString(@NonNull String namespace,
19227                  @NonNull String name) {
19228              ContentResolver resolver = getContentResolver();
19229              return sNameValueCache.deleteStringForUser(resolver,
19230                      createCompositeName(namespace, name), resolver.getUserId());
19231          }
19232  
19233          /**
19234           * Reset the values to their defaults.
19235           * <p>
19236           * The method accepts an optional prefix parameter. If provided, only pairs with a name that
19237           * starts with the exact prefix will be reset. Otherwise all will be reset.
19238           *
19239           * @param resetMode The reset mode to use.
19240           * @param namespace Optionally, to limit which which namespace is reset.
19241           *
19242           * @see #putString(ContentResolver, String, String, String, boolean)
19243           *
19244           * @hide
19245           */
19246          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
19247          @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
resetToDefaults(@esetMode int resetMode, @Nullable String namespace)19248          public static void resetToDefaults(@ResetMode int resetMode,
19249                  @Nullable String namespace) {
19250              try {
19251                  ContentResolver resolver = getContentResolver();
19252                  Bundle arg = new Bundle();
19253                  arg.putInt(CALL_METHOD_USER_KEY, resolver.getUserId());
19254                  arg.putInt(CALL_METHOD_RESET_MODE_KEY, resetMode);
19255                  if (namespace != null) {
19256                      arg.putString(Settings.CALL_METHOD_PREFIX_KEY, createPrefix(namespace));
19257                  }
19258                  IContentProvider cp = sProviderHolder.getProvider(resolver);
19259                  cp.call(resolver.getAttributionSource(),
19260                          sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_CONFIG, null, arg);
19261              } catch (RemoteException e) {
19262                  Log.w(TAG, "Can't reset to defaults for " + CONTENT_URI, e);
19263              }
19264          }
19265  
19266          /**
19267           * Bridge method between {@link DeviceConfig#setSyncDisabledMode(int)} and the
19268           * {@link com.android.providers.settings.SettingsProvider} implementation.
19269           *
19270           * @hide
19271           */
19272          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
19273          @SuppressLint("AndroidFrameworkRequiresPermission")
19274          @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
setSyncDisabledMode(@yncDisabledMode int disableSyncMode)19275          public static void setSyncDisabledMode(@SyncDisabledMode int disableSyncMode) {
19276              try {
19277                  ContentResolver resolver = getContentResolver();
19278                  Bundle args = new Bundle();
19279                  args.putInt(CALL_METHOD_SYNC_DISABLED_MODE_KEY, disableSyncMode);
19280                  IContentProvider cp = sProviderHolder.getProvider(resolver);
19281                  cp.call(resolver.getAttributionSource(), sProviderHolder.mUri.getAuthority(),
19282                          CALL_METHOD_SET_SYNC_DISABLED_MODE_CONFIG, null, args);
19283              } catch (RemoteException e) {
19284                  Log.w(TAG, "Can't set sync disabled mode " + CONTENT_URI, e);
19285              }
19286          }
19287  
19288          /**
19289           * Bridge method between {@link DeviceConfig#getSyncDisabledMode()} and the
19290           * {@link com.android.providers.settings.SettingsProvider} implementation.
19291           *
19292           * @hide
19293           */
19294          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
19295          @SuppressLint("AndroidFrameworkRequiresPermission")
19296          @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG)
getSyncDisabledMode()19297          public static int getSyncDisabledMode() {
19298              try {
19299                  ContentResolver resolver = getContentResolver();
19300                  Bundle args = Bundle.EMPTY;
19301                  IContentProvider cp = sProviderHolder.getProvider(resolver);
19302                  Bundle bundle = cp.call(resolver.getAttributionSource(),
19303                          sProviderHolder.mUri.getAuthority(),
19304                          CALL_METHOD_GET_SYNC_DISABLED_MODE_CONFIG,
19305                          null, args);
19306                  return bundle.getInt(KEY_CONFIG_GET_SYNC_DISABLED_MODE_RETURN);
19307              } catch (RemoteException e) {
19308                  Log.w(TAG, "Can't query sync disabled mode " + CONTENT_URI, e);
19309              }
19310              return -1;
19311          }
19312  
19313          /**
19314           * Setter callback for monitoring Config table.
19315           *
19316           * @param executor the {@link Executor} on which to invoke the callback
19317           * @param callback callback to set
19318           *
19319           * @hide
19320           */
19321          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
19322          @RequiresPermission(Manifest.permission.MONITOR_DEVICE_CONFIG_ACCESS)
setMonitorCallback( @onNull ContentResolver resolver, @NonNull @CallbackExecutor Executor executor, @NonNull DeviceConfig.MonitorCallback callback)19323          public static void setMonitorCallback(
19324                  @NonNull ContentResolver resolver,
19325                  @NonNull @CallbackExecutor Executor executor,
19326                  @NonNull DeviceConfig.MonitorCallback callback) {
19327              setMonitorCallbackAsUser(executor, resolver, resolver.getUserId(), callback);
19328          }
19329  
19330          /**
19331           * Clear callback for monitoring Config table.
19332           * this may only be used to clear callback function registered by
19333           * {@link Config#setMonitorCallback}
19334           * @hide
19335           */
19336          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
19337          @RequiresPermission(Manifest.permission.MONITOR_DEVICE_CONFIG_ACCESS)
clearMonitorCallback(@onNull ContentResolver resolver)19338          public static void clearMonitorCallback(@NonNull ContentResolver resolver) {
19339              try {
19340                  Bundle arg = new Bundle();
19341                  arg.putInt(CALL_METHOD_USER_KEY, resolver.getUserId());
19342                  IContentProvider cp = sProviderHolder.getProvider(resolver);
19343                  cp.call(resolver.getAttributionSource(),
19344                          sProviderHolder.mUri.getAuthority(),
19345                          CALL_METHOD_UNREGISTER_MONITOR_CALLBACK_CONFIG, null, arg);
19346              } catch (RemoteException e) {
19347                  Log.w(TAG, "Can't clear config monitor callback", e);
19348              }
19349          }
19350  
19351  
19352          /**
19353           * Register a content observer.
19354           *
19355           * @hide
19356           */
19357          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
registerContentObserver(@ullable String namespace, boolean notifyForDescendants, @NonNull ContentObserver observer)19358          public static void registerContentObserver(@Nullable String namespace,
19359                  boolean notifyForDescendants, @NonNull ContentObserver observer) {
19360              ActivityThread.currentApplication().getContentResolver()
19361                      .registerContentObserver(createNamespaceUri(namespace),
19362                           notifyForDescendants, observer);
19363          }
19364  
19365          /**
19366           * Unregister a content observer.
19367           * this may only be used with content observers registered through
19368           * {@link Config#registerContentObserver}
19369           *
19370           * @hide
19371           */
19372          @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
unregisterContentObserver(@onNull ContentObserver observer)19373          public static void unregisterContentObserver(@NonNull ContentObserver observer) {
19374              ActivityThread.currentApplication().getContentResolver()
19375                .unregisterContentObserver(observer);
19376          }
19377  
19378          /**
19379           * Determine whether the calling process of an IPC <em>or you</em> have been
19380           * granted a particular permission.  This is the same as
19381           * {@link #checkCallingPermission}, except it grants your own permissions
19382           * if you are not currently processing an IPC.  Use with care!
19383           *
19384           * @param permission The name of the permission being checked.
19385           *
19386           * @return {@link PackageManager#PERMISSION_GRANTED} if the calling
19387           * pid/uid is allowed that permission, or
19388           * {@link PackageManager#PERMISSION_DENIED} if it is not.
19389           *
19390           * @see PackageManager#checkPermission(String, String)
19391           * @see #checkPermission
19392           * @see #checkCallingPermission
19393           * @hide
19394           */
19395          @PermissionMethod(orSelf = true)
19396          @PackageManager.PermissionResult
checkCallingOrSelfPermission(@onNull @ermissionName String permission)19397          public static int checkCallingOrSelfPermission(@NonNull @PermissionName String permission) {
19398              return ActivityThread.currentApplication()
19399                 .getApplicationContext().checkCallingOrSelfPermission(permission);
19400          }
19401  
19402          /**
19403           * Enforces READ_DEVICE_CONFIG permission if namespace is not one of public namespaces.
19404           * @hide
19405           */
enforceReadPermission(String namespace)19406          public static void enforceReadPermission(String namespace) {
19407              if (ActivityThread.currentApplication().getApplicationContext()
19408                      .checkCallingOrSelfPermission(Manifest.permission.READ_DEVICE_CONFIG)
19409                      != PackageManager.PERMISSION_GRANTED) {
19410                  if (!DeviceConfig.getPublicNamespaces().contains(namespace)) {
19411                      throw new SecurityException("Permission denial: reading from settings requires:"
19412                          + Manifest.permission.READ_DEVICE_CONFIG);
19413                  }
19414              }
19415          }
19416  
setMonitorCallbackAsUser( @onNull @allbackExecutor Executor executor, @NonNull ContentResolver resolver, @UserIdInt int userHandle, @NonNull DeviceConfig.MonitorCallback callback)19417          private static void setMonitorCallbackAsUser(
19418                  @NonNull @CallbackExecutor Executor executor,
19419                  @NonNull ContentResolver resolver, @UserIdInt int userHandle,
19420                  @NonNull DeviceConfig.MonitorCallback callback) {
19421              try {
19422                  Bundle arg = new Bundle();
19423                  arg.putInt(CALL_METHOD_USER_KEY, userHandle);
19424                  arg.putParcelable(CALL_METHOD_MONITOR_CALLBACK_KEY,
19425                          new RemoteCallback(result -> {
19426                              handleMonitorCallback(result, executor, callback);
19427                          }));
19428                  IContentProvider cp = sProviderHolder.getProvider(resolver);
19429                  cp.call(resolver.getAttributionSource(),
19430                          sProviderHolder.mUri.getAuthority(),
19431                          CALL_METHOD_REGISTER_MONITOR_CALLBACK_CONFIG, null, arg);
19432              } catch (RemoteException e) {
19433                  Log.w(TAG, "Can't set config monitor callback", e);
19434              }
19435          }
19436  
19437          /** @hide */
clearProviderForTest()19438          public static void clearProviderForTest() {
19439              sProviderHolder.clearProviderForTest();
19440              sNameValueCache.clearGenerationTrackerForTest();
19441          }
19442  
handleMonitorCallback( Bundle result, @NonNull @CallbackExecutor Executor executor, DeviceConfig.MonitorCallback monitorCallback)19443          private static void handleMonitorCallback(
19444                  Bundle result,
19445                  @NonNull @CallbackExecutor Executor executor,
19446                  DeviceConfig.MonitorCallback monitorCallback) {
19447              String callbackType = result.getString(EXTRA_MONITOR_CALLBACK_TYPE, "");
19448              switch (callbackType) {
19449                  case EXTRA_NAMESPACE_UPDATED_CALLBACK:
19450                      String updatedNamespace = result.getString(EXTRA_NAMESPACE);
19451                      if (updatedNamespace != null) {
19452                          executor.execute(() -> monitorCallback.onNamespaceUpdate(updatedNamespace));
19453                      }
19454                      break;
19455                  case EXTRA_ACCESS_CALLBACK:
19456                      String callingPackage = result.getString(EXTRA_CALLING_PACKAGE, null);
19457                      String namespace = result.getString(EXTRA_NAMESPACE, null);
19458                      if (namespace != null && callingPackage != null) {
19459                          executor.execute(() ->
19460                                  monitorCallback.onDeviceConfigAccess(callingPackage, namespace));
19461                      }
19462                      break;
19463                  default:
19464                      Slog.w(TAG, "Unrecognized DeviceConfig callback");
19465                      break;
19466              }
19467          }
19468  
createCompositeName(@onNull String namespace, @NonNull String name)19469          private static String createCompositeName(@NonNull String namespace, @NonNull String name) {
19470              Preconditions.checkNotNull(namespace);
19471              Preconditions.checkNotNull(name);
19472              return createPrefix(namespace) + name;
19473          }
19474  
createPrefix(@onNull String namespace)19475          private static String createPrefix(@NonNull String namespace) {
19476              Preconditions.checkNotNull(namespace);
19477              return namespace + "/";
19478          }
19479  
createNamespaceUri(@onNull String namespace)19480          private static Uri createNamespaceUri(@NonNull String namespace) {
19481              Preconditions.checkNotNull(namespace);
19482              return CONTENT_URI.buildUpon().appendPath(namespace).build();
19483          }
19484  
getContentResolver()19485          private static ContentResolver getContentResolver() {
19486              return ActivityThread.currentApplication().getContentResolver();
19487          }
19488      }
19489  
19490      /**
19491       * User-defined bookmarks and shortcuts.  The target of each bookmark is an
19492       * Intent URL, allowing it to be either a web page or a particular
19493       * application activity.
19494       *
19495       * @hide
19496       */
19497      public static final class Bookmarks implements BaseColumns
19498      {
19499          private static final String TAG = "Bookmarks";
19500  
19501          /**
19502           * The content:// style URL for this table
19503           */
19504          @UnsupportedAppUsage
19505          public static final Uri CONTENT_URI =
19506              Uri.parse("content://" + AUTHORITY + "/bookmarks");
19507  
19508          /**
19509           * The row ID.
19510           * <p>Type: INTEGER</p>
19511           */
19512          public static final String ID = "_id";
19513  
19514          /**
19515           * Descriptive name of the bookmark that can be displayed to the user.
19516           * If this is empty, the title should be resolved at display time (use
19517           * {@link #getTitle(Context, Cursor)} any time you want to display the
19518           * title of a bookmark.)
19519           * <P>
19520           * Type: TEXT
19521           * </P>
19522           */
19523          public static final String TITLE = "title";
19524  
19525          /**
19526           * Arbitrary string (displayed to the user) that allows bookmarks to be
19527           * organized into categories.  There are some special names for
19528           * standard folders, which all start with '@'.  The label displayed for
19529           * the folder changes with the locale (via {@link #getLabelForFolder}) but
19530           * the folder name does not change so you can consistently query for
19531           * the folder regardless of the current locale.
19532           *
19533           * <P>Type: TEXT</P>
19534           *
19535           */
19536          public static final String FOLDER = "folder";
19537  
19538          /**
19539           * The Intent URL of the bookmark, describing what it points to.  This
19540           * value is given to {@link android.content.Intent#getIntent} to create
19541           * an Intent that can be launched.
19542           * <P>Type: TEXT</P>
19543           */
19544          public static final String INTENT = "intent";
19545  
19546          /**
19547           * Optional shortcut character associated with this bookmark.
19548           * <P>Type: INTEGER</P>
19549           */
19550          public static final String SHORTCUT = "shortcut";
19551  
19552          /**
19553           * The order in which the bookmark should be displayed
19554           * <P>Type: INTEGER</P>
19555           */
19556          public static final String ORDERING = "ordering";
19557  
19558          private static final String[] sIntentProjection = { INTENT };
19559          private static final String[] sShortcutProjection = { ID, SHORTCUT };
19560          private static final String sShortcutSelection = SHORTCUT + "=?";
19561  
19562          /**
19563           * Convenience function to retrieve the bookmarked Intent for a
19564           * particular shortcut key.
19565           *
19566           * @param cr The ContentResolver to query.
19567           * @param shortcut The shortcut key.
19568           *
19569           * @return Intent The bookmarked URL, or null if there is no bookmark
19570           *         matching the given shortcut.
19571           */
getIntentForShortcut(ContentResolver cr, char shortcut)19572          public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
19573          {
19574              Intent intent = null;
19575  
19576              Cursor c = cr.query(CONTENT_URI,
19577                      sIntentProjection, sShortcutSelection,
19578                      new String[] { String.valueOf((int) shortcut) }, ORDERING);
19579              // Keep trying until we find a valid shortcut
19580              try {
19581                  while (intent == null && c.moveToNext()) {
19582                      try {
19583                          String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
19584                          intent = Intent.parseUri(intentURI, 0);
19585                      } catch (java.net.URISyntaxException e) {
19586                          // The stored URL is bad...  ignore it.
19587                      } catch (IllegalArgumentException e) {
19588                          // Column not found
19589                          Log.w(TAG, "Intent column not found", e);
19590                      }
19591                  }
19592              } finally {
19593                  if (c != null) c.close();
19594              }
19595  
19596              return intent;
19597          }
19598  
19599          /**
19600           * Add a new bookmark to the system.
19601           *
19602           * @param cr The ContentResolver to query.
19603           * @param intent The desired target of the bookmark.
19604           * @param title Bookmark title that is shown to the user; null if none
19605           *            or it should be resolved to the intent's title.
19606           * @param folder Folder in which to place the bookmark; null if none.
19607           * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
19608           *            this is non-zero and there is an existing bookmark entry
19609           *            with this same shortcut, then that existing shortcut is
19610           *            cleared (the bookmark is not removed).
19611           * @return The unique content URL for the new bookmark entry.
19612           */
19613          @UnsupportedAppUsage
add(ContentResolver cr, Intent intent, String title, String folder, char shortcut, int ordering)19614          public static Uri add(ContentResolver cr,
19615                                             Intent intent,
19616                                             String title,
19617                                             String folder,
19618                                             char shortcut,
19619                                             int ordering)
19620          {
19621              // If a shortcut is supplied, and it is already defined for
19622              // another bookmark, then remove the old definition.
19623              if (shortcut != 0) {
19624                  cr.delete(CONTENT_URI, sShortcutSelection,
19625                          new String[] { String.valueOf((int) shortcut) });
19626              }
19627  
19628              ContentValues values = new ContentValues();
19629              if (title != null) values.put(TITLE, title);
19630              if (folder != null) values.put(FOLDER, folder);
19631              values.put(INTENT, intent.toUri(0));
19632              if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
19633              values.put(ORDERING, ordering);
19634              return cr.insert(CONTENT_URI, values);
19635          }
19636  
19637          /**
19638           * Return the folder name as it should be displayed to the user.  This
19639           * takes care of localizing special folders.
19640           *
19641           * @param r Resources object for current locale; only need access to
19642           *          system resources.
19643           * @param folder The value found in the {@link #FOLDER} column.
19644           *
19645           * @return CharSequence The label for this folder that should be shown
19646           *         to the user.
19647           */
getLabelForFolder(Resources r, String folder)19648          public static CharSequence getLabelForFolder(Resources r, String folder) {
19649              return folder;
19650          }
19651  
19652          /**
19653           * Return the title as it should be displayed to the user. This takes
19654           * care of localizing bookmarks that point to activities.
19655           *
19656           * @param context A context.
19657           * @param cursor A cursor pointing to the row whose title should be
19658           *        returned. The cursor must contain at least the {@link #TITLE}
19659           *        and {@link #INTENT} columns.
19660           * @return A title that is localized and can be displayed to the user,
19661           *         or the empty string if one could not be found.
19662           */
getTitle(Context context, Cursor cursor)19663          public static CharSequence getTitle(Context context, Cursor cursor) {
19664              int titleColumn = cursor.getColumnIndex(TITLE);
19665              int intentColumn = cursor.getColumnIndex(INTENT);
19666              if (titleColumn == -1 || intentColumn == -1) {
19667                  throw new IllegalArgumentException(
19668                          "The cursor must contain the TITLE and INTENT columns.");
19669              }
19670  
19671              String title = cursor.getString(titleColumn);
19672              if (!TextUtils.isEmpty(title)) {
19673                  return title;
19674              }
19675  
19676              String intentUri = cursor.getString(intentColumn);
19677              if (TextUtils.isEmpty(intentUri)) {
19678                  return "";
19679              }
19680  
19681              Intent intent;
19682              try {
19683                  intent = Intent.parseUri(intentUri, 0);
19684              } catch (URISyntaxException e) {
19685                  return "";
19686              }
19687  
19688              PackageManager packageManager = context.getPackageManager();
19689              ResolveInfo info = packageManager.resolveActivity(intent, 0);
19690              return info != null ? info.loadLabel(packageManager) : "";
19691          }
19692      }
19693  
19694      /**
19695       * <p>
19696       *     A Settings panel is floating UI that contains a fixed subset of settings to address a
19697       *     particular user problem. For example, the
19698       *     {@link #ACTION_INTERNET_CONNECTIVITY Internet Panel} surfaces settings related to
19699       *     connecting to the internet.
19700       * <p>
19701       *     Settings panels appear above the calling app to address the problem without
19702       *     the user needing to open Settings and thus leave their current screen.
19703       */
19704      public static final class Panel {
Panel()19705          private Panel() {
19706          }
19707  
19708          /**
19709           * Activity Action: Show a settings dialog containing settings to enable internet
19710           * connection.
19711           * <p>
19712           * Input: Nothing.
19713           * <p>
19714           * Output: Nothing.
19715           */
19716          @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
19717          public static final String ACTION_INTERNET_CONNECTIVITY =
19718                  "android.settings.panel.action.INTERNET_CONNECTIVITY";
19719  
19720          /**
19721           * Activity Action: Show a settings dialog containing NFC-related settings.
19722           * <p>
19723           * Input: Nothing.
19724           * <p>
19725           * Output: Nothing.
19726           */
19727          @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
19728          public static final String ACTION_NFC =
19729                  "android.settings.panel.action.NFC";
19730  
19731          /**
19732           * Activity Action: Show a settings dialog containing controls for Wifi.
19733           * <p>
19734           * Input: Nothing.
19735           * <p>
19736           * Output: Nothing.
19737           */
19738          @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
19739          public static final String ACTION_WIFI =
19740                  "android.settings.panel.action.WIFI";
19741  
19742          /**
19743           * Activity Action: Show a settings dialog containing all volume streams.
19744           * <p>
19745           * Input: Nothing.
19746           * <p>
19747           * Output: Nothing.
19748           */
19749          @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION)
19750          public static final String ACTION_VOLUME =
19751                  "android.settings.panel.action.VOLUME";
19752      }
19753  
19754      /**
19755       * Activity Action: Show setting page to process the addition of Wi-Fi networks to the user's
19756       * saved network list. The app should send a new intent with an extra that holds a maximum
19757       * of five {@link android.net.wifi.WifiNetworkSuggestion} that specify credentials for the
19758       * networks to be added to the user's database. The Intent should be sent via the
19759       * {@link android.app.Activity#startActivityForResult(Intent, int)} API.
19760       * <p>
19761       * Note: The app sending the Intent to add the credentials doesn't get any ownership over the
19762       * newly added network(s). For the Wi-Fi stack, these networks will look like the user
19763       * manually added them from the Settings UI.
19764       * <p>
19765       * Input: The app should put parcelable array list of
19766       * {@link android.net.wifi.WifiNetworkSuggestion} into the {@link #EXTRA_WIFI_NETWORK_LIST}
19767       * extra.
19768       * <p>
19769       * Output: After {@link android.app.Activity#startActivityForResult(Intent, int)}, the
19770       * callback {@link android.app.Activity#onActivityResult(int, int, Intent)} will have a
19771       * result code {@link android.app.Activity#RESULT_OK} to indicate user pressed the save
19772       * button to save the networks or {@link android.app.Activity#RESULT_CANCELED} to indicate
19773       * that the user rejected the request. Additionally, an integer array list, stored in
19774       * {@link #EXTRA_WIFI_NETWORK_RESULT_LIST}, will indicate the process result of each network.
19775       */
19776      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
19777      public static final String ACTION_WIFI_ADD_NETWORKS =
19778              "android.settings.WIFI_ADD_NETWORKS";
19779  
19780      /**
19781       * A bundle extra of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that indicates the list
19782       * of the {@link android.net.wifi.WifiNetworkSuggestion} elements. The maximum count of the
19783       * {@link android.net.wifi.WifiNetworkSuggestion} elements in the list will be five.
19784       * <p>
19785       * For example:
19786       * To provide credentials for one open and one WPA2 networks:
19787       *
19788       * <pre>{@code
19789       * final WifiNetworkSuggestion suggestion1 =
19790       *       new WifiNetworkSuggestion.Builder()
19791       *       .setSsid("test111111")
19792       *       .build();
19793       * final WifiNetworkSuggestion suggestion2 =
19794       *       new WifiNetworkSuggestion.Builder()
19795       *       .setSsid("test222222")
19796       *       .setWpa2Passphrase("test123456")
19797       *       .build();
19798       * final List<WifiNetworkSuggestion> suggestionsList = new ArrayList<>;
19799       * suggestionsList.add(suggestion1);
19800       * suggestionsList.add(suggestion2);
19801       * Bundle bundle = new Bundle();
19802       * bundle.putParcelableArrayList(Settings.EXTRA_WIFI_NETWORK_LIST,(ArrayList<? extends
19803       * Parcelable>) suggestionsList);
19804       * final Intent intent = new Intent(Settings.ACTION_WIFI_ADD_NETWORKS);
19805       * intent.putExtras(bundle);
19806       * startActivityForResult(intent, 0);
19807       * }</pre>
19808       */
19809      public static final String EXTRA_WIFI_NETWORK_LIST =
19810              "android.provider.extra.WIFI_NETWORK_LIST";
19811  
19812      /**
19813       * A bundle extra of the result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that
19814       * indicates the action result of the saved {@link android.net.wifi.WifiNetworkSuggestion}.
19815       * Its value is a list of integers, and all the elements will be 1:1 mapping to the elements
19816       * in {@link #EXTRA_WIFI_NETWORK_LIST}, if user press cancel to cancel the add networks
19817       * request, then its value will be null.
19818       * <p>
19819       * Note: The integer value will be one of the {@link #ADD_WIFI_RESULT_SUCCESS},
19820       * {@link #ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED}, or {@link #ADD_WIFI_RESULT_ALREADY_EXISTS}}.
19821       */
19822      public static final String EXTRA_WIFI_NETWORK_RESULT_LIST =
19823              "android.provider.extra.WIFI_NETWORK_RESULT_LIST";
19824  
19825      /** @hide */
19826      @Retention(RetentionPolicy.SOURCE)
19827      @IntDef(prefix = {"ADD_WIFI_RESULT_"}, value = {
19828              ADD_WIFI_RESULT_SUCCESS,
19829              ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED,
19830              ADD_WIFI_RESULT_ALREADY_EXISTS
19831      })
19832      public @interface AddWifiResult {
19833      }
19834  
19835      /**
19836       * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that saving or updating the
19837       * corresponding Wi-Fi network was successful.
19838       */
19839      public static final int ADD_WIFI_RESULT_SUCCESS = 0;
19840  
19841      /**
19842       * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that saving the corresponding
19843       * Wi-Fi network failed.
19844       */
19845      public static final int ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED = 1;
19846  
19847      /**
19848       * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that indicates the Wi-Fi network
19849       * already exists.
19850       */
19851      public static final int ADD_WIFI_RESULT_ALREADY_EXISTS = 2;
19852  
19853      /**
19854       * Activity Action: Allows user to select current bug report handler.
19855       * <p>
19856       * Input: Nothing.
19857       * <p>
19858       * Output: Nothing.
19859       *
19860       * @hide
19861       */
19862      @SystemApi
19863      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
19864      public static final String ACTION_BUGREPORT_HANDLER_SETTINGS =
19865              "android.settings.BUGREPORT_HANDLER_SETTINGS";
19866  
19867      private static final String[] PM_WRITE_SETTINGS = {
19868          android.Manifest.permission.WRITE_SETTINGS
19869      };
19870      private static final String[] PM_CHANGE_NETWORK_STATE = {
19871          android.Manifest.permission.CHANGE_NETWORK_STATE,
19872          android.Manifest.permission.WRITE_SETTINGS
19873      };
19874      private static final String[] PM_SYSTEM_ALERT_WINDOW = {
19875          android.Manifest.permission.SYSTEM_ALERT_WINDOW
19876      };
19877  
19878      /**
19879       * Activity Action: Show screen for controlling which apps have access to manage external
19880       * storage.
19881       * <p>
19882       * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
19883       * <p>
19884       * If you want to control a specific app's access to manage external storage, use
19885       * {@link #ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION} instead.
19886       * <p>
19887       * Output: Nothing.
19888       * @see #ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
19889       */
19890      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
19891      public static final String ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION =
19892              "android.settings.MANAGE_ALL_FILES_ACCESS_PERMISSION";
19893  
19894      /**
19895       * Activity Action: Show screen for controlling if the app specified in the data URI of the
19896       * intent can manage external storage.
19897       * <p>
19898       * Launching the corresponding activity requires the permission
19899       * {@link Manifest.permission#MANAGE_EXTERNAL_STORAGE}.
19900       * <p>
19901       * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
19902       * <p>
19903       * Input: The Intent's data URI MUST specify the application package name whose ability of
19904       * managing external storage you want to control.
19905       * For example "package:com.my.app".
19906       * <p>
19907       * Output: Nothing.
19908       * @see #ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION
19909       */
19910      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
19911      public static final String ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION =
19912              "android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION";
19913  
19914      /**
19915       * Activity Action: Show screen for controlling whether an app can send full screen intents.
19916       * <p>
19917       *     Input: the intent's data URI must specify the application package name for which you want
19918       *     to manage full screen intents.
19919       * <p>
19920       * Output: Nothing.
19921       */
19922      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
19923      public static final String ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT =
19924              "android.settings.MANAGE_APP_USE_FULL_SCREEN_INTENT";
19925  
19926      /**
19927       * Activity Action: For system or preinstalled apps to show their {@link Activity} embedded
19928       * in Settings app on large screen devices.
19929       *
19930       * Developers should resolve the Intent action before using it.
19931       *
19932       * <p>
19933       *     Input: {@link #EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_INTENT_URI} must be included to
19934       * specify the intent for the activity which will be embedded in Settings app.
19935       * It's an intent URI string from {@code intent.toUri(Intent.URI_INTENT_SCHEME)}.
19936       *
19937       *     Input: {@link #EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_HIGHLIGHT_MENU_KEY} must be included to
19938       * specify a key that indicates the menu item which will be highlighted on settings home menu.
19939       * <p>
19940       * Output: Nothing.
19941       */
19942      @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
19943      public static final String ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY =
19944              "android.settings.SETTINGS_EMBED_DEEP_LINK_ACTIVITY";
19945  
19946      /**
19947       * Activity Extra: Specify the intent for the {@link Activity} which will be embedded in
19948       * Settings app. It's an intent URI string from
19949       * {@code intent.toUri(Intent.URI_INTENT_SCHEME)}.
19950       * <p>
19951       * This must be passed as an extra field to
19952       * {@link #ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY}.
19953       */
19954      public static final String EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_INTENT_URI =
19955              "android.provider.extra.SETTINGS_EMBEDDED_DEEP_LINK_INTENT_URI";
19956  
19957      /**
19958       * Activity Extra: Specify a key that indicates the menu item which should be highlighted on
19959       * settings home menu.
19960       * <p>
19961       * This must be passed as an extra field to
19962       * {@link #ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY}.
19963       */
19964      public static final String EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_HIGHLIGHT_MENU_KEY =
19965              "android.provider.extra.SETTINGS_EMBEDDED_DEEP_LINK_HIGHLIGHT_MENU_KEY";
19966  
19967      /**
19968       * Performs a strict and comprehensive check of whether a calling package is allowed to
19969       * write/modify system settings, as the condition differs for pre-M, M+, and
19970       * privileged/preinstalled apps. If the provided uid does not match the
19971       * callingPackage, a negative result will be returned.
19972       * @hide
19973       */
19974      @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
isCallingPackageAllowedToWriteSettings(Context context, int uid, String callingPackage, boolean throwException)19975      public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid,
19976              String callingPackage, boolean throwException) {
19977          return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
19978                  callingPackage, null /*attribution not needed when not making note */,
19979                  throwException, AppOpsManager.OP_WRITE_SETTINGS, PM_WRITE_SETTINGS,
19980                  false);
19981      }
19982  
19983      /**
19984       * @deprecated Use {@link #checkAndNoteWriteSettingsOperation(Context, int, String, String,
19985       * boolean)} instead.
19986       *
19987       * @hide
19988       */
19989      @Deprecated
19990      @SystemApi
checkAndNoteWriteSettingsOperation(@onNull Context context, int uid, @NonNull String callingPackage, boolean throwException)19991      public static boolean checkAndNoteWriteSettingsOperation(@NonNull Context context, int uid,
19992              @NonNull String callingPackage, boolean throwException) {
19993          return checkAndNoteWriteSettingsOperation(context, uid, callingPackage, null,
19994                  throwException);
19995      }
19996  
19997      /**
19998       * Performs a strict and comprehensive check of whether a calling package is allowed to
19999       * write/modify system settings, as the condition differs for pre-M, M+, and
20000       * privileged/preinstalled apps. If the provided uid does not match the
20001       * callingPackage, a negative result will be returned. The caller is expected to have
20002       * the WRITE_SETTINGS permission declared.
20003       *
20004       * Note: if the check is successful, the operation of this app will be updated to the
20005       * current time.
20006       * @hide
20007       */
20008      @SystemApi
checkAndNoteWriteSettingsOperation(@onNull Context context, int uid, @NonNull String callingPackage, @Nullable String callingAttributionTag, boolean throwException)20009      public static boolean checkAndNoteWriteSettingsOperation(@NonNull Context context, int uid,
20010              @NonNull String callingPackage, @Nullable String callingAttributionTag,
20011              boolean throwException) {
20012          return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
20013                  callingPackage, callingAttributionTag, throwException,
20014                  AppOpsManager.OP_WRITE_SETTINGS, PM_WRITE_SETTINGS, true);
20015      }
20016  
20017      /**
20018       * Performs a strict and comprehensive check of whether a calling package is allowed to
20019       * draw on top of other apps, as the conditions differs for pre-M, M+, and
20020       * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
20021       * a negative result will be returned.
20022       * @hide
20023       */
20024      @UnsupportedAppUsage
isCallingPackageAllowedToDrawOverlays(Context context, int uid, String callingPackage, boolean throwException)20025      public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid,
20026              String callingPackage, boolean throwException) {
20027          return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
20028                  callingPackage, null /*attribution not needed when not making note */,
20029                  throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, PM_SYSTEM_ALERT_WINDOW,
20030                  false);
20031      }
20032  
20033      /**
20034       * Performs a strict and comprehensive check of whether a calling package is allowed to
20035       * draw on top of other apps, as the conditions differs for pre-M, M+, and
20036       * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
20037       * a negative result will be returned.
20038       *
20039       * Note: if the check is successful, the operation of this app will be updated to the
20040       * current time.
20041       * @hide
20042       */
checkAndNoteDrawOverlaysOperation(Context context, int uid, String callingPackage, String callingAttributionTag, boolean throwException)20043      public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid,
20044              String callingPackage, String callingAttributionTag, boolean throwException) {
20045          return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
20046                  callingPackage, callingAttributionTag, throwException,
20047                  AppOpsManager.OP_SYSTEM_ALERT_WINDOW, PM_SYSTEM_ALERT_WINDOW, true);
20048      }
20049  
20050      /**
20051       * @deprecated Use {@link #isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context,
20052       * int, String, String, boolean, int, String[], boolean)} instead.
20053       *
20054       * @hide
20055       */
20056      @Deprecated
20057      @UnsupportedAppUsage
isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] permissions, boolean makeNote)20058      public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
20059              int uid, String callingPackage, boolean throwException, int appOpsOpCode,
20060              String[] permissions, boolean makeNote) {
20061          return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
20062                  callingPackage, null, throwException, appOpsOpCode, permissions, makeNote);
20063      }
20064  
20065      /**
20066       * Helper method to perform a general and comprehensive check of whether an operation that is
20067       * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and
20068       * OP_WRITE_SETTINGS
20069       * @hide
20070       */
isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, int uid, String callingPackage, String callingAttributionTag, boolean throwException, int appOpsOpCode, String[] permissions, boolean makeNote)20071      public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
20072              int uid, String callingPackage, String callingAttributionTag, boolean throwException,
20073              int appOpsOpCode, String[] permissions, boolean makeNote) {
20074          if (callingPackage == null) {
20075              return false;
20076          }
20077  
20078          AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE);
20079          int mode = AppOpsManager.MODE_DEFAULT;
20080          if (makeNote) {
20081              mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage, callingAttributionTag,
20082                      null);
20083          } else {
20084              mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage);
20085          }
20086  
20087          switch (mode) {
20088              case AppOpsManager.MODE_ALLOWED:
20089                  return true;
20090  
20091              case AppOpsManager.MODE_DEFAULT:
20092                  // this is the default operating mode after an app's installation
20093                  // In this case we will check all associated static permission to see
20094                  // if it is granted during install time.
20095                  for (String permission : permissions) {
20096                      if (context.checkCallingOrSelfPermission(permission) == PackageManager
20097                              .PERMISSION_GRANTED) {
20098                          // if either of the permissions are granted, we will allow it
20099                          return true;
20100                      }
20101                  }
20102  
20103              default:
20104                  // this is for all other cases trickled down here...
20105                  if (!throwException) {
20106                      return false;
20107                  }
20108          }
20109  
20110          // prepare string to throw SecurityException
20111          StringBuilder exceptionMessage = new StringBuilder();
20112          exceptionMessage.append(callingPackage);
20113          exceptionMessage.append(" was not granted ");
20114          if (permissions.length > 1) {
20115              exceptionMessage.append(" either of these permissions: ");
20116          } else {
20117              exceptionMessage.append(" this permission: ");
20118          }
20119          for (int i = 0; i < permissions.length; i++) {
20120              exceptionMessage.append(permissions[i]);
20121              exceptionMessage.append((i == permissions.length - 1) ? "." : ", ");
20122          }
20123  
20124          throw new SecurityException(exceptionMessage.toString());
20125      }
20126  
20127      /**
20128       * Retrieves a correponding package name for a given uid. It will query all
20129       * packages that are associated with the given uid, but it will return only
20130       * the zeroth result.
20131       * Note: If package could not be found, a null is returned.
20132       * @hide
20133       */
getPackageNameForUid(Context context, int uid)20134      public static String getPackageNameForUid(Context context, int uid) {
20135          String[] packages = context.getPackageManager().getPackagesForUid(uid);
20136          if (packages == null) {
20137              return null;
20138          }
20139          return packages[0];
20140      }
20141  }
20142