· 9 years ago · Jan 21, 2017, 10:30 PM
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
17package android.provider;
18
19import android.annotation.NonNull;
20import android.annotation.SdkConstant;
21import android.annotation.SdkConstant.SdkConstantType;
22import android.annotation.SystemApi;
23import android.annotation.TestApi;
24import android.app.ActivityThread;
25import android.app.AppOpsManager;
26import android.app.Application;
27import android.app.SearchManager;
28import android.app.WallpaperManager;
29import android.content.ComponentName;
30import android.content.ContentResolver;
31import android.content.ContentValues;
32import android.content.Context;
33import android.content.IContentProvider;
34import android.content.Intent;
35import android.content.pm.ActivityInfo;
36import android.content.pm.PackageManager;
37import android.content.pm.ResolveInfo;
38import android.content.res.Configuration;
39import android.content.res.Resources;
40import android.database.Cursor;
41import android.database.SQLException;
42import android.location.LocationManager;
43import android.net.ConnectivityManager;
44import android.net.Uri;
45import android.net.wifi.WifiManager;
46import android.os.BatteryManager;
47import android.os.Bundle;
48import android.os.DropBoxManager;
49import android.os.IBinder;
50import android.os.LocaleList;
51import android.os.Process;
52import android.os.RemoteException;
53import android.os.ServiceManager;
54import android.os.UserHandle;
55import android.os.Build.VERSION_CODES;
56import android.speech.tts.TextToSpeech;
57import android.text.TextUtils;
58import android.util.AndroidException;
59import android.util.ArrayMap;
60import android.util.ArraySet;
61import android.util.Log;
62import android.util.MemoryIntArray;
63
64import com.android.internal.annotations.GuardedBy;
65import com.android.internal.util.ArrayUtils;
66import com.android.internal.widget.ILockSettings;
67
68import java.io.IOException;
69import java.net.URISyntaxException;
70import java.text.SimpleDateFormat;
71import java.util.HashMap;
72import java.util.HashSet;
73import java.util.Locale;
74import java.util.Map;
75import java.util.Set;
76
77/**
78 * The Settings provider contains global system-level device preferences.
79 */
80public final class Settings {
81
82 // Intent actions for Settings
83
84 /**
85 * Activity Action: Show system settings.
86 * <p>
87 * Input: Nothing.
88 * <p>
89 * Output: Nothing.
90 */
91 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
92 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
93
94 /**
95 * Activity Action: Show settings to allow configuration of APNs.
96 * <p>
97 * Input: Nothing.
98 * <p>
99 * Output: Nothing.
100 */
101 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
102 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
103
104 /**
105 * Activity Action: Show settings to allow configuration of current location
106 * sources.
107 * <p>
108 * In some cases, a matching Activity may not exist, so ensure you
109 * safeguard against this.
110 * <p>
111 * Input: Nothing.
112 * <p>
113 * Output: Nothing.
114 */
115 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
116 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
117 "android.settings.LOCATION_SOURCE_SETTINGS";
118
119 /**
120 * Activity Action: Show settings to allow configuration of users.
121 * <p>
122 * In some cases, a matching Activity may not exist, so ensure you
123 * safeguard against this.
124 * <p>
125 * Input: Nothing.
126 * <p>
127 * Output: Nothing.
128 * @hide
129 */
130 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
131 public static final String ACTION_USER_SETTINGS =
132 "android.settings.USER_SETTINGS";
133
134 /**
135 * Activity Action: Show settings to allow configuration of wireless controls
136 * such as Wi-Fi, Bluetooth and Mobile networks.
137 * <p>
138 * In some cases, a matching Activity may not exist, so ensure you
139 * safeguard against this.
140 * <p>
141 * Input: Nothing.
142 * <p>
143 * Output: Nothing.
144 */
145 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
146 public static final String ACTION_WIRELESS_SETTINGS =
147 "android.settings.WIRELESS_SETTINGS";
148
149 /**
150 * Activity Action: Show tether provisioning activity.
151 *
152 * <p>
153 * In some cases, a matching Activity may not exist, so ensure you
154 * safeguard against this.
155 * <p>
156 * Input: {@link ConnectivityManager.EXTRA_TETHER_TYPE} should be included to specify which type
157 * of tethering should be checked. {@link ConnectivityManager.EXTRA_PROVISION_CALLBACK} should
158 * contain a {@link ResultReceiver} which will be called back with a tether result code.
159 * <p>
160 * Output: The result of the provisioning check.
161 * {@link ConnectivityManager.TETHER_ERROR_NO_ERROR} if successful,
162 * {@link ConnectivityManager.TETHER_ERROR_PROVISION_FAILED} for failure.
163 *
164 * @hide
165 */
166 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
167 public static final String ACTION_TETHER_PROVISIONING =
168 "android.settings.TETHER_PROVISIONING_UI";
169
170 /**
171 * Activity Action: Show settings to allow entering/exiting airplane mode.
172 * <p>
173 * In some cases, a matching Activity may not exist, so ensure you
174 * safeguard against this.
175 * <p>
176 * Input: Nothing.
177 * <p>
178 * Output: Nothing.
179 */
180 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
181 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
182 "android.settings.AIRPLANE_MODE_SETTINGS";
183
184 /**
185 * Activity Action: Modify Airplane mode settings using a voice command.
186 * <p>
187 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
188 * <p>
189 * This intent MUST be started using
190 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
191 * startVoiceActivity}.
192 * <p>
193 * Note: The activity implementing this intent MUST verify that
194 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
195 * modifying the setting.
196 * <p>
197 * Input: To tell which state airplane mode should be set to, add the
198 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
199 * If the extra is not included, no changes will be made.
200 * <p>
201 * Output: Nothing.
202 */
203 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
204 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
205 "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
206
207 /**
208 * Activity Action: Show settings for accessibility modules.
209 * <p>
210 * In some cases, a matching Activity may not exist, so ensure you
211 * safeguard against this.
212 * <p>
213 * Input: Nothing.
214 * <p>
215 * Output: Nothing.
216 */
217 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
218 public static final String ACTION_ACCESSIBILITY_SETTINGS =
219 "android.settings.ACCESSIBILITY_SETTINGS";
220
221 /**
222 * Activity Action: Show settings to control access to usage information.
223 * <p>
224 * In some cases, a matching Activity may not exist, so ensure you
225 * safeguard against this.
226 * <p>
227 * Input: Nothing.
228 * <p>
229 * Output: Nothing.
230 */
231 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
232 public static final String ACTION_USAGE_ACCESS_SETTINGS =
233 "android.settings.USAGE_ACCESS_SETTINGS";
234
235 /**
236 * Activity Category: Show application settings related to usage access.
237 * <p>
238 * An activity that provides a user interface for adjusting usage access related
239 * preferences for its containing application. Optional but recommended for apps that
240 * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}.
241 * <p>
242 * The activity may define meta-data to describe what usage access is
243 * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which
244 * will be displayed in Settings.
245 * <p>
246 * Input: Nothing.
247 * <p>
248 * Output: Nothing.
249 */
250 @SdkConstant(SdkConstantType.INTENT_CATEGORY)
251 public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG =
252 "android.intent.category.USAGE_ACCESS_CONFIG";
253
254 /**
255 * Metadata key: Reason for needing usage access.
256 * <p>
257 * A key for metadata attached to an activity that receives action
258 * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the
259 * user as description of how the app uses usage access.
260 * <p>
261 */
262 public static final String METADATA_USAGE_ACCESS_REASON =
263 "android.settings.metadata.USAGE_ACCESS_REASON";
264
265 /**
266 * Activity Action: Show settings to allow configuration of security and
267 * location privacy.
268 * <p>
269 * In some cases, a matching Activity may not exist, so ensure you
270 * safeguard against this.
271 * <p>
272 * Input: Nothing.
273 * <p>
274 * Output: Nothing.
275 */
276 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
277 public static final String ACTION_SECURITY_SETTINGS =
278 "android.settings.SECURITY_SETTINGS";
279
280 /**
281 * Activity Action: Show trusted credentials settings, opening to the user tab,
282 * to allow management of installed credentials.
283 * <p>
284 * In some cases, a matching Activity may not exist, so ensure you
285 * safeguard against this.
286 * <p>
287 * Input: Nothing.
288 * <p>
289 * Output: Nothing.
290 * @hide
291 */
292 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
293 public static final String ACTION_TRUSTED_CREDENTIALS_USER =
294 "com.android.settings.TRUSTED_CREDENTIALS_USER";
295
296 /**
297 * Activity Action: Show dialog explaining that an installed CA cert may enable
298 * monitoring of encrypted network traffic.
299 * <p>
300 * In some cases, a matching Activity may not exist, so ensure you
301 * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the
302 * number of certificates.
303 * <p>
304 * Input: Nothing.
305 * <p>
306 * Output: Nothing.
307 * @hide
308 */
309 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
310 public static final String ACTION_MONITORING_CERT_INFO =
311 "com.android.settings.MONITORING_CERT_INFO";
312
313 /**
314 * Activity Action: Show settings to allow configuration of privacy options.
315 * <p>
316 * In some cases, a matching Activity may not exist, so ensure you
317 * safeguard against this.
318 * <p>
319 * Input: Nothing.
320 * <p>
321 * Output: Nothing.
322 */
323 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
324 public static final String ACTION_PRIVACY_SETTINGS =
325 "android.settings.PRIVACY_SETTINGS";
326
327 /**
328 * Activity Action: Show settings to allow configuration of VPN.
329 * <p>
330 * In some cases, a matching Activity may not exist, so ensure you
331 * safeguard against this.
332 * <p>
333 * Input: Nothing.
334 * <p>
335 * Output: Nothing.
336 */
337 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
338 public static final String ACTION_VPN_SETTINGS =
339 "android.settings.VPN_SETTINGS";
340
341 /**
342 * Activity Action: Show settings to allow configuration of Wi-Fi.
343 * <p>
344 * In some cases, a matching Activity may not exist, so ensure you
345 * safeguard against this.
346 * <p>
347 * Input: Nothing.
348 * <p>
349 * Output: Nothing.
350
351 */
352 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
353 public static final String ACTION_WIFI_SETTINGS =
354 "android.settings.WIFI_SETTINGS";
355
356 /**
357 * Activity Action: Show settings to allow configuration of a static IP
358 * address for Wi-Fi.
359 * <p>
360 * In some cases, a matching Activity may not exist, so ensure you safeguard
361 * against this.
362 * <p>
363 * Input: Nothing.
364 * <p>
365 * Output: Nothing.
366 */
367 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
368 public static final String ACTION_WIFI_IP_SETTINGS =
369 "android.settings.WIFI_IP_SETTINGS";
370
371 /**
372 * Activity Action: Show settings to allow configuration of Bluetooth.
373 * <p>
374 * In some cases, a matching Activity may not exist, so ensure you
375 * safeguard against this.
376 * <p>
377 * Input: Nothing.
378 * <p>
379 * Output: Nothing.
380 */
381 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
382 public static final String ACTION_BLUETOOTH_SETTINGS =
383 "android.settings.BLUETOOTH_SETTINGS";
384
385 /**
386 * Activity Action: Show settings to allow configuration of cast endpoints.
387 * <p>
388 * In some cases, a matching Activity may not exist, so ensure you
389 * safeguard against this.
390 * <p>
391 * Input: Nothing.
392 * <p>
393 * Output: Nothing.
394 */
395 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
396 public static final String ACTION_CAST_SETTINGS =
397 "android.settings.CAST_SETTINGS";
398
399 /**
400 * Activity Action: Show settings to allow configuration of date and time.
401 * <p>
402 * In some cases, a matching Activity may not exist, so ensure you
403 * safeguard against this.
404 * <p>
405 * Input: Nothing.
406 * <p>
407 * Output: Nothing.
408 */
409 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
410 public static final String ACTION_DATE_SETTINGS =
411 "android.settings.DATE_SETTINGS";
412
413 /**
414 * Activity Action: Show settings to allow configuration of sound and volume.
415 * <p>
416 * In some cases, a matching Activity may not exist, so ensure you
417 * safeguard against this.
418 * <p>
419 * Input: Nothing.
420 * <p>
421 * Output: Nothing.
422 */
423 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
424 public static final String ACTION_SOUND_SETTINGS =
425 "android.settings.SOUND_SETTINGS";
426
427 /**
428 * Activity Action: Show settings to allow configuration of display.
429 * <p>
430 * In some cases, a matching Activity may not exist, so ensure you
431 * safeguard against this.
432 * <p>
433 * Input: Nothing.
434 * <p>
435 * Output: Nothing.
436 */
437 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
438 public static final String ACTION_DISPLAY_SETTINGS =
439 "android.settings.DISPLAY_SETTINGS";
440
441 /**
442 * Activity Action: Show settings to allow configuration of Night display.
443 * <p>
444 * In some cases, a matching Activity may not exist, so ensure you
445 * safeguard against this.
446 * <p>
447 * Input: Nothing.
448 * <p>
449 * Output: Nothing.
450 *
451 * @hide
452 */
453 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
454 public static final String ACTION_NIGHT_DISPLAY_SETTINGS =
455 "android.settings.NIGHT_DISPLAY_SETTINGS";
456
457 /**
458 * Activity Action: Show settings to allow configuration of locale.
459 * <p>
460 * In some cases, a matching Activity may not exist, so ensure you
461 * safeguard against this.
462 * <p>
463 * Input: Nothing.
464 * <p>
465 * Output: Nothing.
466 */
467 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
468 public static final String ACTION_LOCALE_SETTINGS =
469 "android.settings.LOCALE_SETTINGS";
470
471 /**
472 * Activity Action: Show settings to configure input methods, in particular
473 * allowing the user to enable input methods.
474 * <p>
475 * In some cases, a matching Activity may not exist, so ensure you
476 * safeguard against this.
477 * <p>
478 * Input: Nothing.
479 * <p>
480 * Output: Nothing.
481 */
482 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
483 public static final String ACTION_VOICE_INPUT_SETTINGS =
484 "android.settings.VOICE_INPUT_SETTINGS";
485
486 /**
487 * Activity Action: Show settings to configure input methods, in particular
488 * allowing the user to enable input methods.
489 * <p>
490 * In some cases, a matching Activity may not exist, so ensure you
491 * safeguard against this.
492 * <p>
493 * Input: Nothing.
494 * <p>
495 * Output: Nothing.
496 */
497 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
498 public static final String ACTION_INPUT_METHOD_SETTINGS =
499 "android.settings.INPUT_METHOD_SETTINGS";
500
501 /**
502 * Activity Action: Show settings to enable/disable input method subtypes.
503 * <p>
504 * In some cases, a matching Activity may not exist, so ensure you
505 * safeguard against this.
506 * <p>
507 * To tell which input method's subtypes are displayed in the settings, add
508 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
509 * If there is no extra in this Intent, subtypes from all installed input methods
510 * will be displayed in the settings.
511 *
512 * @see android.view.inputmethod.InputMethodInfo#getId
513 * <p>
514 * Input: Nothing.
515 * <p>
516 * Output: Nothing.
517 */
518 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
519 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
520 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
521
522 /**
523 * Activity Action: Show a dialog to select input method.
524 * <p>
525 * In some cases, a matching Activity may not exist, so ensure you
526 * safeguard against this.
527 * <p>
528 * Input: Nothing.
529 * <p>
530 * Output: Nothing.
531 * @hide
532 */
533 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
534 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
535 "android.settings.SHOW_INPUT_METHOD_PICKER";
536
537 /**
538 * Activity Action: Show settings to manage the user input dictionary.
539 * <p>
540 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
541 * it is guaranteed there will always be an appropriate implementation for this Intent action.
542 * In prior releases of the platform this was optional, so ensure you safeguard against it.
543 * <p>
544 * Input: Nothing.
545 * <p>
546 * Output: Nothing.
547 */
548 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
549 public static final String ACTION_USER_DICTIONARY_SETTINGS =
550 "android.settings.USER_DICTIONARY_SETTINGS";
551
552 /**
553 * Activity Action: Show settings to configure the hardware keyboard.
554 * <p>
555 * In some cases, a matching Activity may not exist, so ensure you
556 * safeguard against this.
557 * <p>
558 * Input: Nothing.
559 * <p>
560 * Output: Nothing.
561 */
562 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
563 public static final String ACTION_HARD_KEYBOARD_SETTINGS =
564 "android.settings.HARD_KEYBOARD_SETTINGS";
565
566 /**
567 * Activity Action: Adds a word to the user dictionary.
568 * <p>
569 * In some cases, a matching Activity may not exist, so ensure you
570 * safeguard against this.
571 * <p>
572 * Input: An extra with key <code>word</code> that contains the word
573 * that should be added to the dictionary.
574 * <p>
575 * Output: Nothing.
576 *
577 * @hide
578 */
579 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
580 public static final String ACTION_USER_DICTIONARY_INSERT =
581 "com.android.settings.USER_DICTIONARY_INSERT";
582
583 /**
584 * Activity Action: Show settings to allow configuration of application-related settings.
585 * <p>
586 * In some cases, a matching Activity may not exist, so ensure you
587 * safeguard against this.
588 * <p>
589 * Input: Nothing.
590 * <p>
591 * Output: Nothing.
592 */
593 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
594 public static final String ACTION_APPLICATION_SETTINGS =
595 "android.settings.APPLICATION_SETTINGS";
596
597 /**
598 * Activity Action: Show settings to allow configuration of application
599 * development-related settings. As of
600 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
601 * a required part of the platform.
602 * <p>
603 * Input: Nothing.
604 * <p>
605 * Output: Nothing.
606 */
607 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
608 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
609 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
610
611 /**
612 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
613 * <p>
614 * In some cases, a matching Activity may not exist, so ensure you
615 * safeguard against this.
616 * <p>
617 * Input: Nothing.
618 * <p>
619 * Output: Nothing.
620 */
621 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
622 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
623 "android.settings.QUICK_LAUNCH_SETTINGS";
624
625 /**
626 * Activity Action: Show settings to manage installed applications.
627 * <p>
628 * In some cases, a matching Activity may not exist, so ensure you
629 * safeguard against this.
630 * <p>
631 * Input: Nothing.
632 * <p>
633 * Output: Nothing.
634 */
635 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
636 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
637 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
638
639 /**
640 * Activity Action: Show settings to manage all applications.
641 * <p>
642 * In some cases, a matching Activity may not exist, so ensure you
643 * safeguard against this.
644 * <p>
645 * Input: Nothing.
646 * <p>
647 * Output: Nothing.
648 */
649 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
650 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
651 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
652
653 /**
654 * Activity Action: Show screen for controlling which apps can draw on top of other apps.
655 * <p>
656 * In some cases, a matching Activity may not exist, so ensure you
657 * safeguard against this.
658 * <p>
659 * Input: Optionally, the Intent's data URI can specify the application package name to
660 * directly invoke the management GUI specific to the package name. For example
661 * "package:com.my.app".
662 * <p>
663 * Output: Nothing.
664 */
665 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
666 public static final String ACTION_MANAGE_OVERLAY_PERMISSION =
667 "android.settings.action.MANAGE_OVERLAY_PERMISSION";
668
669 /**
670 * Activity Action: Show screen for controlling which apps are allowed to write/modify
671 * system settings.
672 * <p>
673 * In some cases, a matching Activity may not exist, so ensure you
674 * safeguard against this.
675 * <p>
676 * Input: Optionally, the Intent's data URI can specify the application package name to
677 * directly invoke the management GUI specific to the package name. For example
678 * "package:com.my.app".
679 * <p>
680 * Output: Nothing.
681 */
682 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
683 public static final String ACTION_MANAGE_WRITE_SETTINGS =
684 "android.settings.action.MANAGE_WRITE_SETTINGS";
685
686 /**
687 * Activity Action: Show screen of details about a particular application.
688 * <p>
689 * In some cases, a matching Activity may not exist, so ensure you
690 * safeguard against this.
691 * <p>
692 * Input: The Intent's data URI specifies the application package name
693 * to be shown, with the "package" scheme. That is "package:com.my.app".
694 * <p>
695 * Output: Nothing.
696 */
697 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
698 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
699 "android.settings.APPLICATION_DETAILS_SETTINGS";
700
701 /**
702 * Activity Action: Show screen for controlling which apps can ignore battery optimizations.
703 * <p>
704 * Input: Nothing.
705 * <p>
706 * Output: Nothing.
707 * <p>
708 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
709 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
710 * already ignoring optimizations. You can use
711 * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you
712 * on this list.
713 */
714 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
715 public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS =
716 "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS";
717
718 /**
719 * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is,
720 * put them on the whitelist of apps shown by
721 * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also
722 * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}
723 * permission.
724 * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities
725 * provided by the platform for applications to operate correctly in the various power
726 * saving modes. This is only for unusual applications that need to deeply control their own
727 * execution, at the potential expense of the user's battery life. Note that these applications
728 * greatly run the risk of showing to the user as high power consumers on their device.</p>
729 * <p>
730 * Input: The Intent's data URI must specify the application package name
731 * to be shown, with the "package" scheme. That is "package:com.my.app".
732 * <p>
733 * Output: Nothing.
734 * <p>
735 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations
736 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is
737 * already ignoring optimizations.
738 */
739 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
740 public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS =
741 "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
742
743 /**
744 * Activity Action: Show screen for controlling background data
745 * restrictions for a particular application.
746 * <p>
747 * Input: Intent's data URI set with an application name, using the
748 * "package" schema (like "package:com.my.app").
749 *
750 * <p>
751 * Output: Nothing.
752 * <p>
753 * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus
754 * ConnectivityManager#getRestrictBackgroundStatus()} to determine the
755 * status of the background data restrictions for them.
756 */
757 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
758 public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS =
759 "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS";
760
761 /**
762 * @hide
763 * Activity Action: Show the "app ops" settings screen.
764 * <p>
765 * Input: Nothing.
766 * <p>
767 * Output: Nothing.
768 */
769 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
770 public static final String ACTION_APP_OPS_SETTINGS =
771 "android.settings.APP_OPS_SETTINGS";
772
773 /**
774 * Activity Action: Show settings to allow configuration of sync settings.
775 * <p>
776 * In some cases, a matching Activity may not exist, so ensure you
777 * safeguard against this.
778 * <p>
779 * The account types available to add via the add account button may be restricted by adding an
780 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
781 * authorities. Only account types which can sync with that content provider will be offered to
782 * the user.
783 * <p>
784 * Input: Nothing.
785 * <p>
786 * Output: Nothing.
787 */
788 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
789 public static final String ACTION_SYNC_SETTINGS =
790 "android.settings.SYNC_SETTINGS";
791
792 /**
793 * Activity Action: Show add account screen for creating a new account.
794 * <p>
795 * In some cases, a matching Activity may not exist, so ensure you
796 * safeguard against this.
797 * <p>
798 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
799 * extra to the Intent with one or more syncable content provider's authorities. Only account
800 * types which can sync with that content provider will be offered to the user.
801 * <p>
802 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
803 * Intent with one or more account types.
804 * <p>
805 * Input: Nothing.
806 * <p>
807 * Output: Nothing.
808 */
809 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
810 public static final String ACTION_ADD_ACCOUNT =
811 "android.settings.ADD_ACCOUNT_SETTINGS";
812
813 /**
814 * Activity Action: Show settings for selecting the network operator.
815 * <p>
816 * In some cases, a matching Activity may not exist, so ensure you
817 * safeguard against this.
818 * <p>
819 * Input: Nothing.
820 * <p>
821 * Output: Nothing.
822 */
823 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
824 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
825 "android.settings.NETWORK_OPERATOR_SETTINGS";
826
827 /**
828 * Activity Action: Show settings for selection of 2G/3G.
829 * <p>
830 * In some cases, a matching Activity may not exist, so ensure you
831 * safeguard against this.
832 * <p>
833 * Input: Nothing.
834 * <p>
835 * Output: Nothing.
836 */
837 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
838 public static final String ACTION_DATA_ROAMING_SETTINGS =
839 "android.settings.DATA_ROAMING_SETTINGS";
840
841 /**
842 * Activity Action: Show settings for internal storage.
843 * <p>
844 * In some cases, a matching Activity may not exist, so ensure you
845 * safeguard against this.
846 * <p>
847 * Input: Nothing.
848 * <p>
849 * Output: Nothing.
850 */
851 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
852 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
853 "android.settings.INTERNAL_STORAGE_SETTINGS";
854 /**
855 * Activity Action: Show settings for memory card storage.
856 * <p>
857 * In some cases, a matching Activity may not exist, so ensure you
858 * safeguard against this.
859 * <p>
860 * Input: Nothing.
861 * <p>
862 * Output: Nothing.
863 */
864 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
865 public static final String ACTION_MEMORY_CARD_SETTINGS =
866 "android.settings.MEMORY_CARD_SETTINGS";
867
868 /**
869 * Activity Action: Show settings for global search.
870 * <p>
871 * In some cases, a matching Activity may not exist, so ensure you
872 * safeguard against this.
873 * <p>
874 * Input: Nothing.
875 * <p>
876 * Output: Nothing
877 */
878 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
879 public static final String ACTION_SEARCH_SETTINGS =
880 "android.search.action.SEARCH_SETTINGS";
881
882 /**
883 * Activity Action: Show general device information settings (serial
884 * number, software version, phone number, etc.).
885 * <p>
886 * In some cases, a matching Activity may not exist, so ensure you
887 * safeguard against this.
888 * <p>
889 * Input: Nothing.
890 * <p>
891 * Output: Nothing
892 */
893 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
894 public static final String ACTION_DEVICE_INFO_SETTINGS =
895 "android.settings.DEVICE_INFO_SETTINGS";
896
897 /**
898 * Activity Action: Show NFC settings.
899 * <p>
900 * This shows UI that allows NFC to be turned on or off.
901 * <p>
902 * In some cases, a matching Activity may not exist, so ensure you
903 * safeguard against this.
904 * <p>
905 * Input: Nothing.
906 * <p>
907 * Output: Nothing
908 * @see android.nfc.NfcAdapter#isEnabled()
909 */
910 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
911 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
912
913 /**
914 * Activity Action: Show NFC Sharing settings.
915 * <p>
916 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
917 * off.
918 * <p>
919 * In some cases, a matching Activity may not exist, so ensure you
920 * safeguard against this.
921 * <p>
922 * Input: Nothing.
923 * <p>
924 * Output: Nothing
925 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
926 */
927 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
928 public static final String ACTION_NFCSHARING_SETTINGS =
929 "android.settings.NFCSHARING_SETTINGS";
930
931 /**
932 * Activity Action: Show NFC Tap & Pay settings
933 * <p>
934 * This shows UI that allows the user to configure Tap&Pay
935 * settings.
936 * <p>
937 * In some cases, a matching Activity may not exist, so ensure you
938 * safeguard against this.
939 * <p>
940 * Input: Nothing.
941 * <p>
942 * Output: Nothing
943 */
944 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
945 public static final String ACTION_NFC_PAYMENT_SETTINGS =
946 "android.settings.NFC_PAYMENT_SETTINGS";
947
948 /**
949 * Activity Action: Show Daydream settings.
950 * <p>
951 * In some cases, a matching Activity may not exist, so ensure you
952 * safeguard against this.
953 * <p>
954 * Input: Nothing.
955 * <p>
956 * Output: Nothing.
957 * @see android.service.dreams.DreamService
958 */
959 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
960 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
961
962 /**
963 * Activity Action: Show Notification listener settings.
964 * <p>
965 * In some cases, a matching Activity may not exist, so ensure you
966 * safeguard against this.
967 * <p>
968 * Input: Nothing.
969 * <p>
970 * Output: Nothing.
971 * @see android.service.notification.NotificationListenerService
972 */
973 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
974 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
975 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
976
977 /**
978 * Activity Action: Show Do Not Disturb access settings.
979 * <p>
980 * Users can grant and deny access to Do Not Disturb configuration from here.
981 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more
982 * details.
983 * <p>
984 * Input: Nothing.
985 * <p>
986 * Output: Nothing.
987 */
988 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
989 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS
990 = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS";
991
992 /**
993 * @hide
994 */
995 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
996 public static final String ACTION_CONDITION_PROVIDER_SETTINGS
997 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
998
999 /**
1000 * Activity Action: Show settings for video captioning.
1001 * <p>
1002 * In some cases, a matching Activity may not exist, so ensure you safeguard
1003 * against this.
1004 * <p>
1005 * Input: Nothing.
1006 * <p>
1007 * Output: Nothing.
1008 */
1009 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1010 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
1011
1012 /**
1013 * Activity Action: Show the top level print settings.
1014 * <p>
1015 * In some cases, a matching Activity may not exist, so ensure you
1016 * safeguard against this.
1017 * <p>
1018 * Input: Nothing.
1019 * <p>
1020 * Output: Nothing.
1021 */
1022 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1023 public static final String ACTION_PRINT_SETTINGS =
1024 "android.settings.ACTION_PRINT_SETTINGS";
1025
1026 /**
1027 * Activity Action: Show Zen Mode configuration settings.
1028 *
1029 * @hide
1030 */
1031 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1032 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
1033
1034 /**
1035 * Activity Action: Show Zen Mode priority configuration settings.
1036 *
1037 * @hide
1038 */
1039 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1040 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
1041 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
1042
1043 /**
1044 * Activity Action: Show Zen Mode automation configuration settings.
1045 *
1046 * @hide
1047 */
1048 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1049 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS
1050 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS";
1051
1052 /**
1053 * Activity Action: Modify do not disturb mode settings.
1054 * <p>
1055 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1056 * <p>
1057 * This intent MUST be started using
1058 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1059 * startVoiceActivity}.
1060 * <p>
1061 * Note: The Activity implementing this intent MUST verify that
1062 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
1063 * returns true before modifying the setting.
1064 * <p>
1065 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate
1066 * how long the user wishes to avoid interruptions for. The optional
1067 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is
1068 * enabling or disabling do not disturb mode. If either extra is not included, the
1069 * user maybe asked to provide the value.
1070 * <p>
1071 * Output: Nothing.
1072 */
1073 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1074 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
1075 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE";
1076
1077 /**
1078 * Activity Action: Show Zen Mode schedule rule configuration settings.
1079 *
1080 * @hide
1081 */
1082 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1083 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS
1084 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS";
1085
1086 /**
1087 * Activity Action: Show Zen Mode event rule configuration settings.
1088 *
1089 * @hide
1090 */
1091 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1092 public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS
1093 = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS";
1094
1095 /**
1096 * Activity Action: Show Zen Mode external rule configuration settings.
1097 *
1098 * @hide
1099 */
1100 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1101 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS
1102 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS";
1103
1104 /**
1105 * Activity Action: Show the regulatory information screen for the device.
1106 * <p>
1107 * In some cases, a matching Activity may not exist, so ensure you safeguard
1108 * against this.
1109 * <p>
1110 * Input: Nothing.
1111 * <p>
1112 * Output: Nothing.
1113 */
1114 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1115 public static final String
1116 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
1117
1118 /**
1119 * Activity Action: Show Device Name Settings.
1120 * <p>
1121 * In some cases, a matching Activity may not exist, so ensure you safeguard
1122 * against this.
1123 *
1124 * @hide
1125 */
1126 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1127 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
1128
1129 /**
1130 * Activity Action: Show pairing settings.
1131 * <p>
1132 * In some cases, a matching Activity may not exist, so ensure you safeguard
1133 * against this.
1134 *
1135 * @hide
1136 */
1137 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1138 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
1139
1140 /**
1141 * Activity Action: Show battery saver settings.
1142 * <p>
1143 * In some cases, a matching Activity may not exist, so ensure you safeguard
1144 * against this.
1145 */
1146 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1147 public static final String ACTION_BATTERY_SAVER_SETTINGS
1148 = "android.settings.BATTERY_SAVER_SETTINGS";
1149
1150 /**
1151 * Activity Action: Modify Battery Saver mode setting using a voice command.
1152 * <p>
1153 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
1154 * <p>
1155 * This intent MUST be started using
1156 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
1157 * startVoiceActivity}.
1158 * <p>
1159 * Note: The activity implementing this intent MUST verify that
1160 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
1161 * modifying the setting.
1162 * <p>
1163 * Input: To tell which state batter saver mode should be set to, add the
1164 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified.
1165 * If the extra is not included, no changes will be made.
1166 * <p>
1167 * Output: Nothing.
1168 */
1169 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1170 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
1171 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE";
1172
1173 /**
1174 * Activity Action: Show Home selection settings. If there are multiple activities
1175 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
1176 * to pick your preferred activity.
1177 */
1178 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1179 public static final String ACTION_HOME_SETTINGS
1180 = "android.settings.HOME_SETTINGS";
1181
1182
1183
1184 /**
1185 * Activity Action: Show Default apps settings.
1186 * <p>
1187 * In some cases, a matching Activity may not exist, so ensure you
1188 * safeguard against this.
1189 * <p>
1190 * Input: Nothing.
1191 * <p>
1192 * Output: Nothing.
1193 */
1194 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1195 public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS
1196 = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS";
1197
1198 /**
1199 * Activity Action: Show notification settings.
1200 *
1201 * @hide
1202 */
1203 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1204 public static final String ACTION_NOTIFICATION_SETTINGS
1205 = "android.settings.NOTIFICATION_SETTINGS";
1206
1207 /**
1208 * Activity Action: Show notification settings for a single app.
1209 *
1210 * @hide
1211 */
1212 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1213 public static final String ACTION_APP_NOTIFICATION_SETTINGS
1214 = "android.settings.APP_NOTIFICATION_SETTINGS";
1215
1216 /**
1217 * Activity Action: Show notification redaction settings.
1218 *
1219 * @hide
1220 */
1221 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1222 public static final String ACTION_APP_NOTIFICATION_REDACTION
1223 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
1224
1225 /** @hide */ public static final String EXTRA_APP_UID = "app_uid";
1226 /** @hide */ public static final String EXTRA_APP_PACKAGE = "app_package";
1227
1228 /**
1229 * Activity Action: Show a dialog with disabled by policy message.
1230 * <p> If an user action is disabled by policy, this dialog can be triggered to let
1231 * the user know about this.
1232 * <p>
1233 * Input: Nothing.
1234 * <p>
1235 * Output: Nothing.
1236 *
1237 * @hide
1238 */
1239 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1240 public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS
1241 = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
1242
1243 /**
1244 * Activity Action: Show a dialog for remote bugreport flow.
1245 * <p>
1246 * Input: Nothing.
1247 * <p>
1248 * Output: Nothing.
1249 *
1250 * @hide
1251 */
1252 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1253 public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG
1254 = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG";
1255
1256 /**
1257 * Activity Action: Show VR listener settings.
1258 * <p>
1259 * Input: Nothing.
1260 * <p>
1261 * Output: Nothing.
1262 *
1263 * @see android.service.vr.VrListenerService
1264 */
1265 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1266 public static final String ACTION_VR_LISTENER_SETTINGS
1267 = "android.settings.VR_LISTENER_SETTINGS";
1268
1269 /**
1270 * Activity Action: Show Storage Manager settings.
1271 * <p>
1272 * Input: Nothing.
1273 * <p>
1274 * Output: Nothing.
1275 *
1276 * @hide
1277 */
1278 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1279 public static final String ACTION_STORAGE_MANAGER_SETTINGS
1280 = "android.settings.STORAGE_MANAGER_SETTINGS";
1281
1282 /**
1283 * Activity Action: Allows user to select current webview implementation.
1284 * <p>
1285 * Input: Nothing.
1286 * <p>
1287 * Output: Nothing.
1288 */
1289 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
1290 public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS";
1291
1292 // End of Intent actions for Settings
1293
1294 /**
1295 * @hide - Private call() method on SettingsProvider to read from 'system' table.
1296 */
1297 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
1298
1299 /**
1300 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
1301 */
1302 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
1303
1304 /**
1305 * @hide - Private call() method on SettingsProvider to read from 'global' table.
1306 */
1307 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
1308
1309 /**
1310 * @hide - Specifies that the caller of the fast-path call()-based flow tracks
1311 * the settings generation in order to cache values locally. If this key is
1312 * mapped to a <code>null</code> string extra in the request bundle, the response
1313 * bundle will contain the same key mapped to a parcelable extra which would be
1314 * an {@link android.util.MemoryIntArray}. The response will also contain an
1315 * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the
1316 * index in the array clients should use to lookup the generation. For efficiency
1317 * the caller should request the generation tracking memory array only if it
1318 * doesn't already have it.
1319 *
1320 * @see #CALL_METHOD_GENERATION_INDEX_KEY
1321 */
1322 public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation";
1323
1324 /**
1325 * @hide Key with the location in the {@link android.util.MemoryIntArray} where
1326 * to look up the generation id of the backing table. The value is an integer.
1327 *
1328 * @see #CALL_METHOD_TRACK_GENERATION_KEY
1329 */
1330 public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index";
1331
1332 /**
1333 * @hide Key with the settings table generation. The value is an integer.
1334 *
1335 * @see #CALL_METHOD_TRACK_GENERATION_KEY
1336 */
1337 public static final String CALL_METHOD_GENERATION_KEY = "_generation";
1338
1339 /**
1340 * @hide - User handle argument extra to the fast-path call()-based requests
1341 */
1342 public static final String CALL_METHOD_USER_KEY = "_user";
1343
1344 /** @hide - Private call() method to write to 'system' table */
1345 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
1346
1347 /** @hide - Private call() method to write to 'secure' table */
1348 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
1349
1350 /** @hide - Private call() method to write to 'global' table */
1351 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
1352
1353 /**
1354 * Activity Extra: Limit available options in launched activity based on the given authority.
1355 * <p>
1356 * This can be passed as an extra field in an Activity Intent with one or more syncable content
1357 * provider's authorities as a String[]. This field is used by some intents to alter the
1358 * behavior of the called activity.
1359 * <p>
1360 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
1361 * on the authority given.
1362 */
1363 public static final String EXTRA_AUTHORITIES = "authorities";
1364
1365 /**
1366 * Activity Extra: Limit available options in launched activity based on the given account
1367 * types.
1368 * <p>
1369 * This can be passed as an extra field in an Activity Intent with one or more account types
1370 * as a String[]. This field is used by some intents to alter the behavior of the called
1371 * activity.
1372 * <p>
1373 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
1374 * list.
1375 */
1376 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
1377
1378 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
1379
1380 /**
1381 * Activity Extra: The device identifier to act upon.
1382 * <p>
1383 * This can be passed as an extra field in an Activity Intent with a single
1384 * InputDeviceIdentifier. This field is used by some activities to jump straight into the
1385 * settings for the given device.
1386 * <p>
1387 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
1388 * dialog for the given device.
1389 * @hide
1390 */
1391 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
1392
1393 /**
1394 * Activity Extra: Enable or disable Airplane Mode.
1395 * <p>
1396 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
1397 * intent as a boolean to indicate if it should be enabled.
1398 */
1399 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
1400
1401 /**
1402 * Activity Extra: Enable or disable Battery saver mode.
1403 * <p>
1404 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE}
1405 * intent as a boolean to indicate if it should be enabled.
1406 */
1407 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED =
1408 "android.settings.extra.battery_saver_mode_enabled";
1409
1410 /**
1411 * Activity Extra: Enable or disable Do Not Disturb mode.
1412 * <p>
1413 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1414 * intent as a boolean to indicate if it should be enabled.
1415 */
1416 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED =
1417 "android.settings.extra.do_not_disturb_mode_enabled";
1418
1419 /**
1420 * Activity Extra: How many minutes to enable do not disturb mode for.
1421 * <p>
1422 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE}
1423 * intent to indicate how long do not disturb mode should be enabled for.
1424 */
1425 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES =
1426 "android.settings.extra.do_not_disturb_mode_minutes";
1427
1428 /**
1429 * Activity Extra: Number of certificates
1430 * <p>
1431 * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO}
1432 * intent to indicate the number of certificates
1433 * @hide
1434 */
1435 public static final String EXTRA_NUMBER_OF_CERTIFICATES =
1436 "android.settings.extra.number_of_certificates";
1437
1438 private static final String JID_RESOURCE_PREFIX = "android";
1439
1440 public static final String AUTHORITY = "settings";
1441
1442 private static final String TAG = "Settings";
1443 private static final boolean LOCAL_LOGV = false;
1444
1445 // Lock ensures that when enabling/disabling the master location switch, we don't end up
1446 // with a partial enable/disable state in multi-threaded situations.
1447 private static final Object mLocationSettingsLock = new Object();
1448
1449 public static class SettingNotFoundException extends AndroidException {
1450 public SettingNotFoundException(String msg) {
1451 super(msg);
1452 }
1453 }
1454
1455 /**
1456 * Common base for tables of name/value settings.
1457 */
1458 public static class NameValueTable implements BaseColumns {
1459 public static final String NAME = "name";
1460 public static final String VALUE = "value";
1461
1462 protected static boolean putString(ContentResolver resolver, Uri uri,
1463 String name, String value) {
1464 // The database will take care of replacing duplicates.
1465 try {
1466 ContentValues values = new ContentValues();
1467 values.put(NAME, name);
1468 values.put(VALUE, value);
1469 resolver.insert(uri, values);
1470 return true;
1471 } catch (SQLException e) {
1472 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
1473 return false;
1474 }
1475 }
1476
1477 public static Uri getUriFor(Uri uri, String name) {
1478 return Uri.withAppendedPath(uri, name);
1479 }
1480 }
1481
1482 private static final class GenerationTracker {
1483 private final MemoryIntArray mArray;
1484 private final Runnable mErrorHandler;
1485 private final int mIndex;
1486 private int mCurrentGeneration;
1487
1488 public GenerationTracker(@NonNull MemoryIntArray array, int index,
1489 int generation, Runnable errorHandler) {
1490 mArray = array;
1491 mIndex = index;
1492 mErrorHandler = errorHandler;
1493 mCurrentGeneration = generation;
1494 }
1495
1496 public boolean isGenerationChanged() {
1497 final int currentGeneration = readCurrentGeneration();
1498 if (currentGeneration >= 0) {
1499 if (currentGeneration == mCurrentGeneration) {
1500 return false;
1501 }
1502 mCurrentGeneration = currentGeneration;
1503 }
1504 return true;
1505 }
1506
1507 private int readCurrentGeneration() {
1508 try {
1509 return mArray.get(mIndex);
1510 } catch (IOException e) {
1511 Log.e(TAG, "Error getting current generation", e);
1512 if (mErrorHandler != null) {
1513 mErrorHandler.run();
1514 }
1515 }
1516 return -1;
1517 }
1518
1519 public void destroy() {
1520 try {
1521 mArray.close();
1522 } catch (IOException e) {
1523 Log.e(TAG, "Error closing backing array", e);
1524 if (mErrorHandler != null) {
1525 mErrorHandler.run();
1526 }
1527 }
1528 }
1529 }
1530
1531 // Thread-safe.
1532 private static class NameValueCache {
1533 private static final boolean DEBUG = false;
1534
1535 private final Uri mUri;
1536
1537 private static final String[] SELECT_VALUE =
1538 new String[] { Settings.NameValueTable.VALUE };
1539 private static final String NAME_EQ_PLACEHOLDER = "name=?";
1540
1541 // Must synchronize on 'this' to access mValues and mValuesVersion.
1542 private final HashMap<String, String> mValues = new HashMap<String, String>();
1543
1544 // Initially null; set lazily and held forever. Synchronized on 'this'.
1545 private IContentProvider mContentProvider = null;
1546
1547 // The method we'll call (or null, to not use) on the provider
1548 // for the fast path of retrieving settings.
1549 private final String mCallGetCommand;
1550 private final String mCallSetCommand;
1551
1552 @GuardedBy("this")
1553 private GenerationTracker mGenerationTracker;
1554
1555 public NameValueCache(Uri uri, String getCommand, String setCommand) {
1556 mUri = uri;
1557 mCallGetCommand = getCommand;
1558 mCallSetCommand = setCommand;
1559 }
1560
1561 private IContentProvider lazyGetProvider(ContentResolver cr) {
1562 IContentProvider cp = null;
1563 synchronized (NameValueCache.this) {
1564 cp = mContentProvider;
1565 if (cp == null) {
1566 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
1567 }
1568 }
1569 return cp;
1570 }
1571
1572 public boolean putStringForUser(ContentResolver cr, String name, String value,
1573 final int userHandle) {
1574 try {
1575 Bundle arg = new Bundle();
1576 arg.putString(Settings.NameValueTable.VALUE, value);
1577 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
1578 IContentProvider cp = lazyGetProvider(cr);
1579 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
1580 } catch (RemoteException e) {
1581 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
1582 return false;
1583 }
1584 return true;
1585 }
1586
1587 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
1588 final boolean isSelf = (userHandle == UserHandle.myUserId());
1589 if (isSelf) {
1590 synchronized (NameValueCache.this) {
1591 if (mGenerationTracker != null) {
1592 if (mGenerationTracker.isGenerationChanged()) {
1593 if (DEBUG) {
1594 Log.i(TAG, "Generation changed for type:"
1595 + mUri.getPath() + " in package:"
1596 + cr.getPackageName() +" and user:" + userHandle);
1597 }
1598 mValues.clear();
1599 } else if (mValues.containsKey(name)) {
1600 return mValues.get(name);
1601 }
1602 }
1603 }
1604 } else {
1605 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
1606 + " by user " + UserHandle.myUserId() + " so skipping cache");
1607 }
1608
1609 IContentProvider cp = lazyGetProvider(cr);
1610
1611 // Try the fast path first, not using query(). If this
1612 // fails (alternate Settings provider that doesn't support
1613 // this interface?) then we fall back to the query/table
1614 // interface.
1615 if (mCallGetCommand != null) {
1616 try {
1617 Bundle args = null;
1618 if (!isSelf) {
1619 args = new Bundle();
1620 args.putInt(CALL_METHOD_USER_KEY, userHandle);
1621 }
1622 boolean needsGenerationTracker = false;
1623 synchronized (NameValueCache.this) {
1624 if (isSelf && mGenerationTracker == null) {
1625 needsGenerationTracker = true;
1626 if (args == null) {
1627 args = new Bundle();
1628 }
1629 args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null);
1630 if (DEBUG) {
1631 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath()
1632 + " in package:" + cr.getPackageName() +" and user:"
1633 + userHandle);
1634 }
1635 }
1636 }
1637 Bundle b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
1638 if (b != null) {
1639 String value = b.getString(Settings.NameValueTable.VALUE);
1640 // Don't update our cache for reads of other users' data
1641 if (isSelf) {
1642 synchronized (NameValueCache.this) {
1643 if (needsGenerationTracker) {
1644 MemoryIntArray array = b.getParcelable(
1645 CALL_METHOD_TRACK_GENERATION_KEY);
1646 final int index = b.getInt(
1647 CALL_METHOD_GENERATION_INDEX_KEY, -1);
1648 if (array != null && index >= 0) {
1649 final int generation = b.getInt(
1650 CALL_METHOD_GENERATION_KEY, 0);
1651 if (DEBUG) {
1652 Log.i(TAG, "Received generation tracker for type:"
1653 + mUri.getPath() + " in package:"
1654 + cr.getPackageName() + " and user:"
1655 + userHandle + " with index:" + index);
1656 }
1657 mGenerationTracker = new GenerationTracker(array, index,
1658 generation, () -> {
1659 synchronized (NameValueCache.this) {
1660 Log.e(TAG, "Error accessing generation"
1661 + " tracker - removing");
1662 if (mGenerationTracker != null) {
1663 GenerationTracker generationTracker =
1664 mGenerationTracker;
1665 mGenerationTracker = null;
1666 generationTracker.destroy();
1667 mValues.clear();
1668 }
1669 }
1670 });
1671 }
1672 }
1673 mValues.put(name, value);
1674 }
1675 } else {
1676 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
1677 + " by " + UserHandle.myUserId()
1678 + " so not updating cache");
1679 }
1680 return value;
1681 }
1682 // If the response Bundle is null, we fall through
1683 // to the query interface below.
1684 } catch (RemoteException e) {
1685 // Not supported by the remote side? Fall through
1686 // to query().
1687 }
1688 }
1689
1690 Cursor c = null;
1691 try {
1692 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
1693 new String[]{name}, null, null);
1694 if (c == null) {
1695 Log.w(TAG, "Can't get key " + name + " from " + mUri);
1696 return null;
1697 }
1698
1699 String value = c.moveToNext() ? c.getString(0) : null;
1700 synchronized (NameValueCache.this) {
1701 mValues.put(name, value);
1702 }
1703 if (LOCAL_LOGV) {
1704 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
1705 name + " = " + (value == null ? "(null)" : value));
1706 }
1707 return value;
1708 } catch (RemoteException e) {
1709 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
1710 return null; // Return null, but don't cache it.
1711 } finally {
1712 if (c != null) c.close();
1713 }
1714 }
1715 }
1716
1717 /**
1718 * Checks if the specified context can draw on top of other apps. As of API
1719 * level 23, an app cannot draw on top of other apps unless it declares the
1720 * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its
1721 * manifest, <em>and</em> the user specifically grants the app this
1722 * capability. To prompt the user to grant this approval, the app must send an
1723 * intent with the action
1724 * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which
1725 * causes the system to display a permission management screen.
1726 *
1727 * @param context App context.
1728 * @return true if the specified context can draw on top of other apps, false otherwise
1729 */
1730 public static boolean canDrawOverlays(Context context) {
1731 return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(),
1732 context.getOpPackageName(), false);
1733 }
1734
1735 /**
1736 * System settings, containing miscellaneous system preferences. This
1737 * table holds simple name/value pairs. There are convenience
1738 * functions for accessing individual settings entries.
1739 */
1740 public static final class System extends NameValueTable {
1741 private static final float DEFAULT_FONT_SCALE = 1.0f;
1742
1743 /** @hide */
1744 public static interface Validator {
1745 public boolean validate(String value);
1746 }
1747
1748 /**
1749 * The content:// style URL for this table
1750 */
1751 public static final Uri CONTENT_URI =
1752 Uri.parse("content://" + AUTHORITY + "/system");
1753
1754 private static final NameValueCache sNameValueCache = new NameValueCache(
1755 CONTENT_URI,
1756 CALL_METHOD_GET_SYSTEM,
1757 CALL_METHOD_PUT_SYSTEM);
1758
1759 private static final HashSet<String> MOVED_TO_SECURE;
1760 static {
1761 MOVED_TO_SECURE = new HashSet<String>(30);
1762 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
1763 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
1764 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
1765 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
1766 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
1767 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
1768 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
1769 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
1770 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
1771 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
1772 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
1773 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
1774 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
1775 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
1776 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
1777 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
1778 MOVED_TO_SECURE.add(Secure.WIFI_ON);
1779 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
1780 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
1781 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
1782 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
1783 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
1784 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
1785 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
1786 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
1787 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
1788 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
1789 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
1790
1791 // At one time in System, then Global, but now back in Secure
1792 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
1793 }
1794
1795 private static final HashSet<String> MOVED_TO_GLOBAL;
1796 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
1797 static {
1798 MOVED_TO_GLOBAL = new HashSet<String>();
1799 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
1800
1801 // these were originally in system but migrated to secure in the past,
1802 // so are duplicated in the Secure.* namespace
1803 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
1804 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
1805 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
1806 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
1807 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
1808 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
1809
1810 // these are moving directly from system to global
1811 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
1812 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
1813 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
1814 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
1815 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
1816 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
1817 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
1818 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
1819 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
1820 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
1821 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
1822 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
1823 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
1824 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
1825 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
1826 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
1827 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
1828 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
1829 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
1830 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
1831 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
1832 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
1833 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
1834 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
1835 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
1836 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
1837 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
1838 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
1839 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
1840 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
1841 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
1842 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
1843 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
1844 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
1845 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
1846 }
1847
1848 private static final Validator sBooleanValidator =
1849 new DiscreteValueValidator(new String[] {"0", "1"});
1850
1851 private static final Validator sNonNegativeIntegerValidator = new Validator() {
1852 @Override
1853 public boolean validate(String value) {
1854 try {
1855 return Integer.parseInt(value) >= 0;
1856 } catch (NumberFormatException e) {
1857 return false;
1858 }
1859 }
1860 };
1861
1862 private static final Validator sUriValidator = new Validator() {
1863 @Override
1864 public boolean validate(String value) {
1865 try {
1866 Uri.decode(value);
1867 return true;
1868 } catch (IllegalArgumentException e) {
1869 return false;
1870 }
1871 }
1872 };
1873
1874 private static final Validator sLenientIpAddressValidator = new Validator() {
1875 private static final int MAX_IPV6_LENGTH = 45;
1876
1877 @Override
1878 public boolean validate(String value) {
1879 return value.length() <= MAX_IPV6_LENGTH;
1880 }
1881 };
1882
1883 /** @hide */
1884 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
1885 outKeySet.addAll(MOVED_TO_GLOBAL);
1886 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
1887 }
1888
1889 /** @hide */
1890 public static void getMovedToSecureSettings(Set<String> outKeySet) {
1891 outKeySet.addAll(MOVED_TO_SECURE);
1892 }
1893
1894 /** @hide */
1895 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
1896 outKeySet.addAll(MOVED_TO_GLOBAL);
1897 }
1898
1899 /**
1900 * Look up a name in the database.
1901 * @param resolver to access the database with
1902 * @param name to look up in the table
1903 * @return the corresponding value, or null if not present
1904 */
1905 public static String getString(ContentResolver resolver, String name) {
1906 return getStringForUser(resolver, name, UserHandle.myUserId());
1907 }
1908
1909 /** @hide */
1910 public static String getStringForUser(ContentResolver resolver, String name,
1911 int userHandle) {
1912 if (MOVED_TO_SECURE.contains(name)) {
1913 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1914 + " to android.provider.Settings.Secure, returning read-only value.");
1915 return Secure.getStringForUser(resolver, name, userHandle);
1916 }
1917 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
1918 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1919 + " to android.provider.Settings.Global, returning read-only value.");
1920 return Global.getStringForUser(resolver, name, userHandle);
1921 }
1922 return sNameValueCache.getStringForUser(resolver, name, userHandle);
1923 }
1924
1925 /**
1926 * Store a name/value pair into the database.
1927 * @param resolver to access the database with
1928 * @param name to store
1929 * @param value to associate with the name
1930 * @return true if the value was set, false on database errors
1931 */
1932 public static boolean putString(ContentResolver resolver, String name, String value) {
1933 return putStringForUser(resolver, name, value, UserHandle.myUserId());
1934 }
1935
1936 /** @hide */
1937 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
1938 int userHandle) {
1939 if (MOVED_TO_SECURE.contains(name)) {
1940 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1941 + " to android.provider.Settings.Secure, value is unchanged.");
1942 return false;
1943 }
1944 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
1945 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1946 + " to android.provider.Settings.Global, value is unchanged.");
1947 return false;
1948 }
1949 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
1950 }
1951
1952 /**
1953 * Construct the content URI for a particular name/value pair,
1954 * useful for monitoring changes with a ContentObserver.
1955 * @param name to look up in the table
1956 * @return the corresponding content URI, or null if not present
1957 */
1958 public static Uri getUriFor(String name) {
1959 if (MOVED_TO_SECURE.contains(name)) {
1960 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1961 + " to android.provider.Settings.Secure, returning Secure URI.");
1962 return Secure.getUriFor(Secure.CONTENT_URI, name);
1963 }
1964 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
1965 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1966 + " to android.provider.Settings.Global, returning read-only global URI.");
1967 return Global.getUriFor(Global.CONTENT_URI, name);
1968 }
1969 return getUriFor(CONTENT_URI, name);
1970 }
1971
1972 /**
1973 * Convenience function for retrieving a single system settings value
1974 * as an integer. Note that internally setting values are always
1975 * stored as strings; this function converts the string to an integer
1976 * for you. The default value will be returned if the setting is
1977 * not defined or not an integer.
1978 *
1979 * @param cr The ContentResolver to access.
1980 * @param name The name of the setting to retrieve.
1981 * @param def Value to return if the setting is not defined.
1982 *
1983 * @return The setting's current value, or 'def' if it is not defined
1984 * or not a valid integer.
1985 */
1986 public static int getInt(ContentResolver cr, String name, int def) {
1987 return getIntForUser(cr, name, def, UserHandle.myUserId());
1988 }
1989
1990 /** @hide */
1991 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
1992 String v = getStringForUser(cr, name, userHandle);
1993 try {
1994 return v != null ? Integer.parseInt(v) : def;
1995 } catch (NumberFormatException e) {
1996 return def;
1997 }
1998 }
1999
2000 /**
2001 * Convenience function for retrieving a single system settings value
2002 * as an integer. Note that internally setting values are always
2003 * stored as strings; this function converts the string to an integer
2004 * for you.
2005 * <p>
2006 * This version does not take a default value. If the setting has not
2007 * been set, or the string value is not a number,
2008 * it throws {@link SettingNotFoundException}.
2009 *
2010 * @param cr The ContentResolver to access.
2011 * @param name The name of the setting to retrieve.
2012 *
2013 * @throws SettingNotFoundException Thrown if a setting by the given
2014 * name can't be found or the setting value is not an integer.
2015 *
2016 * @return The setting's current value.
2017 */
2018 public static int getInt(ContentResolver cr, String name)
2019 throws SettingNotFoundException {
2020 return getIntForUser(cr, name, UserHandle.myUserId());
2021 }
2022
2023 /** @hide */
2024 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
2025 throws SettingNotFoundException {
2026 String v = getStringForUser(cr, name, userHandle);
2027 try {
2028 return Integer.parseInt(v);
2029 } catch (NumberFormatException e) {
2030 throw new SettingNotFoundException(name);
2031 }
2032 }
2033
2034 /**
2035 * Convenience function for updating a single settings value as an
2036 * integer. This will either create a new entry in the table if the
2037 * given name does not exist, or modify the value of the existing row
2038 * with that name. Note that internally setting values are always
2039 * stored as strings, so this function converts the given value to a
2040 * string before storing it.
2041 *
2042 * @param cr The ContentResolver to access.
2043 * @param name The name of the setting to modify.
2044 * @param value The new value for the setting.
2045 * @return true if the value was set, false on database errors
2046 */
2047 public static boolean putInt(ContentResolver cr, String name, int value) {
2048 return putIntForUser(cr, name, value, UserHandle.myUserId());
2049 }
2050
2051 /** @hide */
2052 public static boolean putIntForUser(ContentResolver cr, String name, int value,
2053 int userHandle) {
2054 return putStringForUser(cr, name, Integer.toString(value), userHandle);
2055 }
2056
2057 /**
2058 * Convenience function for retrieving a single system settings value
2059 * as a {@code long}. Note that internally setting values are always
2060 * stored as strings; this function converts the string to a {@code long}
2061 * for you. The default value will be returned if the setting is
2062 * not defined or not a {@code long}.
2063 *
2064 * @param cr The ContentResolver to access.
2065 * @param name The name of the setting to retrieve.
2066 * @param def Value to return if the setting is not defined.
2067 *
2068 * @return The setting's current value, or 'def' if it is not defined
2069 * or not a valid {@code long}.
2070 */
2071 public static long getLong(ContentResolver cr, String name, long def) {
2072 return getLongForUser(cr, name, def, UserHandle.myUserId());
2073 }
2074
2075 /** @hide */
2076 public static long getLongForUser(ContentResolver cr, String name, long def,
2077 int userHandle) {
2078 String valString = getStringForUser(cr, name, userHandle);
2079 long value;
2080 try {
2081 value = valString != null ? Long.parseLong(valString) : def;
2082 } catch (NumberFormatException e) {
2083 value = def;
2084 }
2085 return value;
2086 }
2087
2088 /**
2089 * Convenience function for retrieving a single system settings value
2090 * as a {@code long}. Note that internally setting values are always
2091 * stored as strings; this function converts the string to a {@code long}
2092 * for you.
2093 * <p>
2094 * This version does not take a default value. If the setting has not
2095 * been set, or the string value is not a number,
2096 * it throws {@link SettingNotFoundException}.
2097 *
2098 * @param cr The ContentResolver to access.
2099 * @param name The name of the setting to retrieve.
2100 *
2101 * @return The setting's current value.
2102 * @throws SettingNotFoundException Thrown if a setting by the given
2103 * name can't be found or the setting value is not an integer.
2104 */
2105 public static long getLong(ContentResolver cr, String name)
2106 throws SettingNotFoundException {
2107 return getLongForUser(cr, name, UserHandle.myUserId());
2108 }
2109
2110 /** @hide */
2111 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
2112 throws SettingNotFoundException {
2113 String valString = getStringForUser(cr, name, userHandle);
2114 try {
2115 return Long.parseLong(valString);
2116 } catch (NumberFormatException e) {
2117 throw new SettingNotFoundException(name);
2118 }
2119 }
2120
2121 /**
2122 * Convenience function for updating a single settings value as a long
2123 * integer. This will either create a new entry in the table if the
2124 * given name does not exist, or modify the value of the existing row
2125 * with that name. Note that internally setting values are always
2126 * stored as strings, so this function converts the given value to a
2127 * string before storing it.
2128 *
2129 * @param cr The ContentResolver to access.
2130 * @param name The name of the setting to modify.
2131 * @param value The new value for the setting.
2132 * @return true if the value was set, false on database errors
2133 */
2134 public static boolean putLong(ContentResolver cr, String name, long value) {
2135 return putLongForUser(cr, name, value, UserHandle.myUserId());
2136 }
2137
2138 /** @hide */
2139 public static boolean putLongForUser(ContentResolver cr, String name, long value,
2140 int userHandle) {
2141 return putStringForUser(cr, name, Long.toString(value), userHandle);
2142 }
2143
2144 /**
2145 * Convenience function for retrieving a single system settings value
2146 * as a floating point number. Note that internally setting values are
2147 * always stored as strings; this function converts the string to an
2148 * float for you. The default value will be returned if the setting
2149 * is not defined or not a valid float.
2150 *
2151 * @param cr The ContentResolver to access.
2152 * @param name The name of the setting to retrieve.
2153 * @param def Value to return if the setting is not defined.
2154 *
2155 * @return The setting's current value, or 'def' if it is not defined
2156 * or not a valid float.
2157 */
2158 public static float getFloat(ContentResolver cr, String name, float def) {
2159 return getFloatForUser(cr, name, def, UserHandle.myUserId());
2160 }
2161
2162 /** @hide */
2163 public static float getFloatForUser(ContentResolver cr, String name, float def,
2164 int userHandle) {
2165 String v = getStringForUser(cr, name, userHandle);
2166 try {
2167 return v != null ? Float.parseFloat(v) : def;
2168 } catch (NumberFormatException e) {
2169 return def;
2170 }
2171 }
2172
2173 /**
2174 * Convenience function for retrieving a single system settings value
2175 * as a float. Note that internally setting values are always
2176 * stored as strings; this function converts the string to a float
2177 * for you.
2178 * <p>
2179 * This version does not take a default value. If the setting has not
2180 * been set, or the string value is not a number,
2181 * it throws {@link SettingNotFoundException}.
2182 *
2183 * @param cr The ContentResolver to access.
2184 * @param name The name of the setting to retrieve.
2185 *
2186 * @throws SettingNotFoundException Thrown if a setting by the given
2187 * name can't be found or the setting value is not a float.
2188 *
2189 * @return The setting's current value.
2190 */
2191 public static float getFloat(ContentResolver cr, String name)
2192 throws SettingNotFoundException {
2193 return getFloatForUser(cr, name, UserHandle.myUserId());
2194 }
2195
2196 /** @hide */
2197 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
2198 throws SettingNotFoundException {
2199 String v = getStringForUser(cr, name, userHandle);
2200 if (v == null) {
2201 throw new SettingNotFoundException(name);
2202 }
2203 try {
2204 return Float.parseFloat(v);
2205 } catch (NumberFormatException e) {
2206 throw new SettingNotFoundException(name);
2207 }
2208 }
2209
2210 /**
2211 * Convenience function for updating a single settings value as a
2212 * floating point number. This will either create a new entry in the
2213 * table if the given name does not exist, or modify the value of the
2214 * existing row with that name. Note that internally setting values
2215 * are always stored as strings, so this function converts the given
2216 * value to a string before storing it.
2217 *
2218 * @param cr The ContentResolver to access.
2219 * @param name The name of the setting to modify.
2220 * @param value The new value for the setting.
2221 * @return true if the value was set, false on database errors
2222 */
2223 public static boolean putFloat(ContentResolver cr, String name, float value) {
2224 return putFloatForUser(cr, name, value, UserHandle.myUserId());
2225 }
2226
2227 /** @hide */
2228 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
2229 int userHandle) {
2230 return putStringForUser(cr, name, Float.toString(value), userHandle);
2231 }
2232
2233 /**
2234 * Convenience function to read all of the current
2235 * configuration-related settings into a
2236 * {@link Configuration} object.
2237 *
2238 * @param cr The ContentResolver to access.
2239 * @param outConfig Where to place the configuration settings.
2240 */
2241 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
2242 adjustConfigurationForUser(cr, outConfig, UserHandle.myUserId(),
2243 false /* updateSettingsIfEmpty */);
2244 }
2245
2246 /** @hide */
2247 public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig,
2248 int userHandle, boolean updateSettingsIfEmpty) {
2249 outConfig.fontScale = Settings.System.getFloatForUser(
2250 cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle);
2251 if (outConfig.fontScale < 0) {
2252 outConfig.fontScale = DEFAULT_FONT_SCALE;
2253 }
2254
2255 final String localeValue =
2256 Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle);
2257 if (localeValue != null) {
2258 outConfig.setLocales(LocaleList.forLanguageTags(localeValue));
2259 } else {
2260 // Do not update configuration with emtpy settings since we need to take over the
2261 // locale list of previous user if the settings value is empty. This happens when a
2262 // new user is created.
2263
2264 if (updateSettingsIfEmpty) {
2265 // Make current configuration persistent. This is necessary the first time a
2266 // user log in. At the first login, the configuration settings are empty, so we
2267 // need to store the adjusted configuration as the initial settings.
2268 Settings.System.putStringForUser(
2269 cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(),
2270 userHandle);
2271 }
2272 }
2273 }
2274
2275 /**
2276 * @hide Erase the fields in the Configuration that should be applied
2277 * by the settings.
2278 */
2279 public static void clearConfiguration(Configuration inoutConfig) {
2280 inoutConfig.fontScale = 0;
2281 if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) {
2282 inoutConfig.clearLocales();
2283 }
2284 }
2285
2286 /**
2287 * Convenience function to write a batch of configuration-related
2288 * settings from a {@link Configuration} object.
2289 *
2290 * @param cr The ContentResolver to access.
2291 * @param config The settings to write.
2292 * @return true if the values were set, false on database errors
2293 */
2294 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
2295 return putConfigurationForUser(cr, config, UserHandle.myUserId());
2296 }
2297
2298 /** @hide */
2299 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
2300 int userHandle) {
2301 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) &&
2302 Settings.System.putStringForUser(
2303 cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle);
2304 }
2305
2306 /** @hide */
2307 public static boolean hasInterestingConfigurationChanges(int changes) {
2308 return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 ||
2309 (changes & ActivityInfo.CONFIG_LOCALE) != 0;
2310 }
2311
2312 /** @deprecated - Do not use */
2313 @Deprecated
2314 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
2315 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
2316 }
2317
2318 /**
2319 * @hide
2320 * @deprecated - Do not use
2321 */
2322 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
2323 int userHandle) {
2324 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
2325 }
2326
2327 /** @deprecated - Do not use */
2328 @Deprecated
2329 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
2330 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
2331 }
2332
2333 /**
2334 * @hide
2335 * @deprecated - Do not use
2336 */
2337 @Deprecated
2338 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
2339 int userHandle) {
2340 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
2341 }
2342
2343 private static final class DiscreteValueValidator implements Validator {
2344 private final String[] mValues;
2345
2346 public DiscreteValueValidator(String[] values) {
2347 mValues = values;
2348 }
2349
2350 @Override
2351 public boolean validate(String value) {
2352 return ArrayUtils.contains(mValues, value);
2353 }
2354 }
2355
2356 private static final class InclusiveIntegerRangeValidator implements Validator {
2357 private final int mMin;
2358 private final int mMax;
2359
2360 public InclusiveIntegerRangeValidator(int min, int max) {
2361 mMin = min;
2362 mMax = max;
2363 }
2364
2365 @Override
2366 public boolean validate(String value) {
2367 try {
2368 final int intValue = Integer.parseInt(value);
2369 return intValue >= mMin && intValue <= mMax;
2370 } catch (NumberFormatException e) {
2371 return false;
2372 }
2373 }
2374 }
2375
2376 private static final class InclusiveFloatRangeValidator implements Validator {
2377 private final float mMin;
2378 private final float mMax;
2379
2380 public InclusiveFloatRangeValidator(float min, float max) {
2381 mMin = min;
2382 mMax = max;
2383 }
2384
2385 @Override
2386 public boolean validate(String value) {
2387 try {
2388 final float floatValue = Float.parseFloat(value);
2389 return floatValue >= mMin && floatValue <= mMax;
2390 } catch (NumberFormatException e) {
2391 return false;
2392 }
2393 }
2394 }
2395
2396 /**
2397 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
2398 */
2399 @Deprecated
2400 public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN;
2401
2402 /**
2403 * What happens when the user presses the end call button if they're not
2404 * on a call.<br/>
2405 * <b>Values:</b><br/>
2406 * 0 - The end button does nothing.<br/>
2407 * 1 - The end button goes to the home screen.<br/>
2408 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
2409 * 3 - The end button goes to the home screen. If the user is already on the
2410 * home screen, it puts the device to sleep.
2411 */
2412 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
2413
2414 private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
2415 new InclusiveIntegerRangeValidator(0, 3);
2416
2417 /**
2418 * END_BUTTON_BEHAVIOR value for "go home".
2419 * @hide
2420 */
2421 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
2422
2423 /**
2424 * END_BUTTON_BEHAVIOR value for "go to sleep".
2425 * @hide
2426 */
2427 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
2428
2429 /**
2430 * END_BUTTON_BEHAVIOR default value.
2431 * @hide
2432 */
2433 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
2434
2435 /**
2436 * List of Apps hidden from recents
2437 * @hide
2438 */
2439 public static final String HIDE_FROM_RECENTS_LIST = "hide_from_recents_list";
2440
2441 /**
2442 * Is advanced settings mode turned on. 0 == no, 1 == yes
2443 * @hide
2444 */
2445 public static final String ADVANCED_SETTINGS = "advanced_settings";
2446
2447 private static final Validator ADVANCED_SETTINGS_VALIDATOR = sBooleanValidator;
2448
2449 /**
2450 * ADVANCED_SETTINGS default value.
2451 * @hide
2452 */
2453 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
2454
2455 /**
2456 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
2457 */
2458 @Deprecated
2459 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
2460
2461 /**
2462 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
2463 */
2464 @Deprecated
2465 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
2466
2467 /**
2468 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
2469 */
2470 @Deprecated
2471 public static final String RADIO_WIFI = Global.RADIO_WIFI;
2472
2473 /**
2474 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
2475 * {@hide}
2476 */
2477 @Deprecated
2478 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
2479
2480 /**
2481 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
2482 */
2483 @Deprecated
2484 public static final String RADIO_CELL = Global.RADIO_CELL;
2485
2486 /**
2487 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
2488 */
2489 @Deprecated
2490 public static final String RADIO_NFC = Global.RADIO_NFC;
2491
2492 /**
2493 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
2494 */
2495 @Deprecated
2496 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
2497
2498 /**
2499 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
2500 *
2501 * {@hide}
2502 */
2503 @Deprecated
2504 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
2505 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
2506
2507 /**
2508 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
2509 */
2510 @Deprecated
2511 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
2512
2513 /**
2514 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
2515 */
2516 @Deprecated
2517 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
2518
2519 /**
2520 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
2521 */
2522 @Deprecated
2523 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
2524 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
2525
2526 /**
2527 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
2528 */
2529 @Deprecated
2530 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
2531
2532 /**
2533 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
2534 */
2535 @Deprecated
2536 public static final String MODE_RINGER = Global.MODE_RINGER;
2537
2538 /**
2539 * Whether to use static IP and other static network attributes.
2540 * <p>
2541 * Set to 1 for true and 0 for false.
2542 *
2543 * @deprecated Use {@link WifiManager} instead
2544 */
2545 @Deprecated
2546 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
2547
2548 private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = sBooleanValidator;
2549
2550 /**
2551 * The static IP address.
2552 * <p>
2553 * Example: "192.168.1.51"
2554 *
2555 * @deprecated Use {@link WifiManager} instead
2556 */
2557 @Deprecated
2558 public static final String WIFI_STATIC_IP = "wifi_static_ip";
2559
2560 private static final Validator WIFI_STATIC_IP_VALIDATOR = sLenientIpAddressValidator;
2561
2562 /**
2563 * If using static IP, the gateway's IP address.
2564 * <p>
2565 * Example: "192.168.1.1"
2566 *
2567 * @deprecated Use {@link WifiManager} instead
2568 */
2569 @Deprecated
2570 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
2571
2572 private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = sLenientIpAddressValidator;
2573
2574 /**
2575 * If using static IP, the net mask.
2576 * <p>
2577 * Example: "255.255.255.0"
2578 *
2579 * @deprecated Use {@link WifiManager} instead
2580 */
2581 @Deprecated
2582 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
2583
2584 private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = sLenientIpAddressValidator;
2585
2586 /**
2587 * If using static IP, the primary DNS's IP address.
2588 * <p>
2589 * Example: "192.168.1.1"
2590 *
2591 * @deprecated Use {@link WifiManager} instead
2592 */
2593 @Deprecated
2594 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
2595
2596 private static final Validator WIFI_STATIC_DNS1_VALIDATOR = sLenientIpAddressValidator;
2597
2598 /**
2599 * If using static IP, the secondary DNS's IP address.
2600 * <p>
2601 * Example: "192.168.1.2"
2602 *
2603 * @deprecated Use {@link WifiManager} instead
2604 */
2605 @Deprecated
2606 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
2607
2608 private static final Validator WIFI_STATIC_DNS2_VALIDATOR = sLenientIpAddressValidator;
2609
2610 /**
2611 * Determines whether remote devices may discover and/or connect to
2612 * this device.
2613 * <P>Type: INT</P>
2614 * 2 -- discoverable and connectable
2615 * 1 -- connectable but not discoverable
2616 * 0 -- neither connectable nor discoverable
2617 */
2618 public static final String BLUETOOTH_DISCOVERABILITY =
2619 "bluetooth_discoverability";
2620
2621 private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
2622 new InclusiveIntegerRangeValidator(0, 2);
2623
2624 /**
2625 * If all file types can be accepted over Bluetooth OBEX.
2626 * @hide
2627 */
2628 public static final String BLUETOOTH_ACCEPT_ALL_FILES =
2629 "bluetooth_accept_all_files";
2630
2631 /**
2632 * Bluetooth discoverability timeout. If this value is nonzero, then
2633 * Bluetooth becomes discoverable for a certain number of seconds,
2634 * after which is becomes simply connectable. The value is in seconds.
2635 */
2636 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
2637 "bluetooth_discoverability_timeout";
2638
2639 private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
2640 sNonNegativeIntegerValidator;
2641
2642 /**
2643 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
2644 * instead
2645 */
2646 @Deprecated
2647 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
2648
2649 /**
2650 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
2651 * instead
2652 */
2653 @Deprecated
2654 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2655
2656 /**
2657 * @deprecated Use
2658 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
2659 * instead
2660 */
2661 @Deprecated
2662 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2663 "lock_pattern_tactile_feedback_enabled";
2664
2665 /**
2666 * A formatted string of the next alarm that is set, or the empty string
2667 * if there is no alarm set.
2668 *
2669 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
2670 */
2671 @Deprecated
2672 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
2673
2674 private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
2675 private static final int MAX_LENGTH = 1000;
2676
2677 @Override
2678 public boolean validate(String value) {
2679 // TODO: No idea what the correct format is.
2680 return value == null || value.length() < MAX_LENGTH;
2681 }
2682 };
2683
2684 /**
2685 * Scaling factor for fonts, float.
2686 */
2687 public static final String FONT_SCALE = "font_scale";
2688
2689 private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
2690 @Override
2691 public boolean validate(String value) {
2692 try {
2693 return Float.parseFloat(value) >= 0;
2694 } catch (NumberFormatException e) {
2695 return false;
2696 }
2697 }
2698 };
2699
2700 /**
2701 * The serialized system locale value.
2702 *
2703 * Do not use this value directory.
2704 * To get system locale, use {@link LocaleList#getDefault} instead.
2705 * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales}
2706 * instead.
2707 * @hide
2708 */
2709 public static final String SYSTEM_LOCALES = "system_locales";
2710
2711
2712 /**
2713 * Name of an application package to be debugged.
2714 *
2715 * @deprecated Use {@link Global#DEBUG_APP} instead
2716 */
2717 @Deprecated
2718 public static final String DEBUG_APP = Global.DEBUG_APP;
2719
2720 /**
2721 * If 1, when launching DEBUG_APP it will wait for the debugger before
2722 * starting user code. If 0, it will run normally.
2723 *
2724 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
2725 */
2726 @Deprecated
2727 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
2728
2729 /**
2730 * Whether or not to dim the screen. 0=no 1=yes
2731 * @deprecated This setting is no longer used.
2732 */
2733 @Deprecated
2734 public static final String DIM_SCREEN = "dim_screen";
2735
2736 private static final Validator DIM_SCREEN_VALIDATOR = sBooleanValidator;
2737
2738 /**
2739 * The amount of time in milliseconds before the device goes to sleep or begins
2740 * to dream after a period of inactivity. This value is also known as the
2741 * user activity timeout period since the screen isn't necessarily turned off
2742 * when it expires.
2743 */
2744 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
2745
2746 private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = sNonNegativeIntegerValidator;
2747
2748 /**
2749 * The screen backlight brightness between 0 and 255.
2750 */
2751 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
2752
2753 private static final Validator SCREEN_BRIGHTNESS_VALIDATOR =
2754 new InclusiveIntegerRangeValidator(0, 255);
2755
2756 /**
2757 * Control whether to enable automatic brightness mode.
2758 */
2759 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
2760
2761 private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = sBooleanValidator;
2762
2763 /**
2764 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
2765 * or less (<0.0 >-1.0) bright.
2766 * @hide
2767 */
2768 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
2769
2770 private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
2771 new InclusiveFloatRangeValidator(-1, 1);
2772
2773 /**
2774 * SCREEN_BRIGHTNESS_MODE value for manual mode.
2775 */
2776 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
2777
2778 /**
2779 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
2780 */
2781 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
2782
2783 /**
2784 * Control whether the process CPU usage meter should be shown.
2785 *
2786 * @deprecated This functionality is no longer available as of
2787 * {@link android.os.Build.VERSION_CODES#N_MR1}.
2788 */
2789 @Deprecated
2790 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
2791
2792 /**
2793 * If 1, the activity manager will aggressively finish activities and
2794 * processes as soon as they are no longer needed. If 0, the normal
2795 * extended lifetime is used.
2796 *
2797 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
2798 */
2799 @Deprecated
2800 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
2801
2802 /**
2803 * Determines which streams are affected by ringer mode changes. The
2804 * stream type's bit should be set to 1 if it should be muted when going
2805 * into an inaudible ringer mode.
2806 */
2807 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
2808
2809 private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
2810 sNonNegativeIntegerValidator;
2811
2812 /**
2813 * Determines which streams are affected by mute. The
2814 * stream type's bit should be set to 1 if it should be muted when a mute request
2815 * is received.
2816 */
2817 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
2818
2819 private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
2820 sNonNegativeIntegerValidator;
2821
2822 /**
2823 * Whether vibrate is on for different events. This is used internally,
2824 * changing this value will not change the vibrate. See AudioManager.
2825 */
2826 public static final String VIBRATE_ON = "vibrate_on";
2827
2828 private static final Validator VIBRATE_ON_VALIDATOR = sBooleanValidator;
2829
2830 /**
2831 * If 1, redirects the system vibrator to all currently attached input devices
2832 * that support vibration. If there are no such input devices, then the system
2833 * vibrator is used instead.
2834 * If 0, does not register the system vibrator.
2835 *
2836 * This setting is mainly intended to provide a compatibility mechanism for
2837 * applications that only know about the system vibrator and do not use the
2838 * input device vibrator API.
2839 *
2840 * @hide
2841 */
2842 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
2843
2844 private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = sBooleanValidator;
2845
2846 /**
2847 * Ringer volume. This is used internally, changing this value will not
2848 * change the volume. See AudioManager.
2849 *
2850 * @removed Not used by anything since API 2.
2851 */
2852 public static final String VOLUME_RING = "volume_ring";
2853
2854 /**
2855 * System/notifications volume. This is used internally, changing this
2856 * value will not change the volume. See AudioManager.
2857 *
2858 * @removed Not used by anything since API 2.
2859 */
2860 public static final String VOLUME_SYSTEM = "volume_system";
2861
2862 /**
2863 * Voice call volume. This is used internally, changing this value will
2864 * not change the volume. See AudioManager.
2865 *
2866 * @removed Not used by anything since API 2.
2867 */
2868 public static final String VOLUME_VOICE = "volume_voice";
2869
2870 /**
2871 * Music/media/gaming volume. This is used internally, changing this
2872 * value will not change the volume. See AudioManager.
2873 *
2874 * @removed Not used by anything since API 2.
2875 */
2876 public static final String VOLUME_MUSIC = "volume_music";
2877
2878 /**
2879 * Alarm volume. This is used internally, changing this
2880 * value will not change the volume. See AudioManager.
2881 *
2882 * @removed Not used by anything since API 2.
2883 */
2884 public static final String VOLUME_ALARM = "volume_alarm";
2885
2886 /**
2887 * Notification volume. This is used internally, changing this
2888 * value will not change the volume. See AudioManager.
2889 *
2890 * @removed Not used by anything since API 2.
2891 */
2892 public static final String VOLUME_NOTIFICATION = "volume_notification";
2893
2894 /**
2895 * Bluetooth Headset volume. This is used internally, changing this value will
2896 * not change the volume. See AudioManager.
2897 *
2898 * @removed Not used by anything since API 2.
2899 */
2900 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
2901
2902 /**
2903 * Master volume (float in the range 0.0f to 1.0f).
2904 *
2905 * @hide
2906 */
2907 public static final String VOLUME_MASTER = "volume_master";
2908
2909 /**
2910 * Master mono (int 1 = mono, 0 = normal).
2911 *
2912 * @hide
2913 */
2914 public static final String MASTER_MONO = "master_mono";
2915
2916 private static final Validator MASTER_MONO_VALIDATOR = sBooleanValidator;
2917
2918 /**
2919 * Whether the notifications should use the ring volume (value of 1) or
2920 * a separate notification volume (value of 0). In most cases, users
2921 * will have this enabled so the notification and ringer volumes will be
2922 * the same. However, power users can disable this and use the separate
2923 * notification volume control.
2924 * <p>
2925 * Note: This is a one-off setting that will be removed in the future
2926 * when there is profile support. For this reason, it is kept hidden
2927 * from the public APIs.
2928 *
2929 * @hide
2930 * @deprecated
2931 */
2932 @Deprecated
2933 public static final String NOTIFICATIONS_USE_RING_VOLUME =
2934 "notifications_use_ring_volume";
2935
2936 private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = sBooleanValidator;
2937
2938 /**
2939 * Whether silent mode should allow vibration feedback. This is used
2940 * internally in AudioService and the Sound settings activity to
2941 * coordinate decoupling of vibrate and silent modes. This setting
2942 * will likely be removed in a future release with support for
2943 * audio/vibe feedback profiles.
2944 *
2945 * Not used anymore. On devices with vibrator, the user explicitly selects
2946 * silent or vibrate mode.
2947 * Kept for use by legacy database upgrade code in DatabaseHelper.
2948 * @hide
2949 */
2950 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
2951
2952 private static final Validator VIBRATE_IN_SILENT_VALIDATOR = sBooleanValidator;
2953
2954 /**
2955 * The mapping of stream type (integer) to its setting.
2956 *
2957 * @removed Not used by anything since API 2.
2958 */
2959 public static final String[] VOLUME_SETTINGS = {
2960 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
2961 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
2962 };
2963
2964 /**
2965 * Appended to various volume related settings to record the previous
2966 * values before they the settings were affected by a silent/vibrate
2967 * ringer mode change.
2968 *
2969 * @removed Not used by anything since API 2.
2970 */
2971 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
2972
2973 /**
2974 * Persistent store for the system-wide default ringtone URI.
2975 * <p>
2976 * If you need to play the default ringtone at any given time, it is recommended
2977 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
2978 * to the set default ringtone at the time of playing.
2979 *
2980 * @see #DEFAULT_RINGTONE_URI
2981 */
2982 public static final String RINGTONE = "ringtone";
2983
2984 private static final Validator RINGTONE_VALIDATOR = sUriValidator;
2985
2986 /**
2987 * A {@link Uri} that will point to the current default ringtone at any
2988 * given time.
2989 * <p>
2990 * If the current default ringtone is in the DRM provider and the caller
2991 * does not have permission, the exception will be a
2992 * FileNotFoundException.
2993 */
2994 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
2995
2996 /** {@hide} */
2997 public static final String RINGTONE_CACHE = "ringtone_cache";
2998 /** {@hide} */
2999 public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE);
3000
3001 /**
3002 * Persistent store for the system-wide default notification sound.
3003 *
3004 * @see #RINGTONE
3005 * @see #DEFAULT_NOTIFICATION_URI
3006 */
3007 public static final String NOTIFICATION_SOUND = "notification_sound";
3008
3009 private static final Validator NOTIFICATION_SOUND_VALIDATOR = sUriValidator;
3010
3011 /**
3012 * A {@link Uri} that will point to the current default notification
3013 * sound at any given time.
3014 *
3015 * @see #DEFAULT_RINGTONE_URI
3016 */
3017 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
3018
3019 /** {@hide} */
3020 public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache";
3021 /** {@hide} */
3022 public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE);
3023
3024 /**
3025 * Persistent store for the system-wide default alarm alert.
3026 *
3027 * @see #RINGTONE
3028 * @see #DEFAULT_ALARM_ALERT_URI
3029 */
3030 public static final String ALARM_ALERT = "alarm_alert";
3031
3032 private static final Validator ALARM_ALERT_VALIDATOR = sUriValidator;
3033
3034 /**
3035 * A {@link Uri} that will point to the current default alarm alert at
3036 * any given time.
3037 *
3038 * @see #DEFAULT_ALARM_ALERT_URI
3039 */
3040 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
3041
3042 /** {@hide} */
3043 public static final String ALARM_ALERT_CACHE = "alarm_alert_cache";
3044 /** {@hide} */
3045 public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE);
3046
3047 /**
3048 * Persistent store for the system default media button event receiver.
3049 *
3050 * @hide
3051 */
3052 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
3053
3054 private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = new Validator() {
3055 @Override
3056 public boolean validate(String value) {
3057 try {
3058 ComponentName.unflattenFromString(value);
3059 return true;
3060 } catch (NullPointerException e) {
3061 return false;
3062 }
3063 }
3064 };
3065
3066 /**
3067 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
3068 */
3069 public static final String TEXT_AUTO_REPLACE = "auto_replace";
3070
3071 private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = sBooleanValidator;
3072
3073 /**
3074 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
3075 */
3076 public static final String TEXT_AUTO_CAPS = "auto_caps";
3077
3078 private static final Validator TEXT_AUTO_CAPS_VALIDATOR = sBooleanValidator;
3079
3080 /**
3081 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
3082 * feature converts two spaces to a "." and space.
3083 */
3084 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
3085
3086 private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = sBooleanValidator;
3087
3088 /**
3089 * Setting to showing password characters in text editors. 1 = On, 0 = Off
3090 */
3091 public static final String TEXT_SHOW_PASSWORD = "show_password";
3092
3093 private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = sBooleanValidator;
3094
3095 public static final String SHOW_GTALK_SERVICE_STATUS =
3096 "SHOW_GTALK_SERVICE_STATUS";
3097
3098 private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = sBooleanValidator;
3099
3100 /**
3101 * Name of activity to use for wallpaper on the home screen.
3102 *
3103 * @deprecated Use {@link WallpaperManager} instead.
3104 */
3105 @Deprecated
3106 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
3107
3108 private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
3109 private static final int MAX_LENGTH = 1000;
3110
3111 @Override
3112 public boolean validate(String value) {
3113 if (value != null && value.length() > MAX_LENGTH) {
3114 return false;
3115 }
3116 return ComponentName.unflattenFromString(value) != null;
3117 }
3118 };
3119
3120 /**
3121 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
3122 * instead
3123 */
3124 @Deprecated
3125 public static final String AUTO_TIME = Global.AUTO_TIME;
3126
3127 /**
3128 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
3129 * instead
3130 */
3131 @Deprecated
3132 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
3133
3134 /**
3135 * Display times as 12 or 24 hours
3136 * 12
3137 * 24
3138 */
3139 public static final String TIME_12_24 = "time_12_24";
3140
3141 /** @hide */
3142 public static final Validator TIME_12_24_VALIDATOR =
3143 new DiscreteValueValidator(new String[] {"12", "24"});
3144
3145 /**
3146 * Date format string
3147 * mm/dd/yyyy
3148 * dd/mm/yyyy
3149 * yyyy/mm/dd
3150 */
3151 public static final String DATE_FORMAT = "date_format";
3152
3153 /** @hide */
3154 public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
3155 @Override
3156 public boolean validate(String value) {
3157 try {
3158 new SimpleDateFormat(value);
3159 return true;
3160 } catch (IllegalArgumentException e) {
3161 return false;
3162 }
3163 }
3164 };
3165
3166 /**
3167 * Whether the setup wizard has been run before (on first boot), or if
3168 * it still needs to be run.
3169 *
3170 * nonzero = it has been run in the past
3171 * 0 = it has not been run in the past
3172 */
3173 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
3174
3175 /** @hide */
3176 public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = sBooleanValidator;
3177
3178 /**
3179 * Scaling factor for normal window animations. Setting to 0 will disable window
3180 * animations.
3181 *
3182 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
3183 */
3184 @Deprecated
3185 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
3186
3187 /**
3188 * Scaling factor for activity transition animations. Setting to 0 will disable window
3189 * animations.
3190 *
3191 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
3192 */
3193 @Deprecated
3194 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
3195
3196 /**
3197 * Scaling factor for Animator-based animations. This affects both the start delay and
3198 * duration of all such animations. Setting to 0 will cause animations to end immediately.
3199 * The default value is 1.
3200 *
3201 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
3202 */
3203 @Deprecated
3204 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
3205
3206 /**
3207 * Control whether the accelerometer will be used to change screen
3208 * orientation. If 0, it will not be used unless explicitly requested
3209 * by the application; if 1, it will be used by default unless explicitly
3210 * disabled by the application.
3211 */
3212 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
3213
3214 /** @hide */
3215 public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = sBooleanValidator;
3216
3217 /**
3218 * Control the type of rotation which can be performed using the accelerometer
3219 * if ACCELEROMETER_ROTATION is enabled.
3220 * Value is a bitwise combination of
3221 * 1 = 0 degrees (portrait)
3222 * 2 = 90 degrees (left)
3223 * 4 = 180 degrees (inverted portrait)
3224 * 8 = 270 degrees (right)
3225 * Setting to 0 is effectively orientation lock
3226 * @hide
3227 */
3228 public static final String ACCELEROMETER_ROTATION_ANGLES = "accelerometer_rotation_angles";
3229
3230 /**
3231 * Whether to display powermenu on secure lockscreen
3232 *
3233 * @hide
3234 */
3235 public static final String POWER_MENU_LOCKSCREEN = "power_menu_lockscreen";
3236
3237 /**
3238 * Default screen rotation when no other policy applies.
3239 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
3240 * preference, this rotation value will be used. Must be one of the
3241 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
3242 *
3243 * @see android.view.Display#getRotation
3244 */
3245 public static final String USER_ROTATION = "user_rotation";
3246
3247 /** @hide */
3248 public static final Validator USER_ROTATION_VALIDATOR =
3249 new InclusiveIntegerRangeValidator(0, 3);
3250
3251 /**
3252 * Control whether the rotation lock toggle in the System UI should be hidden.
3253 * Typically this is done for accessibility purposes to make it harder for
3254 * the user to accidentally toggle the rotation lock while the display rotation
3255 * has been locked for accessibility.
3256 *
3257 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
3258 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
3259 *
3260 * @hide
3261 */
3262 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
3263 "hide_rotation_lock_toggle_for_accessibility";
3264
3265 /** @hide */
3266 public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
3267 sBooleanValidator;
3268
3269 /**
3270 * Whether the phone vibrates when it is ringing due to an incoming call. This will
3271 * be used by Phone and Setting apps; it shouldn't affect other apps.
3272 * The value is boolean (1 or 0).
3273 *
3274 * Note: this is not same as "vibrate on ring", which had been available until ICS.
3275 * It was about AudioManager's setting and thus affected all the applications which
3276 * relied on the setting, while this is purely about the vibration setting for incoming
3277 * calls.
3278 */
3279 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
3280
3281 /** @hide */
3282 public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = sBooleanValidator;
3283
3284 /**
3285 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
3286 * boolean (1 or 0).
3287 */
3288 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
3289
3290 /** @hide */
3291 public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
3292
3293 /**
3294 * CDMA only settings
3295 * DTMF tone type played by the dialer when dialing.
3296 * 0 = Normal
3297 * 1 = Long
3298 */
3299 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
3300
3301 /** @hide */
3302 public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
3303
3304 /**
3305 * Whether the hearing aid is enabled. The value is
3306 * boolean (1 or 0).
3307 * @hide
3308 */
3309 public static final String HEARING_AID = "hearing_aid";
3310
3311 /** @hide */
3312 public static final Validator HEARING_AID_VALIDATOR = sBooleanValidator;
3313
3314 /**
3315 * CDMA only settings
3316 * TTY Mode
3317 * 0 = OFF
3318 * 1 = FULL
3319 * 2 = VCO
3320 * 3 = HCO
3321 * @hide
3322 */
3323 public static final String TTY_MODE = "tty_mode";
3324
3325 /** @hide */
3326 public static final Validator TTY_MODE_VALIDATOR = new InclusiveIntegerRangeValidator(0, 3);
3327
3328 /**
3329 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
3330 * boolean (1 or 0).
3331 */
3332 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
3333
3334 /** @hide */
3335 public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = sBooleanValidator;
3336
3337 /**
3338 * Whether the haptic feedback (long presses, ...) are enabled. The value is
3339 * boolean (1 or 0).
3340 */
3341 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
3342
3343 /** @hide */
3344 public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = sBooleanValidator;
3345
3346 /**
3347 * @deprecated Each application that shows web suggestions should have its own
3348 * setting for this.
3349 */
3350 @Deprecated
3351 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
3352
3353 /** @hide */
3354 public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = sBooleanValidator;;
3355
3356 /**
3357 * Whether to enable the pixel navbar animation
3358 * @hide
3359 */
3360 public static final String PIXEL_NAV_ANIMATION = "pixel_nav_animation";
3361
3362 /**
3363 * Whether to allow notifications with the screen on or DayDreams.
3364 * The value is boolean (1 or 0). Default will always be false.
3365 * @hide
3366 */
3367 public static final String NOTIFICATION_LIGHT_SCREEN_ON =
3368 "notification_light_screen_on_enable";
3369
3370 /**
3371 * Whether the notification LED should repeatedly flash when a notification is
3372 * pending. The value is boolean (1 or 0).
3373 * @hide
3374 */
3375 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
3376
3377 /** @hide */
3378 public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = sBooleanValidator;
3379
3380 /**
3381 * What color to use for the notification LED by default
3382 * @hide
3383 */
3384 public static final String NOTIFICATION_LIGHT_PULSE_DEFAULT_COLOR =
3385 "notification_light_pulse_default_color";
3386
3387 /**
3388 * How long to flash the notification LED by default
3389 * @hide
3390 */
3391 public static final String NOTIFICATION_LIGHT_PULSE_DEFAULT_LED_ON =
3392 "notification_light_pulse_default_led_on";
3393
3394 /**
3395 * How long to wait between flashes for the notification LED by default
3396 * @hide
3397 */
3398 public static final String NOTIFICATION_LIGHT_PULSE_DEFAULT_LED_OFF =
3399 "notification_light_pulse_default_led_off";
3400
3401 /**
3402 * What color to use for the missed call notification LED
3403 * @hide
3404 */
3405 public static final String NOTIFICATION_LIGHT_PULSE_CALL_COLOR =
3406 "notification_light_pulse_call_color";
3407
3408 /**
3409 * How long to flash the missed call notification LED
3410 * @hide
3411 */
3412 public static final String NOTIFICATION_LIGHT_PULSE_CALL_LED_ON =
3413 "notification_light_pulse_call_led_on";
3414
3415 /**
3416 * How long to wait between flashes for the missed call notification LED
3417 * @hide
3418 */
3419 public static final String NOTIFICATION_LIGHT_PULSE_CALL_LED_OFF =
3420 "notification_light_pulse_call_led_off";
3421 /**
3422 * What color to use for the voicemail notification LED
3423 * @hide
3424 */
3425 public static final String NOTIFICATION_LIGHT_PULSE_VMAIL_COLOR =
3426 "notification_light_pulse_vmail_color";
3427
3428 /**
3429 * How long to flash the voicemail notification LED
3430 * @hide
3431 */
3432 public static final String NOTIFICATION_LIGHT_PULSE_VMAIL_LED_ON =
3433 "notification_light_pulse_vmail_led_on";
3434
3435 /**
3436 * How long to wait between flashes for the voicemail notification LED
3437 * @hide
3438 */
3439 public static final String NOTIFICATION_LIGHT_PULSE_VMAIL_LED_OFF =
3440 "notification_light_pulse_vmail_led_off";
3441
3442 /**
3443 * Whether to use the custom LED values for the notification pulse LED.
3444 * @hide
3445 */
3446 public static final String NOTIFICATION_LIGHT_PULSE_CUSTOM_ENABLE =
3447 "notification_light_pulse_custom_enable";
3448
3449 /**
3450 * Which custom LED values to use for the notification pulse LED.
3451 * @hide
3452 */
3453 public static final String NOTIFICATION_LIGHT_PULSE_CUSTOM_VALUES =
3454 "notification_light_pulse_custom_values";
3455
3456 /**
3457 * Whether the battery light should be enabled (if hardware supports it)
3458 * The value is boolean (1 or 0).
3459 * @hide
3460 */
3461 public static final String BATTERY_LIGHT_ENABLED = "battery_light_enabled";
3462
3463 /**
3464 * Whether the battery LED should repeatedly flash when the battery is low
3465 * on charge. The value is boolean (1 or 0).
3466 * @hide
3467 */
3468 public static final String BATTERY_LIGHT_PULSE = "battery_light_pulse";
3469
3470 /**
3471 * What color to use for the battery LED while charging - low
3472 * @hide
3473 */
3474 public static final String BATTERY_LIGHT_LOW_COLOR = "battery_light_low_color";
3475
3476 /**
3477 * What color to use for the battery LED while charging - medium
3478 * @hide
3479 */
3480 public static final String BATTERY_LIGHT_MEDIUM_COLOR = "battery_light_medium_color";
3481
3482 /**
3483 * What color to use for the battery LED while charging - full
3484 * @hide
3485 */
3486 public static final String BATTERY_LIGHT_FULL_COLOR = "battery_light_full_color";
3487
3488 /**
3489 * What color to use for the battery LED while charging - really full (100%)
3490 * @hide
3491 */
3492 public static final String BATTERY_LIGHT_REALLY_FULL_COLOR = "battery_light_really_full_color";
3493
3494 /**
3495 * Show pointer location on screen?
3496 * 0 = no
3497 * 1 = yes
3498 * @hide
3499 */
3500 public static final String POINTER_LOCATION = "pointer_location";
3501
3502 /** @hide */
3503 public static final Validator POINTER_LOCATION_VALIDATOR = sBooleanValidator;
3504
3505 /**
3506 * Show touch positions on screen?
3507 * 0 = no
3508 * 1 = yes
3509 * @hide
3510 */
3511 public static final String SHOW_TOUCHES = "show_touches";
3512
3513 /** @hide */
3514 public static final Validator SHOW_TOUCHES_VALIDATOR = sBooleanValidator;
3515
3516 /**
3517 * Log raw orientation data from
3518 * {@link com.android.server.policy.WindowOrientationListener} for use with the
3519 * orientationplot.py tool.
3520 * 0 = no
3521 * 1 = yes
3522 * @hide
3523 */
3524 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
3525 "window_orientation_listener_log";
3526
3527 /** @hide */
3528 public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = sBooleanValidator;
3529
3530 /**
3531 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
3532 * instead
3533 * @hide
3534 */
3535 @Deprecated
3536 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
3537
3538 /**
3539 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
3540 * instead
3541 * @hide
3542 */
3543 @Deprecated
3544 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
3545
3546 /**
3547 * Whether to play sounds when the keyguard is shown and dismissed.
3548 * @hide
3549 */
3550 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
3551
3552 /** @hide */
3553 public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = sBooleanValidator;
3554
3555 /**
3556 * Whether the lockscreen should be completely disabled.
3557 * @hide
3558 */
3559 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
3560
3561 /** @hide */
3562 public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = sBooleanValidator;
3563
3564 /**
3565 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
3566 * instead
3567 * @hide
3568 */
3569 @Deprecated
3570 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
3571
3572 /**
3573 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
3574 * instead
3575 * @hide
3576 */
3577 @Deprecated
3578 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
3579
3580 /**
3581 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
3582 * instead
3583 * @hide
3584 */
3585 @Deprecated
3586 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
3587
3588 /**
3589 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
3590 * instead
3591 * @hide
3592 */
3593 @Deprecated
3594 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
3595
3596 /**
3597 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
3598 * instead
3599 * @hide
3600 */
3601 @Deprecated
3602 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
3603
3604 /**
3605 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
3606 * instead
3607 * @hide
3608 */
3609 @Deprecated
3610 public static final String LOCK_SOUND = Global.LOCK_SOUND;
3611
3612 /**
3613 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
3614 * instead
3615 * @hide
3616 */
3617 @Deprecated
3618 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
3619
3620 /**
3621 * Receive incoming SIP calls?
3622 * 0 = no
3623 * 1 = yes
3624 * @hide
3625 */
3626 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
3627
3628 /** @hide */
3629 public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = sBooleanValidator;
3630
3631 /**
3632 * Call Preference String.
3633 * "SIP_ALWAYS" : Always use SIP with network access
3634 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
3635 * @hide
3636 */
3637 public static final String SIP_CALL_OPTIONS = "sip_call_options";
3638
3639 /** @hide */
3640 public static final Validator SIP_CALL_OPTIONS_VALIDATOR = new DiscreteValueValidator(
3641 new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
3642
3643 /**
3644 * One of the sip call options: Always use SIP with network access.
3645 * @hide
3646 */
3647 public static final String SIP_ALWAYS = "SIP_ALWAYS";
3648
3649 /** @hide */
3650 public static final Validator SIP_ALWAYS_VALIDATOR = sBooleanValidator;
3651
3652 /**
3653 * One of the sip call options: Only if destination is a SIP address.
3654 * @hide
3655 */
3656 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
3657
3658 /** @hide */
3659 public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = sBooleanValidator;
3660
3661 /**
3662 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that
3663 * the user should be prompted each time a call is made whether it should be placed using
3664 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with
3665 * SIP_ADDRESS_ONLY.
3666 * @hide
3667 */
3668 @Deprecated
3669 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
3670
3671 /** @hide */
3672 public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = sBooleanValidator;
3673
3674 /**
3675 * Pointer speed setting.
3676 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
3677 * -7 = slowest
3678 * 0 = default speed
3679 * +7 = fastest
3680 * @hide
3681 */
3682 public static final String POINTER_SPEED = "pointer_speed";
3683
3684 /** @hide */
3685 public static final Validator POINTER_SPEED_VALIDATOR =
3686 new InclusiveFloatRangeValidator(-7, 7);
3687
3688 /**
3689 * Whether the phone volume up / down effect should be played
3690 * @hide
3691 */
3692 public static final String VOLUME_ADJUST_SOUNDS_ENABLED = "volume_adjust_sounds_enabled";
3693
3694 /**
3695 * Whether lock-to-app will be triggered by long-press on recents.
3696 * @hide
3697 */
3698 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
3699
3700 /** @hide */
3701 public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = sBooleanValidator;
3702
3703 /**
3704 * Enable/Disable screenshot sound
3705 * @hide
3706 */
3707 public static final String SCREENSHOT_SOUND = "screenshot_sound";
3708
3709 /**
3710 * I am the lolrus.
3711 * <p>
3712 * Nonzero values indicate that the user has a bukkit.
3713 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
3714 * @hide
3715 */
3716 public static final String EGG_MODE = "egg_mode";
3717
3718 /** @hide */
3719 public static final Validator EGG_MODE_VALIDATOR = new Validator() {
3720 @Override
3721 public boolean validate(String value) {
3722 try {
3723 return Long.parseLong(value) >= 0;
3724 } catch (NumberFormatException e) {
3725 return false;
3726 }
3727 }
3728 };
3729
3730 /**
3731 * IMPORTANT: If you add a new public settings you also have to add it to
3732 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
3733 * it to PRIVATE_SETTINGS below. Also add a validator that can validate
3734 * the setting value. See an example above.
3735 */
3736
3737 /**
3738 * Enable statusbar double tap gesture on to put device to sleep
3739 * @hide
3740 */
3741 public static final String DOUBLE_TAP_SLEEP_GESTURE = "double_tap_sleep_gesture";
3742
3743 /**
3744 * Whether to allow fullscreen screenshots or let the user select which area to screenshot
3745 *
3746 */
3747 public static final String SCREENSHOT_TYPE = "screenshot_type";
3748
3749 /**
3750 * Enable double tap gesture anywhere on the lock screen put device to sleep
3751 * @hide
3752 */
3753 public static final String DOUBLE_TAP_SLEEP_ANYWHERE = "double_tap_sleep_anywhere";
3754
3755 /**
3756 * Require double tap instead of simple tap to wake from Doze pulse screen
3757 * @hide
3758 */
3759 public static final String DOZE_WAKEUP_DOUBLETAP = "doze_wakeup_doubletap";
3760
3761 /**
3762 * whether to enable torch on lockscreen
3763 * @hide
3764 */
3765 public static final String KEYGUARD_TOGGLE_TORCH = "keyguard_toggle_torch";
3766
3767 /**
3768 * Whether to scramble a pin unlock layout
3769 * @hide
3770 */
3771 public static final String LOCKSCREEN_PIN_SCRAMBLE_LAYOUT = "lockscreen_scramble_pin_layout";
3772
3773 /**
3774 * Network traffic indicator, goes from least to greatest significant bitwise
3775 * 0 = Display up-stream traffic if set
3776 * 1 = Display down-stream traffic if set
3777 * 2 = Show as Byte/s if set
3778 * 16-31 = Refresh interval(ms) min: 250 max: 32750 default: 1000
3779 * @hide
3780 */
3781 public static final String NETWORK_TRAFFIC_STATE = "network_traffic_state";
3782
3783 /**
3784 * Network stats Color style
3785 * @hide
3786 */
3787 public static final String NETWORK_TRAFFIC_COLOR = "network_traffic_color";
3788
3789 /**
3790 * Whether or not to hide the network traffic indicator when there is no activity
3791 * @hide
3792 */
3793 public static final String NETWORK_TRAFFIC_AUTOHIDE = "network_traffic_autohide";
3794
3795 /**
3796 * Network traffic inactivity threshold (default is 10 kBs)
3797 * @hide
3798 */
3799 public static final String NETWORK_TRAFFIC_AUTOHIDE_THRESHOLD = "network_traffic_autohide_threshold";
3800
3801 /**
3802 * Whether to disable showing arrows in network traffic indicators
3803 * @hide
3804 */
3805 public static final String NETWORK_TRAFFIC_HIDEARROW = "network_traffic_hidearrow";
3806
3807 /**
3808 * Whether to display sound panel in the power menu
3809 *
3810 * @hide
3811 */
3812 public static final String POWERMENU_SOUNDPANEL = "powermenu_soundpanel";
3813
3814 /**
3815 * Whether to display screenshot in the power menu
3816 *
3817 * @hide
3818 */
3819 public static final String POWERMENU_SCREENSHOT = "powermenu_screenshot";
3820
3821 /**
3822 * Whether to display settings in the power menu
3823 *
3824 * @hide
3825 */
3826 public static final String POWERMENU_SETTINGS = "powermenu_settings";
3827
3828 /**
3829 * Whether to display lock in the power menu
3830 *
3831 * @hide
3832 */
3833 public static final String POWERMENU_LOCKDOWN = "powermenu_lockdown";
3834
3835 /**
3836 * Whether to display airplane in the power menu
3837 *
3838 * @hide
3839 */
3840 public static final String POWERMENU_AIRPLANE = "powermenu_airplane";
3841
3842 /**
3843 * Whether to display reboot in the power menu
3844 *
3845 * @hide
3846 */
3847 public static final String POWERMENU_REBOOT = "powermenu_reboot";
3848
3849 /**
3850 * Whether to display power in the power menu
3851 *
3852 * @hide
3853 */
3854 public static final String POWERMENU_POWER = "powermenu_power";
3855
3856 /**
3857 * Whether to display screen record in the power menu
3858 *
3859 * @hide
3860 */
3861 public static final String POWERMENU_SCREENRECORD = "powermenu_screenrecord";
3862
3863 /**
3864 * Whether to display the torch option in the power menu
3865 *
3866 * @hide
3867 */
3868 public static final String POWERMENU_TORCH = "powermenu_torch";
3869
3870 /**
3871 * Toast icon
3872 * @hide
3873 */
3874 public static final String TOAST_ICON = "toast_icon";
3875
3876 /**
3877 * Dim amount control for power and reboot dialogs
3878 * @hide
3879 */
3880 public static final String POWER_REBOOT_DIALOG_DIM = "power_reboot_dialog_dim";
3881
3882 /**
3883 * Volume rocker wake
3884 * @hide
3885 */
3886 public static final String VOLUME_ROCKER_WAKE = "volume_rocker_wake";
3887
3888
3889 /**
3890 * Whether or not volume button music controls should be enabled to seek media tracks
3891 * @hide
3892 */
3893 public static final String VOLUME_ROCKER_MUSIC_CONTROLS = "volume_rocker_music_controls";
3894
3895 /**
3896 * Swap volume buttons when the screen is rotated
3897 * 0 - Disabled
3898 * 1 - Enabled (screen is rotated by 90 or 180 degrees: phone, hybrid)
3899 * 2 - Enabled (screen is rotated by 180 or 270 degrees: tablet)
3900 * @hide
3901 */
3902 public static final String SWAP_VOLUME_BUTTONS = "swap_volume_buttons";
3903
3904 /**
3905 * Whether to display set of animations when prompting the power menu
3906 *
3907 * @hide
3908 */
3909 public static final String POWER_MENU_ANIMATIONS = "power_menu_animations";
3910
3911 /**
3912 * Whether to vibrate when quick settings tile is pressed.
3913 *
3914 * @hide
3915 */
3916 public static final String QUICK_SETTINGS_TILES_VIBRATE = "quick_settings_vibrate";
3917
3918 /**
3919 * Show the four 4g network icon instead of lte
3920 * @hide
3921 */
3922 public static final String SHOW_LTE_FOURGEE = "show_lte_fourgee";
3923
3924 /**
3925 * Quick Settings number of columns
3926 * @hide
3927 */
3928 public static final String QS_LAYOUT_COLUMNS = "qs_layout_columns";
3929
3930 /**
3931 * Number of rows used for the Quick Settings (portrait)
3932 *
3933 * @hide
3934 */
3935 public static final String QS_ROWS_PORTRAIT = "qs_rows_portrait";
3936
3937 /**
3938 * Number of rows used for the Quick Settings (landscape)
3939 *
3940 * @hide
3941 */
3942 public static final String QS_ROWS_LANDSCAPE = "qs_rows_landscape";
3943
3944 /**
3945 * Whether to hide the clock, show it in the right or left
3946 * position or show it in the center
3947 * 0: don't show the clock
3948 * 1: show the clock in the right position (LTR)
3949 * 2: show the clock in the center
3950 * 3: show the clock in the left position (LTR)
3951 * default: 1
3952 * @hide
3953 */
3954 public static final String STATUS_BAR_CLOCK = "status_bar_clock";
3955
3956 /**
3957 * Whether to show the battery info on the lockscreen while charging
3958 * @hide
3959 */
3960 public static final String LOCKSCREEN_BATTERY_INFO = "lockscreen_battery_info";
3961
3962 /**
3963 * Display style of AM/PM next to clock in status bar
3964 * 0: Normal display (Eclair stock)
3965 * 1: Small display (Froyo stock)
3966 * 2: No display (Gingerbread/ICS stock)
3967 * default: 2
3968 * @hide
3969 */
3970 public static final String STATUS_BAR_AM_PM = "status_bar_am_pm";
3971
3972 /**
3973 * Shows custom date before clock time
3974 * 0 - No Date
3975 * 1 - Small Date
3976 * 2 - Normal Date
3977 * @hide
3978 */
3979 public static final String STATUS_BAR_CLOCK_DATE_DISPLAY = "statusbar_clock_date_display";
3980
3981 /**
3982 * Sets the date string style
3983 * 0 - Regular style
3984 * 1 - Lowercase
3985 * 2 - Uppercase
3986 * @hide
3987 */
3988 public static final String STATUS_BAR_CLOCK_DATE_STYLE = "statusbar_clock_date_style";
3989
3990 /**
3991 * Stores the java DateFormat string for the date
3992 * @hide
3993 */
3994 public static final String STATUS_BAR_CLOCK_DATE_FORMAT = "statusbar_clock_date_format";
3995
3996 /**
3997 * Whether to use the custom status bar header or not
3998 * @hide
3999 */
4000 public static final String STATUS_BAR_CUSTOM_HEADER = "status_bar_custom_header";
4001
4002 /**
4003 * Manual override picture to use
4004 * @hide
4005 */
4006 public static final String STATUS_BAR_CUSTOM_HEADER_IMAGE = "status_bar_custom_header_image";
4007
4008 /**
4009 * Current active provider - available currently "static" "daylight"
4010 * @hide
4011 */
4012 public static final String STATUS_BAR_CUSTOM_HEADER_PROVIDER = "status_bar_custom_header_provider";
4013
4014 /**
4015 * Whether to apply a shadow on top of the header image
4016 * value is the alpha value of the shadow image is 0 -> no shadow -> 255 black
4017 * @hide
4018 */
4019 public static final String STATUS_BAR_CUSTOM_HEADER_SHADOW = "status_bar_custom_header_shadow";
4020
4021 /**
4022 * header image package to use for daylight header - package name - null if default
4023 * @hide
4024 */
4025 public static final String STATUS_BAR_DAYLIGHT_HEADER_PACK = "status_bar_daylight_header_pack";
4026
4027 /**
4028 * Status bar carrier label
4029 * 0: Hide
4030 * 1: Display on keyguard status bar
4031 * 2: Display on Normal status bar
4032 * 3: Enabled for both
4033 * @hide
4034 */
4035 public static final String STATUS_BAR_SHOW_CARRIER = "status_bar_show_carrier";
4036
4037 /**
4038 * Whether to show or hide the Settings Shortcut
4039 * @hide
4040 */
4041 public static final String QS_SETTINGS_ICON_TOGGLE = "qs_settings_icon_toggle";
4042
4043 /**
4044 * Whether to show or hide the Settings Shortcut in expanded mode
4045 * @hide
4046 */
4047 public static final String QS_SETTINGS_EXPANDED_TOGGLE = "qs_settings_expanded_toggle";
4048
4049 /**
4050 * Whether to show or hide the edit icon
4051 * @hide
4052 */
4053 public static final String QS_EDIT_TOGGLE = "qs_edit_toggle";
4054
4055 /**
4056 * Whether to show or hide the multiuser switch
4057 * @hide
4058 */
4059 public static final String QS_MULTIUSER_SWITCH_TOGGLE = "qs_multiuser_switch_toggle";
4060
4061 /**
4062 * Whether to show or hide the expand indicator
4063 * @hide
4064 */
4065 public static final String QS_EXPAND_INDICATOR_TOGGLE = "qs_expand_indicator_toggle";
4066
4067 /**
4068 * custom carrier label. The value is
4069 * String.
4070 */
4071 public static final String CUSTOM_CARRIER_LABEL = "custom_carrier_label";
4072
4073 /**
4074 * Immersive recents options
4075 *
4076 * 0 = Default AOSP look
4077 * 1 = Statusbar only
4078 * 2 = Navbar only
4079 * 3 = Fullscreen
4080 * @hide
4081 */
4082 public static final String IMMERSIVE_RECENTS = "immersive_recents";
4083
4084 /**
4085 * show the membar in recents
4086 * @hide
4087 */
4088 public static final String SYSTEMUI_RECENTS_MEM_DISPLAY = "systemui_recents_mem_display";
4089
4090 /**
4091 * show clear all recents button
4092 * @hide
4093 */
4094 public static final String SHOW_CLEAR_ALL_RECENTS = "show_clear_all_recents";
4095
4096 /**
4097 * location of the clear all rectents button
4098 * @hide
4099 */
4100 public static final String RECENTS_CLEAR_ALL_LOCATION = "recents_clear_all_location";
4101
4102 /**
4103 * Settings to backup. This is here so that it's in the same place as the settings
4104 * keys and easy to update.
4105 *
4106 * NOTE: Settings are backed up and restored in the order they appear
4107 * in this array. If you have one setting depending on another,
4108 * make sure that they are ordered appropriately.
4109 *
4110 * @hide
4111 */
4112 public static final String[] SETTINGS_TO_BACKUP = {
4113 STAY_ON_WHILE_PLUGGED_IN, // moved to global
4114 WIFI_USE_STATIC_IP,
4115 WIFI_STATIC_IP,
4116 WIFI_STATIC_GATEWAY,
4117 WIFI_STATIC_NETMASK,
4118 WIFI_STATIC_DNS1,
4119 WIFI_STATIC_DNS2,
4120 BLUETOOTH_DISCOVERABILITY,
4121 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
4122 FONT_SCALE,
4123 BLUETOOTH_ACCEPT_ALL_FILES,
4124 DIM_SCREEN,
4125 SCREEN_OFF_TIMEOUT,
4126 SCREEN_BRIGHTNESS,
4127 SCREEN_BRIGHTNESS_MODE,
4128 SCREEN_AUTO_BRIGHTNESS_ADJ,
4129 VIBRATE_INPUT_DEVICES,
4130 MODE_RINGER_STREAMS_AFFECTED,
4131 TEXT_AUTO_REPLACE,
4132 TEXT_AUTO_CAPS,
4133 TEXT_AUTO_PUNCTUATE,
4134 TEXT_SHOW_PASSWORD,
4135 AUTO_TIME, // moved to global
4136 AUTO_TIME_ZONE, // moved to global
4137 TIME_12_24,
4138 DATE_FORMAT,
4139 DTMF_TONE_WHEN_DIALING,
4140 DTMF_TONE_TYPE_WHEN_DIALING,
4141 HEARING_AID,
4142 TTY_MODE,
4143 MASTER_MONO,
4144 SOUND_EFFECTS_ENABLED,
4145 HAPTIC_FEEDBACK_ENABLED,
4146 POWER_SOUNDS_ENABLED, // moved to global
4147 DOCK_SOUNDS_ENABLED, // moved to global
4148 LOCKSCREEN_SOUNDS_ENABLED,
4149 SHOW_WEB_SUGGESTIONS,
4150 SIP_CALL_OPTIONS,
4151 SIP_RECEIVE_CALLS,
4152 POINTER_SPEED,
4153 VIBRATE_WHEN_RINGING,
4154 RINGTONE,
4155 LOCK_TO_APP_ENABLED,
4156 NOTIFICATION_SOUND,
4157 ACCELEROMETER_ROTATION,
4158 STATUS_BAR_CLOCK,
4159 STATUS_BAR_AM_PM,
4160 STATUS_BAR_CLOCK_DATE_DISPLAY,
4161 STATUS_BAR_CLOCK_DATE_STYLE,
4162 STATUS_BAR_CLOCK_DATE_FORMAT,
4163 NOTIFICATION_LIGHT_SCREEN_ON
4164 };
4165
4166 /**
4167 * These are all public system settings
4168 *
4169 * @hide
4170 */
4171 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
4172 static {
4173 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
4174 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
4175 PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
4176 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
4177 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
4178 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
4179 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
4180 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
4181 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
4182 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
4183 PUBLIC_SETTINGS.add(FONT_SCALE);
4184 PUBLIC_SETTINGS.add(DIM_SCREEN);
4185 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
4186 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
4187 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
4188 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
4189 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
4190 PUBLIC_SETTINGS.add(VIBRATE_ON);
4191 PUBLIC_SETTINGS.add(VOLUME_RING);
4192 PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
4193 PUBLIC_SETTINGS.add(VOLUME_VOICE);
4194 PUBLIC_SETTINGS.add(VOLUME_MUSIC);
4195 PUBLIC_SETTINGS.add(VOLUME_ALARM);
4196 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
4197 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
4198 PUBLIC_SETTINGS.add(RINGTONE);
4199 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
4200 PUBLIC_SETTINGS.add(ALARM_ALERT);
4201 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
4202 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
4203 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
4204 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
4205 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
4206 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
4207 PUBLIC_SETTINGS.add(TIME_12_24);
4208 PUBLIC_SETTINGS.add(DATE_FORMAT);
4209 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
4210 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
4211 PUBLIC_SETTINGS.add(USER_ROTATION);
4212 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
4213 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
4214 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
4215 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
4216 PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING);
4217 }
4218
4219 /**
4220 * These are all hidden system settings.
4221 *
4222 * @hide
4223 */
4224 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
4225 static {
4226 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
4227 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
4228 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
4229 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
4230 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
4231 PRIVATE_SETTINGS.add(VOLUME_MASTER);
4232 PRIVATE_SETTINGS.add(MASTER_MONO);
4233 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
4234 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
4235 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
4236 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
4237 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
4238 PRIVATE_SETTINGS.add(HEARING_AID);
4239 PRIVATE_SETTINGS.add(TTY_MODE);
4240 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
4241 PRIVATE_SETTINGS.add(POINTER_LOCATION);
4242 PRIVATE_SETTINGS.add(SHOW_TOUCHES);
4243 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
4244 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
4245 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
4246 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
4247 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
4248 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
4249 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
4250 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
4251 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
4252 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
4253 PRIVATE_SETTINGS.add(LOCK_SOUND);
4254 PRIVATE_SETTINGS.add(UNLOCK_SOUND);
4255 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
4256 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
4257 PRIVATE_SETTINGS.add(SIP_ALWAYS);
4258 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
4259 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
4260 PRIVATE_SETTINGS.add(POINTER_SPEED);
4261 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
4262 PRIVATE_SETTINGS.add(EGG_MODE);
4263 }
4264
4265 /**
4266 * These are all public system settings
4267 *
4268 * @hide
4269 */
4270 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
4271 static {
4272 VALIDATORS.put(END_BUTTON_BEHAVIOR,END_BUTTON_BEHAVIOR_VALIDATOR);
4273 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
4274 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
4275 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
4276 BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
4277 VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
4278 VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
4279 VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
4280 VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
4281 VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR);
4282 VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
4283 VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
4284 VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
4285 VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
4286 VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
4287 VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
4288 VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
4289 VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
4290 VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
4291 VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
4292 VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
4293 VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
4294 VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
4295 VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
4296 VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
4297 VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
4298 VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
4299 VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
4300 VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
4301 VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
4302 VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
4303 VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
4304 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
4305 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
4306 VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
4307 VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
4308 VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
4309 VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR);
4310 VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
4311 VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
4312 VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
4313 VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
4314 HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
4315 VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
4316 VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
4317 VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
4318 VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
4319 VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
4320 VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
4321 VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
4322 VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
4323 WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
4324 VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
4325 VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
4326 VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
4327 VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
4328 VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
4329 VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
4330 VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
4331 VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
4332 VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
4333 VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
4334 VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
4335 VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
4336 VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
4337 VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
4338 VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
4339 }
4340
4341 /**
4342 * These entries are considered common between the personal and the managed profile,
4343 * since the managed profile doesn't get to change them.
4344 */
4345 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
4346 static {
4347 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
4348 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
4349 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
4350 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
4351 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
4352 }
4353
4354 /** @hide */
4355 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
4356 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
4357 }
4358
4359 /**
4360 * When to use Wi-Fi calling
4361 *
4362 * @see android.telephony.TelephonyManager.WifiCallingChoices
4363 * @hide
4364 */
4365 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
4366
4367 // Settings moved to Settings.Secure
4368
4369 /**
4370 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
4371 * instead
4372 */
4373 @Deprecated
4374 public static final String ADB_ENABLED = Global.ADB_ENABLED;
4375
4376 /**
4377 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
4378 */
4379 @Deprecated
4380 public static final String ANDROID_ID = Secure.ANDROID_ID;
4381
4382 /**
4383 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
4384 */
4385 @Deprecated
4386 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
4387
4388 /**
4389 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
4390 */
4391 @Deprecated
4392 public static final String DATA_ROAMING = Global.DATA_ROAMING;
4393
4394 /**
4395 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
4396 */
4397 @Deprecated
4398 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
4399
4400 /**
4401 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
4402 */
4403 @Deprecated
4404 public static final String HTTP_PROXY = Global.HTTP_PROXY;
4405
4406 /**
4407 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
4408 */
4409 @Deprecated
4410 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
4411
4412 /**
4413 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
4414 * instead
4415 */
4416 @Deprecated
4417 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
4418
4419 /**
4420 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
4421 */
4422 @Deprecated
4423 public static final String LOGGING_ID = Secure.LOGGING_ID;
4424
4425 /**
4426 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
4427 */
4428 @Deprecated
4429 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
4430
4431 /**
4432 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
4433 * instead
4434 */
4435 @Deprecated
4436 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
4437
4438 /**
4439 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
4440 * instead
4441 */
4442 @Deprecated
4443 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
4444
4445 /**
4446 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
4447 * instead
4448 */
4449 @Deprecated
4450 public static final String PARENTAL_CONTROL_REDIRECT_URL =
4451 Secure.PARENTAL_CONTROL_REDIRECT_URL;
4452
4453 /**
4454 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
4455 */
4456 @Deprecated
4457 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
4458
4459 /**
4460 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
4461 */
4462 @Deprecated
4463 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
4464
4465 /**
4466 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
4467 */
4468 @Deprecated
4469 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
4470
4471 /**
4472 * @deprecated Use
4473 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
4474 */
4475 @Deprecated
4476 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
4477
4478 /**
4479 * @deprecated Use
4480 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
4481 */
4482 @Deprecated
4483 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
4484 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
4485
4486 /**
4487 * @deprecated Use
4488 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
4489 */
4490 @Deprecated
4491 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
4492 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
4493
4494 /**
4495 * @deprecated Use
4496 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
4497 */
4498 @Deprecated
4499 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
4500 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
4501
4502 /**
4503 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
4504 * instead
4505 */
4506 @Deprecated
4507 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
4508
4509 /**
4510 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
4511 */
4512 @Deprecated
4513 public static final String WIFI_ON = Global.WIFI_ON;
4514
4515 /**
4516 * @deprecated Use
4517 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
4518 * instead
4519 */
4520 @Deprecated
4521 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4522 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
4523
4524 /**
4525 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
4526 */
4527 @Deprecated
4528 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
4529
4530 /**
4531 * @deprecated Use
4532 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
4533 */
4534 @Deprecated
4535 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4536 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
4537
4538 /**
4539 * @deprecated Use
4540 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
4541 */
4542 @Deprecated
4543 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
4544 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
4545
4546 /**
4547 * @deprecated Use
4548 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
4549 * instead
4550 */
4551 @Deprecated
4552 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
4553 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
4554
4555 /**
4556 * @deprecated Use
4557 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
4558 */
4559 @Deprecated
4560 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
4561 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
4562
4563 /**
4564 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
4565 * instead
4566 */
4567 @Deprecated
4568 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
4569
4570 /**
4571 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
4572 */
4573 @Deprecated
4574 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
4575
4576 /**
4577 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
4578 */
4579 @Deprecated
4580 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
4581
4582 /**
4583 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
4584 * instead
4585 */
4586 @Deprecated
4587 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
4588
4589 /**
4590 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
4591 * instead
4592 */
4593 @Deprecated
4594 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
4595 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
4596
4597 /**
4598 * Checks if the specified app can modify system settings. As of API
4599 * level 23, an app cannot modify system settings unless it declares the
4600 * {@link android.Manifest.permission#WRITE_SETTINGS}
4601 * permission in its manifest, <em>and</em> the user specifically grants
4602 * the app this capability. To prompt the user to grant this approval,
4603 * the app must send an intent with the action {@link
4604 * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes
4605 * the system to display a permission management screen.
4606 *
4607 * @param context App context.
4608 * @return true if the calling app can write to system settings, false otherwise
4609 */
4610 public static boolean canWrite(Context context) {
4611 return isCallingPackageAllowedToWriteSettings(context, Process.myUid(),
4612 context.getOpPackageName(), false);
4613 }
4614 }
4615
4616 /**
4617 * Secure system settings, containing system preferences that applications
4618 * can read but are not allowed to write. These are for preferences that
4619 * the user must explicitly modify through the system UI or specialized
4620 * APIs for those values, not modified directly by applications.
4621 */
4622 public static final class Secure extends NameValueTable {
4623 /**
4624 * The content:// style URL for this table
4625 */
4626 public static final Uri CONTENT_URI =
4627 Uri.parse("content://" + AUTHORITY + "/secure");
4628
4629 // Populated lazily, guarded by class object:
4630 private static final NameValueCache sNameValueCache = new NameValueCache(
4631 CONTENT_URI,
4632 CALL_METHOD_GET_SECURE,
4633 CALL_METHOD_PUT_SECURE);
4634
4635 private static ILockSettings sLockSettings = null;
4636
4637 private static boolean sIsSystemProcess;
4638 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
4639 private static final HashSet<String> MOVED_TO_GLOBAL;
4640 static {
4641 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
4642 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
4643 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
4644 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
4645
4646 MOVED_TO_GLOBAL = new HashSet<String>();
4647 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
4648 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
4649 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
4650 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
4651 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
4652 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
4653 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
4654 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
4655 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
4656 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
4657 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
4658 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
4659 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
4660 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
4661 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
4662 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
4663 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
4664 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
4665 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
4666 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
4667 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
4668 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
4669 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
4670 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
4671 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
4672 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
4673 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
4674 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
4675 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
4676 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
4677 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
4678 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
4679 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
4680 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
4681 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
4682 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
4683 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
4684 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
4685 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
4686 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
4687 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
4688 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
4689 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
4690 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
4691 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
4692 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
4693 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
4694 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
4695 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
4696 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
4697 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
4698 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
4699 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
4700 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
4701 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
4702 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
4703 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
4704 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
4705 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
4706 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
4707 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
4708 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
4709 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
4710 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
4711 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
4712 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
4713 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED);
4714 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
4715 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
4716 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
4717 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
4718 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
4719 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
4720 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
4721 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
4722 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
4723 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
4724 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
4725 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
4726 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
4727 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
4728 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
4729 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
4730 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
4731 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
4732 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
4733 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
4734 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
4735 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
4736 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
4737 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
4738 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
4739 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
4740 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
4741 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
4742 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
4743 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
4744 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
4745 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
4746 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
4747 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
4748 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
4749 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
4750 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
4751 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
4752 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
4753 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
4754 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
4755 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
4756 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
4757 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
4758 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
4759 }
4760
4761 /** @hide */
4762 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
4763 outKeySet.addAll(MOVED_TO_GLOBAL);
4764 }
4765
4766 /**
4767 * Look up a name in the database.
4768 * @param resolver to access the database with
4769 * @param name to look up in the table
4770 * @return the corresponding value, or null if not present
4771 */
4772 public static String getString(ContentResolver resolver, String name) {
4773 return getStringForUser(resolver, name, UserHandle.myUserId());
4774 }
4775
4776 /** @hide */
4777 public static String getStringForUser(ContentResolver resolver, String name,
4778 int userHandle) {
4779 if (MOVED_TO_GLOBAL.contains(name)) {
4780 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4781 + " to android.provider.Settings.Global.");
4782 return Global.getStringForUser(resolver, name, userHandle);
4783 }
4784
4785 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
4786 synchronized (Secure.class) {
4787 if (sLockSettings == null) {
4788 sLockSettings = ILockSettings.Stub.asInterface(
4789 (IBinder) ServiceManager.getService("lock_settings"));
4790 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
4791 }
4792 }
4793 if (sLockSettings != null && !sIsSystemProcess) {
4794 // No context; use the ActivityThread's context as an approximation for
4795 // determining the target API level.
4796 Application application = ActivityThread.currentApplication();
4797
4798 boolean isPreMnc = application != null
4799 && application.getApplicationInfo() != null
4800 && application.getApplicationInfo().targetSdkVersion
4801 <= VERSION_CODES.LOLLIPOP_MR1;
4802 if (isPreMnc) {
4803 try {
4804 return sLockSettings.getString(name, "0", userHandle);
4805 } catch (RemoteException re) {
4806 // Fall through
4807 }
4808 } else {
4809 throw new SecurityException("Settings.Secure." + name
4810 + " is deprecated and no longer accessible."
4811 + " See API documentation for potential replacements.");
4812 }
4813 }
4814 }
4815
4816 return sNameValueCache.getStringForUser(resolver, name, userHandle);
4817 }
4818
4819 /**
4820 * Store a name/value pair into the database.
4821 * @param resolver to access the database with
4822 * @param name to store
4823 * @param value to associate with the name
4824 * @return true if the value was set, false on database errors
4825 */
4826 public static boolean putString(ContentResolver resolver, String name, String value) {
4827 return putStringForUser(resolver, name, value, UserHandle.myUserId());
4828 }
4829
4830 /** @hide */
4831 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
4832 int userHandle) {
4833 if (LOCATION_MODE.equals(name)) {
4834 // HACK ALERT: temporary hack to work around b/10491283.
4835 // TODO: once b/10491283 fixed, remove this hack
4836 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle);
4837 }
4838 if (MOVED_TO_GLOBAL.contains(name)) {
4839 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
4840 + " to android.provider.Settings.Global");
4841 return Global.putStringForUser(resolver, name, value, userHandle);
4842 }
4843 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
4844 }
4845
4846 /**
4847 * Construct the content URI for a particular name/value pair,
4848 * useful for monitoring changes with a ContentObserver.
4849 * @param name to look up in the table
4850 * @return the corresponding content URI, or null if not present
4851 */
4852 public static Uri getUriFor(String name) {
4853 if (MOVED_TO_GLOBAL.contains(name)) {
4854 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4855 + " to android.provider.Settings.Global, returning global URI.");
4856 return Global.getUriFor(Global.CONTENT_URI, name);
4857 }
4858 return getUriFor(CONTENT_URI, name);
4859 }
4860
4861 /**
4862 * Convenience function for retrieving a single secure settings value
4863 * as an integer. Note that internally setting values are always
4864 * stored as strings; this function converts the string to an integer
4865 * for you. The default value will be returned if the setting is
4866 * not defined or not an integer.
4867 *
4868 * @param cr The ContentResolver to access.
4869 * @param name The name of the setting to retrieve.
4870 * @param def Value to return if the setting is not defined.
4871 *
4872 * @return The setting's current value, or 'def' if it is not defined
4873 * or not a valid integer.
4874 */
4875 public static int getInt(ContentResolver cr, String name, int def) {
4876 return getIntForUser(cr, name, def, UserHandle.myUserId());
4877 }
4878
4879 /** @hide */
4880 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
4881 if (LOCATION_MODE.equals(name)) {
4882 // HACK ALERT: temporary hack to work around b/10491283.
4883 // TODO: once b/10491283 fixed, remove this hack
4884 return getLocationModeForUser(cr, userHandle);
4885 }
4886 String v = getStringForUser(cr, name, userHandle);
4887 try {
4888 return v != null ? Integer.parseInt(v) : def;
4889 } catch (NumberFormatException e) {
4890 return def;
4891 }
4892 }
4893
4894 /**
4895 * Convenience function for retrieving a single secure settings value
4896 * as an integer. Note that internally setting values are always
4897 * stored as strings; this function converts the string to an integer
4898 * for you.
4899 * <p>
4900 * This version does not take a default value. If the setting has not
4901 * been set, or the string value is not a number,
4902 * it throws {@link SettingNotFoundException}.
4903 *
4904 * @param cr The ContentResolver to access.
4905 * @param name The name of the setting to retrieve.
4906 *
4907 * @throws SettingNotFoundException Thrown if a setting by the given
4908 * name can't be found or the setting value is not an integer.
4909 *
4910 * @return The setting's current value.
4911 */
4912 public static int getInt(ContentResolver cr, String name)
4913 throws SettingNotFoundException {
4914 return getIntForUser(cr, name, UserHandle.myUserId());
4915 }
4916
4917 /** @hide */
4918 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
4919 throws SettingNotFoundException {
4920 if (LOCATION_MODE.equals(name)) {
4921 // HACK ALERT: temporary hack to work around b/10491283.
4922 // TODO: once b/10491283 fixed, remove this hack
4923 return getLocationModeForUser(cr, userHandle);
4924 }
4925 String v = getStringForUser(cr, name, userHandle);
4926 try {
4927 return Integer.parseInt(v);
4928 } catch (NumberFormatException e) {
4929 throw new SettingNotFoundException(name);
4930 }
4931 }
4932
4933 /**
4934 * Convenience function for updating a single settings value as an
4935 * integer. This will either create a new entry in the table if the
4936 * given name does not exist, or modify the value of the existing row
4937 * with that name. Note that internally setting values are always
4938 * stored as strings, so this function converts the given value to a
4939 * string before storing it.
4940 *
4941 * @param cr The ContentResolver to access.
4942 * @param name The name of the setting to modify.
4943 * @param value The new value for the setting.
4944 * @return true if the value was set, false on database errors
4945 */
4946 public static boolean putInt(ContentResolver cr, String name, int value) {
4947 return putIntForUser(cr, name, value, UserHandle.myUserId());
4948 }
4949
4950 /** @hide */
4951 public static boolean putIntForUser(ContentResolver cr, String name, int value,
4952 int userHandle) {
4953 return putStringForUser(cr, name, Integer.toString(value), userHandle);
4954 }
4955
4956 /**
4957 * Convenience function for retrieving a single secure settings value
4958 * as a {@code long}. Note that internally setting values are always
4959 * stored as strings; this function converts the string to a {@code long}
4960 * for you. The default value will be returned if the setting is
4961 * not defined or not a {@code long}.
4962 *
4963 * @param cr The ContentResolver to access.
4964 * @param name The name of the setting to retrieve.
4965 * @param def Value to return if the setting is not defined.
4966 *
4967 * @return The setting's current value, or 'def' if it is not defined
4968 * or not a valid {@code long}.
4969 */
4970 public static long getLong(ContentResolver cr, String name, long def) {
4971 return getLongForUser(cr, name, def, UserHandle.myUserId());
4972 }
4973
4974 /** @hide */
4975 public static long getLongForUser(ContentResolver cr, String name, long def,
4976 int userHandle) {
4977 String valString = getStringForUser(cr, name, userHandle);
4978 long value;
4979 try {
4980 value = valString != null ? Long.parseLong(valString) : def;
4981 } catch (NumberFormatException e) {
4982 value = def;
4983 }
4984 return value;
4985 }
4986
4987 /**
4988 * Convenience function for retrieving a single secure settings value
4989 * as a {@code long}. Note that internally setting values are always
4990 * stored as strings; this function converts the string to a {@code long}
4991 * for you.
4992 * <p>
4993 * This version does not take a default value. If the setting has not
4994 * been set, or the string value is not a number,
4995 * it throws {@link SettingNotFoundException}.
4996 *
4997 * @param cr The ContentResolver to access.
4998 * @param name The name of the setting to retrieve.
4999 *
5000 * @return The setting's current value.
5001 * @throws SettingNotFoundException Thrown if a setting by the given
5002 * name can't be found or the setting value is not an integer.
5003 */
5004 public static long getLong(ContentResolver cr, String name)
5005 throws SettingNotFoundException {
5006 return getLongForUser(cr, name, UserHandle.myUserId());
5007 }
5008
5009 /** @hide */
5010 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
5011 throws SettingNotFoundException {
5012 String valString = getStringForUser(cr, name, userHandle);
5013 try {
5014 return Long.parseLong(valString);
5015 } catch (NumberFormatException e) {
5016 throw new SettingNotFoundException(name);
5017 }
5018 }
5019
5020 /**
5021 * Convenience function for updating a secure settings value as a long
5022 * integer. This will either create a new entry in the table if the
5023 * given name does not exist, or modify the value of the existing row
5024 * with that name. Note that internally setting values are always
5025 * stored as strings, so this function converts the given value to a
5026 * string before storing it.
5027 *
5028 * @param cr The ContentResolver to access.
5029 * @param name The name of the setting to modify.
5030 * @param value The new value for the setting.
5031 * @return true if the value was set, false on database errors
5032 */
5033 public static boolean putLong(ContentResolver cr, String name, long value) {
5034 return putLongForUser(cr, name, value, UserHandle.myUserId());
5035 }
5036
5037 /** @hide */
5038 public static boolean putLongForUser(ContentResolver cr, String name, long value,
5039 int userHandle) {
5040 return putStringForUser(cr, name, Long.toString(value), userHandle);
5041 }
5042
5043 /**
5044 * Convenience function for retrieving a single secure settings value
5045 * as a floating point number. Note that internally setting values are
5046 * always stored as strings; this function converts the string to an
5047 * float for you. The default value will be returned if the setting
5048 * is not defined or not a valid float.
5049 *
5050 * @param cr The ContentResolver to access.
5051 * @param name The name of the setting to retrieve.
5052 * @param def Value to return if the setting is not defined.
5053 *
5054 * @return The setting's current value, or 'def' if it is not defined
5055 * or not a valid float.
5056 */
5057 public static float getFloat(ContentResolver cr, String name, float def) {
5058 return getFloatForUser(cr, name, def, UserHandle.myUserId());
5059 }
5060
5061 /** @hide */
5062 public static float getFloatForUser(ContentResolver cr, String name, float def,
5063 int userHandle) {
5064 String v = getStringForUser(cr, name, userHandle);
5065 try {
5066 return v != null ? Float.parseFloat(v) : def;
5067 } catch (NumberFormatException e) {
5068 return def;
5069 }
5070 }
5071
5072 /**
5073 * Convenience function for retrieving a single secure settings value
5074 * as a float. Note that internally setting values are always
5075 * stored as strings; this function converts the string to a float
5076 * for you.
5077 * <p>
5078 * This version does not take a default value. If the setting has not
5079 * been set, or the string value is not a number,
5080 * it throws {@link SettingNotFoundException}.
5081 *
5082 * @param cr The ContentResolver to access.
5083 * @param name The name of the setting to retrieve.
5084 *
5085 * @throws SettingNotFoundException Thrown if a setting by the given
5086 * name can't be found or the setting value is not a float.
5087 *
5088 * @return The setting's current value.
5089 */
5090 public static float getFloat(ContentResolver cr, String name)
5091 throws SettingNotFoundException {
5092 return getFloatForUser(cr, name, UserHandle.myUserId());
5093 }
5094
5095 /** @hide */
5096 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
5097 throws SettingNotFoundException {
5098 String v = getStringForUser(cr, name, userHandle);
5099 if (v == null) {
5100 throw new SettingNotFoundException(name);
5101 }
5102 try {
5103 return Float.parseFloat(v);
5104 } catch (NumberFormatException e) {
5105 throw new SettingNotFoundException(name);
5106 }
5107 }
5108
5109 /**
5110 * Convenience function for updating a single settings value as a
5111 * floating point number. This will either create a new entry in the
5112 * table if the given name does not exist, or modify the value of the
5113 * existing row with that name. Note that internally setting values
5114 * are always stored as strings, so this function converts the given
5115 * value to a string before storing it.
5116 *
5117 * @param cr The ContentResolver to access.
5118 * @param name The name of the setting to modify.
5119 * @param value The new value for the setting.
5120 * @return true if the value was set, false on database errors
5121 */
5122 public static boolean putFloat(ContentResolver cr, String name, float value) {
5123 return putFloatForUser(cr, name, value, UserHandle.myUserId());
5124 }
5125
5126 /** @hide */
5127 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
5128 int userHandle) {
5129 return putStringForUser(cr, name, Float.toString(value), userHandle);
5130 }
5131
5132 /**
5133 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
5134 * instead
5135 */
5136 @Deprecated
5137 public static final String DEVELOPMENT_SETTINGS_ENABLED =
5138 Global.DEVELOPMENT_SETTINGS_ENABLED;
5139
5140 /**
5141 * When the user has enable the option to have a "bug report" command
5142 * in the power menu.
5143 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
5144 * @hide
5145 */
5146 @Deprecated
5147 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5148
5149 /**
5150 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
5151 */
5152 @Deprecated
5153 public static final String ADB_ENABLED = Global.ADB_ENABLED;
5154
5155 /**
5156 * Setting to allow mock locations and location provider status to be injected into the
5157 * LocationManager service for testing purposes during application development. These
5158 * locations and status values override actual location and status information generated
5159 * by network, gps, or other location providers.
5160 *
5161 * @deprecated This settings is not used anymore.
5162 */
5163 @Deprecated
5164 public static final String ALLOW_MOCK_LOCATION = "mock_location";
5165
5166 /**
5167 * A 64-bit number (as a hex string) that is randomly
5168 * generated when the user first sets up the device and should remain
5169 * constant for the lifetime of the user's device. The value may
5170 * change if a factory reset is performed on the device.
5171 * <p class="note"><strong>Note:</strong> When a device has <a
5172 * href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">multiple users</a>
5173 * (available on certain devices running Android 4.2 or higher), each user appears as a
5174 * completely separate device, so the {@code ANDROID_ID} value is unique to each
5175 * user.</p>
5176 */
5177 public static final String ANDROID_ID = "android_id";
5178
5179 /**
5180 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
5181 */
5182 @Deprecated
5183 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
5184
5185 /**
5186 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
5187 */
5188 @Deprecated
5189 public static final String DATA_ROAMING = Global.DATA_ROAMING;
5190
5191 /**
5192 * Setting to record the input method used by default, holding the ID
5193 * of the desired method.
5194 */
5195 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
5196
5197 /**
5198 * Setting to record the input method subtype used by default, holding the ID
5199 * of the desired method.
5200 */
5201 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
5202 "selected_input_method_subtype";
5203
5204 /**
5205 * Setting to record the history of input method subtype, holding the pair of ID of IME
5206 * and its last used subtype.
5207 * @hide
5208 */
5209 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
5210 "input_methods_subtype_history";
5211
5212 /**
5213 * Setting to record the visibility of input method selector
5214 */
5215 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
5216 "input_method_selector_visibility";
5217
5218 /**
5219 * The currently selected voice interaction service flattened ComponentName.
5220 * @hide
5221 */
5222 @TestApi
5223 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
5224
5225 /**
5226 * bluetooth HCI snoop log configuration
5227 * @hide
5228 */
5229 public static final String BLUETOOTH_HCI_LOG =
5230 "bluetooth_hci_log";
5231
5232 /**
5233 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
5234 */
5235 @Deprecated
5236 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
5237
5238 /**
5239 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
5240 * @hide
5241 */
5242 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
5243
5244 /**
5245 * Prefix for category name that marks whether a suggested action from that category was
5246 * completed.
5247 * @hide
5248 */
5249 public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
5250
5251 /**
5252 * List of input methods that are currently enabled. This is a string
5253 * containing the IDs of all enabled input methods, each ID separated
5254 * by ':'.
5255 */
5256 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
5257
5258 /**
5259 * List of system input methods that are currently disabled. This is a string
5260 * containing the IDs of all disabled input methods, each ID separated
5261 * by ':'.
5262 * @hide
5263 */
5264 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
5265
5266 /**
5267 * Whether to show the IME when a hard keyboard is connected. This is a boolean that
5268 * determines if the IME should be shown when a hard keyboard is attached.
5269 * @hide
5270 */
5271 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
5272
5273 /**
5274 * Host name and port for global http proxy. Uses ':' seperator for
5275 * between host and port.
5276 *
5277 * @deprecated Use {@link Global#HTTP_PROXY}
5278 */
5279 @Deprecated
5280 public static final String HTTP_PROXY = Global.HTTP_PROXY;
5281
5282 /**
5283 * Package designated as always-on VPN provider.
5284 *
5285 * @hide
5286 */
5287 public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app";
5288
5289 /**
5290 * Whether to block networking outside of VPN connections while always-on is set.
5291 * @see #ALWAYS_ON_VPN_APP
5292 *
5293 * @hide
5294 */
5295 public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown";
5296
5297 /**
5298 * Whether applications can be installed for this user via the system's
5299 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
5300 *
5301 * <p>1 = permit app installation via the system package installer intent
5302 * <p>0 = do not allow use of the package installer
5303 */
5304 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
5305
5306 /**
5307 * Comma-separated list of location providers that activities may access. Do not rely on
5308 * this value being present in settings.db or on ContentObserver notifications on the
5309 * corresponding Uri.
5310 *
5311 * @deprecated use {@link #LOCATION_MODE} and
5312 * {@link LocationManager#MODE_CHANGED_ACTION} (or
5313 * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
5314 */
5315 @Deprecated
5316 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
5317
5318 /**
5319 * The degree of location access enabled by the user.
5320 * <p>
5321 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
5322 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
5323 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
5324 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
5325 * modes that might be added in the future.
5326 * <p>
5327 * Note: do not rely on this value being present in settings.db or on ContentObserver
5328 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
5329 * to receive changes in this value.
5330 */
5331 public static final String LOCATION_MODE = "location_mode";
5332 /**
5333 * Stores the previous location mode when {@link #LOCATION_MODE} is set to
5334 * {@link #LOCATION_MODE_OFF}
5335 * @hide
5336 */
5337 public static final String LOCATION_PREVIOUS_MODE = "location_previous_mode";
5338
5339 /**
5340 * Sets all location providers to the previous states before location was turned off.
5341 * @hide
5342 */
5343 public static final int LOCATION_MODE_PREVIOUS = -1;
5344 /**
5345 * Location access disabled.
5346 */
5347 public static final int LOCATION_MODE_OFF = 0;
5348 /**
5349 * Network Location Provider disabled, but GPS and other sensors enabled.
5350 */
5351 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
5352 /**
5353 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
5354 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
5355 * {@link android.location.Criteria#POWER_MEDIUM}.
5356 */
5357 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
5358 /**
5359 * Best-effort location computation allowed.
5360 */
5361 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
5362
5363 /**
5364 * A flag containing settings used for biometric weak
5365 * @hide
5366 */
5367 @Deprecated
5368 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
5369 "lock_biometric_weak_flags";
5370
5371 /**
5372 * Whether lock-to-app will lock the keyguard when exiting.
5373 * @hide
5374 */
5375 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
5376
5377 /**
5378 * Whether autolock is enabled (0 = false, 1 = true)
5379 *
5380 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
5381 * level of the keyguard. Accessing this setting from an app that is targeting
5382 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
5383 */
5384 @Deprecated
5385 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
5386
5387 /**
5388 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
5389 *
5390 * @deprecated Accessing this setting from an app that is targeting
5391 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
5392 */
5393 @Deprecated
5394 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
5395
5396 /**
5397 * Disable expanding quick settings on secure lock screens
5398 *
5399 * @hide
5400 */
5401 public static final String LOCK_QS_DISABLED = "lockscreen_qs_disabled";
5402
5403 /**
5404 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
5405 * true)
5406 *
5407 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
5408 * lockscreen uses
5409 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
5410 * Accessing this setting from an app that is targeting
5411 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}.
5412 */
5413 @Deprecated
5414 public static final String
5415 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
5416
5417 /**
5418 * This preference allows the device to be locked given time after screen goes off,
5419 * subject to current DeviceAdmin policy limits.
5420 * @hide
5421 */
5422 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
5423
5424
5425 /**
5426 * This preference contains the string that shows for owner info on LockScreen.
5427 * @hide
5428 * @deprecated
5429 */
5430 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
5431
5432 /**
5433 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
5434 * @hide
5435 */
5436 @Deprecated
5437 public static final String LOCK_SCREEN_APPWIDGET_IDS =
5438 "lock_screen_appwidget_ids";
5439
5440 /**
5441 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
5442 * @hide
5443 */
5444 @Deprecated
5445 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
5446 "lock_screen_fallback_appwidget_id";
5447
5448 /**
5449 * Index of the lockscreen appwidget to restore, -1 if none.
5450 * @hide
5451 */
5452 @Deprecated
5453 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
5454 "lock_screen_sticky_appwidget";
5455
5456 /**
5457 * This preference enables showing the owner info on LockScreen.
5458 * @hide
5459 * @deprecated
5460 */
5461 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
5462 "lock_screen_owner_info_enabled";
5463
5464 /**
5465 * When set by a user, allows notifications to be shown atop a securely locked screen
5466 * in their full "private" form (same as when the device is unlocked).
5467 * @hide
5468 */
5469 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
5470 "lock_screen_allow_private_notifications";
5471
5472 /**
5473 * When set by a user, allows notification remote input atop a securely locked screen
5474 * without having to unlock
5475 * @hide
5476 */
5477 public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT =
5478 "lock_screen_allow_remote_input";
5479
5480 /**
5481 * Set by the system to track if the user needs to see the call to action for
5482 * the lockscreen notification policy.
5483 * @hide
5484 */
5485 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
5486 "show_note_about_notification_hiding";
5487
5488 /**
5489 * Set to 1 by the system after trust agents have been initialized.
5490 * @hide
5491 */
5492 public static final String TRUST_AGENTS_INITIALIZED =
5493 "trust_agents_initialized";
5494
5495 /**
5496 * The Logging ID (a unique 64-bit value) as a hex string.
5497 * Used as a pseudonymous identifier for logging.
5498 * @deprecated This identifier is poorly initialized and has
5499 * many collisions. It should not be used.
5500 */
5501 @Deprecated
5502 public static final String LOGGING_ID = "logging_id";
5503
5504 /**
5505 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
5506 */
5507 @Deprecated
5508 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
5509
5510 /**
5511 * No longer supported.
5512 */
5513 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
5514
5515 /**
5516 * No longer supported.
5517 */
5518 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
5519
5520 /**
5521 * No longer supported.
5522 */
5523 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
5524
5525 /**
5526 * Settings classname to launch when Settings is clicked from All
5527 * Applications. Needed because of user testing between the old
5528 * and new Settings apps.
5529 */
5530 // TODO: 881807
5531 public static final String SETTINGS_CLASSNAME = "settings_classname";
5532
5533 /**
5534 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
5535 */
5536 @Deprecated
5537 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
5538
5539 /**
5540 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
5541 */
5542 @Deprecated
5543 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
5544
5545 /**
5546 * If accessibility is enabled.
5547 */
5548 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
5549
5550 /**
5551 * If touch exploration is enabled.
5552 */
5553 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
5554
5555 /**
5556 * List of the enabled accessibility providers.
5557 */
5558 public static final String ENABLED_ACCESSIBILITY_SERVICES =
5559 "enabled_accessibility_services";
5560
5561 /**
5562 * List of the accessibility services to which the user has granted
5563 * permission to put the device into touch exploration mode.
5564 *
5565 * @hide
5566 */
5567 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
5568 "touch_exploration_granted_accessibility_services";
5569
5570 /**
5571 * Whether to speak passwords while in accessibility mode.
5572 */
5573 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
5574
5575 /**
5576 * Whether to draw text with high contrast while in accessibility mode.
5577 *
5578 * @hide
5579 */
5580 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
5581 "high_text_contrast_enabled";
5582
5583 /**
5584 * If injection of accessibility enhancing JavaScript screen-reader
5585 * is enabled.
5586 * <p>
5587 * Note: The JavaScript based screen-reader is served by the
5588 * Google infrastructure and enable users with disabilities to
5589 * efficiently navigate in and explore web content.
5590 * </p>
5591 * <p>
5592 * This property represents a boolean value.
5593 * </p>
5594 * @hide
5595 */
5596 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
5597 "accessibility_script_injection";
5598
5599 /**
5600 * The URL for the injected JavaScript based screen-reader used
5601 * for providing accessibility of content in WebView.
5602 * <p>
5603 * Note: The JavaScript based screen-reader is served by the
5604 * Google infrastructure and enable users with disabilities to
5605 * efficiently navigate in and explore web content.
5606 * </p>
5607 * <p>
5608 * This property represents a string value.
5609 * </p>
5610 * @hide
5611 */
5612 public static final String ACCESSIBILITY_SCREEN_READER_URL =
5613 "accessibility_script_injection_url";
5614
5615 /**
5616 * Key bindings for navigation in built-in accessibility support for web content.
5617 * <p>
5618 * Note: These key bindings are for the built-in accessibility navigation for
5619 * web content which is used as a fall back solution if JavaScript in a WebView
5620 * is not enabled or the user has not opted-in script injection from Google.
5621 * </p>
5622 * <p>
5623 * The bindings are separated by semi-colon. A binding is a mapping from
5624 * a key to a sequence of actions (for more details look at
5625 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
5626 * string representation of an integer obtained from a meta state (optional) shifted
5627 * sixteen times left and bitwise ored with a key code. An action is represented
5628 * as a hexademical string representation of an integer where the first two digits
5629 * are navigation action index, the second, the third, and the fourth digit pairs
5630 * represent the action arguments. The separate actions in a binding are colon
5631 * separated. The key and the action sequence it maps to are separated by equals.
5632 * </p>
5633 * <p>
5634 * For example, the binding below maps the DPAD right button to traverse the
5635 * current navigation axis once without firing an accessibility event and to
5636 * perform the same traversal again but to fire an event:
5637 * <code>
5638 * 0x16=0x01000100:0x01000101;
5639 * </code>
5640 * </p>
5641 * <p>
5642 * The goal of this binding is to enable dynamic rebinding of keys to
5643 * navigation actions for web content without requiring a framework change.
5644 * </p>
5645 * <p>
5646 * This property represents a string value.
5647 * </p>
5648 * @hide
5649 */
5650 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
5651 "accessibility_web_content_key_bindings";
5652
5653 /**
5654 * Setting that specifies whether the display magnification is enabled.
5655 * Display magnifications allows the user to zoom in the display content
5656 * and is targeted to low vision users. The current magnification scale
5657 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
5658 *
5659 * @hide
5660 */
5661 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
5662 "accessibility_display_magnification_enabled";
5663
5664 /**
5665 * Setting that specifies what the display magnification scale is.
5666 * Display magnifications allows the user to zoom in the display
5667 * content and is targeted to low vision users. Whether a display
5668 * magnification is performed is controlled by
5669 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
5670 *
5671 * @hide
5672 */
5673 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
5674 "accessibility_display_magnification_scale";
5675
5676 /**
5677 * Setting that specifies whether the display magnification should be
5678 * automatically updated. If this fearture is enabled the system will
5679 * exit magnification mode or pan the viewport when a context change
5680 * occurs. For example, on staring a new activity or rotating the screen,
5681 * the system may zoom out so the user can see the new context he is in.
5682 * Another example is on showing a window that is not visible in the
5683 * magnified viewport the system may pan the viewport to make the window
5684 * the has popped up so the user knows that the context has changed.
5685 * Whether a screen magnification is performed is controlled by
5686 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
5687 *
5688 * @hide
5689 */
5690 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
5691 "accessibility_display_magnification_auto_update";
5692
5693 /**
5694 * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be
5695 * modified from an AccessibilityService using the SoftKeyboardController.
5696 *
5697 * @hide
5698 */
5699 public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE =
5700 "accessibility_soft_keyboard_mode";
5701
5702 /**
5703 * Default soft keyboard behavior.
5704 *
5705 * @hide
5706 */
5707 public static final int SHOW_MODE_AUTO = 0;
5708
5709 /**
5710 * Soft keyboard is never shown.
5711 *
5712 * @hide
5713 */
5714 public static final int SHOW_MODE_HIDDEN = 1;
5715
5716 /**
5717 * Setting that specifies whether timed text (captions) should be
5718 * displayed in video content. Text display properties are controlled by
5719 * the following settings:
5720 * <ul>
5721 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
5722 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
5723 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
5724 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
5725 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
5726 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
5727 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
5728 * </ul>
5729 *
5730 * @hide
5731 */
5732 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
5733 "accessibility_captioning_enabled";
5734
5735 /**
5736 * Setting that specifies the language for captions as a locale string,
5737 * e.g. en_US.
5738 *
5739 * @see java.util.Locale#toString
5740 * @hide
5741 */
5742 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
5743 "accessibility_captioning_locale";
5744
5745 /**
5746 * Integer property that specifies the preset style for captions, one
5747 * of:
5748 * <ul>
5749 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
5750 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
5751 * </ul>
5752 *
5753 * @see java.util.Locale#toString
5754 * @hide
5755 */
5756 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
5757 "accessibility_captioning_preset";
5758
5759 /**
5760 * Integer property that specifes the background color for captions as a
5761 * packed 32-bit color.
5762 *
5763 * @see android.graphics.Color#argb
5764 * @hide
5765 */
5766 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
5767 "accessibility_captioning_background_color";
5768
5769 /**
5770 * Integer property that specifes the foreground color for captions as a
5771 * packed 32-bit color.
5772 *
5773 * @see android.graphics.Color#argb
5774 * @hide
5775 */
5776 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
5777 "accessibility_captioning_foreground_color";
5778
5779 /**
5780 * Integer property that specifes the edge type for captions, one of:
5781 * <ul>
5782 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
5783 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
5784 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
5785 * </ul>
5786 *
5787 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
5788 * @hide
5789 */
5790 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
5791 "accessibility_captioning_edge_type";
5792
5793 /**
5794 * Integer property that specifes the edge color for captions as a
5795 * packed 32-bit color.
5796 *
5797 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
5798 * @see android.graphics.Color#argb
5799 * @hide
5800 */
5801 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
5802 "accessibility_captioning_edge_color";
5803
5804 /**
5805 * Integer property that specifes the window color for captions as a
5806 * packed 32-bit color.
5807 *
5808 * @see android.graphics.Color#argb
5809 * @hide
5810 */
5811 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
5812 "accessibility_captioning_window_color";
5813
5814 /**
5815 * String property that specifies the typeface for captions, one of:
5816 * <ul>
5817 * <li>DEFAULT
5818 * <li>MONOSPACE
5819 * <li>SANS_SERIF
5820 * <li>SERIF
5821 * </ul>
5822 *
5823 * @see android.graphics.Typeface
5824 * @hide
5825 */
5826 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
5827 "accessibility_captioning_typeface";
5828
5829 /**
5830 * Floating point property that specifies font scaling for captions.
5831 *
5832 * @hide
5833 */
5834 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
5835 "accessibility_captioning_font_scale";
5836
5837 /**
5838 * Setting that specifies whether display color inversion is enabled.
5839 */
5840 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
5841 "accessibility_display_inversion_enabled";
5842
5843 /**
5844 * Setting that specifies whether display color space adjustment is
5845 * enabled.
5846 *
5847 * @hide
5848 */
5849 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
5850 "accessibility_display_daltonizer_enabled";
5851
5852 /**
5853 * Integer property that specifies the type of color space adjustment to
5854 * perform. Valid values are defined in AccessibilityManager.
5855 *
5856 * @hide
5857 */
5858 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
5859 "accessibility_display_daltonizer";
5860
5861 /**
5862 * Setting that specifies whether automatic click when the mouse pointer stops moving is
5863 * enabled.
5864 *
5865 * @hide
5866 */
5867 public static final String ACCESSIBILITY_AUTOCLICK_ENABLED =
5868 "accessibility_autoclick_enabled";
5869
5870 /**
5871 * Integer setting specifying amount of time in ms the mouse pointer has to stay still
5872 * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set.
5873 *
5874 * @see #ACCESSIBILITY_AUTOCLICK_ENABLED
5875 * @hide
5876 */
5877 public static final String ACCESSIBILITY_AUTOCLICK_DELAY =
5878 "accessibility_autoclick_delay";
5879
5880 /**
5881 * Whether or not larger size icons are used for the pointer of mouse/trackpad for
5882 * accessibility.
5883 * (0 = false, 1 = true)
5884 * @hide
5885 */
5886 public static final String ACCESSIBILITY_LARGE_POINTER_ICON =
5887 "accessibility_large_pointer_icon";
5888
5889 /**
5890 * The timeout for considering a press to be a long press in milliseconds.
5891 * @hide
5892 */
5893 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
5894
5895 /**
5896 * List of the enabled print services.
5897 *
5898 * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade
5899 * from pre-N.
5900 *
5901 * @hide
5902 */
5903 public static final String ENABLED_PRINT_SERVICES =
5904 "enabled_print_services";
5905
5906 /**
5907 * List of the disabled print services.
5908 *
5909 * @hide
5910 */
5911 public static final String DISABLED_PRINT_SERVICES =
5912 "disabled_print_services";
5913
5914 /**
5915 * The saved value for WindowManagerService.setForcedDisplayDensity()
5916 * formatted as a single integer representing DPI. If unset, then use
5917 * the real display density.
5918 *
5919 * @hide
5920 */
5921 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
5922
5923 /**
5924 * Setting to always use the default text-to-speech settings regardless
5925 * of the application settings.
5926 * 1 = override application settings,
5927 * 0 = use application settings (if specified).
5928 *
5929 * @deprecated The value of this setting is no longer respected by
5930 * the framework text to speech APIs as of the Ice Cream Sandwich release.
5931 */
5932 @Deprecated
5933 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
5934
5935 /**
5936 * Default text-to-speech engine speech rate. 100 = 1x
5937 */
5938 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
5939
5940 /**
5941 * Default text-to-speech engine pitch. 100 = 1x
5942 */
5943 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
5944
5945 /**
5946 * Default text-to-speech engine.
5947 */
5948 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
5949
5950 /**
5951 * Default text-to-speech language.
5952 *
5953 * @deprecated this setting is no longer in use, as of the Ice Cream
5954 * Sandwich release. Apps should never need to read this setting directly,
5955 * instead can query the TextToSpeech framework classes for the default
5956 * locale. {@link TextToSpeech#getLanguage()}.
5957 */
5958 @Deprecated
5959 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
5960
5961 /**
5962 * Default text-to-speech country.
5963 *
5964 * @deprecated this setting is no longer in use, as of the Ice Cream
5965 * Sandwich release. Apps should never need to read this setting directly,
5966 * instead can query the TextToSpeech framework classes for the default
5967 * locale. {@link TextToSpeech#getLanguage()}.
5968 */
5969 @Deprecated
5970 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
5971
5972 /**
5973 * Default text-to-speech locale variant.
5974 *
5975 * @deprecated this setting is no longer in use, as of the Ice Cream
5976 * Sandwich release. Apps should never need to read this setting directly,
5977 * instead can query the TextToSpeech framework classes for the
5978 * locale that is in use {@link TextToSpeech#getLanguage()}.
5979 */
5980 @Deprecated
5981 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
5982
5983 /**
5984 * Stores the default tts locales on a per engine basis. Stored as
5985 * a comma seperated list of values, each value being of the form
5986 * {@code engine_name:locale} for example,
5987 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
5988 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
5989 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
5990 * setting directly, and can query the TextToSpeech framework classes
5991 * for the locale that is in use.
5992 *
5993 * @hide
5994 */
5995 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
5996
5997 /**
5998 * Space delimited list of plugin packages that are enabled.
5999 */
6000 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
6001
6002 /**
6003 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
6004 * instead.
6005 */
6006 @Deprecated
6007 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6008 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
6009
6010 /**
6011 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
6012 * instead.
6013 */
6014 @Deprecated
6015 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
6016 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
6017
6018 /**
6019 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
6020 * instead.
6021 */
6022 @Deprecated
6023 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
6024 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
6025
6026 /**
6027 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
6028 * instead.
6029 */
6030 @Deprecated
6031 public static final String WIFI_ON = Global.WIFI_ON;
6032
6033 /**
6034 * The acceptable packet loss percentage (range 0 - 100) before trying
6035 * another AP on the same network.
6036 * @deprecated This setting is not used.
6037 */
6038 @Deprecated
6039 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
6040 "wifi_watchdog_acceptable_packet_loss_percentage";
6041
6042 /**
6043 * The number of access points required for a network in order for the
6044 * watchdog to monitor it.
6045 * @deprecated This setting is not used.
6046 */
6047 @Deprecated
6048 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
6049
6050 /**
6051 * The delay between background checks.
6052 * @deprecated This setting is not used.
6053 */
6054 @Deprecated
6055 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
6056 "wifi_watchdog_background_check_delay_ms";
6057
6058 /**
6059 * Whether the Wi-Fi watchdog is enabled for background checking even
6060 * after it thinks the user has connected to a good access point.
6061 * @deprecated This setting is not used.
6062 */
6063 @Deprecated
6064 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
6065 "wifi_watchdog_background_check_enabled";
6066
6067 /**
6068 * The timeout for a background ping
6069 * @deprecated This setting is not used.
6070 */
6071 @Deprecated
6072 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
6073 "wifi_watchdog_background_check_timeout_ms";
6074
6075 /**
6076 * The number of initial pings to perform that *may* be ignored if they
6077 * fail. Again, if these fail, they will *not* be used in packet loss
6078 * calculation. For example, one network always seemed to time out for
6079 * the first couple pings, so this is set to 3 by default.
6080 * @deprecated This setting is not used.
6081 */
6082 @Deprecated
6083 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
6084 "wifi_watchdog_initial_ignored_ping_count";
6085
6086 /**
6087 * The maximum number of access points (per network) to attempt to test.
6088 * If this number is reached, the watchdog will no longer monitor the
6089 * initial connection state for the network. This is a safeguard for
6090 * networks containing multiple APs whose DNS does not respond to pings.
6091 * @deprecated This setting is not used.
6092 */
6093 @Deprecated
6094 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
6095
6096 /**
6097 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
6098 */
6099 @Deprecated
6100 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
6101
6102 /**
6103 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
6104 * @deprecated This setting is not used.
6105 */
6106 @Deprecated
6107 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
6108
6109 /**
6110 * The number of pings to test if an access point is a good connection.
6111 * @deprecated This setting is not used.
6112 */
6113 @Deprecated
6114 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
6115
6116 /**
6117 * The delay between pings.
6118 * @deprecated This setting is not used.
6119 */
6120 @Deprecated
6121 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
6122
6123 /**
6124 * The timeout per ping.
6125 * @deprecated This setting is not used.
6126 */
6127 @Deprecated
6128 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
6129
6130 /**
6131 * @deprecated Use
6132 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
6133 */
6134 @Deprecated
6135 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
6136
6137 /**
6138 * @deprecated Use
6139 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
6140 */
6141 @Deprecated
6142 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
6143 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
6144
6145 /**
6146 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
6147 * the receivers of the PendingIntent an opportunity to make a new network request before
6148 * the Network satisfying the request is potentially removed.
6149 *
6150 * @hide
6151 */
6152 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
6153 "connectivity_release_pending_intent_delay_ms";
6154
6155 /**
6156 * Whether background data usage is allowed.
6157 *
6158 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
6159 * availability of background data depends on several
6160 * combined factors. When background data is unavailable,
6161 * {@link ConnectivityManager#getActiveNetworkInfo()} will
6162 * now appear disconnected.
6163 */
6164 @Deprecated
6165 public static final String BACKGROUND_DATA = "background_data";
6166
6167 /**
6168 * Origins for which browsers should allow geolocation by default.
6169 * The value is a space-separated list of origins.
6170 */
6171 public static final String ALLOWED_GEOLOCATION_ORIGINS
6172 = "allowed_geolocation_origins";
6173
6174 /**
6175 * The preferred TTY mode 0 = TTy Off, CDMA default
6176 * 1 = TTY Full
6177 * 2 = TTY HCO
6178 * 3 = TTY VCO
6179 * @hide
6180 */
6181 public static final String PREFERRED_TTY_MODE =
6182 "preferred_tty_mode";
6183
6184 /**
6185 * Whether the enhanced voice privacy mode is enabled.
6186 * 0 = normal voice privacy
6187 * 1 = enhanced voice privacy
6188 * @hide
6189 */
6190 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
6191
6192 /**
6193 * Whether the TTY mode mode is enabled.
6194 * 0 = disabled
6195 * 1 = enabled
6196 * @hide
6197 */
6198 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
6199
6200 /**
6201 * Controls whether settings backup is enabled.
6202 * Type: int ( 0 = disabled, 1 = enabled )
6203 * @hide
6204 */
6205 public static final String BACKUP_ENABLED = "backup_enabled";
6206
6207 /**
6208 * Controls whether application data is automatically restored from backup
6209 * at install time.
6210 * Type: int ( 0 = disabled, 1 = enabled )
6211 * @hide
6212 */
6213 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
6214
6215 /**
6216 * Indicates whether settings backup has been fully provisioned.
6217 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
6218 * @hide
6219 */
6220 public static final String BACKUP_PROVISIONED = "backup_provisioned";
6221
6222 /**
6223 * Component of the transport to use for backup/restore.
6224 * @hide
6225 */
6226 public static final String BACKUP_TRANSPORT = "backup_transport";
6227
6228 /**
6229 * Version for which the setup wizard was last shown. Bumped for
6230 * each release when there is new setup information to show.
6231 * @hide
6232 */
6233 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
6234
6235 /**
6236 * The interval in milliseconds after which Wi-Fi is considered idle.
6237 * When idle, it is possible for the device to be switched from Wi-Fi to
6238 * the mobile data network.
6239 * @hide
6240 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
6241 * instead.
6242 */
6243 @Deprecated
6244 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
6245
6246 /**
6247 * The global search provider chosen by the user (if multiple global
6248 * search providers are installed). This will be the provider returned
6249 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
6250 * installed. This setting is stored as a flattened component name as
6251 * per {@link ComponentName#flattenToString()}.
6252 *
6253 * @hide
6254 */
6255 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
6256 "search_global_search_activity";
6257
6258 /**
6259 * The number of promoted sources in GlobalSearch.
6260 * @hide
6261 */
6262 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
6263 /**
6264 * The maximum number of suggestions returned by GlobalSearch.
6265 * @hide
6266 */
6267 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
6268 /**
6269 * The number of suggestions GlobalSearch will ask each non-web search source for.
6270 * @hide
6271 */
6272 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
6273 /**
6274 * The number of suggestions the GlobalSearch will ask the web search source for.
6275 * @hide
6276 */
6277 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
6278 "search_web_results_override_limit";
6279 /**
6280 * The number of milliseconds that GlobalSearch will wait for suggestions from
6281 * promoted sources before continuing with all other sources.
6282 * @hide
6283 */
6284 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
6285 "search_promoted_source_deadline_millis";
6286 /**
6287 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
6288 * @hide
6289 */
6290 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
6291 /**
6292 * The maximum number of milliseconds that GlobalSearch shows the previous results
6293 * after receiving a new query.
6294 * @hide
6295 */
6296 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
6297 /**
6298 * The maximum age of log data used for shortcuts in GlobalSearch.
6299 * @hide
6300 */
6301 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
6302 /**
6303 * The maximum age of log data used for source ranking in GlobalSearch.
6304 * @hide
6305 */
6306 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
6307 "search_max_source_event_age_millis";
6308 /**
6309 * The minimum number of impressions needed to rank a source in GlobalSearch.
6310 * @hide
6311 */
6312 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
6313 "search_min_impressions_for_source_ranking";
6314 /**
6315 * The minimum number of clicks needed to rank a source in GlobalSearch.
6316 * @hide
6317 */
6318 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
6319 "search_min_clicks_for_source_ranking";
6320 /**
6321 * The maximum number of shortcuts shown by GlobalSearch.
6322 * @hide
6323 */
6324 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
6325 /**
6326 * The size of the core thread pool for suggestion queries in GlobalSearch.
6327 * @hide
6328 */
6329 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
6330 "search_query_thread_core_pool_size";
6331 /**
6332 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
6333 * @hide
6334 */
6335 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
6336 "search_query_thread_max_pool_size";
6337 /**
6338 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
6339 * @hide
6340 */
6341 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
6342 "search_shortcut_refresh_core_pool_size";
6343 /**
6344 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
6345 * @hide
6346 */
6347 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
6348 "search_shortcut_refresh_max_pool_size";
6349 /**
6350 * The maximun time that excess threads in the GlobalSeach thread pools will
6351 * wait before terminating.
6352 * @hide
6353 */
6354 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
6355 "search_thread_keepalive_seconds";
6356 /**
6357 * The maximum number of concurrent suggestion queries to each source.
6358 * @hide
6359 */
6360 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
6361 "search_per_source_concurrent_query_limit";
6362
6363 /**
6364 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
6365 * @hide
6366 */
6367 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
6368
6369 /**
6370 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
6371 * @hide
6372 */
6373 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
6374
6375 /**
6376 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
6377 * @hide
6378 */
6379 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
6380
6381 /**
6382 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
6383 * @hide
6384 */
6385 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
6386
6387 /**
6388 * If nonzero, ANRs in invisible background processes bring up a dialog.
6389 * Otherwise, the process will be silently killed.
6390 *
6391 * Also prevents ANRs and crash dialogs from being suppressed.
6392 * @hide
6393 */
6394 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
6395
6396 /**
6397 * The {@link ComponentName} string of the service to be used as the voice recognition
6398 * service.
6399 *
6400 * @hide
6401 */
6402 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
6403
6404 /**
6405 * Stores whether an user has consented to have apps verified through PAM.
6406 * The value is boolean (1 or 0).
6407 *
6408 * @hide
6409 */
6410 public static final String PACKAGE_VERIFIER_USER_CONSENT =
6411 "package_verifier_user_consent";
6412
6413 /**
6414 * The {@link ComponentName} string of the selected spell checker service which is
6415 * one of the services managed by the text service manager.
6416 *
6417 * @hide
6418 */
6419 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
6420
6421 /**
6422 * The {@link ComponentName} string of the selected subtype of the selected spell checker
6423 * service which is one of the services managed by the text service manager.
6424 *
6425 * @hide
6426 */
6427 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
6428 "selected_spell_checker_subtype";
6429
6430 /**
6431 * The {@link ComponentName} string whether spell checker is enabled or not.
6432 *
6433 * @hide
6434 */
6435 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
6436
6437 /**
6438 * What happens when the user presses the Power button while in-call
6439 * and the screen is on.<br/>
6440 * <b>Values:</b><br/>
6441 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
6442 * 2 - The Power button hangs up the current call.<br/>
6443 *
6444 * @hide
6445 */
6446 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
6447
6448 /**
6449 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
6450 * @hide
6451 */
6452 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
6453
6454 /**
6455 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
6456 * @hide
6457 */
6458 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
6459
6460 /**
6461 * INCALL_POWER_BUTTON_BEHAVIOR default value.
6462 * @hide
6463 */
6464 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
6465 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
6466
6467 /**
6468 * Whether to include options in power menu for rebooting into recovery and bootloader
6469 * @hide
6470 */
6471 public static final String ADVANCED_REBOOT = "advanced_reboot";
6472
6473 /**
6474 * Whether the device should wake when the wake gesture sensor detects motion.
6475 * @hide
6476 */
6477 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
6478
6479 /**
6480 * Whether the device should doze if configured.
6481 * @hide
6482 */
6483 public static final String DOZE_ENABLED = "doze_enabled";
6484
6485 /**
6486 * Whether the device should pulse on pick up gesture.
6487 * @hide
6488 */
6489 public static final String DOZE_PULSE_ON_PICK_UP = "doze_pulse_on_pick_up";
6490
6491 /**
6492 * Whether the device should pulse on double tap gesture.
6493 * @hide
6494 */
6495 public static final String DOZE_PULSE_ON_DOUBLE_TAP = "doze_pulse_on_double_tap";
6496
6497 /**
6498 * The current night mode that has been selected by the user. Owned
6499 * and controlled by UiModeManagerService. Constants are as per
6500 * UiModeManager.
6501 * @hide
6502 */
6503 public static final String UI_NIGHT_MODE = "ui_night_mode";
6504
6505 /**
6506 * Whether screensavers are enabled.
6507 * @hide
6508 */
6509 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
6510
6511 /**
6512 * The user's chosen screensaver components.
6513 *
6514 * These will be launched by the PhoneWindowManager after a timeout when not on
6515 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
6516 * @hide
6517 */
6518 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
6519
6520 /**
6521 * If screensavers are enabled, whether the screensaver should be automatically launched
6522 * when the device is inserted into a (desk) dock.
6523 * @hide
6524 */
6525 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
6526
6527 /**
6528 * If screensavers are enabled, whether the screensaver should be automatically launched
6529 * when the screen times out when not on battery.
6530 * @hide
6531 */
6532 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
6533
6534 /**
6535 * If screensavers are enabled, the default screensaver component.
6536 * @hide
6537 */
6538 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
6539
6540 /**
6541 * The default NFC payment component
6542 * @hide
6543 */
6544 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
6545
6546 /**
6547 * Whether NFC payment is handled by the foreground application or a default.
6548 * @hide
6549 */
6550 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
6551
6552 /**
6553 * Specifies the package name currently configured to be the primary sms application
6554 * @hide
6555 */
6556 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
6557
6558 /**
6559 * Specifies the package name currently configured to be the default dialer application
6560 * @hide
6561 */
6562 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application";
6563
6564 /**
6565 * Specifies the package name currently configured to be the emergency assistance application
6566 *
6567 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
6568 *
6569 * @hide
6570 */
6571 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
6572
6573 /**
6574 * Specifies whether the current app context on scren (assist data) will be sent to the
6575 * assist application (active voice interaction service).
6576 *
6577 * @hide
6578 */
6579 public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled";
6580
6581 /**
6582 * Specifies whether a screenshot of the screen contents will be sent to the assist
6583 * application (active voice interaction service).
6584 *
6585 * @hide
6586 */
6587 public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled";
6588
6589 /**
6590 * Specifies whether the screen will show an animation if screen contents are sent to the
6591 * assist application (active voice interaction service).
6592 *
6593 * Note that the disclosure will be forced for third-party assistants or if the device
6594 * does not support disabling it.
6595 *
6596 * @hide
6597 */
6598 public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled";
6599
6600 /**
6601 * Names of the service components that the current user has explicitly allowed to
6602 * see all of the user's notifications, separated by ':'.
6603 *
6604 * @hide
6605 */
6606 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
6607
6608 /**
6609 * Names of the packages that the current user has explicitly allowed to
6610 * manage notification policy configuration, separated by ':'.
6611 *
6612 * @hide
6613 */
6614 @TestApi
6615 public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES =
6616 "enabled_notification_policy_access_packages";
6617
6618 /** @hide */
6619 public static final String BAR_SERVICE_COMPONENT = "bar_service_component";
6620
6621 /** @hide */
6622 public static final String VOLUME_CONTROLLER_SERVICE_COMPONENT
6623 = "volume_controller_service_component";
6624
6625 /** @hide */
6626 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
6627
6628 /**
6629 * This is the query URI for finding a print service to install.
6630 *
6631 * @hide
6632 */
6633 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
6634
6635 /**
6636 * This is the query URI for finding a NFC payment service to install.
6637 *
6638 * @hide
6639 */
6640 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
6641
6642 /**
6643 * If enabled, apps should try to skip any introductory hints on first launch. This might
6644 * apply to users that are already familiar with the environment or temporary users.
6645 * <p>
6646 * Type : int (0 to show hints, 1 to skip showing hints)
6647 */
6648 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
6649
6650 /**
6651 * Persisted playback time after a user confirmation of an unsafe volume level.
6652 *
6653 * @hide
6654 */
6655 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
6656
6657 /**
6658 * This preference enables notification display on the lockscreen.
6659 * @hide
6660 */
6661 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
6662 "lock_screen_show_notifications";
6663
6664 /**
6665 * List of TV inputs that are currently hidden. This is a string
6666 * containing the IDs of all hidden TV inputs. Each ID is encoded by
6667 * {@link android.net.Uri#encode(String)} and separated by ':'.
6668 * @hide
6669 */
6670 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
6671
6672 /**
6673 * List of custom TV input labels. This is a string containing <TV input id, custom name>
6674 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
6675 * and separated by ','. Each pair is separated by ':'.
6676 * @hide
6677 */
6678 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
6679
6680 /**
6681 * Whether automatic routing of system audio to USB audio peripheral is disabled.
6682 * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
6683 * and 0 means automatic routing is enabled.
6684 *
6685 * @hide
6686 */
6687 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
6688 "usb_audio_automatic_routing_disabled";
6689
6690 /**
6691 * The timeout in milliseconds before the device fully goes to sleep after
6692 * a period of inactivity. This value sets an upper bound on how long the device
6693 * will stay awake or dreaming without user activity. It should generally
6694 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
6695 * will sleep before it ever has a chance to dream.
6696 * <p>
6697 * Use -1 to disable this timeout.
6698 * </p>
6699 *
6700 * @hide
6701 */
6702 public static final String SLEEP_TIMEOUT = "sleep_timeout";
6703
6704 /**
6705 * Controls whether double tap to wake is enabled.
6706 * @hide
6707 */
6708 public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake";
6709
6710 /**
6711 * The current assistant component. It could be a voice interaction service,
6712 * or an activity that handles ACTION_ASSIST, or empty which means using the default
6713 * handling.
6714 *
6715 * @hide
6716 */
6717 public static final String ASSISTANT = "assistant";
6718
6719 /**
6720 * Whether the camera launch gesture should be disabled.
6721 *
6722 * @hide
6723 */
6724 public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled";
6725
6726 /**
6727 * Whether the camera launch gesture to double tap the power button when the screen is off
6728 * should be disabled.
6729 *
6730 * @hide
6731 */
6732 public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED =
6733 "camera_double_tap_power_gesture_disabled";
6734
6735 /**
6736 * Whether the camera double twist gesture to flip between front and back mode should be
6737 * enabled.
6738 *
6739 * @hide
6740 */
6741 public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED =
6742 "camera_double_twist_to_flip_enabled";
6743
6744 /**
6745 * Control whether Night display is currently activated.
6746 * @hide
6747 */
6748 public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated";
6749
6750 /**
6751 * Control whether Night display will automatically activate/deactivate.
6752 * @hide
6753 */
6754 public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode";
6755
6756 /**
6757 * Custom time when Night display is scheduled to activate.
6758 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm).
6759 * @hide
6760 */
6761 public static final String NIGHT_DISPLAY_CUSTOM_START_TIME = "night_display_custom_start_time";
6762
6763 /**
6764 * Custom time when Night display is scheduled to deactivate.
6765 * Represented as milliseconds from midnight (e.g. 21600000 == 6am).
6766 * @hide
6767 */
6768 public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time";
6769
6770 /**
6771 * Whether brightness should automatically adjust based on twilight state.
6772 * @hide
6773 */
6774 public static final String BRIGHTNESS_USE_TWILIGHT = "brightness_use_twilight";
6775
6776 /**
6777 * Names of the service components that the current user has explicitly allowed to
6778 * be a VR mode listener, separated by ':'.
6779 *
6780 * @hide
6781 */
6782 public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners";
6783
6784 /**
6785 * Behavior of the display while in VR mode.
6786 *
6787 * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}.
6788 *
6789 * @hide
6790 */
6791 public static final String VR_DISPLAY_MODE = "vr_display_mode";
6792
6793 /**
6794 * Lower the display persistence while the system is in VR mode.
6795 *
6796 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
6797 *
6798 * @hide.
6799 */
6800 public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0;
6801
6802 /**
6803 * Do not alter the display persistence while the system is in VR mode.
6804 *
6805 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE
6806 *
6807 * @hide.
6808 */
6809 public static final int VR_DISPLAY_MODE_OFF = 1;
6810
6811 /**
6812 * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least
6813 * once.
6814 *
6815 * <p>This is used to ensure that we only take one pass which will disable apps that are not
6816 * privileged (if any). From then on, we only want to enable apps (when a matching SIM is
6817 * inserted), to avoid disabling an app that the user might actively be using.
6818 *
6819 * <p>Will be set to 1 once executed.
6820 *
6821 * @hide
6822 */
6823 public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled";
6824
6825 /**
6826 * Whether parent user can access remote contact in managed profile.
6827 *
6828 * @hide
6829 */
6830 public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH =
6831 "managed_profile_contact_remote_search";
6832
6833 /**
6834 * Whether or not the automatic storage manager is enabled and should run on the device.
6835 *
6836 * @hide
6837 */
6838 public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED =
6839 "automatic_storage_manager_enabled";
6840
6841 /**
6842 * How many days of information for the automatic storage manager to retain on the device.
6843 *
6844 * @hide
6845 */
6846 public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN =
6847 "automatic_storage_manager_days_to_retain";
6848
6849 /**
6850 * Default number of days of information for the automatic storage manager to retain.
6851 *
6852 * @hide
6853 */
6854 public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90;
6855
6856 /**
6857 * How many bytes the automatic storage manager has cleared out.
6858 *
6859 * @hide
6860 */
6861 public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED =
6862 "automatic_storage_manager_bytes_cleared";
6863
6864
6865 /**
6866 * Last run time for the automatic storage manager.
6867 *
6868 * @hide
6869 */
6870 public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN =
6871 "automatic_storage_manager_last_run";
6872
6873
6874 /**
6875 * Whether SystemUI navigation keys is enabled.
6876 * @hide
6877 */
6878 public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
6879 "system_navigation_keys_enabled";
6880
6881 /**
6882 * Holds comma separated list of ordering of QS tiles.
6883 * @hide
6884 */
6885 public static final String QS_TILES = "sysui_qs_tiles";
6886
6887 /**
6888 * Whether preloaded APKs have been installed for the user.
6889 * @hide
6890 */
6891 public static final String DEMO_USER_SETUP_COMPLETE
6892 = "demo_user_setup_complete";
6893
6894 /**
6895 * Specifies whether the web action API is enabled.
6896 *
6897 * @hide
6898 */
6899 public static final String WEB_ACTION_ENABLED = "web_action_enabled";
6900
6901 /**
6902 * Whether to display the ADB notification.
6903 * @hide
6904 */
6905 public static final String ADB_NOTIFY = "adb_notify";
6906
6907 /**
6908 * The TCP/IP port to run ADB on, or -1 for USB
6909 * @hide
6910 */
6911 public static final String ADB_PORT = "adb_port";
6912
6913 /**
6914 * Whether to use one tap tile action to enable or disable data
6915 * @hide
6916 */
6917 public static final String QS_DATA_ADVANCED = "qs_data_advanced";
6918
6919 /**
6920 * This are the settings to be backed up.
6921 *
6922 * NOTE: Settings are backed up and restored in the order they appear
6923 * in this array. If you have one setting depending on another,
6924 * make sure that they are ordered appropriately.
6925 *
6926 * @hide
6927 */
6928 public static final String[] SETTINGS_TO_BACKUP = {
6929 BUGREPORT_IN_POWER_MENU, // moved to global
6930 ALLOW_MOCK_LOCATION,
6931 PARENTAL_CONTROL_ENABLED,
6932 PARENTAL_CONTROL_REDIRECT_URL,
6933 USB_MASS_STORAGE_ENABLED, // moved to global
6934 ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
6935 ACCESSIBILITY_DISPLAY_DALTONIZER,
6936 ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
6937 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
6938 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
6939 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
6940 ACCESSIBILITY_SCRIPT_INJECTION,
6941 ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS,
6942 ENABLED_ACCESSIBILITY_SERVICES,
6943 ENABLED_NOTIFICATION_LISTENERS,
6944 ENABLED_VR_LISTENERS,
6945 ENABLED_INPUT_METHODS,
6946 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
6947 TOUCH_EXPLORATION_ENABLED,
6948 ACCESSIBILITY_ENABLED,
6949 ACCESSIBILITY_SPEAK_PASSWORD,
6950 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
6951 ACCESSIBILITY_CAPTIONING_PRESET,
6952 ACCESSIBILITY_CAPTIONING_ENABLED,
6953 ACCESSIBILITY_CAPTIONING_LOCALE,
6954 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
6955 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
6956 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
6957 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
6958 ACCESSIBILITY_CAPTIONING_TYPEFACE,
6959 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
6960 ACCESSIBILITY_CAPTIONING_WINDOW_COLOR,
6961 TTS_USE_DEFAULTS,
6962 TTS_DEFAULT_RATE,
6963 TTS_DEFAULT_PITCH,
6964 TTS_DEFAULT_SYNTH,
6965 TTS_DEFAULT_LANG,
6966 TTS_DEFAULT_COUNTRY,
6967 TTS_ENABLED_PLUGINS,
6968 TTS_DEFAULT_LOCALE,
6969 SHOW_IME_WITH_HARD_KEYBOARD,
6970 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
6971 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
6972 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
6973 SELECTED_SPELL_CHECKER,
6974 SELECTED_SPELL_CHECKER_SUBTYPE,
6975 SPELL_CHECKER_ENABLED,
6976 MOUNT_PLAY_NOTIFICATION_SND,
6977 MOUNT_UMS_AUTOSTART,
6978 MOUNT_UMS_PROMPT,
6979 MOUNT_UMS_NOTIFY_ENABLED,
6980 SLEEP_TIMEOUT,
6981 DOUBLE_TAP_TO_WAKE,
6982 WAKE_GESTURE_ENABLED,
6983 LONG_PRESS_TIMEOUT,
6984 CAMERA_GESTURE_DISABLED,
6985 ACCESSIBILITY_AUTOCLICK_ENABLED,
6986 ACCESSIBILITY_AUTOCLICK_DELAY,
6987 ACCESSIBILITY_LARGE_POINTER_ICON,
6988 PREFERRED_TTY_MODE,
6989 ENHANCED_VOICE_PRIVACY_ENABLED,
6990 TTY_MODE_ENABLED,
6991 INCALL_POWER_BUTTON_BEHAVIOR,
6992 NIGHT_DISPLAY_CUSTOM_START_TIME,
6993 NIGHT_DISPLAY_CUSTOM_END_TIME,
6994 NIGHT_DISPLAY_AUTO_MODE,
6995 NIGHT_DISPLAY_ACTIVATED,
6996 CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
6997 CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
6998 SYSTEM_NAVIGATION_KEYS_ENABLED,
6999 QS_TILES,
7000 DOZE_ENABLED,
7001 DOZE_PULSE_ON_PICK_UP,
7002 DOZE_PULSE_ON_DOUBLE_TAP,
7003 ADVANCED_REBOOT,
7004 };
7005
7006 /**
7007 * These entries are considered common between the personal and the managed profile,
7008 * since the managed profile doesn't get to change them.
7009 */
7010 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
7011
7012 static {
7013 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
7014 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
7015 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
7016 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
7017 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
7018 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
7019 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
7020 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PREVIOUS_MODE);
7021 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
7022 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
7023 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
7024 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
7025 }
7026
7027 /** @hide */
7028 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
7029 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
7030 }
7031
7032 /**
7033 * Helper method for determining if a location provider is enabled.
7034 *
7035 * @param cr the content resolver to use
7036 * @param provider the location provider to query
7037 * @return true if the provider is enabled
7038 *
7039 * @deprecated use {@link #LOCATION_MODE} or
7040 * {@link LocationManager#isProviderEnabled(String)}
7041 */
7042 @Deprecated
7043 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
7044 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
7045 }
7046
7047 /**
7048 * Helper method for determining if a location provider is enabled.
7049 * @param cr the content resolver to use
7050 * @param provider the location provider to query
7051 * @param userId the userId to query
7052 * @return true if the provider is enabled
7053 * @deprecated use {@link #LOCATION_MODE} or
7054 * {@link LocationManager#isProviderEnabled(String)}
7055 * @hide
7056 */
7057 @Deprecated
7058 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
7059 String allowedProviders = Settings.Secure.getStringForUser(cr,
7060 LOCATION_PROVIDERS_ALLOWED, userId);
7061 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
7062 }
7063
7064 /**
7065 * Thread-safe method for enabling or disabling a single location provider.
7066 * @param cr the content resolver to use
7067 * @param provider the location provider to enable or disable
7068 * @param enabled true if the provider should be enabled
7069 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE}
7070 */
7071 @Deprecated
7072 public static final void setLocationProviderEnabled(ContentResolver cr,
7073 String provider, boolean enabled) {
7074 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
7075 }
7076
7077 /**
7078 * Thread-safe method for enabling or disabling a single location provider.
7079 *
7080 * @param cr the content resolver to use
7081 * @param provider the location provider to enable or disable
7082 * @param enabled true if the provider should be enabled
7083 * @param userId the userId for which to enable/disable providers
7084 * @return true if the value was set, false on database errors
7085 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and
7086 * {@link #LOCATION_MODE}
7087 * @hide
7088 */
7089 @Deprecated
7090 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
7091 String provider, boolean enabled, int userId) {
7092 synchronized (mLocationSettingsLock) {
7093 // to ensure thread safety, we write the provider name with a '+' or '-'
7094 // and let the SettingsProvider handle it rather than reading and modifying
7095 // the list of enabled providers.
7096 if (enabled) {
7097 provider = "+" + provider;
7098 } else {
7099 provider = "-" + provider;
7100 }
7101 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
7102 userId);
7103 }
7104 }
7105
7106 /**
7107 * Saves the current location mode into {@link #LOCATION_PREVIOUS_MODE}.
7108 */
7109 private static final boolean saveLocationModeForUser(ContentResolver cr, int userId) {
7110 final int mode = getLocationModeForUser(cr, userId);
7111 return putIntForUser(cr, Settings.Secure.LOCATION_PREVIOUS_MODE, mode, userId);
7112 }
7113
7114 /**
7115 * Restores the current location mode from {@link #LOCATION_PREVIOUS_MODE}.
7116 */
7117 private static final boolean restoreLocationModeForUser(ContentResolver cr, int userId) {
7118 int mode = getIntForUser(cr, Settings.Secure.LOCATION_PREVIOUS_MODE,
7119 LOCATION_MODE_HIGH_ACCURACY, userId);
7120 // Make sure that the previous mode is never "off". Otherwise the user won't be able to
7121 // turn on location any longer.
7122 if (mode == LOCATION_MODE_OFF) {
7123 mode = LOCATION_MODE_HIGH_ACCURACY;
7124 }
7125 return setLocationModeForUser(cr, mode, userId);
7126 }
7127
7128 /**
7129 * Thread-safe method for setting the location mode to one of
7130 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
7131 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
7132 *
7133 * @param cr the content resolver to use
7134 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
7135 * @param userId the userId for which to change mode
7136 * @return true if the value was set, false on database errors
7137 *
7138 * @throws IllegalArgumentException if mode is not one of the supported values
7139 */
7140 private static final boolean setLocationModeForUser(ContentResolver cr, int mode,
7141 int userId) {
7142 synchronized (mLocationSettingsLock) {
7143 boolean gps = false;
7144 boolean network = false;
7145 switch (mode) {
7146 case LOCATION_MODE_PREVIOUS:
7147 // Retrieve the actual mode and set to that mode.
7148 return restoreLocationModeForUser(cr, userId);
7149 case LOCATION_MODE_OFF:
7150 saveLocationModeForUser(cr, userId);
7151 break;
7152 case LOCATION_MODE_SENSORS_ONLY:
7153 gps = true;
7154 break;
7155 case LOCATION_MODE_BATTERY_SAVING:
7156 network = true;
7157 break;
7158 case LOCATION_MODE_HIGH_ACCURACY:
7159 gps = true;
7160 network = true;
7161 break;
7162 default:
7163 throw new IllegalArgumentException("Invalid location mode: " + mode);
7164 }
7165 // Note it's important that we set the NLP mode first. The Google implementation
7166 // of NLP clears its NLP consent setting any time it receives a
7167 // LocationManager.PROVIDERS_CHANGED_ACTION broadcast and NLP is disabled. Also,
7168 // it shows an NLP consent dialog any time it receives the broadcast, NLP is
7169 // enabled, and the NLP consent is not set. If 1) we were to enable GPS first,
7170 // 2) a setup wizard has its own NLP consent UI that sets the NLP consent setting,
7171 // and 3) the receiver happened to complete before we enabled NLP, then the Google
7172 // NLP would detect the attempt to enable NLP and show a redundant NLP consent
7173 // dialog. Then the people who wrote the setup wizard would be sad.
7174 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
7175 cr, LocationManager.NETWORK_PROVIDER, network, userId);
7176 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
7177 cr, LocationManager.GPS_PROVIDER, gps, userId);
7178 return gpsSuccess && nlpSuccess;
7179 }
7180 }
7181
7182 /**
7183 * Thread-safe method for reading the location mode, returns one of
7184 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
7185 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
7186 *
7187 * @param cr the content resolver to use
7188 * @param userId the userId for which to read the mode
7189 * @return the location mode
7190 */
7191 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
7192 synchronized (mLocationSettingsLock) {
7193 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
7194 cr, LocationManager.GPS_PROVIDER, userId);
7195 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
7196 cr, LocationManager.NETWORK_PROVIDER, userId);
7197 if (gpsEnabled && networkEnabled) {
7198 return LOCATION_MODE_HIGH_ACCURACY;
7199 } else if (gpsEnabled) {
7200 return LOCATION_MODE_SENSORS_ONLY;
7201 } else if (networkEnabled) {
7202 return LOCATION_MODE_BATTERY_SAVING;
7203 } else {
7204 return LOCATION_MODE_OFF;
7205 }
7206 }
7207 }
7208 }
7209
7210 /**
7211 * Global system settings, containing preferences that always apply identically
7212 * to all defined users. Applications can read these but are not allowed to write;
7213 * like the "Secure" settings, these are for preferences that the user must
7214 * explicitly modify through the system UI or specialized APIs for those values.
7215 */
7216 public static final class Global extends NameValueTable {
7217 /**
7218 * The content:// style URL for global secure settings items. Not public.
7219 */
7220 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
7221
7222 /**
7223 * Whether users are allowed to add more users or guest from lockscreen.
7224 * <p>
7225 * Type: int
7226 * @hide
7227 */
7228 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
7229
7230 /**
7231 * Setting whether the global gesture for enabling accessibility is enabled.
7232 * If this gesture is enabled the user will be able to perfrom it to enable
7233 * the accessibility state without visiting the settings app.
7234 * @hide
7235 */
7236 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
7237 "enable_accessibility_global_gesture_enabled";
7238
7239 /**
7240 * Whether Airplane Mode is on.
7241 */
7242 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
7243
7244 /**
7245 * Whether Theater Mode is on.
7246 * {@hide}
7247 */
7248 @SystemApi
7249 public static final String THEATER_MODE_ON = "theater_mode_on";
7250
7251 /**
7252 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
7253 */
7254 public static final String RADIO_BLUETOOTH = "bluetooth";
7255
7256 /**
7257 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
7258 */
7259 public static final String RADIO_WIFI = "wifi";
7260
7261 /**
7262 * {@hide}
7263 */
7264 public static final String RADIO_WIMAX = "wimax";
7265 /**
7266 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
7267 */
7268 public static final String RADIO_CELL = "cell";
7269
7270 /**
7271 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
7272 */
7273 public static final String RADIO_NFC = "nfc";
7274
7275 /**
7276 * A comma separated list of radios that need to be disabled when airplane mode
7277 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
7278 * included in the comma separated list.
7279 */
7280 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
7281
7282 /**
7283 * A comma separated list of radios that should to be disabled when airplane mode
7284 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
7285 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
7286 * will be turned off when entering airplane mode, but the user will be able to reenable
7287 * Wifi in the Settings app.
7288 *
7289 * {@hide}
7290 */
7291 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
7292
7293 /**
7294 * A Long representing a bitmap of profiles that should be disabled when bluetooth starts.
7295 * See {@link android.bluetooth.BluetoothProfile}.
7296 * {@hide}
7297 */
7298 public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";
7299
7300 /**
7301 * A semi-colon separated list of Bluetooth interoperability workarounds.
7302 * Each entry is a partial Bluetooth device address string and an integer representing
7303 * the feature to be disabled, separated by a comma. The integer must correspond
7304 * to a interoperability feature as defined in "interop.h" in /system/bt.
7305 * <p>
7306 * Example: <br/>
7307 * "00:11:22,0;01:02:03:04,2"
7308 * @hide
7309 */
7310 public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";
7311
7312 /**
7313 * The policy for deciding when Wi-Fi should go to sleep (which will in
7314 * turn switch to using the mobile data as an Internet connection).
7315 * <p>
7316 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
7317 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
7318 * {@link #WIFI_SLEEP_POLICY_NEVER}.
7319 */
7320 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
7321
7322 /**
7323 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
7324 * policy, which is to sleep shortly after the turning off
7325 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
7326 */
7327 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
7328
7329 /**
7330 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
7331 * the device is on battery, and never go to sleep when the device is
7332 * plugged in.
7333 */
7334 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
7335
7336 /**
7337 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
7338 */
7339 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
7340
7341 /**
7342 * Value to specify if the user prefers the date, time and time zone
7343 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
7344 */
7345 public static final String AUTO_TIME = "auto_time";
7346
7347 /**
7348 * Value to specify if the user prefers the time zone
7349 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
7350 */
7351 public static final String AUTO_TIME_ZONE = "auto_time_zone";
7352
7353 /**
7354 * URI for the car dock "in" event sound.
7355 * @hide
7356 */
7357 public static final String CAR_DOCK_SOUND = "car_dock_sound";
7358
7359 /**
7360 * URI for the car dock "out" event sound.
7361 * @hide
7362 */
7363 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
7364
7365 /**
7366 * URI for the desk dock "in" event sound.
7367 * @hide
7368 */
7369 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
7370
7371 /**
7372 * URI for the desk dock "out" event sound.
7373 * @hide
7374 */
7375 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
7376
7377 /**
7378 * Whether to play a sound for dock events.
7379 * @hide
7380 */
7381 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
7382
7383 /**
7384 * URI for the "device locked" (keyguard shown) sound.
7385 * @hide
7386 */
7387 public static final String LOCK_SOUND = "lock_sound";
7388
7389 /**
7390 * URI for the "device unlocked" sound.
7391 * @hide
7392 */
7393 public static final String UNLOCK_SOUND = "unlock_sound";
7394
7395 /**
7396 * URI for the "device is trusted" sound, which is played when the device enters the trusted
7397 * state without unlocking.
7398 * @hide
7399 */
7400 public static final String TRUSTED_SOUND = "trusted_sound";
7401
7402 /**
7403 * URI for the low battery sound file.
7404 * @hide
7405 */
7406 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
7407
7408 /**
7409 * Whether to play a sound for low-battery alerts.
7410 * @hide
7411 */
7412 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
7413
7414 /**
7415 * URI for the "wireless charging started" sound.
7416 * @hide
7417 */
7418 public static final String WIRELESS_CHARGING_STARTED_SOUND =
7419 "wireless_charging_started_sound";
7420
7421 /**
7422 * Whether to play a sound for charging events.
7423 * @hide
7424 */
7425 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
7426
7427 /**
7428 * Whether we keep the device on while the device is plugged in.
7429 * Supported values are:
7430 * <ul>
7431 * <li>{@code 0} to never stay on while plugged in</li>
7432 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
7433 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
7434 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
7435 * </ul>
7436 * These values can be OR-ed together.
7437 */
7438 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
7439
7440 /**
7441 * When the user has enable the option to have a "bug report" command
7442 * in the power menu.
7443 * @hide
7444 */
7445 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
7446
7447 /**
7448 * Whether ADB is enabled.
7449 */
7450 public static final String ADB_ENABLED = "adb_enabled";
7451
7452 /**
7453 * Whether Views are allowed to save their attribute data.
7454 * @hide
7455 */
7456 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
7457
7458 /**
7459 * Whether assisted GPS should be enabled or not.
7460 * @hide
7461 */
7462 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
7463
7464 /**
7465 * Whether bluetooth is enabled/disabled
7466 * 0=disabled. 1=enabled.
7467 */
7468 public static final String BLUETOOTH_ON = "bluetooth_on";
7469
7470 /**
7471 * CDMA Cell Broadcast SMS
7472 * 0 = CDMA Cell Broadcast SMS disabled
7473 * 1 = CDMA Cell Broadcast SMS enabled
7474 * @hide
7475 */
7476 public static final String CDMA_CELL_BROADCAST_SMS =
7477 "cdma_cell_broadcast_sms";
7478
7479 /**
7480 * The CDMA roaming mode 0 = Home Networks, CDMA default
7481 * 1 = Roaming on Affiliated networks
7482 * 2 = Roaming on any networks
7483 * @hide
7484 */
7485 public static final String CDMA_ROAMING_MODE = "roaming_settings";
7486
7487 /**
7488 * The CDMA subscription mode 0 = RUIM/SIM (default)
7489 * 1 = NV
7490 * @hide
7491 */
7492 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
7493
7494 /** Inactivity timeout to track mobile data activity.
7495 *
7496 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
7497 * infer the data activity of mobile network. After a period of no activity on mobile
7498 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
7499 * intent is fired to indicate a transition of network status from "active" to "idle". Any
7500 * subsequent activity on mobile networks triggers the firing of {@code
7501 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
7502 *
7503 * Network activity refers to transmitting or receiving data on the network interfaces.
7504 *
7505 * Tracking is disabled if set to zero or negative value.
7506 *
7507 * @hide
7508 */
7509 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
7510
7511 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
7512 * but for Wifi network.
7513 * @hide
7514 */
7515 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
7516
7517 /**
7518 * Whether or not data roaming is enabled. (0 = false, 1 = true)
7519 */
7520 public static final String DATA_ROAMING = "data_roaming";
7521
7522 /**
7523 * The value passed to a Mobile DataConnection via bringUp which defines the
7524 * number of retries to preform when setting up the initial connection. The default
7525 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
7526 * @hide
7527 */
7528 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
7529
7530 /**
7531 * Whether any package can be on external storage. When this is true, any
7532 * package, regardless of manifest values, is a candidate for installing
7533 * or moving onto external storage. (0 = false, 1 = true)
7534 * @hide
7535 */
7536 public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external";
7537
7538 /**
7539 * Whether any activity can be resized. When this is true, any
7540 * activity, regardless of manifest values, can be resized for multi-window.
7541 * (0 = false, 1 = true)
7542 * @hide
7543 */
7544 public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES
7545 = "force_resizable_activities";
7546
7547 /**
7548 * Whether to enable experimental freeform support for windows.
7549 * @hide
7550 */
7551 public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT
7552 = "enable_freeform_support";
7553
7554 /**
7555 * Whether user has enabled development settings.
7556 */
7557 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
7558
7559 /**
7560 * Whether the device has been provisioned (0 = false, 1 = true).
7561 * <p>On a multiuser device with a separate system user, the screen may be locked
7562 * as soon as this is set to true and further activities cannot be launched on the
7563 * system user unless they are marked to show over keyguard.
7564 */
7565 public static final String DEVICE_PROVISIONED = "device_provisioned";
7566
7567 /**
7568 * Whether mobile data should be allowed while the device is being provisioned.
7569 * This allows the provisioning process to turn off mobile data before the user
7570 * has an opportunity to set things up, preventing other processes from burning
7571 * precious bytes before wifi is setup.
7572 * (0 = false, 1 = true)
7573 * @hide
7574 */
7575 public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED =
7576 "device_provisioning_mobile_data";
7577
7578 /**
7579 * The saved value for WindowManagerService.setForcedDisplaySize().
7580 * Two integers separated by a comma. If unset, then use the real display size.
7581 * @hide
7582 */
7583 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
7584
7585 /**
7586 * The saved value for WindowManagerService.setForcedDisplayScalingMode().
7587 * 0 or unset if scaling is automatic, 1 if scaling is disabled.
7588 * @hide
7589 */
7590 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force";
7591
7592 /**
7593 * The maximum size, in bytes, of a download that the download manager will transfer over
7594 * a non-wifi connection.
7595 * @hide
7596 */
7597 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
7598 "download_manager_max_bytes_over_mobile";
7599
7600 /**
7601 * The recommended maximum size, in bytes, of a download that the download manager should
7602 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
7603 * have the option to start the download over the mobile connection anyway.
7604 * @hide
7605 */
7606 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
7607 "download_manager_recommended_max_bytes_over_mobile";
7608
7609 /**
7610 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
7611 */
7612 @Deprecated
7613 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
7614
7615 /**
7616 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
7617 * sent or processed. (0 = false, 1 = true)
7618 * @hide
7619 */
7620 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
7621
7622 /**
7623 * Whether HDMI system audio is enabled. If enabled, TV internal speaker is muted,
7624 * and the output is redirected to AV Receiver connected via
7625 * {@Global#HDMI_SYSTEM_AUDIO_OUTPUT}.
7626 * @hide
7627 */
7628 public static final String HDMI_SYSTEM_AUDIO_ENABLED = "hdmi_system_audio_enabled";
7629
7630 /**
7631 * Whether TV will automatically turn on upon reception of the CEC command
7632 * <Text View On> or <Image View On>. (0 = false, 1 = true)
7633 * @hide
7634 */
7635 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
7636 "hdmi_control_auto_wakeup_enabled";
7637
7638 /**
7639 * Whether TV will also turn off other CEC devices when it goes to standby mode.
7640 * (0 = false, 1 = true)
7641 * @hide
7642 */
7643 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
7644 "hdmi_control_auto_device_off_enabled";
7645
7646 /**
7647 * Whether TV will switch to MHL port when a mobile device is plugged in.
7648 * (0 = false, 1 = true)
7649 * @hide
7650 */
7651 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
7652
7653 /**
7654 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
7655 * @hide
7656 */
7657 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
7658
7659 /**
7660 * Whether mobile data connections are allowed by the user. See
7661 * ConnectivityManager for more info.
7662 * @hide
7663 */
7664 public static final String MOBILE_DATA = "mobile_data";
7665
7666 /**
7667 * Whether the mobile data connection should remain active even when higher
7668 * priority networks like WiFi are active, to help make network switching faster.
7669 *
7670 * See ConnectivityService for more info.
7671 *
7672 * (0 = disabled, 1 = enabled)
7673 * @hide
7674 */
7675 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
7676
7677 /** {@hide} */
7678 public static final String NETSTATS_ENABLED = "netstats_enabled";
7679 /** {@hide} */
7680 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
7681 /** {@hide} */
7682 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
7683 /** {@hide} */
7684 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
7685 /** {@hide} */
7686 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
7687
7688 /** {@hide} */
7689 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
7690 /** {@hide} */
7691 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
7692 /** {@hide} */
7693 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
7694 /** {@hide} */
7695 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
7696
7697 /** {@hide} */
7698 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
7699 /** {@hide} */
7700 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
7701 /** {@hide} */
7702 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
7703 /** {@hide} */
7704 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
7705
7706 /** {@hide} */
7707 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
7708 /** {@hide} */
7709 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
7710 /** {@hide} */
7711 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
7712 /** {@hide} */
7713 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
7714
7715 /**
7716 * User preference for which network(s) should be used. Only the
7717 * connectivity service should touch this.
7718 */
7719 public static final String NETWORK_PREFERENCE = "network_preference";
7720
7721 /**
7722 * Which package name to use for network scoring. If null, or if the package is not a valid
7723 * scorer app, external network scores will neither be requested nor accepted.
7724 * @hide
7725 */
7726 public static final String NETWORK_SCORER_APP = "network_scorer_app";
7727
7728 /**
7729 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
7730 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
7731 * exceeded.
7732 * @hide
7733 */
7734 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
7735
7736 /**
7737 * The length of time in milli-seconds that automatic small adjustments to
7738 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
7739 * @hide
7740 */
7741 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
7742
7743 /** Preferred NTP server. {@hide} */
7744 public static final String NTP_SERVER = "ntp_server";
7745 /** Timeout in milliseconds to wait for NTP server. {@hide} */
7746 public static final String NTP_TIMEOUT = "ntp_timeout";
7747
7748 /** {@hide} */
7749 public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval";
7750
7751 /**
7752 * Sample validity in seconds to configure for the system DNS resolver.
7753 * {@hide}
7754 */
7755 public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS =
7756 "dns_resolver_sample_validity_seconds";
7757
7758 /**
7759 * Success threshold in percent for use with the system DNS resolver.
7760 * {@hide}
7761 */
7762 public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT =
7763 "dns_resolver_success_threshold_percent";
7764
7765 /**
7766 * Minimum number of samples needed for statistics to be considered meaningful in the
7767 * system DNS resolver.
7768 * {@hide}
7769 */
7770 public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples";
7771
7772 /**
7773 * Maximum number taken into account for statistics purposes in the system DNS resolver.
7774 * {@hide}
7775 */
7776 public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples";
7777
7778 /**
7779 * Whether to disable the automatic scheduling of system updates.
7780 * 1 = system updates won't be automatically scheduled (will always
7781 * present notification instead).
7782 * 0 = system updates will be automatically scheduled. (default)
7783 * @hide
7784 */
7785 @SystemApi
7786 public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
7787
7788 /**
7789 * Whether the package manager should send package verification broadcasts for verifiers to
7790 * review apps prior to installation.
7791 * 1 = request apps to be verified prior to installation, if a verifier exists.
7792 * 0 = do not verify apps before installation
7793 * @hide
7794 */
7795 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
7796
7797 /** Timeout for package verification.
7798 * @hide */
7799 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
7800
7801 /** Default response code for package verification.
7802 * @hide */
7803 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
7804
7805 /**
7806 * Show package verification setting in the Settings app.
7807 * 1 = show (default)
7808 * 0 = hide
7809 * @hide
7810 */
7811 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
7812
7813 /**
7814 * Run package verification on apps installed through ADB/ADT/USB
7815 * 1 = perform package verification on ADB installs (default)
7816 * 0 = bypass package verification on ADB installs
7817 * @hide
7818 */
7819 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
7820
7821 /**
7822 * Time since last fstrim (milliseconds) after which we force one to happen
7823 * during device startup. If unset, the default is 3 days.
7824 * @hide
7825 */
7826 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
7827
7828 /**
7829 * The interval in milliseconds at which to check packet counts on the
7830 * mobile data interface when screen is on, to detect possible data
7831 * connection problems.
7832 * @hide
7833 */
7834 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
7835 "pdp_watchdog_poll_interval_ms";
7836
7837 /**
7838 * The interval in milliseconds at which to check packet counts on the
7839 * mobile data interface when screen is off, to detect possible data
7840 * connection problems.
7841 * @hide
7842 */
7843 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
7844 "pdp_watchdog_long_poll_interval_ms";
7845
7846 /**
7847 * The interval in milliseconds at which to check packet counts on the
7848 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
7849 * outgoing packets has been reached without incoming packets.
7850 * @hide
7851 */
7852 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
7853 "pdp_watchdog_error_poll_interval_ms";
7854
7855 /**
7856 * The number of outgoing packets sent without seeing an incoming packet
7857 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
7858 * device is logged to the event log
7859 * @hide
7860 */
7861 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
7862 "pdp_watchdog_trigger_packet_count";
7863
7864 /**
7865 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
7866 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
7867 * attempting data connection recovery.
7868 * @hide
7869 */
7870 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
7871 "pdp_watchdog_error_poll_count";
7872
7873 /**
7874 * The number of failed PDP reset attempts before moving to something more
7875 * drastic: re-registering to the network.
7876 * @hide
7877 */
7878 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
7879 "pdp_watchdog_max_pdp_reset_fail_count";
7880
7881 /**
7882 * A positive value indicates how often the SamplingProfiler
7883 * should take snapshots. Zero value means SamplingProfiler
7884 * is disabled.
7885 *
7886 * @hide
7887 */
7888 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
7889
7890 /**
7891 * URL to open browser on to allow user to manage a prepay account
7892 * @hide
7893 */
7894 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
7895 "setup_prepaid_data_service_url";
7896
7897 /**
7898 * URL to attempt a GET on to see if this is a prepay device
7899 * @hide
7900 */
7901 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
7902 "setup_prepaid_detection_target_url";
7903
7904 /**
7905 * Host to check for a redirect to after an attempt to GET
7906 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
7907 * this is a prepaid device with zero balance.)
7908 * @hide
7909 */
7910 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
7911 "setup_prepaid_detection_redir_host";
7912
7913 /**
7914 * The interval in milliseconds at which to check the number of SMS sent out without asking
7915 * for use permit, to limit the un-authorized SMS usage.
7916 *
7917 * @hide
7918 */
7919 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
7920 "sms_outgoing_check_interval_ms";
7921
7922 /**
7923 * The number of outgoing SMS sent without asking for user permit (of {@link
7924 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
7925 *
7926 * @hide
7927 */
7928 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
7929 "sms_outgoing_check_max_count";
7930
7931 /**
7932 * Used to disable SMS short code confirmation - defaults to true.
7933 * True indcates we will do the check, etc. Set to false to disable.
7934 * @see com.android.internal.telephony.SmsUsageMonitor
7935 * @hide
7936 */
7937 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
7938
7939 /**
7940 * Used to select which country we use to determine premium sms codes.
7941 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
7942 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
7943 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
7944 * @hide
7945 */
7946 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
7947
7948 /**
7949 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
7950 * @hide
7951 */
7952 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
7953
7954 /**
7955 * Used to disable Tethering on a device - defaults to true
7956 * @hide
7957 */
7958 public static final String TETHER_SUPPORTED = "tether_supported";
7959
7960 /**
7961 * Used to require DUN APN on the device or not - defaults to a build config value
7962 * which defaults to false
7963 * @hide
7964 */
7965 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
7966
7967 /**
7968 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
7969 * corresponding build config values are set it will override the APN DB
7970 * values.
7971 * Consists of a comma seperated list of strings:
7972 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
7973 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
7974 * @hide
7975 */
7976 public static final String TETHER_DUN_APN = "tether_dun_apn";
7977
7978 /**
7979 * List of carrier apps which are whitelisted to prompt the user for install when
7980 * a sim card with matching uicc carrier privilege rules is inserted.
7981 *
7982 * The value is "package1;package2;..."
7983 * @hide
7984 */
7985 public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
7986
7987 /**
7988 * USB Mass Storage Enabled
7989 */
7990 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
7991
7992 /**
7993 * If this setting is set (to anything), then all references
7994 * to Gmail on the device must change to Google Mail.
7995 */
7996 public static final String USE_GOOGLE_MAIL = "use_google_mail";
7997
7998 /**
7999 * Webview Data reduction proxy key.
8000 * @hide
8001 */
8002 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
8003 "webview_data_reduction_proxy_key";
8004
8005 /**
8006 * Whether or not the WebView fallback mechanism should be enabled.
8007 * 0=disabled, 1=enabled.
8008 * @hide
8009 */
8010 public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED =
8011 "webview_fallback_logic_enabled";
8012
8013 /**
8014 * Name of the package used as WebView provider (if unset the provider is instead determined
8015 * by the system).
8016 * @hide
8017 */
8018 public static final String WEBVIEW_PROVIDER = "webview_provider";
8019
8020 /**
8021 * Developer setting to enable WebView multiprocess rendering.
8022 * @hide
8023 */
8024 @SystemApi
8025 public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
8026
8027 /**
8028 * The maximum number of notifications shown in 24 hours when switching networks.
8029 * @hide
8030 */
8031 public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT =
8032 "network_switch_notification_daily_limit";
8033
8034 /**
8035 * The minimum time in milliseconds between notifications when switching networks.
8036 * @hide
8037 */
8038 public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS =
8039 "network_switch_notification_rate_limit_millis";
8040
8041 /**
8042 * Whether to automatically switch away from wifi networks that lose Internet access.
8043 * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always
8044 * avoids such networks. Valid values are:
8045 *
8046 * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013.
8047 * null: Ask the user whether to switch away from bad wifi.
8048 * 1: Avoid bad wifi.
8049 *
8050 * @hide
8051 */
8052 public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi";
8053
8054 /**
8055 * Whether Wifi display is enabled/disabled
8056 * 0=disabled. 1=enabled.
8057 * @hide
8058 */
8059 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
8060
8061 /**
8062 * Whether Wifi display certification mode is enabled/disabled
8063 * 0=disabled. 1=enabled.
8064 * @hide
8065 */
8066 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
8067 "wifi_display_certification_on";
8068
8069 /**
8070 * WPS Configuration method used by Wifi display, this setting only
8071 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
8072 *
8073 * Possible values are:
8074 *
8075 * WpsInfo.INVALID: use default WPS method chosen by framework
8076 * WpsInfo.PBC : use Push button
8077 * WpsInfo.KEYPAD : use Keypad
8078 * WpsInfo.DISPLAY: use Display
8079 * @hide
8080 */
8081 public static final String WIFI_DISPLAY_WPS_CONFIG =
8082 "wifi_display_wps_config";
8083
8084 /**
8085 * Whether to notify the user of open networks.
8086 * <p>
8087 * If not connected and the scan results have an open network, we will
8088 * put this notification up. If we attempt to connect to a network or
8089 * the open network(s) disappear, we remove the notification. When we
8090 * show the notification, we will not show it again for
8091 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
8092 */
8093 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
8094 "wifi_networks_available_notification_on";
8095 /**
8096 * {@hide}
8097 */
8098 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
8099 "wimax_networks_available_notification_on";
8100
8101 /**
8102 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
8103 * Connecting to a network will reset the timer.
8104 */
8105 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
8106 "wifi_networks_available_repeat_delay";
8107
8108 /**
8109 * 802.11 country code in ISO 3166 format
8110 * @hide
8111 */
8112 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
8113
8114 /**
8115 * The interval in milliseconds to issue wake up scans when wifi needs
8116 * to connect. This is necessary to connect to an access point when
8117 * device is on the move and the screen is off.
8118 * @hide
8119 */
8120 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
8121 "wifi_framework_scan_interval_ms";
8122
8123 /**
8124 * The interval in milliseconds after which Wi-Fi is considered idle.
8125 * When idle, it is possible for the device to be switched from Wi-Fi to
8126 * the mobile data network.
8127 * @hide
8128 */
8129 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
8130
8131 /**
8132 * When the number of open networks exceeds this number, the
8133 * least-recently-used excess networks will be removed.
8134 */
8135 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
8136
8137 /**
8138 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
8139 */
8140 public static final String WIFI_ON = "wifi_on";
8141
8142 /**
8143 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
8144 * @hide
8145 */
8146 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
8147 "wifi_scan_always_enabled";
8148
8149 /**
8150 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
8151 * connectivity.
8152 * @hide
8153 */
8154 public static final String BLE_SCAN_ALWAYS_AVAILABLE =
8155 "ble_scan_always_enabled";
8156
8157 /**
8158 * Used to save the Wifi_ON state prior to tethering.
8159 * This state will be checked to restore Wifi after
8160 * the user turns off tethering.
8161 *
8162 * @hide
8163 */
8164 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
8165
8166 /**
8167 * The interval in milliseconds to scan as used by the wifi supplicant
8168 * @hide
8169 */
8170 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
8171 "wifi_supplicant_scan_interval_ms";
8172
8173 /**
8174 * whether frameworks handles wifi auto-join
8175 * @hide
8176 */
8177 public static final String WIFI_ENHANCED_AUTO_JOIN =
8178 "wifi_enhanced_auto_join";
8179
8180 /**
8181 * whether settings show RSSI
8182 * @hide
8183 */
8184 public static final String WIFI_NETWORK_SHOW_RSSI =
8185 "wifi_network_show_rssi";
8186
8187 /**
8188 * The interval in milliseconds to scan at supplicant when p2p is connected
8189 * @hide
8190 */
8191 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
8192 "wifi_scan_interval_p2p_connected_ms";
8193
8194 /**
8195 * Whether the Wi-Fi watchdog is enabled.
8196 */
8197 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
8198
8199 /**
8200 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
8201 * the setting needs to be set to 0 to disable it.
8202 * @hide
8203 */
8204 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
8205 "wifi_watchdog_poor_network_test_enabled";
8206
8207 /**
8208 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
8209 * needs to be set to 0 to disable it.
8210 * @hide
8211 */
8212 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
8213 "wifi_suspend_optimizations_enabled";
8214
8215 /**
8216 * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1
8217 * will enable it. In the future, additional values may be supported.
8218 * @hide
8219 */
8220 public static final String WIFI_VERBOSE_LOGGING_ENABLED =
8221 "wifi_verbose_logging_enabled";
8222
8223 /**
8224 * The maximum number of times we will retry a connection to an access
8225 * point for which we have failed in acquiring an IP address from DHCP.
8226 * A value of N means that we will make N+1 connection attempts in all.
8227 */
8228 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
8229
8230 /**
8231 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
8232 * data connectivity to be established after a disconnect from Wi-Fi.
8233 */
8234 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
8235 "wifi_mobile_data_transition_wakelock_timeout_ms";
8236
8237 /**
8238 * This setting controls whether WiFi configurations created by a Device Owner app
8239 * should be locked down (that is, be editable or removable only by the Device Owner App,
8240 * not even by Settings app).
8241 * This setting takes integer values. Non-zero values mean DO created configurations
8242 * are locked down. Value of zero means they are not. Default value in the absence of
8243 * actual value to this setting is 0.
8244 */
8245 public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN =
8246 "wifi_device_owner_configs_lockdown";
8247
8248 /**
8249 * The operational wifi frequency band
8250 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
8251 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
8252 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
8253 *
8254 * @hide
8255 */
8256 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
8257
8258 /**
8259 * The Wi-Fi peer-to-peer device name
8260 * @hide
8261 */
8262 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
8263
8264 /**
8265 * The min time between wifi disable and wifi enable
8266 * @hide
8267 */
8268 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
8269
8270 /**
8271 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
8272 * from an ephemeral network if there is no BSSID for that network with a non-null score that
8273 * has been seen in this time period.
8274 *
8275 * If this is less than or equal to zero, we use a more conservative behavior and only check
8276 * for a non-null score from the currently connected or target BSSID.
8277 * @hide
8278 */
8279 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
8280 "wifi_ephemeral_out_of_range_timeout_ms";
8281
8282 /**
8283 * The number of milliseconds to delay when checking for data stalls during
8284 * non-aggressive detection. (screen is turned off.)
8285 * @hide
8286 */
8287 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
8288 "data_stall_alarm_non_aggressive_delay_in_ms";
8289
8290 /**
8291 * The number of milliseconds to delay when checking for data stalls during
8292 * aggressive detection. (screen on or suspected data stall)
8293 * @hide
8294 */
8295 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
8296 "data_stall_alarm_aggressive_delay_in_ms";
8297
8298 /**
8299 * The number of milliseconds to allow the provisioning apn to remain active
8300 * @hide
8301 */
8302 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
8303 "provisioning_apn_alarm_delay_in_ms";
8304
8305 /**
8306 * The interval in milliseconds at which to check gprs registration
8307 * after the first registration mismatch of gprs and voice service,
8308 * to detect possible data network registration problems.
8309 *
8310 * @hide
8311 */
8312 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
8313 "gprs_register_check_period_ms";
8314
8315 /**
8316 * Nonzero causes Log.wtf() to crash.
8317 * @hide
8318 */
8319 public static final String WTF_IS_FATAL = "wtf_is_fatal";
8320
8321 /**
8322 * Ringer mode. This is used internally, changing this value will not
8323 * change the ringer mode. See AudioManager.
8324 */
8325 public static final String MODE_RINGER = "mode_ringer";
8326
8327 /**
8328 * Overlay display devices setting.
8329 * The associated value is a specially formatted string that describes the
8330 * size and density of simulated secondary display devices.
8331 * <p>
8332 * Format: {width}x{height}/{dpi};...
8333 * </p><p>
8334 * Example:
8335 * <ul>
8336 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
8337 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
8338 * at 1080p and the second at 720p.</li>
8339 * <li>If the value is empty, then no overlay display devices are created.</li>
8340 * </ul></p>
8341 *
8342 * @hide
8343 */
8344 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
8345
8346 /**
8347 * Threshold values for the duration and level of a discharge cycle,
8348 * under which we log discharge cycle info.
8349 *
8350 * @hide
8351 */
8352 public static final String
8353 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
8354
8355 /** @hide */
8356 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
8357
8358 /**
8359 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
8360 * intents on application crashes and ANRs. If this is disabled, the
8361 * crash/ANR dialog will never display the "Report" button.
8362 * <p>
8363 * Type: int (0 = disallow, 1 = allow)
8364 *
8365 * @hide
8366 */
8367 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
8368
8369 /**
8370 * Maximum age of entries kept by {@link DropBoxManager}.
8371 *
8372 * @hide
8373 */
8374 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
8375
8376 /**
8377 * Maximum number of entry files which {@link DropBoxManager} will keep
8378 * around.
8379 *
8380 * @hide
8381 */
8382 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
8383
8384 /**
8385 * Maximum amount of disk space used by {@link DropBoxManager} no matter
8386 * what.
8387 *
8388 * @hide
8389 */
8390 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
8391
8392 /**
8393 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
8394 * will use.
8395 *
8396 * @hide
8397 */
8398 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
8399
8400 /**
8401 * Percent of total disk which {@link DropBoxManager} will never dip
8402 * into.
8403 *
8404 * @hide
8405 */
8406 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
8407
8408 /**
8409 * Prefix for per-tag dropbox disable/enable settings.
8410 *
8411 * @hide
8412 */
8413 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
8414
8415 /**
8416 * Lines of logcat to include with system crash/ANR/etc. reports, as a
8417 * prefix of the dropbox tag of the report type. For example,
8418 * "logcat_for_system_server_anr" controls the lines of logcat captured
8419 * with system server ANR reports. 0 to disable.
8420 *
8421 * @hide
8422 */
8423 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
8424
8425 /**
8426 * The interval in minutes after which the amount of free storage left
8427 * on the device is logged to the event log
8428 *
8429 * @hide
8430 */
8431 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
8432
8433 /**
8434 * Threshold for the amount of change in disk free space required to
8435 * report the amount of free space. Used to prevent spamming the logs
8436 * when the disk free space isn't changing frequently.
8437 *
8438 * @hide
8439 */
8440 public static final String
8441 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
8442
8443 /**
8444 * Minimum percentage of free storage on the device that is used to
8445 * determine if the device is running low on storage. The default is 10.
8446 * <p>
8447 * Say this value is set to 10, the device is considered running low on
8448 * storage if 90% or more of the device storage is filled up.
8449 *
8450 * @hide
8451 */
8452 public static final String
8453 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
8454
8455 /**
8456 * Maximum byte size of the low storage threshold. This is to ensure
8457 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
8458 * overly large threshold for large storage devices. Currently this must
8459 * be less than 2GB. This default is 500MB.
8460 *
8461 * @hide
8462 */
8463 public static final String
8464 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
8465
8466 /**
8467 * Minimum bytes of free storage on the device before the data partition
8468 * is considered full. By default, 1 MB is reserved to avoid system-wide
8469 * SQLite disk full exceptions.
8470 *
8471 * @hide
8472 */
8473 public static final String
8474 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
8475
8476 /**
8477 * The maximum reconnect delay for short network outages or when the
8478 * network is suspended due to phone use.
8479 *
8480 * @hide
8481 */
8482 public static final String
8483 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
8484
8485 /**
8486 * The number of milliseconds to delay before sending out
8487 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
8488 *
8489 * @hide
8490 */
8491 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
8492
8493
8494 /**
8495 * Network sampling interval, in seconds. We'll generate link information
8496 * about bytes/packets sent and error rates based on data sampled in this interval
8497 *
8498 * @hide
8499 */
8500
8501 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
8502 "connectivity_sampling_interval_in_seconds";
8503
8504 /**
8505 * The series of successively longer delays used in retrying to download PAC file.
8506 * Last delay is used between successful PAC downloads.
8507 *
8508 * @hide
8509 */
8510 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
8511
8512 /**
8513 * Setting to turn off captive portal detection. Feature is enabled by
8514 * default and the setting needs to be set to 0 to disable it.
8515 *
8516 * @hide
8517 */
8518 public static final String
8519 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
8520
8521 /**
8522 * The server used for captive portal detection upon a new conection. A
8523 * 204 response code from the server is used for validation.
8524 * TODO: remove this deprecated symbol.
8525 *
8526 * @hide
8527 */
8528 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
8529
8530 /**
8531 * The URL used for HTTPS captive portal detection upon a new connection.
8532 * A 204 response code from the server is used for validation.
8533 *
8534 * @hide
8535 */
8536 public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
8537
8538 /**
8539 * The URL used for HTTP captive portal detection upon a new connection.
8540 * A 204 response code from the server is used for validation.
8541 *
8542 * @hide
8543 */
8544 public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
8545
8546 /**
8547 * The URL used for fallback HTTP captive portal detection when previous HTTP
8548 * and HTTPS captive portal detection attemps did not return a conclusive answer.
8549 *
8550 * @hide
8551 */
8552 public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
8553
8554 /**
8555 * Whether to use HTTPS for network validation. This is enabled by default and the setting
8556 * needs to be set to 0 to disable it. This setting is a misnomer because captive portals
8557 * don't actually use HTTPS, but it's consistent with the other settings.
8558 *
8559 * @hide
8560 */
8561 public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
8562
8563 /**
8564 * Which User-Agent string to use in the header of the captive portal detection probes.
8565 * The User-Agent field is unset when this setting has no value (HttpUrlConnection default).
8566 *
8567 * @hide
8568 */
8569 public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
8570
8571 /**
8572 * Whether network service discovery is enabled.
8573 *
8574 * @hide
8575 */
8576 public static final String NSD_ON = "nsd_on";
8577
8578 /**
8579 * Let user pick default install location.
8580 *
8581 * @hide
8582 */
8583 public static final String SET_INSTALL_LOCATION = "set_install_location";
8584
8585 /**
8586 * Default install location value.
8587 * 0 = auto, let system decide
8588 * 1 = internal
8589 * 2 = sdcard
8590 * @hide
8591 */
8592 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
8593
8594 /**
8595 * ms during which to consume extra events related to Inet connection
8596 * condition after a transtion to fully-connected
8597 *
8598 * @hide
8599 */
8600 public static final String
8601 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
8602
8603 /**
8604 * ms during which to consume extra events related to Inet connection
8605 * condtion after a transtion to partly-connected
8606 *
8607 * @hide
8608 */
8609 public static final String
8610 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
8611
8612 /** {@hide} */
8613 public static final String
8614 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
8615
8616 /**
8617 * Host name and port for global http proxy. Uses ':' seperator for
8618 * between host and port.
8619 */
8620 public static final String HTTP_PROXY = "http_proxy";
8621
8622 /**
8623 * Host name for global http proxy. Set via ConnectivityManager.
8624 *
8625 * @hide
8626 */
8627 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
8628
8629 /**
8630 * Integer host port for global http proxy. Set via ConnectivityManager.
8631 *
8632 * @hide
8633 */
8634 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
8635
8636 /**
8637 * Exclusion list for global proxy. This string contains a list of
8638 * comma-separated domains where the global proxy does not apply.
8639 * Domains should be listed in a comma- separated list. Example of
8640 * acceptable formats: ".domain1.com,my.domain2.com" Use
8641 * ConnectivityManager to set/get.
8642 *
8643 * @hide
8644 */
8645 public static final String
8646 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
8647
8648 /**
8649 * The location PAC File for the proxy.
8650 * @hide
8651 */
8652 public static final String
8653 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
8654
8655 /**
8656 * Enables the UI setting to allow the user to specify the global HTTP
8657 * proxy and associated exclusion list.
8658 *
8659 * @hide
8660 */
8661 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
8662
8663 /**
8664 * Setting for default DNS in case nobody suggests one
8665 *
8666 * @hide
8667 */
8668 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
8669
8670 /** {@hide} */
8671 public static final String
8672 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
8673 /** {@hide} */
8674 public static final String
8675 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
8676 /** {@hide} */
8677 public static final String
8678 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_";
8679 /** {@hide} */
8680 public static final String
8681 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
8682 /** {@hide} */
8683 public static final String
8684 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
8685 /** {@hide} */
8686 public static final String
8687 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_";
8688 /** {@hide} */
8689 public static final String
8690 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_";
8691
8692 /**
8693 * Device Idle (Doze) specific settings.
8694 * This is encoded as a key=value list, separated by commas. Ex:
8695 *
8696 * "inactive_timeout=60000,sensing_timeout=400000"
8697 *
8698 * The following keys are supported:
8699 *
8700 * <pre>
8701 * inactive_to (long)
8702 * sensing_to (long)
8703 * motion_inactive_to (long)
8704 * idle_after_inactive_to (long)
8705 * idle_pending_to (long)
8706 * max_idle_pending_to (long)
8707 * idle_pending_factor (float)
8708 * idle_to (long)
8709 * max_idle_to (long)
8710 * idle_factor (float)
8711 * min_time_to_alarm (long)
8712 * max_temp_app_whitelist_duration (long)
8713 * notification_whitelist_duration (long)
8714 * </pre>
8715 *
8716 * <p>
8717 * Type: string
8718 * @hide
8719 * @see com.android.server.DeviceIdleController.Constants
8720 */
8721 public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants";
8722
8723 /**
8724 * Device Idle (Doze) specific settings for watches. See {@code #DEVICE_IDLE_CONSTANTS}
8725 *
8726 * <p>
8727 * Type: string
8728 * @hide
8729 * @see com.android.server.DeviceIdleController.Constants
8730 */
8731 public static final String DEVICE_IDLE_CONSTANTS_WATCH = "device_idle_constants_watch";
8732
8733 /**
8734 * App standby (app idle) specific settings.
8735 * This is encoded as a key=value list, separated by commas. Ex:
8736 *
8737 * "idle_duration=5000,parole_interval=4500"
8738 *
8739 * The following keys are supported:
8740 *
8741 * <pre>
8742 * idle_duration2 (long)
8743 * wallclock_threshold (long)
8744 * parole_interval (long)
8745 * parole_duration (long)
8746 *
8747 * idle_duration (long) // This is deprecated and used to circumvent b/26355386.
8748 * </pre>
8749 *
8750 * <p>
8751 * Type: string
8752 * @hide
8753 * @see com.android.server.usage.UsageStatsService.SettingsObserver
8754 */
8755 public static final String APP_IDLE_CONSTANTS = "app_idle_constants";
8756
8757 /**
8758 * Alarm manager specific settings.
8759 * This is encoded as a key=value list, separated by commas. Ex:
8760 *
8761 * "min_futurity=5000,allow_while_idle_short_time=4500"
8762 *
8763 * The following keys are supported:
8764 *
8765 * <pre>
8766 * min_futurity (long)
8767 * min_interval (long)
8768 * allow_while_idle_short_time (long)
8769 * allow_while_idle_long_time (long)
8770 * allow_while_idle_whitelist_duration (long)
8771 * </pre>
8772 *
8773 * <p>
8774 * Type: string
8775 * @hide
8776 * @see com.android.server.AlarmManagerService.Constants
8777 */
8778 public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants";
8779
8780 /**
8781 * Job scheduler specific settings.
8782 * This is encoded as a key=value list, separated by commas. Ex:
8783 *
8784 * "min_ready_jobs_count=2,moderate_use_factor=.5"
8785 *
8786 * The following keys are supported:
8787 *
8788 * <pre>
8789 * min_idle_count (int)
8790 * min_charging_count (int)
8791 * min_connectivity_count (int)
8792 * min_content_count (int)
8793 * min_ready_jobs_count (int)
8794 * heavy_use_factor (float)
8795 * moderate_use_factor (float)
8796 * fg_job_count (int)
8797 * bg_normal_job_count (int)
8798 * bg_moderate_job_count (int)
8799 * bg_low_job_count (int)
8800 * bg_critical_job_count (int)
8801 * </pre>
8802 *
8803 * <p>
8804 * Type: string
8805 * @hide
8806 * @see com.android.server.job.JobSchedulerService.Constants
8807 */
8808 public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants";
8809
8810 /**
8811 * ShortcutManager specific settings.
8812 * This is encoded as a key=value list, separated by commas. Ex:
8813 *
8814 * "reset_interval_sec=86400,max_updates_per_interval=1"
8815 *
8816 * The following keys are supported:
8817 *
8818 * <pre>
8819 * reset_interval_sec (long)
8820 * max_updates_per_interval (int)
8821 * max_icon_dimension_dp (int, DP)
8822 * max_icon_dimension_dp_lowram (int, DP)
8823 * max_shortcuts (int)
8824 * icon_quality (int, 0-100)
8825 * icon_format (String)
8826 * </pre>
8827 *
8828 * <p>
8829 * Type: string
8830 * @hide
8831 * @see com.android.server.pm.ShortcutService.ConfigConstants
8832 */
8833 public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants";
8834
8835 /**
8836 * Get the key that retrieves a bluetooth headset's priority.
8837 * @hide
8838 */
8839 public static final String getBluetoothHeadsetPriorityKey(String address) {
8840 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
8841 }
8842
8843 /**
8844 * Get the key that retrieves a bluetooth a2dp sink's priority.
8845 * @hide
8846 */
8847 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
8848 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
8849 }
8850
8851 /**
8852 * Get the key that retrieves a bluetooth a2dp src's priority.
8853 * @hide
8854 */
8855 public static final String getBluetoothA2dpSrcPriorityKey(String address) {
8856 return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
8857 }
8858
8859 /**
8860 * Get the key that retrieves a bluetooth Input Device's priority.
8861 * @hide
8862 */
8863 public static final String getBluetoothInputDevicePriorityKey(String address) {
8864 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
8865 }
8866
8867 /**
8868 * Get the key that retrieves a bluetooth map priority.
8869 * @hide
8870 */
8871 public static final String getBluetoothMapPriorityKey(String address) {
8872 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
8873 }
8874
8875 /**
8876 * Get the key that retrieves a bluetooth pbap client priority.
8877 * @hide
8878 */
8879 public static final String getBluetoothPbapClientPriorityKey(String address) {
8880 return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
8881 }
8882
8883 /**
8884 * Get the key that retrieves a bluetooth map priority.
8885 * @hide
8886 */
8887 public static final String getBluetoothSapPriorityKey(String address) {
8888 return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
8889 }
8890
8891 /**
8892 * Scaling factor for normal window animations. Setting to 0 will
8893 * disable window animations.
8894 */
8895 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
8896
8897 /**
8898 * Scaling factor for activity transition animations. Setting to 0 will
8899 * disable window animations.
8900 */
8901 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
8902
8903 /**
8904 * Scaling factor for Animator-based animations. This affects both the
8905 * start delay and duration of all such animations. Setting to 0 will
8906 * cause animations to end immediately. The default value is 1.
8907 */
8908 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
8909
8910 /**
8911 * Scaling factor for normal window animations. Setting to 0 will
8912 * disable window animations.
8913 *
8914 * @hide
8915 */
8916 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
8917
8918 /**
8919 * If 0, the compatibility mode is off for all applications.
8920 * If 1, older applications run under compatibility mode.
8921 * TODO: remove this settings before code freeze (bug/1907571)
8922 * @hide
8923 */
8924 public static final String COMPATIBILITY_MODE = "compatibility_mode";
8925
8926 /**
8927 * CDMA only settings
8928 * Emergency Tone 0 = Off
8929 * 1 = Alert
8930 * 2 = Vibrate
8931 * @hide
8932 */
8933 public static final String EMERGENCY_TONE = "emergency_tone";
8934
8935 /**
8936 * CDMA only settings
8937 * Whether the auto retry is enabled. The value is
8938 * boolean (1 or 0).
8939 * @hide
8940 */
8941 public static final String CALL_AUTO_RETRY = "call_auto_retry";
8942
8943 /**
8944 * A setting that can be read whether the emergency affordance is currently needed.
8945 * The value is a boolean (1 or 0).
8946 * @hide
8947 */
8948 public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed";
8949
8950 /**
8951 * See RIL_PreferredNetworkType in ril.h
8952 * @hide
8953 */
8954 public static final String PREFERRED_NETWORK_MODE =
8955 "preferred_network_mode";
8956
8957 /**
8958 * Name of an application package to be debugged.
8959 */
8960 public static final String DEBUG_APP = "debug_app";
8961
8962 /**
8963 * If 1, when launching DEBUG_APP it will wait for the debugger before
8964 * starting user code. If 0, it will run normally.
8965 */
8966 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
8967
8968 /**
8969 * Control whether the process CPU usage meter should be shown.
8970 *
8971 * @deprecated This functionality is no longer available as of
8972 * {@link android.os.Build.VERSION_CODES#N_MR1}.
8973 */
8974 @Deprecated
8975 public static final String SHOW_PROCESSES = "show_processes";
8976
8977 /**
8978 * If 1 low power mode is enabled.
8979 * @hide
8980 */
8981 public static final String LOW_POWER_MODE = "low_power";
8982
8983 /**
8984 * Battery level [1-99] at which low power mode automatically turns on.
8985 * If 0, it will not automatically turn on.
8986 * @hide
8987 */
8988 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
8989
8990 /**
8991 * If not 0, the activity manager will aggressively finish activities and
8992 * processes as soon as they are no longer needed. If 0, the normal
8993 * extended lifetime is used.
8994 */
8995 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
8996
8997 /**
8998 * @hide
8999 * If not 0, the activity manager will implement a looser version of background
9000 * check that is more compatible with existing apps.
9001 */
9002 public static final String LENIENT_BACKGROUND_CHECK = "lenient_background_check";
9003
9004 /**
9005 * Use Dock audio output for media:
9006 * 0 = disabled
9007 * 1 = enabled
9008 * @hide
9009 */
9010 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
9011
9012 /**
9013 * The surround sound formats AC3, DTS or IEC61937 are
9014 * available for use if they are detected.
9015 * This is the default mode.
9016 *
9017 * Note that AUTO is equivalent to ALWAYS for Android TVs and other
9018 * devices that have an S/PDIF output. This is because S/PDIF
9019 * is unidirectional and the TV cannot know if a decoder is
9020 * connected. So it assumes they are always available.
9021 * @hide
9022 */
9023 public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0;
9024
9025 /**
9026 * AC3, DTS or IEC61937 are NEVER available, even if they
9027 * are detected by the hardware. Those formats will not be
9028 * reported.
9029 *
9030 * An example use case would be an AVR reports that it is capable of
9031 * surround sound decoding but is broken. If NEVER is chosen
9032 * then apps must use PCM output instead of encoded output.
9033 * @hide
9034 */
9035 public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1;
9036
9037 /**
9038 * AC3, DTS or IEC61937 are ALWAYS available, even if they
9039 * are not detected by the hardware. Those formats will be
9040 * reported as part of the HDMI output capability. Applications
9041 * are then free to use either PCM or encoded output.
9042 *
9043 * An example use case would be a when TV was connected over
9044 * TOS-link to an AVR. But the TV could not see it because TOS-link
9045 * is unidirectional.
9046 * @hide
9047 */
9048 public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2;
9049
9050 /**
9051 * Set to ENCODED_SURROUND_OUTPUT_AUTO,
9052 * ENCODED_SURROUND_OUTPUT_NEVER or
9053 * ENCODED_SURROUND_OUTPUT_ALWAYS
9054 * @hide
9055 */
9056 public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output";
9057
9058 /**
9059 * Persisted safe headphone volume management state by AudioService
9060 * @hide
9061 */
9062 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
9063
9064 /**
9065 * URL for tzinfo (time zone) updates
9066 * @hide
9067 */
9068 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
9069
9070 /**
9071 * URL for tzinfo (time zone) update metadata
9072 * @hide
9073 */
9074 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
9075
9076 /**
9077 * URL for selinux (mandatory access control) updates
9078 * @hide
9079 */
9080 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
9081
9082 /**
9083 * URL for selinux (mandatory access control) update metadata
9084 * @hide
9085 */
9086 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
9087
9088 /**
9089 * URL for sms short code updates
9090 * @hide
9091 */
9092 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
9093 "sms_short_codes_content_url";
9094
9095 /**
9096 * URL for sms short code update metadata
9097 * @hide
9098 */
9099 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
9100 "sms_short_codes_metadata_url";
9101
9102 /**
9103 * URL for apn_db updates
9104 * @hide
9105 */
9106 public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url";
9107
9108 /**
9109 * URL for apn_db update metadata
9110 * @hide
9111 */
9112 public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url";
9113
9114 /**
9115 * URL for cert pinlist updates
9116 * @hide
9117 */
9118 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
9119
9120 /**
9121 * URL for cert pinlist updates
9122 * @hide
9123 */
9124 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
9125
9126 /**
9127 * URL for intent firewall updates
9128 * @hide
9129 */
9130 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
9131 "intent_firewall_content_url";
9132
9133 /**
9134 * URL for intent firewall update metadata
9135 * @hide
9136 */
9137 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
9138 "intent_firewall_metadata_url";
9139
9140 /**
9141 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
9142 * @hide
9143 */
9144 public static final String SELINUX_STATUS = "selinux_status";
9145
9146 /**
9147 * Developer setting to force RTL layout.
9148 * @hide
9149 */
9150 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
9151
9152 /**
9153 * Milliseconds after screen-off after which low battery sounds will be silenced.
9154 *
9155 * If zero, battery sounds will always play.
9156 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
9157 *
9158 * @hide
9159 */
9160 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
9161
9162 /**
9163 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
9164 * the caller is done with this, they should call {@link ContentResolver#delete} to
9165 * clean up any value that they may have written.
9166 *
9167 * @hide
9168 */
9169 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
9170
9171 /**
9172 * Defines global runtime overrides to window policy.
9173 *
9174 * See {@link com.android.server.policy.PolicyControl} for value format.
9175 *
9176 * @hide
9177 */
9178 public static final String POLICY_CONTROL = "policy_control";
9179
9180 /**
9181 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
9182 * or ZEN_MODE_NO_INTERRUPTIONS.
9183 *
9184 * @hide
9185 */
9186 public static final String ZEN_MODE = "zen_mode";
9187
9188 /** @hide */ public static final int ZEN_MODE_OFF = 0;
9189 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
9190 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
9191 /** @hide */ public static final int ZEN_MODE_ALARMS = 3;
9192
9193 /** @hide */ public static String zenModeToString(int mode) {
9194 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
9195 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
9196 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
9197 return "ZEN_MODE_OFF";
9198 }
9199
9200 /** @hide */ public static boolean isValidZenMode(int value) {
9201 switch (value) {
9202 case Global.ZEN_MODE_OFF:
9203 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
9204 case Global.ZEN_MODE_ALARMS:
9205 case Global.ZEN_MODE_NO_INTERRUPTIONS:
9206 return true;
9207 default:
9208 return false;
9209 }
9210 }
9211
9212 /**
9213 * Value of the ringer before entering zen mode.
9214 *
9215 * @hide
9216 */
9217 public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level";
9218
9219 /**
9220 * Opaque value, changes when persisted zen mode configuration changes.
9221 *
9222 * @hide
9223 */
9224 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
9225
9226 /**
9227 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
9228 *
9229 * @hide
9230 */
9231 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
9232 "heads_up_notifications_enabled";
9233
9234 /** @hide */ public static final int HEADS_UP_OFF = 0;
9235 /** @hide */ public static final int HEADS_UP_ON = 1;
9236
9237 /**
9238 * The name of the device
9239 */
9240 public static final String DEVICE_NAME = "device_name";
9241
9242 /**
9243 * Whether the NetworkScoringService has been first initialized.
9244 * <p>
9245 * Type: int (0 for false, 1 for true)
9246 * @hide
9247 */
9248 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
9249
9250 /**
9251 * Whether the user wants to be prompted for password to decrypt the device on boot.
9252 * This only matters if the storage is encrypted.
9253 * <p>
9254 * Type: int (0 for false, 1 for true)
9255 * @hide
9256 */
9257 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
9258
9259 /**
9260 * Whether the Volte is enabled
9261 * <p>
9262 * Type: int (0 for false, 1 for true)
9263 * @hide
9264 */
9265 public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled";
9266
9267 /**
9268 * Whether VT (Video Telephony over IMS) is enabled
9269 * <p>
9270 * Type: int (0 for false, 1 for true)
9271 *
9272 * @hide
9273 */
9274 public static final String VT_IMS_ENABLED = "vt_ims_enabled";
9275
9276 /**
9277 * Whether WFC is enabled
9278 * <p>
9279 * Type: int (0 for false, 1 for true)
9280 *
9281 * @hide
9282 */
9283 public static final String WFC_IMS_ENABLED = "wfc_ims_enabled";
9284
9285 /**
9286 * WFC mode on home/non-roaming network.
9287 * <p>
9288 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
9289 *
9290 * @hide
9291 */
9292 public static final String WFC_IMS_MODE = "wfc_ims_mode";
9293
9294 /**
9295 * WFC mode on roaming network.
9296 * <p>
9297 * Type: int - see {@link WFC_IMS_MODE} for values
9298 *
9299 * @hide
9300 */
9301 public static final String WFC_IMS_ROAMING_MODE = "wfc_ims_roaming_mode";
9302
9303 /**
9304 * Whether WFC roaming is enabled
9305 * <p>
9306 * Type: int (0 for false, 1 for true)
9307 *
9308 * @hide
9309 */
9310 public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled";
9311
9312 /**
9313 * Whether user can enable/disable LTE as a preferred network. A carrier might control
9314 * this via gservices, OMA-DM, carrier app, etc.
9315 * <p>
9316 * Type: int (0 for false, 1 for true)
9317 * @hide
9318 */
9319 public static final String LTE_SERVICE_FORCED = "lte_service_forced";
9320
9321 /**
9322 * Ephemeral app cookie max size in bytes.
9323 * <p>
9324 * Type: int
9325 * @hide
9326 */
9327 public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES =
9328 "ephemeral_cookie_max_size_bytes";
9329
9330 /**
9331 * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is
9332 * enabled. Set to zero to disable.
9333 * <p>
9334 * Type: int (0 for false, 1 for true)
9335 *
9336 * @hide
9337 */
9338 public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature";
9339
9340 /**
9341 * A mask applied to the ephemeral hash to generate the hash prefix.
9342 * <p>
9343 * Type: int
9344 *
9345 * @hide
9346 */
9347 public static final String EPHEMERAL_HASH_PREFIX_MASK = "ephemeral_hash_prefix_mask";
9348
9349 /**
9350 * Number of hash prefixes to send during ephemeral resolution.
9351 * <p>
9352 * Type: int
9353 *
9354 * @hide
9355 */
9356 public static final String EPHEMERAL_HASH_PREFIX_COUNT = "ephemeral_hash_prefix_count";
9357
9358 /**
9359 * The duration for caching uninstalled ephemeral apps.
9360 * <p>
9361 * Type: long
9362 * @hide
9363 */
9364 public static final String UNINSTALLED_EPHEMERAL_APP_CACHE_DURATION_MILLIS =
9365 "uninstalled_ephemeral_app_cache_duration_millis";
9366
9367 /**
9368 * Allows switching users when system user is locked.
9369 * <p>
9370 * Type: int
9371 * @hide
9372 */
9373 public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED =
9374 "allow_user_switching_when_system_user_locked";
9375
9376 /**
9377 * Boot count since the device starts running APK level 24.
9378 * <p>
9379 * Type: int
9380 */
9381 public static final String BOOT_COUNT = "boot_count";
9382
9383 /**
9384 * Whether the safe boot is disallowed.
9385 *
9386 * <p>This setting should have the identical value as the corresponding user restriction.
9387 * The purpose of the setting is to make the restriction available in early boot stages
9388 * before the user restrictions are loaded.
9389 * @hide
9390 */
9391 public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed";
9392
9393
9394 /**
9395 * Whether to wake the display when plugging or unplugging the charger
9396 *
9397 * @hide
9398 */
9399 public static final String WAKE_WHEN_PLUGGED_OR_UNPLUGGED = "wake_when_plugged_or_unplugged";
9400
9401 /**
9402 * Whether this device is currently in retail demo mode. If true, device
9403 * usage is severely limited.
9404 * <p>
9405 * Type: int (0 for false, 1 for true)
9406 * @hide
9407 */
9408 public static final String DEVICE_DEMO_MODE = "device_demo_mode";
9409
9410 /**
9411 * Retail mode specific settings. This is encoded as a key=value list, separated by commas.
9412 * Ex: "user_inactivity_timeout_ms=30000,warning_dialog_timeout_ms=10000". The following
9413 * keys are supported:
9414 *
9415 * <pre>
9416 * user_inactivity_timeout_ms (long)
9417 * warning_dialog_timeout_ms (long)
9418 * </pre>
9419 * <p>
9420 * Type: string
9421 *
9422 * @hide
9423 */
9424 public static final String RETAIL_DEMO_MODE_CONSTANTS = "retail_demo_mode_constants";
9425
9426 /**
9427 * The reason for the settings database being downgraded. This is only for
9428 * troubleshooting purposes and its value should not be interpreted in any way.
9429 *
9430 * Type: string
9431 *
9432 * @hide
9433 */
9434 public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason";
9435
9436 /**
9437 * Settings to backup. This is here so that it's in the same place as the settings
9438 * keys and easy to update.
9439 *
9440 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
9441 * and Secure as well. This is because those tables drive both backup and
9442 * restore, and restore needs to properly whitelist keys that used to live
9443 * in those namespaces. The keys will only actually be backed up / restored
9444 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
9445 *
9446 * NOTE: Settings are backed up and restored in the order they appear
9447 * in this array. If you have one setting depending on another,
9448 * make sure that they are ordered appropriately.
9449 *
9450 * @hide
9451 */
9452 public static final String[] SETTINGS_TO_BACKUP = {
9453 BUGREPORT_IN_POWER_MENU,
9454 STAY_ON_WHILE_PLUGGED_IN,
9455 WAKE_WHEN_PLUGGED_OR_UNPLUGGED,
9456 AUTO_TIME,
9457 AUTO_TIME_ZONE,
9458 POWER_SOUNDS_ENABLED,
9459 DOCK_SOUNDS_ENABLED,
9460 CHARGING_SOUNDS_ENABLED,
9461 USB_MASS_STORAGE_ENABLED,
9462 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
9463 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
9464 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
9465 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
9466 WIFI_NUM_OPEN_NETWORKS_KEPT,
9467 EMERGENCY_TONE,
9468 CALL_AUTO_RETRY,
9469 DOCK_AUDIO_MEDIA_ENABLED,
9470 ENCODED_SURROUND_OUTPUT,
9471 LOW_POWER_MODE_TRIGGER_LEVEL
9472 };
9473
9474 // Populated lazily, guarded by class object:
9475 private static NameValueCache sNameValueCache = new NameValueCache(
9476 CONTENT_URI,
9477 CALL_METHOD_GET_GLOBAL,
9478 CALL_METHOD_PUT_GLOBAL);
9479
9480 // Certain settings have been moved from global to the per-user secure namespace
9481 private static final HashSet<String> MOVED_TO_SECURE;
9482 static {
9483 MOVED_TO_SECURE = new HashSet<String>(1);
9484 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
9485 }
9486
9487 /** @hide */
9488 public static void getMovedToSecureSettings(Set<String> outKeySet) {
9489 outKeySet.addAll(MOVED_TO_SECURE);
9490 }
9491
9492 /**
9493 * Look up a name in the database.
9494 * @param resolver to access the database with
9495 * @param name to look up in the table
9496 * @return the corresponding value, or null if not present
9497 */
9498 public static String getString(ContentResolver resolver, String name) {
9499 return getStringForUser(resolver, name, UserHandle.myUserId());
9500 }
9501
9502 /** @hide */
9503 public static String getStringForUser(ContentResolver resolver, String name,
9504 int userHandle) {
9505 if (MOVED_TO_SECURE.contains(name)) {
9506 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
9507 + " to android.provider.Settings.Secure, returning read-only value.");
9508 return Secure.getStringForUser(resolver, name, userHandle);
9509 }
9510 return sNameValueCache.getStringForUser(resolver, name, userHandle);
9511 }
9512
9513 /**
9514 * Store a name/value pair into the database.
9515 * @param resolver to access the database with
9516 * @param name to store
9517 * @param value to associate with the name
9518 * @return true if the value was set, false on database errors
9519 */
9520 public static boolean putString(ContentResolver resolver,
9521 String name, String value) {
9522 return putStringForUser(resolver, name, value, UserHandle.myUserId());
9523 }
9524
9525 /** @hide */
9526 public static boolean putStringForUser(ContentResolver resolver,
9527 String name, String value, int userHandle) {
9528 if (LOCAL_LOGV) {
9529 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
9530 + " for " + userHandle);
9531 }
9532 // Global and Secure have the same access policy so we can forward writes
9533 if (MOVED_TO_SECURE.contains(name)) {
9534 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
9535 + " to android.provider.Settings.Secure, value is unchanged.");
9536 return Secure.putStringForUser(resolver, name, value, userHandle);
9537 }
9538 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
9539 }
9540
9541 /**
9542 * Construct the content URI for a particular name/value pair,
9543 * useful for monitoring changes with a ContentObserver.
9544 * @param name to look up in the table
9545 * @return the corresponding content URI, or null if not present
9546 */
9547 public static Uri getUriFor(String name) {
9548 return getUriFor(CONTENT_URI, name);
9549 }
9550
9551 /**
9552 * Convenience function for retrieving a single secure settings value
9553 * as an integer. Note that internally setting values are always
9554 * stored as strings; this function converts the string to an integer
9555 * for you. The default value will be returned if the setting is
9556 * not defined or not an integer.
9557 *
9558 * @param cr The ContentResolver to access.
9559 * @param name The name of the setting to retrieve.
9560 * @param def Value to return if the setting is not defined.
9561 *
9562 * @return The setting's current value, or 'def' if it is not defined
9563 * or not a valid integer.
9564 */
9565 public static int getInt(ContentResolver cr, String name, int def) {
9566 String v = getString(cr, name);
9567 try {
9568 return v != null ? Integer.parseInt(v) : def;
9569 } catch (NumberFormatException e) {
9570 return def;
9571 }
9572 }
9573
9574 /**
9575 * Convenience function for retrieving a single secure settings value
9576 * as an integer. Note that internally setting values are always
9577 * stored as strings; this function converts the string to an integer
9578 * for you.
9579 * <p>
9580 * This version does not take a default value. If the setting has not
9581 * been set, or the string value is not a number,
9582 * it throws {@link SettingNotFoundException}.
9583 *
9584 * @param cr The ContentResolver to access.
9585 * @param name The name of the setting to retrieve.
9586 *
9587 * @throws SettingNotFoundException Thrown if a setting by the given
9588 * name can't be found or the setting value is not an integer.
9589 *
9590 * @return The setting's current value.
9591 */
9592 public static int getInt(ContentResolver cr, String name)
9593 throws SettingNotFoundException {
9594 String v = getString(cr, name);
9595 try {
9596 return Integer.parseInt(v);
9597 } catch (NumberFormatException e) {
9598 throw new SettingNotFoundException(name);
9599 }
9600 }
9601
9602 /**
9603 * Convenience function for updating a single settings value as an
9604 * integer. This will either create a new entry in the table if the
9605 * given name does not exist, or modify the value of the existing row
9606 * with that name. Note that internally setting values are always
9607 * stored as strings, so this function converts the given value to a
9608 * string before storing it.
9609 *
9610 * @param cr The ContentResolver to access.
9611 * @param name The name of the setting to modify.
9612 * @param value The new value for the setting.
9613 * @return true if the value was set, false on database errors
9614 */
9615 public static boolean putInt(ContentResolver cr, String name, int value) {
9616 return putString(cr, name, Integer.toString(value));
9617 }
9618
9619 /**
9620 * Convenience function for retrieving a single secure settings value
9621 * as a {@code long}. Note that internally setting values are always
9622 * stored as strings; this function converts the string to a {@code long}
9623 * for you. The default value will be returned if the setting is
9624 * not defined or not a {@code long}.
9625 *
9626 * @param cr The ContentResolver to access.
9627 * @param name The name of the setting to retrieve.
9628 * @param def Value to return if the setting is not defined.
9629 *
9630 * @return The setting's current value, or 'def' if it is not defined
9631 * or not a valid {@code long}.
9632 */
9633 public static long getLong(ContentResolver cr, String name, long def) {
9634 String valString = getString(cr, name);
9635 long value;
9636 try {
9637 value = valString != null ? Long.parseLong(valString) : def;
9638 } catch (NumberFormatException e) {
9639 value = def;
9640 }
9641 return value;
9642 }
9643
9644 /**
9645 * Convenience function for retrieving a single secure settings value
9646 * as a {@code long}. Note that internally setting values are always
9647 * stored as strings; this function converts the string to a {@code long}
9648 * for you.
9649 * <p>
9650 * This version does not take a default value. If the setting has not
9651 * been set, or the string value is not a number,
9652 * it throws {@link SettingNotFoundException}.
9653 *
9654 * @param cr The ContentResolver to access.
9655 * @param name The name of the setting to retrieve.
9656 *
9657 * @return The setting's current value.
9658 * @throws SettingNotFoundException Thrown if a setting by the given
9659 * name can't be found or the setting value is not an integer.
9660 */
9661 public static long getLong(ContentResolver cr, String name)
9662 throws SettingNotFoundException {
9663 String valString = getString(cr, name);
9664 try {
9665 return Long.parseLong(valString);
9666 } catch (NumberFormatException e) {
9667 throw new SettingNotFoundException(name);
9668 }
9669 }
9670
9671 /**
9672 * Convenience function for updating a secure settings value as a long
9673 * integer. This will either create a new entry in the table if the
9674 * given name does not exist, or modify the value of the existing row
9675 * with that name. Note that internally setting values are always
9676 * stored as strings, so this function converts the given value to a
9677 * string before storing it.
9678 *
9679 * @param cr The ContentResolver to access.
9680 * @param name The name of the setting to modify.
9681 * @param value The new value for the setting.
9682 * @return true if the value was set, false on database errors
9683 */
9684 public static boolean putLong(ContentResolver cr, String name, long value) {
9685 return putString(cr, name, Long.toString(value));
9686 }
9687
9688 /**
9689 * Convenience function for retrieving a single secure settings value
9690 * as a floating point number. Note that internally setting values are
9691 * always stored as strings; this function converts the string to an
9692 * float for you. The default value will be returned if the setting
9693 * is not defined or not a valid float.
9694 *
9695 * @param cr The ContentResolver to access.
9696 * @param name The name of the setting to retrieve.
9697 * @param def Value to return if the setting is not defined.
9698 *
9699 * @return The setting's current value, or 'def' if it is not defined
9700 * or not a valid float.
9701 */
9702 public static float getFloat(ContentResolver cr, String name, float def) {
9703 String v = getString(cr, name);
9704 try {
9705 return v != null ? Float.parseFloat(v) : def;
9706 } catch (NumberFormatException e) {
9707 return def;
9708 }
9709 }
9710
9711 /**
9712 * Convenience function for retrieving a single secure settings value
9713 * as a float. Note that internally setting values are always
9714 * stored as strings; this function converts the string to a float
9715 * for you.
9716 * <p>
9717 * This version does not take a default value. If the setting has not
9718 * been set, or the string value is not a number,
9719 * it throws {@link SettingNotFoundException}.
9720 *
9721 * @param cr The ContentResolver to access.
9722 * @param name The name of the setting to retrieve.
9723 *
9724 * @throws SettingNotFoundException Thrown if a setting by the given
9725 * name can't be found or the setting value is not a float.
9726 *
9727 * @return The setting's current value.
9728 */
9729 public static float getFloat(ContentResolver cr, String name)
9730 throws SettingNotFoundException {
9731 String v = getString(cr, name);
9732 if (v == null) {
9733 throw new SettingNotFoundException(name);
9734 }
9735 try {
9736 return Float.parseFloat(v);
9737 } catch (NumberFormatException e) {
9738 throw new SettingNotFoundException(name);
9739 }
9740 }
9741
9742 /**
9743 * Convenience function for updating a single settings value as a
9744 * floating point number. This will either create a new entry in the
9745 * table if the given name does not exist, or modify the value of the
9746 * existing row with that name. Note that internally setting values
9747 * are always stored as strings, so this function converts the given
9748 * value to a string before storing it.
9749 *
9750 * @param cr The ContentResolver to access.
9751 * @param name The name of the setting to modify.
9752 * @param value The new value for the setting.
9753 * @return true if the value was set, false on database errors
9754 */
9755 public static boolean putFloat(ContentResolver cr, String name, float value) {
9756 return putString(cr, name, Float.toString(value));
9757 }
9758
9759
9760 /**
9761 * Subscription to be used for voice call on a multi sim device. The supported values
9762 * are 0 = SUB1, 1 = SUB2 and etc.
9763 * @hide
9764 */
9765 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
9766
9767 /**
9768 * Used to provide option to user to select subscription during dial.
9769 * The supported values are 0 = disable or 1 = enable prompt.
9770 * @hide
9771 */
9772 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
9773
9774 /**
9775 * Subscription to be used for data call on a multi sim device. The supported values
9776 * are 0 = SUB1, 1 = SUB2 and etc.
9777 * @hide
9778 */
9779 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
9780
9781 /**
9782 * Subscription to be used for SMS on a multi sim device. The supported values
9783 * are 0 = SUB1, 1 = SUB2 and etc.
9784 * @hide
9785 */
9786 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
9787
9788 /**
9789 * Used to provide option to user to select subscription during send SMS.
9790 * The value 1 - enable, 0 - disable
9791 * @hide
9792 */
9793 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
9794
9795
9796
9797 /** User preferred subscriptions setting.
9798 * This holds the details of the user selected subscription from the card and
9799 * the activation status. Each settings string have the coma separated values
9800 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
9801 * @hide
9802 */
9803 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
9804 "user_preferred_sub2","user_preferred_sub3"};
9805
9806 /**
9807 * Whether to enable new contacts aggregator or not.
9808 * The value 1 - enable, 0 - disable
9809 * @hide
9810 */
9811 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator";
9812
9813 /**
9814 * Whether to enable contacts metadata syncing or not
9815 * The value 1 - enable, 0 - disable
9816 *
9817 * @removed
9818 */
9819 @Deprecated
9820 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync";
9821
9822 /**
9823 * Whether to enable contacts metadata syncing or not
9824 * The value 1 - enable, 0 - disable
9825 */
9826 public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled";
9827
9828 /**
9829 * Whether to enable cellular on boot.
9830 * The value 1 - enable, 0 - disable
9831 * @hide
9832 */
9833 public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot";
9834
9835 /**
9836 * The maximum allowed notification enqueue rate in Hertz.
9837 *
9838 * Should be a float, and includes both posts and updates.
9839 * @hide
9840 */
9841 public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate";
9842
9843 /**
9844 * Whether cell is enabled/disabled
9845 * @hide
9846 */
9847 public static final String CELL_ON = "cell_on";
9848 }
9849
9850 /**
9851 * User-defined bookmarks and shortcuts. The target of each bookmark is an
9852 * Intent URL, allowing it to be either a web page or a particular
9853 * application activity.
9854 *
9855 * @hide
9856 */
9857 public static final class Bookmarks implements BaseColumns
9858 {
9859 private static final String TAG = "Bookmarks";
9860
9861 /**
9862 * The content:// style URL for this table
9863 */
9864 public static final Uri CONTENT_URI =
9865 Uri.parse("content://" + AUTHORITY + "/bookmarks");
9866
9867 /**
9868 * The row ID.
9869 * <p>Type: INTEGER</p>
9870 */
9871 public static final String ID = "_id";
9872
9873 /**
9874 * Descriptive name of the bookmark that can be displayed to the user.
9875 * If this is empty, the title should be resolved at display time (use
9876 * {@link #getTitle(Context, Cursor)} any time you want to display the
9877 * title of a bookmark.)
9878 * <P>
9879 * Type: TEXT
9880 * </P>
9881 */
9882 public static final String TITLE = "title";
9883
9884 /**
9885 * Arbitrary string (displayed to the user) that allows bookmarks to be
9886 * organized into categories. There are some special names for
9887 * standard folders, which all start with '@'. The label displayed for
9888 * the folder changes with the locale (via {@link #getLabelForFolder}) but
9889 * the folder name does not change so you can consistently query for
9890 * the folder regardless of the current locale.
9891 *
9892 * <P>Type: TEXT</P>
9893 *
9894 */
9895 public static final String FOLDER = "folder";
9896
9897 /**
9898 * The Intent URL of the bookmark, describing what it points to. This
9899 * value is given to {@link android.content.Intent#getIntent} to create
9900 * an Intent that can be launched.
9901 * <P>Type: TEXT</P>
9902 */
9903 public static final String INTENT = "intent";
9904
9905 /**
9906 * Optional shortcut character associated with this bookmark.
9907 * <P>Type: INTEGER</P>
9908 */
9909 public static final String SHORTCUT = "shortcut";
9910
9911 /**
9912 * The order in which the bookmark should be displayed
9913 * <P>Type: INTEGER</P>
9914 */
9915 public static final String ORDERING = "ordering";
9916
9917 private static final String[] sIntentProjection = { INTENT };
9918 private static final String[] sShortcutProjection = { ID, SHORTCUT };
9919 private static final String sShortcutSelection = SHORTCUT + "=?";
9920
9921 /**
9922 * Convenience function to retrieve the bookmarked Intent for a
9923 * particular shortcut key.
9924 *
9925 * @param cr The ContentResolver to query.
9926 * @param shortcut The shortcut key.
9927 *
9928 * @return Intent The bookmarked URL, or null if there is no bookmark
9929 * matching the given shortcut.
9930 */
9931 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
9932 {
9933 Intent intent = null;
9934
9935 Cursor c = cr.query(CONTENT_URI,
9936 sIntentProjection, sShortcutSelection,
9937 new String[] { String.valueOf((int) shortcut) }, ORDERING);
9938 // Keep trying until we find a valid shortcut
9939 try {
9940 while (intent == null && c.moveToNext()) {
9941 try {
9942 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
9943 intent = Intent.parseUri(intentURI, 0);
9944 } catch (java.net.URISyntaxException e) {
9945 // The stored URL is bad... ignore it.
9946 } catch (IllegalArgumentException e) {
9947 // Column not found
9948 Log.w(TAG, "Intent column not found", e);
9949 }
9950 }
9951 } finally {
9952 if (c != null) c.close();
9953 }
9954
9955 return intent;
9956 }
9957
9958 /**
9959 * Add a new bookmark to the system.
9960 *
9961 * @param cr The ContentResolver to query.
9962 * @param intent The desired target of the bookmark.
9963 * @param title Bookmark title that is shown to the user; null if none
9964 * or it should be resolved to the intent's title.
9965 * @param folder Folder in which to place the bookmark; null if none.
9966 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
9967 * this is non-zero and there is an existing bookmark entry
9968 * with this same shortcut, then that existing shortcut is
9969 * cleared (the bookmark is not removed).
9970 * @return The unique content URL for the new bookmark entry.
9971 */
9972 public static Uri add(ContentResolver cr,
9973 Intent intent,
9974 String title,
9975 String folder,
9976 char shortcut,
9977 int ordering)
9978 {
9979 // If a shortcut is supplied, and it is already defined for
9980 // another bookmark, then remove the old definition.
9981 if (shortcut != 0) {
9982 cr.delete(CONTENT_URI, sShortcutSelection,
9983 new String[] { String.valueOf((int) shortcut) });
9984 }
9985
9986 ContentValues values = new ContentValues();
9987 if (title != null) values.put(TITLE, title);
9988 if (folder != null) values.put(FOLDER, folder);
9989 values.put(INTENT, intent.toUri(0));
9990 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
9991 values.put(ORDERING, ordering);
9992 return cr.insert(CONTENT_URI, values);
9993 }
9994
9995 /**
9996 * Return the folder name as it should be displayed to the user. This
9997 * takes care of localizing special folders.
9998 *
9999 * @param r Resources object for current locale; only need access to
10000 * system resources.
10001 * @param folder The value found in the {@link #FOLDER} column.
10002 *
10003 * @return CharSequence The label for this folder that should be shown
10004 * to the user.
10005 */
10006 public static CharSequence getLabelForFolder(Resources r, String folder) {
10007 return folder;
10008 }
10009
10010 /**
10011 * Return the title as it should be displayed to the user. This takes
10012 * care of localizing bookmarks that point to activities.
10013 *
10014 * @param context A context.
10015 * @param cursor A cursor pointing to the row whose title should be
10016 * returned. The cursor must contain at least the {@link #TITLE}
10017 * and {@link #INTENT} columns.
10018 * @return A title that is localized and can be displayed to the user,
10019 * or the empty string if one could not be found.
10020 */
10021 public static CharSequence getTitle(Context context, Cursor cursor) {
10022 int titleColumn = cursor.getColumnIndex(TITLE);
10023 int intentColumn = cursor.getColumnIndex(INTENT);
10024 if (titleColumn == -1 || intentColumn == -1) {
10025 throw new IllegalArgumentException(
10026 "The cursor must contain the TITLE and INTENT columns.");
10027 }
10028
10029 String title = cursor.getString(titleColumn);
10030 if (!TextUtils.isEmpty(title)) {
10031 return title;
10032 }
10033
10034 String intentUri = cursor.getString(intentColumn);
10035 if (TextUtils.isEmpty(intentUri)) {
10036 return "";
10037 }
10038
10039 Intent intent;
10040 try {
10041 intent = Intent.parseUri(intentUri, 0);
10042 } catch (URISyntaxException e) {
10043 return "";
10044 }
10045
10046 PackageManager packageManager = context.getPackageManager();
10047 ResolveInfo info = packageManager.resolveActivity(intent, 0);
10048 return info != null ? info.loadLabel(packageManager) : "";
10049 }
10050 }
10051
10052 /**
10053 * Returns the device ID that we should use when connecting to the mobile gtalk server.
10054 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
10055 * from the GoogleLoginService.
10056 *
10057 * @param androidId The Android ID for this device.
10058 * @return The device ID that should be used when connecting to the mobile gtalk server.
10059 * @hide
10060 */
10061 public static String getGTalkDeviceId(long androidId) {
10062 return "android-" + Long.toHexString(androidId);
10063 }
10064
10065 private static final String[] PM_WRITE_SETTINGS = {
10066 android.Manifest.permission.WRITE_SETTINGS
10067 };
10068 private static final String[] PM_CHANGE_NETWORK_STATE = {
10069 android.Manifest.permission.CHANGE_NETWORK_STATE,
10070 android.Manifest.permission.WRITE_SETTINGS
10071 };
10072 private static final String[] PM_SYSTEM_ALERT_WINDOW = {
10073 android.Manifest.permission.SYSTEM_ALERT_WINDOW
10074 };
10075
10076 /**
10077 * Performs a strict and comprehensive check of whether a calling package is allowed to
10078 * write/modify system settings, as the condition differs for pre-M, M+, and
10079 * privileged/preinstalled apps. If the provided uid does not match the
10080 * callingPackage, a negative result will be returned.
10081 * @hide
10082 */
10083 public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid,
10084 String callingPackage, boolean throwException) {
10085 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
10086 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
10087 PM_WRITE_SETTINGS, false);
10088 }
10089
10090 /**
10091 * Performs a strict and comprehensive check of whether a calling package is allowed to
10092 * write/modify system settings, as the condition differs for pre-M, M+, and
10093 * privileged/preinstalled apps. If the provided uid does not match the
10094 * callingPackage, a negative result will be returned. The caller is expected to have
10095 * the WRITE_SETTINGS permission declared.
10096 *
10097 * Note: if the check is successful, the operation of this app will be updated to the
10098 * current time.
10099 * @hide
10100 */
10101 public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid,
10102 String callingPackage, boolean throwException) {
10103 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
10104 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
10105 PM_WRITE_SETTINGS, true);
10106 }
10107
10108 /**
10109 * Performs a strict and comprehensive check of whether a calling package is allowed to
10110 * change the state of network, as the condition differs for pre-M, M+, and
10111 * privileged/preinstalled apps. The caller is expected to have either the
10112 * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these
10113 * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and
10114 * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal
10115 * permission and cannot be revoked. See http://b/23597341
10116 *
10117 * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation
10118 * of this app will be updated to the current time.
10119 * @hide
10120 */
10121 public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid,
10122 String callingPackage, boolean throwException) {
10123 if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE)
10124 == PackageManager.PERMISSION_GRANTED) {
10125 return true;
10126 }
10127 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
10128 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
10129 PM_CHANGE_NETWORK_STATE, true);
10130 }
10131
10132 /**
10133 * Performs a strict and comprehensive check of whether a calling package is allowed to
10134 * draw on top of other apps, as the conditions differs for pre-M, M+, and
10135 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
10136 * a negative result will be returned.
10137 * @hide
10138 */
10139 public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid,
10140 String callingPackage, boolean throwException) {
10141 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
10142 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
10143 PM_SYSTEM_ALERT_WINDOW, false);
10144 }
10145
10146 /**
10147 * Performs a strict and comprehensive check of whether a calling package is allowed to
10148 * draw on top of other apps, as the conditions differs for pre-M, M+, and
10149 * privileged/preinstalled apps. If the provided uid does not match the callingPackage,
10150 * a negative result will be returned.
10151 *
10152 * Note: if the check is successful, the operation of this app will be updated to the
10153 * current time.
10154 * @hide
10155 */
10156 public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String
10157 callingPackage, boolean throwException) {
10158 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
10159 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
10160 PM_SYSTEM_ALERT_WINDOW, true);
10161 }
10162
10163 /**
10164 * Helper method to perform a general and comprehensive check of whether an operation that is
10165 * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and
10166 * OP_WRITE_SETTINGS
10167 * @hide
10168 */
10169 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context,
10170 int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[]
10171 permissions, boolean makeNote) {
10172 if (callingPackage == null) {
10173 return false;
10174 }
10175
10176 AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE);
10177 int mode = AppOpsManager.MODE_DEFAULT;
10178 if (makeNote) {
10179 mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage);
10180 } else {
10181 mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage);
10182 }
10183
10184 switch (mode) {
10185 case AppOpsManager.MODE_ALLOWED:
10186 return true;
10187
10188 case AppOpsManager.MODE_DEFAULT:
10189 // this is the default operating mode after an app's installation
10190 // In this case we will check all associated static permission to see
10191 // if it is granted during install time.
10192 for (String permission : permissions) {
10193 if (context.checkCallingOrSelfPermission(permission) == PackageManager
10194 .PERMISSION_GRANTED) {
10195 // if either of the permissions are granted, we will allow it
10196 return true;
10197 }
10198 }
10199
10200 default:
10201 // this is for all other cases trickled down here...
10202 if (!throwException) {
10203 return false;
10204 }
10205 }
10206
10207 // prepare string to throw SecurityException
10208 StringBuilder exceptionMessage = new StringBuilder();
10209 exceptionMessage.append(callingPackage);
10210 exceptionMessage.append(" was not granted ");
10211 if (permissions.length > 1) {
10212 exceptionMessage.append(" either of these permissions: ");
10213 } else {
10214 exceptionMessage.append(" this permission: ");
10215 }
10216 for (int i = 0; i < permissions.length; i++) {
10217 exceptionMessage.append(permissions[i]);
10218 exceptionMessage.append((i == permissions.length - 1) ? "." : ", ");
10219 }
10220
10221 throw new SecurityException(exceptionMessage.toString());
10222 }
10223
10224 /**
10225 * Retrieves a correponding package name for a given uid. It will query all
10226 * packages that are associated with the given uid, but it will return only
10227 * the zeroth result.
10228 * Note: If package could not be found, a null is returned.
10229 * @hide
10230 */
10231 public static String getPackageNameForUid(Context context, int uid) {
10232 String[] packages = context.getPackageManager().getPackagesForUid(uid);
10233 if (packages == null) {
10234 return null;
10235 }
10236 return packages[0];
10237 }
10238}