· 10 years ago · Sep 04, 2016, 09:00 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.SdkConstant;
20import android.annotation.SdkConstant.SdkConstantType;
21import android.app.SearchManager;
22import android.app.WallpaperManager;
23import android.content.ComponentName;
24import android.content.ContentResolver;
25import android.content.ContentValues;
26import android.content.Context;
27import android.content.IContentProvider;
28import android.content.Intent;
29import android.content.pm.ActivityInfo;
30import android.content.pm.PackageManager;
31import android.content.pm.ResolveInfo;
32import android.content.res.Configuration;
33import android.content.res.Resources;
34import android.database.Cursor;
35import android.database.SQLException;
36import android.location.LocationManager;
37import android.net.ConnectivityManager;
38import android.net.Uri;
39import android.net.wifi.WifiManager;
40import android.os.BatteryManager;
41import android.os.Bundle;
42import android.os.DropBoxManager;
43import android.os.IBinder;
44import android.os.Process;
45import android.os.RemoteException;
46import android.os.ServiceManager;
47import android.os.SystemProperties;
48import android.os.UserHandle;
49import android.os.Build.VERSION_CODES;
50import android.speech.tts.TextToSpeech;
51import android.text.TextUtils;
52import android.util.AndroidException;
53import android.util.Log;
54
55import com.android.internal.widget.ILockSettings;
56
57import java.net.URISyntaxException;
58import java.util.ArrayList;
59import java.util.HashMap;
60import java.util.HashSet;
61import java.util.List;
62import java.util.Locale;
63
64/**
65 * The Settings provider contains global system-level device preferences.
66 */
67public final class Settings {
68
69 // Intent actions for Settings
70
71 /**
72 * Activity Action: Show system settings.
73 * <p>
74 * Input: Nothing.
75 * <p>
76 * Output: Nothing.
77 */
78 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
79 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
80
81 /**
82 * Activity Action: Show settings to allow configuration of APNs.
83 * <p>
84 * Input: Nothing.
85 * <p>
86 * Output: Nothing.
87 */
88 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
89 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
90
91 /**
92 * Activity Action: Show settings to allow configuration of current location
93 * sources.
94 * <p>
95 * In some cases, a matching Activity may not exist, so ensure you
96 * safeguard against this.
97 * <p>
98 * Input: Nothing.
99 * <p>
100 * Output: Nothing.
101 */
102 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
103 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
104 "android.settings.LOCATION_SOURCE_SETTINGS";
105
106 /**
107 * Activity Action: Show settings to allow configuration of wireless controls
108 * such as Wi-Fi, Bluetooth and Mobile networks.
109 * <p>
110 * In some cases, a matching Activity may not exist, so ensure you
111 * safeguard against this.
112 * <p>
113 * Input: Nothing.
114 * <p>
115 * Output: Nothing.
116 */
117 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
118 public static final String ACTION_WIRELESS_SETTINGS =
119 "android.settings.WIRELESS_SETTINGS";
120
121 /**
122 * Activity Action: Show settings to allow entering/exiting airplane mode.
123 * <p>
124 * In some cases, a matching Activity may not exist, so ensure you
125 * safeguard against this.
126 * <p>
127 * Input: Nothing.
128 * <p>
129 * Output: Nothing.
130 */
131 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
132 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
133 "android.settings.AIRPLANE_MODE_SETTINGS";
134
135 /**
136 * Activity Action: Show settings for accessibility modules.
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_ACCESSIBILITY_SETTINGS =
147 "android.settings.ACCESSIBILITY_SETTINGS";
148
149 /**
150 * Activity Action: Show settings to allow configuration of security and
151 * location privacy.
152 * <p>
153 * In some cases, a matching Activity may not exist, so ensure you
154 * safeguard against this.
155 * <p>
156 * Input: Nothing.
157 * <p>
158 * Output: Nothing.
159 */
160 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
161 public static final String ACTION_SECURITY_SETTINGS =
162 "android.settings.SECURITY_SETTINGS";
163
164 /**
165 * Activity Action: Show trusted credentials settings, opening to the user tab,
166 * to allow management of installed credentials.
167 * <p>
168 * In some cases, a matching Activity may not exist, so ensure you
169 * safeguard against this.
170 * <p>
171 * Input: Nothing.
172 * <p>
173 * Output: Nothing.
174 * @hide
175 */
176 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
177 public static final String ACTION_TRUSTED_CREDENTIALS_USER =
178 "com.android.settings.TRUSTED_CREDENTIALS_USER";
179
180 /**
181 * Activity Action: Show dialog explaining that an installed CA cert may enable
182 * monitoring of encrypted network traffic.
183 * <p>
184 * In some cases, a matching Activity may not exist, so ensure you
185 * safeguard against this.
186 * <p>
187 * Input: Nothing.
188 * <p>
189 * Output: Nothing.
190 * @hide
191 */
192 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
193 public static final String ACTION_MONITORING_CERT_INFO =
194 "com.android.settings.MONITORING_CERT_INFO";
195
196 /**
197 * Activity Action: Show settings to allow configuration of privacy options.
198 * <p>
199 * In some cases, a matching Activity may not exist, so ensure you
200 * safeguard against this.
201 * <p>
202 * Input: Nothing.
203 * <p>
204 * Output: Nothing.
205 */
206 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
207 public static final String ACTION_PRIVACY_SETTINGS =
208 "android.settings.PRIVACY_SETTINGS";
209
210 /**
211 * Activity Action: Show settings to allow configuration of Wi-Fi.
212
213 * <p>
214 * In some cases, a matching Activity may not exist, so ensure you
215 * safeguard against this.
216 * <p>
217 * Input: Nothing.
218 * <p>
219 * Output: Nothing.
220
221 */
222 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
223 public static final String ACTION_WIFI_SETTINGS =
224 "android.settings.WIFI_SETTINGS";
225
226 /**
227 * Activity Action: Show settings to allow configuration of a static IP
228 * address for Wi-Fi.
229 * <p>
230 * In some cases, a matching Activity may not exist, so ensure you safeguard
231 * against this.
232 * <p>
233 * Input: Nothing.
234 * <p>
235 * Output: Nothing.
236 */
237 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
238 public static final String ACTION_WIFI_IP_SETTINGS =
239 "android.settings.WIFI_IP_SETTINGS";
240
241 /**
242 * Activity Action: Show settings to allow configuration of Bluetooth.
243 * <p>
244 * In some cases, a matching Activity may not exist, so ensure you
245 * safeguard against this.
246 * <p>
247 * Input: Nothing.
248 * <p>
249 * Output: Nothing.
250 */
251 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
252 public static final String ACTION_BLUETOOTH_SETTINGS =
253 "android.settings.BLUETOOTH_SETTINGS";
254
255 /**
256 * Activity Action: Show settings to allow configuration of Wifi Displays.
257 * <p>
258 * In some cases, a matching Activity may not exist, so ensure you
259 * safeguard against this.
260 * <p>
261 * Input: Nothing.
262 * <p>
263 * Output: Nothing.
264 * @hide
265 */
266 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
267 public static final String ACTION_WIFI_DISPLAY_SETTINGS =
268 "android.settings.WIFI_DISPLAY_SETTINGS";
269
270 /**
271 * Activity Action: Show settings to allow configuration of date and time.
272 * <p>
273 * In some cases, a matching Activity may not exist, so ensure you
274 * safeguard against this.
275 * <p>
276 * Input: Nothing.
277 * <p>
278 * Output: Nothing.
279 */
280 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
281 public static final String ACTION_DATE_SETTINGS =
282 "android.settings.DATE_SETTINGS";
283
284 /**
285 * Activity Action: Show settings to allow configuration of sound and volume.
286 * <p>
287 * In some cases, a matching Activity may not exist, so ensure you
288 * safeguard against this.
289 * <p>
290 * Input: Nothing.
291 * <p>
292 * Output: Nothing.
293 */
294 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
295 public static final String ACTION_SOUND_SETTINGS =
296 "android.settings.SOUND_SETTINGS";
297
298 /**
299 * Activity Action: Show settings to allow configuration of display.
300 * <p>
301 * In some cases, a matching Activity may not exist, so ensure you
302 * safeguard against this.
303 * <p>
304 * Input: Nothing.
305 * <p>
306 * Output: Nothing.
307 */
308 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
309 public static final String ACTION_DISPLAY_SETTINGS =
310 "android.settings.DISPLAY_SETTINGS";
311
312 /**
313 * Activity Action: Show settings to allow configuration of locale.
314 * <p>
315 * In some cases, a matching Activity may not exist, so ensure you
316 * safeguard against this.
317 * <p>
318 * Input: Nothing.
319 * <p>
320 * Output: Nothing.
321 */
322 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
323 public static final String ACTION_LOCALE_SETTINGS =
324 "android.settings.LOCALE_SETTINGS";
325
326 /**
327 * Activity Action: Show settings to configure input methods, in particular
328 * allowing the user to enable input methods.
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_INPUT_METHOD_SETTINGS =
339 "android.settings.INPUT_METHOD_SETTINGS";
340
341 /**
342 * Activity Action: Show settings to enable/disable input method subtypes.
343 * <p>
344 * In some cases, a matching Activity may not exist, so ensure you
345 * safeguard against this.
346 * <p>
347 * To tell which input method's subtypes are displayed in the settings, add
348 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
349 * If there is no extra in this Intent, subtypes from all installed input methods
350 * will be displayed in the settings.
351 *
352 * @see android.view.inputmethod.InputMethodInfo#getId
353 * <p>
354 * Input: Nothing.
355 * <p>
356 * Output: Nothing.
357 */
358 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
359 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
360 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
361
362 /**
363 * Activity Action: Show a dialog to select input method.
364 * <p>
365 * In some cases, a matching Activity may not exist, so ensure you
366 * safeguard against this.
367 * <p>
368 * Input: Nothing.
369 * <p>
370 * Output: Nothing.
371 * @hide
372 */
373 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
374 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
375 "android.settings.SHOW_INPUT_METHOD_PICKER";
376
377 /**
378 * Activity Action: Show settings to manage the user input dictionary.
379 * <p>
380 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
381 * it is guaranteed there will always be an appropriate implementation for this Intent action.
382 * In prior releases of the platform this was optional, so ensure you safeguard against it.
383 * <p>
384 * Input: Nothing.
385 * <p>
386 * Output: Nothing.
387 */
388 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
389 public static final String ACTION_USER_DICTIONARY_SETTINGS =
390 "android.settings.USER_DICTIONARY_SETTINGS";
391
392 /**
393 * Activity Action: Adds a word to the user dictionary.
394 * <p>
395 * In some cases, a matching Activity may not exist, so ensure you
396 * safeguard against this.
397 * <p>
398 * Input: An extra with key <code>word</code> that contains the word
399 * that should be added to the dictionary.
400 * <p>
401 * Output: Nothing.
402 *
403 * @hide
404 */
405 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
406 public static final String ACTION_USER_DICTIONARY_INSERT =
407 "com.android.settings.USER_DICTIONARY_INSERT";
408
409 /**
410 * Activity Action: Show settings to allow configuration of application-related settings.
411 * <p>
412 * In some cases, a matching Activity may not exist, so ensure you
413 * safeguard against this.
414 * <p>
415 * Input: Nothing.
416 * <p>
417 * Output: Nothing.
418 */
419 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
420 public static final String ACTION_APPLICATION_SETTINGS =
421 "android.settings.APPLICATION_SETTINGS";
422
423 /**
424 * Activity Action: Show settings to allow configuration of application
425 * development-related settings. As of
426 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
427 * a required part of the platform.
428 * <p>
429 * Input: Nothing.
430 * <p>
431 * Output: Nothing.
432 */
433 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
434 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
435 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
436
437 /**
438 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
439 * <p>
440 * In some cases, a matching Activity may not exist, so ensure you
441 * safeguard against this.
442 * <p>
443 * Input: Nothing.
444 * <p>
445 * Output: Nothing.
446 */
447 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
448 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
449 "android.settings.QUICK_LAUNCH_SETTINGS";
450
451 /**
452 * Activity Action: Show settings to manage installed applications.
453 * <p>
454 * In some cases, a matching Activity may not exist, so ensure you
455 * safeguard against this.
456 * <p>
457 * Input: Nothing.
458 * <p>
459 * Output: Nothing.
460 */
461 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
462 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
463 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
464
465 /**
466 * Activity Action: Show settings to manage all applications.
467 * <p>
468 * In some cases, a matching Activity may not exist, so ensure you
469 * safeguard against this.
470 * <p>
471 * Input: Nothing.
472 * <p>
473 * Output: Nothing.
474 */
475 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
476 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
477 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
478
479 /**
480 * Activity Action: Show screen of details about a particular application.
481 * <p>
482 * In some cases, a matching Activity may not exist, so ensure you
483 * safeguard against this.
484 * <p>
485 * Input: The Intent's data URI specifies the application package name
486 * to be shown, with the "package" scheme. That is "package:com.my.app".
487 * <p>
488 * Output: Nothing.
489 */
490 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
491 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
492 "android.settings.APPLICATION_DETAILS_SETTINGS";
493
494 /**
495 * @hide
496 * Activity Action: Show the "app ops" settings screen.
497 * <p>
498 * Input: Nothing.
499 * <p>
500 * Output: Nothing.
501 */
502 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
503 public static final String ACTION_APP_OPS_SETTINGS =
504 "android.settings.APP_OPS_SETTINGS";
505
506 /**
507 * Activity Action: Show settings for system update functionality.
508 * <p>
509 * In some cases, a matching Activity may not exist, so ensure you
510 * safeguard against this.
511 * <p>
512 * Input: Nothing.
513 * <p>
514 * Output: Nothing.
515 *
516 * @hide
517 */
518 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
519 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
520 "android.settings.SYSTEM_UPDATE_SETTINGS";
521
522 /**
523 * Activity Action: Show settings to allow configuration of sync settings.
524 * <p>
525 * In some cases, a matching Activity may not exist, so ensure you
526 * safeguard against this.
527 * <p>
528 * The account types available to add via the add account button may be restricted by adding an
529 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
530 * authorities. Only account types which can sync with that content provider will be offered to
531 * the user.
532 * <p>
533 * Input: Nothing.
534 * <p>
535 * Output: Nothing.
536 */
537 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
538 public static final String ACTION_SYNC_SETTINGS =
539 "android.settings.SYNC_SETTINGS";
540
541 /**
542 * Activity Action: Show add account screen for creating a new account.
543 * <p>
544 * In some cases, a matching Activity may not exist, so ensure you
545 * safeguard against this.
546 * <p>
547 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
548 * extra to the Intent with one or more syncable content provider's authorities. Only account
549 * types which can sync with that content provider will be offered to the user.
550 * <p>
551 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
552 * Intent with one or more account types.
553 * <p>
554 * Input: Nothing.
555 * <p>
556 * Output: Nothing.
557 */
558 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
559 public static final String ACTION_ADD_ACCOUNT =
560 "android.settings.ADD_ACCOUNT_SETTINGS";
561
562 /**
563 * Activity Action: Show settings for selecting the network operator.
564 * <p>
565 * In some cases, a matching Activity may not exist, so ensure you
566 * safeguard against this.
567 * <p>
568 * Input: Nothing.
569 * <p>
570 * Output: Nothing.
571 */
572 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
573 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
574 "android.settings.NETWORK_OPERATOR_SETTINGS";
575
576 /**
577 * Activity Action: Show settings for selection of 2G/3G.
578 * <p>
579 * In some cases, a matching Activity may not exist, so ensure you
580 * safeguard against this.
581 * <p>
582 * Input: Nothing.
583 * <p>
584 * Output: Nothing.
585 */
586 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
587 public static final String ACTION_DATA_ROAMING_SETTINGS =
588 "android.settings.DATA_ROAMING_SETTINGS";
589
590 /**
591 * Activity Action: Show settings for internal storage.
592 * <p>
593 * In some cases, a matching Activity may not exist, so ensure you
594 * safeguard against this.
595 * <p>
596 * Input: Nothing.
597 * <p>
598 * Output: Nothing.
599 */
600 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
601 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
602 "android.settings.INTERNAL_STORAGE_SETTINGS";
603 /**
604 * Activity Action: Show settings for memory card storage.
605 * <p>
606 * In some cases, a matching Activity may not exist, so ensure you
607 * safeguard against this.
608 * <p>
609 * Input: Nothing.
610 * <p>
611 * Output: Nothing.
612 */
613 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
614 public static final String ACTION_MEMORY_CARD_SETTINGS =
615 "android.settings.MEMORY_CARD_SETTINGS";
616
617 /**
618 * Activity Action: Show settings for global search.
619 * <p>
620 * In some cases, a matching Activity may not exist, so ensure you
621 * safeguard against this.
622 * <p>
623 * Input: Nothing.
624 * <p>
625 * Output: Nothing
626 */
627 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
628 public static final String ACTION_SEARCH_SETTINGS =
629 "android.search.action.SEARCH_SETTINGS";
630
631 /**
632 * Activity Action: Show general device information settings (serial
633 * number, software version, phone number, etc.).
634 * <p>
635 * In some cases, a matching Activity may not exist, so ensure you
636 * safeguard against this.
637 * <p>
638 * Input: Nothing.
639 * <p>
640 * Output: Nothing
641 */
642 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
643 public static final String ACTION_DEVICE_INFO_SETTINGS =
644 "android.settings.DEVICE_INFO_SETTINGS";
645
646 /**
647 * Activity Action: Show NFC settings.
648 * <p>
649 * This shows UI that allows NFC to be turned on or off.
650 * <p>
651 * In some cases, a matching Activity may not exist, so ensure you
652 * safeguard against this.
653 * <p>
654 * Input: Nothing.
655 * <p>
656 * Output: Nothing
657 * @see android.nfc.NfcAdapter#isEnabled()
658 */
659 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
660 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
661
662 /**
663 * Activity Action: Show NFC Sharing settings.
664 * <p>
665 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
666 * off.
667 * <p>
668 * In some cases, a matching Activity may not exist, so ensure you
669 * safeguard against this.
670 * <p>
671 * Input: Nothing.
672 * <p>
673 * Output: Nothing
674 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
675 */
676 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
677 public static final String ACTION_NFCSHARING_SETTINGS =
678 "android.settings.NFCSHARING_SETTINGS";
679
680 /**
681 * Activity Action: Show NFC Tap & Pay settings
682 * <p>
683 * This shows UI that allows the user to configure Tap&Pay
684 * settings.
685 * <p>
686 * In some cases, a matching Activity may not exist, so ensure you
687 * safeguard against this.
688 * <p>
689 * Input: Nothing.
690 * <p>
691 * Output: Nothing
692 */
693 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
694 public static final String ACTION_NFC_PAYMENT_SETTINGS =
695 "android.settings.NFC_PAYMENT_SETTINGS";
696
697 /**
698 * Activity Action: Show Daydream settings.
699 * <p>
700 * In some cases, a matching Activity may not exist, so ensure you
701 * safeguard against this.
702 * <p>
703 * Input: Nothing.
704 * <p>
705 * Output: Nothing.
706 * @see android.service.dreams.DreamService
707 */
708 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
709 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
710
711 /**
712 * Activity Action: Show Notification listener settings.
713 * <p>
714 * In some cases, a matching Activity may not exist, so ensure you
715 * safeguard against this.
716 * <p>
717 * Input: Nothing.
718 * <p>
719 * Output: Nothing.
720 * @see android.service.notification.NotificationListenerService
721 * @hide
722 */
723 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
724 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
725 = "android.settings.NOTIFICATION_LISTENER_SETTINGS";
726
727 /**
728 * Activity Action: Show settings for video captioning.
729 * <p>
730 * In some cases, a matching Activity may not exist, so ensure you safeguard
731 * against this.
732 * <p>
733 * Input: Nothing.
734 * <p>
735 * Output: Nothing.
736 */
737 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
738 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
739
740 /**
741 * Activity Action: Show the top level print settings.
742 * <p>
743 * In some cases, a matching Activity may not exist, so ensure you
744 * safeguard against this.
745 * <p>
746 * Input: Nothing.
747 * <p>
748 * Output: Nothing.
749 */
750 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
751 public static final String ACTION_PRINT_SETTINGS =
752 "android.settings.ACTION_PRINT_SETTINGS";
753
754 // End of Intent actions for Settings
755
756 /**
757 * @hide - Private call() method on SettingsProvider to read from 'system' table.
758 */
759 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
760
761 /**
762 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
763 */
764 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
765
766 /**
767 * @hide - Private call() method on SettingsProvider to read from 'global' table.
768 */
769 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
770
771 /**
772 * @hide - User handle argument extra to the fast-path call()-based requests
773 */
774 public static final String CALL_METHOD_USER_KEY = "_user";
775
776 /** @hide - Private call() method to write to 'system' table */
777 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
778
779 /** @hide - Private call() method to write to 'secure' table */
780 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
781
782 /** @hide - Private call() method to write to 'global' table */
783 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
784
785 /**
786 * Activity Extra: Limit available options in launched activity based on the given authority.
787 * <p>
788 * This can be passed as an extra field in an Activity Intent with one or more syncable content
789 * provider's authorities as a String[]. This field is used by some intents to alter the
790 * behavior of the called activity.
791 * <p>
792 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
793 * on the authority given.
794 */
795 public static final String EXTRA_AUTHORITIES = "authorities";
796
797 /**
798 * Activity Extra: Limit available options in launched activity based on the given account
799 * types.
800 * <p>
801 * This can be passed as an extra field in an Activity Intent with one or more account types
802 * as a String[]. This field is used by some intents to alter the behavior of the called
803 * activity.
804 * <p>
805 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
806 * list.
807 */
808 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
809
810 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
811
812 private static final String JID_RESOURCE_PREFIX = "android";
813
814 public static final String AUTHORITY = "settings";
815
816 private static final String TAG = "Settings";
817 private static final boolean LOCAL_LOGV = false;
818
819 // Lock ensures that when enabling/disabling the master location switch, we don't end up
820 // with a partial enable/disable state in multi-threaded situations.
821 private static final Object mLocationSettingsLock = new Object();
822
823 public static class SettingNotFoundException extends AndroidException {
824 public SettingNotFoundException(String msg) {
825 super(msg);
826 }
827 }
828
829 /**
830 * Common base for tables of name/value settings.
831 */
832 public static class NameValueTable implements BaseColumns {
833 public static final String NAME = "name";
834 public static final String VALUE = "value";
835
836 protected static boolean putString(ContentResolver resolver, Uri uri,
837 String name, String value) {
838 // The database will take care of replacing duplicates.
839 try {
840 ContentValues values = new ContentValues();
841 values.put(NAME, name);
842 values.put(VALUE, value);
843 resolver.insert(uri, values);
844 return true;
845 } catch (SQLException e) {
846 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
847 return false;
848 }
849 }
850
851 public static Uri getUriFor(Uri uri, String name) {
852 return Uri.withAppendedPath(uri, name);
853 }
854 }
855
856 // Thread-safe.
857 private static class NameValueCache {
858 private final String mVersionSystemProperty;
859 private final Uri mUri;
860
861 private static final String[] SELECT_VALUE =
862 new String[] { Settings.NameValueTable.VALUE };
863 private static final String NAME_EQ_PLACEHOLDER = "name=?";
864
865 // Must synchronize on 'this' to access mValues and mValuesVersion.
866 private final HashMap<String, String> mValues = new HashMap<String, String>();
867 private long mValuesVersion = 0;
868
869 // Initially null; set lazily and held forever. Synchronized on 'this'.
870 private IContentProvider mContentProvider = null;
871
872 // The method we'll call (or null, to not use) on the provider
873 // for the fast path of retrieving settings.
874 private final String mCallGetCommand;
875 private final String mCallSetCommand;
876
877 public NameValueCache(String versionSystemProperty, Uri uri,
878 String getCommand, String setCommand) {
879 mVersionSystemProperty = versionSystemProperty;
880 mUri = uri;
881 mCallGetCommand = getCommand;
882 mCallSetCommand = setCommand;
883 }
884
885 private IContentProvider lazyGetProvider(ContentResolver cr) {
886 IContentProvider cp = null;
887 synchronized (this) {
888 cp = mContentProvider;
889 if (cp == null) {
890 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
891 }
892 }
893 return cp;
894 }
895
896 public boolean putStringForUser(ContentResolver cr, String name, String value,
897 final int userHandle) {
898 try {
899 Bundle arg = new Bundle();
900 arg.putString(Settings.NameValueTable.VALUE, value);
901 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
902 IContentProvider cp = lazyGetProvider(cr);
903 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
904 } catch (RemoteException e) {
905 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
906 return false;
907 }
908 return true;
909 }
910
911 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
912 final boolean isSelf = (userHandle == UserHandle.myUserId());
913 if (isSelf) {
914 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
915
916 // Our own user's settings data uses a client-side cache
917 synchronized (this) {
918 if (mValuesVersion != newValuesVersion) {
919 if (LOCAL_LOGV || false) {
920 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current "
921 + newValuesVersion + " != cached " + mValuesVersion);
922 }
923
924 mValues.clear();
925 mValuesVersion = newValuesVersion;
926 }
927
928 if (mValues.containsKey(name)) {
929 return mValues.get(name); // Could be null, that's OK -- negative caching
930 }
931 }
932 } else {
933 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
934 + " by user " + UserHandle.myUserId() + " so skipping cache");
935 }
936
937 IContentProvider cp = lazyGetProvider(cr);
938
939 // Try the fast path first, not using query(). If this
940 // fails (alternate Settings provider that doesn't support
941 // this interface?) then we fall back to the query/table
942 // interface.
943 if (mCallGetCommand != null) {
944 try {
945 Bundle args = null;
946 if (!isSelf) {
947 args = new Bundle();
948 args.putInt(CALL_METHOD_USER_KEY, userHandle);
949 }
950 Bundle b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
951 if (b != null) {
952 String value = b.getPairValue();
953 // Don't update our cache for reads of other users' data
954 if (isSelf) {
955 synchronized (this) {
956 mValues.put(name, value);
957 }
958 } else {
959 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
960 + " by " + UserHandle.myUserId()
961 + " so not updating cache");
962 }
963 return value;
964 }
965 // If the response Bundle is null, we fall through
966 // to the query interface below.
967 } catch (RemoteException e) {
968 // Not supported by the remote side? Fall through
969 // to query().
970 }
971 }
972
973 Cursor c = null;
974 try {
975 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
976 new String[]{name}, null, null);
977 if (c == null) {
978 Log.w(TAG, "Can't get key " + name + " from " + mUri);
979 return null;
980 }
981
982 String value = c.moveToNext() ? c.getString(0) : null;
983 synchronized (this) {
984 mValues.put(name, value);
985 }
986 if (LOCAL_LOGV) {
987 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
988 name + " = " + (value == null ? "(null)" : value));
989 }
990 return value;
991 } catch (RemoteException e) {
992 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
993 return null; // Return null, but don't cache it.
994 } finally {
995 if (c != null) c.close();
996 }
997 }
998 }
999
1000 /**
1001 * System settings, containing miscellaneous system preferences. This
1002 * table holds simple name/value pairs. There are convenience
1003 * functions for accessing individual settings entries.
1004 */
1005 public static final class System extends NameValueTable {
1006 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
1007
1008 /**
1009 * The content:// style URL for this table
1010 */
1011 public static final Uri CONTENT_URI =
1012 Uri.parse("content://" + AUTHORITY + "/system");
1013
1014 private static final NameValueCache sNameValueCache = new NameValueCache(
1015 SYS_PROP_SETTING_VERSION,
1016 CONTENT_URI,
1017 CALL_METHOD_GET_SYSTEM,
1018 CALL_METHOD_PUT_SYSTEM);
1019
1020 private static final HashSet<String> MOVED_TO_SECURE;
1021 static {
1022 MOVED_TO_SECURE = new HashSet<String>(30);
1023 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
1024 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
1025 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
1026 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
1027 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
1028 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
1029 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
1030 MOVED_TO_SECURE.add(Secure.LOCK_NUMPAD_RANDOM);
1031 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
1032 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
1033 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
1034 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
1035 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
1036 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
1037 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
1038 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
1039 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
1040 MOVED_TO_SECURE.add(Secure.WIFI_ON);
1041 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
1042 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
1043 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
1044 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
1045 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
1046 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
1047 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
1048 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
1049 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
1050 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
1051 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
1052 }
1053
1054 private static final HashSet<String> MOVED_TO_GLOBAL;
1055 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
1056 static {
1057 MOVED_TO_GLOBAL = new HashSet<String>();
1058 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
1059
1060 // these were originally in system but migrated to secure in the past,
1061 // so are duplicated in the Secure.* namespace
1062 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
1063 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
1064 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
1065 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
1066 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.INSTALL_NON_MARKET_APPS);
1067 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
1068 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
1069
1070 // these are moving directly from system to global
1071 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
1072 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
1073 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
1074 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
1075 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
1076 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
1077 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
1078 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
1079 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
1080 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
1081 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
1082 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
1083 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
1084 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
1085 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
1086 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
1087 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
1088 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
1089 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
1090 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
1091 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
1092 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
1093 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
1094 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
1095 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
1096 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
1097 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
1098 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
1099 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
1100 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
1101 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
1102 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
1103 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
1104 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
1105 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
1106 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
1107 }
1108
1109 /** @hide */
1110 public static void getMovedKeys(HashSet<String> outKeySet) {
1111 outKeySet.addAll(MOVED_TO_GLOBAL);
1112 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
1113 }
1114
1115 /** @hide */
1116 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
1117 outKeySet.addAll(MOVED_TO_GLOBAL);
1118 }
1119
1120 /**
1121 * Look up a name in the database.
1122 * @param resolver to access the database with
1123 * @param name to look up in the table
1124 * @return the corresponding value, or null if not present
1125 */
1126 public static String getString(ContentResolver resolver, String name) {
1127 return getStringForUser(resolver, name, UserHandle.myUserId());
1128 }
1129
1130 /** @hide */
1131 public static String getStringForUser(ContentResolver resolver, String name,
1132 int userHandle) {
1133 if (MOVED_TO_SECURE.contains(name)) {
1134 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1135 + " to android.provider.Settings.Secure, returning read-only value.");
1136 return Secure.getStringForUser(resolver, name, userHandle);
1137 }
1138 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
1139 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1140 + " to android.provider.Settings.Global, returning read-only value.");
1141 return Global.getStringForUser(resolver, name, userHandle);
1142 }
1143 return sNameValueCache.getStringForUser(resolver, name, userHandle);
1144 }
1145
1146 /**
1147 * Store a name/value pair into the database.
1148 * @param resolver to access the database with
1149 * @param name to store
1150 * @param value to associate with the name
1151 * @return true if the value was set, false on database errors
1152 */
1153 public static boolean putString(ContentResolver resolver, String name, String value) {
1154 return putStringForUser(resolver, name, value, UserHandle.myUserId());
1155 }
1156
1157 /** @hide */
1158 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
1159 int userHandle) {
1160 if (MOVED_TO_SECURE.contains(name)) {
1161 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1162 + " to android.provider.Settings.Secure, value is unchanged.");
1163 return false;
1164 }
1165 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
1166 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1167 + " to android.provider.Settings.Global, value is unchanged.");
1168 return false;
1169 }
1170 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
1171 }
1172
1173 /**
1174 * Construct the content URI for a particular name/value pair,
1175 * useful for monitoring changes with a ContentObserver.
1176 * @param name to look up in the table
1177 * @return the corresponding content URI, or null if not present
1178 */
1179 public static Uri getUriFor(String name) {
1180 if (MOVED_TO_SECURE.contains(name)) {
1181 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1182 + " to android.provider.Settings.Secure, returning Secure URI.");
1183 return Secure.getUriFor(Secure.CONTENT_URI, name);
1184 }
1185 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
1186 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1187 + " to android.provider.Settings.Global, returning read-only global URI.");
1188 return Global.getUriFor(Global.CONTENT_URI, name);
1189 }
1190 return getUriFor(CONTENT_URI, name);
1191 }
1192
1193 /**
1194 * Convenience function for retrieving a single system settings value
1195 * as an integer. Note that internally setting values are always
1196 * stored as strings; this function converts the string to an integer
1197 * for you. The default value will be returned if the setting is
1198 * not defined or not an integer.
1199 *
1200 * @param cr The ContentResolver to access.
1201 * @param name The name of the setting to retrieve.
1202 * @param def Value to return if the setting is not defined.
1203 *
1204 * @return The setting's current value, or 'def' if it is not defined
1205 * or not a valid integer.
1206 */
1207 public static int getInt(ContentResolver cr, String name, int def) {
1208 return getIntForUser(cr, name, def, UserHandle.myUserId());
1209 }
1210
1211 /** @hide */
1212 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
1213 String v = getStringForUser(cr, name, userHandle);
1214 try {
1215 return v != null ? Integer.parseInt(v) : def;
1216 } catch (NumberFormatException e) {
1217 return def;
1218 }
1219 }
1220
1221 /**
1222 * Convenience function for retrieving a single system settings value
1223 * as an integer. Note that internally setting values are always
1224 * stored as strings; this function converts the string to an integer
1225 * for you.
1226 * <p>
1227 * This version does not take a default value. If the setting has not
1228 * been set, or the string value is not a number,
1229 * it throws {@link SettingNotFoundException}.
1230 *
1231 * @param cr The ContentResolver to access.
1232 * @param name The name of the setting to retrieve.
1233 *
1234 * @throws SettingNotFoundException Thrown if a setting by the given
1235 * name can't be found or the setting value is not an integer.
1236 *
1237 * @return The setting's current value.
1238 */
1239 public static int getInt(ContentResolver cr, String name)
1240 throws SettingNotFoundException {
1241 return getIntForUser(cr, name, UserHandle.myUserId());
1242 }
1243
1244 /** @hide */
1245 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
1246 throws SettingNotFoundException {
1247 String v = getStringForUser(cr, name, userHandle);
1248 try {
1249 return Integer.parseInt(v);
1250 } catch (NumberFormatException e) {
1251 throw new SettingNotFoundException(name);
1252 }
1253 }
1254
1255 /**
1256 * Convenience function for updating a single settings value as an
1257 * integer. This will either create a new entry in the table if the
1258 * given name does not exist, or modify the value of the existing row
1259 * with that name. Note that internally setting values are always
1260 * stored as strings, so this function converts the given value to a
1261 * string before storing it.
1262 *
1263 * @param cr The ContentResolver to access.
1264 * @param name The name of the setting to modify.
1265 * @param value The new value for the setting.
1266 * @return true if the value was set, false on database errors
1267 */
1268 public static boolean putInt(ContentResolver cr, String name, int value) {
1269 return putIntForUser(cr, name, value, UserHandle.myUserId());
1270 }
1271
1272 /** @hide */
1273 public static boolean putIntForUser(ContentResolver cr, String name, int value,
1274 int userHandle) {
1275 return putStringForUser(cr, name, Integer.toString(value), userHandle);
1276 }
1277
1278 /**
1279 * Convenience function for retrieving a single system settings value
1280 * as a {@code long}. Note that internally setting values are always
1281 * stored as strings; this function converts the string to a {@code long}
1282 * for you. The default value will be returned if the setting is
1283 * not defined or not a {@code long}.
1284 *
1285 * @param cr The ContentResolver to access.
1286 * @param name The name of the setting to retrieve.
1287 * @param def Value to return if the setting is not defined.
1288 *
1289 * @return The setting's current value, or 'def' if it is not defined
1290 * or not a valid {@code long}.
1291 */
1292 public static long getLong(ContentResolver cr, String name, long def) {
1293 return getLongForUser(cr, name, def, UserHandle.myUserId());
1294 }
1295
1296 /** @hide */
1297 public static long getLongForUser(ContentResolver cr, String name, long def,
1298 int userHandle) {
1299 String valString = getStringForUser(cr, name, userHandle);
1300 long value;
1301 try {
1302 value = valString != null ? Long.parseLong(valString) : def;
1303 } catch (NumberFormatException e) {
1304 value = def;
1305 }
1306 return value;
1307 }
1308
1309 /**
1310 * Convenience function for retrieving a single system settings value
1311 * as a {@code long}. Note that internally setting values are always
1312 * stored as strings; this function converts the string to a {@code long}
1313 * for you.
1314 * <p>
1315 * This version does not take a default value. If the setting has not
1316 * been set, or the string value is not a number,
1317 * it throws {@link SettingNotFoundException}.
1318 *
1319 * @param cr The ContentResolver to access.
1320 * @param name The name of the setting to retrieve.
1321 *
1322 * @return The setting's current value.
1323 * @throws SettingNotFoundException Thrown if a setting by the given
1324 * name can't be found or the setting value is not an integer.
1325 */
1326 public static long getLong(ContentResolver cr, String name)
1327 throws SettingNotFoundException {
1328 return getLongForUser(cr, name, UserHandle.myUserId());
1329 }
1330
1331 /** @hide */
1332 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
1333 throws SettingNotFoundException {
1334 String valString = getStringForUser(cr, name, userHandle);
1335 try {
1336 return Long.parseLong(valString);
1337 } catch (NumberFormatException e) {
1338 throw new SettingNotFoundException(name);
1339 }
1340 }
1341
1342 /**
1343 * Convenience function for updating a single settings value as a long
1344 * integer. This will either create a new entry in the table if the
1345 * given name does not exist, or modify the value of the existing row
1346 * with that name. Note that internally setting values are always
1347 * stored as strings, so this function converts the given value to a
1348 * string before storing it.
1349 *
1350 * @param cr The ContentResolver to access.
1351 * @param name The name of the setting to modify.
1352 * @param value The new value for the setting.
1353 * @return true if the value was set, false on database errors
1354 */
1355 public static boolean putLong(ContentResolver cr, String name, long value) {
1356 return putLongForUser(cr, name, value, UserHandle.myUserId());
1357 }
1358
1359 /** @hide */
1360 public static boolean putLongForUser(ContentResolver cr, String name, long value,
1361 int userHandle) {
1362 return putStringForUser(cr, name, Long.toString(value), userHandle);
1363 }
1364
1365 /**
1366 * Convenience function for retrieving a single system settings value
1367 * as a floating point number. Note that internally setting values are
1368 * always stored as strings; this function converts the string to an
1369 * float for you. The default value will be returned if the setting
1370 * is not defined or not a valid float.
1371 *
1372 * @param cr The ContentResolver to access.
1373 * @param name The name of the setting to retrieve.
1374 * @param def Value to return if the setting is not defined.
1375 *
1376 * @return The setting's current value, or 'def' if it is not defined
1377 * or not a valid float.
1378 */
1379 public static float getFloat(ContentResolver cr, String name, float def) {
1380 return getFloatForUser(cr, name, def, UserHandle.myUserId());
1381 }
1382
1383 /** @hide */
1384 public static float getFloatForUser(ContentResolver cr, String name, float def,
1385 int userHandle) {
1386 String v = getStringForUser(cr, name, userHandle);
1387 try {
1388 return v != null ? Float.parseFloat(v) : def;
1389 } catch (NumberFormatException e) {
1390 return def;
1391 }
1392 }
1393
1394 /**
1395 * Convenience function for retrieving a single system settings value
1396 * as a float. Note that internally setting values are always
1397 * stored as strings; this function converts the string to a float
1398 * for you.
1399 * <p>
1400 * This version does not take a default value. If the setting has not
1401 * been set, or the string value is not a number,
1402 * it throws {@link SettingNotFoundException}.
1403 *
1404 * @param cr The ContentResolver to access.
1405 * @param name The name of the setting to retrieve.
1406 *
1407 * @throws SettingNotFoundException Thrown if a setting by the given
1408 * name can't be found or the setting value is not a float.
1409 *
1410 * @return The setting's current value.
1411 */
1412 public static float getFloat(ContentResolver cr, String name)
1413 throws SettingNotFoundException {
1414 return getFloatForUser(cr, name, UserHandle.myUserId());
1415 }
1416
1417 /** @hide */
1418 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
1419 throws SettingNotFoundException {
1420 String v = getStringForUser(cr, name, userHandle);
1421 if (v == null) {
1422 throw new SettingNotFoundException(name);
1423 }
1424 try {
1425 return Float.parseFloat(v);
1426 } catch (NumberFormatException e) {
1427 throw new SettingNotFoundException(name);
1428 }
1429 }
1430
1431 /**
1432 * Convenience function for updating a single settings value as a
1433 * floating point number. This will either create a new entry in the
1434 * table if the given name does not exist, or modify the value of the
1435 * existing row with that name. Note that internally setting values
1436 * are always stored as strings, so this function converts the given
1437 * value to a string before storing it.
1438 *
1439 * @param cr The ContentResolver to access.
1440 * @param name The name of the setting to modify.
1441 * @param value The new value for the setting.
1442 * @return true if the value was set, false on database errors
1443 */
1444 public static boolean putFloat(ContentResolver cr, String name, float value) {
1445 return putFloatForUser(cr, name, value, UserHandle.myUserId());
1446 }
1447
1448 /** @hide */
1449 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
1450 int userHandle) {
1451 return putStringForUser(cr, name, Float.toString(value), userHandle);
1452 }
1453
1454 /**
1455 * Convenience function to read all of the current
1456 * configuration-related settings into a
1457 * {@link Configuration} object.
1458 *
1459 * @param cr The ContentResolver to access.
1460 * @param outConfig Where to place the configuration settings.
1461 */
1462 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
1463 getConfigurationForUser(cr, outConfig, UserHandle.myUserId());
1464 }
1465
1466 /** @hide */
1467 public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig,
1468 int userHandle) {
1469 outConfig.fontScale = Settings.System.getFloatForUser(
1470 cr, FONT_SCALE, outConfig.fontScale, userHandle);
1471 if (outConfig.fontScale < 0) {
1472 outConfig.fontScale = 1;
1473 }
1474 }
1475
1476 /**
1477 * @hide Erase the fields in the Configuration that should be applied
1478 * by the settings.
1479 */
1480 public static void clearConfiguration(Configuration inoutConfig) {
1481 inoutConfig.fontScale = 0;
1482 }
1483
1484 /**
1485 * Convenience function to write a batch of configuration-related
1486 * settings from a {@link Configuration} object.
1487 *
1488 * @param cr The ContentResolver to access.
1489 * @param config The settings to write.
1490 * @return true if the values were set, false on database errors
1491 */
1492 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
1493 return putConfigurationForUser(cr, config, UserHandle.myUserId());
1494 }
1495
1496 /** @hide */
1497 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
1498 int userHandle) {
1499 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle);
1500 }
1501
1502 /** @hide */
1503 public static boolean hasInterestingConfigurationChanges(int changes) {
1504 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1505 }
1506
1507 /** @deprecated - Do not use */
1508 @Deprecated
1509 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
1510 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
1511 }
1512
1513 /**
1514 * @hide
1515 * @deprecated - Do not use
1516 */
1517 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
1518 int userHandle) {
1519 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
1520 }
1521
1522 /** @deprecated - Do not use */
1523 @Deprecated
1524 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
1525 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
1526 }
1527
1528 /**
1529 * @hide
1530 * @deprecated - Do not use
1531 */
1532 @Deprecated
1533 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
1534 int userHandle) {
1535 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
1536 }
1537
1538 /**
1539 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
1540 */
1541 @Deprecated
1542 public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN;
1543
1544 /**
1545 * What happens when the user presses the end call button if they're not
1546 * on a call.<br/>
1547 * <b>Values:</b><br/>
1548 * 0 - The end button does nothing.<br/>
1549 * 1 - The end button goes to the home screen.<br/>
1550 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1551 * 3 - The end button goes to the home screen. If the user is already on the
1552 * home screen, it puts the device to sleep.
1553 */
1554 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1555
1556 /**
1557 * END_BUTTON_BEHAVIOR value for "go home".
1558 * @hide
1559 */
1560 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1561
1562 /**
1563 * END_BUTTON_BEHAVIOR value for "go to sleep".
1564 * @hide
1565 */
1566 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
1567
1568 /**
1569 * END_BUTTON_BEHAVIOR default value.
1570 * @hide
1571 */
1572 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
1573
1574 /**
1575 * Is advanced settings mode turned on. 0 == no, 1 == yes
1576 * @hide
1577 */
1578 public static final String ADVANCED_SETTINGS = "advanced_settings";
1579
1580 /**
1581 * ADVANCED_SETTINGS default value.
1582 * @hide
1583 */
1584 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
1585
1586 /**
1587 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
1588 */
1589 @Deprecated
1590 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
1591
1592 /**
1593 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
1594 */
1595 @Deprecated
1596 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
1597
1598 /**
1599 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
1600 */
1601 @Deprecated
1602 public static final String RADIO_WIFI = Global.RADIO_WIFI;
1603
1604 /**
1605 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
1606 * {@hide}
1607 */
1608 @Deprecated
1609 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
1610
1611 /**
1612 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
1613 */
1614 @Deprecated
1615 public static final String RADIO_CELL = Global.RADIO_CELL;
1616
1617 /**
1618 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
1619 */
1620 @Deprecated
1621 public static final String RADIO_NFC = Global.RADIO_NFC;
1622
1623 /**
1624 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
1625 */
1626 @Deprecated
1627 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
1628
1629 /**
1630 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
1631 *
1632 * {@hide}
1633 */
1634 @Deprecated
1635 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
1636 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
1637
1638 /**
1639 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
1640 */
1641 @Deprecated
1642 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
1643
1644 /**
1645 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
1646 */
1647 @Deprecated
1648 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
1649
1650 /**
1651 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
1652 */
1653 @Deprecated
1654 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
1655 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
1656
1657 /**
1658 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
1659 */
1660 @Deprecated
1661 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
1662
1663 /**
1664 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
1665 */
1666 @Deprecated
1667 public static final String MODE_RINGER = Global.MODE_RINGER;
1668
1669 /**
1670 * Whether to use static IP and other static network attributes.
1671 * <p>
1672 * Set to 1 for true and 0 for false.
1673 *
1674 * @deprecated Use {@link WifiManager} instead
1675 */
1676 @Deprecated
1677 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
1678
1679 /**
1680 * The static IP address.
1681 * <p>
1682 * Example: "192.168.1.51"
1683 *
1684 * @deprecated Use {@link WifiManager} instead
1685 */
1686 @Deprecated
1687 public static final String WIFI_STATIC_IP = "wifi_static_ip";
1688
1689 /**
1690 * If using static IP, the gateway's IP address.
1691 * <p>
1692 * Example: "192.168.1.1"
1693 *
1694 * @deprecated Use {@link WifiManager} instead
1695 */
1696 @Deprecated
1697 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
1698
1699 /**
1700 * If using static IP, the net mask.
1701 * <p>
1702 * Example: "255.255.255.0"
1703 *
1704 * @deprecated Use {@link WifiManager} instead
1705 */
1706 @Deprecated
1707 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
1708
1709 /**
1710 * If using static IP, the primary DNS's IP address.
1711 * <p>
1712 * Example: "192.168.1.1"
1713 *
1714 * @deprecated Use {@link WifiManager} instead
1715 */
1716 @Deprecated
1717 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
1718
1719 /**
1720 * If using static IP, the secondary DNS's IP address.
1721 * <p>
1722 * Example: "192.168.1.2"
1723 *
1724 * @deprecated Use {@link WifiManager} instead
1725 */
1726 @Deprecated
1727 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
1728
1729 /**
1730 * Allows automatic retrieval of mms contents
1731 * <p>Type: INT</p>
1732 * 0 -- false
1733 * 1 -- true
1734 * @hide
1735 */
1736 public static final String MMS_AUTO_RETRIEVAL = "mms_auto_retrieval";
1737
1738 /**
1739 * Allows automatic retrieval of mms contents during roaming
1740 * <p>Type: INT</p>
1741 * 0 -- false
1742 * 1 -- true
1743 * @hide
1744 */
1745 public static final String MMS_AUTO_RETRIEVAL_ON_ROAMING = "mms_auto_on_roaming";
1746
1747 /**
1748 * Determines whether remote devices may discover and/or connect to
1749 * this device.
1750 * <P>Type: INT</P>
1751 * 2 -- discoverable and connectable
1752 * 1 -- connectable but not discoverable
1753 * 0 -- neither connectable nor discoverable
1754 */
1755 public static final String BLUETOOTH_DISCOVERABILITY =
1756 "bluetooth_discoverability";
1757
1758 /**
1759 * Bluetooth discoverability timeout. If this value is nonzero, then
1760 * Bluetooth becomes discoverable for a certain number of seconds,
1761 * after which is becomes simply connectable. The value is in seconds.
1762 */
1763 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
1764 "bluetooth_discoverability_timeout";
1765
1766 /**
1767 * If all file types can be accepted over Bluetooth OBEX.
1768 * @hide
1769 */
1770 public static final String BLUETOOTH_ACCEPT_ALL_FILES =
1771 "bluetooth_accept_all_files";
1772
1773 /**
1774 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
1775 * instead
1776 */
1777 @Deprecated
1778 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
1779
1780 /**
1781 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
1782 * instead
1783 */
1784 @Deprecated
1785 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
1786
1787 /**
1788 * @deprecated Use
1789 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
1790 * instead
1791 */
1792 @Deprecated
1793 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
1794 "lock_pattern_tactile_feedback_enabled";
1795
1796
1797 /**
1798 * A formatted string of the next alarm that is set, or the empty string
1799 * if there is no alarm set.
1800 */
1801 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
1802
1803 /**
1804 * Scaling factor for fonts, float.
1805 */
1806 public static final String FONT_SCALE = "font_scale";
1807
1808 /**
1809 * Name of an application package to be debugged.
1810 *
1811 * @deprecated Use {@link Global#DEBUG_APP} instead
1812 */
1813 @Deprecated
1814 public static final String DEBUG_APP = Global.DEBUG_APP;
1815
1816 /**
1817 * If 1, when launching DEBUG_APP it will wait for the debugger before
1818 * starting user code. If 0, it will run normally.
1819 *
1820 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
1821 */
1822 @Deprecated
1823 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
1824
1825 /**
1826 * Whether or not to dim the screen. 0=no 1=yes
1827 * @deprecated This setting is no longer used.
1828 */
1829 @Deprecated
1830 public static final String DIM_SCREEN = "dim_screen";
1831
1832 /**
1833 * The timeout before the screen turns off.
1834 */
1835 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
1836
1837 /**
1838 * The screen backlight brightness between 0 and 255.
1839 */
1840 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
1841
1842 /**
1843 * Control whether to enable automatic brightness mode.
1844 */
1845 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
1846
1847 /**
1848 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
1849 * or less (<0.0 >-1.0) bright.
1850 * @hide
1851 */
1852 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
1853
1854 /**
1855 * SCREEN_BRIGHTNESS_MODE value for manual mode.
1856 */
1857 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
1858
1859 /**
1860 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
1861 */
1862 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
1863
1864 /**
1865 * Custom automatic brightness light sensor levels.
1866 * The value is a comma separated int array with length N.
1867 * Example: "100,300,3000".
1868 *
1869 * @hide
1870 */
1871 public static final String AUTO_BRIGHTNESS_LUX = "auto_brightness_lux";
1872
1873 /**
1874 * Custom automatic brightness display backlight brightness values.
1875 * The value is a comma separated int array with length N+1.
1876 * Example: "10,50,100,255".
1877 *
1878 * @hide
1879 */
1880 public static final String AUTO_BRIGHTNESS_SCREEN_BACKLIGHT = "auto_brightness_screen_backlight";
1881
1882 /**
1883 * Custom automatic brightness display backlight brightness values.
1884 * The value is a comma separated int array with length N+1.
1885 * Example: "10,50,100,255".
1886 *
1887 * @hide
1888 */
1889 public static final String AUTO_BRIGHTNESS_BUTTON_BACKLIGHT = "auto_brightness_button_backlight";
1890
1891 /**
1892 * Correction factor for auto-brightness adjustment light sensor
1893 * debounce times.
1894 * Smaller factors will make the adjustment more responsive, but might
1895 * cause flicker and/or cause higher CPU usage.
1896 * Valid range is 0.2 ... 3
1897 *
1898 * @hide
1899 */
1900 public static final String AUTO_BRIGHTNESS_RESPONSIVENESS = "auto_brightness_responsiveness";
1901
1902 /**
1903 * Custom button brightness value for manual mode
1904 *
1905 * @hide
1906 */
1907 public static final String CUSTOM_BUTTON_BRIGHTNESS = "custom_button_brightness";
1908
1909 /**
1910 * use same value for buttons as for screen (manual and auto mode)
1911 *
1912 * @hide
1913 */
1914 public static final String CUSTOM_BUTTON_USE_SCREEN_BRIGHTNESS = "custom_button_use_screen_brightness";
1915
1916 /**
1917 * disable all button brightness (manual and auto mode)
1918 *
1919 * @hide
1920 */
1921 public static final String CUSTOM_BUTTON_DISABLE_BRIGHTNESS = "custom_button_use_disable_brightness";
1922
1923 /**
1924 * Whether to enable adjustment of automatic brightness adjustment
1925 * to sunrise and sunset.
1926 * @hide
1927 */
1928 public static final String AUTO_BRIGHTNESS_TWILIGHT_ADJUSTMENT = "auto_brightness_twilight_adjustment";
1929
1930 /**
1931 * Timeout value for button lights. 0 = disabled
1932 * @hide
1933 */
1934 public static final String BUTTON_BACKLIGHT_TIMEOUT = "button_backlight_timeout";
1935
1936 /**
1937 * Control whether the process CPU usage meter should be shown.
1938 *
1939 * @deprecated Use {@link Global#SHOW_PROCESSES} instead
1940 */
1941 @Deprecated
1942 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
1943
1944 /**
1945 * If 1, the activity manager will aggressively finish activities and
1946 * processes as soon as they are no longer needed. If 0, the normal
1947 * extended lifetime is used.
1948 *
1949 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
1950 */
1951 @Deprecated
1952 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
1953
1954 /**
1955 * Determines which streams are affected by ringer mode changes. The
1956 * stream type's bit should be set to 1 if it should be muted when going
1957 * into an inaudible ringer mode.
1958 */
1959 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
1960
1961 /**
1962 * Determines which streams are affected by mute. The
1963 * stream type's bit should be set to 1 if it should be muted when a mute request
1964 * is received.
1965 */
1966 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
1967
1968 /**
1969 * Whether vibrate is on for different events. This is used internally,
1970 * changing this value will not change the vibrate. See AudioManager.
1971 */
1972 public static final String VIBRATE_ON = "vibrate_on";
1973
1974 /**
1975 * If 1, redirects the system vibrator to all currently attached input devices
1976 * that support vibration. If there are no such input devices, then the system
1977 * vibrator is used instead.
1978 * If 0, does not register the system vibrator.
1979 *
1980 * This setting is mainly intended to provide a compatibility mechanism for
1981 * applications that only know about the system vibrator and do not use the
1982 * input device vibrator API.
1983 *
1984 * @hide
1985 */
1986 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
1987
1988 /**
1989 * Empty volume.
1990 * @hide
1991 */
1992 public static final String VOLUME_DEFAULT = "volume_default";
1993
1994 /**
1995 * Ringer volume. This is used internally, changing this value will not
1996 * change the volume. See AudioManager.
1997 */
1998 public static final String VOLUME_RING = "volume_ring";
1999
2000 /**
2001 * System/notifications volume. This is used internally, changing this
2002 * value will not change the volume. See AudioManager.
2003 */
2004 public static final String VOLUME_SYSTEM = "volume_system";
2005
2006 /**
2007 * Voice call volume. This is used internally, changing this value will
2008 * not change the volume. See AudioManager.
2009 */
2010 public static final String VOLUME_VOICE = "volume_voice";
2011
2012 /**
2013 * Music/media/gaming volume. This is used internally, changing this
2014 * value will not change the volume. See AudioManager.
2015 */
2016 public static final String VOLUME_MUSIC = "volume_music";
2017
2018 /**
2019 * Alarm volume. This is used internally, changing this
2020 * value will not change the volume. See AudioManager.
2021 */
2022 public static final String VOLUME_ALARM = "volume_alarm";
2023
2024 /**
2025 * Notification volume. This is used internally, changing this
2026 * value will not change the volume. See AudioManager.
2027 */
2028 public static final String VOLUME_NOTIFICATION = "volume_notification";
2029
2030 /**
2031 * Bluetooth Headset volume. This is used internally, changing this value will
2032 * not change the volume. See AudioManager.
2033 */
2034 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
2035
2036 /**
2037 * Master volume (float in the range 0.0f to 1.0f).
2038 * @hide
2039 */
2040 public static final String VOLUME_MASTER = "volume_master";
2041
2042 /**
2043 * Master volume mute (int 1 = mute, 0 = not muted).
2044 *
2045 * @hide
2046 */
2047 public static final String VOLUME_MASTER_MUTE = "volume_master_mute";
2048
2049 /**
2050 * Whether the notifications should use the ring volume (value of 1) or
2051 * a separate notification volume (value of 0). In most cases, users
2052 * will have this enabled so the notification and ringer volumes will be
2053 * the same. However, power users can disable this and use the separate
2054 * notification volume control.
2055 * <p>
2056 * Note: This is a one-off setting that will be removed in the future
2057 * when there is profile support. For this reason, it is kept hidden
2058 * from the public APIs.
2059 *
2060 * @hide
2061 * @deprecated
2062 */
2063 @Deprecated
2064 public static final String NOTIFICATIONS_USE_RING_VOLUME =
2065 "notifications_use_ring_volume";
2066
2067 /**
2068 * Whether the blacklisting feature for phone calls is enabled
2069 * @hide
2070 */
2071 public static final String PHONE_BLACKLIST_ENABLED = "phone_blacklist_enabled";
2072
2073 /**
2074 * Whether a notification should be shown when a call/message is blocked
2075 * @hide
2076 */
2077 public static final String PHONE_BLACKLIST_NOTIFY_ENABLED = "phone_blacklist_notify_enabled";
2078
2079 /**
2080 * Whether the blacklisting feature for phone calls from private numbers is enabled
2081 * @hide
2082 */
2083 public static final String PHONE_BLACKLIST_PRIVATE_NUMBER_MODE = "phone_blacklist_private_number_enabled";
2084
2085 /**
2086 * Whether the blacklisting feature for phone calls from unknown numbers is enabled
2087 * @hide
2088 */
2089 public static final String PHONE_BLACKLIST_UNKNOWN_NUMBER_MODE = "phone_blacklist_unknown_number_enabled";
2090
2091 /**
2092 * Constants to be used for {@link PHONE_BLACKLIST_PRIVATE_NUMBER_MODE} and
2093 * {@link PHONE_BLACKLIST_UNKNOWN_NUMBER_MODE}.
2094 * @hide
2095 */
2096 public static final int BLACKLIST_DO_NOT_BLOCK = 0;
2097
2098 /**
2099 * @hide
2100 */
2101 public static final int BLACKLIST_BLOCK = 1;
2102 /**
2103 * @hide
2104 */
2105 public static final int BLACKLIST_PHONE_SHIFT = 0;
2106 /**
2107 * @hide
2108 */
2109 public static final int BLACKLIST_MESSAGE_SHIFT = 4;
2110
2111 /**
2112 * Whether the regex blacklisting feature for phone calls is enabled
2113 * @hide
2114 */
2115 public static final String PHONE_BLACKLIST_REGEX_ENABLED = "phone_blacklist_regex_enabled";
2116
2117 /**
2118 * Volume Overlay Mode, This is behaviour of the volume overlay panel
2119 * Defaults to 1 - which is expandable
2120 * @hide
2121 */
2122 public static final String MODE_VOLUME_OVERLAY = "mode_volume_overlay";
2123
2124 /** @hide */
2125 public static final int VOLUME_OVERLAY_SINGLE = 0;
2126 /** @hide */
2127 public static final int VOLUME_OVERLAY_EXPANDABLE = 1;
2128 /** @hide */
2129 public static final int VOLUME_OVERLAY_EXPANDED = 2;
2130 /** @hide */
2131 public static final int VOLUME_OVERLAY_NONE = 3;
2132
2133 /**
2134 * Timeout for volume panel
2135 * @hide
2136 */
2137 public static final String VOLUME_PANEL_TIMEOUT = "volume_panel_timeout";
2138
2139 /**
2140 * Volume Adjust Sounds Enable, This is the noise made when using volume hard buttons
2141 * Defaults to 1 - sounds enabled
2142 * @hide
2143 */
2144 public static final String VOLUME_ADJUST_SOUNDS_ENABLED = "volume_adjust_sounds_enabled";
2145
2146 /**
2147 * Boolean value whether to link ringtone and notification volumes
2148 *
2149 * @hide
2150 */
2151 public static final String VOLUME_LINK_NOTIFICATION = "volume_link_notification";
2152
2153 /**
2154 * Whether to enable the built-in safe media volume for headsets
2155 * @hide
2156 */
2157 public static final String MANUAL_SAFE_MEDIA_VOLUME = "manual_safe_media_volume";
2158
2159 /**
2160 * Whether silent mode should allow vibration feedback. This is used
2161 * internally in AudioService and the Sound settings activity to
2162 * coordinate decoupling of vibrate and silent modes. This setting
2163 * will likely be removed in a future release with support for
2164 * audio/vibe feedback profiles.
2165 *
2166 * Not used anymore. On devices with vibrator, the user explicitly selects
2167 * silent or vibrate mode.
2168 * Kept for use by legacy database upgrade code in DatabaseHelper.
2169 * @hide
2170 */
2171 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
2172
2173 /**
2174 * The mapping of stream type (integer) to its setting.
2175 */
2176 public static final String[] VOLUME_SETTINGS = {
2177 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
2178 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
2179 };
2180
2181 /**
2182 * Appended to various volume related settings to record the previous
2183 * values before they the settings were affected by a silent/vibrate
2184 * ringer mode change.
2185 */
2186 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
2187
2188 /**
2189 * Persistent store for the system-wide default ringtone URI.
2190 * <p>
2191 * If you need to play the default ringtone at any given time, it is recommended
2192 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
2193 * to the set default ringtone at the time of playing.
2194 *
2195 * @see #DEFAULT_RINGTONE_URI
2196 */
2197 public static final String RINGTONE = "ringtone";
2198
2199 /**
2200 * A {@link Uri} that will point to the current default ringtone at any
2201 * given time.
2202 * <p>
2203 * If the current default ringtone is in the DRM provider and the caller
2204 * does not have permission, the exception will be a
2205 * FileNotFoundException.
2206 */
2207 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
2208
2209 /**
2210 * Persistent store for the system-wide default notification sound.
2211 *
2212 * @see #RINGTONE
2213 * @see #DEFAULT_NOTIFICATION_URI
2214 */
2215 public static final String NOTIFICATION_SOUND = "notification_sound";
2216
2217 /**
2218 * A {@link Uri} that will point to the current default notification
2219 * sound at any given time.
2220 *
2221 * @see #DEFAULT_RINGTONE_URI
2222 */
2223 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
2224
2225 /**
2226 * Persistent store for the system-wide default alarm alert.
2227 *
2228 * @see #RINGTONE
2229 * @see #DEFAULT_ALARM_ALERT_URI
2230 */
2231 public static final String ALARM_ALERT = "alarm_alert";
2232
2233 /**
2234 * A {@link Uri} that will point to the current default alarm alert at
2235 * any given time.
2236 *
2237 * @see #DEFAULT_ALARM_ALERT_URI
2238 */
2239 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
2240
2241 /**
2242 * Persistent store for the system default media button event receiver.
2243 *
2244 * @hide
2245 */
2246 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
2247
2248 /**
2249 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
2250 */
2251 public static final String TEXT_AUTO_REPLACE = "auto_replace";
2252
2253 /**
2254 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
2255 */
2256 public static final String TEXT_AUTO_CAPS = "auto_caps";
2257
2258 /**
2259 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
2260 * feature converts two spaces to a "." and space.
2261 */
2262 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
2263
2264 /**
2265 * Setting to showing password characters in text editors. 1 = On, 0 = Off
2266 */
2267 public static final String TEXT_SHOW_PASSWORD = "show_password";
2268
2269 public static final String SHOW_GTALK_SERVICE_STATUS =
2270 "SHOW_GTALK_SERVICE_STATUS";
2271
2272 /**
2273 * Name of activity to use for wallpaper on the home screen.
2274 *
2275 * @deprecated Use {@link WallpaperManager} instead.
2276 */
2277 @Deprecated
2278 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
2279
2280 /**
2281 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
2282 * instead
2283 */
2284 @Deprecated
2285 public static final String AUTO_TIME = Global.AUTO_TIME;
2286
2287 /**
2288 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
2289 * instead
2290 */
2291 @Deprecated
2292 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
2293
2294 /**
2295 * Display times as 12 or 24 hours
2296 * 12
2297 * 24
2298 */
2299 public static final String TIME_12_24 = "time_12_24";
2300
2301 /**
2302 * Date format string
2303 * mm/dd/yyyy
2304 * dd/mm/yyyy
2305 * yyyy/mm/dd
2306 */
2307 public static final String DATE_FORMAT = "date_format";
2308
2309 /**
2310 * Whether the setup wizard has been run before (on first boot), or if
2311 * it still needs to be run.
2312 *
2313 * nonzero = it has been run in the past
2314 * 0 = it has not been run in the past
2315 */
2316 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
2317
2318 /**
2319 * Scaling factor for normal window animations. Setting to 0 will disable window
2320 * animations.
2321 *
2322 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
2323 */
2324 @Deprecated
2325 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
2326
2327 /**
2328 * Scaling factor for activity transition animations. Setting to 0 will disable window
2329 * animations.
2330 *
2331 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
2332 */
2333 @Deprecated
2334 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
2335
2336 /**
2337 * Scaling factor for Animator-based animations. This affects both the start delay and
2338 * duration of all such animations. Setting to 0 will cause animations to end immediately.
2339 * The default value is 1.
2340 *
2341 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
2342 */
2343 @Deprecated
2344 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
2345
2346 /**
2347 * Control whether the accelerometer will be used to change screen
2348 * orientation. If 0, it will not be used unless explicitly requested
2349 * by the application; if 1, it will be used by default unless explicitly
2350 * disabled by the application.
2351 */
2352 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
2353
2354 /**
2355 * Control whether the accelerometer will be used to change lockscreen
2356 * orientation. If 0, it will not be used; if 1, it will be used by default.
2357 * @hide
2358 */
2359 public static final String LOCKSCREEN_ROTATION = "lockscreen_rotation";
2360
2361 /**
2362 * Control the type of rotation which can be performed using the accelerometer
2363 * if ACCELEROMETER_ROTATION is enabled.
2364 * Value is a bitwise combination of
2365 * 1 = 0 degrees (portrait)
2366 * 2 = 90 degrees (left)
2367 * 4 = 180 degrees (inverted portrait)
2368 * 8 = 270 degrees (right)
2369 * Setting to 0 is effectively orientation lock
2370 * @hide
2371 */
2372 public static final String ACCELEROMETER_ROTATION_ANGLES = "accelerometer_rotation_angles";
2373
2374 /**
2375 * Default screen rotation when no other policy applies.
2376 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
2377 * preference, this rotation value will be used. Must be one of the
2378 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
2379 *
2380 * @see Display#getRotation
2381 */
2382 public static final String USER_ROTATION = "user_rotation";
2383
2384 /**
2385 * Control whether the rotation lock toggle in the System UI should be hidden.
2386 * Typically this is done for accessibility purposes to make it harder for
2387 * the user to accidentally toggle the rotation lock while the display rotation
2388 * has been locked for accessibility.
2389 *
2390 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
2391 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
2392 *
2393 * @hide
2394 */
2395 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
2396 "hide_rotation_lock_toggle_for_accessibility";
2397
2398 /**
2399 * Whether the phone vibrates when it is ringing due to an incoming call. This will
2400 * be used by Phone and Setting apps; it shouldn't affect other apps.
2401 * The value is boolean (1 or 0).
2402 *
2403 * Note: this is not same as "vibrate on ring", which had been available until ICS.
2404 * It was about AudioManager's setting and thus affected all the applications which
2405 * relied on the setting, while this is purely about the vibration setting for incoming
2406 * calls.
2407 *
2408 * @hide
2409 */
2410 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
2411
2412 /**
2413 * Whether the phone ringtone should be played in an increasing manner
2414 *
2415 * @hide
2416 */
2417 public static final String INCREASING_RING = "increasing_ring";
2418
2419 /**
2420 * Increase ringtone volume each ringing interval
2421 *
2422 * @hide
2423 */
2424 public static final String INCREASING_RING_INTERVAL = "increasing_ring_interval";
2425
2426 /**
2427 * Volume level to start at for increasing ringtone
2428 *
2429 * @hide
2430 */
2431 public static final String INCREASING_RING_MIN_VOLUME = "increasing_ring_min_volume";
2432
2433 /**
2434 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
2435 * boolean (1 or 0).
2436 */
2437 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
2438
2439 /**
2440 * CDMA only settings
2441 * DTMF tone type played by the dialer when dialing.
2442 * 0 = Normal
2443 * 1 = Long
2444 * @hide
2445 */
2446 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
2447
2448 /**
2449 * Whether the hearing aid is enabled. The value is
2450 * boolean (1 or 0).
2451 * @hide
2452 */
2453 public static final String HEARING_AID = "hearing_aid";
2454
2455 /**
2456 * CDMA only settings
2457 * TTY Mode
2458 * 0 = OFF
2459 * 1 = FULL
2460 * 2 = VCO
2461 * 3 = HCO
2462 * @hide
2463 */
2464 public static final String TTY_MODE = "tty_mode";
2465
2466 /**
2467 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
2468 * boolean (1 or 0).
2469 */
2470 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
2471
2472 /**
2473 * Whether the haptic feedback (long presses, ...) are enabled. The value is
2474 * boolean (1 or 0).
2475 */
2476 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
2477
2478 /**
2479 * @deprecated Each application that shows web suggestions should have its own
2480 * setting for this.
2481 */
2482 @Deprecated
2483 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
2484
2485 /**
2486 * Whether the notification LED should repeatedly flash when a notification is
2487 * pending. The value is boolean (1 or 0).
2488 * @hide
2489 */
2490 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
2491
2492 /**
2493 * What color to use for the notification LED by default
2494 * @hide
2495 */
2496 public static final String NOTIFICATION_LIGHT_PULSE_DEFAULT_COLOR = "notification_light_pulse_default_color";
2497
2498 /**
2499 * How long to flash the notification LED by default
2500 * @hide
2501 */
2502 public static final String NOTIFICATION_LIGHT_PULSE_DEFAULT_LED_ON = "notification_light_pulse_default_led_on";
2503
2504 /**
2505 * How long to wait between flashes for the notification LED by default
2506 * @hide
2507 */
2508 public static final String NOTIFICATION_LIGHT_PULSE_DEFAULT_LED_OFF = "notification_light_pulse_default_led_off";
2509
2510 /**
2511 * What color to use for the missed call notification LED
2512 * @hide
2513 */
2514 public static final String NOTIFICATION_LIGHT_PULSE_CALL_COLOR = "notification_light_pulse_call_color";
2515
2516 /**
2517 * How long to flash the missed call notification LED
2518 * @hide
2519 */
2520 public static final String NOTIFICATION_LIGHT_PULSE_CALL_LED_ON = "notification_light_pulse_call_led_on";
2521
2522 /**
2523 * How long to wait between flashes for the missed call notification LED
2524 * @hide
2525 */
2526 public static final String NOTIFICATION_LIGHT_PULSE_CALL_LED_OFF = "notification_light_pulse_call_led_off";
2527
2528 /**
2529 * What color to use for the voicemail notification LED
2530 * @hide
2531 */
2532 public static final String NOTIFICATION_LIGHT_PULSE_VMAIL_COLOR = "notification_light_pulse_vmail_color";
2533
2534 /**
2535 * How long to flash the voicemail notification LED
2536 * @hide
2537 */
2538 public static final String NOTIFICATION_LIGHT_PULSE_VMAIL_LED_ON = "notification_light_pulse_vmail_led_on";
2539
2540 /**
2541 * How long to wait between flashes for the voicemail notification LED
2542 * @hide
2543 */
2544 public static final String NOTIFICATION_LIGHT_PULSE_VMAIL_LED_OFF = "notification_light_pulse_vmail_led_off";
2545
2546 /**
2547 * Whether to use the custom LED values for the notification pulse LED.
2548 * @hide
2549 */
2550 public static final String NOTIFICATION_LIGHT_PULSE_CUSTOM_ENABLE = "notification_light_pulse_custom_enable";
2551
2552 /**
2553 * Which custom LED values to use for the notification pulse LED.
2554 * @hide
2555 */
2556 public static final String NOTIFICATION_LIGHT_PULSE_CUSTOM_VALUES = "notification_light_pulse_custom_values";
2557
2558 /**
2559 * Whether the battery light should be enabled (if hardware supports it)
2560 * The value is boolean (1 or 0).
2561 * @hide
2562 */
2563 public static final String BATTERY_LIGHT_ENABLED = "battery_light_enabled";
2564
2565 /**
2566 * Whether the battery LED should repeatedly flash when the battery is low
2567 * on charge. The value is boolean (1 or 0).
2568 * @hide
2569 */
2570 public static final String BATTERY_LIGHT_PULSE = "battery_light_pulse";
2571
2572 /**
2573 * What color to use for the battery LED while charging - low
2574 * @hide
2575 */
2576 public static final String BATTERY_LIGHT_LOW_COLOR = "battery_light_low_color";
2577
2578 /**
2579 * What color to use for the battery LED while charging - medium
2580 * @hide
2581 */
2582 public static final String BATTERY_LIGHT_MEDIUM_COLOR = "battery_light_medium_color";
2583
2584 /**
2585 * What color to use for the battery LED while charging - full
2586 * @hide
2587 */
2588 public static final String BATTERY_LIGHT_FULL_COLOR = "battery_light_full_color";
2589
2590 /**
2591 * What color to use for the battery LED while charging - really full (100%)
2592 * @hide
2593 */
2594 public static final String BATTERY_LIGHT_REALLY_FULL_COLOR = "battery_light_really_full_color";
2595
2596 /**
2597 * Network traffic indicator, goes from least to greatest significant bitwise
2598 * 0 = Display up-stream traffic if set
2599 * 1 = Display down-stream traffic if set
2600 * 2 = Show as Byte/s if set
2601 * 16-31 = Refresh interval(ms) min: 250 max: 32750 default: 1000
2602 * @hide
2603 */
2604 public static final String NETWORK_TRAFFIC_STATE = "network_traffic_state";
2605
2606 /**
2607 * Show Screenshot in Power Menu
2608 * @hide
2609 */
2610 public static final String SCREENSHOT_IN_POWER_MENU = "screenshot_in_power_menu";
2611
2612 /**
2613 * Show ScreenRecord in Power Menu
2614 * @hide
2615 */
2616 public static final String SCREENRECORD_IN_POWER_MENU = "screenrecord_in_power_menu";
2617
2618 /**
2619 * Show AirplaneMode in Power Menu
2620 * @hide
2621 */
2622 public static final String AIRPLANE_MODE_IN_POWER_MENU = "airplane_mode_in_power_menu";
2623
2624 /**
2625 * Show SoundToggle in Power Menu
2626 * @hide
2627 */
2628 public static final String SOUND_TOGGLES_IN_POWER_MENU = "sound_toggles_in_power_menu";
2629
2630 /**
2631 * Show MobileData in Power Menu
2632 * @hide
2633 */
2634 public static final String MOBILE_DATA_IN_POWER_MENU = "mobile_data_in_power_menu";
2635
2636 /**
2637 * Sprint MWI Quirk: Show message wait indicator notifications
2638 * @hide
2639 */
2640 public static final String ENABLE_MWI_NOTIFICATION = "enable_mwi_notification";
2641
2642 /**
2643 * Show pointer location on screen?
2644 * 0 = no
2645 * 1 = yes
2646 * @hide
2647 */
2648 public static final String POINTER_LOCATION = "pointer_location";
2649
2650 /**
2651 * Show icon when stylus is used?
2652 * 0 = no
2653 * 1 = yes
2654 * @hide
2655 */
2656 public static final String STYLUS_ICON_ENABLED = "stylus_icon_enabled";
2657
2658 /**
2659 * Show touch positions on screen?
2660 * 0 = no
2661 * 1 = yes
2662 * @hide
2663 */
2664 public static final String SHOW_TOUCHES = "show_touches";
2665
2666 /**
2667 * Log raw orientation data from {@link WindowOrientationListener} for use with the
2668 * orientationplot.py tool.
2669 * 0 = no
2670 * 1 = yes
2671 * @hide
2672 */
2673 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
2674 "window_orientation_listener_log";
2675
2676 /**
2677 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
2678 * instead
2679 * @hide
2680 */
2681 @Deprecated
2682 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
2683
2684 /**
2685 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
2686 * instead
2687 * @hide
2688 */
2689 @Deprecated
2690 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
2691
2692 /**
2693 * Opens music app when headset is plugged.
2694 * @hide
2695 */
2696 public static final String HEADSET_PLUG_ENABLED = "headset_plug_enabled";
2697
2698 /**
2699 * Disable opens music app when headset is plugged.
2700 * @hide
2701 */
2702 public static final String HEADSET_PLUG_SYSTEM_DEFAULT = "SYSTEM_DEFAULT";
2703
2704 /**
2705 * If true, music app will not open if music is active.
2706 * @hide
2707 */
2708 public static final String HEADSET_PLUG_MUSIC_ACTIVE = "headset_plug_music_active";
2709
2710 /**
2711 * Actions when unplug headsets
2712 * @hide
2713 */
2714 public static final String HEADSET_PLUG_ACTIONS = "headset_plug_actions";
2715
2716 /**
2717 * Force actions when unplug headsets
2718 * @hide
2719 */
2720 public static final String HEADSET_PLUG_FORCE_ACTIONS = "headset_plug_force_actions";
2721
2722 /**
2723 * Actions if app is already running
2724 * @hide
2725 */
2726 public static final String HEADSET_PLUG_APP_RUNNING = "headset_plug_app_runnig";
2727
2728 /**
2729 * Whether to play sounds when the keyguard is shown and dismissed.
2730 * @hide
2731 */
2732 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
2733
2734 /**
2735 * Whether the lockscreen should be completely disabled.
2736 * @hide
2737 */
2738 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
2739
2740 /**
2741 * Stores values for custom lockscreen targets
2742 * @hide
2743 */
2744 public static final String LOCKSCREEN_TARGETS = "lockscreen_targets";
2745
2746 /**
2747 * Whether camera should be shown on lockscreen
2748 * @hide
2749 */
2750 public static final String LOCKSCREEN_ENABLE_CAMERA = "lockscreen_enable_camera";
2751
2752 /**
2753 * This preference enables showing the power menu on LockScreen.
2754 * @hide
2755 */
2756 public static final String LOCKSCREEN_ENABLE_POWER_MENU = "lockscreen_enable_power_menu";
2757
2758 /**
2759 * Allows to show the background activity back the lockscreen
2760 * @hide
2761 */
2762 public static final String LOCKSCREEN_SEE_THROUGH = "lockscreen_see_through";
2763
2764 /**
2765 * Allows setting the radius for blur
2766 * @hide
2767 */
2768 public static final String LOCKSCREEN_BLUR_RADIUS = "lockscreen_blur_radius";
2769
2770 /**
2771 * Whether to display notifications on screen when screen is off
2772 * @hide
2773 */
2774 public static final String ENABLE_ACTIVE_DISPLAY = "enable_active_display";
2775
2776 /**
2777 * Whether to display notification messages around ring
2778 * @hide
2779 */
2780 public static final String ACTIVE_DISPLAY_TEXT = "active_display_text";
2781
2782 /**
2783 * Time to redisplay notifications on screen from when screen turns off, 0 = never redisplay
2784 * @hide
2785 */
2786 public static final String ACTIVE_DISPLAY_REDISPLAY = "active_display_redisplay";
2787
2788 /**
2789 * Brightness of the display when displaying the active display view
2790 * @hide
2791 */
2792 public static final String ACTIVE_DISPLAY_BRIGHTNESS = "active_display_brightness";
2793
2794 /**
2795 * Display active display view when device comes out of the user's pocket, etc...
2796 * @hide
2797 */
2798 public static final String ACTIVE_DISPLAY_POCKET_MODE = "active_display_pocket_mode";
2799
2800 /**
2801 * Whether to include ongoing/non-clearable notifications
2802 * @hide
2803 */
2804 public static final String ACTIVE_DISPLAY_ALL_NOTIFICATIONS = "active_display_all_notifications";
2805
2806 /**
2807 * Whether to hide low priority notifications like those from google now
2808 * @hide
2809 */
2810 public static final String ACTIVE_DISPLAY_HIDE_LOW_PRIORITY_NOTIFICATIONS =
2811 "active_display_hide_low_priority_notifications";
2812
2813 /**
2814 * Whether to display AM/PM after time when in 12h format
2815 * @hide
2816 */
2817 public static final String ACTIVE_DISPLAY_SHOW_AMPM = "active_display_show_ampm";
2818
2819 /**
2820 * Whether to display the date above the time
2821 * @hide
2822 */
2823 public static final String ACTIVE_DISPLAY_SHOW_DATE = "active_display_show_date";
2824
2825 /**
2826 * Whether to invert the colors when in bright light
2827 * @hide
2828 */
2829 public static final String ACTIVE_DISPLAY_SUNLIGHT_MODE = "active_display_sunlight_mode";
2830
2831 /**
2832 * Whether to turn off the device when gets pocketed again and was waked up by active display
2833 * @hide
2834 */
2835 public static final String ACTIVE_DISPLAY_TURNOFF_MODE = "active_display_turnoff_mode";
2836
2837 /**
2838 * Threshold of the proximity sensor to turn on the device.
2839 * @hide
2840 */
2841 public static final String ACTIVE_DISPLAY_THRESHOLD = "active_display_threshold";
2842
2843 /**
2844 * use Active display content view instead default one.
2845 * @hide
2846 */
2847 public static final String ACTIVE_DISPLAY_CONTENT = "active_display_content";
2848
2849 /**
2850 * Timeout of the display when there is no user interaction
2851 * @hide
2852 */
2853 public static final String ACTIVE_DISPLAY_TIMEOUT = "active_display_timeout";
2854
2855 /**
2856 * A list of packages to exclude from being displayed in active display.
2857 * This should be a string of packages separated by |
2858 * @hide
2859 */
2860 public static final String ACTIVE_DISPLAY_EXCLUDED_APPS = "active_display_excluded_apps";
2861
2862 /**
2863 * A list of packages to exclude from being message displayed in active display.
2864 * This should be a string of packages separated by |
2865 * @hide
2866 */
2867 public static final String ACTIVE_DISPLAY_PRIVACY_APPS = "active_display_privacy_apps";
2868
2869 /**
2870 * allow bypass active display when lockscreen isSecure
2871 * and there is no notifications
2872 * @hide
2873 */
2874 public static final String ACTIVE_DISPLAY_BYPASS = "active_display_bypass";
2875
2876 /**
2877 * Whether to not showing active display when there is annoying notifications.
2878 * @hide
2879 */
2880 public static final String ACTIVE_DISPLAY_ANNOYING = "active_display_annoying";
2881
2882 /**
2883 * double tap every where to sleep on active display.
2884 * @hide
2885 */
2886 public static final String ACTIVE_DISPLAY_DOUBLE_TAP = "active_display_double_tap";
2887
2888 /**
2889 * shake device to show/hide active display.
2890 * @hide
2891 */
2892 public static final String ACTIVE_DISPLAY_SHAKE_EVENT = "active_display_shake_event";
2893
2894 /**
2895 * force shake device to show active display.
2896 * @hide
2897 */
2898 public static final String ACTIVE_DISPLAY_SHAKE_FORCE = "active_display_shake_force";
2899
2900 /**
2901 * shake device to show/hide active display.
2902 * @hide
2903 */
2904 public static final String ACTIVE_DISPLAY_SHAKE_QUITE_HOURS = "active_display_shake_quiet_hours";
2905
2906 /**
2907 * shake threshold active display.
2908 * @hide
2909 */
2910 public static final String ACTIVE_DISPLAY_SHAKE_THRESHOLD = "active_display_shake_threshold";
2911
2912 /**
2913 * shake timeout active display.
2914 * @hide
2915 */
2916 public static final String ACTIVE_DISPLAY_SHAKE_TIMEOUT = "active_display_shake_timeout";
2917
2918 /**
2919 * shake between interval active display.
2920 * @hide
2921 */
2922 public static final String ACTIVE_DISPLAY_SHAKE_LONGTHRESHOLD = "active_display_shake_long_threshold";
2923
2924 /**
2925 * Screen-On Notification Light
2926 * 0 - disable, default
2927 * 1 - enable
2928 * @hide
2929 */
2930 public static final String SCREEN_ON_NOTIFICATION_LED = "screen_on_notification_led";
2931
2932 /**
2933 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
2934 * instead
2935 * @hide
2936 */
2937 @Deprecated
2938 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
2939
2940 /**
2941 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
2942 * instead
2943 * @hide
2944 */
2945 @Deprecated
2946 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
2947
2948 /**
2949 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
2950 * instead
2951 * @hide
2952 */
2953 @Deprecated
2954 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
2955
2956 /**
2957 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
2958 * instead
2959 * @hide
2960 */
2961 @Deprecated
2962 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
2963
2964 /**
2965 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
2966 * instead
2967 * @hide
2968 */
2969 @Deprecated
2970 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
2971
2972 /**
2973 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
2974 * instead
2975 * @hide
2976 */
2977 @Deprecated
2978 public static final String LOCK_SOUND = Global.LOCK_SOUND;
2979
2980 /**
2981 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
2982 * instead
2983 * @hide
2984 */
2985 @Deprecated
2986 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
2987
2988 /**
2989 * Receive incoming SIP calls?
2990 * 0 = no
2991 * 1 = yes
2992 * @hide
2993 */
2994 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
2995
2996 /**
2997 * Call Preference String.
2998 * "SIP_ALWAYS" : Always use SIP with network access
2999 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
3000 * "SIP_ASK_ME_EACH_TIME" : Always ask me each time
3001 * @hide
3002 */
3003 public static final String SIP_CALL_OPTIONS = "sip_call_options";
3004
3005 /**
3006 * One of the sip call options: Always use SIP with network access.
3007 * @hide
3008 */
3009 public static final String SIP_ALWAYS = "SIP_ALWAYS";
3010
3011 /**
3012 * One of the sip call options: Only if destination is a SIP address.
3013 * @hide
3014 */
3015 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
3016
3017 /**
3018 * One of the sip call options: Always ask me each time.
3019 * @hide
3020 */
3021 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
3022
3023 /**
3024 * Pointer speed setting.
3025 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
3026 * -7 = slowest
3027 * 0 = default speed
3028 * +7 = fastest
3029 * @hide
3030 */
3031 public static final String POINTER_SPEED = "pointer_speed";
3032
3033 /**
3034 * I am the lolrus.
3035 * <p>
3036 * Nonzero values indicate that the user has a bukkit.
3037 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
3038 * @hide
3039 */
3040 public static final String EGG_MODE = "egg_mode";
3041
3042 /**
3043 * Whether to control brightness from status bar
3044 *
3045 * @hide
3046 */
3047 public static final String STATUS_BAR_BRIGHTNESS_CONTROL = "status_bar_brightness_control";
3048
3049 /**
3050 * Whether or not to launch default music player when headset is connected
3051 * @hide
3052 */
3053 public static final String HEADSET_CONNECT_PLAYER = "headset_connect_player";
3054
3055 /**
3056 * volume rocker wake
3057 * @hide
3058 */
3059 public static final String VOLUME_WAKE_SCREEN = "volume_wake_screen";
3060
3061 /**
3062 * Swap volume buttons when the screen is rotated
3063 * @hide
3064 */
3065 public static final String SWAP_VOLUME_BUTTONS = "swap_volume_buttons";
3066
3067 /**
3068 * volume rocker music track control enable/disable
3069 * @hide
3070 */
3071 public static final String VOLUME_MUSIC_CONTROL = "volume_music_control";
3072
3073 /**
3074 * Swipe between quick settings and notification drawer
3075 * @hide
3076 */
3077 public static final String QUICK_SWIPE = "quick_swipe";
3078
3079 /**
3080 * What application to launch when the user click the clock in the notification bar
3081 * @hide
3082 */
3083 public static final String CLOCK_SHORTCUT = "clock_shortcut";
3084
3085 /**
3086 * What application to launch when the user click the calendar in the notification bar
3087 * @hide
3088 */
3089 public static final String CALENDAR_SHORTCUT = "calendar_shortcut";
3090
3091 /**
3092 * Show clear all recents button
3093 * @hide
3094 */
3095 public static final String SHOW_CLEAR_RECENTS_BUTTON = "clear_recents_button";
3096
3097 /**
3098 * Location of the clear all recents button
3099 * @hide
3100 */
3101 public static final String CLEAR_RECENTS_BUTTON_LOCATION = "clear_recents_button_location";
3102
3103 /**
3104 * Show circle memory indicator in recents panel view
3105 * @hide
3106 */
3107 public static final String SHOW_RECENTS_MEMORY_INDICATOR = "show_recents_memory_indicator";
3108
3109 /**
3110 * Location of the memory indicator
3111 * @hide
3112 */
3113 public static final String RECENTS_MEMORY_INDICATOR_LOCATION =
3114 "recents_memory_indicator_location";
3115
3116 /**
3117 * Alternative recent apps integration using OmniSwitch
3118 * @hide
3119 */
3120 public static final String RECENTS_USE_OMNISWITCH = "recents_use_omniswitch";
3121
3122 /**
3123 * Immersive mode global actions switch
3124 * 0 = no
3125 * 1 = yes
3126 * 2 = hide navigation bar
3127 * 3 = hide status bar
3128 * @hide
3129 */
3130 public static final String IMMERSIVE_MODE = "immersive_mode";
3131
3132 /**
3133 * return value last immersive mode
3134 * @hide
3135 */
3136 public static final String IMMERSIVE_LAST_ACTIVE_STATE = "immersive_last_active_state";
3137
3138 /**
3139 * @hide
3140 */
3141 public static final String STATUSBAR_NOTIFICATION_ACTIVITY = "statusbar_notification_activity";
3142
3143 /**
3144 * Show when WiFi or data mobile is sending/receiving data
3145 * @hide
3146 */
3147 public static final String STATUS_BAR_NETWORK_ACTIVITY = "status_bar_network_activity";
3148
3149 /**
3150 * Handle activation of immersive mode on lockscreen
3151 * @hide
3152 */
3153 public static final String LOCKSCREEN_IMMERSIVE_MODE = "lockscreen_immersive_mode";
3154
3155 /**
3156 * Whether or not to show circle battery around the lockscreen ring
3157 * @hide
3158 */
3159 public static final String BATTERY_AROUND_LOCKSCREEN_RING = "battery_around_lockscreen_ring";
3160
3161 /**
3162 * Show the pending notification counts as overlays on the status bar
3163 * @hide
3164 */
3165 public static final String STATUS_BAR_NOTIF_COUNT = "status_bar_notif_count";
3166
3167 /**
3168 * option for tinted statusbar
3169 * 0 = disabled
3170 * 1 = follow actionbar
3171 * 2 = follow screen
3172 * 3 = follow all
3173 * @hide
3174 */
3175 public static final String STATUS_BAR_TINTED_COLOR = "status_bar_tinted_color";
3176
3177 /**
3178 * option for tinted statusbar last active
3179 * @hide
3180 */
3181 public static final String STATUS_BAR_TINTED_LAST_ACTIVE_STATE = "status_bar_tinted_last_active_state";
3182
3183 /**
3184 * option for systemui color
3185 * 0 = statusbar
3186 * 1 = navigationbar
3187 * 2 = both
3188 * @hide
3189 */
3190 public static final String STATUS_BAR_TINTED_OPTION = "status_bar_tinted_option";
3191
3192 /**
3193 * option for filter tinted statusbar
3194 * @hide
3195 */
3196 public static final String STATUS_BAR_TINTED_FILTER = "status_bar_tinted_filter";
3197
3198 /**
3199 * option for filter gradient statusbar
3200 * @hide
3201 */
3202 public static final String STATUS_BAR_TINTED_GRADIENT = "status_bar_tinted_gradient";
3203
3204 /**
3205 * option for transparent statusbar
3206 * @hide
3207 */
3208 public static final String STATUS_BAR_TINTED_STATBAR_TRANSPARENT = "status_bar_tinted_statbar_transparent";
3209
3210 /**
3211 * option for transparent navbar
3212 * @hide
3213 */
3214 public static final String STATUS_BAR_TINTED_NAVBAR_TRANSPARENT = "status_bar_tinted_navbar_transparent";
3215
3216 /**
3217 * option for full tinted system ui
3218 * @hide
3219 */
3220 public static final String STATUS_BAR_TINTED_FULL_MODE = "status_bar_tinted_full_mode";
3221
3222 /**
3223 * Weather to minimize lockscreen challenge on screen turned on
3224 * @hide
3225 */
3226 public static final String LOCKSCREEN_MAXIMIZE_WIDGETS = "lockscreen_maximize_widgets";
3227
3228 /**
3229 * Defines the screen-off animation to display
3230 * @hide
3231 */
3232 public static final String SCREEN_OFF_ANIMATION = "screen_off_animation";
3233
3234 /**
3235 * Defines the custom path to use for UI sound effects (null for default)
3236 * @hide
3237 */
3238 public static final String CUSTOM_SOUND_EFFECTS_PATH = "custom_sound_effects_path";
3239
3240 /**
3241 * Action to perform when the key is pressed
3242 * 0 - Nothing
3243 * 1 - Menu
3244 * 2 - App-switch
3245 * 3 - Search
3246 * 4 - Voice search
3247 * 5 - In-app search
3248 * 6 - home
3249 * 7 - back
3250 * 8 - toggle last app
3251 * 9 - kill app
3252 * 10 - go to sleep
3253 * @hide
3254 */
3255 public static final String HARDWARE_KEY_REBINDING = "hardware_key_rebinding";
3256
3257 /**
3258 * Action to perform when the back key is pressed. (Default is 7)
3259 * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
3260 * @hide
3261 */
3262 public static final String KEY_BACK_ACTION = "key_back_action";
3263
3264 /**
3265 * Action to perform when the back key is long-pressed. (Default is 0)
3266 * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
3267 * @hide
3268 */
3269 public static final String KEY_BACK_LONG_PRESS_ACTION = "key_back_long_press_action";
3270
3271 /**
3272 * Action to perform when the home key is pressed. (Default is 6)
3273 * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
3274 * @hide
3275 */
3276 public static final String KEY_HOME_ACTION = "key_home_action";
3277
3278 /**
3279 * Action to perform when the home key is long-pressed. (Default is 2)
3280 * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
3281 * @hide
3282 */
3283 public static final String KEY_HOME_LONG_PRESS_ACTION = "key_home_long_press_action";
3284
3285 /**
3286 * Action to perform when the home key is double taped (Default is 0)
3287 * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
3288 * @hide
3289 */
3290 public static final String KEY_HOME_DOUBLE_TAP_ACTION = "key_home_double_tap_action";
3291
3292 /**
3293 * Action to perform when the menu key is pressed. (Default is 1)
3294 * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
3295 * @hide
3296 */
3297 public static final String KEY_MENU_ACTION = "key_menu_action";
3298
3299 /**
3300 * Action to perform when the menu key is long-pressed.
3301 * (Default is 0 on devices with a search key, 3 on devices without)
3302 * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
3303 * @hide
3304 */
3305 public static final String KEY_MENU_LONG_PRESS_ACTION = "key_menu_long_press_action";
3306
3307 /**
3308 * Action to perform when the assistant (search) key is pressed. (Default is 3)
3309 * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
3310 * @hide
3311 */
3312 public static final String KEY_ASSIST_ACTION = "key_assist_action";
3313
3314 /**
3315 * Action to perform when the assistant (search) key is long-pressed. (Default is 4)
3316 * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
3317 * @hide
3318 */
3319 public static final String KEY_ASSIST_LONG_PRESS_ACTION = "key_assist_long_press_action";
3320
3321 /**
3322 * Action to perform when the app switch key is pressed. (Default is 2)
3323 * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
3324 * @hide
3325 */
3326 public static final String KEY_APP_SWITCH_ACTION = "key_app_switch_action";
3327
3328 /**
3329 * Action to perform when the app switch key is long-pressed. (Default is 0)
3330 * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
3331 * @hide
3332 */
3333 public static final String KEY_APP_SWITCH_LONG_PRESS_ACTION = "key_app_switch_long_press_action";
3334
3335 /**
3336 * Enable/disable haptic feedback for virtual keys
3337 * @hide
3338 */
3339 public static final String VIRTUAL_KEYS_HAPTIC_FEEDBACK = "virtual_keys_haptic_feedback";
3340
3341 /** Weather to allow headsethook to launch voice commands
3342 * @hide
3343 */
3344 public static final String HEADSETHOOK_LAUNCH_VOICE = "headsethook_launch_voice";
3345
3346 /**
3347 * Enable Stylus Gestures
3348 *
3349 * @hide
3350 */
3351 public static final String ENABLE_STYLUS_GESTURES = "enable_stylus_gestures";
3352
3353 /**
3354 * Left Swipe Action
3355 *
3356 * @hide
3357 */
3358 public static final String GESTURES_LEFT_SWIPE = "gestures_left_swipe";
3359
3360 /**
3361 * Right Swipe Action
3362 *
3363 * @hide
3364 */
3365 public static final String GESTURES_RIGHT_SWIPE = "gestures_right_swipe";
3366
3367 /**
3368 * Up Swipe Action
3369 *
3370 * @hide
3371 */
3372 public static final String GESTURES_UP_SWIPE = "gestures_up_swipe";
3373
3374 /**
3375 * down Swipe Action
3376 *
3377 * @hide
3378 */
3379 public static final String GESTURES_DOWN_SWIPE = "gestures_down_swipe";
3380
3381 /**
3382 * Long press Action
3383 *
3384 * @hide
3385 */
3386 public static final String GESTURES_LONG_PRESS = "gestures_long_press";
3387
3388 /**
3389 * double tap Action
3390 *
3391 * @hide
3392 */
3393 public static final String GESTURES_DOUBLE_TAP = "gestures_double_tap";
3394
3395 /**
3396 * Whether to use the custom quick unlock screen control
3397 * @hide
3398 */
3399 public static final String LOCKSCREEN_QUICK_UNLOCK_CONTROL = "lockscreen_quick_unlock_control";
3400
3401 /**
3402 * Battery warning preferences
3403 *
3404 * 0 = show dialog + play sound (default)
3405 * 1 = fire notification + play sound
3406 * 2 = show dialog only
3407 * 3 = fire notification only
3408 * 4 = play sound only
3409 * 5 = none
3410 * @hide
3411 */
3412 public static final String POWER_UI_LOW_BATTERY_WARNING_POLICY = "power_ui_low_battery_warning_policy";
3413
3414 /**
3415 * Whether to use the custom status bar header or not
3416 * @hide
3417 */
3418 public static final String STATUS_BAR_CUSTOM_HEADER = "status_bar_custom_header";
3419
3420 /**
3421 * Quick settings tiles to show on status bar
3422 * @hide
3423 */
3424 public static final String QUICK_SETTINGS_TILES = "quick_settings_tiles";
3425
3426 /**
3427 * Quick settings tiles dynamic row
3428 * @hide
3429 */
3430 public static final String QUICK_SETTINGS_TILES_ROW = "quick_settings_tiles_row";
3431
3432 /**
3433 * Navigation controls to Use
3434 *
3435 * @hide
3436 */
3437 public static final String NAV_BUTTONS = "nav_buttons";
3438
3439 /**
3440 * Navigation bar height when it is on protrait
3441 * @hide
3442 */
3443 public static final String NAVIGATION_BAR_HEIGHT = "navigation_bar_height";
3444
3445 /**
3446 * Navigation bar height when it is on landscape
3447 * @hide
3448 */
3449 public static final String NAVIGATION_BAR_HEIGHT_LANDSCAPE = "navigation_bar_height_landscape";
3450
3451 /**
3452 * Navigation bar height when it is on landscape at the right
3453 * @hide
3454 */
3455 public static final String NAVIGATION_BAR_WIDTH = "navigation_bar_width";
3456
3457 /**
3458 * Navigation bar enable disable for devices that have hw buttons
3459 * @hide
3460 */
3461 public static final String NAVIGATION_BAR_SHOW = "navigation_bar_show";
3462
3463 /**
3464 * Disable hw buttons - actions, brightness, haptic feedback, overflow menu
3465 * @hide
3466 */
3467 public static final String HARDWARE_KEYS_DISABLE = "hardware_keys_disable";
3468
3469 /**
3470 * Volume key controls ringtone or media sound stream
3471 *
3472 * @hide
3473 */
3474 public static final String VOLUME_KEYS_DEFAULT = "volume_keys_default";
3475
3476 /**
3477 * Should the non-intrsive incall ui be used
3478 *
3479 * @hide
3480 */
3481 public static final String NON_INTRUSIVE_INCALL = "non_intrusive_incall";
3482
3483 /**
3484 * Should Dialer suggest nearby phone numbers
3485 *
3486 * @hide
3487 */
3488 public static final String ENABLE_DIALER_SUGGESTIONS = "enable_dialer_suggestions";
3489
3490 /**
3491 * Should Dialer reverse look up names for unknown phone numbers
3492 *
3493 * @hide
3494 */
3495 public static final String ENABLE_DIALER_REVERSE_LOOKUP = "enable_dialer_reverse_lookup";
3496
3497 /**
3498 * Should Flip to Silence be used
3499 *
3500 * @hide
3501 */
3502 public static final String FLIP_ACTION_KEY = "flip_action";
3503
3504 /**
3505 * Should call status sounds be player
3506 *
3507 * @hide
3508 */
3509 public static final String CALL_END_SOUND = "call_end_sound";
3510
3511 /**
3512 * Setting to show the battery percentage text
3513 * @hide
3514 */
3515 public static final String STATUS_BAR_BATTERY_STYLE = "status_bar_battery_style";
3516
3517 /**
3518 * Whether to unlock the menu key. The value is boolean (1 or 0).
3519 * @hide
3520 */
3521 public static final String MENU_UNLOCK_SCREEN = "menu_unlock_screen";
3522
3523 /**
3524 * Custom navring actions
3525 *
3526 * @hide
3527 */
3528 public static final String[] NAVIGATION_RING_TARGETS = new String[] {
3529 "navigation_ring_targets_0",
3530 "navigation_ring_targets_1",
3531 "navigation_ring_targets_2",
3532 };
3533
3534 /**
3535 * Whether to enable quiet hours.
3536 * @hide
3537 */
3538 public static final String QUIET_HOURS_ENABLED = "quiet_hours_enabled";
3539
3540 /**
3541 * Sets when quiet hours starts. This is stored in minutes from the start of the day.
3542 * @hide
3543 */
3544 public static final String QUIET_HOURS_START = "quiet_hours_start";
3545
3546 /**
3547 * Sets when quiet hours end. This is stored in minutes from the start of the day.
3548 * @hide
3549 */
3550 public static final String QUIET_HOURS_END = "quiet_hours_end";
3551
3552 /**
3553 * Whether to remove the sound from outgoing notifications during quiet hours.
3554 * @hide
3555 */
3556 public static final String QUIET_HOURS_MUTE = "quiet_hours_mute";
3557
3558 /**
3559 * Whether to disable system sound during quiet hours.
3560 * @hide
3561 */
3562 public static final String QUIET_HOURS_SYSTEM = "quiet_hours_system";
3563
3564 /**
3565 * Whether to disable haptic feedback during quiet hours.
3566 * @hide
3567 */
3568 public static final String QUIET_HOURS_HAPTIC = "quiet_hours_haptic";
3569
3570 /**
3571 * Whether to remove the vibration from outgoing notifications during quiet hours.
3572 * @hide
3573 */
3574 public static final String QUIET_HOURS_STILL = "quiet_hours_still";
3575
3576 /**
3577 * Whether to attempt to dim the LED color during quiet hours.
3578 * @hide
3579 */
3580 public static final String QUIET_HOURS_DIM = "quiet_hours_dim";
3581
3582 /**
3583 * Whether to remove the sound from phone ringing during quiet hours.
3584 * @hide
3585 */
3586 public static final String QUIET_HOURS_RINGER = "quiet_hours_ringer";
3587
3588 /**
3589 * Constant: Keep ringer on for all numbers during quiet hours
3590 * @hide
3591 */
3592 public static final int QUIET_HOURS_RINGER_ALLOW_ALL = 0;
3593
3594 /**
3595 * Constant: Only ring for numbers in contact list during quiet hours
3596 * @hide
3597 */
3598 public static final int QUIET_HOURS_RINGER_CONTACTS_ONLY = 1;
3599
3600 /**
3601 * Constant: Only ring for favorite contacts during quiet hours
3602 * @hide
3603 */
3604 public static final int QUIET_HOURS_RINGER_FAVORITES_ONLY = 2;
3605
3606 /**
3607 * Constant: Disable ringer during quiet hours
3608 * @hide
3609 */
3610 public static final int QUIET_HOURS_RINGER_DISABLED = 3;
3611
3612 /**
3613 * Constant: Only ring for whitelist contacts during quiet hours
3614 * @hide
3615 */
3616 public static final int QUIET_HOURS_RINGER_WHITELIST_ONLY = 4;
3617
3618 /**
3619 * Whether to pause (overrule) quiet hours for the moment
3620 * @hide
3621 */
3622 public static final String QUIET_HOURS_PAUSED = "quiet_hours_paused";
3623
3624 /**
3625 * Whether to force on quiet hours for the moment
3626 * @hide
3627 */
3628 public static final String QUIET_HOURS_FORCED = "quiet_hours_forced";
3629
3630 /**
3631 * @hide
3632 */
3633 public static final String QUIET_HOURS_WHITELIST = "quiet_hours_whitelist";
3634
3635 /**
3636 * @hide
3637 */
3638 public static final String QUIET_HOURS_CALL_BYPASS = "quiet_hours_call_bypass";
3639
3640 /**
3641 * @hide
3642 */
3643 public static final String QUIET_HOURS_CALL_BYPASS_COUNT = "quiet_hours_call_bypass_count";
3644
3645 /**
3646 * @hide
3647 */
3648 public static final String QUIET_HOURS_SMS_BYPASS = "quiet_hours_sms_bypass";
3649
3650 /**
3651 * @hide
3652 */
3653 public static final String QUIET_HOURS_SMS_BYPASS_CODE = "quiet_hours_sms_bypass_code";
3654
3655 /**
3656 * @hide
3657 */
3658 public static final String QUIET_HOURS_AUTO_SMS = "quiet_hours_auto_sms";
3659
3660 /**
3661 * @hide
3662 */
3663 public static final String QUIET_HOURS_AUTO_SMS_TEXT = "quiet_hours_auto_sms_text";
3664
3665 /**
3666 * @hide
3667 */
3668 public static final String QUIET_HOURS_AUTO_CALL = "quiet_hours_auto_call";
3669
3670 /**
3671 * @hide
3672 */
3673 public static final String QUIET_HOURS_ALARM_TONE = "quiet_hours_alarm_tone";
3674
3675 /**
3676 * @hide
3677 */
3678 public static final String QUIET_HOURS_ALARM_LOOP = "quiet_hours_alarm_loop";
3679
3680 /**
3681 * @hide
3682 */
3683 public static final String QUIET_HOURS_ACTIVE = "quiet_hours_active";
3684
3685 /**
3686 * Quick Settings Quick Pulldown
3687 *
3688 * @hide
3689 */
3690 public static final String QS_QUICK_PULLDOWN = "qs_quick_pulldown";
3691
3692 /**
3693 * Quick Settings Smart Pulldown
3694 *
3695 * @hide
3696 */
3697 public static final String QS_SMART_PULLDOWN = "qs_smart_pulldown";
3698
3699 /**
3700 * Volume keys control cursor in text fields (default is 0)
3701 * 0 - Disabled
3702 * 1 - Volume up/down moves cursor left/right
3703 * 2 - Volume up/down moves cursor right/left
3704 * @hide
3705 */
3706 public static final String VOLUME_KEY_CURSOR_CONTROL = "volume_key_cursor_control";
3707
3708 /**
3709 * Override and forcefully disable the fullscreen keyboard
3710 * @hide
3711 */
3712 public static final String DISABLE_FULLSCREEN_KEYBOARD = "disable_fullscreen_keyboard";
3713
3714 /**
3715 * Whether to show the IME switcher in the status bar
3716 * @hide
3717 */
3718 public static final String STATUS_BAR_IME_SWITCHER = "status_bar_ime_switcher";
3719
3720 /**
3721 * Show or hide clock
3722 * 0 - hide
3723 * 1 - show (default)
3724 * @hide
3725 */
3726 public static final String STATUS_BAR_CLOCK = "status_bar_clock";
3727
3728 /**
3729 * Show or hide clock on lockscreen
3730 * 0 - hide (default)
3731 * 1 - show
3732 * @hide
3733 */
3734 public static final String STATUS_BAR_FORCE_CLOCK_LOCKSCREEN = "status_bar_force_clock_lockscreen";
3735
3736 /**
3737 * AM/PM Style for clock options
3738 * 0 - Normal AM/PM
3739 * 1 - Small AM/PM
3740 * 2 - No AM/PM
3741 * @hide
3742 */
3743 public static final String STATUSBAR_CLOCK_AM_PM_STYLE = "statusbar_clock_am_pm_style";
3744
3745 /**
3746 * Style of clock
3747 * 0 - Hide Clock
3748 * 1 - Right Clock
3749 * 2 - Center Clock
3750 * @hide
3751 */
3752 public static final String STATUSBAR_CLOCK_STYLE = "statusbar_clock_style";
3753
3754 /**
3755 * @hide
3756 * Shows custom date before clock time
3757 * 0 - No Date
3758 * 1 - Small Date
3759 * 2 - Normal Date
3760 */
3761 public static final String STATUSBAR_CLOCK_DATE_DISPLAY = "statusbar_clock_date_display";
3762
3763 /**
3764 * @hide
3765 * Sets the date string style
3766 * 0 - Regular style
3767 * 1 - Lowercase
3768 * 2 - Uppercase
3769 */
3770 public static final String STATUSBAR_CLOCK_DATE_STYLE = "statusbar_clock_date_style";
3771
3772 /**
3773 * @hide
3774 * Stores the java DateFormat string for the date
3775 */
3776 public static final String STATUSBAR_CLOCK_DATE_FORMAT = "statusbar_clock_date_format";
3777
3778 /**
3779 * Automatic keyboard rotation timeout. 0 to disable completely.
3780 * @hide
3781 */
3782 public static final String KEYBOARD_ROTATION_TIMEOUT = "keyboard_rotation_timeout";
3783
3784 /**
3785 * Forces formal text input. 1 to replace emoticon key with enter key.
3786 * @hide
3787 */
3788 public static final String FORMAL_TEXT_INPUT = "formal_text_input";
3789
3790 /**
3791 * Enable long press on back kill for soft buttons.
3792 * @hide
3793 */
3794 public static final String SOFT_BACK_KILL_APP_ENABLE = "soft_back_kill_app_enable";
3795
3796 /**
3797 * Emulate existance of a menu key on devices that have only soft keys
3798 * Using a soft menu key will behave like if a hw menu is used
3799 * @hide
3800 */
3801 public static final String EMULATE_HW_MENU_KEY = "emulate_hw_menu_key";
3802
3803 /**
3804 * Force show overflow (3dot) menu for devices that have a hw menu key
3805 * Can be used for custom button assignment and force soft key use-cases
3806 * @hide
3807 */
3808 public static final String FORCE_SHOW_OVERFLOW_MENU = "force_show_overflow_menu";
3809
3810 /**
3811 * Enable handlign of oppo input event for camera flip (F1)
3812 * and start camera app
3813 * @hide
3814 */
3815 public static final String OPPO_CAMERA_FLIP_ENABLED = "oppo_camera_flip_enable";
3816
3817 /**
3818 * The style of the incoming call screen.
3819 * Default is {@link INCOMING_CALL_STYLE_FULLSCREEN_PHOTO}.
3820 * @hide
3821 */
3822 public static final String INCOMING_CALL_STYLE = "incoming_call_style";
3823
3824 /** @hide */
3825 public static final int INCOMING_CALL_STYLE_CLASSIC = 0;
3826 /** @hide */
3827 public static final int INCOMING_CALL_STYLE_FULLSCREEN_PHOTO = 1;
3828
3829 /**
3830 * Settings to backup. This is here so that it's in the same place as the settings
3831 * keys and easy to update.
3832 *
3833 * NOTE: Settings are backed up and restored in the order they appear
3834 * in this array. If you have one setting depending on another,
3835 * make sure that they are ordered appropriately.
3836 *
3837 * @hide
3838 */
3839 public static final String[] SETTINGS_TO_BACKUP = {
3840 STAY_ON_WHILE_PLUGGED_IN, // moved to global
3841 WIFI_USE_STATIC_IP,
3842 WIFI_STATIC_IP,
3843 WIFI_STATIC_GATEWAY,
3844 WIFI_STATIC_NETMASK,
3845 WIFI_STATIC_DNS1,
3846 WIFI_STATIC_DNS2,
3847 MMS_AUTO_RETRIEVAL,
3848 MMS_AUTO_RETRIEVAL_ON_ROAMING,
3849 BLUETOOTH_DISCOVERABILITY,
3850 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3851 BLUETOOTH_ACCEPT_ALL_FILES,
3852 DIM_SCREEN,
3853 SCREEN_OFF_TIMEOUT,
3854 SCREEN_BRIGHTNESS,
3855 SCREEN_BRIGHTNESS_MODE,
3856 SCREEN_AUTO_BRIGHTNESS_ADJ,
3857 VIBRATE_INPUT_DEVICES,
3858 MODE_RINGER_STREAMS_AFFECTED,
3859 VOLUME_VOICE,
3860 VOLUME_SYSTEM,
3861 VOLUME_RING,
3862 VOLUME_MUSIC,
3863 VOLUME_ALARM,
3864 VOLUME_NOTIFICATION,
3865 VOLUME_BLUETOOTH_SCO,
3866 VOLUME_VOICE + APPEND_FOR_LAST_AUDIBLE,
3867 VOLUME_SYSTEM + APPEND_FOR_LAST_AUDIBLE,
3868 VOLUME_RING + APPEND_FOR_LAST_AUDIBLE,
3869 VOLUME_MUSIC + APPEND_FOR_LAST_AUDIBLE,
3870 VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE,
3871 VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE,
3872 VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE,
3873 TEXT_AUTO_REPLACE,
3874 TEXT_AUTO_CAPS,
3875 TEXT_AUTO_PUNCTUATE,
3876 TEXT_SHOW_PASSWORD,
3877 AUTO_TIME, // moved to global
3878 AUTO_TIME_ZONE, // moved to global
3879 TIME_12_24,
3880 DATE_FORMAT,
3881 DTMF_TONE_WHEN_DIALING,
3882 DTMF_TONE_TYPE_WHEN_DIALING,
3883 HEARING_AID,
3884 TTY_MODE,
3885 SOUND_EFFECTS_ENABLED,
3886 HAPTIC_FEEDBACK_ENABLED,
3887 POWER_SOUNDS_ENABLED, // moved to global
3888 DOCK_SOUNDS_ENABLED, // moved to global
3889 LOCKSCREEN_SOUNDS_ENABLED,
3890 SHOW_WEB_SUGGESTIONS,
3891 NOTIFICATION_LIGHT_PULSE,
3892 SIP_CALL_OPTIONS,
3893 SIP_RECEIVE_CALLS,
3894 POINTER_SPEED,
3895 VIBRATE_WHEN_RINGING,
3896 INCREASING_RING,
3897 RINGTONE,
3898 PHONE_BLACKLIST_ENABLED,
3899 PHONE_BLACKLIST_NOTIFY_ENABLED,
3900 PHONE_BLACKLIST_PRIVATE_NUMBER_MODE,
3901 PHONE_BLACKLIST_UNKNOWN_NUMBER_MODE,
3902 PHONE_BLACKLIST_REGEX_ENABLED,
3903 NOTIFICATION_SOUND,
3904 INCOMING_CALL_STYLE
3905 };
3906
3907 // Settings moved to Settings.Secure
3908
3909 /**
3910 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
3911 * instead
3912 */
3913 @Deprecated
3914 public static final String ADB_ENABLED = Global.ADB_ENABLED;
3915
3916 /**
3917 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
3918 */
3919 @Deprecated
3920 public static final String ANDROID_ID = Secure.ANDROID_ID;
3921
3922 /**
3923 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
3924 */
3925 @Deprecated
3926 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
3927
3928 /**
3929 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
3930 */
3931 @Deprecated
3932 public static final String DATA_ROAMING = Global.DATA_ROAMING;
3933
3934 /**
3935 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
3936 */
3937 @Deprecated
3938 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
3939
3940 /**
3941 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
3942 */
3943 @Deprecated
3944 public static final String HTTP_PROXY = Global.HTTP_PROXY;
3945
3946 /**
3947 * @deprecated Use {@link android.provider.Settings.Global#INSTALL_NON_MARKET_APPS} instead
3948 */
3949 @Deprecated
3950 public static final String INSTALL_NON_MARKET_APPS = Global.INSTALL_NON_MARKET_APPS;
3951
3952 /**
3953 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
3954 * instead
3955 */
3956 @Deprecated
3957 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
3958
3959 /**
3960 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
3961 */
3962 @Deprecated
3963 public static final String LOGGING_ID = Secure.LOGGING_ID;
3964
3965 /**
3966 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
3967 */
3968 @Deprecated
3969 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
3970
3971 /**
3972 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
3973 * instead
3974 */
3975 @Deprecated
3976 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
3977
3978 /**
3979 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
3980 * instead
3981 */
3982 @Deprecated
3983 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
3984
3985 /**
3986 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
3987 * instead
3988 */
3989 @Deprecated
3990 public static final String PARENTAL_CONTROL_REDIRECT_URL =
3991 Secure.PARENTAL_CONTROL_REDIRECT_URL;
3992
3993 /**
3994 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
3995 */
3996 @Deprecated
3997 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
3998
3999 /**
4000 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
4001 */
4002 @Deprecated
4003 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
4004
4005 /**
4006 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
4007 */
4008 @Deprecated
4009 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
4010
4011 /**
4012 * @deprecated Use
4013 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
4014 */
4015 @Deprecated
4016 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
4017
4018 /**
4019 * @deprecated Use
4020 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
4021 */
4022 @Deprecated
4023 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
4024 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
4025
4026 /**
4027 * @deprecated Use
4028 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
4029 */
4030 @Deprecated
4031 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
4032 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
4033
4034 /**
4035 * @deprecated Use
4036 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
4037 */
4038 @Deprecated
4039 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
4040 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
4041
4042 /**
4043 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
4044 * instead
4045 */
4046 @Deprecated
4047 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
4048
4049 /**
4050 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
4051 */
4052 @Deprecated
4053 public static final String WIFI_ON = Global.WIFI_ON;
4054
4055 /**
4056 * @deprecated Use
4057 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
4058 * instead
4059 */
4060 @Deprecated
4061 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4062 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
4063
4064 /**
4065 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
4066 */
4067 @Deprecated
4068 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
4069
4070 /**
4071 * @deprecated Use
4072 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
4073 */
4074 @Deprecated
4075 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4076 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
4077
4078 /**
4079 * @deprecated Use
4080 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
4081 */
4082 @Deprecated
4083 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
4084 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
4085
4086 /**
4087 * @deprecated Use
4088 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
4089 * instead
4090 */
4091 @Deprecated
4092 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
4093 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
4094
4095 /**
4096 * @deprecated Use
4097 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
4098 */
4099 @Deprecated
4100 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
4101 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
4102
4103 /**
4104 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
4105 * instead
4106 */
4107 @Deprecated
4108 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
4109
4110 /**
4111 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
4112 */
4113 @Deprecated
4114 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
4115
4116 /**
4117 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
4118 */
4119 @Deprecated
4120 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
4121
4122 /**
4123 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
4124 * instead
4125 */
4126 @Deprecated
4127 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
4128
4129 /**
4130 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
4131 * instead
4132 */
4133 @Deprecated
4134 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
4135 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
4136
4137 }
4138
4139 /**
4140 * Secure system settings, containing system preferences that applications
4141 * can read but are not allowed to write. These are for preferences that
4142 * the user must explicitly modify through the system UI or specialized
4143 * APIs for those values, not modified directly by applications.
4144 */
4145 public static final class Secure extends NameValueTable {
4146 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
4147
4148 /**
4149 * The content:// style URL for this table
4150 */
4151 public static final Uri CONTENT_URI =
4152 Uri.parse("content://" + AUTHORITY + "/secure");
4153
4154 // Populated lazily, guarded by class object:
4155 private static final NameValueCache sNameValueCache = new NameValueCache(
4156 SYS_PROP_SETTING_VERSION,
4157 CONTENT_URI,
4158 CALL_METHOD_GET_SECURE,
4159 CALL_METHOD_PUT_SECURE);
4160
4161 private static ILockSettings sLockSettings = null;
4162
4163 private static boolean sIsSystemProcess;
4164 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
4165 private static final HashSet<String> MOVED_TO_GLOBAL;
4166 static {
4167 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
4168 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
4169 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
4170 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
4171
4172 MOVED_TO_GLOBAL = new HashSet<String>();
4173 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
4174 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
4175 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
4176 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
4177 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
4178 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
4179 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
4180 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
4181 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
4182 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
4183 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
4184 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
4185 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_DENSITY_FORCED);
4186 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
4187 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
4188 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
4189 MOVED_TO_GLOBAL.add(Settings.Global.INSTALL_NON_MARKET_APPS);
4190 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
4191 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
4192 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
4193 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
4194 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
4195 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
4196 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
4197 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
4198 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_REPORT_XT_OVER_DEV);
4199 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
4200 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
4201 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
4202 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
4203 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
4204 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
4205 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
4206 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
4207 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
4208 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
4209 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
4210 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
4211 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
4212 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
4213 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
4214 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
4215 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
4216 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
4217 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
4218 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
4219 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
4220 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
4221 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
4222 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
4223 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
4224 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
4225 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
4226 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
4227 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
4228 MOVED_TO_GLOBAL.add(Settings.Global.WEB_AUTOFILL_QUERY_URL);
4229 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
4230 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
4231 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
4232 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
4233 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
4234 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
4235 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
4236 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
4237 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
4238 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
4239 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
4240 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
4241 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
4242 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
4243 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
4244 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
4245 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
4246 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
4247 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
4248 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
4249 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
4250 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
4251 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
4252 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
4253 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
4254 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
4255 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
4256 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
4257 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
4258 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
4259 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
4260 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
4261 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
4262 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
4263 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
4264 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
4265 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
4266 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
4267 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
4268 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
4269 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
4270 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
4271 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
4272 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
4273 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
4274 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
4275 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
4276 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
4277 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
4278 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
4279 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
4280 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
4281 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
4282 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
4283 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
4284 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
4285 }
4286
4287 /** @hide */
4288 public static void getMovedKeys(HashSet<String> outKeySet) {
4289 outKeySet.addAll(MOVED_TO_GLOBAL);
4290 }
4291
4292 /**
4293 * Look up a name in the database.
4294 * @param resolver to access the database with
4295 * @param name to look up in the table
4296 * @return the corresponding value, or null if not present
4297 */
4298 public static String getString(ContentResolver resolver, String name) {
4299 return getStringForUser(resolver, name, UserHandle.myUserId());
4300 }
4301
4302 /** @hide */
4303 public static String getStringForUser(ContentResolver resolver, String name,
4304 int userHandle) {
4305 if (MOVED_TO_GLOBAL.contains(name)) {
4306 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4307 + " to android.provider.Settings.Global.");
4308 return Global.getStringForUser(resolver, name, userHandle);
4309 }
4310
4311 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
4312 synchronized (Secure.class) {
4313 if (sLockSettings == null) {
4314 sLockSettings = ILockSettings.Stub.asInterface(
4315 (IBinder) ServiceManager.getService("lock_settings"));
4316 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
4317 }
4318 }
4319 if (sLockSettings != null && !sIsSystemProcess) {
4320 try {
4321 return sLockSettings.getString(name, "0", userHandle);
4322 } catch (RemoteException re) {
4323 // Fall through
4324 }
4325 }
4326 }
4327
4328 return sNameValueCache.getStringForUser(resolver, name, userHandle);
4329 }
4330
4331 /**
4332 * Store a name/value pair into the database.
4333 * @param resolver to access the database with
4334 * @param name to store
4335 * @param value to associate with the name
4336 * @return true if the value was set, false on database errors
4337 */
4338 public static boolean putString(ContentResolver resolver, String name, String value) {
4339 return putStringForUser(resolver, name, value, UserHandle.myUserId());
4340 }
4341
4342 /** @hide */
4343 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
4344 int userHandle) {
4345 if (MOVED_TO_GLOBAL.contains(name)) {
4346 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
4347 + " to android.provider.Settings.Global");
4348 return Global.putStringForUser(resolver, name, value, userHandle);
4349 }
4350 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
4351 }
4352
4353 /**
4354 * Construct the content URI for a particular name/value pair,
4355 * useful for monitoring changes with a ContentObserver.
4356 * @param name to look up in the table
4357 * @return the corresponding content URI, or null if not present
4358 */
4359 public static Uri getUriFor(String name) {
4360 if (MOVED_TO_GLOBAL.contains(name)) {
4361 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
4362 + " to android.provider.Settings.Global, returning global URI.");
4363 return Global.getUriFor(Global.CONTENT_URI, name);
4364 }
4365 return getUriFor(CONTENT_URI, name);
4366 }
4367
4368 /**
4369 * Convenience function for retrieving a single secure settings value
4370 * as an integer. Note that internally setting values are always
4371 * stored as strings; this function converts the string to an integer
4372 * for you. The default value will be returned if the setting is
4373 * not defined or not an integer.
4374 *
4375 * @param cr The ContentResolver to access.
4376 * @param name The name of the setting to retrieve.
4377 * @param def Value to return if the setting is not defined.
4378 *
4379 * @return The setting's current value, or 'def' if it is not defined
4380 * or not a valid integer.
4381 */
4382 public static int getInt(ContentResolver cr, String name, int def) {
4383 return getIntForUser(cr, name, def, UserHandle.myUserId());
4384 }
4385
4386 /** @hide */
4387 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
4388 if (LOCATION_MODE.equals(name)) {
4389 // HACK ALERT: temporary hack to work around b/10491283.
4390 // TODO: once b/10491283 fixed, remove this hack
4391 return getLocationModeForUser(cr, userHandle);
4392 }
4393 String v = getStringForUser(cr, name, userHandle);
4394 try {
4395 return v != null ? Integer.parseInt(v) : def;
4396 } catch (NumberFormatException e) {
4397 return def;
4398 }
4399 }
4400
4401 /**
4402 * Convenience function for retrieving a single secure settings value
4403 * as an integer. Note that internally setting values are always
4404 * stored as strings; this function converts the string to an integer
4405 * for you.
4406 * <p>
4407 * This version does not take a default value. If the setting has not
4408 * been set, or the string value is not a number,
4409 * it throws {@link SettingNotFoundException}.
4410 *
4411 * @param cr The ContentResolver to access.
4412 * @param name The name of the setting to retrieve.
4413 *
4414 * @throws SettingNotFoundException Thrown if a setting by the given
4415 * name can't be found or the setting value is not an integer.
4416 *
4417 * @return The setting's current value.
4418 */
4419 public static int getInt(ContentResolver cr, String name)
4420 throws SettingNotFoundException {
4421 return getIntForUser(cr, name, UserHandle.myUserId());
4422 }
4423
4424 /** @hide */
4425 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
4426 throws SettingNotFoundException {
4427 if (LOCATION_MODE.equals(name)) {
4428 // HACK ALERT: temporary hack to work around b/10491283.
4429 // TODO: once b/10491283 fixed, remove this hack
4430 return getLocationModeForUser(cr, userHandle);
4431 }
4432 String v = getStringForUser(cr, name, userHandle);
4433 try {
4434 return Integer.parseInt(v);
4435 } catch (NumberFormatException e) {
4436 throw new SettingNotFoundException(name);
4437 }
4438 }
4439
4440 /**
4441 * Convenience function for updating a single settings value as an
4442 * integer. This will either create a new entry in the table if the
4443 * given name does not exist, or modify the value of the existing row
4444 * with that name. Note that internally setting values are always
4445 * stored as strings, so this function converts the given value to a
4446 * string before storing it.
4447 *
4448 * @param cr The ContentResolver to access.
4449 * @param name The name of the setting to modify.
4450 * @param value The new value for the setting.
4451 * @return true if the value was set, false on database errors
4452 */
4453 public static boolean putInt(ContentResolver cr, String name, int value) {
4454 return putIntForUser(cr, name, value, UserHandle.myUserId());
4455 }
4456
4457 /** @hide */
4458 public static boolean putIntForUser(ContentResolver cr, String name, int value,
4459 int userHandle) {
4460 if (LOCATION_MODE.equals(name)) {
4461 // HACK ALERT: temporary hack to work around b/10491283.
4462 // TODO: once b/10491283 fixed, remove this hack
4463 return setLocationModeForUser(cr, value, userHandle);
4464 }
4465 return putStringForUser(cr, name, Integer.toString(value), userHandle);
4466 }
4467
4468 /**
4469 * Convenience function for retrieving a single secure settings value
4470 * as a {@code long}. Note that internally setting values are always
4471 * stored as strings; this function converts the string to a {@code long}
4472 * for you. The default value will be returned if the setting is
4473 * not defined or not a {@code long}.
4474 *
4475 * @param cr The ContentResolver to access.
4476 * @param name The name of the setting to retrieve.
4477 * @param def Value to return if the setting is not defined.
4478 *
4479 * @return The setting's current value, or 'def' if it is not defined
4480 * or not a valid {@code long}.
4481 */
4482 public static long getLong(ContentResolver cr, String name, long def) {
4483 return getLongForUser(cr, name, def, UserHandle.myUserId());
4484 }
4485
4486 /** @hide */
4487 public static long getLongForUser(ContentResolver cr, String name, long def,
4488 int userHandle) {
4489 String valString = getStringForUser(cr, name, userHandle);
4490 long value;
4491 try {
4492 value = valString != null ? Long.parseLong(valString) : def;
4493 } catch (NumberFormatException e) {
4494 value = def;
4495 }
4496 return value;
4497 }
4498
4499 /**
4500 * Convenience function for retrieving a single secure settings value
4501 * as a {@code long}. Note that internally setting values are always
4502 * stored as strings; this function converts the string to a {@code long}
4503 * for you.
4504 * <p>
4505 * This version does not take a default value. If the setting has not
4506 * been set, or the string value is not a number,
4507 * it throws {@link SettingNotFoundException}.
4508 *
4509 * @param cr The ContentResolver to access.
4510 * @param name The name of the setting to retrieve.
4511 *
4512 * @return The setting's current value.
4513 * @throws SettingNotFoundException Thrown if a setting by the given
4514 * name can't be found or the setting value is not an integer.
4515 */
4516 public static long getLong(ContentResolver cr, String name)
4517 throws SettingNotFoundException {
4518 return getLongForUser(cr, name, UserHandle.myUserId());
4519 }
4520
4521 /** @hide */
4522 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
4523 throws SettingNotFoundException {
4524 String valString = getStringForUser(cr, name, userHandle);
4525 try {
4526 return Long.parseLong(valString);
4527 } catch (NumberFormatException e) {
4528 throw new SettingNotFoundException(name);
4529 }
4530 }
4531
4532 /**
4533 * Convenience function for updating a secure settings value as a long
4534 * integer. This will either create a new entry in the table if the
4535 * given name does not exist, or modify the value of the existing row
4536 * with that name. Note that internally setting values are always
4537 * stored as strings, so this function converts the given value to a
4538 * string before storing it.
4539 *
4540 * @param cr The ContentResolver to access.
4541 * @param name The name of the setting to modify.
4542 * @param value The new value for the setting.
4543 * @return true if the value was set, false on database errors
4544 */
4545 public static boolean putLong(ContentResolver cr, String name, long value) {
4546 return putLongForUser(cr, name, value, UserHandle.myUserId());
4547 }
4548
4549 /** @hide */
4550 public static boolean putLongForUser(ContentResolver cr, String name, long value,
4551 int userHandle) {
4552 return putStringForUser(cr, name, Long.toString(value), userHandle);
4553 }
4554
4555 /**
4556 * Convenience function for retrieving a single secure settings value
4557 * as a floating point number. Note that internally setting values are
4558 * always stored as strings; this function converts the string to an
4559 * float for you. The default value will be returned if the setting
4560 * is not defined or not a valid float.
4561 *
4562 * @param cr The ContentResolver to access.
4563 * @param name The name of the setting to retrieve.
4564 * @param def Value to return if the setting is not defined.
4565 *
4566 * @return The setting's current value, or 'def' if it is not defined
4567 * or not a valid float.
4568 */
4569 public static float getFloat(ContentResolver cr, String name, float def) {
4570 return getFloatForUser(cr, name, def, UserHandle.myUserId());
4571 }
4572
4573 /** @hide */
4574 public static float getFloatForUser(ContentResolver cr, String name, float def,
4575 int userHandle) {
4576 String v = getStringForUser(cr, name, userHandle);
4577 try {
4578 return v != null ? Float.parseFloat(v) : def;
4579 } catch (NumberFormatException e) {
4580 return def;
4581 }
4582 }
4583
4584 /**
4585 * Convenience function for retrieving a single secure settings value
4586 * as a float. Note that internally setting values are always
4587 * stored as strings; this function converts the string to a float
4588 * for you.
4589 * <p>
4590 * This version does not take a default value. If the setting has not
4591 * been set, or the string value is not a number,
4592 * it throws {@link SettingNotFoundException}.
4593 *
4594 * @param cr The ContentResolver to access.
4595 * @param name The name of the setting to retrieve.
4596 *
4597 * @throws SettingNotFoundException Thrown if a setting by the given
4598 * name can't be found or the setting value is not a float.
4599 *
4600 * @return The setting's current value.
4601 */
4602 public static float getFloat(ContentResolver cr, String name)
4603 throws SettingNotFoundException {
4604 return getFloatForUser(cr, name, UserHandle.myUserId());
4605 }
4606
4607 /** @hide */
4608 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
4609 throws SettingNotFoundException {
4610 String v = getStringForUser(cr, name, userHandle);
4611 if (v == null) {
4612 throw new SettingNotFoundException(name);
4613 }
4614 try {
4615 return Float.parseFloat(v);
4616 } catch (NumberFormatException e) {
4617 throw new SettingNotFoundException(name);
4618 }
4619 }
4620
4621 /**
4622 * Convenience function for updating a single settings value as a
4623 * floating point number. This will either create a new entry in the
4624 * table if the given name does not exist, or modify the value of the
4625 * existing row with that name. Note that internally setting values
4626 * are always stored as strings, so this function converts the given
4627 * value to a string before storing it.
4628 *
4629 * @param cr The ContentResolver to access.
4630 * @param name The name of the setting to modify.
4631 * @param value The new value for the setting.
4632 * @return true if the value was set, false on database errors
4633 */
4634 public static boolean putFloat(ContentResolver cr, String name, float value) {
4635 return putFloatForUser(cr, name, value, UserHandle.myUserId());
4636 }
4637
4638 /** @hide */
4639 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
4640 int userHandle) {
4641 return putStringForUser(cr, name, Float.toString(value), userHandle);
4642 }
4643
4644 /**
4645 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
4646 * instead
4647 */
4648 @Deprecated
4649 public static final String DEVELOPMENT_SETTINGS_ENABLED =
4650 Global.DEVELOPMENT_SETTINGS_ENABLED;
4651
4652 /**
4653 * When the user has enable the option to have a "bug report" command
4654 * in the power menu.
4655 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
4656 * @hide
4657 */
4658 @Deprecated
4659 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
4660
4661 /**
4662 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
4663 */
4664 @Deprecated
4665 public static final String ADB_ENABLED = Global.ADB_ENABLED;
4666
4667 /**
4668 * The hostname for this device
4669 * @hide
4670 */
4671 public static final String DEVICE_HOSTNAME = "device_hostname";
4672
4673 /**
4674 * The TCP/IP port to run ADB on, or -1 for USB
4675 * @hide
4676 */
4677 public static final String ADB_PORT = "adb_port";
4678
4679 /**
4680 * Whether to display the ADB notification.
4681 * @hide
4682 */
4683 public static final String ADB_NOTIFY = "adb_notify";
4684
4685 /**
4686 * Whether to reboot the device if an unknown ADB host is detected while screen is locked
4687 * @hide
4688 */
4689 public static final String ADB_PARANOID = "adb_paranoid";
4690
4691 /**
4692 * Setting to allow mock locations and location provider status to be injected into the
4693 * LocationManager service for testing purposes during application development. These
4694 * locations and status values override actual location and status information generated
4695 * by network, gps, or other location providers.
4696 */
4697 public static final String ALLOW_MOCK_LOCATION = "mock_location";
4698
4699 /**
4700 * A 64-bit number (as a hex string) that is randomly
4701 * generated on the device's first boot and should remain
4702 * constant for the lifetime of the device. (The value may
4703 * change if a factory reset is performed on the device.)
4704 */
4705 public static final String ANDROID_ID = "android_id";
4706
4707 /**
4708 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
4709 */
4710 @Deprecated
4711 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
4712
4713 /**
4714 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
4715 */
4716 @Deprecated
4717 public static final String DATA_ROAMING = Global.DATA_ROAMING;
4718
4719 /**
4720 * Setting to record the input method used by default, holding the ID
4721 * of the desired method.
4722 */
4723 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
4724
4725 /**
4726 * Setting to record the input method subtype used by default, holding the ID
4727 * of the desired method.
4728 */
4729 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
4730 "selected_input_method_subtype";
4731
4732 /**
4733 * Setting to record the history of input method subtype, holding the pair of ID of IME
4734 * and its last used subtype.
4735 * @hide
4736 */
4737 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
4738 "input_methods_subtype_history";
4739
4740 /**
4741 * Setting to record the visibility of input method selector
4742 */
4743 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
4744 "input_method_selector_visibility";
4745
4746 /**
4747 * bluetooth HCI snoop log configuration
4748 * @hide
4749 */
4750 public static final String BLUETOOTH_HCI_LOG =
4751 "bluetooth_hci_log";
4752
4753 /**
4754 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
4755 */
4756 @Deprecated
4757 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
4758
4759 /**
4760 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
4761 * @hide
4762 */
4763 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
4764
4765 /**
4766 * List of input methods that are currently enabled. This is a string
4767 * containing the IDs of all enabled input methods, each ID separated
4768 * by ':'.
4769 */
4770 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
4771
4772 /**
4773 * List of system input methods that are currently disabled. This is a string
4774 * containing the IDs of all disabled input methods, each ID separated
4775 * by ':'.
4776 * @hide
4777 */
4778 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
4779
4780 /**
4781 * Host name and port for global http proxy. Uses ':' seperator for
4782 * between host and port.
4783 *
4784 * @deprecated Use {@link Global#HTTP_PROXY}
4785 */
4786 @Deprecated
4787 public static final String HTTP_PROXY = Global.HTTP_PROXY;
4788
4789 /**
4790 * @deprecated Use {@link android.provider.Settings.Global#INSTALL_NON_MARKET_APPS} instead
4791 */
4792 @Deprecated
4793 public static final String INSTALL_NON_MARKET_APPS = Global.INSTALL_NON_MARKET_APPS;
4794
4795 /**
4796 * Comma-separated list of location providers that activities may access.
4797 *
4798 * @deprecated use {@link #LOCATION_MODE}
4799 */
4800 @Deprecated
4801 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
4802
4803 /**
4804 * The degree of location access enabled by the user.
4805 * <p/>
4806 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
4807 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
4808 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
4809 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
4810 * modes that might be added in the future.
4811 */
4812 public static final String LOCATION_MODE = "location_mode";
4813
4814 /**
4815 * The last degree of location access enabled by the user.
4816 * <p/>
4817 * Must be one of {@link
4818 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
4819 * #LOCATION_MODE_BATTERY_SAVING}.
4820 *
4821 * @hide
4822 */
4823 public static final String LOCATION_LAST_MODE = "location_last_mode";
4824
4825 /**
4826 * Location access disabled.
4827 */
4828 public static final int LOCATION_MODE_OFF = 0;
4829 /**
4830 * Network Location Provider disabled, but GPS and other sensors enabled.
4831 */
4832 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
4833 /**
4834 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
4835 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
4836 * {@link android.location.Criteria#POWER_MEDIUM}.
4837 */
4838 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
4839 /**
4840 * Best-effort location computation allowed.
4841 */
4842 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
4843
4844 /**
4845 * A flag containing settings used for biometric weak
4846 * @hide
4847 */
4848 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
4849 "lock_biometric_weak_flags";
4850
4851 /**
4852 * Whether autolock is enabled (0 = false, 1 = true)
4853 */
4854 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
4855
4856 /**
4857 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
4858 */
4859 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
4860
4861 /**
4862 * Whether the NumKeyPad will change the orders of numbers
4863 * in a PIN locked lockscreen
4864 * 0 = off | 1 = always | 2 = only on request
4865 * @hide
4866 */
4867
4868 public static final String LOCK_NUMPAD_RANDOM = "lock_numpad_random";
4869
4870 /**
4871 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
4872 * true)
4873 *
4874 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
4875 * lockscreen uses
4876 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
4877 */
4878 @Deprecated
4879 public static final String
4880 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
4881
4882 /**
4883 * This preference allows the device to be locked given time after screen goes off,
4884 * subject to current DeviceAdmin policy limits.
4885 * @hide
4886 */
4887 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
4888
4889
4890 /**
4891 * This preference contains the string that shows for owner info on LockScreen.
4892 * @hide
4893 * @deprecated
4894 */
4895 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
4896
4897 /**
4898 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
4899 * @hide
4900 */
4901 public static final String LOCK_SCREEN_APPWIDGET_IDS =
4902 "lock_screen_appwidget_ids";
4903
4904 /**
4905 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
4906 * @hide
4907 */
4908 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
4909 "lock_screen_fallback_appwidget_id";
4910
4911 /**
4912 * Index of the lockscreen appwidget to restore, -1 if none.
4913 * @hide
4914 */
4915 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
4916 "lock_screen_sticky_appwidget";
4917
4918 /**
4919 * This preference enables showing the owner info on LockScreen.
4920 * @hide
4921 * @deprecated
4922 */
4923 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
4924 "lock_screen_owner_info_enabled";
4925
4926 /**
4927 * The Logging ID (a unique 64-bit value) as a hex string.
4928 * Used as a pseudonymous identifier for logging.
4929 * @deprecated This identifier is poorly initialized and has
4930 * many collisions. It should not be used.
4931 */
4932 @Deprecated
4933 public static final String LOGGING_ID = "logging_id";
4934
4935 /**
4936 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
4937 */
4938 @Deprecated
4939 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
4940
4941 /**
4942 * No longer supported.
4943 */
4944 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
4945
4946 /**
4947 * No longer supported.
4948 */
4949 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
4950
4951 /**
4952 * No longer supported.
4953 */
4954 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
4955
4956 /**
4957 * Settings classname to launch when Settings is clicked from All
4958 * Applications. Needed because of user testing between the old
4959 * and new Settings apps.
4960 */
4961 // TODO: 881807
4962 public static final String SETTINGS_CLASSNAME = "settings_classname";
4963
4964 /**
4965 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
4966 */
4967 @Deprecated
4968 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
4969
4970 /**
4971 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
4972 */
4973 @Deprecated
4974 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
4975
4976 /**
4977 * If accessibility is enabled.
4978 */
4979 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
4980
4981 /**
4982 * If touch exploration is enabled.
4983 */
4984 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
4985
4986 /**
4987 * List of the enabled accessibility providers.
4988 */
4989 public static final String ENABLED_ACCESSIBILITY_SERVICES =
4990 "enabled_accessibility_services";
4991
4992 /**
4993 * List of the accessibility services to which the user has granted
4994 * permission to put the device into touch exploration mode.
4995 *
4996 * @hide
4997 */
4998 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
4999 "touch_exploration_granted_accessibility_services";
5000
5001 /**
5002 * Whether to speak passwords while in accessibility mode.
5003 */
5004 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
5005
5006 /**
5007 * If injection of accessibility enhancing JavaScript screen-reader
5008 * is enabled.
5009 * <p>
5010 * Note: The JavaScript based screen-reader is served by the
5011 * Google infrastructure and enable users with disabilities to
5012 * efficiently navigate in and explore web content.
5013 * </p>
5014 * <p>
5015 * This property represents a boolean value.
5016 * </p>
5017 * @hide
5018 */
5019 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
5020 "accessibility_script_injection";
5021
5022 /**
5023 * The URL for the injected JavaScript based screen-reader used
5024 * for providing accessibility of content in WebView.
5025 * <p>
5026 * Note: The JavaScript based screen-reader is served by the
5027 * Google infrastructure and enable users with disabilities to
5028 * efficiently navigate in and explore web content.
5029 * </p>
5030 * <p>
5031 * This property represents a string value.
5032 * </p>
5033 * @hide
5034 */
5035 public static final String ACCESSIBILITY_SCREEN_READER_URL =
5036 "accessibility_script_injection_url";
5037
5038 /**
5039 * Key bindings for navigation in built-in accessibility support for web content.
5040 * <p>
5041 * Note: These key bindings are for the built-in accessibility navigation for
5042 * web content which is used as a fall back solution if JavaScript in a WebView
5043 * is not enabled or the user has not opted-in script injection from Google.
5044 * </p>
5045 * <p>
5046 * The bindings are separated by semi-colon. A binding is a mapping from
5047 * a key to a sequence of actions (for more details look at
5048 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
5049 * string representation of an integer obtained from a meta state (optional) shifted
5050 * sixteen times left and bitwise ored with a key code. An action is represented
5051 * as a hexademical string representation of an integer where the first two digits
5052 * are navigation action index, the second, the third, and the fourth digit pairs
5053 * represent the action arguments. The separate actions in a binding are colon
5054 * separated. The key and the action sequence it maps to are separated by equals.
5055 * </p>
5056 * <p>
5057 * For example, the binding below maps the DPAD right button to traverse the
5058 * current navigation axis once without firing an accessibility event and to
5059 * perform the same traversal again but to fire an event:
5060 * <code>
5061 * 0x16=0x01000100:0x01000101;
5062 * </code>
5063 * </p>
5064 * <p>
5065 * The goal of this binding is to enable dynamic rebinding of keys to
5066 * navigation actions for web content without requiring a framework change.
5067 * </p>
5068 * <p>
5069 * This property represents a string value.
5070 * </p>
5071 * @hide
5072 */
5073 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
5074 "accessibility_web_content_key_bindings";
5075
5076 /**
5077 * Setting that specifies whether the display magnification is enabled.
5078 * Display magnifications allows the user to zoom in the display content
5079 * and is targeted to low vision users. The current magnification scale
5080 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
5081 *
5082 * @hide
5083 */
5084 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
5085 "accessibility_display_magnification_enabled";
5086
5087 /**
5088 * Setting that specifies what the display magnification scale is.
5089 * Display magnifications allows the user to zoom in the display
5090 * content and is targeted to low vision users. Whether a display
5091 * magnification is performed is controlled by
5092 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
5093 *
5094 * @hide
5095 */
5096 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
5097 "accessibility_display_magnification_scale";
5098
5099 /**
5100 * Setting that specifies whether the display magnification should be
5101 * automatically updated. If this fearture is enabled the system will
5102 * exit magnification mode or pan the viewport when a context change
5103 * occurs. For example, on staring a new activity or rotating the screen,
5104 * the system may zoom out so the user can see the new context he is in.
5105 * Another example is on showing a window that is not visible in the
5106 * magnified viewport the system may pan the viewport to make the window
5107 * the has popped up so the user knows that the context has changed.
5108 * Whether a screen magnification is performed is controlled by
5109 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
5110 *
5111 * @hide
5112 */
5113 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
5114 "accessibility_display_magnification_auto_update";
5115
5116 /**
5117 * Setting that specifies whether timed text (captions) should be
5118 * displayed in video content. Text display properties are controlled by
5119 * the following settings:
5120 * <ul>
5121 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
5122 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
5123 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
5124 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
5125 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
5126 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
5127 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
5128 * </ul>
5129 *
5130 * @hide
5131 */
5132 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
5133 "accessibility_captioning_enabled";
5134
5135 /**
5136 * Setting that specifies the language for captions as a locale string,
5137 * e.g. en_US.
5138 *
5139 * @see java.util.Locale#toString
5140 * @hide
5141 */
5142 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
5143 "accessibility_captioning_locale";
5144
5145 /**
5146 * Integer property that specifies the preset style for captions, one
5147 * of:
5148 * <ul>
5149 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
5150 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
5151 * </ul>
5152 *
5153 * @see java.util.Locale#toString
5154 * @hide
5155 */
5156 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
5157 "accessibility_captioning_preset";
5158
5159 /**
5160 * Integer property that specifes the background color for captions as a
5161 * packed 32-bit color.
5162 *
5163 * @see android.graphics.Color#argb
5164 * @hide
5165 */
5166 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
5167 "accessibility_captioning_background_color";
5168
5169 /**
5170 * Integer property that specifes the foreground color for captions as a
5171 * packed 32-bit color.
5172 *
5173 * @see android.graphics.Color#argb
5174 * @hide
5175 */
5176 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
5177 "accessibility_captioning_foreground_color";
5178
5179 /**
5180 * Integer property that specifes the edge type for captions, one of:
5181 * <ul>
5182 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
5183 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
5184 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
5185 * </ul>
5186 *
5187 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
5188 * @hide
5189 */
5190 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
5191 "accessibility_captioning_edge_type";
5192
5193 /**
5194 * Integer property that specifes the edge color for captions as a
5195 * packed 32-bit color.
5196 *
5197 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
5198 * @see android.graphics.Color#argb
5199 * @hide
5200 */
5201 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
5202 "accessibility_captioning_edge_color";
5203
5204 /**
5205 * String property that specifies the typeface for captions, one of:
5206 * <ul>
5207 * <li>DEFAULT
5208 * <li>MONOSPACE
5209 * <li>SANS_SERIF
5210 * <li>SERIF
5211 * </ul>
5212 *
5213 * @see android.graphics.Typeface
5214 * @hide
5215 */
5216 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
5217 "accessibility_captioning_typeface";
5218
5219 /**
5220 * Floating point property that specifies font scaling for captions.
5221 *
5222 * @hide
5223 */
5224 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
5225 "accessibility_captioning_font_scale";
5226
5227 /**
5228 * The timout for considering a press to be a long press in milliseconds.
5229 * @hide
5230 */
5231 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
5232
5233 /**
5234 * List of the enabled print services.
5235 * @hide
5236 */
5237 public static final String ENABLED_PRINT_SERVICES =
5238 "enabled_print_services";
5239
5240 /**
5241 * List of the system print services we enabled on first boot. On
5242 * first boot we enable all system, i.e. bundled print services,
5243 * once, so they work out-of-the-box.
5244 * @hide
5245 */
5246 public static final String ENABLED_ON_FIRST_BOOT_SYSTEM_PRINT_SERVICES =
5247 "enabled_on_first_boot_system_print_services";
5248
5249 /**
5250 * Setting to always use the default text-to-speech settings regardless
5251 * of the application settings.
5252 * 1 = override application settings,
5253 * 0 = use application settings (if specified).
5254 *
5255 * @deprecated The value of this setting is no longer respected by
5256 * the framework text to speech APIs as of the Ice Cream Sandwich release.
5257 */
5258 @Deprecated
5259 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
5260
5261 /**
5262 * Default text-to-speech engine speech rate. 100 = 1x
5263 */
5264 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
5265
5266 /**
5267 * Default text-to-speech engine pitch. 100 = 1x
5268 */
5269 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
5270
5271 /**
5272 * Default text-to-speech engine.
5273 */
5274 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
5275
5276 /**
5277 * Default text-to-speech language.
5278 *
5279 * @deprecated this setting is no longer in use, as of the Ice Cream
5280 * Sandwich release. Apps should never need to read this setting directly,
5281 * instead can query the TextToSpeech framework classes for the default
5282 * locale. {@link TextToSpeech#getLanguage()}.
5283 */
5284 @Deprecated
5285 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
5286
5287 /**
5288 * Default text-to-speech country.
5289 *
5290 * @deprecated this setting is no longer in use, as of the Ice Cream
5291 * Sandwich release. Apps should never need to read this setting directly,
5292 * instead can query the TextToSpeech framework classes for the default
5293 * locale. {@link TextToSpeech#getLanguage()}.
5294 */
5295 @Deprecated
5296 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
5297
5298 /**
5299 * Default text-to-speech locale variant.
5300 *
5301 * @deprecated this setting is no longer in use, as of the Ice Cream
5302 * Sandwich release. Apps should never need to read this setting directly,
5303 * instead can query the TextToSpeech framework classes for the
5304 * locale that is in use {@link TextToSpeech#getLanguage()}.
5305 */
5306 @Deprecated
5307 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
5308
5309 /**
5310 * Stores the default tts locales on a per engine basis. Stored as
5311 * a comma seperated list of values, each value being of the form
5312 * {@code engine_name:locale} for example,
5313 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
5314 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
5315 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
5316 * setting directly, and can query the TextToSpeech framework classes
5317 * for the locale that is in use.
5318 *
5319 * @hide
5320 */
5321 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
5322
5323 /**
5324 * Space delimited list of plugin packages that are enabled.
5325 */
5326 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
5327
5328 /**
5329 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
5330 * instead.
5331 */
5332 @Deprecated
5333 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
5334 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
5335
5336 /**
5337 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
5338 * instead.
5339 */
5340 @Deprecated
5341 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
5342 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
5343
5344 /**
5345 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
5346 * instead.
5347 */
5348 @Deprecated
5349 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
5350 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
5351
5352 /**
5353 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
5354 * instead.
5355 */
5356 @Deprecated
5357 public static final String WIFI_ON = Global.WIFI_ON;
5358
5359 /**
5360 * The acceptable packet loss percentage (range 0 - 100) before trying
5361 * another AP on the same network.
5362 * @deprecated This setting is not used.
5363 */
5364 @Deprecated
5365 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
5366 "wifi_watchdog_acceptable_packet_loss_percentage";
5367
5368 /**
5369 * The number of access points required for a network in order for the
5370 * watchdog to monitor it.
5371 * @deprecated This setting is not used.
5372 */
5373 @Deprecated
5374 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
5375
5376 /**
5377 * The delay between background checks.
5378 * @deprecated This setting is not used.
5379 */
5380 @Deprecated
5381 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
5382 "wifi_watchdog_background_check_delay_ms";
5383
5384 /**
5385 * Whether the Wi-Fi watchdog is enabled for background checking even
5386 * after it thinks the user has connected to a good access point.
5387 * @deprecated This setting is not used.
5388 */
5389 @Deprecated
5390 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
5391 "wifi_watchdog_background_check_enabled";
5392
5393 /**
5394 * The timeout for a background ping
5395 * @deprecated This setting is not used.
5396 */
5397 @Deprecated
5398 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
5399 "wifi_watchdog_background_check_timeout_ms";
5400
5401 /**
5402 * The number of initial pings to perform that *may* be ignored if they
5403 * fail. Again, if these fail, they will *not* be used in packet loss
5404 * calculation. For example, one network always seemed to time out for
5405 * the first couple pings, so this is set to 3 by default.
5406 * @deprecated This setting is not used.
5407 */
5408 @Deprecated
5409 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
5410 "wifi_watchdog_initial_ignored_ping_count";
5411
5412 /**
5413 * The maximum number of access points (per network) to attempt to test.
5414 * If this number is reached, the watchdog will no longer monitor the
5415 * initial connection state for the network. This is a safeguard for
5416 * networks containing multiple APs whose DNS does not respond to pings.
5417 * @deprecated This setting is not used.
5418 */
5419 @Deprecated
5420 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
5421
5422 /**
5423 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
5424 */
5425 @Deprecated
5426 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
5427
5428 /**
5429 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
5430 * @deprecated This setting is not used.
5431 */
5432 @Deprecated
5433 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
5434
5435 /**
5436 * The number of pings to test if an access point is a good connection.
5437 * @deprecated This setting is not used.
5438 */
5439 @Deprecated
5440 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
5441
5442 /**
5443 * The delay between pings.
5444 * @deprecated This setting is not used.
5445 */
5446 @Deprecated
5447 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
5448
5449 /**
5450 * The timeout per ping.
5451 * @deprecated This setting is not used.
5452 */
5453 @Deprecated
5454 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
5455
5456 /**
5457 * @deprecated Use
5458 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
5459 */
5460 @Deprecated
5461 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
5462
5463 /**
5464 * @deprecated Use
5465 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
5466 */
5467 @Deprecated
5468 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
5469 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
5470
5471 /**
5472 * Whether background data usage is allowed.
5473 *
5474 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
5475 * availability of background data depends on several
5476 * combined factors. When background data is unavailable,
5477 * {@link ConnectivityManager#getActiveNetworkInfo()} will
5478 * now appear disconnected.
5479 */
5480 @Deprecated
5481 public static final String BACKGROUND_DATA = "background_data";
5482
5483 /**
5484 * Origins for which browsers should allow geolocation by default.
5485 * The value is a space-separated list of origins.
5486 */
5487 public static final String ALLOWED_GEOLOCATION_ORIGINS
5488 = "allowed_geolocation_origins";
5489
5490 /**
5491 * The preferred TTY mode 0 = TTy Off, CDMA default
5492 * 1 = TTY Full
5493 * 2 = TTY HCO
5494 * 3 = TTY VCO
5495 * @hide
5496 */
5497 public static final String PREFERRED_TTY_MODE =
5498 "preferred_tty_mode";
5499
5500 /**
5501 * Whether the enhanced voice privacy mode is enabled.
5502 * 0 = normal voice privacy
5503 * 1 = enhanced voice privacy
5504 * @hide
5505 */
5506 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
5507
5508 /**
5509 * Whether the TTY mode mode is enabled.
5510 * 0 = disabled
5511 * 1 = enabled
5512 * @hide
5513 */
5514 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
5515
5516 /**
5517 * Controls whether settings backup is enabled.
5518 * Type: int ( 0 = disabled, 1 = enabled )
5519 * @hide
5520 */
5521 public static final String BACKUP_ENABLED = "backup_enabled";
5522
5523 /**
5524 * Controls whether application data is automatically restored from backup
5525 * at install time.
5526 * Type: int ( 0 = disabled, 1 = enabled )
5527 * @hide
5528 */
5529 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
5530
5531 /**
5532 * Indicates whether settings backup has been fully provisioned.
5533 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
5534 * @hide
5535 */
5536 public static final String BACKUP_PROVISIONED = "backup_provisioned";
5537
5538 /**
5539 * Component of the transport to use for backup/restore.
5540 * @hide
5541 */
5542 public static final String BACKUP_TRANSPORT = "backup_transport";
5543
5544 /**
5545 * Version for which the setup wizard was last shown. Bumped for
5546 * each release when there is new setup information to show.
5547 * @hide
5548 */
5549 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
5550
5551 /**
5552 * The interval in milliseconds after which Wi-Fi is considered idle.
5553 * When idle, it is possible for the device to be switched from Wi-Fi to
5554 * the mobile data network.
5555 * @hide
5556 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
5557 * instead.
5558 */
5559 @Deprecated
5560 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
5561
5562 /**
5563 * The global search provider chosen by the user (if multiple global
5564 * search providers are installed). This will be the provider returned
5565 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
5566 * installed. This setting is stored as a flattened component name as
5567 * per {@link ComponentName#flattenToString()}.
5568 *
5569 * @hide
5570 */
5571 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
5572 "search_global_search_activity";
5573
5574 /**
5575 * The number of promoted sources in GlobalSearch.
5576 * @hide
5577 */
5578 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
5579 /**
5580 * The maximum number of suggestions returned by GlobalSearch.
5581 * @hide
5582 */
5583 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
5584 /**
5585 * The number of suggestions GlobalSearch will ask each non-web search source for.
5586 * @hide
5587 */
5588 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
5589 /**
5590 * The number of suggestions the GlobalSearch will ask the web search source for.
5591 * @hide
5592 */
5593 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
5594 "search_web_results_override_limit";
5595 /**
5596 * The number of milliseconds that GlobalSearch will wait for suggestions from
5597 * promoted sources before continuing with all other sources.
5598 * @hide
5599 */
5600 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
5601 "search_promoted_source_deadline_millis";
5602 /**
5603 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
5604 * @hide
5605 */
5606 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
5607 /**
5608 * The maximum number of milliseconds that GlobalSearch shows the previous results
5609 * after receiving a new query.
5610 * @hide
5611 */
5612 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
5613 /**
5614 * The maximum age of log data used for shortcuts in GlobalSearch.
5615 * @hide
5616 */
5617 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
5618 /**
5619 * The maximum age of log data used for source ranking in GlobalSearch.
5620 * @hide
5621 */
5622 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
5623 "search_max_source_event_age_millis";
5624 /**
5625 * The minimum number of impressions needed to rank a source in GlobalSearch.
5626 * @hide
5627 */
5628 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
5629 "search_min_impressions_for_source_ranking";
5630 /**
5631 * The minimum number of clicks needed to rank a source in GlobalSearch.
5632 * @hide
5633 */
5634 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
5635 "search_min_clicks_for_source_ranking";
5636 /**
5637 * The maximum number of shortcuts shown by GlobalSearch.
5638 * @hide
5639 */
5640 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
5641 /**
5642 * The size of the core thread pool for suggestion queries in GlobalSearch.
5643 * @hide
5644 */
5645 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
5646 "search_query_thread_core_pool_size";
5647 /**
5648 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
5649 * @hide
5650 */
5651 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
5652 "search_query_thread_max_pool_size";
5653 /**
5654 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
5655 * @hide
5656 */
5657 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
5658 "search_shortcut_refresh_core_pool_size";
5659 /**
5660 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
5661 * @hide
5662 */
5663 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
5664 "search_shortcut_refresh_max_pool_size";
5665 /**
5666 * The maximun time that excess threads in the GlobalSeach thread pools will
5667 * wait before terminating.
5668 * @hide
5669 */
5670 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
5671 "search_thread_keepalive_seconds";
5672 /**
5673 * The maximum number of concurrent suggestion queries to each source.
5674 * @hide
5675 */
5676 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
5677 "search_per_source_concurrent_query_limit";
5678
5679 /**
5680 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
5681 * @hide
5682 */
5683 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
5684
5685 /**
5686 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
5687 * @hide
5688 */
5689 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
5690
5691 /**
5692 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
5693 * @hide
5694 */
5695 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
5696
5697 /**
5698 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
5699 * @hide
5700 */
5701 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
5702
5703 /**
5704 * If nonzero, ANRs in invisible background processes bring up a dialog.
5705 * Otherwise, the process will be silently killed.
5706 * @hide
5707 */
5708 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
5709
5710 /**
5711 * The {@link ComponentName} string of the service to be used as the voice recognition
5712 * service.
5713 *
5714 * @hide
5715 */
5716 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
5717
5718 /**
5719 * Stores whether an user has consented to have apps verified through PAM.
5720 * The value is boolean (1 or 0).
5721 *
5722 * @hide
5723 */
5724 public static final String PACKAGE_VERIFIER_USER_CONSENT =
5725 "package_verifier_user_consent";
5726
5727 /**
5728 * The {@link ComponentName} string of the selected spell checker service which is
5729 * one of the services managed by the text service manager.
5730 *
5731 * @hide
5732 */
5733 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
5734
5735 /**
5736 * The {@link ComponentName} string of the selected subtype of the selected spell checker
5737 * service which is one of the services managed by the text service manager.
5738 *
5739 * @hide
5740 */
5741 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
5742 "selected_spell_checker_subtype";
5743
5744 /**
5745 * The {@link ComponentName} string whether spell checker is enabled or not.
5746 *
5747 * @hide
5748 */
5749 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
5750
5751 /**
5752 * What happens when the user presses the Power button while in-call
5753 * and the screen is on.<br/>
5754 * <b>Values:</b><br/>
5755 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
5756 * 2 - The Power button hangs up the current call.<br/>
5757 *
5758 * @hide
5759 */
5760 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
5761
5762 /**
5763 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
5764 * @hide
5765 */
5766 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
5767
5768 /**
5769 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
5770 * @hide
5771 */
5772 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
5773
5774 /**
5775 * INCALL_POWER_BUTTON_BEHAVIOR default value.
5776 * @hide
5777 */
5778 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
5779 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
5780
5781 /**
5782 * The current night mode that has been selected by the user. Owned
5783 * and controlled by UiModeManagerService. Constants are as per
5784 * UiModeManager.
5785 * @hide
5786 */
5787 public static final String UI_NIGHT_MODE = "ui_night_mode";
5788
5789 /**
5790 * Whether screensavers are enabled.
5791 * @hide
5792 */
5793 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
5794
5795 /**
5796 * The user's chosen screensaver components.
5797 *
5798 * These will be launched by the PhoneWindowManager after a timeout when not on
5799 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
5800 * @hide
5801 */
5802 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
5803
5804 /**
5805 * If screensavers are enabled, whether the screensaver should be automatically launched
5806 * when the device is inserted into a (desk) dock.
5807 * @hide
5808 */
5809 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
5810
5811 /**
5812 * If screensavers are enabled, whether the screensaver should be automatically launched
5813 * when the screen times out when not on battery.
5814 * @hide
5815 */
5816 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
5817
5818 /**
5819 * If screensavers are enabled, the default screensaver component.
5820 * @hide
5821 */
5822 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
5823
5824 /**
5825 * The default NFC payment component
5826 * @hide
5827 */
5828 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
5829
5830 /**
5831 * Specifies the package name currently configured to be the primary sms application
5832 * @hide
5833 */
5834 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
5835
5836 /**
5837 * Name of a package that the current user has explicitly allowed to see all of that
5838 * user's notifications.
5839 *
5840 * @hide
5841 */
5842 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
5843
5844 /** @hide */
5845 public static final String BAR_SERVICE_COMPONENT = "bar_service_component";
5846
5847 /** @hide */
5848 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
5849
5850 /**
5851 * This is the query URI for finding a print service to install.
5852 *
5853 * @hide
5854 */
5855 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
5856
5857 /**
5858 * This is the query URI for finding a NFC payment service to install.
5859 *
5860 * @hide
5861 */
5862 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
5863
5864 /**
5865 * Whether to include options in power menu for rebooting into recovery or bootloader
5866 * @hide
5867 */
5868 public static final String ADVANCED_REBOOT = "advanced_reboot";
5869
5870 /**
5871 * Whether developer settings dare enabled.
5872 * @hide
5873 */
5874 public static final String DEVELOPER_OPTIONS_ENABLED = "developer_options_enabled";
5875
5876 /**
5877 * This are the settings to be backed up.
5878 *
5879 * NOTE: Settings are backed up and restored in the order they appear
5880 * in this array. If you have one setting depending on another,
5881 * make sure that they are ordered appropriately.
5882 *
5883 * @hide
5884 */
5885 public static final String[] SETTINGS_TO_BACKUP = {
5886 BUGREPORT_IN_POWER_MENU, // moved to global
5887 ALLOW_MOCK_LOCATION,
5888 PARENTAL_CONTROL_ENABLED,
5889 PARENTAL_CONTROL_REDIRECT_URL,
5890 USB_MASS_STORAGE_ENABLED, // moved to global
5891 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
5892 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
5893 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
5894 ACCESSIBILITY_SCRIPT_INJECTION,
5895 BACKUP_AUTO_RESTORE,
5896 ENABLED_ACCESSIBILITY_SERVICES,
5897 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
5898 TOUCH_EXPLORATION_ENABLED,
5899 ACCESSIBILITY_ENABLED,
5900 ACCESSIBILITY_SPEAK_PASSWORD,
5901 ACCESSIBILITY_CAPTIONING_ENABLED,
5902 ACCESSIBILITY_CAPTIONING_LOCALE,
5903 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
5904 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
5905 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
5906 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
5907 ACCESSIBILITY_CAPTIONING_TYPEFACE,
5908 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
5909 TTS_USE_DEFAULTS,
5910 TTS_DEFAULT_RATE,
5911 TTS_DEFAULT_PITCH,
5912 TTS_DEFAULT_SYNTH,
5913 TTS_DEFAULT_LANG,
5914 TTS_DEFAULT_COUNTRY,
5915 TTS_ENABLED_PLUGINS,
5916 TTS_DEFAULT_LOCALE,
5917 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
5918 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
5919 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
5920 MOUNT_PLAY_NOTIFICATION_SND,
5921 MOUNT_UMS_AUTOSTART,
5922 MOUNT_UMS_PROMPT,
5923 MOUNT_UMS_NOTIFY_ENABLED,
5924 UI_NIGHT_MODE,
5925 ADVANCED_REBOOT
5926 };
5927
5928 /**
5929 * Helper method for determining if a location provider is enabled.
5930 *
5931 * @param cr the content resolver to use
5932 * @param provider the location provider to query
5933 * @return true if the provider is enabled
5934 *
5935 * @deprecated use {@link #LOCATION_MODE} or
5936 * {@link LocationManager#isProviderEnabled(String)}
5937 */
5938 @Deprecated
5939 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
5940 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
5941 }
5942
5943 /**
5944 * Helper method for determining if a location provider is enabled.
5945 * @param cr the content resolver to use
5946 * @param provider the location provider to query
5947 * @param userId the userId to query
5948 * @return true if the provider is enabled
5949 * @deprecated use {@link #LOCATION_MODE} or
5950 * {@link LocationManager#isProviderEnabled(String)}
5951 * @hide
5952 */
5953 @Deprecated
5954 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
5955 String allowedProviders = Settings.Secure.getStringForUser(cr,
5956 LOCATION_PROVIDERS_ALLOWED, userId);
5957 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
5958 }
5959
5960 /**
5961 * Thread-safe method for enabling or disabling a single location provider.
5962 * @param cr the content resolver to use
5963 * @param provider the location provider to enable or disable
5964 * @param enabled true if the provider should be enabled
5965 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE}
5966 */
5967 @Deprecated
5968 public static final void setLocationProviderEnabled(ContentResolver cr,
5969 String provider, boolean enabled) {
5970 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
5971 }
5972
5973 /**
5974 * Thread-safe method for enabling or disabling a single location provider.
5975 *
5976 * @param cr the content resolver to use
5977 * @param provider the location provider to enable or disable
5978 * @param enabled true if the provider should be enabled
5979 * @param userId the userId for which to enable/disable providers
5980 * @return true if the value was set, false on database errors
5981 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and
5982 * {@link #LOCATION_MODE}
5983 * @hide
5984 */
5985 @Deprecated
5986 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
5987 String provider, boolean enabled, int userId) {
5988 synchronized (mLocationSettingsLock) {
5989 // to ensure thread safety, we write the provider name with a '+' or '-'
5990 // and let the SettingsProvider handle it rather than reading and modifying
5991 // the list of enabled providers.
5992 if (enabled) {
5993 provider = "+" + provider;
5994 } else {
5995 provider = "-" + provider;
5996 }
5997 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
5998 userId);
5999 }
6000 }
6001
6002 /**
6003 * Thread-safe method for setting the location mode to one of
6004 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
6005 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
6006 *
6007 * @param cr the content resolver to use
6008 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
6009 * @param userId the userId for which to change mode
6010 * @return true if the value was set, false on database errors
6011 *
6012 * @throws IllegalArgumentException if mode is not one of the supported values
6013 */
6014 private static final boolean setLocationModeForUser(ContentResolver cr, int mode,
6015 int userId) {
6016 synchronized (mLocationSettingsLock) {
6017 boolean gps = false;
6018 boolean network = false;
6019 switch (mode) {
6020 case LOCATION_MODE_OFF:
6021 break;
6022 case LOCATION_MODE_SENSORS_ONLY:
6023 gps = true;
6024 break;
6025 case LOCATION_MODE_BATTERY_SAVING:
6026 network = true;
6027 break;
6028 case LOCATION_MODE_HIGH_ACCURACY:
6029 gps = true;
6030 network = true;
6031 break;
6032 default:
6033 throw new IllegalArgumentException("Invalid location mode: " + mode);
6034 }
6035 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
6036 cr, LocationManager.GPS_PROVIDER, gps, userId);
6037 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
6038 cr, LocationManager.NETWORK_PROVIDER, network, userId);
6039 return gpsSuccess && nlpSuccess;
6040 }
6041 }
6042
6043 /**
6044 * Thread-safe method for reading the location mode, returns one of
6045 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
6046 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
6047 *
6048 * @param cr the content resolver to use
6049 * @param userId the userId for which to read the mode
6050 * @return the location mode
6051 */
6052 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
6053 synchronized (mLocationSettingsLock) {
6054 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
6055 cr, LocationManager.GPS_PROVIDER, userId);
6056 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
6057 cr, LocationManager.NETWORK_PROVIDER, userId);
6058 if (gpsEnabled && networkEnabled) {
6059 return LOCATION_MODE_HIGH_ACCURACY;
6060 } else if (gpsEnabled) {
6061 return LOCATION_MODE_SENSORS_ONLY;
6062 } else if (networkEnabled) {
6063 return LOCATION_MODE_BATTERY_SAVING;
6064 } else {
6065 return LOCATION_MODE_OFF;
6066 }
6067 }
6068 }
6069 }
6070
6071 /**
6072 * Global system settings, containing preferences that always apply identically
6073 * to all defined users. Applications can read these but are not allowed to write;
6074 * like the "Secure" settings, these are for preferences that the user must
6075 * explicitly modify through the system UI or specialized APIs for those values.
6076 */
6077 public static final class Global extends NameValueTable {
6078 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_global_version";
6079
6080 /**
6081 * The content:// style URL for global secure settings items. Not public.
6082 */
6083 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
6084
6085 /**
6086 * Setting whether the global gesture for enabling accessibility is enabled.
6087 * If this gesture is enabled the user will be able to perfrom it to enable
6088 * the accessibility state without visiting the settings app.
6089 * @hide
6090 */
6091 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
6092 "enable_accessibility_global_gesture_enabled";
6093
6094 /**
6095 * Whether Airplane Mode is on.
6096 */
6097 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
6098
6099 /**
6100 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
6101 */
6102 public static final String RADIO_BLUETOOTH = "bluetooth";
6103
6104 /**
6105 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
6106 */
6107 public static final String RADIO_WIFI = "wifi";
6108
6109 /**
6110 * {@hide}
6111 */
6112 public static final String RADIO_WIMAX = "wimax";
6113 /**
6114 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
6115 */
6116 public static final String RADIO_CELL = "cell";
6117
6118 /**
6119 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
6120 */
6121 public static final String RADIO_NFC = "nfc";
6122
6123 /**
6124 * A comma separated list of radios that need to be disabled when airplane mode
6125 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
6126 * included in the comma separated list.
6127 */
6128 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
6129
6130 /**
6131 * A comma separated list of radios that should to be disabled when airplane mode
6132 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
6133 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
6134 * will be turned off when entering airplane mode, but the user will be able to reenable
6135 * Wifi in the Settings app.
6136 *
6137 * {@hide}
6138 */
6139 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
6140
6141 /**
6142 * The policy for deciding when Wi-Fi should go to sleep (which will in
6143 * turn switch to using the mobile data as an Internet connection).
6144 * <p>
6145 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
6146 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
6147 * {@link #WIFI_SLEEP_POLICY_NEVER}.
6148 */
6149 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
6150
6151 /**
6152 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
6153 * policy, which is to sleep shortly after the turning off
6154 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
6155 */
6156 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
6157
6158 /**
6159 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
6160 * the device is on battery, and never go to sleep when the device is
6161 * plugged in.
6162 */
6163 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
6164
6165 /**
6166 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
6167 */
6168 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
6169
6170 /**
6171 * Value to specify if the user prefers the date, time and time zone
6172 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
6173 */
6174 public static final String AUTO_TIME = "auto_time";
6175
6176 /**
6177 * Value to specify if the user prefers the time zone
6178 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
6179 */
6180 public static final String AUTO_TIME_ZONE = "auto_time_zone";
6181
6182 /**
6183 * URI for the car dock "in" event sound.
6184 * @hide
6185 */
6186 public static final String CAR_DOCK_SOUND = "car_dock_sound";
6187
6188 /**
6189 * URI for the car dock "out" event sound.
6190 * @hide
6191 */
6192 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
6193
6194 /**
6195 * URI for the desk dock "in" event sound.
6196 * @hide
6197 */
6198 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
6199
6200 /**
6201 * URI for the desk dock "out" event sound.
6202 * @hide
6203 */
6204 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
6205
6206 /**
6207 * Whether to play a sound for dock events.
6208 * @hide
6209 */
6210 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
6211
6212 /**
6213 * URI for the "device locked" (keyguard shown) sound.
6214 * @hide
6215 */
6216 public static final String LOCK_SOUND = "lock_sound";
6217
6218 /**
6219 * URI for the "device unlocked" sound.
6220 * @hide
6221 */
6222 public static final String UNLOCK_SOUND = "unlock_sound";
6223
6224 /**
6225 * URI for the low battery sound file.
6226 * @hide
6227 */
6228 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
6229
6230 /**
6231 * Whether to play a sound for low-battery alerts.
6232 * @hide
6233 */
6234 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
6235
6236 /**
6237 * URI for the "wireless charging started" sound.
6238 * @hide
6239 */
6240 public static final String WIRELESS_CHARGING_STARTED_SOUND =
6241 "wireless_charging_started_sound";
6242
6243 /**
6244 * Whether we keep the device on while the device is plugged in.
6245 * Supported values are:
6246 * <ul>
6247 * <li>{@code 0} to never stay on while plugged in</li>
6248 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
6249 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
6250 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
6251 * </ul>
6252 * These values can be OR-ed together.
6253 */
6254 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
6255
6256 /**
6257 * When the user has enable the option to have a "bug report" command
6258 * in the power menu.
6259 * @hide
6260 */
6261 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
6262
6263 /**
6264 * Whether to wake the display when plugging or unplugging the charger
6265 *
6266 * @hide
6267 */
6268 public static final String WAKE_WHEN_PLUGGED_OR_UNPLUGGED = "wake_when_plugged_or_unplugged";
6269
6270 /**
6271 * Whether ADB is enabled.
6272 */
6273 public static final String ADB_ENABLED = "adb_enabled";
6274
6275 /**
6276 * Whether assisted GPS should be enabled or not.
6277 * @hide
6278 */
6279 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
6280
6281 /**
6282 * Whether bluetooth is enabled/disabled
6283 * 0=disabled. 1=enabled.
6284 */
6285 public static final String BLUETOOTH_ON = "bluetooth_on";
6286
6287 /**
6288 * CDMA Cell Broadcast SMS
6289 * 0 = CDMA Cell Broadcast SMS disabled
6290 * 1 = CDMA Cell Broadcast SMS enabled
6291 * @hide
6292 */
6293 public static final String CDMA_CELL_BROADCAST_SMS =
6294 "cdma_cell_broadcast_sms";
6295
6296 /**
6297 * The CDMA roaming mode 0 = Home Networks, CDMA default
6298 * 1 = Roaming on Affiliated networks
6299 * 2 = Roaming on any networks
6300 * @hide
6301 */
6302 public static final String CDMA_ROAMING_MODE = "roaming_settings";
6303
6304 /**
6305 * The CDMA subscription mode 0 = RUIM/SIM (default)
6306 * 1 = NV
6307 * @hide
6308 */
6309 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
6310
6311 /** Inactivity timeout to track mobile data activity.
6312 *
6313 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
6314 * infer the data activity of mobile network. After a period of no activity on mobile
6315 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
6316 * intent is fired to indicate a transition of network status from "active" to "idle". Any
6317 * subsequent activity on mobile networks triggers the firing of {@code
6318 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
6319 *
6320 * Network activity refers to transmitting or receiving data on the network interfaces.
6321 *
6322 * Tracking is disabled if set to zero or negative value.
6323 *
6324 * @hide
6325 */
6326 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
6327
6328 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
6329 * but for Wifi network.
6330 * @hide
6331 */
6332 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
6333
6334 /**
6335 * Whether or not data roaming is enabled. (0 = false, 1 = true)
6336 */
6337 public static final String DATA_ROAMING = "data_roaming";
6338
6339 /**
6340 * The value passed to a Mobile DataConnection via bringUp which defines the
6341 * number of retries to preform when setting up the initial connection. The default
6342 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
6343 * @hide
6344 */
6345 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
6346
6347 /**
6348 * Whether user has enabled development settings.
6349 */
6350 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
6351
6352 /**
6353 * Whether the device has been provisioned (0 = false, 1 = true)
6354 */
6355 public static final String DEVICE_PROVISIONED = "device_provisioned";
6356
6357 /**
6358 * The saved value for WindowManagerService.setForcedDisplayDensity().
6359 * One integer in dpi. If unset, then use the real display density.
6360 * @hide
6361 */
6362 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
6363
6364 /**
6365 * The saved value for WindowManagerService.setForcedDisplaySize().
6366 * Two integers separated by a comma. If unset, then use the real display size.
6367 * @hide
6368 */
6369 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
6370
6371 /**
6372 * The maximum size, in bytes, of a download that the download manager will transfer over
6373 * a non-wifi connection.
6374 * @hide
6375 */
6376 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
6377 "download_manager_max_bytes_over_mobile";
6378
6379 /**
6380 * The recommended maximum size, in bytes, of a download that the download manager should
6381 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
6382 * have the option to start the download over the mobile connection anyway.
6383 * @hide
6384 */
6385 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
6386 "download_manager_recommended_max_bytes_over_mobile";
6387
6388 /**
6389 * Whether the package installer should allow installation of apps downloaded from
6390 * sources other than Google Play.
6391 *
6392 * 1 = allow installing from other sources
6393 * 0 = only allow installing from Google Play
6394 */
6395 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
6396
6397 /**
6398 * Whether mobile data connections are allowed by the user. See
6399 * ConnectivityManager for more info.
6400 * @hide
6401 */
6402 public static final String MOBILE_DATA = "mobile_data";
6403
6404 /** {@hide} */
6405 public static final String NETSTATS_ENABLED = "netstats_enabled";
6406 /** {@hide} */
6407 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
6408 /** {@hide} */
6409 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
6410 /** {@hide} */
6411 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
6412 /** {@hide} */
6413 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
6414 /** {@hide} */
6415 public static final String NETSTATS_REPORT_XT_OVER_DEV = "netstats_report_xt_over_dev";
6416
6417 /** {@hide} */
6418 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
6419 /** {@hide} */
6420 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
6421 /** {@hide} */
6422 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
6423 /** {@hide} */
6424 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
6425
6426 /** {@hide} */
6427 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
6428 /** {@hide} */
6429 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
6430 /** {@hide} */
6431 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
6432 /** {@hide} */
6433 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
6434
6435 /** {@hide} */
6436 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
6437 /** {@hide} */
6438 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
6439 /** {@hide} */
6440 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
6441 /** {@hide} */
6442 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
6443
6444 /**
6445 * User preference for which network(s) should be used. Only the
6446 * connectivity service should touch this.
6447 */
6448 public static final String NETWORK_PREFERENCE = "network_preference";
6449
6450 /**
6451 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
6452 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
6453 * exceeded.
6454 * @hide
6455 */
6456 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
6457
6458 /**
6459 * The length of time in milli-seconds that automatic small adjustments to
6460 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
6461 * @hide
6462 */
6463 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
6464
6465 /** Preferred NTP server. {@hide} */
6466 public static final String NTP_SERVER = "ntp_server";
6467 /** Timeout in milliseconds to wait for NTP server. {@hide} */
6468 public static final String NTP_TIMEOUT = "ntp_timeout";
6469
6470 /**
6471 * Whether the package manager should send package verification broadcasts for verifiers to
6472 * review apps prior to installation.
6473 * 1 = request apps to be verified prior to installation, if a verifier exists.
6474 * 0 = do not verify apps before installation
6475 * @hide
6476 */
6477 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
6478
6479 /** Timeout for package verification.
6480 * @hide */
6481 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
6482
6483 /** Default response code for package verification.
6484 * @hide */
6485 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
6486
6487 /**
6488 * Show package verification setting in the Settings app.
6489 * 1 = show (default)
6490 * 0 = hide
6491 * @hide
6492 */
6493 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
6494
6495 /**
6496 * Run package verificaiton on apps installed through ADB/ADT/USB
6497 * 1 = perform package verification on ADB installs (default)
6498 * 0 = bypass package verification on ADB installs
6499 * @hide
6500 */
6501 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
6502
6503 /**
6504 * The interval in milliseconds at which to check packet counts on the
6505 * mobile data interface when screen is on, to detect possible data
6506 * connection problems.
6507 * @hide
6508 */
6509 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
6510 "pdp_watchdog_poll_interval_ms";
6511
6512 /**
6513 * The interval in milliseconds at which to check packet counts on the
6514 * mobile data interface when screen is off, to detect possible data
6515 * connection problems.
6516 * @hide
6517 */
6518 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
6519 "pdp_watchdog_long_poll_interval_ms";
6520
6521 /**
6522 * The interval in milliseconds at which to check packet counts on the
6523 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
6524 * outgoing packets has been reached without incoming packets.
6525 * @hide
6526 */
6527 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
6528 "pdp_watchdog_error_poll_interval_ms";
6529
6530 /**
6531 * The number of outgoing packets sent without seeing an incoming packet
6532 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
6533 * device is logged to the event log
6534 * @hide
6535 */
6536 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
6537 "pdp_watchdog_trigger_packet_count";
6538
6539 /**
6540 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
6541 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
6542 * attempting data connection recovery.
6543 * @hide
6544 */
6545 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
6546 "pdp_watchdog_error_poll_count";
6547
6548 /**
6549 * The number of failed PDP reset attempts before moving to something more
6550 * drastic: re-registering to the network.
6551 * @hide
6552 */
6553 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
6554 "pdp_watchdog_max_pdp_reset_fail_count";
6555
6556 /**
6557 * A positive value indicates how often the SamplingProfiler
6558 * should take snapshots. Zero value means SamplingProfiler
6559 * is disabled.
6560 *
6561 * @hide
6562 */
6563 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
6564
6565 /**
6566 * URL to open browser on to allow user to manage a prepay account
6567 * @hide
6568 */
6569 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
6570 "setup_prepaid_data_service_url";
6571
6572 /**
6573 * URL to attempt a GET on to see if this is a prepay device
6574 * @hide
6575 */
6576 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
6577 "setup_prepaid_detection_target_url";
6578
6579 /**
6580 * Host to check for a redirect to after an attempt to GET
6581 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
6582 * this is a prepaid device with zero balance.)
6583 * @hide
6584 */
6585 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
6586 "setup_prepaid_detection_redir_host";
6587
6588 /**
6589 * The interval in milliseconds at which to check the number of SMS sent out without asking
6590 * for use permit, to limit the un-authorized SMS usage.
6591 *
6592 * @hide
6593 */
6594 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
6595 "sms_outgoing_check_interval_ms";
6596
6597 /**
6598 * The number of outgoing SMS sent without asking for user permit (of {@link
6599 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
6600 *
6601 * @hide
6602 */
6603 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
6604 "sms_outgoing_check_max_count";
6605
6606 /**
6607 * Used to disable SMS short code confirmation - defaults to true.
6608 * True indcates we will do the check, etc. Set to false to disable.
6609 * @see com.android.internal.telephony.SmsUsageMonitor
6610 * @hide
6611 */
6612 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
6613
6614 /**
6615 * Used to select which country we use to determine premium sms codes.
6616 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
6617 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
6618 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
6619 * @hide
6620 */
6621 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
6622
6623 /**
6624 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
6625 * @hide
6626 */
6627 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
6628
6629 /**
6630 * Used to disable Tethering on a device - defaults to true
6631 * @hide
6632 */
6633 public static final String TETHER_SUPPORTED = "tether_supported";
6634
6635 /**
6636 * Used to require DUN APN on the device or not - defaults to a build config value
6637 * which defaults to false
6638 * @hide
6639 */
6640 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
6641
6642 /**
6643 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
6644 * corresponding build config values are set it will override the APN DB
6645 * values.
6646 * Consists of a comma seperated list of strings:
6647 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
6648 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
6649 * @hide
6650 */
6651 public static final String TETHER_DUN_APN = "tether_dun_apn";
6652
6653 /**
6654 * USB Mass Storage Enabled
6655 */
6656 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
6657
6658 /**
6659 * If this setting is set (to anything), then all references
6660 * to Gmail on the device must change to Google Mail.
6661 */
6662 public static final String USE_GOOGLE_MAIL = "use_google_mail";
6663
6664 /** Autofill server address (Used in WebView/browser).
6665 * {@hide} */
6666 public static final String WEB_AUTOFILL_QUERY_URL =
6667 "web_autofill_query_url";
6668
6669 /**
6670 * Whether Wifi display is enabled/disabled
6671 * 0=disabled. 1=enabled.
6672 * @hide
6673 */
6674 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
6675
6676 /**
6677 * Whether Wifi display certification mode is enabled/disabled
6678 * 0=disabled. 1=enabled.
6679 * @hide
6680 */
6681 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
6682 "wifi_display_certification_on";
6683
6684 /**
6685 * WPS Configuration method used by Wifi display, this setting only
6686 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
6687 *
6688 * Possible values are:
6689 *
6690 * WpsInfo.INVALID: use default WPS method chosen by framework
6691 * WpsInfo.PBC : use Push button
6692 * WpsInfo.KEYPAD : use Keypad
6693 * WpsInfo.DISPLAY: use Display
6694 * @hide
6695 */
6696 public static final String WIFI_DISPLAY_WPS_CONFIG =
6697 "wifi_display_wps_config";
6698
6699 /**
6700 * Whether to notify the user of open networks.
6701 * <p>
6702 * If not connected and the scan results have an open network, we will
6703 * put this notification up. If we attempt to connect to a network or
6704 * the open network(s) disappear, we remove the notification. When we
6705 * show the notification, we will not show it again for
6706 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
6707 */
6708 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6709 "wifi_networks_available_notification_on";
6710 /**
6711 * {@hide}
6712 */
6713 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6714 "wimax_networks_available_notification_on";
6715
6716 /**
6717 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
6718 * Connecting to a network will reset the timer.
6719 */
6720 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
6721 "wifi_networks_available_repeat_delay";
6722
6723 /**
6724 * 802.11 country code in ISO 3166 format
6725 * @hide
6726 */
6727 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
6728
6729 /**
6730 * The interval in milliseconds to issue wake up scans when wifi needs
6731 * to connect. This is necessary to connect to an access point when
6732 * device is on the move and the screen is off.
6733 * @hide
6734 */
6735 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
6736 "wifi_framework_scan_interval_ms";
6737
6738 /**
6739 * The interval in milliseconds after which Wi-Fi is considered idle.
6740 * When idle, it is possible for the device to be switched from Wi-Fi to
6741 * the mobile data network.
6742 * @hide
6743 */
6744 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
6745
6746 /**
6747 * When the number of open networks exceeds this number, the
6748 * least-recently-used excess networks will be removed.
6749 */
6750 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
6751
6752 /**
6753 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
6754 */
6755 public static final String WIFI_ON = "wifi_on";
6756
6757 /**
6758 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
6759 * @hide
6760 */
6761 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
6762 "wifi_scan_always_enabled";
6763
6764 /**
6765 * Used to save the Wifi_ON state prior to tethering.
6766 * This state will be checked to restore Wifi after
6767 * the user turns off tethering.
6768 *
6769 * @hide
6770 */
6771 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
6772
6773 /**
6774 * The interval in milliseconds to scan as used by the wifi supplicant
6775 * @hide
6776 */
6777 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
6778 "wifi_supplicant_scan_interval_ms";
6779
6780 /**
6781 * The interval in milliseconds to scan at supplicant when p2p is connected
6782 * @hide
6783 */
6784 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
6785 "wifi_scan_interval_p2p_connected_ms";
6786
6787 /**
6788 * Whether the Wi-Fi watchdog is enabled.
6789 */
6790 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
6791
6792 /**
6793 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
6794 * the setting needs to be set to 0 to disable it.
6795 * @hide
6796 */
6797 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
6798 "wifi_watchdog_poor_network_test_enabled";
6799
6800 /**
6801 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
6802 * needs to be set to 0 to disable it.
6803 * @hide
6804 */
6805 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
6806 "wifi_suspend_optimizations_enabled";
6807
6808 /**
6809 * The maximum number of times we will retry a connection to an access
6810 * point for which we have failed in acquiring an IP address from DHCP.
6811 * A value of N means that we will make N+1 connection attempts in all.
6812 */
6813 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
6814
6815 /**
6816 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
6817 * data connectivity to be established after a disconnect from Wi-Fi.
6818 */
6819 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
6820 "wifi_mobile_data_transition_wakelock_timeout_ms";
6821
6822 /**
6823 * The operational wifi frequency band
6824 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
6825 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
6826 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
6827 *
6828 * @hide
6829 */
6830 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
6831
6832 /**
6833 * The Wi-Fi peer-to-peer device name
6834 * @hide
6835 */
6836 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
6837
6838 /**
6839 * The min time between wifi disable and wifi enable
6840 * @hide
6841 */
6842 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
6843
6844 /**
6845 * The number of milliseconds to delay when checking for data stalls during
6846 * non-aggressive detection. (screen is turned off.)
6847 * @hide
6848 */
6849 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
6850 "data_stall_alarm_non_aggressive_delay_in_ms";
6851
6852 /**
6853 * The number of milliseconds to delay when checking for data stalls during
6854 * aggressive detection. (screen on or suspected data stall)
6855 * @hide
6856 */
6857 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
6858 "data_stall_alarm_aggressive_delay_in_ms";
6859
6860 /**
6861 * The number of milliseconds to allow the provisioning apn to remain active
6862 * @hide
6863 */
6864 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
6865 "provisioning_apn_alarm_delay_in_ms";
6866
6867 /**
6868 * The interval in milliseconds at which to check gprs registration
6869 * after the first registration mismatch of gprs and voice service,
6870 * to detect possible data network registration problems.
6871 *
6872 * @hide
6873 */
6874 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
6875 "gprs_register_check_period_ms";
6876
6877 /**
6878 * Nonzero causes Log.wtf() to crash.
6879 * @hide
6880 */
6881 public static final String WTF_IS_FATAL = "wtf_is_fatal";
6882
6883 /**
6884 * Ringer mode. This is used internally, changing this value will not
6885 * change the ringer mode. See AudioManager.
6886 */
6887 public static final String MODE_RINGER = "mode_ringer";
6888
6889 /**
6890 * Overlay display devices setting.
6891 * The associated value is a specially formatted string that describes the
6892 * size and density of simulated secondary display devices.
6893 * <p>
6894 * Format: {width}x{height}/{dpi};...
6895 * </p><p>
6896 * Example:
6897 * <ul>
6898 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
6899 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
6900 * at 1080p and the second at 720p.</li>
6901 * <li>If the value is empty, then no overlay display devices are created.</li>
6902 * </ul></p>
6903 *
6904 * @hide
6905 */
6906 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
6907
6908 /**
6909 * Threshold values for the duration and level of a discharge cycle,
6910 * under which we log discharge cycle info.
6911 *
6912 * @hide
6913 */
6914 public static final String
6915 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
6916
6917 /** @hide */
6918 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
6919
6920 /**
6921 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
6922 * intents on application crashes and ANRs. If this is disabled, the
6923 * crash/ANR dialog will never display the "Report" button.
6924 * <p>
6925 * Type: int (0 = disallow, 1 = allow)
6926 *
6927 * @hide
6928 */
6929 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
6930
6931 /**
6932 * Maximum age of entries kept by {@link DropBoxManager}.
6933 *
6934 * @hide
6935 */
6936 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
6937
6938 /**
6939 * Maximum number of entry files which {@link DropBoxManager} will keep
6940 * around.
6941 *
6942 * @hide
6943 */
6944 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
6945
6946 /**
6947 * Maximum amount of disk space used by {@link DropBoxManager} no matter
6948 * what.
6949 *
6950 * @hide
6951 */
6952 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
6953
6954 /**
6955 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
6956 * will use.
6957 *
6958 * @hide
6959 */
6960 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
6961
6962 /**
6963 * Percent of total disk which {@link DropBoxManager} will never dip
6964 * into.
6965 *
6966 * @hide
6967 */
6968 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
6969
6970 /**
6971 * Prefix for per-tag dropbox disable/enable settings.
6972 *
6973 * @hide
6974 */
6975 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
6976
6977 /**
6978 * Lines of logcat to include with system crash/ANR/etc. reports, as a
6979 * prefix of the dropbox tag of the report type. For example,
6980 * "logcat_for_system_server_anr" controls the lines of logcat captured
6981 * with system server ANR reports. 0 to disable.
6982 *
6983 * @hide
6984 */
6985 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
6986
6987 /**
6988 * The interval in minutes after which the amount of free storage left
6989 * on the device is logged to the event log
6990 *
6991 * @hide
6992 */
6993 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
6994
6995 /**
6996 * Threshold for the amount of change in disk free space required to
6997 * report the amount of free space. Used to prevent spamming the logs
6998 * when the disk free space isn't changing frequently.
6999 *
7000 * @hide
7001 */
7002 public static final String
7003 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
7004
7005 /**
7006 * Minimum percentage of free storage on the device that is used to
7007 * determine if the device is running low on storage. The default is 10.
7008 * <p>
7009 * Say this value is set to 10, the device is considered running low on
7010 * storage if 90% or more of the device storage is filled up.
7011 *
7012 * @hide
7013 */
7014 public static final String
7015 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
7016
7017 /**
7018 * Maximum byte size of the low storage threshold. This is to ensure
7019 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
7020 * overly large threshold for large storage devices. Currently this must
7021 * be less than 2GB. This default is 500MB.
7022 *
7023 * @hide
7024 */
7025 public static final String
7026 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
7027
7028 /**
7029 * Minimum bytes of free storage on the device before the data partition
7030 * is considered full. By default, 1 MB is reserved to avoid system-wide
7031 * SQLite disk full exceptions.
7032 *
7033 * @hide
7034 */
7035 public static final String
7036 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
7037
7038 /**
7039 * The maximum reconnect delay for short network outages or when the
7040 * network is suspended due to phone use.
7041 *
7042 * @hide
7043 */
7044 public static final String
7045 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
7046
7047 /**
7048 * The number of milliseconds to delay before sending out
7049 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts.
7050 *
7051 * @hide
7052 */
7053 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
7054
7055
7056 /**
7057 * Network sampling interval, in seconds. We'll generate link information
7058 * about bytes/packets sent and error rates based on data sampled in this interval
7059 *
7060 * @hide
7061 */
7062
7063 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
7064 "connectivity_sampling_interval_in_seconds";
7065
7066 /**
7067 * The series of successively longer delays used in retrying to download PAC file.
7068 * Last delay is used between successful PAC downloads.
7069 *
7070 * @hide
7071 */
7072 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
7073
7074 /**
7075 * Setting to turn off captive portal detection. Feature is enabled by
7076 * default and the setting needs to be set to 0 to disable it.
7077 *
7078 * @hide
7079 */
7080 public static final String
7081 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
7082
7083 /**
7084 * The server used for captive portal detection upon a new conection. A
7085 * 204 response code from the server is used for validation.
7086 *
7087 * @hide
7088 */
7089 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
7090
7091 /**
7092 * Whether network service discovery is enabled.
7093 *
7094 * @hide
7095 */
7096 public static final String NSD_ON = "nsd_on";
7097
7098 /**
7099 * Let user pick default install location.
7100 *
7101 * @hide
7102 */
7103 public static final String SET_INSTALL_LOCATION = "set_install_location";
7104
7105 /**
7106 * Default install location value.
7107 * 0 = auto, let system decide
7108 * 1 = internal
7109 * 2 = sdcard
7110 * @hide
7111 */
7112 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
7113
7114 /**
7115 * ms during which to consume extra events related to Inet connection
7116 * condition after a transtion to fully-connected
7117 *
7118 * @hide
7119 */
7120 public static final String
7121 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
7122
7123 /**
7124 * ms during which to consume extra events related to Inet connection
7125 * condtion after a transtion to partly-connected
7126 *
7127 * @hide
7128 */
7129 public static final String
7130 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
7131
7132 /** {@hide} */
7133 public static final String
7134 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
7135
7136 /**
7137 * Host name and port for global http proxy. Uses ':' seperator for
7138 * between host and port.
7139 */
7140 public static final String HTTP_PROXY = "http_proxy";
7141
7142 /**
7143 * Host name for global http proxy. Set via ConnectivityManager.
7144 *
7145 * @hide
7146 */
7147 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
7148
7149 /**
7150 * Integer host port for global http proxy. Set via ConnectivityManager.
7151 *
7152 * @hide
7153 */
7154 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
7155
7156 /**
7157 * Exclusion list for global proxy. This string contains a list of
7158 * comma-separated domains where the global proxy does not apply.
7159 * Domains should be listed in a comma- separated list. Example of
7160 * acceptable formats: ".domain1.com,my.domain2.com" Use
7161 * ConnectivityManager to set/get.
7162 *
7163 * @hide
7164 */
7165 public static final String
7166 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
7167
7168 /**
7169 * The location PAC File for the proxy.
7170 * @hide
7171 */
7172 public static final String
7173 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
7174
7175 /**
7176 * Enables the UI setting to allow the user to specify the global HTTP
7177 * proxy and associated exclusion list.
7178 *
7179 * @hide
7180 */
7181 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
7182
7183 /**
7184 * Setting for default DNS in case nobody suggests one
7185 *
7186 * @hide
7187 */
7188 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
7189
7190 /** {@hide} */
7191 public static final String
7192 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
7193 /** {@hide} */
7194 public static final String
7195 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
7196 /** {@hide} */
7197 public static final String
7198 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
7199 /** {@hide} */
7200 public static final String
7201 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
7202
7203 /**
7204 * Get the key that retrieves a bluetooth headset's priority.
7205 * @hide
7206 */
7207 public static final String getBluetoothHeadsetPriorityKey(String address) {
7208 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7209 }
7210
7211 /**
7212 * Get the key that retrieves a bluetooth a2dp sink's priority.
7213 * @hide
7214 */
7215 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
7216 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7217 }
7218
7219 /**
7220 * Get the key that retrieves a bluetooth Input Device's priority.
7221 * @hide
7222 */
7223 public static final String getBluetoothInputDevicePriorityKey(String address) {
7224 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7225 }
7226
7227 /**
7228 * Get the key that retrieves a bluetooth map priority.
7229 * @hide
7230 */
7231 public static final String getBluetoothMapPriorityKey(String address) {
7232 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
7233 }
7234 /**
7235 * Scaling factor for normal window animations. Setting to 0 will
7236 * disable window animations.
7237 */
7238 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
7239
7240 /**
7241 * Scaling factor for activity transition animations. Setting to 0 will
7242 * disable window animations.
7243 */
7244 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
7245
7246 /**
7247 * Scaling factor for Animator-based animations. This affects both the
7248 * start delay and duration of all such animations. Setting to 0 will
7249 * cause animations to end immediately. The default value is 1.
7250 */
7251 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
7252
7253 /**
7254 * Scaling factor for normal window animations. Setting to 0 will
7255 * disable window animations.
7256 *
7257 * @hide
7258 */
7259 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
7260
7261 /**
7262 * If 0, the compatibility mode is off for all applications.
7263 * If 1, older applications run under compatibility mode.
7264 * TODO: remove this settings before code freeze (bug/1907571)
7265 * @hide
7266 */
7267 public static final String COMPATIBILITY_MODE = "compatibility_mode";
7268
7269 /**
7270 * CDMA only settings
7271 * Emergency Tone 0 = Off
7272 * 1 = Alert
7273 * 2 = Vibrate
7274 * @hide
7275 */
7276 public static final String EMERGENCY_TONE = "emergency_tone";
7277
7278 /**
7279 * CDMA only settings
7280 * Whether the auto retry is enabled. The value is
7281 * boolean (1 or 0).
7282 * @hide
7283 */
7284 public static final String CALL_AUTO_RETRY = "call_auto_retry";
7285
7286 /**
7287 * The preferred network mode 7 = Global
7288 * 6 = EvDo only
7289 * 5 = CDMA w/o EvDo
7290 * 4 = CDMA / EvDo auto
7291 * 3 = GSM / WCDMA auto
7292 * 2 = WCDMA only
7293 * 1 = GSM only
7294 * 0 = GSM / WCDMA preferred
7295 * @hide
7296 */
7297 public static final String PREFERRED_NETWORK_MODE =
7298 "preferred_network_mode";
7299
7300 /**
7301 * Name of an application package to be debugged.
7302 */
7303 public static final String DEBUG_APP = "debug_app";
7304
7305 /**
7306 * If 1, when launching DEBUG_APP it will wait for the debugger before
7307 * starting user code. If 0, it will run normally.
7308 */
7309 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
7310
7311 /**
7312 * Control whether the process CPU usage meter should be shown.
7313 */
7314 public static final String SHOW_PROCESSES = "show_processes";
7315
7316 /**
7317 * Control whether the process CPU info meter should be shown.
7318 * @hide
7319 */
7320 public static final String SHOW_CPU = "show_cpu";
7321
7322 /**
7323 * If 1, the activity manager will aggressively finish activities and
7324 * processes as soon as they are no longer needed. If 0, the normal
7325 * extended lifetime is used.
7326 */
7327 public static final String ALWAYS_FINISH_ACTIVITIES =
7328 "always_finish_activities";
7329
7330 /**
7331 * Use Dock audio output for media:
7332 * 0 = disabled
7333 * 1 = enabled
7334 * @hide
7335 */
7336 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
7337
7338 /**
7339 * Persisted safe headphone volume management state by AudioService
7340 * @hide
7341 */
7342 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
7343
7344 /**
7345 * URL for tzinfo (time zone) updates
7346 * @hide
7347 */
7348 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
7349
7350 /**
7351 * URL for tzinfo (time zone) update metadata
7352 * @hide
7353 */
7354 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
7355
7356 /**
7357 * URL for selinux (mandatory access control) updates
7358 * @hide
7359 */
7360 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
7361
7362 /**
7363 * URL for selinux (mandatory access control) update metadata
7364 * @hide
7365 */
7366 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
7367
7368 /**
7369 * URL for sms short code updates
7370 * @hide
7371 */
7372 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
7373 "sms_short_codes_content_url";
7374
7375 /**
7376 * URL for sms short code update metadata
7377 * @hide
7378 */
7379 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
7380 "sms_short_codes_metadata_url";
7381
7382 /**
7383 * URL for cert pinlist updates
7384 * @hide
7385 */
7386 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
7387
7388 /**
7389 * URL for cert pinlist updates
7390 * @hide
7391 */
7392 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
7393
7394 /**
7395 * URL for intent firewall updates
7396 * @hide
7397 */
7398 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
7399 "intent_firewall_content_url";
7400
7401 /**
7402 * URL for intent firewall update metadata
7403 * @hide
7404 */
7405 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
7406 "intent_firewall_metadata_url";
7407
7408 /**
7409 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
7410 * @hide
7411 */
7412 public static final String SELINUX_STATUS = "selinux_status";
7413
7414 /**
7415 * Developer setting to force RTL layout.
7416 * @hide
7417 */
7418 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
7419
7420 /**
7421 * Milliseconds after screen-off after which low battery sounds will be silenced.
7422 *
7423 * If zero, battery sounds will always play.
7424 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
7425 *
7426 * @hide
7427 */
7428 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
7429
7430 /**
7431 * Settings to backup. This is here so that it's in the same place as the settings
7432 * keys and easy to update.
7433 *
7434 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
7435 * and Secure as well. This is because those tables drive both backup and
7436 * restore, and restore needs to properly whitelist keys that used to live
7437 * in those namespaces. The keys will only actually be backed up / restored
7438 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
7439 *
7440 * NOTE: Settings are backed up and restored in the order they appear
7441 * in this array. If you have one setting depending on another,
7442 * make sure that they are ordered appropriately.
7443 *
7444 * @hide
7445 */
7446 public static final String[] SETTINGS_TO_BACKUP = {
7447 BUGREPORT_IN_POWER_MENU,
7448 STAY_ON_WHILE_PLUGGED_IN,
7449 WAKE_WHEN_PLUGGED_OR_UNPLUGGED,
7450 AUTO_TIME,
7451 AUTO_TIME_ZONE,
7452 POWER_SOUNDS_ENABLED,
7453 DOCK_SOUNDS_ENABLED,
7454 USB_MASS_STORAGE_ENABLED,
7455 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
7456 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
7457 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
7458 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
7459 WIFI_NUM_OPEN_NETWORKS_KEPT,
7460 EMERGENCY_TONE,
7461 CALL_AUTO_RETRY,
7462 DOCK_AUDIO_MEDIA_ENABLED
7463 };
7464
7465 // Populated lazily, guarded by class object:
7466 private static NameValueCache sNameValueCache = new NameValueCache(
7467 SYS_PROP_SETTING_VERSION,
7468 CONTENT_URI,
7469 CALL_METHOD_GET_GLOBAL,
7470 CALL_METHOD_PUT_GLOBAL);
7471
7472 /**
7473 * Look up a name in the database.
7474 * @param resolver to access the database with
7475 * @param name to look up in the table
7476 * @return the corresponding value, or null if not present
7477 */
7478 public static String getString(ContentResolver resolver, String name) {
7479 return getStringForUser(resolver, name, UserHandle.myUserId());
7480 }
7481
7482 /** @hide */
7483 public static String getStringForUser(ContentResolver resolver, String name,
7484 int userHandle) {
7485 return sNameValueCache.getStringForUser(resolver, name, userHandle);
7486 }
7487
7488 /**
7489 * Store a name/value pair into the database.
7490 * @param resolver to access the database with
7491 * @param name to store
7492 * @param value to associate with the name
7493 * @return true if the value was set, false on database errors
7494 */
7495 public static boolean putString(ContentResolver resolver,
7496 String name, String value) {
7497 return putStringForUser(resolver, name, value, UserHandle.myUserId());
7498 }
7499
7500 /** @hide */
7501 public static boolean putStringForUser(ContentResolver resolver,
7502 String name, String value, int userHandle) {
7503 if (LOCAL_LOGV) {
7504 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
7505 + " for " + userHandle);
7506 }
7507 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
7508 }
7509
7510 /**
7511 * Construct the content URI for a particular name/value pair,
7512 * useful for monitoring changes with a ContentObserver.
7513 * @param name to look up in the table
7514 * @return the corresponding content URI, or null if not present
7515 */
7516 public static Uri getUriFor(String name) {
7517 return getUriFor(CONTENT_URI, name);
7518 }
7519
7520 /**
7521 * Convenience function for retrieving a single secure settings value
7522 * as an integer. Note that internally setting values are always
7523 * stored as strings; this function converts the string to an integer
7524 * for you. The default value will be returned if the setting is
7525 * not defined or not an integer.
7526 *
7527 * @param cr The ContentResolver to access.
7528 * @param name The name of the setting to retrieve.
7529 * @param def Value to return if the setting is not defined.
7530 *
7531 * @return The setting's current value, or 'def' if it is not defined
7532 * or not a valid integer.
7533 */
7534 public static int getInt(ContentResolver cr, String name, int def) {
7535 String v = getString(cr, name);
7536 try {
7537 return v != null ? Integer.parseInt(v) : def;
7538 } catch (NumberFormatException e) {
7539 return def;
7540 }
7541 }
7542
7543 /**
7544 * Convenience function for retrieving a single secure settings value
7545 * as an integer. Note that internally setting values are always
7546 * stored as strings; this function converts the string to an integer
7547 * for you.
7548 * <p>
7549 * This version does not take a default value. If the setting has not
7550 * been set, or the string value is not a number,
7551 * it throws {@link SettingNotFoundException}.
7552 *
7553 * @param cr The ContentResolver to access.
7554 * @param name The name of the setting to retrieve.
7555 *
7556 * @throws SettingNotFoundException Thrown if a setting by the given
7557 * name can't be found or the setting value is not an integer.
7558 *
7559 * @return The setting's current value.
7560 */
7561 public static int getInt(ContentResolver cr, String name)
7562 throws SettingNotFoundException {
7563 String v = getString(cr, name);
7564 try {
7565 return Integer.parseInt(v);
7566 } catch (NumberFormatException e) {
7567 throw new SettingNotFoundException(name);
7568 }
7569 }
7570
7571 /**
7572 * Convenience function for updating a single settings value as an
7573 * integer. This will either create a new entry in the table if the
7574 * given name does not exist, or modify the value of the existing row
7575 * with that name. Note that internally setting values are always
7576 * stored as strings, so this function converts the given value to a
7577 * string before storing it.
7578 *
7579 * @param cr The ContentResolver to access.
7580 * @param name The name of the setting to modify.
7581 * @param value The new value for the setting.
7582 * @return true if the value was set, false on database errors
7583 */
7584 public static boolean putInt(ContentResolver cr, String name, int value) {
7585 return putString(cr, name, Integer.toString(value));
7586 }
7587
7588 /**
7589 * Convenience function for retrieving a single secure settings value
7590 * as a {@code long}. Note that internally setting values are always
7591 * stored as strings; this function converts the string to a {@code long}
7592 * for you. The default value will be returned if the setting is
7593 * not defined or not a {@code long}.
7594 *
7595 * @param cr The ContentResolver to access.
7596 * @param name The name of the setting to retrieve.
7597 * @param def Value to return if the setting is not defined.
7598 *
7599 * @return The setting's current value, or 'def' if it is not defined
7600 * or not a valid {@code long}.
7601 */
7602 public static long getLong(ContentResolver cr, String name, long def) {
7603 String valString = getString(cr, name);
7604 long value;
7605 try {
7606 value = valString != null ? Long.parseLong(valString) : def;
7607 } catch (NumberFormatException e) {
7608 value = def;
7609 }
7610 return value;
7611 }
7612
7613 /**
7614 * Convenience function for retrieving a single secure settings value
7615 * as a {@code long}. Note that internally setting values are always
7616 * stored as strings; this function converts the string to a {@code long}
7617 * for you.
7618 * <p>
7619 * This version does not take a default value. If the setting has not
7620 * been set, or the string value is not a number,
7621 * it throws {@link SettingNotFoundException}.
7622 *
7623 * @param cr The ContentResolver to access.
7624 * @param name The name of the setting to retrieve.
7625 *
7626 * @return The setting's current value.
7627 * @throws SettingNotFoundException Thrown if a setting by the given
7628 * name can't be found or the setting value is not an integer.
7629 */
7630 public static long getLong(ContentResolver cr, String name)
7631 throws SettingNotFoundException {
7632 String valString = getString(cr, name);
7633 try {
7634 return Long.parseLong(valString);
7635 } catch (NumberFormatException e) {
7636 throw new SettingNotFoundException(name);
7637 }
7638 }
7639
7640 /**
7641 * Convenience function for updating a secure settings value as a long
7642 * integer. This will either create a new entry in the table if the
7643 * given name does not exist, or modify the value of the existing row
7644 * with that name. Note that internally setting values are always
7645 * stored as strings, so this function converts the given value to a
7646 * string before storing it.
7647 *
7648 * @param cr The ContentResolver to access.
7649 * @param name The name of the setting to modify.
7650 * @param value The new value for the setting.
7651 * @return true if the value was set, false on database errors
7652 */
7653 public static boolean putLong(ContentResolver cr, String name, long value) {
7654 return putString(cr, name, Long.toString(value));
7655 }
7656
7657 /**
7658 * Convenience function for retrieving a single secure settings value
7659 * as a floating point number. Note that internally setting values are
7660 * always stored as strings; this function converts the string to an
7661 * float for you. The default value will be returned if the setting
7662 * is not defined or not a valid float.
7663 *
7664 * @param cr The ContentResolver to access.
7665 * @param name The name of the setting to retrieve.
7666 * @param def Value to return if the setting is not defined.
7667 *
7668 * @return The setting's current value, or 'def' if it is not defined
7669 * or not a valid float.
7670 */
7671 public static float getFloat(ContentResolver cr, String name, float def) {
7672 String v = getString(cr, name);
7673 try {
7674 return v != null ? Float.parseFloat(v) : def;
7675 } catch (NumberFormatException e) {
7676 return def;
7677 }
7678 }
7679
7680 /**
7681 * Convenience function for retrieving a single secure settings value
7682 * as a float. Note that internally setting values are always
7683 * stored as strings; this function converts the string to a float
7684 * for you.
7685 * <p>
7686 * This version does not take a default value. If the setting has not
7687 * been set, or the string value is not a number,
7688 * it throws {@link SettingNotFoundException}.
7689 *
7690 * @param cr The ContentResolver to access.
7691 * @param name The name of the setting to retrieve.
7692 *
7693 * @throws SettingNotFoundException Thrown if a setting by the given
7694 * name can't be found or the setting value is not a float.
7695 *
7696 * @return The setting's current value.
7697 */
7698 public static float getFloat(ContentResolver cr, String name)
7699 throws SettingNotFoundException {
7700 String v = getString(cr, name);
7701 if (v == null) {
7702 throw new SettingNotFoundException(name);
7703 }
7704 try {
7705 return Float.parseFloat(v);
7706 } catch (NumberFormatException e) {
7707 throw new SettingNotFoundException(name);
7708 }
7709 }
7710
7711 /**
7712 * Convenience function for updating a single settings value as a
7713 * floating point number. This will either create a new entry in the
7714 * table if the given name does not exist, or modify the value of the
7715 * existing row with that name. Note that internally setting values
7716 * are always stored as strings, so this function converts the given
7717 * value to a string before storing it.
7718 *
7719 * @param cr The ContentResolver to access.
7720 * @param name The name of the setting to modify.
7721 * @param value The new value for the setting.
7722 * @return true if the value was set, false on database errors
7723 */
7724 public static boolean putFloat(ContentResolver cr, String name, float value) {
7725 return putString(cr, name, Float.toString(value));
7726 }
7727
7728 /**
7729 *
7730 * @hide
7731 */
7732 public static final String[] ACTIVITY_ANIMATION_CONTROLS = new String[] {
7733 "activity_open",
7734 "activity_close",
7735 "task_open",
7736 "task_close",
7737 "task_to_front",
7738 "task_to_back",
7739 "wallpaper_open",
7740 "wallpaper_close",
7741 "wallpaper_intra_open",
7742 "wallpaper_intra_close",
7743 };
7744
7745 /**
7746 *
7747 * @hide
7748 */
7749 public static final String ANIMATION_CONTROLS_DURATION = "animation_controls_duration";
7750
7751 /**
7752 *
7753 * @hide
7754 */
7755 public static final String ANIMATION_CONTROLS_NO_SCROLL = "animation_controls_no_scroll";
7756
7757 /**
7758 *
7759 * @hide
7760 */
7761 public static final String ANIMATION_CONTROLS_NO_OVERRIDE = "animation_controls_no_override";
7762
7763 /**
7764 *
7765 * @hide
7766 */
7767 public static final String LISTVIEW_ANIMATION_CACHE = "listview_animation_cache";
7768
7769 /**
7770 *
7771 * @hide
7772 */
7773 public static final String LISTVIEW_ANIMATION_EXCLUDED_APPS = "listview_animation_excluded_apps";
7774
7775 /**
7776 * ListView Animations
7777 * 0 == None
7778 * 1 == Wave (Left)
7779 * 2 == Wave (Right)
7780 * 3 == Scale
7781 * 4 == Alpha
7782 * 5 == Stack (Top)
7783 * 6 == Stack (Bottom)
7784 * 7 == Translate (Left)
7785 * 8 == Translate (Right)
7786 * @hide
7787 */
7788 public static final String LISTVIEW_ANIMATION = "listview_animation";
7789
7790 /**
7791 * ListView Interpolators
7792 * 0 == None
7793 * 1 == accelerate_interpolator
7794 * 2 == decelerate_interpolator
7795 * 3 == accelerate_decelerate_interpolator
7796 * 4 == anticipate_interpolator
7797 * 5 == overshoot_interpolator
7798 * 6 == anticipate_overshoot_interpolator
7799 * 7 == bounce_interpolator
7800 * @hide
7801 */
7802 public static final String LISTVIEW_INTERPOLATOR = "listview_interpolator";
7803
7804 /**
7805 *
7806 * @hide
7807 */
7808 public static final String LISTVIEW_DURATION = "listview_duration";
7809
7810 /**
7811 *
7812 * @hide
7813 */
7814 public static final String ANIMATION_IME_DURATION = "animation_ime_duration";
7815
7816 /**
7817 *
7818 * @hide
7819 */
7820 public static final String ANIMATION_IME_ENTER = "animation_ime_enter";
7821
7822 /**
7823 *
7824 * @hide
7825 */
7826 public static final String ANIMATION_IME_EXIT = "animation_ime_exit";
7827
7828 /**
7829 *
7830 * @hide
7831 */
7832 public static final String ANIMATION_IME_INTERPOLATOR = "animation_ime_interpolator";
7833
7834 /**
7835 * Determine custom scroll friction.
7836 * @hide
7837 */
7838 public static final String CUSTOM_SCROLL_FRICTION = "custom_scroll_friction";
7839
7840 /**
7841 * Determine custom fling velocity.
7842 * @hide
7843 */
7844 public static final String CUSTOM_FLING_VELOCITY = "custom_fling_velocity";
7845
7846 /**
7847 * Determine custom overscroll distance.
7848 * @hide
7849 */
7850 public static final String CUSTOM_OVERSCROLL_DISTANCE = "custom_overscroll_distance";
7851
7852 /**
7853 * Determine custom overfling distance.
7854 * @hide
7855 */
7856 public static final String CUSTOM_OVERFLING_DISTANCE = "custom_overfling_distance";
7857
7858 /**
7859 *
7860 * @hide
7861 */
7862 public static final String ANIMATION_TOAST = "animation_toast";
7863 }
7864
7865 /**
7866 * User-defined bookmarks and shortcuts. The target of each bookmark is an
7867 * Intent URL, allowing it to be either a web page or a particular
7868 * application activity.
7869 *
7870 * @hide
7871 */
7872 public static final class Bookmarks implements BaseColumns
7873 {
7874 private static final String TAG = "Bookmarks";
7875
7876 /**
7877 * The content:// style URL for this table
7878 */
7879 public static final Uri CONTENT_URI =
7880 Uri.parse("content://" + AUTHORITY + "/bookmarks");
7881
7882 /**
7883 * The row ID.
7884 * <p>Type: INTEGER</p>
7885 */
7886 public static final String ID = "_id";
7887
7888 /**
7889 * Descriptive name of the bookmark that can be displayed to the user.
7890 * If this is empty, the title should be resolved at display time (use
7891 * {@link #getTitle(Context, Cursor)} any time you want to display the
7892 * title of a bookmark.)
7893 * <P>
7894 * Type: TEXT
7895 * </P>
7896 */
7897 public static final String TITLE = "title";
7898
7899 /**
7900 * Arbitrary string (displayed to the user) that allows bookmarks to be
7901 * organized into categories. There are some special names for
7902 * standard folders, which all start with '@'. The label displayed for
7903 * the folder changes with the locale (via {@link #getLabelForFolder}) but
7904 * the folder name does not change so you can consistently query for
7905 * the folder regardless of the current locale.
7906 *
7907 * <P>Type: TEXT</P>
7908 *
7909 */
7910 public static final String FOLDER = "folder";
7911
7912 /**
7913 * The Intent URL of the bookmark, describing what it points to. This
7914 * value is given to {@link android.content.Intent#getIntent} to create
7915 * an Intent that can be launched.
7916 * <P>Type: TEXT</P>
7917 */
7918 public static final String INTENT = "intent";
7919
7920 /**
7921 * Optional shortcut character associated with this bookmark.
7922 * <P>Type: INTEGER</P>
7923 */
7924 public static final String SHORTCUT = "shortcut";
7925
7926 /**
7927 * The order in which the bookmark should be displayed
7928 * <P>Type: INTEGER</P>
7929 */
7930 public static final String ORDERING = "ordering";
7931
7932 private static final String[] sIntentProjection = { INTENT };
7933 private static final String[] sShortcutProjection = { ID, SHORTCUT };
7934 private static final String sShortcutSelection = SHORTCUT + "=?";
7935
7936 /**
7937 * Convenience function to retrieve the bookmarked Intent for a
7938 * particular shortcut key.
7939 *
7940 * @param cr The ContentResolver to query.
7941 * @param shortcut The shortcut key.
7942 *
7943 * @return Intent The bookmarked URL, or null if there is no bookmark
7944 * matching the given shortcut.
7945 */
7946 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
7947 {
7948 Intent intent = null;
7949
7950 Cursor c = cr.query(CONTENT_URI,
7951 sIntentProjection, sShortcutSelection,
7952 new String[] { String.valueOf((int) shortcut) }, ORDERING);
7953 // Keep trying until we find a valid shortcut
7954 try {
7955 while (intent == null && c.moveToNext()) {
7956 try {
7957 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
7958 intent = Intent.parseUri(intentURI, 0);
7959 } catch (java.net.URISyntaxException e) {
7960 // The stored URL is bad... ignore it.
7961 } catch (IllegalArgumentException e) {
7962 // Column not found
7963 Log.w(TAG, "Intent column not found", e);
7964 }
7965 }
7966 } finally {
7967 if (c != null) c.close();
7968 }
7969
7970 return intent;
7971 }
7972
7973 /**
7974 * Add a new bookmark to the system.
7975 *
7976 * @param cr The ContentResolver to query.
7977 * @param intent The desired target of the bookmark.
7978 * @param title Bookmark title that is shown to the user; null if none
7979 * or it should be resolved to the intent's title.
7980 * @param folder Folder in which to place the bookmark; null if none.
7981 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
7982 * this is non-zero and there is an existing bookmark entry
7983 * with this same shortcut, then that existing shortcut is
7984 * cleared (the bookmark is not removed).
7985 * @return The unique content URL for the new bookmark entry.
7986 */
7987 public static Uri add(ContentResolver cr,
7988 Intent intent,
7989 String title,
7990 String folder,
7991 char shortcut,
7992 int ordering)
7993 {
7994 // If a shortcut is supplied, and it is already defined for
7995 // another bookmark, then remove the old definition.
7996 if (shortcut != 0) {
7997 cr.delete(CONTENT_URI, sShortcutSelection,
7998 new String[] { String.valueOf((int) shortcut) });
7999 }
8000
8001 ContentValues values = new ContentValues();
8002 if (title != null) values.put(TITLE, title);
8003 if (folder != null) values.put(FOLDER, folder);
8004 values.put(INTENT, intent.toUri(0));
8005 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
8006 values.put(ORDERING, ordering);
8007 return cr.insert(CONTENT_URI, values);
8008 }
8009
8010 /**
8011 * Return the folder name as it should be displayed to the user. This
8012 * takes care of localizing special folders.
8013 *
8014 * @param r Resources object for current locale; only need access to
8015 * system resources.
8016 * @param folder The value found in the {@link #FOLDER} column.
8017 *
8018 * @return CharSequence The label for this folder that should be shown
8019 * to the user.
8020 */
8021 public static CharSequence getLabelForFolder(Resources r, String folder) {
8022 return folder;
8023 }
8024
8025 /**
8026 * Return the title as it should be displayed to the user. This takes
8027 * care of localizing bookmarks that point to activities.
8028 *
8029 * @param context A context.
8030 * @param cursor A cursor pointing to the row whose title should be
8031 * returned. The cursor must contain at least the {@link #TITLE}
8032 * and {@link #INTENT} columns.
8033 * @return A title that is localized and can be displayed to the user,
8034 * or the empty string if one could not be found.
8035 */
8036 public static CharSequence getTitle(Context context, Cursor cursor) {
8037 int titleColumn = cursor.getColumnIndex(TITLE);
8038 int intentColumn = cursor.getColumnIndex(INTENT);
8039 if (titleColumn == -1 || intentColumn == -1) {
8040 throw new IllegalArgumentException(
8041 "The cursor must contain the TITLE and INTENT columns.");
8042 }
8043
8044 String title = cursor.getString(titleColumn);
8045 if (!TextUtils.isEmpty(title)) {
8046 return title;
8047 }
8048
8049 String intentUri = cursor.getString(intentColumn);
8050 if (TextUtils.isEmpty(intentUri)) {
8051 return "";
8052 }
8053
8054 Intent intent;
8055 try {
8056 intent = Intent.parseUri(intentUri, 0);
8057 } catch (URISyntaxException e) {
8058 return "";
8059 }
8060
8061 PackageManager packageManager = context.getPackageManager();
8062 ResolveInfo info = packageManager.resolveActivity(intent, 0);
8063 return info != null ? info.loadLabel(packageManager) : "";
8064 }
8065 }
8066
8067 /**
8068 * Returns the device ID that we should use when connecting to the mobile gtalk server.
8069 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
8070 * from the GoogleLoginService.
8071 *
8072 * @param androidId The Android ID for this device.
8073 * @return The device ID that should be used when connecting to the mobile gtalk server.
8074 * @hide
8075 */
8076 public static String getGTalkDeviceId(long androidId) {
8077 return "android-" + Long.toHexString(androidId);
8078 }
8079}