blob: e5c98591b1f8189b5097fe7abc98049da43c4123 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080019import android.annotation.SdkConstant;
20import android.annotation.SdkConstant.SdkConstantType;
Bryce Leecdfebd62015-02-02 08:19:11 -080021import android.annotation.SystemApi;
Narayan Kamathee69ff42011-06-28 12:07:18 +010022import android.app.SearchManager;
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070023import android.app.WallpaperManager;
Mike LeBeau5d34e9b2010-02-10 19:34:56 -080024import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025import android.content.ContentResolver;
26import android.content.ContentValues;
27import android.content.Context;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -080028import android.content.IContentProvider;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080029import android.content.Intent;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -080030import android.content.pm.ActivityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080031import android.content.pm.PackageManager;
32import android.content.pm.ResolveInfo;
33import android.content.res.Configuration;
34import android.content.res.Resources;
35import android.database.Cursor;
36import android.database.SQLException;
David Christie3f7b6522013-08-06 19:19:08 -070037import android.location.LocationManager;
Jeff Sharkey625239a2012-09-26 22:03:49 -070038import android.net.ConnectivityManager;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080039import android.net.Uri;
Irfan Sheriff36f74132010-11-04 16:57:37 -070040import android.net.wifi.WifiManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070041import android.os.BatteryManager;
42import android.os.Bundle;
Jeff Sharkey625239a2012-09-26 22:03:49 -070043import android.os.DropBoxManager;
Amith Yamasani52c489c2012-03-28 11:42:42 -070044import android.os.IBinder;
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -070045import android.os.Process;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070046import android.os.RemoteException;
Amith Yamasani52c489c2012-03-28 11:42:42 -070047import android.os.ServiceManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070048import android.os.SystemProperties;
Dianne Hackbornf02b60a2012-08-16 10:48:27 -070049import android.os.UserHandle;
Jeff Sharkey625239a2012-09-26 22:03:49 -070050import android.os.Build.VERSION_CODES;
Narayan Kamath6d632962011-08-24 11:51:37 +010051import android.speech.tts.TextToSpeech;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080052import android.text.TextUtils;
53import android.util.AndroidException;
Svetoslav683914b2015-01-15 14:22:26 -080054import android.util.ArrayMap;
55import android.util.ArraySet;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056import android.util.Log;
57
Svetoslav683914b2015-01-15 14:22:26 -080058import com.android.internal.util.ArrayUtils;
Amith Yamasani52c489c2012-03-28 11:42:42 -070059import com.android.internal.widget.ILockSettings;
60
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080061import java.net.URISyntaxException;
Svetoslav683914b2015-01-15 14:22:26 -080062import java.text.SimpleDateFormat;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080063import java.util.HashMap;
64import java.util.HashSet;
Elliott Hughescb64d432013-08-02 10:00:44 -070065import java.util.Locale;
Svetoslav683914b2015-01-15 14:22:26 -080066import java.util.Map;
67import java.util.Set;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080069/**
70 * The Settings provider contains global system-level device preferences.
71 */
72public final class Settings {
73
74 // Intent actions for Settings
75
76 /**
77 * Activity Action: Show system settings.
78 * <p>
79 * Input: Nothing.
80 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070081 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080082 */
83 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
84 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
85
86 /**
87 * Activity Action: Show settings to allow configuration of APNs.
88 * <p>
89 * Input: Nothing.
90 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070091 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080092 */
93 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
94 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
95
96 /**
97 * Activity Action: Show settings to allow configuration of current location
98 * sources.
99 * <p>
100 * In some cases, a matching Activity may not exist, so ensure you
101 * safeguard against this.
102 * <p>
103 * Input: Nothing.
104 * <p>
105 * Output: Nothing.
106 */
107 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
108 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
109 "android.settings.LOCATION_SOURCE_SETTINGS";
110
111 /**
112 * Activity Action: Show settings to allow configuration of wireless controls
113 * such as Wi-Fi, Bluetooth and Mobile networks.
114 * <p>
115 * In some cases, a matching Activity may not exist, so ensure you
116 * safeguard against this.
117 * <p>
118 * Input: Nothing.
119 * <p>
120 * Output: Nothing.
121 */
122 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
123 public static final String ACTION_WIRELESS_SETTINGS =
124 "android.settings.WIRELESS_SETTINGS";
125
126 /**
127 * Activity Action: Show settings to allow entering/exiting airplane mode.
128 * <p>
129 * In some cases, a matching Activity may not exist, so ensure you
130 * safeguard against this.
131 * <p>
132 * Input: Nothing.
133 * <p>
134 * Output: Nothing.
135 */
136 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
137 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
138 "android.settings.AIRPLANE_MODE_SETTINGS";
139
140 /**
Barnaby James48f35522014-07-16 14:27:39 -0700141 * Activity Action: Modify Airplane mode settings using the users voice.
142 * <p>
143 * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
144 * <p>
145 * This intent MUST be started using
146 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
147 * startVoiceActivity}.
148 * <p>
149 * To tell which state airplane mode should be set to, add the
150 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
151 * If there is no extra in this Intent, no changes will be made.
152 * <p>
153 * The activity should verify that
154 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
155 * modifying the setting.
156 * <p>
157 * Input: Nothing.
158 * <p>
159 * Output: Nothing.
160 */
161 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
162 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
163 "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
164
165 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700166 * Activity Action: Show settings for accessibility modules.
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 */
175 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
176 public static final String ACTION_ACCESSIBILITY_SETTINGS =
177 "android.settings.ACCESSIBILITY_SETTINGS";
178
179 /**
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700180 * Activity Action: Show settings to control access to usage information.
181 * <p>
182 * In some cases, a matching Activity may not exist, so ensure you
183 * safeguard against this.
184 * <p>
185 * Input: Nothing.
186 * <p>
187 * Output: Nothing.
188 */
189 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
190 public static final String ACTION_USAGE_ACCESS_SETTINGS =
191 "android.settings.USAGE_ACCESS_SETTINGS";
192
193 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800194 * Activity Action: Show settings to allow configuration of security and
195 * location privacy.
196 * <p>
197 * In some cases, a matching Activity may not exist, so ensure you
198 * safeguard against this.
199 * <p>
200 * Input: Nothing.
201 * <p>
202 * Output: Nothing.
203 */
204 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
205 public static final String ACTION_SECURITY_SETTINGS =
206 "android.settings.SECURITY_SETTINGS";
207
208 /**
Maggie Benthall0469f412013-09-05 15:30:26 -0400209 * Activity Action: Show trusted credentials settings, opening to the user tab,
210 * to allow management of installed credentials.
211 * <p>
212 * In some cases, a matching Activity may not exist, so ensure you
213 * safeguard against this.
214 * <p>
215 * Input: Nothing.
216 * <p>
217 * Output: Nothing.
218 * @hide
219 */
220 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
221 public static final String ACTION_TRUSTED_CREDENTIALS_USER =
222 "com.android.settings.TRUSTED_CREDENTIALS_USER";
223
224 /**
225 * Activity Action: Show dialog explaining that an installed CA cert may enable
226 * monitoring of encrypted network traffic.
227 * <p>
228 * In some cases, a matching Activity may not exist, so ensure you
229 * safeguard against this.
230 * <p>
231 * Input: Nothing.
232 * <p>
233 * Output: Nothing.
234 * @hide
235 */
236 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
237 public static final String ACTION_MONITORING_CERT_INFO =
238 "com.android.settings.MONITORING_CERT_INFO";
239
240 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700241 * Activity Action: Show settings to allow configuration of privacy options.
242 * <p>
243 * In some cases, a matching Activity may not exist, so ensure you
244 * safeguard against this.
245 * <p>
246 * Input: Nothing.
247 * <p>
248 * Output: Nothing.
249 */
250 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
251 public static final String ACTION_PRIVACY_SETTINGS =
252 "android.settings.PRIVACY_SETTINGS";
253
254 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800255 * Activity Action: Show settings to allow configuration of Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800256 * <p>
257 * In some cases, a matching Activity may not exist, so ensure you
258 * safeguard against this.
259 * <p>
260 * Input: Nothing.
261 * <p>
262 * Output: Nothing.
263
264 */
265 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
266 public static final String ACTION_WIFI_SETTINGS =
267 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700268
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800269 /**
270 * Activity Action: Show settings to allow configuration of a static IP
271 * address for Wi-Fi.
272 * <p>
273 * In some cases, a matching Activity may not exist, so ensure you safeguard
274 * 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_WIFI_IP_SETTINGS =
282 "android.settings.WIFI_IP_SETTINGS";
283
284 /**
285 * Activity Action: Show settings to allow configuration of Bluetooth.
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_BLUETOOTH_SETTINGS =
296 "android.settings.BLUETOOTH_SETTINGS";
297
298 /**
Jeff Brown89d55462012-09-19 11:33:42 -0700299 * Activity Action: Show settings to allow configuration of Wifi Displays.
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 * @hide
308 */
309 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
310 public static final String ACTION_WIFI_DISPLAY_SETTINGS =
311 "android.settings.WIFI_DISPLAY_SETTINGS";
312
313 /**
Jeff Brown1a937b02014-07-01 22:13:04 -0700314 * Activity Action: Show settings to allow configuration of
315 * {@link android.media.routing.MediaRouteService media route providers}.
316 * <p>
317 * In some cases, a matching Activity may not exist, so ensure you
318 * safeguard against this.
319 * <p>
320 * Input: Nothing.
321 * <p>
322 * Output: Nothing.
323 */
324 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
325 public static final String ACTION_CAST_SETTINGS =
326 "android.settings.CAST_SETTINGS";
327
328 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800329 * Activity Action: Show settings to allow configuration of date and time.
330 * <p>
331 * In some cases, a matching Activity may not exist, so ensure you
332 * safeguard against this.
333 * <p>
334 * Input: Nothing.
335 * <p>
336 * Output: Nothing.
337 */
338 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
339 public static final String ACTION_DATE_SETTINGS =
340 "android.settings.DATE_SETTINGS";
341
342 /**
343 * Activity Action: Show settings to allow configuration of sound and volume.
344 * <p>
345 * In some cases, a matching Activity may not exist, so ensure you
346 * safeguard against this.
347 * <p>
348 * Input: Nothing.
349 * <p>
350 * Output: Nothing.
351 */
352 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
353 public static final String ACTION_SOUND_SETTINGS =
354 "android.settings.SOUND_SETTINGS";
355
356 /**
357 * Activity Action: Show settings to allow configuration of display.
358 * <p>
359 * In some cases, a matching Activity may not exist, so ensure you
360 * safeguard against this.
361 * <p>
362 * Input: Nothing.
363 * <p>
364 * Output: Nothing.
365 */
366 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
367 public static final String ACTION_DISPLAY_SETTINGS =
368 "android.settings.DISPLAY_SETTINGS";
369
370 /**
371 * Activity Action: Show settings to allow configuration of locale.
372 * <p>
373 * In some cases, a matching Activity may not exist, so ensure you
374 * safeguard against this.
375 * <p>
376 * Input: Nothing.
377 * <p>
378 * Output: Nothing.
379 */
380 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
381 public static final String ACTION_LOCALE_SETTINGS =
382 "android.settings.LOCALE_SETTINGS";
383
384 /**
385 * Activity Action: Show settings to configure input methods, in particular
386 * allowing the user to enable input methods.
387 * <p>
388 * In some cases, a matching Activity may not exist, so ensure you
389 * safeguard against this.
390 * <p>
391 * Input: Nothing.
392 * <p>
393 * Output: Nothing.
394 */
395 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Dianne Hackborna3fb40d2014-08-12 15:06:50 -0700396 public static final String ACTION_VOICE_INPUT_SETTINGS =
397 "android.settings.VOICE_INPUT_SETTINGS";
398
399 /**
400 * Activity Action: Show settings to configure input methods, in particular
401 * allowing the user to enable input methods.
402 * <p>
403 * In some cases, a matching Activity may not exist, so ensure you
404 * safeguard against this.
405 * <p>
406 * Input: Nothing.
407 * <p>
408 * Output: Nothing.
409 */
410 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800411 public static final String ACTION_INPUT_METHOD_SETTINGS =
412 "android.settings.INPUT_METHOD_SETTINGS";
413
414 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900415 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900416 * <p>
417 * In some cases, a matching Activity may not exist, so ensure you
418 * safeguard against this.
419 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900420 * To tell which input method's subtypes are displayed in the settings, add
421 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
422 * If there is no extra in this Intent, subtypes from all installed input methods
423 * will be displayed in the settings.
424 *
425 * @see android.view.inputmethod.InputMethodInfo#getId
426 * <p>
satok86417ea2010-10-27 14:11:03 +0900427 * Input: Nothing.
428 * <p>
429 * Output: Nothing.
430 */
431 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900432 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
433 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900434
435 /**
satok7cfc0ed2011-06-20 21:29:36 +0900436 * Activity Action: Show a dialog to select input method.
437 * <p>
438 * In some cases, a matching Activity may not exist, so ensure you
439 * safeguard against this.
440 * <p>
441 * Input: Nothing.
442 * <p>
443 * Output: Nothing.
444 * @hide
445 */
446 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
447 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
448 "android.settings.SHOW_INPUT_METHOD_PICKER";
449
450 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800451 * Activity Action: Show settings to manage the user input dictionary.
452 * <p>
Chet Haasee8222dd2013-09-05 07:44:18 -0700453 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
Satoshi Kataoka2aa2bc52013-07-30 14:25:11 +0900454 * it is guaranteed there will always be an appropriate implementation for this Intent action.
455 * In prior releases of the platform this was optional, so ensure you safeguard against it.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800456 * <p>
457 * Input: Nothing.
458 * <p>
459 * Output: Nothing.
460 */
461 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
462 public static final String ACTION_USER_DICTIONARY_SETTINGS =
463 "android.settings.USER_DICTIONARY_SETTINGS";
464
465 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700466 * Activity Action: Adds a word to the user dictionary.
467 * <p>
468 * In some cases, a matching Activity may not exist, so ensure you
469 * safeguard against this.
470 * <p>
471 * Input: An extra with key <code>word</code> that contains the word
472 * that should be added to the dictionary.
473 * <p>
474 * Output: Nothing.
475 *
476 * @hide
477 */
478 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
479 public static final String ACTION_USER_DICTIONARY_INSERT =
480 "com.android.settings.USER_DICTIONARY_INSERT";
481
482 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800483 * Activity Action: Show settings to allow configuration of application-related settings.
484 * <p>
485 * In some cases, a matching Activity may not exist, so ensure you
486 * safeguard against this.
487 * <p>
488 * Input: Nothing.
489 * <p>
490 * Output: Nothing.
491 */
492 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
493 public static final String ACTION_APPLICATION_SETTINGS =
494 "android.settings.APPLICATION_SETTINGS";
495
496 /**
497 * Activity Action: Show settings to allow configuration of application
Dianne Hackborn8d866e52012-10-10 18:39:45 -0700498 * development-related settings. As of
499 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
500 * a required part of the platform.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800501 * <p>
502 * Input: Nothing.
503 * <p>
504 * Output: Nothing.
505 */
506 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
507 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
508 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
509
510 /**
511 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
512 * <p>
513 * In some cases, a matching Activity may not exist, so ensure you
514 * safeguard against this.
515 * <p>
516 * Input: Nothing.
517 * <p>
518 * Output: Nothing.
519 */
520 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
521 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
522 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700523
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800524 /**
525 * Activity Action: Show settings to manage installed applications.
526 * <p>
527 * In some cases, a matching Activity may not exist, so ensure you
528 * safeguard against this.
529 * <p>
530 * Input: Nothing.
531 * <p>
532 * Output: Nothing.
533 */
534 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
535 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
536 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700537
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800538 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700539 * Activity Action: Show settings to manage all applications.
540 * <p>
541 * In some cases, a matching Activity may not exist, so ensure you
542 * safeguard against this.
543 * <p>
544 * Input: Nothing.
545 * <p>
546 * Output: Nothing.
547 */
548 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
549 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
550 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
551
552 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700553 * Activity Action: Show screen of details about a particular application.
554 * <p>
555 * In some cases, a matching Activity may not exist, so ensure you
556 * safeguard against this.
557 * <p>
558 * Input: The Intent's data URI specifies the application package name
559 * to be shown, with the "package" scheme. That is "package:com.my.app".
560 * <p>
561 * Output: Nothing.
562 */
563 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
564 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
565 "android.settings.APPLICATION_DETAILS_SETTINGS";
566
567 /**
Dianne Hackborn35654b62013-01-14 17:38:02 -0800568 * @hide
569 * Activity Action: Show the "app ops" settings screen.
570 * <p>
571 * Input: Nothing.
572 * <p>
573 * Output: Nothing.
574 */
575 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
576 public static final String ACTION_APP_OPS_SETTINGS =
577 "android.settings.APP_OPS_SETTINGS";
578
579 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800580 * Activity Action: Show settings for system update functionality.
581 * <p>
582 * In some cases, a matching Activity may not exist, so ensure you
583 * safeguard against this.
584 * <p>
585 * Input: Nothing.
586 * <p>
587 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700588 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800589 * @hide
590 */
591 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
592 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
593 "android.settings.SYSTEM_UPDATE_SETTINGS";
594
595 /**
596 * Activity Action: Show settings to allow configuration of sync settings.
597 * <p>
598 * In some cases, a matching Activity may not exist, so ensure you
599 * safeguard against this.
600 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800601 * The account types available to add via the add account button may be restricted by adding an
602 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
603 * authorities. Only account types which can sync with that content provider will be offered to
604 * the user.
605 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800606 * Input: Nothing.
607 * <p>
608 * Output: Nothing.
609 */
610 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
611 public static final String ACTION_SYNC_SETTINGS =
612 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700613
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800614 /**
Erikeebc8e22010-02-18 13:27:19 -0800615 * Activity Action: Show add account screen for creating a new account.
616 * <p>
617 * In some cases, a matching Activity may not exist, so ensure you
618 * safeguard against this.
619 * <p>
620 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
621 * extra to the Intent with one or more syncable content provider's authorities. Only account
622 * types which can sync with that content provider will be offered to the user.
623 * <p>
Alon Albert50359c22013-02-26 14:47:48 -0800624 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
625 * Intent with one or more account types.
626 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800627 * Input: Nothing.
628 * <p>
629 * Output: Nothing.
630 */
631 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
632 public static final String ACTION_ADD_ACCOUNT =
633 "android.settings.ADD_ACCOUNT_SETTINGS";
634
635 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800636 * Activity Action: Show settings for selecting the network operator.
637 * <p>
638 * In some cases, a matching Activity may not exist, so ensure you
639 * safeguard against this.
640 * <p>
641 * Input: Nothing.
642 * <p>
643 * Output: Nothing.
644 */
645 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
646 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
647 "android.settings.NETWORK_OPERATOR_SETTINGS";
648
649 /**
650 * Activity Action: Show settings for selection of 2G/3G.
651 * <p>
652 * In some cases, a matching Activity may not exist, so ensure you
653 * safeguard against this.
654 * <p>
655 * Input: Nothing.
656 * <p>
657 * Output: Nothing.
658 */
659 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
660 public static final String ACTION_DATA_ROAMING_SETTINGS =
661 "android.settings.DATA_ROAMING_SETTINGS";
662
663 /**
664 * Activity Action: Show settings for internal storage.
665 * <p>
666 * In some cases, a matching Activity may not exist, so ensure you
667 * safeguard against this.
668 * <p>
669 * Input: Nothing.
670 * <p>
671 * Output: Nothing.
672 */
673 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
674 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
675 "android.settings.INTERNAL_STORAGE_SETTINGS";
676 /**
677 * Activity Action: Show settings for memory card storage.
678 * <p>
679 * In some cases, a matching Activity may not exist, so ensure you
680 * safeguard against this.
681 * <p>
682 * Input: Nothing.
683 * <p>
684 * Output: Nothing.
685 */
686 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
687 public static final String ACTION_MEMORY_CARD_SETTINGS =
688 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700689
Justin Mattsonef340352010-01-13 21:05:46 -0800690 /**
691 * Activity Action: Show settings for global search.
692 * <p>
693 * In some cases, a matching Activity may not exist, so ensure you
694 * safeguard against this.
695 * <p>
696 * Input: Nothing.
697 * <p>
698 * Output: Nothing
699 */
700 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
701 public static final String ACTION_SEARCH_SETTINGS =
702 "android.search.action.SEARCH_SETTINGS";
703
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500704 /**
705 * Activity Action: Show general device information settings (serial
706 * number, software version, phone number, etc.).
707 * <p>
708 * In some cases, a matching Activity may not exist, so ensure you
709 * safeguard against this.
710 * <p>
711 * Input: Nothing.
712 * <p>
713 * Output: Nothing
714 */
715 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
716 public static final String ACTION_DEVICE_INFO_SETTINGS =
717 "android.settings.DEVICE_INFO_SETTINGS";
718
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500719 /**
Nick Pellycccf01d2011-10-31 14:49:40 -0700720 * Activity Action: Show NFC settings.
721 * <p>
722 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500723 * <p>
724 * In some cases, a matching Activity may not exist, so ensure you
725 * safeguard against this.
726 * <p>
727 * Input: Nothing.
728 * <p>
729 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -0700730 * @see android.nfc.NfcAdapter#isEnabled()
731 */
732 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
733 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
734
735 /**
736 * Activity Action: Show NFC Sharing settings.
737 * <p>
738 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
739 * off.
740 * <p>
741 * In some cases, a matching Activity may not exist, so ensure you
742 * safeguard against this.
743 * <p>
744 * Input: Nothing.
745 * <p>
746 * Output: Nothing
747 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500748 */
749 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
750 public static final String ACTION_NFCSHARING_SETTINGS =
751 "android.settings.NFCSHARING_SETTINGS";
752
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500753 /**
Martijn Coenen62c196a2013-08-09 13:43:34 -0700754 * Activity Action: Show NFC Tap & Pay settings
755 * <p>
756 * This shows UI that allows the user to configure Tap&Pay
757 * settings.
758 * <p>
759 * In some cases, a matching Activity may not exist, so ensure you
760 * safeguard against this.
761 * <p>
762 * Input: Nothing.
763 * <p>
764 * Output: Nothing
765 */
766 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
767 public static final String ACTION_NFC_PAYMENT_SETTINGS =
768 "android.settings.NFC_PAYMENT_SETTINGS";
769
770 /**
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500771 * Activity Action: Show Daydream settings.
772 * <p>
773 * In some cases, a matching Activity may not exist, so ensure you
774 * safeguard against this.
775 * <p>
776 * Input: Nothing.
777 * <p>
778 * Output: Nothing.
779 * @see android.service.dreams.DreamService
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500780 */
781 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
782 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
783
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700784 /**
785 * Activity Action: Show Notification listener settings.
786 * <p>
787 * In some cases, a matching Activity may not exist, so ensure you
788 * safeguard against this.
789 * <p>
790 * Input: Nothing.
791 * <p>
792 * Output: Nothing.
793 * @see android.service.notification.NotificationListenerService
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700794 */
795 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
796 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
Chris Wren8326a8a2014-10-22 14:13:32 -0400797 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700798
Alan Viverette69ce69b2013-08-29 12:23:48 -0700799 /**
John Spurlock7340fc82014-04-24 18:50:12 -0400800 * @hide
801 */
802 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
803 public static final String ACTION_CONDITION_PROVIDER_SETTINGS
804 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS";
805
806 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -0700807 * Activity Action: Show settings for video captioning.
808 * <p>
809 * In some cases, a matching Activity may not exist, so ensure you safeguard
810 * against this.
811 * <p>
812 * Input: Nothing.
813 * <p>
814 * Output: Nothing.
815 */
816 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
817 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
818
Svetoslav773f54d2013-09-03 14:01:43 -0700819 /**
820 * Activity Action: Show the top level print settings.
821 * <p>
822 * In some cases, a matching Activity may not exist, so ensure you
823 * safeguard against this.
824 * <p>
825 * Input: Nothing.
826 * <p>
827 * Output: Nothing.
828 */
829 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
830 public static final String ACTION_PRINT_SETTINGS =
831 "android.settings.ACTION_PRINT_SETTINGS";
832
John Spurlockde547002014-02-28 17:50:39 -0500833 /**
834 * Activity Action: Show Zen Mode configuration settings.
835 *
836 * @hide
837 */
838 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
839 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
840
Santos Cordona4c75242014-07-09 12:07:51 -0700841 /**
John Spurlockfc746f82015-04-03 13:47:14 -0400842 * Activity Action: Show Zen Mode priority configuration settings.
843 *
844 * @hide
845 */
846 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
847 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS
848 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS";
849
850 /**
Santos Cordona4c75242014-07-09 12:07:51 -0700851 * Activity Action: Show the regulatory information screen for the device.
852 * <p>
853 * In some cases, a matching Activity may not exist, so ensure you safeguard
854 * against this.
855 * <p>
856 * Input: Nothing.
857 * <p>
858 * Output: Nothing.
859 */
Jeff Sharkeydd77fda2014-04-16 17:23:08 -0700860 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
861 public static final String
862 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
863
Jerome Poichet7974cb32014-05-14 12:04:43 -0700864 /**
865 * Activity Action: Show Device Name Settings.
866 * <p>
867 * In some cases, a matching Activity may not exist, so ensure you safeguard
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -0700868 * against this.
Jerome Poichet7974cb32014-05-14 12:04:43 -0700869 *
870 * @hide
871 */
872 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
873 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME";
874
Tim Kilbourn87cd0dc2014-04-14 15:37:51 -0700875 /**
876 * Activity Action: Show pairing settings.
877 * <p>
878 * In some cases, a matching Activity may not exist, so ensure you safeguard
879 * against this.
880 *
881 * @hide
882 */
883 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
884 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS";
885
John Spurlockf8f524c2014-06-10 14:47:29 -0400886 /**
887 * Activity Action: Show battery saver settings.
John Spurlock73466662014-10-30 13:42:05 -0400888 * <p>
889 * In some cases, a matching Activity may not exist, so ensure you safeguard
890 * against this.
John Spurlockf8f524c2014-06-10 14:47:29 -0400891 */
892 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
893 public static final String ACTION_BATTERY_SAVER_SETTINGS
894 = "android.settings.BATTERY_SAVER_SETTINGS";
895
Amith Yamasanieb7b94a2014-07-14 18:02:08 -0700896 /**
897 * Activity Action: Show Home selection settings. If there are multiple activities
898 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you
899 * to pick your preferred activity.
900 */
901 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
902 public static final String ACTION_HOME_SETTINGS
903 = "android.settings.HOME_SETTINGS";
904
John Spurlock2b0e09c2014-07-27 13:27:47 -0400905 /**
906 * Activity Action: Show notification settings.
907 *
908 * @hide
909 */
910 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
911 public static final String ACTION_NOTIFICATION_SETTINGS
912 = "android.settings.NOTIFICATION_SETTINGS";
913
914 /**
915 * Activity Action: Show notification settings for a single app.
916 *
917 * @hide
918 */
919 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
920 public static final String ACTION_APP_NOTIFICATION_SETTINGS
921 = "android.settings.APP_NOTIFICATION_SETTINGS";
922
Chris Wrencd8f4f72014-08-27 18:48:13 -0400923 /**
924 * Activity Action: Show notification redaction settings.
925 *
926 * @hide
927 */
928 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
929 public static final String ACTION_APP_NOTIFICATION_REDACTION
930 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION";
931
John Spurlock2b0e09c2014-07-27 13:27:47 -0400932 /** @hide */ public static final String EXTRA_APP_UID = "app_uid";
933 /** @hide */ public static final String EXTRA_APP_PACKAGE = "app_package";
934
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800935 // End of Intent actions for Settings
936
Erikeebc8e22010-02-18 13:27:19 -0800937 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800938 * @hide - Private call() method on SettingsProvider to read from 'system' table.
939 */
940 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
941
942 /**
943 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
944 */
945 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
946
947 /**
Christopher Tate06efb532012-08-24 15:29:27 -0700948 * @hide - Private call() method on SettingsProvider to read from 'global' table.
949 */
950 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
951
952 /**
953 * @hide - User handle argument extra to the fast-path call()-based requests
954 */
955 public static final String CALL_METHOD_USER_KEY = "_user";
956
957 /** @hide - Private call() method to write to 'system' table */
958 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
959
960 /** @hide - Private call() method to write to 'secure' table */
961 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
962
963 /** @hide - Private call() method to write to 'global' table */
964 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
965
966 /**
Erikeebc8e22010-02-18 13:27:19 -0800967 * Activity Extra: Limit available options in launched activity based on the given authority.
968 * <p>
969 * This can be passed as an extra field in an Activity Intent with one or more syncable content
970 * provider's authorities as a String[]. This field is used by some intents to alter the
971 * behavior of the called activity.
972 * <p>
973 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
974 * on the authority given.
975 */
Alon Albert50359c22013-02-26 14:47:48 -0800976 public static final String EXTRA_AUTHORITIES = "authorities";
977
Alon Albertd35bf1f2013-04-18 14:26:51 -0700978 /**
979 * Activity Extra: Limit available options in launched activity based on the given account
980 * types.
981 * <p>
982 * This can be passed as an extra field in an Activity Intent with one or more account types
983 * as a String[]. This field is used by some intents to alter the behavior of the called
984 * activity.
985 * <p>
986 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
987 * list.
988 */
Alon Albert50359c22013-02-26 14:47:48 -0800989 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
Erikeebc8e22010-02-18 13:27:19 -0800990
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900991 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
992
Barnaby James48f35522014-07-16 14:27:39 -0700993 /**
Michael Wrightc93fbd12014-09-22 20:07:59 -0700994 * Activity Extra: The device identifier to act upon.
995 * <p>
996 * This can be passed as an extra field in an Activity Intent with a single
997 * InputDeviceIdentifier. This field is used by some activities to jump straight into the
998 * settings for the given device.
999 * <p>
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08001000 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout
1001 * dialog for the given device.
Michael Wrightc93fbd12014-09-22 20:07:59 -07001002 * @hide
1003 */
1004 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
1005
1006 /**
Barnaby James48f35522014-07-16 14:27:39 -07001007 * Activity Extra: Enable or disable Airplane Mode.
1008 * <p>
1009 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
1010 * intent as a boolean.
1011 */
1012 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
1013
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001014 private static final String JID_RESOURCE_PREFIX = "android";
1015
1016 public static final String AUTHORITY = "settings";
1017
1018 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -07001019 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001020
David Christie3f7b6522013-08-06 19:19:08 -07001021 // Lock ensures that when enabling/disabling the master location switch, we don't end up
1022 // with a partial enable/disable state in multi-threaded situations.
1023 private static final Object mLocationSettingsLock = new Object();
1024
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001025 public static class SettingNotFoundException extends AndroidException {
1026 public SettingNotFoundException(String msg) {
1027 super(msg);
1028 }
1029 }
1030
1031 /**
1032 * Common base for tables of name/value settings.
1033 */
1034 public static class NameValueTable implements BaseColumns {
1035 public static final String NAME = "name";
1036 public static final String VALUE = "value";
1037
1038 protected static boolean putString(ContentResolver resolver, Uri uri,
1039 String name, String value) {
1040 // The database will take care of replacing duplicates.
1041 try {
1042 ContentValues values = new ContentValues();
1043 values.put(NAME, name);
1044 values.put(VALUE, value);
1045 resolver.insert(uri, values);
1046 return true;
1047 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -07001048 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001049 return false;
1050 }
1051 }
1052
1053 public static Uri getUriFor(Uri uri, String name) {
1054 return Uri.withAppendedPath(uri, name);
1055 }
1056 }
1057
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001058 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001059 private static class NameValueCache {
1060 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001061 private final Uri mUri;
1062
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001063 private static final String[] SELECT_VALUE =
1064 new String[] { Settings.NameValueTable.VALUE };
1065 private static final String NAME_EQ_PLACEHOLDER = "name=?";
1066
1067 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -08001068 private final HashMap<String, String> mValues = new HashMap<String, String>();
1069 private long mValuesVersion = 0;
1070
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001071 // Initially null; set lazily and held forever. Synchronized on 'this'.
1072 private IContentProvider mContentProvider = null;
1073
1074 // The method we'll call (or null, to not use) on the provider
1075 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -07001076 private final String mCallGetCommand;
1077 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001078
Christopher Tate06efb532012-08-24 15:29:27 -07001079 public NameValueCache(String versionSystemProperty, Uri uri,
1080 String getCommand, String setCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001081 mVersionSystemProperty = versionSystemProperty;
1082 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -07001083 mCallGetCommand = getCommand;
1084 mCallSetCommand = setCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001085 }
1086
Christopher Tate06efb532012-08-24 15:29:27 -07001087 private IContentProvider lazyGetProvider(ContentResolver cr) {
1088 IContentProvider cp = null;
1089 synchronized (this) {
1090 cp = mContentProvider;
1091 if (cp == null) {
1092 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
1093 }
1094 }
1095 return cp;
1096 }
1097
1098 public boolean putStringForUser(ContentResolver cr, String name, String value,
1099 final int userHandle) {
1100 try {
1101 Bundle arg = new Bundle();
1102 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -07001103 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -07001104 IContentProvider cp = lazyGetProvider(cr);
Dianne Hackborn35654b62013-01-14 17:38:02 -08001105 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
Christopher Tate06efb532012-08-24 15:29:27 -07001106 } catch (RemoteException e) {
1107 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
1108 return false;
1109 }
1110 return true;
1111 }
1112
Christopher Tate06efb532012-08-24 15:29:27 -07001113 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -07001114 final boolean isSelf = (userHandle == UserHandle.myUserId());
1115 if (isSelf) {
1116 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -08001117
Christopher Tate78d2a662012-09-13 16:19:44 -07001118 // Our own user's settings data uses a client-side cache
1119 synchronized (this) {
1120 if (mValuesVersion != newValuesVersion) {
1121 if (LOCAL_LOGV || false) {
1122 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current "
1123 + newValuesVersion + " != cached " + mValuesVersion);
1124 }
1125
1126 mValues.clear();
1127 mValuesVersion = newValuesVersion;
Dan Egnor799f7212009-11-24 16:24:44 -08001128 }
1129
Christopher Tate78d2a662012-09-13 16:19:44 -07001130 if (mValues.containsKey(name)) {
1131 return mValues.get(name); // Could be null, that's OK -- negative caching
1132 }
Dan Egnor799f7212009-11-24 16:24:44 -08001133 }
Christopher Tate78d2a662012-09-13 16:19:44 -07001134 } else {
1135 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
1136 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001137 }
Dan Egnor799f7212009-11-24 16:24:44 -08001138
Christopher Tate06efb532012-08-24 15:29:27 -07001139 IContentProvider cp = lazyGetProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001140
1141 // Try the fast path first, not using query(). If this
1142 // fails (alternate Settings provider that doesn't support
1143 // this interface?) then we fall back to the query/table
1144 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -07001145 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001146 try {
Christopher Tate06efb532012-08-24 15:29:27 -07001147 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -07001148 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -07001149 args = new Bundle();
1150 args.putInt(CALL_METHOD_USER_KEY, userHandle);
1151 }
Dianne Hackborn35654b62013-01-14 17:38:02 -08001152 Bundle b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001153 if (b != null) {
1154 String value = b.getPairValue();
Christopher Tate78d2a662012-09-13 16:19:44 -07001155 // Don't update our cache for reads of other users' data
1156 if (isSelf) {
1157 synchronized (this) {
1158 mValues.put(name, value);
1159 }
1160 } else {
1161 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
1162 + " by " + UserHandle.myUserId()
1163 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001164 }
1165 return value;
1166 }
1167 // If the response Bundle is null, we fall through
1168 // to the query interface below.
1169 } catch (RemoteException e) {
1170 // Not supported by the remote side? Fall through
1171 // to query().
1172 }
1173 }
1174
Dan Egnor799f7212009-11-24 16:24:44 -08001175 Cursor c = null;
1176 try {
Dianne Hackborn35654b62013-01-14 17:38:02 -08001177 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
Jeff Brown75ea64f2012-01-25 19:37:13 -08001178 new String[]{name}, null, null);
Dan Egnor799f7212009-11-24 16:24:44 -08001179 if (c == null) {
1180 Log.w(TAG, "Can't get key " + name + " from " + mUri);
1181 return null;
1182 }
1183
1184 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001185 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -08001186 mValues.put(name, value);
1187 }
1188 if (LOCAL_LOGV) {
1189 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
1190 name + " = " + (value == null ? "(null)" : value));
1191 }
1192 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08001193 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -08001194 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
1195 return null; // Return null, but don't cache it.
1196 } finally {
1197 if (c != null) c.close();
1198 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001199 }
1200 }
1201
1202 /**
1203 * System settings, containing miscellaneous system preferences. This
1204 * table holds simple name/value pairs. There are convenience
1205 * functions for accessing individual settings entries.
1206 */
1207 public static final class System extends NameValueTable {
1208 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
1209
Svetoslav683914b2015-01-15 14:22:26 -08001210 /** @hide */
1211 public static interface Validator {
1212 public boolean validate(String value);
1213 }
1214
Dianne Hackborn139748f2012-09-24 11:36:57 -07001215 /**
1216 * The content:// style URL for this table
1217 */
1218 public static final Uri CONTENT_URI =
1219 Uri.parse("content://" + AUTHORITY + "/system");
1220
1221 private static final NameValueCache sNameValueCache = new NameValueCache(
1222 SYS_PROP_SETTING_VERSION,
1223 CONTENT_URI,
1224 CALL_METHOD_GET_SYSTEM,
1225 CALL_METHOD_PUT_SYSTEM);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001226
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001227 private static final HashSet<String> MOVED_TO_SECURE;
1228 static {
1229 MOVED_TO_SECURE = new HashSet<String>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001230 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001231 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001232 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -04001233 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -08001234 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
1235 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
1236 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001237 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
1238 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
1239 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
1240 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
1241 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001242 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
1243 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
1244 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
1245 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
1246 MOVED_TO_SECURE.add(Secure.WIFI_ON);
1247 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
1248 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
1249 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
1250 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
1251 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
1252 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
1253 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
1254 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
1255 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
1256 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
1257 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
Christopher Tateaa036a22014-05-19 16:33:27 -07001258
1259 // At one time in System, then Global, but now back in Secure
1260 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001261 }
1262
Christopher Tate06efb532012-08-24 15:29:27 -07001263 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -07001264 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -07001265 static {
1266 MOVED_TO_GLOBAL = new HashSet<String>();
Christopher Tate66488d62012-10-02 11:58:01 -07001267 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
1268
Christopher Tate92198742012-09-07 12:00:13 -07001269 // these were originally in system but migrated to secure in the past,
1270 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -07001271 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
1272 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
1273 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
1274 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
Christopher Tate66488d62012-10-02 11:58:01 -07001275 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
1276 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -07001277
Christopher Tate92198742012-09-07 12:00:13 -07001278 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -07001279 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
1280 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
1281 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
1282 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
1283 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
1284 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
1285 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
1286 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
1287 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
1288 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
1289 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
1290 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
1291 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
1292 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
1293 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
1294 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001295 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001296 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
1297 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
1298 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
1299 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
1300 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
1301 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
1302 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
1303 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
1304 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
1305 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
1306 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Geremy Condraa0735112013-03-26 21:49:26 -07001307 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
1308 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
1309 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
1310 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
1311 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
1312 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
1313 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
1314 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
Christopher Tate06efb532012-08-24 15:29:27 -07001315 }
1316
Svetoslav683914b2015-01-15 14:22:26 -08001317 private static final Validator sBooleanValidator =
1318 new DiscreteValueValidator(new String[] {"0", "1"});
1319
1320 private static final Validator sNonNegativeIntegerValidator = new Validator() {
1321 @Override
1322 public boolean validate(String value) {
1323 try {
1324 return Integer.parseInt(value) >= 0;
1325 } catch (NumberFormatException e) {
1326 return false;
1327 }
1328 }
1329 };
1330
Svetoslav683914b2015-01-15 14:22:26 -08001331 private static final Validator sUriValidator = new Validator() {
1332 @Override
1333 public boolean validate(String value) {
1334 try {
1335 Uri.decode(value);
1336 return true;
1337 } catch (IllegalArgumentException e) {
1338 return false;
1339 }
1340 }
1341 };
1342
1343 private static final Validator sLenientIpAddressValidator = new Validator() {
1344 private static final int MAX_IPV6_LENGTH = 45;
1345
1346 @Override
1347 public boolean validate(String value) {
1348 return value.length() <= MAX_IPV6_LENGTH;
1349 }
1350 };
1351
Christopher Tate66488d62012-10-02 11:58:01 -07001352 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001353 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07001354 outKeySet.addAll(MOVED_TO_GLOBAL);
1355 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
1356 }
1357
1358 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08001359 public static void getMovedToSecureSettings(Set<String> outKeySet) {
1360 outKeySet.addAll(MOVED_TO_SECURE);
1361 }
1362
1363 /** @hide */
Christopher Tate66488d62012-10-02 11:58:01 -07001364 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
1365 outKeySet.addAll(MOVED_TO_GLOBAL);
1366 }
1367
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001368 /**
1369 * Look up a name in the database.
1370 * @param resolver to access the database with
1371 * @param name to look up in the table
1372 * @return the corresponding value, or null if not present
1373 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001374 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07001375 return getStringForUser(resolver, name, UserHandle.myUserId());
1376 }
1377
1378 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001379 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07001380 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001381 if (MOVED_TO_SECURE.contains(name)) {
1382 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1383 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07001384 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001385 }
Christopher Tate66488d62012-10-02 11:58:01 -07001386 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001387 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1388 + " to android.provider.Settings.Global, returning read-only value.");
1389 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001390 }
Christopher Tate06efb532012-08-24 15:29:27 -07001391 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001392 }
1393
1394 /**
1395 * Store a name/value pair into the database.
1396 * @param resolver to access the database with
1397 * @param name to store
1398 * @param value to associate with the name
1399 * @return true if the value was set, false on database errors
1400 */
1401 public static boolean putString(ContentResolver resolver, String name, String value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001402 return putStringForUser(resolver, name, value, UserHandle.myUserId());
1403 }
1404
1405 /** @hide */
1406 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
1407 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001408 if (MOVED_TO_SECURE.contains(name)) {
1409 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1410 + " to android.provider.Settings.Secure, value is unchanged.");
1411 return false;
1412 }
Christopher Tate66488d62012-10-02 11:58:01 -07001413 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001414 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1415 + " to android.provider.Settings.Global, value is unchanged.");
1416 return false;
1417 }
Christopher Tate06efb532012-08-24 15:29:27 -07001418 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001419 }
1420
1421 /**
1422 * Construct the content URI for a particular name/value pair,
1423 * useful for monitoring changes with a ContentObserver.
1424 * @param name to look up in the table
1425 * @return the corresponding content URI, or null if not present
1426 */
1427 public static Uri getUriFor(String name) {
1428 if (MOVED_TO_SECURE.contains(name)) {
1429 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1430 + " to android.provider.Settings.Secure, returning Secure URI.");
1431 return Secure.getUriFor(Secure.CONTENT_URI, name);
1432 }
Christopher Tate66488d62012-10-02 11:58:01 -07001433 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001434 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1435 + " to android.provider.Settings.Global, returning read-only global URI.");
1436 return Global.getUriFor(Global.CONTENT_URI, name);
1437 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001438 return getUriFor(CONTENT_URI, name);
1439 }
1440
1441 /**
1442 * Convenience function for retrieving a single system settings value
1443 * as an integer. Note that internally setting values are always
1444 * stored as strings; this function converts the string to an integer
1445 * for you. The default value will be returned if the setting is
1446 * not defined or not an integer.
1447 *
1448 * @param cr The ContentResolver to access.
1449 * @param name The name of the setting to retrieve.
1450 * @param def Value to return if the setting is not defined.
1451 *
1452 * @return The setting's current value, or 'def' if it is not defined
1453 * or not a valid integer.
1454 */
1455 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001456 return getIntForUser(cr, name, def, UserHandle.myUserId());
1457 }
1458
1459 /** @hide */
1460 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
1461 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001462 try {
1463 return v != null ? Integer.parseInt(v) : def;
1464 } catch (NumberFormatException e) {
1465 return def;
1466 }
1467 }
1468
1469 /**
1470 * Convenience function for retrieving a single system settings value
1471 * as an integer. Note that internally setting values are always
1472 * stored as strings; this function converts the string to an integer
1473 * for you.
1474 * <p>
1475 * This version does not take a default value. If the setting has not
1476 * been set, or the string value is not a number,
1477 * it throws {@link SettingNotFoundException}.
1478 *
1479 * @param cr The ContentResolver to access.
1480 * @param name The name of the setting to retrieve.
1481 *
1482 * @throws SettingNotFoundException Thrown if a setting by the given
1483 * name can't be found or the setting value is not an integer.
1484 *
1485 * @return The setting's current value.
1486 */
1487 public static int getInt(ContentResolver cr, String name)
1488 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001489 return getIntForUser(cr, name, UserHandle.myUserId());
1490 }
1491
1492 /** @hide */
1493 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
1494 throws SettingNotFoundException {
1495 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001496 try {
1497 return Integer.parseInt(v);
1498 } catch (NumberFormatException e) {
1499 throw new SettingNotFoundException(name);
1500 }
1501 }
1502
1503 /**
1504 * Convenience function for updating a single settings value as an
1505 * integer. This will either create a new entry in the table if the
1506 * given name does not exist, or modify the value of the existing row
1507 * with that name. Note that internally setting values are always
1508 * stored as strings, so this function converts the given value to a
1509 * string before storing it.
1510 *
1511 * @param cr The ContentResolver to access.
1512 * @param name The name of the setting to modify.
1513 * @param value The new value for the setting.
1514 * @return true if the value was set, false on database errors
1515 */
1516 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001517 return putIntForUser(cr, name, value, UserHandle.myUserId());
1518 }
1519
1520 /** @hide */
1521 public static boolean putIntForUser(ContentResolver cr, String name, int value,
1522 int userHandle) {
1523 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001524 }
1525
1526 /**
1527 * Convenience function for retrieving a single system settings value
1528 * as a {@code long}. Note that internally setting values are always
1529 * stored as strings; this function converts the string to a {@code long}
1530 * for you. The default value will be returned if the setting is
1531 * not defined or not a {@code long}.
1532 *
1533 * @param cr The ContentResolver to access.
1534 * @param name The name of the setting to retrieve.
1535 * @param def Value to return if the setting is not defined.
1536 *
1537 * @return The setting's current value, or 'def' if it is not defined
1538 * or not a valid {@code long}.
1539 */
1540 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001541 return getLongForUser(cr, name, def, UserHandle.myUserId());
1542 }
1543
1544 /** @hide */
1545 public static long getLongForUser(ContentResolver cr, String name, long def,
1546 int userHandle) {
1547 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001548 long value;
1549 try {
1550 value = valString != null ? Long.parseLong(valString) : def;
1551 } catch (NumberFormatException e) {
1552 value = def;
1553 }
1554 return value;
1555 }
1556
1557 /**
1558 * Convenience function for retrieving a single system settings value
1559 * as a {@code long}. Note that internally setting values are always
1560 * stored as strings; this function converts the string to a {@code long}
1561 * for you.
1562 * <p>
1563 * This version does not take a default value. If the setting has not
1564 * been set, or the string value is not a number,
1565 * it throws {@link SettingNotFoundException}.
1566 *
1567 * @param cr The ContentResolver to access.
1568 * @param name The name of the setting to retrieve.
1569 *
1570 * @return The setting's current value.
1571 * @throws SettingNotFoundException Thrown if a setting by the given
1572 * name can't be found or the setting value is not an integer.
1573 */
1574 public static long getLong(ContentResolver cr, String name)
1575 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001576 return getLongForUser(cr, name, UserHandle.myUserId());
1577 }
1578
1579 /** @hide */
1580 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
1581 throws SettingNotFoundException {
1582 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001583 try {
1584 return Long.parseLong(valString);
1585 } catch (NumberFormatException e) {
1586 throw new SettingNotFoundException(name);
1587 }
1588 }
1589
1590 /**
1591 * Convenience function for updating a single settings value as a long
1592 * integer. This will either create a new entry in the table if the
1593 * given name does not exist, or modify the value of the existing row
1594 * with that name. Note that internally setting values are always
1595 * stored as strings, so this function converts the given value to a
1596 * string before storing it.
1597 *
1598 * @param cr The ContentResolver to access.
1599 * @param name The name of the setting to modify.
1600 * @param value The new value for the setting.
1601 * @return true if the value was set, false on database errors
1602 */
1603 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001604 return putLongForUser(cr, name, value, UserHandle.myUserId());
1605 }
1606
1607 /** @hide */
1608 public static boolean putLongForUser(ContentResolver cr, String name, long value,
1609 int userHandle) {
1610 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001611 }
1612
1613 /**
1614 * Convenience function for retrieving a single system settings value
1615 * as a floating point number. Note that internally setting values are
1616 * always stored as strings; this function converts the string to an
1617 * float for you. The default value will be returned if the setting
1618 * is not defined or not a valid float.
1619 *
1620 * @param cr The ContentResolver to access.
1621 * @param name The name of the setting to retrieve.
1622 * @param def Value to return if the setting is not defined.
1623 *
1624 * @return The setting's current value, or 'def' if it is not defined
1625 * or not a valid float.
1626 */
1627 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001628 return getFloatForUser(cr, name, def, UserHandle.myUserId());
1629 }
1630
1631 /** @hide */
1632 public static float getFloatForUser(ContentResolver cr, String name, float def,
1633 int userHandle) {
1634 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001635 try {
1636 return v != null ? Float.parseFloat(v) : def;
1637 } catch (NumberFormatException e) {
1638 return def;
1639 }
1640 }
1641
1642 /**
1643 * Convenience function for retrieving a single system settings value
1644 * as a float. Note that internally setting values are always
1645 * stored as strings; this function converts the string to a float
1646 * for you.
1647 * <p>
1648 * This version does not take a default value. If the setting has not
1649 * been set, or the string value is not a number,
1650 * it throws {@link SettingNotFoundException}.
1651 *
1652 * @param cr The ContentResolver to access.
1653 * @param name The name of the setting to retrieve.
1654 *
1655 * @throws SettingNotFoundException Thrown if a setting by the given
1656 * name can't be found or the setting value is not a float.
1657 *
1658 * @return The setting's current value.
1659 */
1660 public static float getFloat(ContentResolver cr, String name)
1661 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001662 return getFloatForUser(cr, name, UserHandle.myUserId());
1663 }
1664
1665 /** @hide */
1666 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
1667 throws SettingNotFoundException {
1668 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08001669 if (v == null) {
1670 throw new SettingNotFoundException(name);
1671 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001672 try {
1673 return Float.parseFloat(v);
1674 } catch (NumberFormatException e) {
1675 throw new SettingNotFoundException(name);
1676 }
1677 }
1678
1679 /**
1680 * Convenience function for updating a single settings value as a
1681 * floating point number. This will either create a new entry in the
1682 * table if the given name does not exist, or modify the value of the
1683 * existing row with that name. Note that internally setting values
1684 * are always stored as strings, so this function converts the given
1685 * value to a string before storing it.
1686 *
1687 * @param cr The ContentResolver to access.
1688 * @param name The name of the setting to modify.
1689 * @param value The new value for the setting.
1690 * @return true if the value was set, false on database errors
1691 */
1692 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001693 return putFloatForUser(cr, name, value, UserHandle.myUserId());
1694 }
1695
1696 /** @hide */
1697 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
1698 int userHandle) {
1699 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001700 }
1701
1702 /**
1703 * Convenience function to read all of the current
1704 * configuration-related settings into a
1705 * {@link Configuration} object.
1706 *
1707 * @param cr The ContentResolver to access.
1708 * @param outConfig Where to place the configuration settings.
1709 */
1710 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Christopher Tate06efb532012-08-24 15:29:27 -07001711 getConfigurationForUser(cr, outConfig, UserHandle.myUserId());
1712 }
1713
1714 /** @hide */
1715 public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig,
1716 int userHandle) {
1717 outConfig.fontScale = Settings.System.getFloatForUser(
1718 cr, FONT_SCALE, outConfig.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001719 if (outConfig.fontScale < 0) {
1720 outConfig.fontScale = 1;
1721 }
1722 }
1723
1724 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001725 * @hide Erase the fields in the Configuration that should be applied
1726 * by the settings.
1727 */
1728 public static void clearConfiguration(Configuration inoutConfig) {
1729 inoutConfig.fontScale = 0;
1730 }
Narayan Kamath6d632962011-08-24 11:51:37 +01001731
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001732 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001733 * Convenience function to write a batch of configuration-related
1734 * settings from a {@link Configuration} object.
1735 *
1736 * @param cr The ContentResolver to access.
1737 * @param config The settings to write.
1738 * @return true if the values were set, false on database errors
1739 */
1740 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Christopher Tate06efb532012-08-24 15:29:27 -07001741 return putConfigurationForUser(cr, config, UserHandle.myUserId());
1742 }
1743
1744 /** @hide */
1745 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
1746 int userHandle) {
1747 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001748 }
1749
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001750 /** @hide */
1751 public static boolean hasInterestingConfigurationChanges(int changes) {
1752 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1753 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001754
Christopher Tate06efb532012-08-24 15:29:27 -07001755 /** @deprecated - Do not use */
1756 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001757 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Christopher Tate06efb532012-08-24 15:29:27 -07001758 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001759 }
1760
Christopher Tate06efb532012-08-24 15:29:27 -07001761 /**
1762 * @hide
1763 * @deprecated - Do not use
1764 */
1765 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
1766 int userHandle) {
1767 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
1768 }
1769
1770 /** @deprecated - Do not use */
1771 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001772 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Christopher Tatec8c08382012-09-19 17:18:18 -07001773 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07001774 }
1775
1776 /**
1777 * @hide
1778 * @deprecated - Do not use
1779 */
1780 @Deprecated
1781 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
1782 int userHandle) {
1783 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001784 }
1785
Svetoslav683914b2015-01-15 14:22:26 -08001786 private static final class DiscreteValueValidator implements Validator {
1787 private final String[] mValues;
1788
1789 public DiscreteValueValidator(String[] values) {
1790 mValues = values;
1791 }
1792
Svetoslav1b71ea92015-02-17 18:20:29 -08001793 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001794 public boolean validate(String value) {
1795 return ArrayUtils.contains(mValues, value);
1796 }
1797 }
1798
1799 private static final class InclusiveIntegerRangeValidator implements Validator {
1800 private final int mMin;
1801 private final int mMax;
1802
1803 public InclusiveIntegerRangeValidator(int min, int max) {
1804 mMin = min;
1805 mMax = max;
1806 }
1807
Svetoslav1b71ea92015-02-17 18:20:29 -08001808 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001809 public boolean validate(String value) {
1810 try {
1811 final int intValue = Integer.parseInt(value);
1812 return intValue >= mMin && intValue <= mMax;
1813 } catch (NumberFormatException e) {
1814 return false;
1815 }
1816 }
1817 }
1818
1819 private static final class InclusiveFloatRangeValidator implements Validator {
1820 private final float mMin;
1821 private final float mMax;
1822
1823 public InclusiveFloatRangeValidator(float min, float max) {
1824 mMin = min;
1825 mMax = max;
1826 }
1827
Svetoslav1b71ea92015-02-17 18:20:29 -08001828 @Override
Svetoslav683914b2015-01-15 14:22:26 -08001829 public boolean validate(String value) {
1830 try {
1831 final float floatValue = Float.parseFloat(value);
1832 return floatValue >= mMin && floatValue <= mMax;
1833 } catch (NumberFormatException e) {
1834 return false;
1835 }
1836 }
1837 }
1838
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001839 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001840 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001841 */
Christopher Tate06efb532012-08-24 15:29:27 -07001842 @Deprecated
1843 public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001844
1845 /**
1846 * What happens when the user presses the end call button if they're not
1847 * on a call.<br/>
1848 * <b>Values:</b><br/>
1849 * 0 - The end button does nothing.<br/>
1850 * 1 - The end button goes to the home screen.<br/>
1851 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1852 * 3 - The end button goes to the home screen. If the user is already on the
1853 * home screen, it puts the device to sleep.
1854 */
1855 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1856
Svetoslav683914b2015-01-15 14:22:26 -08001857 private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR =
1858 new InclusiveIntegerRangeValidator(0, 3);
1859
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001860 /**
David Brown458e8062010-03-08 21:52:11 -08001861 * END_BUTTON_BEHAVIOR value for "go home".
1862 * @hide
1863 */
1864 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1865
1866 /**
1867 * END_BUTTON_BEHAVIOR value for "go to sleep".
1868 * @hide
1869 */
1870 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
1871
1872 /**
1873 * END_BUTTON_BEHAVIOR default value.
1874 * @hide
1875 */
1876 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
1877
1878 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07001879 * Is advanced settings mode turned on. 0 == no, 1 == yes
1880 * @hide
1881 */
1882 public static final String ADVANCED_SETTINGS = "advanced_settings";
1883
Svetoslav683914b2015-01-15 14:22:26 -08001884 private static final Validator ADVANCED_SETTINGS_VALIDATOR = sBooleanValidator;
1885
Joe Onorato9cdffa12011-04-06 18:27:27 -07001886 /**
1887 * ADVANCED_SETTINGS default value.
1888 * @hide
1889 */
1890 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
1891
1892 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001893 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001894 */
Christopher Tate06efb532012-08-24 15:29:27 -07001895 @Deprecated
1896 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001897
1898 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001899 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001900 */
Christopher Tate06efb532012-08-24 15:29:27 -07001901 @Deprecated
1902 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001903
1904 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001905 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001906 */
Christopher Tate06efb532012-08-24 15:29:27 -07001907 @Deprecated
1908 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001909
Robert Greenwalt8588e472011-11-08 10:12:25 -08001910 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001911 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08001912 * {@hide}
1913 */
Christopher Tate06efb532012-08-24 15:29:27 -07001914 @Deprecated
1915 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001916
1917 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001918 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07001919 */
Christopher Tate06efb532012-08-24 15:29:27 -07001920 @Deprecated
1921 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07001922
1923 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001924 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001925 */
Christopher Tate06efb532012-08-24 15:29:27 -07001926 @Deprecated
1927 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001928
1929 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001930 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
1931 */
1932 @Deprecated
1933 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
1934
1935 /**
1936 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001937 *
1938 * {@hide}
1939 */
Christopher Tate06efb532012-08-24 15:29:27 -07001940 @Deprecated
1941 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
1942 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001943
1944 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001945 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001946 */
Christopher Tate06efb532012-08-24 15:29:27 -07001947 @Deprecated
1948 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001949
1950 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001951 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001952 */
Christopher Tate06efb532012-08-24 15:29:27 -07001953 @Deprecated
1954 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001955
1956 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001957 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001958 */
Christopher Tate06efb532012-08-24 15:29:27 -07001959 @Deprecated
1960 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
1961 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001962
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001963 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001964 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001965 */
Christopher Tate06efb532012-08-24 15:29:27 -07001966 @Deprecated
1967 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001968
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001969 /**
1970 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
1971 */
1972 @Deprecated
1973 public static final String MODE_RINGER = Global.MODE_RINGER;
1974
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001975 /**
1976 * Whether to use static IP and other static network attributes.
1977 * <p>
1978 * Set to 1 for true and 0 for false.
Jeff Sharkey625239a2012-09-26 22:03:49 -07001979 *
1980 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001981 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001982 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001983 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
1984
Svetoslav683914b2015-01-15 14:22:26 -08001985 private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = sBooleanValidator;
1986
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001987 /**
1988 * The static IP address.
1989 * <p>
1990 * Example: "192.168.1.51"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001991 *
1992 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001993 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001994 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001995 public static final String WIFI_STATIC_IP = "wifi_static_ip";
1996
Svetoslav683914b2015-01-15 14:22:26 -08001997 private static final Validator WIFI_STATIC_IP_VALIDATOR = sLenientIpAddressValidator;
1998
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001999 /**
2000 * If using static IP, the gateway's IP address.
2001 * <p>
2002 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002003 *
2004 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002005 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002006 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002007 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
2008
Svetoslav683914b2015-01-15 14:22:26 -08002009 private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = sLenientIpAddressValidator;
2010
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002011 /**
2012 * If using static IP, the net mask.
2013 * <p>
2014 * Example: "255.255.255.0"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002015 *
2016 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002017 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002018 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002019 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
2020
Svetoslav683914b2015-01-15 14:22:26 -08002021 private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = sLenientIpAddressValidator;
2022
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002023 /**
2024 * If using static IP, the primary DNS's IP address.
2025 * <p>
2026 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002027 *
2028 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002029 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002030 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002031 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
2032
Svetoslav683914b2015-01-15 14:22:26 -08002033 private static final Validator WIFI_STATIC_DNS1_VALIDATOR = sLenientIpAddressValidator;
2034
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002035 /**
2036 * If using static IP, the secondary DNS's IP address.
2037 * <p>
2038 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07002039 *
2040 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002041 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07002042 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002043 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
2044
Svetoslav683914b2015-01-15 14:22:26 -08002045 private static final Validator WIFI_STATIC_DNS2_VALIDATOR = sLenientIpAddressValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002046
2047 /**
2048 * Determines whether remote devices may discover and/or connect to
2049 * this device.
2050 * <P>Type: INT</P>
2051 * 2 -- discoverable and connectable
2052 * 1 -- connectable but not discoverable
2053 * 0 -- neither connectable nor discoverable
2054 */
2055 public static final String BLUETOOTH_DISCOVERABILITY =
2056 "bluetooth_discoverability";
2057
Svetoslav683914b2015-01-15 14:22:26 -08002058 private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR =
2059 new InclusiveIntegerRangeValidator(0, 2);
2060
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002061 /**
2062 * Bluetooth discoverability timeout. If this value is nonzero, then
2063 * Bluetooth becomes discoverable for a certain number of seconds,
2064 * after which is becomes simply connectable. The value is in seconds.
2065 */
2066 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
2067 "bluetooth_discoverability_timeout";
2068
Svetoslav683914b2015-01-15 14:22:26 -08002069 private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR =
2070 sNonNegativeIntegerValidator;
2071
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002072 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002073 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
2074 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002075 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002076 @Deprecated
2077 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002078
2079 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002080 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
2081 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002082 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002083 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002084 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2085
2086 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002087 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08002088 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
2089 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002090 */
Amith Yamasani156c4352010-03-05 17:10:03 -08002091 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002092 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2093 "lock_pattern_tactile_feedback_enabled";
2094
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002095 /**
2096 * A formatted string of the next alarm that is set, or the empty string
2097 * if there is no alarm set.
Adrian Roosc42a1e12014-07-07 23:35:53 +02002098 *
2099 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002100 */
Adrian Roosc42a1e12014-07-07 23:35:53 +02002101 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002102 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
2103
Svetoslav683914b2015-01-15 14:22:26 -08002104 private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() {
2105 private static final int MAX_LENGTH = 1000;
Svetoslav1b71ea92015-02-17 18:20:29 -08002106
Svetoslav683914b2015-01-15 14:22:26 -08002107 @Override
2108 public boolean validate(String value) {
2109 // TODO: No idea what the correct format is.
Svetoslav64d6e9c2015-02-12 11:30:36 -08002110 return value == null || value.length() < MAX_LENGTH;
Svetoslav683914b2015-01-15 14:22:26 -08002111 }
2112 };
2113
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002114 /**
2115 * Scaling factor for fonts, float.
2116 */
2117 public static final String FONT_SCALE = "font_scale";
2118
Svetoslav683914b2015-01-15 14:22:26 -08002119 private static final Validator FONT_SCALE_VALIDATOR = new Validator() {
2120 @Override
2121 public boolean validate(String value) {
2122 try {
2123 return Float.parseFloat(value) >= 0;
2124 } catch (NumberFormatException e) {
2125 return false;
2126 }
2127 }
2128 };
2129
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002130 /**
2131 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002132 *
2133 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002134 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002135 @Deprecated
2136 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002137
2138 /**
2139 * If 1, when launching DEBUG_APP it will wait for the debugger before
2140 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002141 *
2142 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002143 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002144 @Deprecated
2145 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002146
2147 /**
2148 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07002149 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002150 */
Jeff Brown96307042012-07-27 15:51:34 -07002151 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002152 public static final String DIM_SCREEN = "dim_screen";
2153
Svetoslav683914b2015-01-15 14:22:26 -08002154 private static final Validator DIM_SCREEN_VALIDATOR = sBooleanValidator;
2155
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002156 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07002157 * The amount of time in milliseconds before the device goes to sleep or begins
2158 * to dream after a period of inactivity. This value is also known as the
2159 * user activity timeout period since the screen isn't necessarily turned off
2160 * when it expires.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002161 */
2162 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
2163
Svetoslav683914b2015-01-15 14:22:26 -08002164 private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = sNonNegativeIntegerValidator;
2165
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002166 /**
2167 * The screen backlight brightness between 0 and 255.
2168 */
2169 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
2170
Svetoslav683914b2015-01-15 14:22:26 -08002171 private static final Validator SCREEN_BRIGHTNESS_VALIDATOR =
2172 new InclusiveIntegerRangeValidator(0, 255);
2173
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002174 /**
Dan Murphy951764b2009-08-27 14:59:03 -05002175 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05002176 */
2177 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
2178
Svetoslav683914b2015-01-15 14:22:26 -08002179 private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = sBooleanValidator;
2180
Dan Murphy951764b2009-08-27 14:59:03 -05002181 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002182 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
2183 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07002184 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002185 */
2186 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
2187
Svetoslav683914b2015-01-15 14:22:26 -08002188 private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR =
2189 new InclusiveFloatRangeValidator(-1, 1);
2190
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002191 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002192 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002193 */
2194 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
2195
2196 /**
Scott Main52bfc242012-02-09 10:09:14 -08002197 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07002198 */
2199 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
2200
2201 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002202 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002203 *
2204 * @deprecated Use {@link Global#SHOW_PROCESSES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002205 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002206 @Deprecated
2207 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002208
2209 /**
2210 * If 1, the activity manager will aggressively finish activities and
2211 * processes as soon as they are no longer needed. If 0, the normal
2212 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002213 *
2214 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002215 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002216 @Deprecated
2217 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002218
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002219 /**
2220 * Determines which streams are affected by ringer mode changes. The
2221 * stream type's bit should be set to 1 if it should be muted when going
2222 * into an inaudible ringer mode.
2223 */
2224 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
2225
Svetoslav683914b2015-01-15 14:22:26 -08002226 private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR =
2227 sNonNegativeIntegerValidator;
2228
2229 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002230 * Determines which streams are affected by mute. The
2231 * stream type's bit should be set to 1 if it should be muted when a mute request
2232 * is received.
2233 */
Svetoslav683914b2015-01-15 14:22:26 -08002234 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
2235
2236 private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR =
2237 sNonNegativeIntegerValidator;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002238
2239 /**
2240 * Whether vibrate is on for different events. This is used internally,
2241 * changing this value will not change the vibrate. See AudioManager.
2242 */
2243 public static final String VIBRATE_ON = "vibrate_on";
2244
Svetoslav683914b2015-01-15 14:22:26 -08002245 private static final Validator VIBRATE_ON_VALIDATOR = sBooleanValidator;
2246
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002247 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07002248 * If 1, redirects the system vibrator to all currently attached input devices
2249 * that support vibration. If there are no such input devices, then the system
2250 * vibrator is used instead.
2251 * If 0, does not register the system vibrator.
2252 *
2253 * This setting is mainly intended to provide a compatibility mechanism for
2254 * applications that only know about the system vibrator and do not use the
2255 * input device vibrator API.
2256 *
2257 * @hide
2258 */
2259 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
2260
Svetoslav683914b2015-01-15 14:22:26 -08002261 private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = sBooleanValidator;
2262
Jeff Brown7f6c2312012-04-13 20:38:38 -07002263 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002264 * Ringer volume. This is used internally, changing this value will not
2265 * change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002266 *
2267 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002268 */
2269 public static final String VOLUME_RING = "volume_ring";
2270
2271 /**
2272 * System/notifications volume. This is used internally, changing this
2273 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002274 *
2275 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002276 */
2277 public static final String VOLUME_SYSTEM = "volume_system";
2278
2279 /**
2280 * Voice call volume. This is used internally, changing this value will
2281 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002282 *
2283 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002284 */
2285 public static final String VOLUME_VOICE = "volume_voice";
2286
2287 /**
2288 * Music/media/gaming volume. This is used internally, changing this
2289 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002290 *
2291 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002292 */
2293 public static final String VOLUME_MUSIC = "volume_music";
2294
2295 /**
2296 * Alarm volume. This is used internally, changing this
2297 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002298 *
2299 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002300 */
2301 public static final String VOLUME_ALARM = "volume_alarm";
2302
2303 /**
2304 * Notification volume. This is used internally, changing this
2305 * value will not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002306 *
2307 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002308 */
2309 public static final String VOLUME_NOTIFICATION = "volume_notification";
2310
2311 /**
Eric Laurent484d2882009-12-08 09:05:45 -08002312 * Bluetooth Headset volume. This is used internally, changing this value will
2313 * not change the volume. See AudioManager.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002314 *
2315 * @removed Not used by anything since API 2.
Eric Laurent484d2882009-12-08 09:05:45 -08002316 */
2317 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
2318
2319 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04002320 * Master volume (float in the range 0.0f to 1.0f).
Svetoslavdbbeeb32015-02-18 19:16:25 -08002321 *
Mike Lockwood8517e462011-10-25 14:47:19 -04002322 * @hide
2323 */
2324 public static final String VOLUME_MASTER = "volume_master";
2325
2326 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002327 * Master volume mute (int 1 = mute, 0 = not muted).
2328 *
2329 * @hide
2330 */
2331 public static final String VOLUME_MASTER_MUTE = "volume_master_mute";
2332
Svetoslav683914b2015-01-15 14:22:26 -08002333 private static final Validator VOLUME_MASTER_MUTE_VALIDATOR = sBooleanValidator;
2334
Justin Koh57978ed2012-04-03 17:37:58 -07002335 /**
Julia Reynoldsb53453f2014-08-22 11:42:43 -04002336 * Microphone mute (int 1 = mute, 0 = not muted).
2337 *
2338 * @hide
2339 */
2340 public static final String MICROPHONE_MUTE = "microphone_mute";
2341
Svetoslav683914b2015-01-15 14:22:26 -08002342 private static final Validator MICROPHONE_MUTE_VALIDATOR = sBooleanValidator;
2343
Julia Reynoldsb53453f2014-08-22 11:42:43 -04002344 /**
Justin Koh57978ed2012-04-03 17:37:58 -07002345 * Whether the notifications should use the ring volume (value of 1) or
2346 * a separate notification volume (value of 0). In most cases, users
2347 * will have this enabled so the notification and ringer volumes will be
2348 * the same. However, power users can disable this and use the separate
2349 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002350 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07002351 * Note: This is a one-off setting that will be removed in the future
2352 * when there is profile support. For this reason, it is kept hidden
2353 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002354 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002355 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07002356 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002357 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07002358 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002359 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002360 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002361
Svetoslav683914b2015-01-15 14:22:26 -08002362 private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = sBooleanValidator;
2363
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002364 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05002365 * Whether silent mode should allow vibration feedback. This is used
2366 * internally in AudioService and the Sound settings activity to
2367 * coordinate decoupling of vibrate and silent modes. This setting
2368 * will likely be removed in a future release with support for
2369 * audio/vibe feedback profiles.
2370 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07002371 * Not used anymore. On devices with vibrator, the user explicitly selects
2372 * silent or vibrate mode.
2373 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05002374 * @hide
2375 */
2376 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
2377
Svetoslav683914b2015-01-15 14:22:26 -08002378 private static final Validator VIBRATE_IN_SILENT_VALIDATOR = sBooleanValidator;
2379
Daniel Sandler6329bf72010-02-26 15:17:44 -05002380 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002381 * The mapping of stream type (integer) to its setting.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002382 *
2383 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002384 */
2385 public static final String[] VOLUME_SETTINGS = {
2386 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08002387 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002388 };
2389
2390 /**
2391 * Appended to various volume related settings to record the previous
2392 * values before they the settings were affected by a silent/vibrate
2393 * ringer mode change.
Svetoslavdbbeeb32015-02-18 19:16:25 -08002394 *
2395 * @removed Not used by anything since API 2.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002396 */
2397 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
2398
2399 /**
2400 * Persistent store for the system-wide default ringtone URI.
2401 * <p>
2402 * If you need to play the default ringtone at any given time, it is recommended
2403 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
2404 * to the set default ringtone at the time of playing.
2405 *
2406 * @see #DEFAULT_RINGTONE_URI
2407 */
2408 public static final String RINGTONE = "ringtone";
2409
Svetoslav683914b2015-01-15 14:22:26 -08002410 private static final Validator RINGTONE_VALIDATOR = sUriValidator;
2411
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002412 /**
2413 * A {@link Uri} that will point to the current default ringtone at any
2414 * given time.
2415 * <p>
2416 * If the current default ringtone is in the DRM provider and the caller
2417 * does not have permission, the exception will be a
2418 * FileNotFoundException.
2419 */
2420 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
2421
2422 /**
2423 * Persistent store for the system-wide default notification sound.
2424 *
2425 * @see #RINGTONE
2426 * @see #DEFAULT_NOTIFICATION_URI
2427 */
2428 public static final String NOTIFICATION_SOUND = "notification_sound";
2429
Svetoslav683914b2015-01-15 14:22:26 -08002430 private static final Validator NOTIFICATION_SOUND_VALIDATOR = sUriValidator;
2431
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002432 /**
2433 * A {@link Uri} that will point to the current default notification
2434 * sound at any given time.
2435 *
2436 * @see #DEFAULT_RINGTONE_URI
2437 */
2438 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
2439
2440 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07002441 * Persistent store for the system-wide default alarm alert.
2442 *
2443 * @see #RINGTONE
2444 * @see #DEFAULT_ALARM_ALERT_URI
2445 */
2446 public static final String ALARM_ALERT = "alarm_alert";
2447
Svetoslav683914b2015-01-15 14:22:26 -08002448 private static final Validator ALARM_ALERT_VALIDATOR = sUriValidator;
2449
Patrick Scott3156bb002009-04-13 09:57:38 -07002450 /**
2451 * A {@link Uri} that will point to the current default alarm alert at
2452 * any given time.
2453 *
2454 * @see #DEFAULT_ALARM_ALERT_URI
2455 */
2456 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
2457
2458 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002459 * Persistent store for the system default media button event receiver.
2460 *
2461 * @hide
2462 */
2463 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
2464
Svetoslav683914b2015-01-15 14:22:26 -08002465 private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = new Validator() {
2466 @Override
2467 public boolean validate(String value) {
2468 try {
2469 ComponentName.unflattenFromString(value);
2470 return true;
2471 } catch (NullPointerException e) {
2472 return false;
2473 }
2474 }
2475 };
2476
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002477 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002478 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
2479 */
2480 public static final String TEXT_AUTO_REPLACE = "auto_replace";
2481
Svetoslav683914b2015-01-15 14:22:26 -08002482 private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = sBooleanValidator;
2483
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002484 /**
2485 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
2486 */
2487 public static final String TEXT_AUTO_CAPS = "auto_caps";
2488
Svetoslav683914b2015-01-15 14:22:26 -08002489 private static final Validator TEXT_AUTO_CAPS_VALIDATOR = sBooleanValidator;
2490
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002491 /**
2492 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
2493 * feature converts two spaces to a "." and space.
2494 */
2495 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002496
Svetoslav683914b2015-01-15 14:22:26 -08002497 private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = sBooleanValidator;
2498
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002499 /**
2500 * Setting to showing password characters in text editors. 1 = On, 0 = Off
2501 */
2502 public static final String TEXT_SHOW_PASSWORD = "show_password";
2503
Svetoslav683914b2015-01-15 14:22:26 -08002504 private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = sBooleanValidator;
2505
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002506 public static final String SHOW_GTALK_SERVICE_STATUS =
2507 "SHOW_GTALK_SERVICE_STATUS";
2508
Svetoslav683914b2015-01-15 14:22:26 -08002509 private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = sBooleanValidator;
2510
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002511 /**
2512 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002513 *
2514 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002515 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002516 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002517 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
2518
Svetoslav683914b2015-01-15 14:22:26 -08002519 private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() {
2520 private static final int MAX_LENGTH = 1000;
2521
2522 @Override
2523 public boolean validate(String value) {
2524 if (value != null && value.length() > MAX_LENGTH) {
2525 return false;
2526 }
2527 return ComponentName.unflattenFromString(value) != null;
2528 }
2529 };
2530
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002531 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002532 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
2533 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002534 */
Christopher Tate06efb532012-08-24 15:29:27 -07002535 @Deprecated
2536 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002537
2538 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002539 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
2540 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07002541 */
Christopher Tate06efb532012-08-24 15:29:27 -07002542 @Deprecated
2543 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07002544
2545 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002546 * Display times as 12 or 24 hours
2547 * 12
2548 * 24
2549 */
2550 public static final String TIME_12_24 = "time_12_24";
2551
Svetoslav683914b2015-01-15 14:22:26 -08002552 /** @hide */
2553 public static final Validator TIME_12_24_VALIDATOR =
2554 new DiscreteValueValidator(new String[] {"12", "24"});
2555
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002556 /**
2557 * Date format string
2558 * mm/dd/yyyy
2559 * dd/mm/yyyy
2560 * yyyy/mm/dd
2561 */
2562 public static final String DATE_FORMAT = "date_format";
2563
Svetoslav683914b2015-01-15 14:22:26 -08002564 /** @hide */
2565 public static final Validator DATE_FORMAT_VALIDATOR = new Validator() {
2566 @Override
2567 public boolean validate(String value) {
2568 try {
2569 new SimpleDateFormat(value);
2570 return true;
2571 } catch (IllegalArgumentException e) {
2572 return false;
2573 }
2574 }
2575 };
2576
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002577 /**
2578 * Whether the setup wizard has been run before (on first boot), or if
2579 * it still needs to be run.
2580 *
2581 * nonzero = it has been run in the past
2582 * 0 = it has not been run in the past
2583 */
2584 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
2585
Svetoslav683914b2015-01-15 14:22:26 -08002586 /** @hide */
2587 public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = sBooleanValidator;
2588
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002589 /**
2590 * Scaling factor for normal window animations. Setting to 0 will disable window
2591 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002592 *
2593 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002594 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002595 @Deprecated
2596 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002597
2598 /**
2599 * Scaling factor for activity transition animations. Setting to 0 will disable window
2600 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002601 *
2602 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002603 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002604 @Deprecated
2605 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002606
2607 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08002608 * Scaling factor for Animator-based animations. This affects both the start delay and
2609 * duration of all such animations. Setting to 0 will cause animations to end immediately.
2610 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002611 *
2612 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08002613 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002614 @Deprecated
2615 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002616
2617 /**
2618 * Control whether the accelerometer will be used to change screen
2619 * orientation. If 0, it will not be used unless explicitly requested
2620 * by the application; if 1, it will be used by default unless explicitly
2621 * disabled by the application.
2622 */
2623 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
2624
Svetoslav683914b2015-01-15 14:22:26 -08002625 /** @hide */
2626 public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = sBooleanValidator;
2627
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002628 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002629 * Default screen rotation when no other policy applies.
2630 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
2631 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08002632 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002633 *
Dianne Hackborn16ec0802014-08-15 18:32:33 -07002634 * @see android.view.Display#getRotation
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002635 */
2636 public static final String USER_ROTATION = "user_rotation";
2637
Svetoslav683914b2015-01-15 14:22:26 -08002638 /** @hide */
2639 public static final Validator USER_ROTATION_VALIDATOR =
2640 new InclusiveIntegerRangeValidator(0, 3);
2641
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002642 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07002643 * Control whether the rotation lock toggle in the System UI should be hidden.
2644 * Typically this is done for accessibility purposes to make it harder for
2645 * the user to accidentally toggle the rotation lock while the display rotation
2646 * has been locked for accessibility.
2647 *
2648 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
2649 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
2650 *
2651 * @hide
2652 */
2653 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
2654 "hide_rotation_lock_toggle_for_accessibility";
2655
Svetoslav683914b2015-01-15 14:22:26 -08002656 /** @hide */
2657 public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR =
2658 sBooleanValidator;
2659
Jeff Brown207673cd2012-06-05 17:47:11 -07002660 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002661 * Whether the phone vibrates when it is ringing due to an incoming call. This will
2662 * be used by Phone and Setting apps; it shouldn't affect other apps.
2663 * The value is boolean (1 or 0).
2664 *
2665 * Note: this is not same as "vibrate on ring", which had been available until ICS.
2666 * It was about AudioManager's setting and thus affected all the applications which
2667 * relied on the setting, while this is purely about the vibration setting for incoming
2668 * calls.
2669 *
2670 * @hide
2671 */
2672 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
2673
Svetoslav683914b2015-01-15 14:22:26 -08002674 /** @hide */
2675 public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = sBooleanValidator;
2676
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002677 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002678 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
2679 * boolean (1 or 0).
2680 */
2681 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
2682
Svetoslav683914b2015-01-15 14:22:26 -08002683 /** @hide */
2684 public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
2685
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002686 /**
David Kraused0f67152009-06-13 18:01:13 -05002687 * CDMA only settings
2688 * DTMF tone type played by the dialer when dialing.
2689 * 0 = Normal
2690 * 1 = Long
2691 * @hide
2692 */
2693 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
2694
Svetoslav683914b2015-01-15 14:22:26 -08002695 /** @hide */
2696 public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = sBooleanValidator;
2697
David Kraused0f67152009-06-13 18:01:13 -05002698 /**
David Kraused0f67152009-06-13 18:01:13 -05002699 * Whether the hearing aid is enabled. The value is
2700 * boolean (1 or 0).
2701 * @hide
2702 */
2703 public static final String HEARING_AID = "hearing_aid";
2704
Svetoslav683914b2015-01-15 14:22:26 -08002705 /** @hide */
2706 public static final Validator HEARING_AID_VALIDATOR = sBooleanValidator;
2707
David Kraused0f67152009-06-13 18:01:13 -05002708 /**
2709 * CDMA only settings
2710 * TTY Mode
2711 * 0 = OFF
2712 * 1 = FULL
2713 * 2 = VCO
2714 * 3 = HCO
2715 * @hide
2716 */
2717 public static final String TTY_MODE = "tty_mode";
2718
Svetoslav683914b2015-01-15 14:22:26 -08002719 /** @hide */
2720 public static final Validator TTY_MODE_VALIDATOR = new InclusiveIntegerRangeValidator(0, 3);
2721
David Kraused0f67152009-06-13 18:01:13 -05002722 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002723 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
2724 * boolean (1 or 0).
2725 */
2726 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002727
Svetoslav683914b2015-01-15 14:22:26 -08002728 /** @hide */
2729 public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = sBooleanValidator;
2730
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002731 /**
2732 * Whether the haptic feedback (long presses, ...) are enabled. The value is
2733 * boolean (1 or 0).
2734 */
2735 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07002736
Svetoslav683914b2015-01-15 14:22:26 -08002737 /** @hide */
2738 public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = sBooleanValidator;
2739
Mike LeBeau48603e72009-06-05 00:27:00 +01002740 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01002741 * @deprecated Each application that shows web suggestions should have its own
2742 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01002743 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01002744 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01002745 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002746
Svetoslav683914b2015-01-15 14:22:26 -08002747 /** @hide */
2748 public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = sBooleanValidator;
2749
-b master501eec92009-07-06 13:53:11 -07002750 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002751 * Whether the notification LED should repeatedly flash when a notification is
2752 * pending. The value is boolean (1 or 0).
2753 * @hide
2754 */
2755 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
2756
Svetoslav683914b2015-01-15 14:22:26 -08002757 /** @hide */
2758 public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = sBooleanValidator;
2759
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002760 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002761 * Show pointer location on screen?
2762 * 0 = no
2763 * 1 = yes
2764 * @hide
2765 */
2766 public static final String POINTER_LOCATION = "pointer_location";
2767
Svetoslav683914b2015-01-15 14:22:26 -08002768 /** @hide */
2769 public static final Validator POINTER_LOCATION_VALIDATOR = sBooleanValidator;
2770
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002771 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07002772 * Show touch positions on screen?
2773 * 0 = no
2774 * 1 = yes
2775 * @hide
2776 */
2777 public static final String SHOW_TOUCHES = "show_touches";
2778
Svetoslav683914b2015-01-15 14:22:26 -08002779 /** @hide */
2780 public static final Validator SHOW_TOUCHES_VALIDATOR = sBooleanValidator;
2781
Jeff Browndaf4a122011-08-26 17:14:14 -07002782 /**
Dianne Hackborn16ec0802014-08-15 18:32:33 -07002783 * Log raw orientation data from
Jorim Jaggib10e33f2015-02-04 21:57:40 +01002784 * {@link com.android.server.policy.WindowOrientationListener} for use with the
Jeff Brown4519f072011-01-23 13:16:01 -08002785 * orientationplot.py tool.
2786 * 0 = no
2787 * 1 = yes
2788 * @hide
2789 */
2790 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
2791 "window_orientation_listener_log";
2792
Svetoslav683914b2015-01-15 14:22:26 -08002793 /** @hide */
2794 public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = sBooleanValidator;
2795
Jeff Brown4519f072011-01-23 13:16:01 -08002796 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002797 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
2798 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002799 * @hide
2800 */
Christopher Tate06efb532012-08-24 15:29:27 -07002801 @Deprecated
2802 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002803
2804 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002805 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
2806 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002807 * @hide
2808 */
Christopher Tate06efb532012-08-24 15:29:27 -07002809 @Deprecated
2810 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002811
2812 /**
2813 * Whether to play sounds when the keyguard is shown and dismissed.
2814 * @hide
2815 */
2816 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
2817
Svetoslav683914b2015-01-15 14:22:26 -08002818 /** @hide */
2819 public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = sBooleanValidator;
2820
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002821 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04002822 * Whether the lockscreen should be completely disabled.
2823 * @hide
2824 */
2825 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
2826
Svetoslav683914b2015-01-15 14:22:26 -08002827 /** @hide */
2828 public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = sBooleanValidator;
2829
Mike Lockwood7bef7392011-10-20 16:51:53 -04002830 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002831 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
2832 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002833 * @hide
2834 */
Christopher Tate06efb532012-08-24 15:29:27 -07002835 @Deprecated
2836 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002837
2838 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002839 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
2840 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002841 * @hide
2842 */
Christopher Tate06efb532012-08-24 15:29:27 -07002843 @Deprecated
2844 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002845
2846 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002847 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
2848 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002849 * @hide
2850 */
Christopher Tate06efb532012-08-24 15:29:27 -07002851 @Deprecated
2852 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002853
2854 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002855 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
2856 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002857 * @hide
2858 */
Christopher Tate06efb532012-08-24 15:29:27 -07002859 @Deprecated
2860 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002861
2862 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002863 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
2864 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002865 * @hide
2866 */
Christopher Tate06efb532012-08-24 15:29:27 -07002867 @Deprecated
2868 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002869
2870 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002871 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
2872 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002873 * @hide
2874 */
Christopher Tate06efb532012-08-24 15:29:27 -07002875 @Deprecated
2876 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002877
2878 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002879 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
2880 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002881 * @hide
2882 */
Christopher Tate06efb532012-08-24 15:29:27 -07002883 @Deprecated
2884 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002885
2886 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002887 * Receive incoming SIP calls?
2888 * 0 = no
2889 * 1 = yes
2890 * @hide
2891 */
2892 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
2893
Svetoslav683914b2015-01-15 14:22:26 -08002894 /** @hide */
2895 public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = sBooleanValidator;
2896
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002897 /**
2898 * Call Preference String.
2899 * "SIP_ALWAYS" : Always use SIP with network access
2900 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002901 * @hide
2902 */
2903 public static final String SIP_CALL_OPTIONS = "sip_call_options";
2904
Svetoslav683914b2015-01-15 14:22:26 -08002905 /** @hide */
2906 public static final Validator SIP_CALL_OPTIONS_VALIDATOR = new DiscreteValueValidator(
2907 new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"});
2908
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002909 /**
2910 * One of the sip call options: Always use SIP with network access.
2911 * @hide
2912 */
2913 public static final String SIP_ALWAYS = "SIP_ALWAYS";
2914
Svetoslav683914b2015-01-15 14:22:26 -08002915 /** @hide */
2916 public static final Validator SIP_ALWAYS_VALIDATOR = sBooleanValidator;
2917
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002918 /**
2919 * One of the sip call options: Only if destination is a SIP address.
2920 * @hide
2921 */
2922 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
2923
Svetoslav683914b2015-01-15 14:22:26 -08002924 /** @hide */
2925 public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = sBooleanValidator;
2926
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002927 /**
Tyler Gunn2c830a22014-09-02 08:39:35 -07002928 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that
2929 * the user should be prompted each time a call is made whether it should be placed using
2930 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with
2931 * SIP_ADDRESS_ONLY.
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002932 * @hide
2933 */
Tyler Gunn2c830a22014-09-02 08:39:35 -07002934 @Deprecated
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002935 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
2936
Svetoslav683914b2015-01-15 14:22:26 -08002937 /** @hide */
2938 public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = sBooleanValidator;
2939
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002940 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07002941 * Pointer speed setting.
2942 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
2943 * -7 = slowest
2944 * 0 = default speed
2945 * +7 = fastest
2946 * @hide
2947 */
2948 public static final String POINTER_SPEED = "pointer_speed";
2949
Svetoslav683914b2015-01-15 14:22:26 -08002950 /** @hide */
2951 public static final Validator POINTER_SPEED_VALIDATOR =
2952 new InclusiveFloatRangeValidator(-7, 7);
2953
Jeff Brown1a84fd12011-06-02 01:26:32 -07002954 /**
Jason Monk56e09b42014-07-18 10:29:14 -04002955 * Whether lock-to-app will be triggered by long-press on recents.
2956 * @hide
2957 */
2958 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled";
2959
Svetoslav683914b2015-01-15 14:22:26 -08002960 /** @hide */
2961 public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = sBooleanValidator;
2962
Jason Monk56e09b42014-07-18 10:29:14 -04002963 /**
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04002964 * I am the lolrus.
2965 * <p>
2966 * Nonzero values indicate that the user has a bukkit.
2967 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>.
2968 * @hide
2969 */
2970 public static final String EGG_MODE = "egg_mode";
2971
Svetoslav683914b2015-01-15 14:22:26 -08002972 /** @hide */
2973 public static final Validator EGG_MODE_VALIDATOR = sBooleanValidator;
2974
2975 /**
2976 * IMPORTANT: If you add a new public settings you also have to add it to
2977 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add
2978 * it to PRIVATE_SETTINGS below. Also add a validator that can validate
2979 * the setting value. See an example above.
2980 */
2981
Daniel Sandler2fdb68b2013-10-03 00:12:11 -04002982 /**
-b master501eec92009-07-06 13:53:11 -07002983 * Settings to backup. This is here so that it's in the same place as the settings
2984 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07002985 *
2986 * NOTE: Settings are backed up and restored in the order they appear
2987 * in this array. If you have one setting depending on another,
2988 * make sure that they are ordered appropriately.
2989 *
-b master501eec92009-07-06 13:53:11 -07002990 * @hide
2991 */
2992 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07002993 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07002994 WIFI_USE_STATIC_IP,
2995 WIFI_STATIC_IP,
2996 WIFI_STATIC_GATEWAY,
2997 WIFI_STATIC_NETMASK,
2998 WIFI_STATIC_DNS1,
2999 WIFI_STATIC_DNS2,
3000 BLUETOOTH_DISCOVERABILITY,
3001 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3002 DIM_SCREEN,
3003 SCREEN_OFF_TIMEOUT,
3004 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07003005 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08003006 SCREEN_AUTO_BRIGHTNESS_ADJ,
Jeff Brown7f6c2312012-04-13 20:38:38 -07003007 VIBRATE_INPUT_DEVICES,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07003008 MODE_RINGER_STREAMS_AFFECTED,
-b master501eec92009-07-06 13:53:11 -07003009 TEXT_AUTO_REPLACE,
3010 TEXT_AUTO_CAPS,
3011 TEXT_AUTO_PUNCTUATE,
3012 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07003013 AUTO_TIME, // moved to global
3014 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07003015 TIME_12_24,
3016 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07003017 DTMF_TONE_WHEN_DIALING,
3018 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07003019 HEARING_AID,
3020 TTY_MODE,
3021 SOUND_EFFECTS_ENABLED,
3022 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07003023 POWER_SOUNDS_ENABLED, // moved to global
3024 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08003025 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08003026 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04003027 NOTIFICATION_LIGHT_PULSE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08003028 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07003029 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07003030 POINTER_SPEED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003031 VIBRATE_WHEN_RINGING,
3032 RINGTONE,
Jason Monk94cfd9d2014-10-31 13:18:21 -04003033 LOCK_TO_APP_ENABLED,
Amith Yamasani622bf2222013-09-06 13:54:28 -07003034 NOTIFICATION_SOUND
-b master501eec92009-07-06 13:53:11 -07003035 };
3036
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003037 /**
Svetoslav683914b2015-01-15 14:22:26 -08003038 * These are all pulbic system settings
3039 *
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003040 * @hide
3041 */
Svetoslav683914b2015-01-15 14:22:26 -08003042 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>();
3043 static {
3044 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR);
3045 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP);
3046 PUBLIC_SETTINGS.add(WIFI_STATIC_IP);
3047 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY);
3048 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK);
3049 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1);
3050 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2);
3051 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY);
3052 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT);
3053 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED);
3054 PUBLIC_SETTINGS.add(FONT_SCALE);
3055 PUBLIC_SETTINGS.add(DIM_SCREEN);
3056 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT);
3057 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
3058 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
3059 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
3060 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
3061 PUBLIC_SETTINGS.add(VIBRATE_ON);
3062 PUBLIC_SETTINGS.add(VOLUME_RING);
3063 PUBLIC_SETTINGS.add(VOLUME_SYSTEM);
3064 PUBLIC_SETTINGS.add(VOLUME_VOICE);
3065 PUBLIC_SETTINGS.add(VOLUME_MUSIC);
3066 PUBLIC_SETTINGS.add(VOLUME_ALARM);
3067 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION);
3068 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO);
3069 PUBLIC_SETTINGS.add(RINGTONE);
3070 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND);
3071 PUBLIC_SETTINGS.add(ALARM_ALERT);
3072 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE);
3073 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS);
3074 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE);
3075 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD);
3076 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS);
3077 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY);
3078 PUBLIC_SETTINGS.add(TIME_12_24);
3079 PUBLIC_SETTINGS.add(DATE_FORMAT);
3080 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN);
3081 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION);
3082 PUBLIC_SETTINGS.add(USER_ROTATION);
3083 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING);
3084 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED);
3085 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED);
3086 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS);
3087 }
3088
3089 /**
3090 * These are all hidden system settings.
3091 *
3092 * @hide
3093 */
3094 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>();
3095 static {
3096 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
3097 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
3098 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
3099 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
3100 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
3101 PRIVATE_SETTINGS.add(VOLUME_MASTER);
3102 PRIVATE_SETTINGS.add(VOLUME_MASTER_MUTE);
3103 PRIVATE_SETTINGS.add(MICROPHONE_MUTE);
3104 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME);
3105 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT);
3106 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER);
3107 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY);
3108 PRIVATE_SETTINGS.add(VIBRATE_WHEN_RINGING);
3109 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING);
3110 PRIVATE_SETTINGS.add(HEARING_AID);
3111 PRIVATE_SETTINGS.add(TTY_MODE);
3112 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE);
3113 PRIVATE_SETTINGS.add(POINTER_LOCATION);
3114 PRIVATE_SETTINGS.add(SHOW_TOUCHES);
3115 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG);
3116 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED);
3117 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED);
3118 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED);
3119 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED);
3120 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND);
3121 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND);
3122 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND);
3123 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND);
3124 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND);
3125 PRIVATE_SETTINGS.add(LOCK_SOUND);
3126 PRIVATE_SETTINGS.add(UNLOCK_SOUND);
3127 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS);
3128 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS);
3129 PRIVATE_SETTINGS.add(SIP_ALWAYS);
3130 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY);
3131 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME);
3132 PRIVATE_SETTINGS.add(POINTER_SPEED);
3133 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED);
3134 PRIVATE_SETTINGS.add(EGG_MODE);
3135 }
3136
3137 /**
3138 * These are all pulbic system settings
3139 *
3140 * @hide
3141 */
3142 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
3143 static {
3144 VALIDATORS.put(END_BUTTON_BEHAVIOR,END_BUTTON_BEHAVIOR_VALIDATOR);
3145 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3146 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR);
3147 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT,
3148 BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR);
3149 VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR);
3150 VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR);
3151 VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
3152 VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
3153 VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR);
3154 VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
3155 VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
3156 VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
3157 VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003158 VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR);
3159 VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR);
3160 VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR);
3161 VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR);
3162 VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR);
3163 VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR);
3164 VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR);
3165 VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR);
3166 VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR);
3167 VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR);
3168 VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR);
3169 VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR);
3170 VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR);
3171 VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR);
3172 VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR);
3173 VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR);
3174 VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR);
3175 VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR);
3176 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR);
3177 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR);
3178 VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR);
3179 VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR);
3180 VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR);
Svetoslav683914b2015-01-15 14:22:26 -08003181 VALIDATORS.put(VOLUME_MASTER_MUTE, VOLUME_MASTER_MUTE_VALIDATOR);
3182 VALIDATORS.put(MICROPHONE_MUTE, MICROPHONE_MUTE_VALIDATOR);
3183 VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR);
3184 VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR);
3185 VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR);
3186 VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY,
3187 HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR);
3188 VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR);
3189 VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR);
3190 VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR);
3191 VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR);
3192 VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR);
3193 VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR);
3194 VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR);
3195 VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG,
3196 WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR);
3197 VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR);
3198 VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR);
3199 VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR);
3200 VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR);
3201 VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR);
3202 VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR);
3203 VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR);
3204 VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR);
3205 VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR);
3206 VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR);
3207 VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR);
3208 VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR);
3209 VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR);
3210 VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
3211 VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
3212 }
3213
3214 /**
3215 * These entries are considered common between the personal and the managed profile,
3216 * since the managed profile doesn't get to change them.
3217 */
3218 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
3219 static {
3220 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT);
3221 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED);
3222 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED);
3223 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD);
3224 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24);
3225 }
3226
3227 /** @hide */
3228 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
3229 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
3230 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07003231
3232 /**
Sailesh Nepal1bd78762014-02-11 22:32:21 -08003233 * When to use Wi-Fi calling
3234 *
3235 * @see android.telephony.TelephonyManager.WifiCallingChoices
3236 * @hide
3237 */
3238 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls";
3239
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003240 // Settings moved to Settings.Secure
3241
3242 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003243 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003244 * instead
3245 */
3246 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003247 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003248
3249 /**
3250 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
3251 */
3252 @Deprecated
3253 public static final String ANDROID_ID = Secure.ANDROID_ID;
3254
3255 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003256 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003257 */
3258 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003259 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003260
3261 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003262 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003263 */
3264 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003265 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003266
3267 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003268 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003269 */
3270 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003271 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003272
3273 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003274 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003275 */
3276 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07003277 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003278
3279 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07003280 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003281 */
3282 @Deprecated
Christopher Tateaa036a22014-05-19 16:33:27 -07003283 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003284
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003285 /**
3286 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
3287 * instead
3288 */
3289 @Deprecated
3290 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
3291
3292 /**
3293 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
3294 */
3295 @Deprecated
3296 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003297
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003298 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003299 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003300 */
3301 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003302 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003303
3304 /**
3305 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
3306 * instead
3307 */
3308 @Deprecated
3309 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
3310
3311 /**
3312 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
3313 * instead
3314 */
3315 @Deprecated
3316 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
3317
3318 /**
3319 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
3320 * instead
3321 */
3322 @Deprecated
3323 public static final String PARENTAL_CONTROL_REDIRECT_URL =
3324 Secure.PARENTAL_CONTROL_REDIRECT_URL;
3325
3326 /**
3327 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
3328 */
3329 @Deprecated
3330 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
3331
3332 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003333 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003334 */
3335 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003336 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003337
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003338 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003339 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003340 */
3341 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003342 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003343
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003344 /**
3345 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003346 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003347 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003348 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003349 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003350
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003351 /**
3352 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003353 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07003354 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003355 @Deprecated
3356 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07003357 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003358
3359 /**
3360 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003361 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003362 */
3363 @Deprecated
3364 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07003365 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003366
3367 /**
3368 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07003369 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003370 */
3371 @Deprecated
3372 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07003373 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003374
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003375 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003376 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003377 * instead
3378 */
3379 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003380 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003381
3382 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003383 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003384 */
3385 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003386 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003387
3388 /**
3389 * @deprecated Use
3390 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
3391 * instead
3392 */
3393 @Deprecated
3394 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
3395 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
3396
3397 /**
3398 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
3399 */
3400 @Deprecated
3401 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
3402
3403 /**
3404 * @deprecated Use
3405 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
3406 */
3407 @Deprecated
3408 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
3409 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003410
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003411 /**
3412 * @deprecated Use
3413 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
3414 */
3415 @Deprecated
3416 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
3417 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
3418
3419 /**
3420 * @deprecated Use
3421 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
3422 * instead
3423 */
3424 @Deprecated
3425 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
3426 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
3427
3428 /**
3429 * @deprecated Use
3430 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
3431 */
3432 @Deprecated
3433 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
3434 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
3435
3436 /**
3437 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
3438 * instead
3439 */
3440 @Deprecated
3441 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
3442
3443 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003444 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003445 */
3446 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003447 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003448
3449 /**
3450 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
3451 */
3452 @Deprecated
3453 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
3454
3455 /**
3456 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
3457 * instead
3458 */
3459 @Deprecated
3460 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
3461
3462 /**
3463 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
3464 * instead
3465 */
3466 @Deprecated
3467 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
3468 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
3469 }
3470
3471 /**
3472 * Secure system settings, containing system preferences that applications
3473 * can read but are not allowed to write. These are for preferences that
3474 * the user must explicitly modify through the system UI or specialized
3475 * APIs for those values, not modified directly by applications.
3476 */
3477 public static final class Secure extends NameValueTable {
3478 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
3479
Dianne Hackborn139748f2012-09-24 11:36:57 -07003480 /**
3481 * The content:// style URL for this table
3482 */
3483 public static final Uri CONTENT_URI =
3484 Uri.parse("content://" + AUTHORITY + "/secure");
3485
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08003486 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07003487 private static final NameValueCache sNameValueCache = new NameValueCache(
3488 SYS_PROP_SETTING_VERSION,
3489 CONTENT_URI,
3490 CALL_METHOD_GET_SECURE,
3491 CALL_METHOD_PUT_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003492
Amith Yamasani52c489c2012-03-28 11:42:42 -07003493 private static ILockSettings sLockSettings = null;
3494
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07003495 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003496 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07003497 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07003498 static {
3499 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
3500 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
3501 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
3502 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07003503
3504 MOVED_TO_GLOBAL = new HashSet<String>();
3505 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
3506 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
3507 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate58f41ec2013-01-11 15:40:36 -08003508 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
Christopher Tate06efb532012-08-24 15:29:27 -07003509 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
3510 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
3511 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
3512 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
3513 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
3514 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
3515 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
3516 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
3517 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_DENSITY_FORCED);
3518 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
3519 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
3520 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
Christopher Tate06efb532012-08-24 15:29:27 -07003521 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
3522 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
3523 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
3524 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
3525 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
3526 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
3527 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
3528 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
Christopher Tate06efb532012-08-24 15:29:27 -07003529 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
3530 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
3531 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
3532 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
3533 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
3534 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
3535 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
3536 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
3537 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
3538 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
3539 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
3540 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
3541 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
3542 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
3543 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
3544 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
3545 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
3546 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
3547 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
3548 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
3549 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
3550 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
3551 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
3552 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
3553 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
3554 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
3555 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07003556 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
3557 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00003558 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
Christopher Tate06efb532012-08-24 15:29:27 -07003559 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
3560 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
3561 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
3562 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
3563 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
3564 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
3565 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
3566 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
3567 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
3568 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
3569 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
3570 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
3571 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
vandwalle7c3606c2014-03-31 19:12:07 -07003572 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN);
3573 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI);
Christopher Tate06efb532012-08-24 15:29:27 -07003574 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
3575 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07003576 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07003577 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
3578 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
3579 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
3580 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
3581 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
3582 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07003583 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07003584 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
3585 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
3586 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
3587 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
3588 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
3589 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
3590 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
3591 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
3592 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
3593 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
3594 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
3595 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
3596 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
3597 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
3598 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
3599 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
3600 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
3601 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
3602 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
3603 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
3604 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
3605 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
3606 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
3607 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
3608 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
3609 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
3610 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
3611 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
3612 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
3613 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
3614 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07003615 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
Hui Shu22671772014-10-01 21:41:07 +00003616 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY);
Christopher Tate06efb532012-08-24 15:29:27 -07003617 }
3618
Christopher Tate66488d62012-10-02 11:58:01 -07003619 /** @hide */
Svetoslav683914b2015-01-15 14:22:26 -08003620 public static void getMovedToGlobalSettings(Set<String> outKeySet) {
Christopher Tate66488d62012-10-02 11:58:01 -07003621 outKeySet.addAll(MOVED_TO_GLOBAL);
3622 }
3623
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003624 /**
3625 * Look up a name in the database.
3626 * @param resolver to access the database with
3627 * @param name to look up in the table
3628 * @return the corresponding value, or null if not present
3629 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07003630 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07003631 return getStringForUser(resolver, name, UserHandle.myUserId());
3632 }
3633
3634 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07003635 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07003636 int userHandle) {
3637 if (MOVED_TO_GLOBAL.contains(name)) {
3638 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
3639 + " to android.provider.Settings.Global.");
3640 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003641 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07003642
Dianne Hackborn139748f2012-09-24 11:36:57 -07003643 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
3644 synchronized (Secure.class) {
3645 if (sLockSettings == null) {
3646 sLockSettings = ILockSettings.Stub.asInterface(
3647 (IBinder) ServiceManager.getService("lock_settings"));
3648 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
3649 }
3650 }
3651 if (sLockSettings != null && !sIsSystemProcess) {
3652 try {
3653 return sLockSettings.getString(name, "0", userHandle);
3654 } catch (RemoteException re) {
3655 // Fall through
3656 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07003657 }
3658 }
3659
Christopher Tate06efb532012-08-24 15:29:27 -07003660 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003661 }
3662
3663 /**
3664 * Store a name/value pair into the database.
3665 * @param resolver to access the database with
3666 * @param name to store
3667 * @param value to associate with the name
3668 * @return true if the value was set, false on database errors
3669 */
Christopher Tate06efb532012-08-24 15:29:27 -07003670 public static boolean putString(ContentResolver resolver, String name, String value) {
3671 return putStringForUser(resolver, name, value, UserHandle.myUserId());
3672 }
3673
3674 /** @hide */
3675 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
3676 int userHandle) {
Julia Reynolds82735bc2014-09-04 16:43:30 -04003677 if (LOCATION_MODE.equals(name)) {
3678 // HACK ALERT: temporary hack to work around b/10491283.
3679 // TODO: once b/10491283 fixed, remove this hack
3680 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle);
3681 }
Christopher Tate06efb532012-08-24 15:29:27 -07003682 if (MOVED_TO_GLOBAL.contains(name)) {
3683 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
3684 + " to android.provider.Settings.Global");
3685 return Global.putStringForUser(resolver, name, value, userHandle);
3686 }
Christopher Tate06efb532012-08-24 15:29:27 -07003687 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003688 }
3689
3690 /**
3691 * Construct the content URI for a particular name/value pair,
3692 * useful for monitoring changes with a ContentObserver.
3693 * @param name to look up in the table
3694 * @return the corresponding content URI, or null if not present
3695 */
3696 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07003697 if (MOVED_TO_GLOBAL.contains(name)) {
3698 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
3699 + " to android.provider.Settings.Global, returning global URI.");
3700 return Global.getUriFor(Global.CONTENT_URI, name);
3701 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003702 return getUriFor(CONTENT_URI, name);
3703 }
3704
3705 /**
3706 * Convenience function for retrieving a single secure settings value
3707 * as an integer. Note that internally setting values are always
3708 * stored as strings; this function converts the string to an integer
3709 * for you. The default value will be returned if the setting is
3710 * not defined or not an integer.
3711 *
3712 * @param cr The ContentResolver to access.
3713 * @param name The name of the setting to retrieve.
3714 * @param def Value to return if the setting is not defined.
3715 *
3716 * @return The setting's current value, or 'def' if it is not defined
3717 * or not a valid integer.
3718 */
3719 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003720 return getIntForUser(cr, name, def, UserHandle.myUserId());
3721 }
3722
3723 /** @hide */
3724 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003725 if (LOCATION_MODE.equals(name)) {
3726 // HACK ALERT: temporary hack to work around b/10491283.
3727 // TODO: once b/10491283 fixed, remove this hack
3728 return getLocationModeForUser(cr, userHandle);
3729 }
Christopher Tate06efb532012-08-24 15:29:27 -07003730 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003731 try {
3732 return v != null ? Integer.parseInt(v) : def;
3733 } catch (NumberFormatException e) {
3734 return def;
3735 }
3736 }
3737
3738 /**
3739 * Convenience function for retrieving a single secure settings value
3740 * as an integer. Note that internally setting values are always
3741 * stored as strings; this function converts the string to an integer
3742 * for you.
3743 * <p>
3744 * This version does not take a default value. If the setting has not
3745 * been set, or the string value is not a number,
3746 * it throws {@link SettingNotFoundException}.
3747 *
3748 * @param cr The ContentResolver to access.
3749 * @param name The name of the setting to retrieve.
3750 *
3751 * @throws SettingNotFoundException Thrown if a setting by the given
3752 * name can't be found or the setting value is not an integer.
3753 *
3754 * @return The setting's current value.
3755 */
3756 public static int getInt(ContentResolver cr, String name)
3757 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003758 return getIntForUser(cr, name, UserHandle.myUserId());
3759 }
3760
3761 /** @hide */
3762 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
3763 throws SettingNotFoundException {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003764 if (LOCATION_MODE.equals(name)) {
3765 // HACK ALERT: temporary hack to work around b/10491283.
3766 // TODO: once b/10491283 fixed, remove this hack
3767 return getLocationModeForUser(cr, userHandle);
3768 }
Christopher Tate06efb532012-08-24 15:29:27 -07003769 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003770 try {
3771 return Integer.parseInt(v);
3772 } catch (NumberFormatException e) {
3773 throw new SettingNotFoundException(name);
3774 }
3775 }
3776
3777 /**
3778 * Convenience function for updating a single settings value as an
3779 * integer. This will either create a new entry in the table if the
3780 * given name does not exist, or modify the value of the existing row
3781 * with that name. Note that internally setting values are always
3782 * stored as strings, so this function converts the given value to a
3783 * string before storing it.
3784 *
3785 * @param cr The ContentResolver to access.
3786 * @param name The name of the setting to modify.
3787 * @param value The new value for the setting.
3788 * @return true if the value was set, false on database errors
3789 */
3790 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003791 return putIntForUser(cr, name, value, UserHandle.myUserId());
3792 }
3793
3794 /** @hide */
3795 public static boolean putIntForUser(ContentResolver cr, String name, int value,
3796 int userHandle) {
3797 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003798 }
3799
3800 /**
3801 * Convenience function for retrieving a single secure settings value
3802 * as a {@code long}. Note that internally setting values are always
3803 * stored as strings; this function converts the string to a {@code long}
3804 * for you. The default value will be returned if the setting is
3805 * not defined or not a {@code long}.
3806 *
3807 * @param cr The ContentResolver to access.
3808 * @param name The name of the setting to retrieve.
3809 * @param def Value to return if the setting is not defined.
3810 *
3811 * @return The setting's current value, or 'def' if it is not defined
3812 * or not a valid {@code long}.
3813 */
3814 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003815 return getLongForUser(cr, name, def, UserHandle.myUserId());
3816 }
3817
3818 /** @hide */
3819 public static long getLongForUser(ContentResolver cr, String name, long def,
3820 int userHandle) {
3821 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003822 long value;
3823 try {
3824 value = valString != null ? Long.parseLong(valString) : def;
3825 } catch (NumberFormatException e) {
3826 value = def;
3827 }
3828 return value;
3829 }
3830
3831 /**
3832 * Convenience function for retrieving a single secure settings value
3833 * as a {@code long}. Note that internally setting values are always
3834 * stored as strings; this function converts the string to a {@code long}
3835 * for you.
3836 * <p>
3837 * This version does not take a default value. If the setting has not
3838 * been set, or the string value is not a number,
3839 * it throws {@link SettingNotFoundException}.
3840 *
3841 * @param cr The ContentResolver to access.
3842 * @param name The name of the setting to retrieve.
3843 *
3844 * @return The setting's current value.
3845 * @throws SettingNotFoundException Thrown if a setting by the given
3846 * name can't be found or the setting value is not an integer.
3847 */
3848 public static long getLong(ContentResolver cr, String name)
3849 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003850 return getLongForUser(cr, name, UserHandle.myUserId());
3851 }
3852
3853 /** @hide */
3854 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
3855 throws SettingNotFoundException {
3856 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003857 try {
3858 return Long.parseLong(valString);
3859 } catch (NumberFormatException e) {
3860 throw new SettingNotFoundException(name);
3861 }
3862 }
3863
3864 /**
3865 * Convenience function for updating a secure settings value as a long
3866 * integer. This will either create a new entry in the table if the
3867 * given name does not exist, or modify the value of the existing row
3868 * with that name. Note that internally setting values are always
3869 * stored as strings, so this function converts the given value to a
3870 * string before storing it.
3871 *
3872 * @param cr The ContentResolver to access.
3873 * @param name The name of the setting to modify.
3874 * @param value The new value for the setting.
3875 * @return true if the value was set, false on database errors
3876 */
3877 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003878 return putLongForUser(cr, name, value, UserHandle.myUserId());
3879 }
3880
3881 /** @hide */
3882 public static boolean putLongForUser(ContentResolver cr, String name, long value,
3883 int userHandle) {
3884 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003885 }
3886
3887 /**
3888 * Convenience function for retrieving a single secure settings value
3889 * as a floating point number. Note that internally setting values are
3890 * always stored as strings; this function converts the string to an
3891 * float for you. The default value will be returned if the setting
3892 * is not defined or not a valid float.
3893 *
3894 * @param cr The ContentResolver to access.
3895 * @param name The name of the setting to retrieve.
3896 * @param def Value to return if the setting is not defined.
3897 *
3898 * @return The setting's current value, or 'def' if it is not defined
3899 * or not a valid float.
3900 */
3901 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003902 return getFloatForUser(cr, name, def, UserHandle.myUserId());
3903 }
3904
3905 /** @hide */
3906 public static float getFloatForUser(ContentResolver cr, String name, float def,
3907 int userHandle) {
3908 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003909 try {
3910 return v != null ? Float.parseFloat(v) : def;
3911 } catch (NumberFormatException e) {
3912 return def;
3913 }
3914 }
3915
3916 /**
3917 * Convenience function for retrieving a single secure settings value
3918 * as a float. Note that internally setting values are always
3919 * stored as strings; this function converts the string to a float
3920 * for you.
3921 * <p>
3922 * This version does not take a default value. If the setting has not
3923 * been set, or the string value is not a number,
3924 * it throws {@link SettingNotFoundException}.
3925 *
3926 * @param cr The ContentResolver to access.
3927 * @param name The name of the setting to retrieve.
3928 *
3929 * @throws SettingNotFoundException Thrown if a setting by the given
3930 * name can't be found or the setting value is not a float.
3931 *
3932 * @return The setting's current value.
3933 */
3934 public static float getFloat(ContentResolver cr, String name)
3935 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003936 return getFloatForUser(cr, name, UserHandle.myUserId());
3937 }
3938
3939 /** @hide */
3940 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
3941 throws SettingNotFoundException {
3942 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08003943 if (v == null) {
3944 throw new SettingNotFoundException(name);
3945 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003946 try {
3947 return Float.parseFloat(v);
3948 } catch (NumberFormatException e) {
3949 throw new SettingNotFoundException(name);
3950 }
3951 }
3952
3953 /**
3954 * Convenience function for updating a single settings value as a
3955 * floating point number. This will either create a new entry in the
3956 * table if the given name does not exist, or modify the value of the
3957 * existing row with that name. Note that internally setting values
3958 * are always stored as strings, so this function converts the given
3959 * value to a string before storing it.
3960 *
3961 * @param cr The ContentResolver to access.
3962 * @param name The name of the setting to modify.
3963 * @param value The new value for the setting.
3964 * @return true if the value was set, false on database errors
3965 */
3966 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003967 return putFloatForUser(cr, name, value, UserHandle.myUserId());
3968 }
3969
3970 /** @hide */
3971 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
3972 int userHandle) {
3973 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003974 }
3975
3976 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003977 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
3978 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08003979 */
Christopher Tate06efb532012-08-24 15:29:27 -07003980 @Deprecated
3981 public static final String DEVELOPMENT_SETTINGS_ENABLED =
3982 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08003983
3984 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003985 * When the user has enable the option to have a "bug report" command
3986 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08003987 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003988 * @hide
3989 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08003990 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003991 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
3992
3993 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003994 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003995 */
Christopher Tate06efb532012-08-24 15:29:27 -07003996 @Deprecated
3997 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003998
3999 /**
4000 * Setting to allow mock locations and location provider status to be injected into the
4001 * LocationManager service for testing purposes during application development. These
4002 * locations and status values override actual location and status information generated
4003 * by network, gps, or other location providers.
4004 */
4005 public static final String ALLOW_MOCK_LOCATION = "mock_location";
4006
4007 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08004008 * A 64-bit number (as a hex string) that is randomly
Scott Main44895332013-11-12 09:23:13 -08004009 * generated when the user first sets up the device and should remain
4010 * constant for the lifetime of the user's device. The value may
4011 * change if a factory reset is performed on the device.
4012 * <p class="note"><strong>Note:</strong> When a device has <a
4013 * href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">multiple users</a>
4014 * (available on certain devices running Android 4.2 or higher), each user appears as a
4015 * completely separate device, so the {@code ANDROID_ID} value is unique to each
4016 * user.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004017 */
4018 public static final String ANDROID_ID = "android_id";
4019
4020 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004021 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004022 */
Christopher Tate06efb532012-08-24 15:29:27 -07004023 @Deprecated
4024 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004025
4026 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004027 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004028 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004029 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07004030 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004031
4032 /**
4033 * Setting to record the input method used by default, holding the ID
4034 * of the desired method.
4035 */
4036 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
4037
4038 /**
satokab751aa2010-09-14 19:17:36 +09004039 * Setting to record the input method subtype used by default, holding the ID
4040 * of the desired method.
4041 */
4042 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
4043 "selected_input_method_subtype";
4044
4045 /**
satok723a27e2010-11-11 14:58:11 +09004046 * Setting to record the history of input method subtype, holding the pair of ID of IME
4047 * and its last used subtype.
4048 * @hide
4049 */
4050 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
4051 "input_methods_subtype_history";
4052
4053 /**
satok5c58dfc2010-12-14 21:54:47 +09004054 * Setting to record the visibility of input method selector
4055 */
4056 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
4057 "input_method_selector_visibility";
4058
4059 /**
Dianne Hackborn91097de2014-04-04 18:02:06 -07004060 * The currently selected voice interaction service flattened ComponentName.
4061 * @hide
4062 */
4063 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
4064
4065 /**
Zhihai Xuaf5971e2013-06-10 20:28:31 -07004066 * bluetooth HCI snoop log configuration
4067 * @hide
4068 */
4069 public static final String BLUETOOTH_HCI_LOG =
4070 "bluetooth_hci_log";
4071
4072 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004073 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004074 */
Christopher Tate06efb532012-08-24 15:29:27 -07004075 @Deprecated
4076 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004077
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004078 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07004079 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
4080 * @hide
4081 */
4082 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
4083
4084 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004085 * List of input methods that are currently enabled. This is a string
4086 * containing the IDs of all enabled input methods, each ID separated
4087 * by ':'.
4088 */
4089 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004090
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004091 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07004092 * List of system input methods that are currently disabled. This is a string
4093 * containing the IDs of all disabled input methods, each ID separated
4094 * by ':'.
4095 * @hide
4096 */
4097 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
4098
4099 /**
Michael Wright7b5a96b2014-08-09 19:28:42 -07004100 * Whether to show the IME when a hard keyboard is connected. This is a boolean that
4101 * determines if the IME should be shown when a hard keyboard is attached.
4102 * @hide
4103 */
4104 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
4105
4106 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004107 * Host name and port for global http proxy. Uses ':' seperator for
4108 * between host and port.
4109 *
4110 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004111 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07004112 @Deprecated
4113 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07004114
4115 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07004116 * Whether applications can be installed for this user via the system's
4117 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism.
4118 *
4119 * <p>1 = permit app installation via the system package installer intent
4120 * <p>0 = do not allow use of the package installer
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004121 */
Christopher Tateaa036a22014-05-19 16:33:27 -07004122 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004123
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004124 /**
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004125 * Comma-separated list of location providers that activities may access. Do not rely on
4126 * this value being present in settings.db or on ContentObserver notifications on the
4127 * corresponding Uri.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004128 *
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004129 * @deprecated use {@link #LOCATION_MODE} and
4130 * {@link LocationManager#MODE_CHANGED_ACTION} (or
4131 * {@link LocationManager#PROVIDERS_CHANGED_ACTION})
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004132 */
Tom O'Neilla324ac72013-08-26 14:40:23 -07004133 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004134 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004135
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004136 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004137 * The degree of location access enabled by the user.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004138 * <p>
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004139 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
4140 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
4141 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
4142 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
4143 * modes that might be added in the future.
Tom O'Neill923c0dc2014-03-03 11:07:55 -08004144 * <p>
4145 * Note: do not rely on this value being present in settings.db or on ContentObserver
4146 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION}
4147 * to receive changes in this value.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004148 */
4149 public static final String LOCATION_MODE = "location_mode";
4150
4151 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004152 * Location access disabled.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004153 */
4154 public static final int LOCATION_MODE_OFF = 0;
4155 /**
4156 * Network Location Provider disabled, but GPS and other sensors enabled.
4157 */
4158 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
4159 /**
Tom O'Neilld5759432013-09-11 11:03:03 -07004160 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests
4161 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to
4162 * {@link android.location.Criteria#POWER_MEDIUM}.
Tom O'Neill1f48b782013-08-19 18:14:56 -07004163 */
4164 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
4165 /**
4166 * Best-effort location computation allowed.
4167 */
4168 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
4169
4170 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04004171 * A flag containing settings used for biometric weak
4172 * @hide
4173 */
Adrian Roos230635e2015-01-07 20:50:29 +01004174 @Deprecated
Danielle Millett925a7d82012-03-19 18:02:20 -04004175 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
4176 "lock_biometric_weak_flags";
4177
4178 /**
Jason Monk94cfd9d2014-10-31 13:18:21 -04004179 * Whether lock-to-app will lock the keyguard when exiting.
4180 * @hide
4181 */
4182 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked";
4183
4184 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08004185 * Whether autolock is enabled (0 = false, 1 = true)
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004186 *
4187 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security
4188 * level of the keyguard.
Amith Yamasani156c4352010-03-05 17:10:03 -08004189 */
Adrian Roos9dd16eb2015-01-08 16:20:49 +01004190 @Deprecated
Amith Yamasani156c4352010-03-05 17:10:03 -08004191 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
4192
4193 /**
4194 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
4195 */
4196 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
4197
4198 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004199 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
4200 * true)
4201 *
4202 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
4203 * lockscreen uses
4204 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Amith Yamasani156c4352010-03-05 17:10:03 -08004205 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07004206 @Deprecated
4207 public static final String
4208 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08004209
4210 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07004211 * This preference allows the device to be locked given time after screen goes off,
4212 * subject to current DeviceAdmin policy limits.
4213 * @hide
4214 */
4215 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
4216
4217
4218 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004219 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004220 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004221 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004222 */
4223 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
4224
4225 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004226 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07004227 * @hide
4228 */
Adrian Roos230635e2015-01-07 20:50:29 +01004229 @Deprecated
Michael Jurkaaa2859a2012-10-24 12:46:49 -07004230 public static final String LOCK_SCREEN_APPWIDGET_IDS =
4231 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07004232
4233 /**
Jim Miller08fa40c2014-04-29 18:18:47 -07004234 * List of enrolled fingerprint identifiers (comma-delimited).
4235 * @hide
4236 */
4237 public static final String USER_FINGERPRINT_IDS = "user_fingerprint_ids";
4238
4239 /**
Jim Miller51117262012-11-04 17:58:09 -08004240 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
4241 * @hide
4242 */
Adrian Roos230635e2015-01-07 20:50:29 +01004243 @Deprecated
Jim Miller51117262012-11-04 17:58:09 -08004244 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
4245 "lock_screen_fallback_appwidget_id";
4246
4247 /**
John Spurlock5f050e52012-10-27 10:44:19 -04004248 * Index of the lockscreen appwidget to restore, -1 if none.
4249 * @hide
4250 */
Adrian Roos230635e2015-01-07 20:50:29 +01004251 @Deprecated
John Spurlock5f050e52012-10-27 10:44:19 -04004252 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
4253 "lock_screen_sticky_appwidget";
4254
4255 /**
4256 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07004257 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07004258 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07004259 */
4260 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
4261 "lock_screen_owner_info_enabled";
4262
4263 /**
Dan Sandler5d7c3cc2014-02-18 17:35:15 -05004264 * When set by a user, allows notifications to be shown atop a securely locked screen
4265 * in their full "private" form (same as when the device is unlocked).
Dan Sandlerfd16d562014-02-13 18:43:31 -08004266 * @hide
4267 */
4268 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
4269 "lock_screen_allow_private_notifications";
4270
4271 /**
Chris Wrencd8f4f72014-08-27 18:48:13 -04004272 * Set by the system to track if the user needs to see the call to action for
4273 * the lockscreen notification policy.
4274 * @hide
4275 */
4276 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING =
4277 "show_note_about_notification_hiding";
4278
4279 /**
Adrian Roos3870d452014-09-05 18:22:28 +02004280 * Set to 1 by the system after trust agents have been initialized.
4281 * @hide
4282 */
4283 public static final String TRUST_AGENTS_INITIALIZED =
4284 "trust_agents_initialized";
4285
4286 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004287 * The Logging ID (a unique 64-bit value) as a hex string.
4288 * Used as a pseudonymous identifier for logging.
4289 * @deprecated This identifier is poorly initialized and has
4290 * many collisions. It should not be used.
4291 */
4292 @Deprecated
4293 public static final String LOGGING_ID = "logging_id";
4294
4295 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004296 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004297 */
Christopher Tate06efb532012-08-24 15:29:27 -07004298 @Deprecated
4299 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004300
4301 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004302 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004303 */
4304 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004305
4306 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004307 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004308 */
4309 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004310
4311 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08004312 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004313 */
4314 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004315
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004316 /**
4317 * Settings classname to launch when Settings is clicked from All
4318 * Applications. Needed because of user testing between the old
4319 * and new Settings apps.
4320 */
4321 // TODO: 881807
4322 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004323
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004324 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004325 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004326 */
Christopher Tate06efb532012-08-24 15:29:27 -07004327 @Deprecated
4328 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004329
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004330 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004331 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004332 */
Christopher Tate06efb532012-08-24 15:29:27 -07004333 @Deprecated
4334 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004335
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004336 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004337 * If accessibility is enabled.
4338 */
4339 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
4340
4341 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004342 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004343 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07004344 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07004345
4346 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07004347 * List of the enabled accessibility providers.
4348 */
4349 public static final String ENABLED_ACCESSIBILITY_SERVICES =
4350 "enabled_accessibility_services";
4351
4352 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004353 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07004354 * permission to put the device into touch exploration mode.
4355 *
4356 * @hide
4357 */
4358 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
4359 "touch_exploration_granted_accessibility_services";
4360
4361 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08004362 * Whether to speak passwords while in accessibility mode.
4363 */
4364 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
4365
4366 /**
Chris Craikcce47eb2014-07-16 15:12:15 -07004367 * Whether to draw text with high contrast while in accessibility mode.
4368 *
4369 * @hide
4370 */
4371 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED =
4372 "high_text_contrast_enabled";
4373
4374 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004375 * If injection of accessibility enhancing JavaScript screen-reader
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004376 * is enabled.
4377 * <p>
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004378 * Note: The JavaScript based screen-reader is served by the
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004379 * Google infrastructure and enable users with disabilities to
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004380 * efficiently navigate in and explore web content.
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004381 * </p>
4382 * <p>
4383 * This property represents a boolean value.
4384 * </p>
4385 * @hide
4386 */
4387 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
4388 "accessibility_script_injection";
4389
4390 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004391 * The URL for the injected JavaScript based screen-reader used
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004392 * for providing accessibility of content in WebView.
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08004393 * <p>
4394 * Note: The JavaScript based screen-reader is served by the
4395 * Google infrastructure and enable users with disabilities to
4396 * efficiently navigate in and explore web content.
4397 * </p>
4398 * <p>
4399 * This property represents a string value.
4400 * </p>
4401 * @hide
4402 */
4403 public static final String ACCESSIBILITY_SCREEN_READER_URL =
4404 "accessibility_script_injection_url";
4405
4406 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004407 * Key bindings for navigation in built-in accessibility support for web content.
4408 * <p>
4409 * Note: These key bindings are for the built-in accessibility navigation for
4410 * web content which is used as a fall back solution if JavaScript in a WebView
4411 * is not enabled or the user has not opted-in script injection from Google.
4412 * </p>
4413 * <p>
4414 * The bindings are separated by semi-colon. A binding is a mapping from
4415 * a key to a sequence of actions (for more details look at
4416 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
4417 * string representation of an integer obtained from a meta state (optional) shifted
4418 * sixteen times left and bitwise ored with a key code. An action is represented
4419 * as a hexademical string representation of an integer where the first two digits
4420 * are navigation action index, the second, the third, and the fourth digit pairs
4421 * represent the action arguments. The separate actions in a binding are colon
4422 * separated. The key and the action sequence it maps to are separated by equals.
4423 * </p>
4424 * <p>
4425 * For example, the binding below maps the DPAD right button to traverse the
4426 * current navigation axis once without firing an accessibility event and to
4427 * perform the same traversal again but to fire an event:
4428 * <code>
4429 * 0x16=0x01000100:0x01000101;
4430 * </code>
4431 * </p>
4432 * <p>
4433 * The goal of this binding is to enable dynamic rebinding of keys to
4434 * navigation actions for web content without requiring a framework change.
4435 * </p>
4436 * <p>
4437 * This property represents a string value.
4438 * </p>
4439 * @hide
4440 */
4441 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
4442 "accessibility_web_content_key_bindings";
4443
4444 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07004445 * Setting that specifies whether the display magnification is enabled.
4446 * Display magnifications allows the user to zoom in the display content
4447 * and is targeted to low vision users. The current magnification scale
4448 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
4449 *
4450 * @hide
4451 */
4452 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
4453 "accessibility_display_magnification_enabled";
4454
4455 /**
4456 * Setting that specifies what the display magnification scale is.
4457 * Display magnifications allows the user to zoom in the display
4458 * content and is targeted to low vision users. Whether a display
4459 * magnification is performed is controlled by
4460 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4461 *
4462 * @hide
4463 */
4464 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
4465 "accessibility_display_magnification_scale";
4466
4467 /**
4468 * Setting that specifies whether the display magnification should be
4469 * automatically updated. If this fearture is enabled the system will
4470 * exit magnification mode or pan the viewport when a context change
4471 * occurs. For example, on staring a new activity or rotating the screen,
4472 * the system may zoom out so the user can see the new context he is in.
4473 * Another example is on showing a window that is not visible in the
4474 * magnified viewport the system may pan the viewport to make the window
4475 * the has popped up so the user knows that the context has changed.
4476 * Whether a screen magnification is performed is controlled by
4477 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
4478 *
4479 * @hide
4480 */
4481 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
4482 "accessibility_display_magnification_auto_update";
4483
4484 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004485 * Setting that specifies whether timed text (captions) should be
4486 * displayed in video content. Text display properties are controlled by
4487 * the following settings:
4488 * <ul>
4489 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
4490 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
4491 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
4492 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
4493 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
4494 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
Alan Viverette69ce69b2013-08-29 12:23:48 -07004495 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
Alan Viveretteef793802013-07-23 14:15:28 -07004496 * </ul>
4497 *
4498 * @hide
4499 */
4500 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
4501 "accessibility_captioning_enabled";
4502
4503 /**
4504 * Setting that specifies the language for captions as a locale string,
4505 * e.g. en_US.
4506 *
4507 * @see java.util.Locale#toString
4508 * @hide
4509 */
4510 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
4511 "accessibility_captioning_locale";
4512
4513 /**
Alan Viverette43a1e3d2013-08-02 16:45:03 -07004514 * Integer property that specifies the preset style for captions, one
4515 * of:
4516 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07004517 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
4518 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
Alan Viverette43a1e3d2013-08-02 16:45:03 -07004519 * </ul>
4520 *
4521 * @see java.util.Locale#toString
4522 * @hide
4523 */
4524 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
4525 "accessibility_captioning_preset";
4526
4527 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004528 * Integer property that specifes the background color for captions as a
4529 * packed 32-bit color.
4530 *
4531 * @see android.graphics.Color#argb
4532 * @hide
4533 */
4534 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
4535 "accessibility_captioning_background_color";
4536
4537 /**
4538 * Integer property that specifes the foreground color for captions as a
4539 * packed 32-bit color.
4540 *
4541 * @see android.graphics.Color#argb
4542 * @hide
4543 */
4544 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
4545 "accessibility_captioning_foreground_color";
4546
4547 /**
4548 * Integer property that specifes the edge type for captions, one of:
4549 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07004550 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
4551 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
4552 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
Alan Viveretteef793802013-07-23 14:15:28 -07004553 * </ul>
4554 *
4555 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
4556 * @hide
4557 */
4558 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
4559 "accessibility_captioning_edge_type";
4560
4561 /**
4562 * Integer property that specifes the edge color for captions as a
4563 * packed 32-bit color.
4564 *
4565 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
4566 * @see android.graphics.Color#argb
4567 * @hide
4568 */
4569 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
4570 "accessibility_captioning_edge_color";
4571
4572 /**
Alan Viverette55d70622013-12-11 15:22:14 -08004573 * Integer property that specifes the window color for captions as a
4574 * packed 32-bit color.
4575 *
4576 * @see android.graphics.Color#argb
4577 * @hide
4578 */
4579 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR =
4580 "accessibility_captioning_window_color";
4581
4582 /**
Alan Viveretteef793802013-07-23 14:15:28 -07004583 * String property that specifies the typeface for captions, one of:
4584 * <ul>
4585 * <li>DEFAULT
4586 * <li>MONOSPACE
4587 * <li>SANS_SERIF
4588 * <li>SERIF
4589 * </ul>
4590 *
4591 * @see android.graphics.Typeface
4592 * @hide
4593 */
4594 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
4595 "accessibility_captioning_typeface";
4596
4597 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07004598 * Floating point property that specifies font scaling for captions.
Alan Viveretteef793802013-07-23 14:15:28 -07004599 *
4600 * @hide
4601 */
Alan Viverette69ce69b2013-08-29 12:23:48 -07004602 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
4603 "accessibility_captioning_font_scale";
Alan Viveretteef793802013-07-23 14:15:28 -07004604
4605 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07004606 * Setting that specifies whether display color inversion is enabled.
Alan Viverette410d4e32013-09-30 15:37:38 -07004607 */
4608 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED =
4609 "accessibility_display_inversion_enabled";
4610
4611 /**
Alan Viverette410d4e32013-09-30 15:37:38 -07004612 * Setting that specifies whether display color space adjustment is
4613 * enabled.
4614 *
4615 * @hide
4616 */
4617 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED =
4618 "accessibility_display_daltonizer_enabled";
4619
4620 /**
4621 * Integer property that specifies the type of color space adjustment to
4622 * perform. Valid values are defined in AccessibilityManager.
4623 *
4624 * @hide
4625 */
4626 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER =
4627 "accessibility_display_daltonizer";
4628
4629 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08004630 * The timout for considering a press to be a long press in milliseconds.
4631 * @hide
4632 */
4633 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
4634
4635 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07004636 * List of the enabled print services.
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07004637 * @hide
4638 */
4639 public static final String ENABLED_PRINT_SERVICES =
4640 "enabled_print_services";
4641
4642 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07004643 * List of the system print services we enabled on first boot. On
4644 * first boot we enable all system, i.e. bundled print services,
4645 * once, so they work out-of-the-box.
4646 * @hide
4647 */
4648 public static final String ENABLED_ON_FIRST_BOOT_SYSTEM_PRINT_SERVICES =
4649 "enabled_on_first_boot_system_print_services";
4650
4651 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004652 * Setting to always use the default text-to-speech settings regardless
4653 * of the application settings.
4654 * 1 = override application settings,
4655 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01004656 *
4657 * @deprecated The value of this setting is no longer respected by
4658 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004659 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004660 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07004661 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
4662
4663 /**
4664 * Default text-to-speech engine speech rate. 100 = 1x
4665 */
4666 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
4667
4668 /**
4669 * Default text-to-speech engine pitch. 100 = 1x
4670 */
4671 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
4672
4673 /**
4674 * Default text-to-speech engine.
4675 */
4676 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
4677
4678 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004679 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01004680 *
4681 * @deprecated this setting is no longer in use, as of the Ice Cream
4682 * Sandwich release. Apps should never need to read this setting directly,
4683 * instead can query the TextToSpeech framework classes for the default
4684 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004685 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004686 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07004687 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
4688
4689 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004690 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01004691 *
4692 * @deprecated this setting is no longer in use, as of the Ice Cream
4693 * Sandwich release. Apps should never need to read this setting directly,
4694 * instead can query the TextToSpeech framework classes for the default
4695 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004696 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004697 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004698 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
4699
4700 /**
4701 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01004702 *
4703 * @deprecated this setting is no longer in use, as of the Ice Cream
4704 * Sandwich release. Apps should never need to read this setting directly,
4705 * instead can query the TextToSpeech framework classes for the
4706 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004707 */
Narayan Kamath6d632962011-08-24 11:51:37 +01004708 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07004709 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
4710
4711 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004712 * Stores the default tts locales on a per engine basis. Stored as
4713 * a comma seperated list of values, each value being of the form
4714 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01004715 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
4716 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
4717 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
4718 * setting directly, and can query the TextToSpeech framework classes
4719 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01004720 *
4721 * @hide
4722 */
4723 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
4724
4725 /**
Charles Chenceffa152010-03-16 21:18:10 -07004726 * Space delimited list of plugin packages that are enabled.
4727 */
4728 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
4729
4730 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004731 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
4732 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004733 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004734 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004735 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004736 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004737
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004738 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004739 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
4740 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004741 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004742 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004743 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004744 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004745
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004746 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004747 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
4748 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004749 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004750 @Deprecated
4751 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
4752 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004753
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004754 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004755 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
4756 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004757 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004758 @Deprecated
4759 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004760
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004761 /**
4762 * The acceptable packet loss percentage (range 0 - 100) before trying
4763 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004764 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004765 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004766 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004767 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
4768 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004769
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004770 /**
4771 * The number of access points required for a network in order for the
4772 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004773 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004774 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004775 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004776 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004777
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004778 /**
4779 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004780 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004781 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004782 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004783 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
4784 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004785
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004786 /**
4787 * Whether the Wi-Fi watchdog is enabled for background checking even
4788 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004789 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004790 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004791 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004792 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
4793 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004794
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004795 /**
4796 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004797 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004798 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004799 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004800 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
4801 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004802
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004803 /**
4804 * The number of initial pings to perform that *may* be ignored if they
4805 * fail. Again, if these fail, they will *not* be used in packet loss
4806 * calculation. For example, one network always seemed to time out for
4807 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004808 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004809 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004810 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004811 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
4812 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004813
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004814 /**
4815 * The maximum number of access points (per network) to attempt to test.
4816 * If this number is reached, the watchdog will no longer monitor the
4817 * initial connection state for the network. This is a safeguard for
4818 * networks containing multiple APs whose DNS does not respond to pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004819 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004820 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004821 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004822 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004823
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004824 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004825 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004826 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004827 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004828 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
4829
4830 /**
4831 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004832 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004833 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004834 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004835 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
4836
4837 /**
4838 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004839 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004840 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004841 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004842 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004843
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004844 /**
4845 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004846 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004847 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004848 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004849 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004850
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004851 /**
4852 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004853 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004854 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07004855 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004856 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004857
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004858 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004859 * @deprecated Use
4860 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004861 */
Christopher Tate06efb532012-08-24 15:29:27 -07004862 @Deprecated
4863 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004864
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004865 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004866 * @deprecated Use
4867 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004868 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07004869 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004870 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004871 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004872
4873 /**
Jeremy Joslin79294842014-12-03 17:15:28 -08004874 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives
4875 * the receivers of the PendingIntent an opportunity to make a new network request before
4876 * the Network satisfying the request is potentially removed.
4877 *
4878 * @hide
4879 */
4880 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS =
4881 "connectivity_release_pending_intent_delay_ms";
4882
4883 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07004884 * Whether background data usage is allowed.
4885 *
4886 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
4887 * availability of background data depends on several
4888 * combined factors. When background data is unavailable,
4889 * {@link ConnectivityManager#getActiveNetworkInfo()} will
4890 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004891 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07004892 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004893 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07004894
4895 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00004896 * Origins for which browsers should allow geolocation by default.
4897 * The value is a space-separated list of origins.
4898 */
4899 public static final String ALLOWED_GEOLOCATION_ORIGINS
4900 = "allowed_geolocation_origins";
4901
4902 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07004903 * The preferred TTY mode 0 = TTy Off, CDMA default
4904 * 1 = TTY Full
4905 * 2 = TTY HCO
4906 * 3 = TTY VCO
4907 * @hide
4908 */
4909 public static final String PREFERRED_TTY_MODE =
4910 "preferred_tty_mode";
4911
Wink Saville04e71b32009-04-02 11:00:54 -07004912 /**
Wink Saville04e71b32009-04-02 11:00:54 -07004913 * Whether the enhanced voice privacy mode is enabled.
4914 * 0 = normal voice privacy
4915 * 1 = enhanced voice privacy
4916 * @hide
4917 */
4918 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
4919
4920 /**
4921 * Whether the TTY mode mode is enabled.
4922 * 0 = disabled
4923 * 1 = enabled
4924 * @hide
4925 */
4926 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004927
4928 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07004929 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07004930 * Type: int ( 0 = disabled, 1 = enabled )
4931 * @hide
4932 */
4933 public static final String BACKUP_ENABLED = "backup_enabled";
4934
4935 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08004936 * Controls whether application data is automatically restored from backup
4937 * at install time.
4938 * Type: int ( 0 = disabled, 1 = enabled )
4939 * @hide
4940 */
4941 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
4942
4943 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07004944 * Indicates whether settings backup has been fully provisioned.
4945 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
4946 * @hide
4947 */
4948 public static final String BACKUP_PROVISIONED = "backup_provisioned";
4949
4950 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07004951 * Component of the transport to use for backup/restore.
4952 * @hide
4953 */
4954 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07004955
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07004956 /**
4957 * Version for which the setup wizard was last shown. Bumped for
4958 * each release when there is new setup information to show.
4959 * @hide
4960 */
4961 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07004962
4963 /**
Doug Zongker43866e02010-01-07 12:09:54 -08004964 * The interval in milliseconds after which Wi-Fi is considered idle.
4965 * When idle, it is possible for the device to be switched from Wi-Fi to
4966 * the mobile data network.
4967 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004968 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
4969 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08004970 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004971 @Deprecated
4972 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08004973
4974 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01004975 * The global search provider chosen by the user (if multiple global
4976 * search providers are installed). This will be the provider returned
4977 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
4978 * installed. This setting is stored as a flattened component name as
4979 * per {@link ComponentName#flattenToString()}.
4980 *
4981 * @hide
4982 */
4983 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
4984 "search_global_search_activity";
4985
4986 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08004987 * The number of promoted sources in GlobalSearch.
4988 * @hide
4989 */
4990 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
4991 /**
4992 * The maximum number of suggestions returned by GlobalSearch.
4993 * @hide
4994 */
4995 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
4996 /**
4997 * The number of suggestions GlobalSearch will ask each non-web search source for.
4998 * @hide
4999 */
5000 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
5001 /**
5002 * The number of suggestions the GlobalSearch will ask the web search source for.
5003 * @hide
5004 */
5005 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
5006 "search_web_results_override_limit";
5007 /**
5008 * The number of milliseconds that GlobalSearch will wait for suggestions from
5009 * promoted sources before continuing with all other sources.
5010 * @hide
5011 */
5012 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
5013 "search_promoted_source_deadline_millis";
5014 /**
5015 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
5016 * @hide
5017 */
5018 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
5019 /**
5020 * The maximum number of milliseconds that GlobalSearch shows the previous results
5021 * after receiving a new query.
5022 * @hide
5023 */
5024 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
5025 /**
5026 * The maximum age of log data used for shortcuts in GlobalSearch.
5027 * @hide
5028 */
5029 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
5030 /**
5031 * The maximum age of log data used for source ranking in GlobalSearch.
5032 * @hide
5033 */
5034 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
5035 "search_max_source_event_age_millis";
5036 /**
5037 * The minimum number of impressions needed to rank a source in GlobalSearch.
5038 * @hide
5039 */
5040 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
5041 "search_min_impressions_for_source_ranking";
5042 /**
5043 * The minimum number of clicks needed to rank a source in GlobalSearch.
5044 * @hide
5045 */
5046 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
5047 "search_min_clicks_for_source_ranking";
5048 /**
5049 * The maximum number of shortcuts shown by GlobalSearch.
5050 * @hide
5051 */
5052 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
5053 /**
5054 * The size of the core thread pool for suggestion queries in GlobalSearch.
5055 * @hide
5056 */
5057 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
5058 "search_query_thread_core_pool_size";
5059 /**
5060 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
5061 * @hide
5062 */
5063 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
5064 "search_query_thread_max_pool_size";
5065 /**
5066 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
5067 * @hide
5068 */
5069 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
5070 "search_shortcut_refresh_core_pool_size";
5071 /**
5072 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
5073 * @hide
5074 */
5075 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
5076 "search_shortcut_refresh_max_pool_size";
5077 /**
5078 * The maximun time that excess threads in the GlobalSeach thread pools will
5079 * wait before terminating.
5080 * @hide
5081 */
5082 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
5083 "search_thread_keepalive_seconds";
5084 /**
5085 * The maximum number of concurrent suggestion queries to each source.
5086 * @hide
5087 */
5088 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
5089 "search_per_source_concurrent_query_limit";
5090
San Mehat87734d32010-01-08 12:53:06 -08005091 /**
5092 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
5093 * @hide
5094 */
5095 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
5096
5097 /**
5098 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
5099 * @hide
5100 */
5101 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
5102
5103 /**
5104 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
5105 * @hide
5106 */
5107 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
5108
5109 /**
5110 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
5111 * @hide
5112 */
5113 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005114
Dan Egnor42471dd2010-01-07 17:25:22 -08005115 /**
5116 * If nonzero, ANRs in invisible background processes bring up a dialog.
5117 * Otherwise, the process will be silently killed.
5118 * @hide
5119 */
5120 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08005121
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005122 /**
5123 * The {@link ComponentName} string of the service to be used as the voice recognition
5124 * service.
Erikeebc8e22010-02-18 13:27:19 -08005125 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08005126 * @hide
5127 */
5128 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08005129
William Luh623a4282013-06-24 12:14:18 -07005130 /**
5131 * Stores whether an user has consented to have apps verified through PAM.
5132 * The value is boolean (1 or 0).
5133 *
5134 * @hide
5135 */
5136 public static final String PACKAGE_VERIFIER_USER_CONSENT =
5137 "package_verifier_user_consent";
satok988323c2011-06-22 16:38:13 +09005138
5139 /**
satokada8c4e2011-08-23 14:56:56 +09005140 * The {@link ComponentName} string of the selected spell checker service which is
5141 * one of the services managed by the text service manager.
5142 *
5143 * @hide
5144 */
5145 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
5146
5147 /**
5148 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09005149 * service which is one of the services managed by the text service manager.
5150 *
5151 * @hide
5152 */
satokada8c4e2011-08-23 14:56:56 +09005153 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
5154 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09005155
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08005156 /**
satoka33c4fc2011-08-25 16:50:11 +09005157 * The {@link ComponentName} string whether spell checker is enabled or not.
5158 *
5159 * @hide
5160 */
5161 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
5162
5163 /**
David Brown458e8062010-03-08 21:52:11 -08005164 * What happens when the user presses the Power button while in-call
5165 * and the screen is on.<br/>
5166 * <b>Values:</b><br/>
5167 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
5168 * 2 - The Power button hangs up the current call.<br/>
5169 *
5170 * @hide
5171 */
5172 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
5173
5174 /**
5175 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
5176 * @hide
5177 */
5178 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
5179
5180 /**
5181 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
5182 * @hide
5183 */
5184 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
5185
5186 /**
5187 * INCALL_POWER_BUTTON_BEHAVIOR default value.
5188 * @hide
5189 */
5190 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
5191 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
5192
5193 /**
Jeff Browna20dda42014-05-27 20:57:24 -07005194 * Whether the device should wake when the wake gesture sensor detects motion.
5195 * @hide
5196 */
5197 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled";
5198
5199 /**
John Spurlocka4215ce2014-08-04 14:50:38 -04005200 * Whether the device should doze if configured.
5201 * @hide
5202 */
5203 public static final String DOZE_ENABLED = "doze_enabled";
5204
5205 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07005206 * The current night mode that has been selected by the user. Owned
5207 * and controlled by UiModeManagerService. Constants are as per
5208 * UiModeManager.
5209 * @hide
5210 */
5211 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07005212
5213 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005214 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04005215 * @hide
5216 */
Daniel Sandler2d545362011-11-17 10:38:37 -08005217 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005218
5219 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005220 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08005221 *
John Spurlock1a868b72012-08-22 09:56:51 -04005222 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08005223 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04005224 * @hide
5225 */
John Spurlock1a868b72012-08-22 09:56:51 -04005226 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08005227
5228 /**
John Spurlock1a868b72012-08-22 09:56:51 -04005229 * If screensavers are enabled, whether the screensaver should be automatically launched
5230 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08005231 * @hide
5232 */
5233 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04005234
John Spurlock1a868b72012-08-22 09:56:51 -04005235 /**
5236 * If screensavers are enabled, whether the screensaver should be automatically launched
5237 * when the screen times out when not on battery.
5238 * @hide
5239 */
5240 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
5241
5242 /**
5243 * If screensavers are enabled, the default screensaver component.
5244 * @hide
5245 */
5246 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
5247
Daniel Sandler0601eb72011-04-13 01:01:32 -04005248 /**
Martijn Coenena7397882013-07-30 20:07:47 -07005249 * The default NFC payment component
5250 * @hide
5251 */
5252 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
5253
5254 /**
Martijn Coenen2f6f3a012014-04-25 17:00:21 -07005255 * Whether NFC payment is handled by the foreground application or a default.
5256 * @hide
5257 */
5258 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground";
5259
5260 /**
David Braunf5d83192013-09-16 13:43:51 -07005261 * Specifies the package name currently configured to be the primary sms application
5262 * @hide
5263 */
5264 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application";
5265
5266 /**
Adrian Roos943eb862015-03-26 12:31:16 -07005267 * Specifies the package name currently configured to be the emergency assistance application
5268 *
5269 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE
5270 *
5271 * @hide
5272 */
5273 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application";
5274
5275 /**
Chris Wren8326a8a2014-10-22 14:13:32 -04005276 * Names of the packages that the current user has explicitly allowed to
5277 * see all of the user's notifications, separated by ':'.
Daniel Sandler4b749ef2013-03-18 21:53:04 -04005278 *
5279 * @hide
5280 */
5281 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
5282
John Spurlock7340fc82014-04-24 18:50:12 -04005283 /**
5284 * @hide
5285 */
5286 public static final String ENABLED_CONDITION_PROVIDERS = "enabled_condition_providers";
5287
John Spurlock5c454122013-06-17 07:35:46 -04005288 /** @hide */
5289 public static final String BAR_SERVICE_COMPONENT = "bar_service_component";
5290
John Spurlockd67ec252013-09-05 11:31:54 -04005291 /** @hide */
John Spurlockcdb57ae2015-02-11 19:04:11 -05005292 public static final String VOLUME_CONTROLLER_SERVICE_COMPONENT
5293 = "volume_controller_service_component";
5294
5295 /** @hide */
John Spurlockf1a36642013-10-12 17:50:42 -04005296 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
John Spurlockd67ec252013-09-05 11:31:54 -04005297
Yorke Lee647f8f32013-05-07 10:49:44 -07005298 /**
Svetoslavf43e8512013-09-30 17:33:05 -07005299 * This is the query URI for finding a print service to install.
5300 *
5301 * @hide
5302 */
5303 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri";
5304
5305 /**
5306 * This is the query URI for finding a NFC payment service to install.
5307 *
5308 * @hide
5309 */
5310 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri";
5311
5312 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005313 * If enabled, apps should try to skip any introductory hints on first launch. This might
Amith Yamasani0c416392014-06-13 15:54:39 -07005314 * apply to users that are already familiar with the environment or temporary users.
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005315 * <p>
5316 * Type : int (0 to show hints, 1 to skip showing hints)
Amith Yamasani1e9c2182014-06-11 17:25:51 -07005317 */
5318 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
5319
5320 /**
John Spurlockaa5ee4d2014-07-25 13:05:12 -04005321 * Persisted playback time after a user confirmation of an unsafe volume level.
5322 *
5323 * @hide
5324 */
5325 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
5326
5327 /**
Dan Sandler52e5701e2014-07-22 23:14:54 -04005328 * This preference enables notification display on the lockscreen.
5329 * @hide
5330 */
5331 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
5332 "lock_screen_show_notifications";
5333
5334 /**
Dongwon Kang4d933a02014-08-07 22:51:47 -07005335 * List of TV inputs that are currently hidden. This is a string
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005336 * containing the IDs of all hidden TV inputs. Each ID is encoded by
5337 * {@link android.net.Uri#encode(String)} and separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005338 * @hide
5339 */
5340 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs";
5341
5342 /**
5343 * List of custom TV input labels. This is a string containing <TV input id, custom name>
Jaewan Kimf0e530e2014-08-22 00:43:31 +09005344 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)}
5345 * and separated by ','. Each pair is separated by ':'.
Dongwon Kang4d933a02014-08-07 22:51:47 -07005346 * @hide
5347 */
5348 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels";
5349
5350 /**
Glenn Kasten34cc4db2014-08-13 10:56:38 -07005351 * Whether automatic routing of system audio to USB audio peripheral is disabled.
5352 * The value is boolean (1 or 0), where 1 means automatic routing is disabled,
5353 * and 0 means automatic routing is enabled.
5354 *
5355 * @hide
5356 */
5357 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED =
5358 "usb_audio_automatic_routing_disabled";
5359
5360 /**
Jeff Brown05af6ad2014-09-30 20:54:30 -07005361 * The timeout in milliseconds before the device fully goes to sleep after
5362 * a period of inactivity. This value sets an upper bound on how long the device
5363 * will stay awake or dreaming without user activity. It should generally
Dianne Hackbornad6a99b2014-11-18 10:11:10 -08005364 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device
Jeff Brown05af6ad2014-09-30 20:54:30 -07005365 * will sleep before it ever has a chance to dream.
5366 * <p>
5367 * Use -1 to disable this timeout.
5368 * </p>
5369 *
5370 * @hide
5371 */
5372 public static final String SLEEP_TIMEOUT = "sleep_timeout";
5373
5374 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07005375 * This are the settings to be backed up.
5376 *
5377 * NOTE: Settings are backed up and restored in the order they appear
5378 * in this array. If you have one setting depending on another,
5379 * make sure that they are ordered appropriately.
5380 *
-b master501eec92009-07-06 13:53:11 -07005381 * @hide
5382 */
5383 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08005384 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07005385 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07005386 PARENTAL_CONTROL_ENABLED,
5387 PARENTAL_CONTROL_REDIRECT_URL,
Christopher Tate66488d62012-10-02 11:58:01 -07005388 USB_MASS_STORAGE_ENABLED, // moved to global
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07005389 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
5390 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
5391 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07005392 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08005393 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07005394 ENABLED_ACCESSIBILITY_SERVICES,
Christopher Tate6597e342015-02-17 12:15:25 -08005395 ENABLED_NOTIFICATION_LISTENERS,
Christopher Tate7b9a28c2015-03-18 13:06:16 -07005396 ENABLED_INPUT_METHODS,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07005397 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07005398 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07005399 ACCESSIBILITY_ENABLED,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08005400 ACCESSIBILITY_SPEAK_PASSWORD,
Chris Craikcce47eb2014-07-16 15:12:15 -07005401 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
Alan Viveretteef793802013-07-23 14:15:28 -07005402 ACCESSIBILITY_CAPTIONING_ENABLED,
5403 ACCESSIBILITY_CAPTIONING_LOCALE,
5404 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
5405 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
5406 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
5407 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
5408 ACCESSIBILITY_CAPTIONING_TYPEFACE,
Alan Viverette69ce69b2013-08-29 12:23:48 -07005409 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
-b master501eec92009-07-06 13:53:11 -07005410 TTS_USE_DEFAULTS,
5411 TTS_DEFAULT_RATE,
5412 TTS_DEFAULT_PITCH,
5413 TTS_DEFAULT_SYNTH,
5414 TTS_DEFAULT_LANG,
5415 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07005416 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01005417 TTS_DEFAULT_LOCALE,
Christopher Tate66488d62012-10-02 11:58:01 -07005418 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
5419 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
5420 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
Christopher Tate06cbadd2015-03-16 18:29:42 -07005421 SELECTED_SPELL_CHECKER,
5422 SELECTED_SPELL_CHECKER_SUBTYPE,
5423 SPELL_CHECKER_ENABLED,
San Mehat87734d32010-01-08 12:53:06 -08005424 MOUNT_PLAY_NOTIFICATION_SND,
5425 MOUNT_UMS_AUTOSTART,
5426 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07005427 MOUNT_UMS_NOTIFY_ENABLED,
Jeff Brown05af6ad2014-09-30 20:54:30 -07005428 UI_NIGHT_MODE,
5429 SLEEP_TIMEOUT
-b master501eec92009-07-06 13:53:11 -07005430 };
5431
5432 /**
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005433 * These entries are considered common between the personal and the managed profile,
5434 * since the managed profile doesn't get to change them.
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005435 */
Svetoslav683914b2015-01-15 14:22:26 -08005436 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>();
5437 static {
5438 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED);
5439 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION);
5440 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS);
5441 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD);
5442 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES);
5443 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS);
5444 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
5445 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED);
5446 CLONE_TO_MANAGED_PROFILE.add(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS);
5447 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE);
5448 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER);
5449 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE);
5450 }
5451
5452 /** @hide */
5453 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) {
5454 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE);
5455 }
Amith Yamasani4f7e2e32014-08-14 18:49:48 -07005456
5457 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005458 * Helper method for determining if a location provider is enabled.
Tom O'Neilld5759432013-09-11 11:03:03 -07005459 *
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005460 * @param cr the content resolver to use
5461 * @param provider the location provider to query
5462 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07005463 *
5464 * @deprecated use {@link #LOCATION_MODE} or
5465 * {@link LocationManager#isProviderEnabled(String)}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005466 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005467 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005468 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Victoria Leaseb711d572012-10-02 13:14:11 -07005469 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
5470 }
5471
5472 /**
5473 * Helper method for determining if a location provider is enabled.
5474 * @param cr the content resolver to use
5475 * @param provider the location provider to query
5476 * @param userId the userId to query
5477 * @return true if the provider is enabled
Tom O'Neilld5759432013-09-11 11:03:03 -07005478 * @deprecated use {@link #LOCATION_MODE} or
5479 * {@link LocationManager#isProviderEnabled(String)}
Victoria Leaseb711d572012-10-02 13:14:11 -07005480 * @hide
5481 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005482 @Deprecated
Victoria Leaseb711d572012-10-02 13:14:11 -07005483 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
5484 String allowedProviders = Settings.Secure.getStringForUser(cr,
5485 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07005486 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005487 }
5488
5489 /**
5490 * Thread-safe method for enabling or disabling a single location provider.
5491 * @param cr the content resolver to use
5492 * @param provider the location provider to enable or disable
5493 * @param enabled true if the provider should be enabled
Tom O'Neilla324ac72013-08-26 14:40:23 -07005494 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005495 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005496 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005497 public static final void setLocationProviderEnabled(ContentResolver cr,
5498 String provider, boolean enabled) {
Victoria Leaseb711d572012-10-02 13:14:11 -07005499 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
5500 }
5501
5502 /**
5503 * Thread-safe method for enabling or disabling a single location provider.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005504 *
Victoria Leaseb711d572012-10-02 13:14:11 -07005505 * @param cr the content resolver to use
5506 * @param provider the location provider to enable or disable
5507 * @param enabled true if the provider should be enabled
5508 * @param userId the userId for which to enable/disable providers
Tom O'Neilla324ac72013-08-26 14:40:23 -07005509 * @return true if the value was set, false on database errors
5510 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and
5511 * {@link #LOCATION_MODE}
Victoria Leaseb711d572012-10-02 13:14:11 -07005512 * @hide
5513 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07005514 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07005515 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
Victoria Leaseb711d572012-10-02 13:14:11 -07005516 String provider, boolean enabled, int userId) {
David Christie3f7b6522013-08-06 19:19:08 -07005517 synchronized (mLocationSettingsLock) {
5518 // to ensure thread safety, we write the provider name with a '+' or '-'
5519 // and let the SettingsProvider handle it rather than reading and modifying
5520 // the list of enabled providers.
5521 if (enabled) {
5522 provider = "+" + provider;
5523 } else {
5524 provider = "-" + provider;
5525 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07005526 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
David Christie3f7b6522013-08-06 19:19:08 -07005527 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005528 }
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07005529 }
Tom O'Neill1f48b782013-08-19 18:14:56 -07005530
5531 /**
5532 * Thread-safe method for setting the location mode to one of
5533 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
5534 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
5535 *
Tom O'Neill1f48b782013-08-19 18:14:56 -07005536 * @param cr the content resolver to use
5537 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
5538 * @param userId the userId for which to change mode
Tom O'Neilla324ac72013-08-26 14:40:23 -07005539 * @return true if the value was set, false on database errors
Tom O'Neill1f48b782013-08-19 18:14:56 -07005540 *
5541 * @throws IllegalArgumentException if mode is not one of the supported values
5542 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005543 private static final boolean setLocationModeForUser(ContentResolver cr, int mode,
5544 int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07005545 synchronized (mLocationSettingsLock) {
5546 boolean gps = false;
5547 boolean network = false;
5548 switch (mode) {
5549 case LOCATION_MODE_OFF:
5550 break;
5551 case LOCATION_MODE_SENSORS_ONLY:
5552 gps = true;
5553 break;
5554 case LOCATION_MODE_BATTERY_SAVING:
5555 network = true;
5556 break;
5557 case LOCATION_MODE_HIGH_ACCURACY:
5558 gps = true;
5559 network = true;
5560 break;
5561 default:
5562 throw new IllegalArgumentException("Invalid location mode: " + mode);
5563 }
Tom O'Neill7731a992014-10-09 11:30:49 -07005564 // Note it's important that we set the NLP mode first. The Google implementation
5565 // of NLP clears its NLP consent setting any time it receives a
5566 // LocationManager.PROVIDERS_CHANGED_ACTION broadcast and NLP is disabled. Also,
5567 // it shows an NLP consent dialog any time it receives the broadcast, NLP is
5568 // enabled, and the NLP consent is not set. If 1) we were to enable GPS first,
5569 // 2) a setup wizard has its own NLP consent UI that sets the NLP consent setting,
5570 // and 3) the receiver happened to complete before we enabled NLP, then the Google
5571 // NLP would detect the attempt to enable NLP and show a redundant NLP consent
5572 // dialog. Then the people who wrote the setup wizard would be sad.
Tom O'Neilla324ac72013-08-26 14:40:23 -07005573 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07005574 cr, LocationManager.NETWORK_PROVIDER, network, userId);
Tom O'Neill7731a992014-10-09 11:30:49 -07005575 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
5576 cr, LocationManager.GPS_PROVIDER, gps, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07005577 return gpsSuccess && nlpSuccess;
Tom O'Neill1f48b782013-08-19 18:14:56 -07005578 }
5579 }
5580
5581 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07005582 * Thread-safe method for reading the location mode, returns one of
5583 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
5584 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
5585 *
5586 * @param cr the content resolver to use
5587 * @param userId the userId for which to read the mode
5588 * @return the location mode
5589 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07005590 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07005591 synchronized (mLocationSettingsLock) {
5592 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
5593 cr, LocationManager.GPS_PROVIDER, userId);
5594 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
5595 cr, LocationManager.NETWORK_PROVIDER, userId);
5596 if (gpsEnabled && networkEnabled) {
5597 return LOCATION_MODE_HIGH_ACCURACY;
5598 } else if (gpsEnabled) {
5599 return LOCATION_MODE_SENSORS_ONLY;
5600 } else if (networkEnabled) {
5601 return LOCATION_MODE_BATTERY_SAVING;
5602 } else {
5603 return LOCATION_MODE_OFF;
5604 }
5605 }
5606 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005607 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005608
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005609 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005610 * Global system settings, containing preferences that always apply identically
5611 * to all defined users. Applications can read these but are not allowed to write;
5612 * like the "Secure" settings, these are for preferences that the user must
5613 * explicitly modify through the system UI or specialized APIs for those values.
5614 */
5615 public static final class Global extends NameValueTable {
5616 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_global_version";
5617
5618 /**
5619 * The content:// style URL for global secure settings items. Not public.
5620 */
5621 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
5622
5623 /**
Amith Yamasani23a0f052014-07-25 12:26:53 -07005624 * Whether users are allowed to add more users or guest from lockscreen.
5625 * <p>
5626 * Type: int
5627 * @hide
5628 */
5629 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
5630
5631 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07005632 * Setting whether the global gesture for enabling accessibility is enabled.
5633 * If this gesture is enabled the user will be able to perfrom it to enable
5634 * the accessibility state without visiting the settings app.
5635 * @hide
5636 */
5637 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
5638 "enable_accessibility_global_gesture_enabled";
5639
5640 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005641 * Whether Airplane Mode is on.
5642 */
5643 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
5644
5645 /**
Bryce Lee584a4452014-10-21 15:55:55 -07005646 * Whether Theater Mode is on.
5647 * {@hide}
5648 */
Bryce Leecdfebd62015-02-02 08:19:11 -08005649 @SystemApi
Bryce Lee584a4452014-10-21 15:55:55 -07005650 public static final String THEATER_MODE_ON = "theater_mode_on";
5651
5652 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005653 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
5654 */
5655 public static final String RADIO_BLUETOOTH = "bluetooth";
5656
5657 /**
5658 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
5659 */
5660 public static final String RADIO_WIFI = "wifi";
5661
5662 /**
5663 * {@hide}
5664 */
5665 public static final String RADIO_WIMAX = "wimax";
5666 /**
5667 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
5668 */
5669 public static final String RADIO_CELL = "cell";
5670
5671 /**
5672 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
5673 */
5674 public static final String RADIO_NFC = "nfc";
5675
5676 /**
5677 * A comma separated list of radios that need to be disabled when airplane mode
5678 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
5679 * included in the comma separated list.
5680 */
5681 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
5682
5683 /**
5684 * A comma separated list of radios that should to be disabled when airplane mode
5685 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
5686 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
5687 * will be turned off when entering airplane mode, but the user will be able to reenable
5688 * Wifi in the Settings app.
5689 *
5690 * {@hide}
5691 */
5692 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
5693
5694 /**
5695 * The policy for deciding when Wi-Fi should go to sleep (which will in
5696 * turn switch to using the mobile data as an Internet connection).
5697 * <p>
5698 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
5699 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
5700 * {@link #WIFI_SLEEP_POLICY_NEVER}.
5701 */
5702 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
5703
5704 /**
5705 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
5706 * policy, which is to sleep shortly after the turning off
5707 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
5708 */
5709 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
5710
5711 /**
5712 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
5713 * the device is on battery, and never go to sleep when the device is
5714 * plugged in.
5715 */
5716 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
5717
5718 /**
5719 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
5720 */
5721 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
5722
5723 /**
5724 * Value to specify if the user prefers the date, time and time zone
5725 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5726 */
5727 public static final String AUTO_TIME = "auto_time";
5728
5729 /**
5730 * Value to specify if the user prefers the time zone
5731 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5732 */
5733 public static final String AUTO_TIME_ZONE = "auto_time_zone";
5734
5735 /**
5736 * URI for the car dock "in" event sound.
5737 * @hide
5738 */
5739 public static final String CAR_DOCK_SOUND = "car_dock_sound";
5740
5741 /**
5742 * URI for the car dock "out" event sound.
5743 * @hide
5744 */
5745 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
5746
5747 /**
5748 * URI for the desk dock "in" event sound.
5749 * @hide
5750 */
5751 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
5752
5753 /**
5754 * URI for the desk dock "out" event sound.
5755 * @hide
5756 */
5757 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
5758
5759 /**
5760 * Whether to play a sound for dock events.
5761 * @hide
5762 */
5763 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
5764
5765 /**
5766 * URI for the "device locked" (keyguard shown) sound.
5767 * @hide
5768 */
5769 public static final String LOCK_SOUND = "lock_sound";
5770
5771 /**
5772 * URI for the "device unlocked" sound.
5773 * @hide
5774 */
5775 public static final String UNLOCK_SOUND = "unlock_sound";
5776
5777 /**
Adrian Roos49e057d2014-08-13 17:14:51 +02005778 * URI for the "device is trusted" sound, which is played when the device enters the trusted
5779 * state without unlocking.
5780 * @hide
5781 */
5782 public static final String TRUSTED_SOUND = "trusted_sound";
5783
5784 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005785 * URI for the low battery sound file.
5786 * @hide
5787 */
5788 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
5789
5790 /**
5791 * Whether to play a sound for low-battery alerts.
5792 * @hide
5793 */
5794 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
5795
5796 /**
Jeff Brown84e27562012-12-07 13:56:34 -08005797 * URI for the "wireless charging started" sound.
5798 * @hide
5799 */
5800 public static final String WIRELESS_CHARGING_STARTED_SOUND =
5801 "wireless_charging_started_sound";
5802
5803 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005804 * Whether we keep the device on while the device is plugged in.
5805 * Supported values are:
5806 * <ul>
5807 * <li>{@code 0} to never stay on while plugged in</li>
5808 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
5809 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
5810 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
5811 * </ul>
5812 * These values can be OR-ed together.
5813 */
5814 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
5815
5816 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08005817 * When the user has enable the option to have a "bug report" command
5818 * in the power menu.
5819 * @hide
5820 */
5821 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
5822
5823 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005824 * Whether ADB is enabled.
5825 */
5826 public static final String ADB_ENABLED = "adb_enabled";
5827
5828 /**
Jon Miranda836c0a82014-08-11 12:32:26 -07005829 * Whether Views are allowed to save their attribute data.
5830 * @hide
5831 */
5832 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes";
5833
5834 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005835 * Whether assisted GPS should be enabled or not.
5836 * @hide
5837 */
5838 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
5839
5840 /**
5841 * Whether bluetooth is enabled/disabled
5842 * 0=disabled. 1=enabled.
5843 */
5844 public static final String BLUETOOTH_ON = "bluetooth_on";
5845
5846 /**
5847 * CDMA Cell Broadcast SMS
5848 * 0 = CDMA Cell Broadcast SMS disabled
5849 * 1 = CDMA Cell Broadcast SMS enabled
5850 * @hide
5851 */
5852 public static final String CDMA_CELL_BROADCAST_SMS =
5853 "cdma_cell_broadcast_sms";
5854
5855 /**
5856 * The CDMA roaming mode 0 = Home Networks, CDMA default
5857 * 1 = Roaming on Affiliated networks
5858 * 2 = Roaming on any networks
5859 * @hide
5860 */
5861 public static final String CDMA_ROAMING_MODE = "roaming_settings";
5862
5863 /**
5864 * The CDMA subscription mode 0 = RUIM/SIM (default)
5865 * 1 = NV
5866 * @hide
5867 */
5868 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
5869
5870 /** Inactivity timeout to track mobile data activity.
5871 *
5872 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
5873 * infer the data activity of mobile network. After a period of no activity on mobile
5874 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
5875 * intent is fired to indicate a transition of network status from "active" to "idle". Any
5876 * subsequent activity on mobile networks triggers the firing of {@code
5877 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
5878 *
5879 * Network activity refers to transmitting or receiving data on the network interfaces.
5880 *
5881 * Tracking is disabled if set to zero or negative value.
5882 *
5883 * @hide
5884 */
5885 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
5886
5887 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
5888 * but for Wifi network.
5889 * @hide
5890 */
5891 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
5892
5893 /**
5894 * Whether or not data roaming is enabled. (0 = false, 1 = true)
5895 */
5896 public static final String DATA_ROAMING = "data_roaming";
5897
5898 /**
Wink Saville75c1e692013-03-20 17:06:50 -07005899 * The value passed to a Mobile DataConnection via bringUp which defines the
5900 * number of retries to preform when setting up the initial connection. The default
5901 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
5902 * @hide
5903 */
5904 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
5905
5906 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005907 * Whether user has enabled development settings.
5908 */
5909 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
5910
5911 /**
5912 * Whether the device has been provisioned (0 = false, 1 = true)
5913 */
5914 public static final String DEVICE_PROVISIONED = "device_provisioned";
5915
5916 /**
5917 * The saved value for WindowManagerService.setForcedDisplayDensity().
5918 * One integer in dpi. If unset, then use the real display density.
5919 * @hide
5920 */
5921 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
5922
5923 /**
5924 * The saved value for WindowManagerService.setForcedDisplaySize().
5925 * Two integers separated by a comma. If unset, then use the real display size.
5926 * @hide
5927 */
5928 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
5929
5930 /**
5931 * The maximum size, in bytes, of a download that the download manager will transfer over
5932 * a non-wifi connection.
5933 * @hide
5934 */
5935 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
5936 "download_manager_max_bytes_over_mobile";
5937
5938 /**
5939 * The recommended maximum size, in bytes, of a download that the download manager should
5940 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
5941 * have the option to start the download over the mobile connection anyway.
5942 * @hide
5943 */
5944 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
5945 "download_manager_recommended_max_bytes_over_mobile";
5946
5947 /**
Christopher Tateaa036a22014-05-19 16:33:27 -07005948 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
Christopher Tate06efb532012-08-24 15:29:27 -07005949 */
Christopher Tateaa036a22014-05-19 16:33:27 -07005950 @Deprecated
5951 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Christopher Tate06efb532012-08-24 15:29:27 -07005952
5953 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09005954 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be
5955 * sent or processed. (0 = false, 1 = true)
5956 * @hide
5957 */
5958 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled";
5959
5960 /**
5961 * Whether HDMI system audio is enabled. If enabled, TV internal speaker is muted,
5962 * and the output is redirected to AV Receiver connected via
5963 * {@Global#HDMI_SYSTEM_AUDIO_OUTPUT}.
5964 * @hide
5965 */
5966 public static final String HDMI_SYSTEM_AUDIO_ENABLED = "hdmi_system_audio_enabled";
5967
5968 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09005969 * Whether TV will automatically turn on upon reception of the CEC command
5970 * &lt;Text View On&gt; or &lt;Image View On&gt;. (0 = false, 1 = true)
5971 * @hide
5972 */
5973 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED =
5974 "hdmi_control_auto_wakeup_enabled";
5975
5976 /**
5977 * Whether TV will also turn off other CEC devices when it goes to standby mode.
5978 * (0 = false, 1 = true)
5979 * @hide
5980 */
5981 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
5982 "hdmi_control_auto_device_off_enabled";
5983
5984 /**
Lorenzo Colitti06d7e532015-03-16 23:46:24 +09005985 * Whether to use the DHCP client from Lollipop and earlier instead of the newer Android DHCP
5986 * client.
5987 * (0 = false, 1 = true)
5988 * @hide
5989 */
5990 public static final String LEGACY_DHCP_CLIENT = "legacy_dhcp_client";
5991
5992 /**
Jinsuk Kimb3d91772014-07-10 12:48:54 +09005993 * Whether TV will switch to MHL port when a mobile device is plugged in.
5994 * (0 = false, 1 = true)
5995 * @hide
5996 */
5997 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled";
5998
5999 /**
6000 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true)
6001 * @hide
6002 */
6003 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled";
6004
6005 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006006 * Whether mobile data connections are allowed by the user. See
6007 * ConnectivityManager for more info.
6008 * @hide
6009 */
6010 public static final String MOBILE_DATA = "mobile_data";
6011
6012 /** {@hide} */
6013 public static final String NETSTATS_ENABLED = "netstats_enabled";
6014 /** {@hide} */
6015 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
6016 /** {@hide} */
6017 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
6018 /** {@hide} */
6019 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
6020 /** {@hide} */
6021 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
Christopher Tate06efb532012-08-24 15:29:27 -07006022
6023 /** {@hide} */
6024 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
6025 /** {@hide} */
6026 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
6027 /** {@hide} */
6028 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
6029 /** {@hide} */
6030 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
6031
6032 /** {@hide} */
6033 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
6034 /** {@hide} */
6035 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
6036 /** {@hide} */
6037 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
6038 /** {@hide} */
6039 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
6040
6041 /** {@hide} */
6042 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
6043 /** {@hide} */
6044 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
6045 /** {@hide} */
6046 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
6047 /** {@hide} */
6048 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
6049
6050 /**
6051 * User preference for which network(s) should be used. Only the
6052 * connectivity service should touch this.
6053 */
6054 public static final String NETWORK_PREFERENCE = "network_preference";
6055
6056 /**
Jeff Davidsondd6fd1e2014-04-14 15:14:30 -07006057 * Which package name to use for network scoring. If null, or if the package is not a valid
6058 * scorer app, external network scores will neither be requested nor accepted.
6059 * @hide
6060 */
6061 public static final String NETWORK_SCORER_APP = "network_scorer_app";
6062
6063 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006064 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
6065 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
6066 * exceeded.
6067 * @hide
6068 */
6069 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
6070
6071 /**
6072 * The length of time in milli-seconds that automatic small adjustments to
6073 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
6074 * @hide
6075 */
6076 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
6077
6078 /** Preferred NTP server. {@hide} */
6079 public static final String NTP_SERVER = "ntp_server";
6080 /** Timeout in milliseconds to wait for NTP server. {@hide} */
6081 public static final String NTP_TIMEOUT = "ntp_timeout";
6082
6083 /**
rich cannings4d8fc792012-09-07 14:43:43 -07006084 * Whether the package manager should send package verification broadcasts for verifiers to
6085 * review apps prior to installation.
6086 * 1 = request apps to be verified prior to installation, if a verifier exists.
6087 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07006088 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07006089 */
6090 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
6091
6092 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006093 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006094 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
6095
6096 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07006097 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07006098 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
6099
rich cannings4e5753f2012-09-19 16:03:56 -07006100 /**
6101 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07006102 * 1 = show (default)
6103 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07006104 * @hide
rich canningse6686b32012-09-16 14:02:20 -07006105 */
6106 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
6107
rich cannings4d8fc792012-09-07 14:43:43 -07006108 /**
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -08006109 * Run package verification on apps installed through ADB/ADT/USB
rich cannings4e5753f2012-09-19 16:03:56 -07006110 * 1 = perform package verification on ADB installs (default)
6111 * 0 = bypass package verification on ADB installs
6112 * @hide
6113 */
6114 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
6115
6116 /**
Christopher Tate7265abe2014-11-21 13:54:45 -08006117 * Time since last fstrim (milliseconds) after which we force one to happen
6118 * during device startup. If unset, the default is 3 days.
6119 * @hide
6120 */
6121 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
6122
6123 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006124 * The interval in milliseconds at which to check packet counts on the
6125 * mobile data interface when screen is on, to detect possible data
6126 * connection problems.
6127 * @hide
6128 */
6129 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
6130 "pdp_watchdog_poll_interval_ms";
6131
6132 /**
6133 * The interval in milliseconds at which to check packet counts on the
6134 * mobile data interface when screen is off, to detect possible data
6135 * connection problems.
6136 * @hide
6137 */
6138 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
6139 "pdp_watchdog_long_poll_interval_ms";
6140
6141 /**
6142 * The interval in milliseconds at which to check packet counts on the
6143 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
6144 * outgoing packets has been reached without incoming packets.
6145 * @hide
6146 */
6147 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
6148 "pdp_watchdog_error_poll_interval_ms";
6149
6150 /**
6151 * The number of outgoing packets sent without seeing an incoming packet
6152 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
6153 * device is logged to the event log
6154 * @hide
6155 */
6156 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
6157 "pdp_watchdog_trigger_packet_count";
6158
6159 /**
6160 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
6161 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
6162 * attempting data connection recovery.
6163 * @hide
6164 */
6165 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
6166 "pdp_watchdog_error_poll_count";
6167
6168 /**
6169 * The number of failed PDP reset attempts before moving to something more
6170 * drastic: re-registering to the network.
6171 * @hide
6172 */
6173 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
6174 "pdp_watchdog_max_pdp_reset_fail_count";
6175
6176 /**
6177 * A positive value indicates how often the SamplingProfiler
6178 * should take snapshots. Zero value means SamplingProfiler
6179 * is disabled.
6180 *
6181 * @hide
6182 */
6183 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
6184
6185 /**
6186 * URL to open browser on to allow user to manage a prepay account
6187 * @hide
6188 */
6189 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
6190 "setup_prepaid_data_service_url";
6191
6192 /**
6193 * URL to attempt a GET on to see if this is a prepay device
6194 * @hide
6195 */
6196 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
6197 "setup_prepaid_detection_target_url";
6198
6199 /**
6200 * Host to check for a redirect to after an attempt to GET
6201 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
6202 * this is a prepaid device with zero balance.)
6203 * @hide
6204 */
6205 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
6206 "setup_prepaid_detection_redir_host";
6207
6208 /**
Jake Hamby76a61422012-09-06 17:40:21 -07006209 * The interval in milliseconds at which to check the number of SMS sent out without asking
6210 * for use permit, to limit the un-authorized SMS usage.
6211 *
6212 * @hide
6213 */
6214 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
6215 "sms_outgoing_check_interval_ms";
6216
6217 /**
6218 * The number of outgoing SMS sent without asking for user permit (of {@link
6219 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
6220 *
6221 * @hide
6222 */
6223 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
6224 "sms_outgoing_check_max_count";
6225
6226 /**
6227 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07006228 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07006229 * @see com.android.internal.telephony.SmsUsageMonitor
6230 * @hide
6231 */
6232 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
6233
Robert Greenwalt026efcc2012-09-24 10:03:21 -07006234 /**
6235 * Used to select which country we use to determine premium sms codes.
6236 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
6237 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
6238 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
6239 * @hide
6240 */
6241 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
6242
Jake Hamby76a61422012-09-06 17:40:21 -07006243 /**
JP Abgrall32d1ac4d2014-02-21 12:05:20 -08006244 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value
6245 * @hide
6246 */
6247 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd";
6248
6249 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006250 * Used to disable Tethering on a device - defaults to true
6251 * @hide
6252 */
6253 public static final String TETHER_SUPPORTED = "tether_supported";
6254
6255 /**
6256 * Used to require DUN APN on the device or not - defaults to a build config value
6257 * which defaults to false
6258 * @hide
6259 */
6260 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
6261
6262 /**
6263 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
6264 * corresponding build config values are set it will override the APN DB
6265 * values.
6266 * Consists of a comma seperated list of strings:
6267 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
6268 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
6269 * @hide
6270 */
6271 public static final String TETHER_DUN_APN = "tether_dun_apn";
6272
6273 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006274 * USB Mass Storage Enabled
6275 */
6276 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
6277
6278 /**
6279 * If this setting is set (to anything), then all references
6280 * to Gmail on the device must change to Google Mail.
6281 */
6282 public static final String USE_GOOGLE_MAIL = "use_google_mail";
6283
Hui Shu22671772014-10-01 21:41:07 +00006284 /**
6285 * Webview Data reduction proxy key.
6286 * @hide
6287 */
6288 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY =
6289 "webview_data_reduction_proxy_key";
6290
Christopher Tate06efb532012-08-24 15:29:27 -07006291 /**
Jeff Brown89d55462012-09-19 11:33:42 -07006292 * Whether Wifi display is enabled/disabled
6293 * 0=disabled. 1=enabled.
6294 * @hide
6295 */
6296 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
6297
6298 /**
Chong Zhang1f3ecaa2013-05-03 15:55:36 -07006299 * Whether Wifi display certification mode is enabled/disabled
6300 * 0=disabled. 1=enabled.
6301 * @hide
6302 */
6303 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
6304 "wifi_display_certification_on";
6305
6306 /**
Chong Zhange38af812013-08-29 17:25:17 -07006307 * WPS Configuration method used by Wifi display, this setting only
6308 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
6309 *
6310 * Possible values are:
6311 *
6312 * WpsInfo.INVALID: use default WPS method chosen by framework
6313 * WpsInfo.PBC : use Push button
6314 * WpsInfo.KEYPAD : use Keypad
6315 * WpsInfo.DISPLAY: use Display
6316 * @hide
6317 */
6318 public static final String WIFI_DISPLAY_WPS_CONFIG =
6319 "wifi_display_wps_config";
6320
6321 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006322 * Whether to notify the user of open networks.
6323 * <p>
6324 * If not connected and the scan results have an open network, we will
6325 * put this notification up. If we attempt to connect to a network or
6326 * the open network(s) disappear, we remove the notification. When we
6327 * show the notification, we will not show it again for
6328 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
6329 */
6330 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6331 "wifi_networks_available_notification_on";
6332 /**
6333 * {@hide}
6334 */
6335 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
6336 "wimax_networks_available_notification_on";
6337
6338 /**
6339 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
6340 * Connecting to a network will reset the timer.
6341 */
6342 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
6343 "wifi_networks_available_repeat_delay";
6344
6345 /**
Robert Greenwalt3ea0c992013-10-03 21:13:49 +00006346 * 802.11 country code in ISO 3166 format
6347 * @hide
6348 */
6349 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
6350
6351 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006352 * The interval in milliseconds to issue wake up scans when wifi needs
6353 * to connect. This is necessary to connect to an access point when
6354 * device is on the move and the screen is off.
6355 * @hide
6356 */
6357 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
6358 "wifi_framework_scan_interval_ms";
6359
6360 /**
6361 * The interval in milliseconds after which Wi-Fi is considered idle.
6362 * When idle, it is possible for the device to be switched from Wi-Fi to
6363 * the mobile data network.
6364 * @hide
6365 */
6366 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
6367
6368 /**
6369 * When the number of open networks exceeds this number, the
6370 * least-recently-used excess networks will be removed.
6371 */
6372 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
6373
6374 /**
6375 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
6376 */
6377 public static final String WIFI_ON = "wifi_on";
6378
6379 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08006380 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
6381 * @hide
6382 */
6383 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
6384 "wifi_scan_always_enabled";
6385
6386 /**
Wei Wangd91f1932015-03-19 15:09:56 -07006387 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for
6388 * connectivity.
6389 * @hide
6390 */
6391 public static final String BLE_SCAN_ALWAYS_AVAILABLE =
6392 "ble_scan_always_enabled";
6393
6394 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006395 * Used to save the Wifi_ON state prior to tethering.
6396 * This state will be checked to restore Wifi after
6397 * the user turns off tethering.
6398 *
6399 * @hide
6400 */
6401 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
6402
6403 /**
6404 * The interval in milliseconds to scan as used by the wifi supplicant
6405 * @hide
6406 */
6407 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
6408 "wifi_supplicant_scan_interval_ms";
6409
vandwalle7c3606c2014-03-31 19:12:07 -07006410 /**
6411 * whether frameworks handles wifi auto-join
6412 * @hide
6413 */
6414 public static final String WIFI_ENHANCED_AUTO_JOIN =
6415 "wifi_enhanced_auto_join";
6416
6417 /**
6418 * whether settings show RSSI
6419 * @hide
6420 */
6421 public static final String WIFI_NETWORK_SHOW_RSSI =
6422 "wifi_network_show_rssi";
6423
6424 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07006425 * The interval in milliseconds to scan at supplicant when p2p is connected
6426 * @hide
6427 */
6428 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
6429 "wifi_scan_interval_p2p_connected_ms";
6430
6431 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006432 * Whether the Wi-Fi watchdog is enabled.
6433 */
6434 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
6435
6436 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006437 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
6438 * the setting needs to be set to 0 to disable it.
6439 * @hide
6440 */
6441 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
6442 "wifi_watchdog_poor_network_test_enabled";
6443
6444 /**
6445 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
6446 * needs to be set to 0 to disable it.
6447 * @hide
6448 */
6449 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
6450 "wifi_suspend_optimizations_enabled";
6451
6452 /**
6453 * The maximum number of times we will retry a connection to an access
6454 * point for which we have failed in acquiring an IP address from DHCP.
6455 * A value of N means that we will make N+1 connection attempts in all.
6456 */
6457 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
6458
6459 /**
6460 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
6461 * data connectivity to be established after a disconnect from Wi-Fi.
6462 */
6463 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
6464 "wifi_mobile_data_transition_wakelock_timeout_ms";
6465
6466 /**
6467 * The operational wifi frequency band
6468 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
6469 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
6470 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
6471 *
6472 * @hide
6473 */
6474 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
6475
6476 /**
6477 * The Wi-Fi peer-to-peer device name
6478 * @hide
6479 */
6480 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
6481
6482 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07006483 * The min time between wifi disable and wifi enable
6484 * @hide
6485 */
6486 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
6487
6488 /**
Jeff Davidsona20ca67d2014-12-16 11:48:54 -08006489 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect
6490 * from an ephemeral network if there is no BSSID for that network with a non-null score that
6491 * has been seen in this time period.
6492 *
6493 * If this is less than or equal to zero, we use a more conservative behavior and only check
6494 * for a non-null score from the currently connected or target BSSID.
6495 * @hide
6496 */
6497 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS =
6498 "wifi_ephemeral_out_of_range_timeout_ms";
6499
6500 /**
Christopher Tatec868b642012-09-12 17:41:04 -07006501 * The number of milliseconds to delay when checking for data stalls during
6502 * non-aggressive detection. (screen is turned off.)
6503 * @hide
6504 */
6505 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
6506 "data_stall_alarm_non_aggressive_delay_in_ms";
6507
6508 /**
6509 * The number of milliseconds to delay when checking for data stalls during
6510 * aggressive detection. (screen on or suspected data stall)
6511 * @hide
6512 */
6513 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
6514 "data_stall_alarm_aggressive_delay_in_ms";
6515
6516 /**
Wink Savillece1e3792013-09-03 16:41:44 -07006517 * The number of milliseconds to allow the provisioning apn to remain active
6518 * @hide
6519 */
6520 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
6521 "provisioning_apn_alarm_delay_in_ms";
6522
6523 /**
Christopher Tatec868b642012-09-12 17:41:04 -07006524 * The interval in milliseconds at which to check gprs registration
6525 * after the first registration mismatch of gprs and voice service,
6526 * to detect possible data network registration problems.
6527 *
6528 * @hide
6529 */
6530 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
6531 "gprs_register_check_period_ms";
6532
6533 /**
Christopher Tate06efb532012-08-24 15:29:27 -07006534 * Nonzero causes Log.wtf() to crash.
6535 * @hide
6536 */
6537 public static final String WTF_IS_FATAL = "wtf_is_fatal";
6538
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07006539 /**
6540 * Ringer mode. This is used internally, changing this value will not
6541 * change the ringer mode. See AudioManager.
6542 */
6543 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07006544
Jeff Brownd4935962012-09-25 13:27:20 -07006545 /**
6546 * Overlay display devices setting.
6547 * The associated value is a specially formatted string that describes the
6548 * size and density of simulated secondary display devices.
6549 * <p>
6550 * Format: {width}x{height}/{dpi};...
6551 * </p><p>
6552 * Example:
6553 * <ul>
6554 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
6555 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
6556 * at 1080p and the second at 720p.</li>
6557 * <li>If the value is empty, then no overlay display devices are created.</li>
6558 * </ul></p>
6559 *
6560 * @hide
6561 */
6562 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07006563
Jeff Sharkey625239a2012-09-26 22:03:49 -07006564 /**
6565 * Threshold values for the duration and level of a discharge cycle,
6566 * under which we log discharge cycle info.
6567 *
6568 * @hide
6569 */
6570 public static final String
6571 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
6572
6573 /** @hide */
6574 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
6575
6576 /**
6577 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
6578 * intents on application crashes and ANRs. If this is disabled, the
6579 * crash/ANR dialog will never display the "Report" button.
6580 * <p>
6581 * Type: int (0 = disallow, 1 = allow)
6582 *
6583 * @hide
6584 */
6585 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
6586
6587 /**
6588 * Maximum age of entries kept by {@link DropBoxManager}.
6589 *
6590 * @hide
6591 */
6592 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
6593
6594 /**
6595 * Maximum number of entry files which {@link DropBoxManager} will keep
6596 * around.
6597 *
6598 * @hide
6599 */
6600 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
6601
6602 /**
6603 * Maximum amount of disk space used by {@link DropBoxManager} no matter
6604 * what.
6605 *
6606 * @hide
6607 */
6608 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
6609
6610 /**
6611 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
6612 * will use.
6613 *
6614 * @hide
6615 */
6616 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
6617
6618 /**
6619 * Percent of total disk which {@link DropBoxManager} will never dip
6620 * into.
6621 *
6622 * @hide
6623 */
6624 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
6625
6626 /**
6627 * Prefix for per-tag dropbox disable/enable settings.
6628 *
6629 * @hide
6630 */
6631 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
6632
6633 /**
6634 * Lines of logcat to include with system crash/ANR/etc. reports, as a
6635 * prefix of the dropbox tag of the report type. For example,
6636 * "logcat_for_system_server_anr" controls the lines of logcat captured
6637 * with system server ANR reports. 0 to disable.
6638 *
6639 * @hide
6640 */
6641 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
6642
6643 /**
6644 * The interval in minutes after which the amount of free storage left
6645 * on the device is logged to the event log
6646 *
6647 * @hide
6648 */
6649 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
6650
6651 /**
6652 * Threshold for the amount of change in disk free space required to
6653 * report the amount of free space. Used to prevent spamming the logs
6654 * when the disk free space isn't changing frequently.
6655 *
6656 * @hide
6657 */
6658 public static final String
6659 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
6660
6661 /**
6662 * Minimum percentage of free storage on the device that is used to
6663 * determine if the device is running low on storage. The default is 10.
6664 * <p>
6665 * Say this value is set to 10, the device is considered running low on
6666 * storage if 90% or more of the device storage is filled up.
6667 *
6668 * @hide
6669 */
6670 public static final String
6671 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
6672
6673 /**
6674 * Maximum byte size of the low storage threshold. This is to ensure
6675 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
6676 * overly large threshold for large storage devices. Currently this must
6677 * be less than 2GB. This default is 500MB.
6678 *
6679 * @hide
6680 */
6681 public static final String
6682 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
6683
6684 /**
6685 * Minimum bytes of free storage on the device before the data partition
6686 * is considered full. By default, 1 MB is reserved to avoid system-wide
6687 * SQLite disk full exceptions.
6688 *
6689 * @hide
6690 */
6691 public static final String
6692 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
6693
6694 /**
6695 * The maximum reconnect delay for short network outages or when the
6696 * network is suspended due to phone use.
6697 *
6698 * @hide
6699 */
6700 public static final String
6701 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
6702
6703 /**
6704 * The number of milliseconds to delay before sending out
Erik Kline8f29dcf2014-12-08 16:25:20 +09006705 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
Jeff Sharkey625239a2012-09-26 22:03:49 -07006706 *
6707 * @hide
6708 */
6709 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
6710
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -07006711
6712 /**
6713 * Network sampling interval, in seconds. We'll generate link information
6714 * about bytes/packets sent and error rates based on data sampled in this interval
6715 *
6716 * @hide
6717 */
6718
6719 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
6720 "connectivity_sampling_interval_in_seconds";
6721
Jeff Sharkey625239a2012-09-26 22:03:49 -07006722 /**
Jason Monk602b2322013-07-03 17:04:33 -04006723 * The series of successively longer delays used in retrying to download PAC file.
6724 * Last delay is used between successful PAC downloads.
6725 *
6726 * @hide
6727 */
6728 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
6729
6730 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07006731 * Setting to turn off captive portal detection. Feature is enabled by
6732 * default and the setting needs to be set to 0 to disable it.
6733 *
6734 * @hide
6735 */
6736 public static final String
6737 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
6738
6739 /**
6740 * The server used for captive portal detection upon a new conection. A
6741 * 204 response code from the server is used for validation.
6742 *
6743 * @hide
6744 */
6745 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
6746
6747 /**
6748 * Whether network service discovery is enabled.
6749 *
6750 * @hide
6751 */
6752 public static final String NSD_ON = "nsd_on";
6753
6754 /**
6755 * Let user pick default install location.
6756 *
6757 * @hide
6758 */
6759 public static final String SET_INSTALL_LOCATION = "set_install_location";
6760
6761 /**
6762 * Default install location value.
6763 * 0 = auto, let system decide
6764 * 1 = internal
6765 * 2 = sdcard
6766 * @hide
6767 */
6768 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
6769
6770 /**
6771 * ms during which to consume extra events related to Inet connection
6772 * condition after a transtion to fully-connected
6773 *
6774 * @hide
6775 */
6776 public static final String
6777 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
6778
6779 /**
6780 * ms during which to consume extra events related to Inet connection
6781 * condtion after a transtion to partly-connected
6782 *
6783 * @hide
6784 */
6785 public static final String
6786 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
6787
6788 /** {@hide} */
6789 public static final String
6790 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
6791
6792 /**
6793 * Host name and port for global http proxy. Uses ':' seperator for
6794 * between host and port.
6795 */
6796 public static final String HTTP_PROXY = "http_proxy";
6797
6798 /**
6799 * Host name for global http proxy. Set via ConnectivityManager.
6800 *
6801 * @hide
6802 */
6803 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
6804
6805 /**
6806 * Integer host port for global http proxy. Set via ConnectivityManager.
6807 *
6808 * @hide
6809 */
6810 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
6811
6812 /**
6813 * Exclusion list for global proxy. This string contains a list of
6814 * comma-separated domains where the global proxy does not apply.
6815 * Domains should be listed in a comma- separated list. Example of
6816 * acceptable formats: ".domain1.com,my.domain2.com" Use
6817 * ConnectivityManager to set/get.
6818 *
6819 * @hide
6820 */
6821 public static final String
6822 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
6823
6824 /**
Jason Monk602b2322013-07-03 17:04:33 -04006825 * The location PAC File for the proxy.
6826 * @hide
6827 */
6828 public static final String
6829 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
6830
6831 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07006832 * Enables the UI setting to allow the user to specify the global HTTP
6833 * proxy and associated exclusion list.
6834 *
6835 * @hide
6836 */
6837 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
6838
6839 /**
6840 * Setting for default DNS in case nobody suggests one
6841 *
6842 * @hide
6843 */
6844 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
6845
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006846 /** {@hide} */
6847 public static final String
6848 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
6849 /** {@hide} */
6850 public static final String
6851 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
6852 /** {@hide} */
6853 public static final String
6854 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
Kim Schulz0d376052013-08-22 11:18:02 +02006855 /** {@hide} */
6856 public static final String
6857 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_";
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006858
6859 /**
6860 * Get the key that retrieves a bluetooth headset's priority.
6861 * @hide
6862 */
6863 public static final String getBluetoothHeadsetPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07006864 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006865 }
6866
6867 /**
6868 * Get the key that retrieves a bluetooth a2dp sink's priority.
6869 * @hide
6870 */
6871 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07006872 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006873 }
6874
6875 /**
6876 * Get the key that retrieves a bluetooth Input Device's priority.
6877 * @hide
6878 */
6879 public static final String getBluetoothInputDevicePriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07006880 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07006881 }
6882
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006883 /**
Kim Schulz0d376052013-08-22 11:18:02 +02006884 * Get the key that retrieves a bluetooth map priority.
6885 * @hide
6886 */
6887 public static final String getBluetoothMapPriorityKey(String address) {
6888 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
6889 }
6890 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006891 * Scaling factor for normal window animations. Setting to 0 will
6892 * disable window animations.
6893 */
6894 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
6895
6896 /**
6897 * Scaling factor for activity transition animations. Setting to 0 will
6898 * disable window animations.
6899 */
6900 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
6901
6902 /**
6903 * Scaling factor for Animator-based animations. This affects both the
6904 * start delay and duration of all such animations. Setting to 0 will
6905 * cause animations to end immediately. The default value is 1.
6906 */
6907 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
6908
6909 /**
6910 * Scaling factor for normal window animations. Setting to 0 will
6911 * disable window animations.
6912 *
6913 * @hide
6914 */
6915 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
6916
6917 /**
6918 * If 0, the compatibility mode is off for all applications.
6919 * If 1, older applications run under compatibility mode.
6920 * TODO: remove this settings before code freeze (bug/1907571)
6921 * @hide
6922 */
6923 public static final String COMPATIBILITY_MODE = "compatibility_mode";
6924
6925 /**
6926 * CDMA only settings
6927 * Emergency Tone 0 = Off
6928 * 1 = Alert
6929 * 2 = Vibrate
6930 * @hide
6931 */
6932 public static final String EMERGENCY_TONE = "emergency_tone";
6933
6934 /**
6935 * CDMA only settings
6936 * Whether the auto retry is enabled. The value is
6937 * boolean (1 or 0).
6938 * @hide
6939 */
6940 public static final String CALL_AUTO_RETRY = "call_auto_retry";
6941
6942 /**
Sungmin Choie099ab12014-06-09 14:45:51 +09006943 * See RIL_PreferredNetworkType in ril.h
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006944 * @hide
6945 */
6946 public static final String PREFERRED_NETWORK_MODE =
6947 "preferred_network_mode";
6948
6949 /**
Junda Liubbdc1c02014-11-07 11:18:02 -08006950 * Setting to 1 will hide carrier network settings.
6951 * Default is 0.
6952 * @hide
6953 */
6954 public static final String HIDE_CARRIER_NETWORK_SETTINGS =
6955 "hide_carrier_network_settings";
6956
6957 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006958 * Name of an application package to be debugged.
6959 */
6960 public static final String DEBUG_APP = "debug_app";
6961
6962 /**
6963 * If 1, when launching DEBUG_APP it will wait for the debugger before
6964 * starting user code. If 0, it will run normally.
6965 */
6966 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
6967
6968 /**
6969 * Control whether the process CPU usage meter should be shown.
6970 */
6971 public static final String SHOW_PROCESSES = "show_processes";
6972
6973 /**
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07006974 * If 1 low power mode is enabled.
6975 * @hide
6976 */
6977 public static final String LOW_POWER_MODE = "low_power";
6978
John Spurlockf8f524c2014-06-10 14:47:29 -04006979 /**
6980 * Battery level [1-99] at which low power mode automatically turns on.
Dianne Hackborn14272302014-06-10 23:13:02 -07006981 * If 0, it will not automatically turn on.
John Spurlockf8f524c2014-06-10 14:47:29 -04006982 * @hide
6983 */
6984 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";
6985
Ruchi Kandoi62b8a492014-04-17 18:01:40 -07006986 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006987 * If 1, the activity manager will aggressively finish activities and
6988 * processes as soon as they are no longer needed. If 0, the normal
6989 * extended lifetime is used.
6990 */
Dianne Hackborn89ad4562014-08-24 16:45:38 -07006991 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities";
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07006992
Christopher Tate66488d62012-10-02 11:58:01 -07006993 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07006994 * Use Dock audio output for media:
6995 * 0 = disabled
6996 * 1 = enabled
6997 * @hide
6998 */
6999 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
7000
7001 /**
Eric Laurent05274f32012-11-29 12:48:18 -08007002 * Persisted safe headphone volume management state by AudioService
7003 * @hide
7004 */
7005 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
7006
7007 /**
Geremy Condraa0735112013-03-26 21:49:26 -07007008 * URL for tzinfo (time zone) updates
7009 * @hide
7010 */
7011 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
7012
7013 /**
7014 * URL for tzinfo (time zone) update metadata
7015 * @hide
7016 */
7017 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
7018
7019 /**
7020 * URL for selinux (mandatory access control) updates
7021 * @hide
7022 */
7023 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
7024
7025 /**
7026 * URL for selinux (mandatory access control) update metadata
7027 * @hide
7028 */
7029 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
7030
7031 /**
7032 * URL for sms short code updates
7033 * @hide
7034 */
7035 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
7036 "sms_short_codes_content_url";
7037
7038 /**
7039 * URL for sms short code update metadata
7040 * @hide
7041 */
7042 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
7043 "sms_short_codes_metadata_url";
7044
7045 /**
7046 * URL for cert pinlist updates
7047 * @hide
7048 */
7049 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
7050
7051 /**
7052 * URL for cert pinlist updates
7053 * @hide
7054 */
7055 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
7056
Geremy Condra757ee522013-03-29 16:39:45 -07007057 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -07007058 * URL for intent firewall updates
7059 * @hide
7060 */
7061 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
7062 "intent_firewall_content_url";
7063
7064 /**
7065 * URL for intent firewall update metadata
7066 * @hide
7067 */
7068 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
7069 "intent_firewall_metadata_url";
7070
7071 /**
Geremy Condra4e7f7e82013-03-26 21:09:01 -07007072 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
7073 * @hide
7074 */
7075 public static final String SELINUX_STATUS = "selinux_status";
7076
Geremy Condraa0735112013-03-26 21:49:26 -07007077 /**
Amith Yamasanid8415f42013-08-07 20:15:10 -07007078 * Developer setting to force RTL layout.
7079 * @hide
7080 */
7081 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
7082
7083 /**
Daniel Sandlerdea64622013-09-23 16:05:57 -04007084 * Milliseconds after screen-off after which low battery sounds will be silenced.
7085 *
7086 * If zero, battery sounds will always play.
7087 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider.
7088 *
7089 * @hide
7090 */
7091 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout";
7092
7093 /**
Evan Charltoncc7b0432014-01-14 14:47:11 -08007094 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after
Dianne Hackborna3fb40d2014-08-12 15:06:50 -07007095 * the caller is done with this, they should call {@link ContentResolver#delete} to
Evan Charltoncc7b0432014-01-14 14:47:11 -08007096 * clean up any value that they may have written.
7097 *
7098 * @hide
7099 */
7100 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms";
7101
John Spurlockc6d1c602014-01-17 15:22:06 -05007102 /**
7103 * Defines global runtime overrides to window policy.
7104 *
Jorim Jaggib10e33f2015-02-04 21:57:40 +01007105 * See {@link com.android.server.policy.PolicyControl} for value format.
John Spurlockc6d1c602014-01-17 15:22:06 -05007106 *
7107 * @hide
7108 */
7109 public static final String POLICY_CONTROL = "policy_control";
Evan Charltoncc7b0432014-01-14 14:47:11 -08007110
7111 /**
John Spurlockae641c92014-06-30 18:11:40 -04007112 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS,
7113 * or ZEN_MODE_NO_INTERRUPTIONS.
John Spurlocke677d712014-02-13 12:52:19 -05007114 *
7115 * @hide
7116 */
7117 public static final String ZEN_MODE = "zen_mode";
7118
7119 /** @hide */ public static final int ZEN_MODE_OFF = 0;
John Spurlockae641c92014-06-30 18:11:40 -04007120 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1;
7121 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2;
John Spurlock4f1163c2015-04-02 17:41:21 -04007122 /** @hide */ public static final int ZEN_MODE_ALARMS = 3;
John Spurlocke677d712014-02-13 12:52:19 -05007123
7124 /** @hide */ public static String zenModeToString(int mode) {
John Spurlockae641c92014-06-30 18:11:40 -04007125 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
John Spurlock4f1163c2015-04-02 17:41:21 -04007126 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
John Spurlockae641c92014-06-30 18:11:40 -04007127 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS";
7128 return "ZEN_MODE_OFF";
John Spurlocke677d712014-02-13 12:52:19 -05007129 }
7130
7131 /**
John Spurlock056c5192014-04-20 21:52:01 -04007132 * Opaque value, changes when persisted zen mode configuration changes.
7133 *
7134 * @hide
7135 */
7136 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag";
7137
7138 /**
Chris Wren7bd241232014-02-28 16:25:05 -05007139 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON.
7140 *
7141 * @hide
7142 */
Chris Wren10d82df2014-03-01 10:34:51 -05007143 public static final String HEADS_UP_NOTIFICATIONS_ENABLED =
7144 "heads_up_notifications_enabled";
Chris Wren7bd241232014-02-28 16:25:05 -05007145
7146 /** @hide */ public static final int HEADS_UP_OFF = 0;
7147 /** @hide */ public static final int HEADS_UP_ON = 1;
7148
7149 /**
Jerome Poichet147b4d72014-05-12 18:13:27 -07007150 * The name of the device
7151 *
7152 * @hide
7153 */
7154 public static final String DEVICE_NAME = "device_name";
7155
7156 /**
Amith Yamasani1e9c2182014-06-11 17:25:51 -07007157 * Whether it should be possible to create a guest user on the device.
7158 * <p>
7159 * Type: int (0 for disabled, 1 for enabled)
7160 * @hide
7161 */
7162 public static final String GUEST_USER_ENABLED = "guest_user_enabled";
7163
7164 /**
Jeff Davidson56f9f732014-08-14 16:47:23 -07007165 * Whether the NetworkScoringService has been first initialized.
7166 * <p>
7167 * Type: int (0 for false, 1 for true)
7168 * @hide
7169 */
7170 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
7171
7172 /**
Jim Miller6848dc82014-10-13 18:51:53 -07007173 * Whether the user wants to be prompted for password to decrypt the device on boot.
7174 * This only matters if the storage is encrypted.
7175 * <p>
7176 * Type: int (0 for false, 1 for true)
7177 * @hide
7178 */
7179 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
7180
7181 /**
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05007182 * Whether the Volte/VT is enabled
7183 * <p>
7184 * Type: int (0 for false, 1 for true)
7185 * @hide
7186 */
Etan Cohene41a9cf2014-10-22 10:50:46 -07007187 public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled";
Libin.Tang@motorola.com0499bb52014-10-10 14:55:57 -05007188
7189 /**
Etan Cohen9c8f21b2014-12-23 15:02:19 -08007190 * Whether WFC is enabled
7191 * <p>
7192 * Type: int (0 for false, 1 for true)
7193 *
7194 * @hide
7195 */
7196 public static final String WFC_IMS_ENABLED = "wfc_ims_enabled";
7197
7198 /**
7199 * WFC Mode.
7200 * <p>
7201 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only
7202 *
7203 * @hide
7204 */
7205 public static final String WFC_IMS_MODE = "wfc_ims_mode";
7206
7207 /**
7208 * Whether WFC roaming is enabled
7209 * <p>
7210 * Type: int (0 for false, 1 for true)
7211 *
7212 * @hide
7213 */
7214 public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled";
7215
7216 /**
Etan Cohen7ab0ad12014-11-24 11:18:01 -08007217 * Global override to disable VoLTE (independent of user setting)
7218 * <p>
7219 * Type: int (1 for disable VoLTE, 0 to use user configuration)
7220 * @hide
7221 */
7222 public static final String VOLTE_FEATURE_DISABLED = "volte_feature_disabled";
7223
7224 /**
Amit Mahajan4fea0922014-11-18 12:56:28 -08007225 * Whether user can enable/disable LTE as a preferred network. A carrier might control
7226 * this via gservices, OMA-DM, carrier app, etc.
7227 * <p>
7228 * Type: int (0 for false, 1 for true)
7229 * @hide
7230 */
7231 public static final String LTE_SERVICE_FORCED = "lte_service_forced";
7232
7233 /**
Christopher Tate66488d62012-10-02 11:58:01 -07007234 * Settings to backup. This is here so that it's in the same place as the settings
7235 * keys and easy to update.
7236 *
7237 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
7238 * and Secure as well. This is because those tables drive both backup and
7239 * restore, and restore needs to properly whitelist keys that used to live
7240 * in those namespaces. The keys will only actually be backed up / restored
7241 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
7242 *
7243 * NOTE: Settings are backed up and restored in the order they appear
7244 * in this array. If you have one setting depending on another,
7245 * make sure that they are ordered appropriately.
7246 *
7247 * @hide
7248 */
7249 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08007250 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -07007251 STAY_ON_WHILE_PLUGGED_IN,
Christopher Tate66488d62012-10-02 11:58:01 -07007252 AUTO_TIME,
7253 AUTO_TIME_ZONE,
7254 POWER_SOUNDS_ENABLED,
7255 DOCK_SOUNDS_ENABLED,
7256 USB_MASS_STORAGE_ENABLED,
7257 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
7258 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
7259 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
Christopher Tate16eb7cd2012-10-09 15:26:30 -07007260 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07007261 WIFI_NUM_OPEN_NETWORKS_KEPT,
7262 EMERGENCY_TONE,
7263 CALL_AUTO_RETRY,
Amith Yamasani94005242014-10-31 11:35:13 -07007264 DOCK_AUDIO_MEDIA_ENABLED,
7265 LOW_POWER_MODE_TRIGGER_LEVEL
Christopher Tate66488d62012-10-02 11:58:01 -07007266 };
7267
Christopher Tate06efb532012-08-24 15:29:27 -07007268 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07007269 private static NameValueCache sNameValueCache = new NameValueCache(
7270 SYS_PROP_SETTING_VERSION,
7271 CONTENT_URI,
7272 CALL_METHOD_GET_GLOBAL,
7273 CALL_METHOD_PUT_GLOBAL);
Christopher Tate06efb532012-08-24 15:29:27 -07007274
Christopher Tateaa036a22014-05-19 16:33:27 -07007275 // Certain settings have been moved from global to the per-user secure namespace
7276 private static final HashSet<String> MOVED_TO_SECURE;
7277 static {
7278 MOVED_TO_SECURE = new HashSet<String>(1);
7279 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS);
7280 }
7281
Svetoslav683914b2015-01-15 14:22:26 -08007282 /** @hide */
7283 public static void getMovedToSecureSettings(Set<String> outKeySet) {
7284 outKeySet.addAll(MOVED_TO_SECURE);
7285 }
7286
Christopher Tate06efb532012-08-24 15:29:27 -07007287 /**
7288 * Look up a name in the database.
7289 * @param resolver to access the database with
7290 * @param name to look up in the table
7291 * @return the corresponding value, or null if not present
7292 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07007293 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07007294 return getStringForUser(resolver, name, UserHandle.myUserId());
7295 }
7296
7297 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07007298 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07007299 int userHandle) {
Christopher Tateaa036a22014-05-19 16:33:27 -07007300 if (MOVED_TO_SECURE.contains(name)) {
7301 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
7302 + " to android.provider.Settings.Secure, returning read-only value.");
7303 return Secure.getStringForUser(resolver, name, userHandle);
7304 }
Christopher Tate06efb532012-08-24 15:29:27 -07007305 return sNameValueCache.getStringForUser(resolver, name, userHandle);
7306 }
7307
7308 /**
7309 * Store a name/value pair into the database.
7310 * @param resolver to access the database with
7311 * @param name to store
7312 * @param value to associate with the name
7313 * @return true if the value was set, false on database errors
7314 */
7315 public static boolean putString(ContentResolver resolver,
7316 String name, String value) {
7317 return putStringForUser(resolver, name, value, UserHandle.myUserId());
7318 }
7319
7320 /** @hide */
7321 public static boolean putStringForUser(ContentResolver resolver,
7322 String name, String value, int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07007323 if (LOCAL_LOGV) {
7324 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
7325 + " for " + userHandle);
7326 }
Christopher Tateaa036a22014-05-19 16:33:27 -07007327 // Global and Secure have the same access policy so we can forward writes
7328 if (MOVED_TO_SECURE.contains(name)) {
7329 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global"
7330 + " to android.provider.Settings.Secure, value is unchanged.");
7331 return Secure.putStringForUser(resolver, name, value, userHandle);
7332 }
Christopher Tate06efb532012-08-24 15:29:27 -07007333 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
7334 }
7335
7336 /**
7337 * Construct the content URI for a particular name/value pair,
7338 * useful for monitoring changes with a ContentObserver.
7339 * @param name to look up in the table
7340 * @return the corresponding content URI, or null if not present
7341 */
7342 public static Uri getUriFor(String name) {
7343 return getUriFor(CONTENT_URI, name);
7344 }
7345
7346 /**
7347 * Convenience function for retrieving a single secure settings value
7348 * as an integer. Note that internally setting values are always
7349 * stored as strings; this function converts the string to an integer
7350 * for you. The default value will be returned if the setting is
7351 * not defined or not an integer.
7352 *
7353 * @param cr The ContentResolver to access.
7354 * @param name The name of the setting to retrieve.
7355 * @param def Value to return if the setting is not defined.
7356 *
7357 * @return The setting's current value, or 'def' if it is not defined
7358 * or not a valid integer.
7359 */
7360 public static int getInt(ContentResolver cr, String name, int def) {
7361 String v = getString(cr, name);
7362 try {
7363 return v != null ? Integer.parseInt(v) : def;
7364 } catch (NumberFormatException e) {
7365 return def;
7366 }
7367 }
7368
7369 /**
7370 * Convenience function for retrieving a single secure settings value
7371 * as an integer. Note that internally setting values are always
7372 * stored as strings; this function converts the string to an integer
7373 * for you.
7374 * <p>
7375 * This version does not take a default value. If the setting has not
7376 * been set, or the string value is not a number,
7377 * it throws {@link SettingNotFoundException}.
7378 *
7379 * @param cr The ContentResolver to access.
7380 * @param name The name of the setting to retrieve.
7381 *
7382 * @throws SettingNotFoundException Thrown if a setting by the given
7383 * name can't be found or the setting value is not an integer.
7384 *
7385 * @return The setting's current value.
7386 */
7387 public static int getInt(ContentResolver cr, String name)
7388 throws SettingNotFoundException {
7389 String v = getString(cr, name);
7390 try {
7391 return Integer.parseInt(v);
7392 } catch (NumberFormatException e) {
7393 throw new SettingNotFoundException(name);
7394 }
7395 }
7396
7397 /**
7398 * Convenience function for updating a single settings value as an
7399 * integer. This will either create a new entry in the table if the
7400 * given name does not exist, or modify the value of the existing row
7401 * with that name. Note that internally setting values are always
7402 * stored as strings, so this function converts the given value to a
7403 * string before storing it.
7404 *
7405 * @param cr The ContentResolver to access.
7406 * @param name The name of the setting to modify.
7407 * @param value The new value for the setting.
7408 * @return true if the value was set, false on database errors
7409 */
7410 public static boolean putInt(ContentResolver cr, String name, int value) {
7411 return putString(cr, name, Integer.toString(value));
7412 }
7413
7414 /**
7415 * Convenience function for retrieving a single secure settings value
7416 * as a {@code long}. Note that internally setting values are always
7417 * stored as strings; this function converts the string to a {@code long}
7418 * for you. The default value will be returned if the setting is
7419 * not defined or not a {@code long}.
7420 *
7421 * @param cr The ContentResolver to access.
7422 * @param name The name of the setting to retrieve.
7423 * @param def Value to return if the setting is not defined.
7424 *
7425 * @return The setting's current value, or 'def' if it is not defined
7426 * or not a valid {@code long}.
7427 */
7428 public static long getLong(ContentResolver cr, String name, long def) {
7429 String valString = getString(cr, name);
7430 long value;
7431 try {
7432 value = valString != null ? Long.parseLong(valString) : def;
7433 } catch (NumberFormatException e) {
7434 value = def;
7435 }
7436 return value;
7437 }
7438
7439 /**
7440 * Convenience function for retrieving a single secure settings value
7441 * as a {@code long}. Note that internally setting values are always
7442 * stored as strings; this function converts the string to a {@code long}
7443 * for you.
7444 * <p>
7445 * This version does not take a default value. If the setting has not
7446 * been set, or the string value is not a number,
7447 * it throws {@link SettingNotFoundException}.
7448 *
7449 * @param cr The ContentResolver to access.
7450 * @param name The name of the setting to retrieve.
7451 *
7452 * @return The setting's current value.
7453 * @throws SettingNotFoundException Thrown if a setting by the given
7454 * name can't be found or the setting value is not an integer.
7455 */
7456 public static long getLong(ContentResolver cr, String name)
7457 throws SettingNotFoundException {
7458 String valString = getString(cr, name);
7459 try {
7460 return Long.parseLong(valString);
7461 } catch (NumberFormatException e) {
7462 throw new SettingNotFoundException(name);
7463 }
7464 }
7465
7466 /**
7467 * Convenience function for updating a secure settings value as a long
7468 * integer. This will either create a new entry in the table if the
7469 * given name does not exist, or modify the value of the existing row
7470 * with that name. Note that internally setting values are always
7471 * stored as strings, so this function converts the given value to a
7472 * string before storing it.
7473 *
7474 * @param cr The ContentResolver to access.
7475 * @param name The name of the setting to modify.
7476 * @param value The new value for the setting.
7477 * @return true if the value was set, false on database errors
7478 */
7479 public static boolean putLong(ContentResolver cr, String name, long value) {
7480 return putString(cr, name, Long.toString(value));
7481 }
7482
7483 /**
7484 * Convenience function for retrieving a single secure settings value
7485 * as a floating point number. Note that internally setting values are
7486 * always stored as strings; this function converts the string to an
7487 * float for you. The default value will be returned if the setting
7488 * is not defined or not a valid float.
7489 *
7490 * @param cr The ContentResolver to access.
7491 * @param name The name of the setting to retrieve.
7492 * @param def Value to return if the setting is not defined.
7493 *
7494 * @return The setting's current value, or 'def' if it is not defined
7495 * or not a valid float.
7496 */
7497 public static float getFloat(ContentResolver cr, String name, float def) {
7498 String v = getString(cr, name);
7499 try {
7500 return v != null ? Float.parseFloat(v) : def;
7501 } catch (NumberFormatException e) {
7502 return def;
7503 }
7504 }
7505
7506 /**
7507 * Convenience function for retrieving a single secure settings value
7508 * as a float. Note that internally setting values are always
7509 * stored as strings; this function converts the string to a float
7510 * for you.
7511 * <p>
7512 * This version does not take a default value. If the setting has not
7513 * been set, or the string value is not a number,
7514 * it throws {@link SettingNotFoundException}.
7515 *
7516 * @param cr The ContentResolver to access.
7517 * @param name The name of the setting to retrieve.
7518 *
7519 * @throws SettingNotFoundException Thrown if a setting by the given
7520 * name can't be found or the setting value is not a float.
7521 *
7522 * @return The setting's current value.
7523 */
7524 public static float getFloat(ContentResolver cr, String name)
7525 throws SettingNotFoundException {
7526 String v = getString(cr, name);
7527 if (v == null) {
7528 throw new SettingNotFoundException(name);
7529 }
7530 try {
7531 return Float.parseFloat(v);
7532 } catch (NumberFormatException e) {
7533 throw new SettingNotFoundException(name);
7534 }
7535 }
7536
7537 /**
7538 * Convenience function for updating a single settings value as a
7539 * floating point number. This will either create a new entry in the
7540 * table if the given name does not exist, or modify the value of the
7541 * existing row with that name. Note that internally setting values
7542 * are always stored as strings, so this function converts the given
7543 * value to a string before storing it.
7544 *
7545 * @param cr The ContentResolver to access.
7546 * @param name The name of the setting to modify.
7547 * @param value The new value for the setting.
7548 * @return true if the value was set, false on database errors
7549 */
7550 public static boolean putFloat(ContentResolver cr, String name, float value) {
7551 return putString(cr, name, Float.toString(value));
7552 }
Wink Savillefb40dd42014-06-12 17:02:31 -07007553
7554
7555 /**
7556 * Subscription to be used for voice call on a multi sim device. The supported values
7557 * are 0 = SUB1, 1 = SUB2 and etc.
7558 * @hide
7559 */
7560 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call";
7561
7562 /**
7563 * Used to provide option to user to select subscription during dial.
7564 * The supported values are 0 = disable or 1 = enable prompt.
7565 * @hide
7566 */
7567 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt";
7568
7569 /**
7570 * Subscription to be used for data call on a multi sim device. The supported values
7571 * are 0 = SUB1, 1 = SUB2 and etc.
7572 * @hide
7573 */
7574 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
7575
7576 /**
7577 * Subscription to be used for SMS on a multi sim device. The supported values
7578 * are 0 = SUB1, 1 = SUB2 and etc.
7579 * @hide
7580 */
7581 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
7582
7583 /**
7584 * Used to provide option to user to select subscription during send SMS.
7585 * The value 1 - enable, 0 - disable
7586 * @hide
7587 */
7588 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt";
7589
7590
7591
7592 /** User preferred subscriptions setting.
7593 * This holds the details of the user selected subscription from the card and
7594 * the activation status. Each settings string have the coma separated values
7595 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index
7596 * @hide
7597 */
7598 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1",
7599 "user_preferred_sub2","user_preferred_sub3"};
Christopher Tate06efb532012-08-24 15:29:27 -07007600 }
7601
7602 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007603 * User-defined bookmarks and shortcuts. The target of each bookmark is an
7604 * Intent URL, allowing it to be either a web page or a particular
7605 * application activity.
7606 *
7607 * @hide
7608 */
7609 public static final class Bookmarks implements BaseColumns
7610 {
7611 private static final String TAG = "Bookmarks";
7612
7613 /**
7614 * The content:// style URL for this table
7615 */
7616 public static final Uri CONTENT_URI =
7617 Uri.parse("content://" + AUTHORITY + "/bookmarks");
7618
7619 /**
7620 * The row ID.
7621 * <p>Type: INTEGER</p>
7622 */
7623 public static final String ID = "_id";
7624
7625 /**
7626 * Descriptive name of the bookmark that can be displayed to the user.
7627 * If this is empty, the title should be resolved at display time (use
7628 * {@link #getTitle(Context, Cursor)} any time you want to display the
7629 * title of a bookmark.)
7630 * <P>
7631 * Type: TEXT
7632 * </P>
7633 */
7634 public static final String TITLE = "title";
7635
7636 /**
7637 * Arbitrary string (displayed to the user) that allows bookmarks to be
7638 * organized into categories. There are some special names for
7639 * standard folders, which all start with '@'. The label displayed for
7640 * the folder changes with the locale (via {@link #getLabelForFolder}) but
7641 * the folder name does not change so you can consistently query for
7642 * the folder regardless of the current locale.
7643 *
7644 * <P>Type: TEXT</P>
7645 *
7646 */
7647 public static final String FOLDER = "folder";
7648
7649 /**
7650 * The Intent URL of the bookmark, describing what it points to. This
7651 * value is given to {@link android.content.Intent#getIntent} to create
7652 * an Intent that can be launched.
7653 * <P>Type: TEXT</P>
7654 */
7655 public static final String INTENT = "intent";
7656
7657 /**
7658 * Optional shortcut character associated with this bookmark.
7659 * <P>Type: INTEGER</P>
7660 */
7661 public static final String SHORTCUT = "shortcut";
7662
7663 /**
7664 * The order in which the bookmark should be displayed
7665 * <P>Type: INTEGER</P>
7666 */
7667 public static final String ORDERING = "ordering";
7668
7669 private static final String[] sIntentProjection = { INTENT };
7670 private static final String[] sShortcutProjection = { ID, SHORTCUT };
7671 private static final String sShortcutSelection = SHORTCUT + "=?";
7672
7673 /**
7674 * Convenience function to retrieve the bookmarked Intent for a
7675 * particular shortcut key.
7676 *
7677 * @param cr The ContentResolver to query.
7678 * @param shortcut The shortcut key.
7679 *
7680 * @return Intent The bookmarked URL, or null if there is no bookmark
7681 * matching the given shortcut.
7682 */
7683 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
7684 {
7685 Intent intent = null;
7686
7687 Cursor c = cr.query(CONTENT_URI,
7688 sIntentProjection, sShortcutSelection,
7689 new String[] { String.valueOf((int) shortcut) }, ORDERING);
7690 // Keep trying until we find a valid shortcut
7691 try {
7692 while (intent == null && c.moveToNext()) {
7693 try {
7694 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02007695 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007696 } catch (java.net.URISyntaxException e) {
7697 // The stored URL is bad... ignore it.
7698 } catch (IllegalArgumentException e) {
7699 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07007700 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007701 }
7702 }
7703 } finally {
7704 if (c != null) c.close();
7705 }
7706
7707 return intent;
7708 }
7709
7710 /**
7711 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007712 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007713 * @param cr The ContentResolver to query.
7714 * @param intent The desired target of the bookmark.
7715 * @param title Bookmark title that is shown to the user; null if none
7716 * or it should be resolved to the intent's title.
7717 * @param folder Folder in which to place the bookmark; null if none.
7718 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
7719 * this is non-zero and there is an existing bookmark entry
7720 * with this same shortcut, then that existing shortcut is
7721 * cleared (the bookmark is not removed).
7722 * @return The unique content URL for the new bookmark entry.
7723 */
7724 public static Uri add(ContentResolver cr,
7725 Intent intent,
7726 String title,
7727 String folder,
7728 char shortcut,
7729 int ordering)
7730 {
7731 // If a shortcut is supplied, and it is already defined for
7732 // another bookmark, then remove the old definition.
7733 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05007734 cr.delete(CONTENT_URI, sShortcutSelection,
7735 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007736 }
7737
7738 ContentValues values = new ContentValues();
7739 if (title != null) values.put(TITLE, title);
7740 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07007741 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007742 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
7743 values.put(ORDERING, ordering);
7744 return cr.insert(CONTENT_URI, values);
7745 }
7746
7747 /**
7748 * Return the folder name as it should be displayed to the user. This
7749 * takes care of localizing special folders.
7750 *
7751 * @param r Resources object for current locale; only need access to
7752 * system resources.
7753 * @param folder The value found in the {@link #FOLDER} column.
7754 *
7755 * @return CharSequence The label for this folder that should be shown
7756 * to the user.
7757 */
7758 public static CharSequence getLabelForFolder(Resources r, String folder) {
7759 return folder;
7760 }
7761
7762 /**
7763 * Return the title as it should be displayed to the user. This takes
7764 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007765 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007766 * @param context A context.
7767 * @param cursor A cursor pointing to the row whose title should be
7768 * returned. The cursor must contain at least the {@link #TITLE}
7769 * and {@link #INTENT} columns.
7770 * @return A title that is localized and can be displayed to the user,
7771 * or the empty string if one could not be found.
7772 */
7773 public static CharSequence getTitle(Context context, Cursor cursor) {
7774 int titleColumn = cursor.getColumnIndex(TITLE);
7775 int intentColumn = cursor.getColumnIndex(INTENT);
7776 if (titleColumn == -1 || intentColumn == -1) {
7777 throw new IllegalArgumentException(
7778 "The cursor must contain the TITLE and INTENT columns.");
7779 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007780
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007781 String title = cursor.getString(titleColumn);
7782 if (!TextUtils.isEmpty(title)) {
7783 return title;
7784 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007785
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007786 String intentUri = cursor.getString(intentColumn);
7787 if (TextUtils.isEmpty(intentUri)) {
7788 return "";
7789 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007790
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007791 Intent intent;
7792 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02007793 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007794 } catch (URISyntaxException e) {
7795 return "";
7796 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07007797
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007798 PackageManager packageManager = context.getPackageManager();
7799 ResolveInfo info = packageManager.resolveActivity(intent, 0);
7800 return info != null ? info.loadLabel(packageManager) : "";
7801 }
7802 }
7803
7804 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007805 * Returns the device ID that we should use when connecting to the mobile gtalk server.
7806 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
7807 * from the GoogleLoginService.
7808 *
7809 * @param androidId The Android ID for this device.
7810 * @return The device ID that should be used when connecting to the mobile gtalk server.
7811 * @hide
7812 */
7813 public static String getGTalkDeviceId(long androidId) {
7814 return "android-" + Long.toHexString(androidId);
7815 }
7816}