blob: 3c8187eba96dab1f8375d19cc7bc285e2442381e [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;
Narayan Kamathee69ff42011-06-28 12:07:18 +010021import android.app.SearchManager;
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070022import android.app.WallpaperManager;
Mike LeBeau5d34e9b2010-02-10 19:34:56 -080023import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080024import android.content.ContentResolver;
25import android.content.ContentValues;
26import android.content.Context;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -080027import android.content.IContentProvider;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080028import android.content.Intent;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -080029import android.content.pm.ActivityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030import android.content.pm.PackageManager;
31import android.content.pm.ResolveInfo;
32import android.content.res.Configuration;
33import android.content.res.Resources;
34import android.database.Cursor;
35import android.database.SQLException;
Jeff Sharkey625239a2012-09-26 22:03:49 -070036import android.net.ConnectivityManager;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080037import android.net.Uri;
Irfan Sheriff36f74132010-11-04 16:57:37 -070038import android.net.wifi.WifiManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070039import android.os.BatteryManager;
40import android.os.Bundle;
Jeff Sharkey625239a2012-09-26 22:03:49 -070041import android.os.DropBoxManager;
Amith Yamasani52c489c2012-03-28 11:42:42 -070042import android.os.IBinder;
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -070043import android.os.Process;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070044import android.os.RemoteException;
Amith Yamasani52c489c2012-03-28 11:42:42 -070045import android.os.ServiceManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070046import android.os.SystemProperties;
Dianne Hackbornf02b60a2012-08-16 10:48:27 -070047import android.os.UserHandle;
Jeff Sharkey625239a2012-09-26 22:03:49 -070048import android.os.Build.VERSION_CODES;
Narayan Kamath6d632962011-08-24 11:51:37 +010049import android.speech.tts.TextToSpeech;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080050import android.text.TextUtils;
51import android.util.AndroidException;
52import android.util.Log;
53
Amith Yamasani52c489c2012-03-28 11:42:42 -070054import com.android.internal.widget.ILockSettings;
55
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056import java.net.URISyntaxException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080057import java.util.HashMap;
58import java.util.HashSet;
59
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080060/**
61 * The Settings provider contains global system-level device preferences.
62 */
63public final class Settings {
64
65 // Intent actions for Settings
66
67 /**
68 * Activity Action: Show system settings.
69 * <p>
70 * Input: Nothing.
71 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070072 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080073 */
74 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
75 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
76
77 /**
78 * Activity Action: Show settings to allow configuration of APNs.
79 * <p>
80 * Input: Nothing.
81 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070082 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080083 */
84 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
85 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
86
87 /**
88 * Activity Action: Show settings to allow configuration of current location
89 * sources.
90 * <p>
91 * In some cases, a matching Activity may not exist, so ensure you
92 * safeguard against this.
93 * <p>
94 * Input: Nothing.
95 * <p>
96 * Output: Nothing.
97 */
98 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
99 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
100 "android.settings.LOCATION_SOURCE_SETTINGS";
101
102 /**
103 * Activity Action: Show settings to allow configuration of wireless controls
104 * such as Wi-Fi, Bluetooth and Mobile networks.
105 * <p>
106 * In some cases, a matching Activity may not exist, so ensure you
107 * safeguard against this.
108 * <p>
109 * Input: Nothing.
110 * <p>
111 * Output: Nothing.
112 */
113 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
114 public static final String ACTION_WIRELESS_SETTINGS =
115 "android.settings.WIRELESS_SETTINGS";
116
117 /**
118 * Activity Action: Show settings to allow entering/exiting airplane mode.
119 * <p>
120 * In some cases, a matching Activity may not exist, so ensure you
121 * safeguard against this.
122 * <p>
123 * Input: Nothing.
124 * <p>
125 * Output: Nothing.
126 */
127 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
128 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
129 "android.settings.AIRPLANE_MODE_SETTINGS";
130
131 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700132 * Activity Action: Show settings for accessibility modules.
133 * <p>
134 * In some cases, a matching Activity may not exist, so ensure you
135 * safeguard against this.
136 * <p>
137 * Input: Nothing.
138 * <p>
139 * Output: Nothing.
140 */
141 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
142 public static final String ACTION_ACCESSIBILITY_SETTINGS =
143 "android.settings.ACCESSIBILITY_SETTINGS";
144
145 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800146 * Activity Action: Show settings to allow configuration of security and
147 * location privacy.
148 * <p>
149 * In some cases, a matching Activity may not exist, so ensure you
150 * safeguard against this.
151 * <p>
152 * Input: Nothing.
153 * <p>
154 * Output: Nothing.
155 */
156 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
157 public static final String ACTION_SECURITY_SETTINGS =
158 "android.settings.SECURITY_SETTINGS";
159
160 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700161 * Activity Action: Show settings to allow configuration of privacy options.
162 * <p>
163 * In some cases, a matching Activity may not exist, so ensure you
164 * safeguard against this.
165 * <p>
166 * Input: Nothing.
167 * <p>
168 * Output: Nothing.
169 */
170 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
171 public static final String ACTION_PRIVACY_SETTINGS =
172 "android.settings.PRIVACY_SETTINGS";
173
174 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800175 * Activity Action: Show settings to allow configuration of Wi-Fi.
176
177 * <p>
178 * In some cases, a matching Activity may not exist, so ensure you
179 * safeguard against this.
180 * <p>
181 * Input: Nothing.
182 * <p>
183 * Output: Nothing.
184
185 */
186 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
187 public static final String ACTION_WIFI_SETTINGS =
188 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700189
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800190 /**
191 * Activity Action: Show settings to allow configuration of a static IP
192 * address for Wi-Fi.
193 * <p>
194 * In some cases, a matching Activity may not exist, so ensure you safeguard
195 * against this.
196 * <p>
197 * Input: Nothing.
198 * <p>
199 * Output: Nothing.
200 */
201 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
202 public static final String ACTION_WIFI_IP_SETTINGS =
203 "android.settings.WIFI_IP_SETTINGS";
204
205 /**
206 * Activity Action: Show settings to allow configuration of Bluetooth.
207 * <p>
208 * In some cases, a matching Activity may not exist, so ensure you
209 * safeguard against this.
210 * <p>
211 * Input: Nothing.
212 * <p>
213 * Output: Nothing.
214 */
215 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
216 public static final String ACTION_BLUETOOTH_SETTINGS =
217 "android.settings.BLUETOOTH_SETTINGS";
218
219 /**
Jeff Brown89d55462012-09-19 11:33:42 -0700220 * Activity Action: Show settings to allow configuration of Wifi Displays.
221 * <p>
222 * In some cases, a matching Activity may not exist, so ensure you
223 * safeguard against this.
224 * <p>
225 * Input: Nothing.
226 * <p>
227 * Output: Nothing.
228 * @hide
229 */
230 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
231 public static final String ACTION_WIFI_DISPLAY_SETTINGS =
232 "android.settings.WIFI_DISPLAY_SETTINGS";
233
234 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800235 * Activity Action: Show settings to allow configuration of date and time.
236 * <p>
237 * In some cases, a matching Activity may not exist, so ensure you
238 * safeguard against this.
239 * <p>
240 * Input: Nothing.
241 * <p>
242 * Output: Nothing.
243 */
244 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
245 public static final String ACTION_DATE_SETTINGS =
246 "android.settings.DATE_SETTINGS";
247
248 /**
249 * Activity Action: Show settings to allow configuration of sound and volume.
250 * <p>
251 * In some cases, a matching Activity may not exist, so ensure you
252 * safeguard against this.
253 * <p>
254 * Input: Nothing.
255 * <p>
256 * Output: Nothing.
257 */
258 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
259 public static final String ACTION_SOUND_SETTINGS =
260 "android.settings.SOUND_SETTINGS";
261
262 /**
263 * Activity Action: Show settings to allow configuration of display.
264 * <p>
265 * In some cases, a matching Activity may not exist, so ensure you
266 * safeguard against this.
267 * <p>
268 * Input: Nothing.
269 * <p>
270 * Output: Nothing.
271 */
272 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
273 public static final String ACTION_DISPLAY_SETTINGS =
274 "android.settings.DISPLAY_SETTINGS";
275
276 /**
277 * Activity Action: Show settings to allow configuration of locale.
278 * <p>
279 * In some cases, a matching Activity may not exist, so ensure you
280 * safeguard against this.
281 * <p>
282 * Input: Nothing.
283 * <p>
284 * Output: Nothing.
285 */
286 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
287 public static final String ACTION_LOCALE_SETTINGS =
288 "android.settings.LOCALE_SETTINGS";
289
290 /**
291 * Activity Action: Show settings to configure input methods, in particular
292 * allowing the user to enable input methods.
293 * <p>
294 * In some cases, a matching Activity may not exist, so ensure you
295 * safeguard against this.
296 * <p>
297 * Input: Nothing.
298 * <p>
299 * Output: Nothing.
300 */
301 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
302 public static final String ACTION_INPUT_METHOD_SETTINGS =
303 "android.settings.INPUT_METHOD_SETTINGS";
304
305 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900306 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900307 * <p>
308 * In some cases, a matching Activity may not exist, so ensure you
309 * safeguard against this.
310 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900311 * To tell which input method's subtypes are displayed in the settings, add
312 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
313 * If there is no extra in this Intent, subtypes from all installed input methods
314 * will be displayed in the settings.
315 *
316 * @see android.view.inputmethod.InputMethodInfo#getId
317 * <p>
satok86417ea2010-10-27 14:11:03 +0900318 * Input: Nothing.
319 * <p>
320 * Output: Nothing.
321 */
322 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900323 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
324 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900325
326 /**
satok7cfc0ed2011-06-20 21:29:36 +0900327 * Activity Action: Show a dialog to select input method.
328 * <p>
329 * In some cases, a matching Activity may not exist, so ensure you
330 * safeguard against this.
331 * <p>
332 * Input: Nothing.
333 * <p>
334 * Output: Nothing.
335 * @hide
336 */
337 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
338 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
339 "android.settings.SHOW_INPUT_METHOD_PICKER";
340
341 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800342 * Activity Action: Show settings to manage the user input dictionary.
343 * <p>
344 * In some cases, a matching Activity may not exist, so ensure you
345 * safeguard against this.
346 * <p>
347 * Input: Nothing.
348 * <p>
349 * Output: Nothing.
350 */
351 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
352 public static final String ACTION_USER_DICTIONARY_SETTINGS =
353 "android.settings.USER_DICTIONARY_SETTINGS";
354
355 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700356 * Activity Action: Adds a word to the user dictionary.
357 * <p>
358 * In some cases, a matching Activity may not exist, so ensure you
359 * safeguard against this.
360 * <p>
361 * Input: An extra with key <code>word</code> that contains the word
362 * that should be added to the dictionary.
363 * <p>
364 * Output: Nothing.
365 *
366 * @hide
367 */
368 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
369 public static final String ACTION_USER_DICTIONARY_INSERT =
370 "com.android.settings.USER_DICTIONARY_INSERT";
371
372 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800373 * Activity Action: Show settings to allow configuration of application-related settings.
374 * <p>
375 * In some cases, a matching Activity may not exist, so ensure you
376 * safeguard against this.
377 * <p>
378 * Input: Nothing.
379 * <p>
380 * Output: Nothing.
381 */
382 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
383 public static final String ACTION_APPLICATION_SETTINGS =
384 "android.settings.APPLICATION_SETTINGS";
385
386 /**
387 * Activity Action: Show settings to allow configuration of application
Dianne Hackborn8d866e52012-10-10 18:39:45 -0700388 * development-related settings. As of
389 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
390 * a required part of the platform.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800391 * <p>
392 * Input: Nothing.
393 * <p>
394 * Output: Nothing.
395 */
396 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
397 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
398 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
399
400 /**
401 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
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)
411 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
412 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700413
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800414 /**
415 * Activity Action: Show settings to manage installed applications.
416 * <p>
417 * In some cases, a matching Activity may not exist, so ensure you
418 * safeguard against this.
419 * <p>
420 * Input: Nothing.
421 * <p>
422 * Output: Nothing.
423 */
424 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
425 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
426 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700427
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800428 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700429 * Activity Action: Show settings to manage all applications.
430 * <p>
431 * In some cases, a matching Activity may not exist, so ensure you
432 * safeguard against this.
433 * <p>
434 * Input: Nothing.
435 * <p>
436 * Output: Nothing.
437 */
438 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
439 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
440 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
441
442 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700443 * Activity Action: Show screen of details about a particular application.
444 * <p>
445 * In some cases, a matching Activity may not exist, so ensure you
446 * safeguard against this.
447 * <p>
448 * Input: The Intent's data URI specifies the application package name
449 * to be shown, with the "package" scheme. That is "package:com.my.app".
450 * <p>
451 * Output: Nothing.
452 */
453 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
454 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
455 "android.settings.APPLICATION_DETAILS_SETTINGS";
456
457 /**
Dianne Hackborn35654b62013-01-14 17:38:02 -0800458 * @hide
459 * Activity Action: Show the "app ops" settings screen.
460 * <p>
461 * Input: Nothing.
462 * <p>
463 * Output: Nothing.
464 */
465 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
466 public static final String ACTION_APP_OPS_SETTINGS =
467 "android.settings.APP_OPS_SETTINGS";
468
469 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800470 * Activity Action: Show settings for system update functionality.
471 * <p>
472 * In some cases, a matching Activity may not exist, so ensure you
473 * safeguard against this.
474 * <p>
475 * Input: Nothing.
476 * <p>
477 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700478 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800479 * @hide
480 */
481 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
482 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
483 "android.settings.SYSTEM_UPDATE_SETTINGS";
484
485 /**
486 * Activity Action: Show settings to allow configuration of sync settings.
487 * <p>
488 * In some cases, a matching Activity may not exist, so ensure you
489 * safeguard against this.
490 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800491 * The account types available to add via the add account button may be restricted by adding an
492 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
493 * authorities. Only account types which can sync with that content provider will be offered to
494 * the user.
495 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800496 * Input: Nothing.
497 * <p>
498 * Output: Nothing.
499 */
500 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
501 public static final String ACTION_SYNC_SETTINGS =
502 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700503
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800504 /**
Erikeebc8e22010-02-18 13:27:19 -0800505 * Activity Action: Show add account screen for creating a new account.
506 * <p>
507 * In some cases, a matching Activity may not exist, so ensure you
508 * safeguard against this.
509 * <p>
510 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
511 * extra to the Intent with one or more syncable content provider's authorities. Only account
512 * types which can sync with that content provider will be offered to the user.
513 * <p>
Alon Albert50359c22013-02-26 14:47:48 -0800514 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
515 * Intent with one or more account types.
516 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800517 * Input: Nothing.
518 * <p>
519 * Output: Nothing.
520 */
521 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
522 public static final String ACTION_ADD_ACCOUNT =
523 "android.settings.ADD_ACCOUNT_SETTINGS";
524
525 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800526 * Activity Action: Show settings for selecting the network operator.
527 * <p>
528 * In some cases, a matching Activity may not exist, so ensure you
529 * safeguard against this.
530 * <p>
531 * Input: Nothing.
532 * <p>
533 * Output: Nothing.
534 */
535 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
536 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
537 "android.settings.NETWORK_OPERATOR_SETTINGS";
538
539 /**
540 * Activity Action: Show settings for selection of 2G/3G.
541 * <p>
542 * In some cases, a matching Activity may not exist, so ensure you
543 * safeguard against this.
544 * <p>
545 * Input: Nothing.
546 * <p>
547 * Output: Nothing.
548 */
549 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
550 public static final String ACTION_DATA_ROAMING_SETTINGS =
551 "android.settings.DATA_ROAMING_SETTINGS";
552
553 /**
554 * Activity Action: Show settings for internal storage.
555 * <p>
556 * In some cases, a matching Activity may not exist, so ensure you
557 * safeguard against this.
558 * <p>
559 * Input: Nothing.
560 * <p>
561 * Output: Nothing.
562 */
563 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
564 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
565 "android.settings.INTERNAL_STORAGE_SETTINGS";
566 /**
567 * Activity Action: Show settings for memory card storage.
568 * <p>
569 * In some cases, a matching Activity may not exist, so ensure you
570 * safeguard against this.
571 * <p>
572 * Input: Nothing.
573 * <p>
574 * Output: Nothing.
575 */
576 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
577 public static final String ACTION_MEMORY_CARD_SETTINGS =
578 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700579
Justin Mattsonef340352010-01-13 21:05:46 -0800580 /**
581 * Activity Action: Show settings for global search.
582 * <p>
583 * In some cases, a matching Activity may not exist, so ensure you
584 * safeguard against this.
585 * <p>
586 * Input: Nothing.
587 * <p>
588 * Output: Nothing
589 */
590 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
591 public static final String ACTION_SEARCH_SETTINGS =
592 "android.search.action.SEARCH_SETTINGS";
593
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500594 /**
595 * Activity Action: Show general device information settings (serial
596 * number, software version, phone number, etc.).
597 * <p>
598 * In some cases, a matching Activity may not exist, so ensure you
599 * safeguard against this.
600 * <p>
601 * Input: Nothing.
602 * <p>
603 * Output: Nothing
604 */
605 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
606 public static final String ACTION_DEVICE_INFO_SETTINGS =
607 "android.settings.DEVICE_INFO_SETTINGS";
608
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500609 /**
Nick Pellycccf01d2011-10-31 14:49:40 -0700610 * Activity Action: Show NFC settings.
611 * <p>
612 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500613 * <p>
614 * In some cases, a matching Activity may not exist, so ensure you
615 * safeguard against this.
616 * <p>
617 * Input: Nothing.
618 * <p>
619 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -0700620 * @see android.nfc.NfcAdapter#isEnabled()
621 */
622 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
623 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
624
625 /**
626 * Activity Action: Show NFC Sharing settings.
627 * <p>
628 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
629 * off.
630 * <p>
631 * In some cases, a matching Activity may not exist, so ensure you
632 * safeguard against this.
633 * <p>
634 * Input: Nothing.
635 * <p>
636 * Output: Nothing
637 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500638 */
639 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
640 public static final String ACTION_NFCSHARING_SETTINGS =
641 "android.settings.NFCSHARING_SETTINGS";
642
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500643 /**
644 * Activity Action: Show Daydream settings.
645 * <p>
646 * In some cases, a matching Activity may not exist, so ensure you
647 * safeguard against this.
648 * <p>
649 * Input: Nothing.
650 * <p>
651 * Output: Nothing.
652 * @see android.service.dreams.DreamService
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500653 */
654 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
655 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
656
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700657 /**
658 * Activity Action: Show Notification listener settings.
659 * <p>
660 * In some cases, a matching Activity may not exist, so ensure you
661 * safeguard against this.
662 * <p>
663 * Input: Nothing.
664 * <p>
665 * Output: Nothing.
666 * @see android.service.notification.NotificationListenerService
667 * @hide
668 */
669 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
670 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
671 = "android.settings.NOTIFICATION_LISTENER_SETTINGS";
672
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800673 // End of Intent actions for Settings
674
Erikeebc8e22010-02-18 13:27:19 -0800675 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800676 * @hide - Private call() method on SettingsProvider to read from 'system' table.
677 */
678 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
679
680 /**
681 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
682 */
683 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
684
685 /**
Christopher Tate06efb532012-08-24 15:29:27 -0700686 * @hide - Private call() method on SettingsProvider to read from 'global' table.
687 */
688 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
689
690 /**
691 * @hide - User handle argument extra to the fast-path call()-based requests
692 */
693 public static final String CALL_METHOD_USER_KEY = "_user";
694
695 /** @hide - Private call() method to write to 'system' table */
696 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
697
698 /** @hide - Private call() method to write to 'secure' table */
699 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
700
701 /** @hide - Private call() method to write to 'global' table */
702 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
703
704 /**
Erikeebc8e22010-02-18 13:27:19 -0800705 * Activity Extra: Limit available options in launched activity based on the given authority.
706 * <p>
707 * This can be passed as an extra field in an Activity Intent with one or more syncable content
708 * provider's authorities as a String[]. This field is used by some intents to alter the
709 * behavior of the called activity.
710 * <p>
711 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
712 * on the authority given.
713 */
Alon Albert50359c22013-02-26 14:47:48 -0800714 public static final String EXTRA_AUTHORITIES = "authorities";
715
Alon Albertd35bf1f2013-04-18 14:26:51 -0700716 /**
717 * Activity Extra: Limit available options in launched activity based on the given account
718 * types.
719 * <p>
720 * This can be passed as an extra field in an Activity Intent with one or more account types
721 * as a String[]. This field is used by some intents to alter the behavior of the called
722 * activity.
723 * <p>
724 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
725 * list.
726 */
Alon Albert50359c22013-02-26 14:47:48 -0800727 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
Erikeebc8e22010-02-18 13:27:19 -0800728
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900729 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
730
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800731 private static final String JID_RESOURCE_PREFIX = "android";
732
733 public static final String AUTHORITY = "settings";
734
735 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -0700736 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800737
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800738 public static class SettingNotFoundException extends AndroidException {
739 public SettingNotFoundException(String msg) {
740 super(msg);
741 }
742 }
743
744 /**
745 * Common base for tables of name/value settings.
746 */
747 public static class NameValueTable implements BaseColumns {
748 public static final String NAME = "name";
749 public static final String VALUE = "value";
750
751 protected static boolean putString(ContentResolver resolver, Uri uri,
752 String name, String value) {
753 // The database will take care of replacing duplicates.
754 try {
755 ContentValues values = new ContentValues();
756 values.put(NAME, name);
757 values.put(VALUE, value);
758 resolver.insert(uri, values);
759 return true;
760 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -0700761 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800762 return false;
763 }
764 }
765
766 public static Uri getUriFor(Uri uri, String name) {
767 return Uri.withAppendedPath(uri, name);
768 }
769 }
770
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800771 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800772 private static class NameValueCache {
773 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800774 private final Uri mUri;
775
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800776 private static final String[] SELECT_VALUE =
777 new String[] { Settings.NameValueTable.VALUE };
778 private static final String NAME_EQ_PLACEHOLDER = "name=?";
779
780 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -0800781 private final HashMap<String, String> mValues = new HashMap<String, String>();
782 private long mValuesVersion = 0;
783
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800784 // Initially null; set lazily and held forever. Synchronized on 'this'.
785 private IContentProvider mContentProvider = null;
786
787 // The method we'll call (or null, to not use) on the provider
788 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -0700789 private final String mCallGetCommand;
790 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800791
Christopher Tate06efb532012-08-24 15:29:27 -0700792 public NameValueCache(String versionSystemProperty, Uri uri,
793 String getCommand, String setCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800794 mVersionSystemProperty = versionSystemProperty;
795 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -0700796 mCallGetCommand = getCommand;
797 mCallSetCommand = setCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800798 }
799
Christopher Tate06efb532012-08-24 15:29:27 -0700800 private IContentProvider lazyGetProvider(ContentResolver cr) {
801 IContentProvider cp = null;
802 synchronized (this) {
803 cp = mContentProvider;
804 if (cp == null) {
805 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
806 }
807 }
808 return cp;
809 }
810
811 public boolean putStringForUser(ContentResolver cr, String name, String value,
812 final int userHandle) {
813 try {
814 Bundle arg = new Bundle();
815 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -0700816 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -0700817 IContentProvider cp = lazyGetProvider(cr);
Dianne Hackborn35654b62013-01-14 17:38:02 -0800818 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
Christopher Tate06efb532012-08-24 15:29:27 -0700819 } catch (RemoteException e) {
820 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
821 return false;
822 }
823 return true;
824 }
825
Christopher Tate06efb532012-08-24 15:29:27 -0700826 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -0700827 final boolean isSelf = (userHandle == UserHandle.myUserId());
828 if (isSelf) {
829 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -0800830
Christopher Tate78d2a662012-09-13 16:19:44 -0700831 // Our own user's settings data uses a client-side cache
832 synchronized (this) {
833 if (mValuesVersion != newValuesVersion) {
834 if (LOCAL_LOGV || false) {
835 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current "
836 + newValuesVersion + " != cached " + mValuesVersion);
837 }
838
839 mValues.clear();
840 mValuesVersion = newValuesVersion;
Dan Egnor799f7212009-11-24 16:24:44 -0800841 }
842
Christopher Tate78d2a662012-09-13 16:19:44 -0700843 if (mValues.containsKey(name)) {
844 return mValues.get(name); // Could be null, that's OK -- negative caching
845 }
Dan Egnor799f7212009-11-24 16:24:44 -0800846 }
Christopher Tate78d2a662012-09-13 16:19:44 -0700847 } else {
848 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
849 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800850 }
Dan Egnor799f7212009-11-24 16:24:44 -0800851
Christopher Tate06efb532012-08-24 15:29:27 -0700852 IContentProvider cp = lazyGetProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800853
854 // Try the fast path first, not using query(). If this
855 // fails (alternate Settings provider that doesn't support
856 // this interface?) then we fall back to the query/table
857 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -0700858 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800859 try {
Christopher Tate06efb532012-08-24 15:29:27 -0700860 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -0700861 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -0700862 args = new Bundle();
863 args.putInt(CALL_METHOD_USER_KEY, userHandle);
864 }
Dianne Hackborn35654b62013-01-14 17:38:02 -0800865 Bundle b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800866 if (b != null) {
867 String value = b.getPairValue();
Christopher Tate78d2a662012-09-13 16:19:44 -0700868 // Don't update our cache for reads of other users' data
869 if (isSelf) {
870 synchronized (this) {
871 mValues.put(name, value);
872 }
873 } else {
874 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
875 + " by " + UserHandle.myUserId()
876 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800877 }
878 return value;
879 }
880 // If the response Bundle is null, we fall through
881 // to the query interface below.
882 } catch (RemoteException e) {
883 // Not supported by the remote side? Fall through
884 // to query().
885 }
886 }
887
Dan Egnor799f7212009-11-24 16:24:44 -0800888 Cursor c = null;
889 try {
Dianne Hackborn35654b62013-01-14 17:38:02 -0800890 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
Jeff Brown75ea64f2012-01-25 19:37:13 -0800891 new String[]{name}, null, null);
Dan Egnor799f7212009-11-24 16:24:44 -0800892 if (c == null) {
893 Log.w(TAG, "Can't get key " + name + " from " + mUri);
894 return null;
895 }
896
897 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800898 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -0800899 mValues.put(name, value);
900 }
901 if (LOCAL_LOGV) {
902 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
903 name + " = " + (value == null ? "(null)" : value));
904 }
905 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800906 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -0800907 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
908 return null; // Return null, but don't cache it.
909 } finally {
910 if (c != null) c.close();
911 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800912 }
913 }
914
915 /**
916 * System settings, containing miscellaneous system preferences. This
917 * table holds simple name/value pairs. There are convenience
918 * functions for accessing individual settings entries.
919 */
920 public static final class System extends NameValueTable {
921 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
922
Dianne Hackborn139748f2012-09-24 11:36:57 -0700923 /**
924 * The content:// style URL for this table
925 */
926 public static final Uri CONTENT_URI =
927 Uri.parse("content://" + AUTHORITY + "/system");
928
929 private static final NameValueCache sNameValueCache = new NameValueCache(
930 SYS_PROP_SETTING_VERSION,
931 CONTENT_URI,
932 CALL_METHOD_GET_SYSTEM,
933 CALL_METHOD_PUT_SYSTEM);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700934
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800935 private static final HashSet<String> MOVED_TO_SECURE;
936 static {
937 MOVED_TO_SECURE = new HashSet<String>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800938 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800939 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800940 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -0400941 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -0800942 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
943 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
944 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800945 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
946 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
947 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
948 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
949 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800950 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
951 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
952 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
953 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
954 MOVED_TO_SECURE.add(Secure.WIFI_ON);
955 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
956 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
957 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
958 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
959 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
960 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
961 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
962 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
963 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
964 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
965 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
966 }
967
Christopher Tate06efb532012-08-24 15:29:27 -0700968 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -0700969 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -0700970 static {
971 MOVED_TO_GLOBAL = new HashSet<String>();
Christopher Tate66488d62012-10-02 11:58:01 -0700972 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
973
Christopher Tate92198742012-09-07 12:00:13 -0700974 // these were originally in system but migrated to secure in the past,
975 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -0700976 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
977 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
978 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
979 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
980 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.INSTALL_NON_MARKET_APPS);
981 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
982 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -0700983
Christopher Tate92198742012-09-07 12:00:13 -0700984 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -0700985 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
986 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
987 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
988 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
989 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
990 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
991 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
992 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
993 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
994 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
995 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
996 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
997 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
998 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
999 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
1000 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001001 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001002 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
1003 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
1004 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
1005 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
1006 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
1007 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
1008 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
1009 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
1010 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
1011 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
1012 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Christopher Tate06efb532012-08-24 15:29:27 -07001013 }
1014
Christopher Tate66488d62012-10-02 11:58:01 -07001015 /** @hide */
1016 public static void getMovedKeys(HashSet<String> outKeySet) {
1017 outKeySet.addAll(MOVED_TO_GLOBAL);
1018 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
1019 }
1020
1021 /** @hide */
1022 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
1023 outKeySet.addAll(MOVED_TO_GLOBAL);
1024 }
1025
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001026 /**
1027 * Look up a name in the database.
1028 * @param resolver to access the database with
1029 * @param name to look up in the table
1030 * @return the corresponding value, or null if not present
1031 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001032 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07001033 return getStringForUser(resolver, name, UserHandle.myUserId());
1034 }
1035
1036 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001037 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07001038 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001039 if (MOVED_TO_SECURE.contains(name)) {
1040 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1041 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07001042 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001043 }
Christopher Tate66488d62012-10-02 11:58:01 -07001044 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001045 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1046 + " to android.provider.Settings.Global, returning read-only value.");
1047 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001048 }
Christopher Tate06efb532012-08-24 15:29:27 -07001049 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001050 }
1051
1052 /**
1053 * Store a name/value pair into the database.
1054 * @param resolver to access the database with
1055 * @param name to store
1056 * @param value to associate with the name
1057 * @return true if the value was set, false on database errors
1058 */
1059 public static boolean putString(ContentResolver resolver, String name, String value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001060 return putStringForUser(resolver, name, value, UserHandle.myUserId());
1061 }
1062
1063 /** @hide */
1064 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
1065 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001066 if (MOVED_TO_SECURE.contains(name)) {
1067 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1068 + " to android.provider.Settings.Secure, value is unchanged.");
1069 return false;
1070 }
Christopher Tate66488d62012-10-02 11:58:01 -07001071 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001072 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1073 + " to android.provider.Settings.Global, value is unchanged.");
1074 return false;
1075 }
Christopher Tate06efb532012-08-24 15:29:27 -07001076 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001077 }
1078
1079 /**
1080 * Construct the content URI for a particular name/value pair,
1081 * useful for monitoring changes with a ContentObserver.
1082 * @param name to look up in the table
1083 * @return the corresponding content URI, or null if not present
1084 */
1085 public static Uri getUriFor(String name) {
1086 if (MOVED_TO_SECURE.contains(name)) {
1087 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1088 + " to android.provider.Settings.Secure, returning Secure URI.");
1089 return Secure.getUriFor(Secure.CONTENT_URI, name);
1090 }
Christopher Tate66488d62012-10-02 11:58:01 -07001091 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001092 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1093 + " to android.provider.Settings.Global, returning read-only global URI.");
1094 return Global.getUriFor(Global.CONTENT_URI, name);
1095 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001096 return getUriFor(CONTENT_URI, name);
1097 }
1098
1099 /**
1100 * Convenience function for retrieving a single system settings value
1101 * as an integer. Note that internally setting values are always
1102 * stored as strings; this function converts the string to an integer
1103 * for you. The default value will be returned if the setting is
1104 * not defined or not an integer.
1105 *
1106 * @param cr The ContentResolver to access.
1107 * @param name The name of the setting to retrieve.
1108 * @param def Value to return if the setting is not defined.
1109 *
1110 * @return The setting's current value, or 'def' if it is not defined
1111 * or not a valid integer.
1112 */
1113 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001114 return getIntForUser(cr, name, def, UserHandle.myUserId());
1115 }
1116
1117 /** @hide */
1118 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
1119 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001120 try {
1121 return v != null ? Integer.parseInt(v) : def;
1122 } catch (NumberFormatException e) {
1123 return def;
1124 }
1125 }
1126
1127 /**
1128 * Convenience function for retrieving a single system settings value
1129 * as an integer. Note that internally setting values are always
1130 * stored as strings; this function converts the string to an integer
1131 * for you.
1132 * <p>
1133 * This version does not take a default value. If the setting has not
1134 * been set, or the string value is not a number,
1135 * it throws {@link SettingNotFoundException}.
1136 *
1137 * @param cr The ContentResolver to access.
1138 * @param name The name of the setting to retrieve.
1139 *
1140 * @throws SettingNotFoundException Thrown if a setting by the given
1141 * name can't be found or the setting value is not an integer.
1142 *
1143 * @return The setting's current value.
1144 */
1145 public static int getInt(ContentResolver cr, String name)
1146 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001147 return getIntForUser(cr, name, UserHandle.myUserId());
1148 }
1149
1150 /** @hide */
1151 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
1152 throws SettingNotFoundException {
1153 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001154 try {
1155 return Integer.parseInt(v);
1156 } catch (NumberFormatException e) {
1157 throw new SettingNotFoundException(name);
1158 }
1159 }
1160
1161 /**
1162 * Convenience function for updating a single settings value as an
1163 * integer. This will either create a new entry in the table if the
1164 * given name does not exist, or modify the value of the existing row
1165 * with that name. Note that internally setting values are always
1166 * stored as strings, so this function converts the given value to a
1167 * string before storing it.
1168 *
1169 * @param cr The ContentResolver to access.
1170 * @param name The name of the setting to modify.
1171 * @param value The new value for the setting.
1172 * @return true if the value was set, false on database errors
1173 */
1174 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001175 return putIntForUser(cr, name, value, UserHandle.myUserId());
1176 }
1177
1178 /** @hide */
1179 public static boolean putIntForUser(ContentResolver cr, String name, int value,
1180 int userHandle) {
1181 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001182 }
1183
1184 /**
1185 * Convenience function for retrieving a single system settings value
1186 * as a {@code long}. Note that internally setting values are always
1187 * stored as strings; this function converts the string to a {@code long}
1188 * for you. The default value will be returned if the setting is
1189 * not defined or not a {@code long}.
1190 *
1191 * @param cr The ContentResolver to access.
1192 * @param name The name of the setting to retrieve.
1193 * @param def Value to return if the setting is not defined.
1194 *
1195 * @return The setting's current value, or 'def' if it is not defined
1196 * or not a valid {@code long}.
1197 */
1198 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001199 return getLongForUser(cr, name, def, UserHandle.myUserId());
1200 }
1201
1202 /** @hide */
1203 public static long getLongForUser(ContentResolver cr, String name, long def,
1204 int userHandle) {
1205 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001206 long value;
1207 try {
1208 value = valString != null ? Long.parseLong(valString) : def;
1209 } catch (NumberFormatException e) {
1210 value = def;
1211 }
1212 return value;
1213 }
1214
1215 /**
1216 * Convenience function for retrieving a single system settings value
1217 * as a {@code long}. Note that internally setting values are always
1218 * stored as strings; this function converts the string to a {@code long}
1219 * for you.
1220 * <p>
1221 * This version does not take a default value. If the setting has not
1222 * been set, or the string value is not a number,
1223 * it throws {@link SettingNotFoundException}.
1224 *
1225 * @param cr The ContentResolver to access.
1226 * @param name The name of the setting to retrieve.
1227 *
1228 * @return The setting's current value.
1229 * @throws SettingNotFoundException Thrown if a setting by the given
1230 * name can't be found or the setting value is not an integer.
1231 */
1232 public static long getLong(ContentResolver cr, String name)
1233 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001234 return getLongForUser(cr, name, UserHandle.myUserId());
1235 }
1236
1237 /** @hide */
1238 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
1239 throws SettingNotFoundException {
1240 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001241 try {
1242 return Long.parseLong(valString);
1243 } catch (NumberFormatException e) {
1244 throw new SettingNotFoundException(name);
1245 }
1246 }
1247
1248 /**
1249 * Convenience function for updating a single settings value as a long
1250 * integer. This will either create a new entry in the table if the
1251 * given name does not exist, or modify the value of the existing row
1252 * with that name. Note that internally setting values are always
1253 * stored as strings, so this function converts the given value to a
1254 * string before storing it.
1255 *
1256 * @param cr The ContentResolver to access.
1257 * @param name The name of the setting to modify.
1258 * @param value The new value for the setting.
1259 * @return true if the value was set, false on database errors
1260 */
1261 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001262 return putLongForUser(cr, name, value, UserHandle.myUserId());
1263 }
1264
1265 /** @hide */
1266 public static boolean putLongForUser(ContentResolver cr, String name, long value,
1267 int userHandle) {
1268 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001269 }
1270
1271 /**
1272 * Convenience function for retrieving a single system settings value
1273 * as a floating point number. Note that internally setting values are
1274 * always stored as strings; this function converts the string to an
1275 * float for you. The default value will be returned if the setting
1276 * is not defined or not a valid float.
1277 *
1278 * @param cr The ContentResolver to access.
1279 * @param name The name of the setting to retrieve.
1280 * @param def Value to return if the setting is not defined.
1281 *
1282 * @return The setting's current value, or 'def' if it is not defined
1283 * or not a valid float.
1284 */
1285 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001286 return getFloatForUser(cr, name, def, UserHandle.myUserId());
1287 }
1288
1289 /** @hide */
1290 public static float getFloatForUser(ContentResolver cr, String name, float def,
1291 int userHandle) {
1292 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001293 try {
1294 return v != null ? Float.parseFloat(v) : def;
1295 } catch (NumberFormatException e) {
1296 return def;
1297 }
1298 }
1299
1300 /**
1301 * Convenience function for retrieving a single system settings value
1302 * as a float. Note that internally setting values are always
1303 * stored as strings; this function converts the string to a float
1304 * for you.
1305 * <p>
1306 * This version does not take a default value. If the setting has not
1307 * been set, or the string value is not a number,
1308 * it throws {@link SettingNotFoundException}.
1309 *
1310 * @param cr The ContentResolver to access.
1311 * @param name The name of the setting to retrieve.
1312 *
1313 * @throws SettingNotFoundException Thrown if a setting by the given
1314 * name can't be found or the setting value is not a float.
1315 *
1316 * @return The setting's current value.
1317 */
1318 public static float getFloat(ContentResolver cr, String name)
1319 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001320 return getFloatForUser(cr, name, UserHandle.myUserId());
1321 }
1322
1323 /** @hide */
1324 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
1325 throws SettingNotFoundException {
1326 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08001327 if (v == null) {
1328 throw new SettingNotFoundException(name);
1329 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001330 try {
1331 return Float.parseFloat(v);
1332 } catch (NumberFormatException e) {
1333 throw new SettingNotFoundException(name);
1334 }
1335 }
1336
1337 /**
1338 * Convenience function for updating a single settings value as a
1339 * floating point number. This will either create a new entry in the
1340 * table if the given name does not exist, or modify the value of the
1341 * existing row with that name. Note that internally setting values
1342 * are always stored as strings, so this function converts the given
1343 * value to a string before storing it.
1344 *
1345 * @param cr The ContentResolver to access.
1346 * @param name The name of the setting to modify.
1347 * @param value The new value for the setting.
1348 * @return true if the value was set, false on database errors
1349 */
1350 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001351 return putFloatForUser(cr, name, value, UserHandle.myUserId());
1352 }
1353
1354 /** @hide */
1355 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
1356 int userHandle) {
1357 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001358 }
1359
1360 /**
1361 * Convenience function to read all of the current
1362 * configuration-related settings into a
1363 * {@link Configuration} object.
1364 *
1365 * @param cr The ContentResolver to access.
1366 * @param outConfig Where to place the configuration settings.
1367 */
1368 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Christopher Tate06efb532012-08-24 15:29:27 -07001369 getConfigurationForUser(cr, outConfig, UserHandle.myUserId());
1370 }
1371
1372 /** @hide */
1373 public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig,
1374 int userHandle) {
1375 outConfig.fontScale = Settings.System.getFloatForUser(
1376 cr, FONT_SCALE, outConfig.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001377 if (outConfig.fontScale < 0) {
1378 outConfig.fontScale = 1;
1379 }
1380 }
1381
1382 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001383 * @hide Erase the fields in the Configuration that should be applied
1384 * by the settings.
1385 */
1386 public static void clearConfiguration(Configuration inoutConfig) {
1387 inoutConfig.fontScale = 0;
1388 }
Narayan Kamath6d632962011-08-24 11:51:37 +01001389
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001390 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001391 * Convenience function to write a batch of configuration-related
1392 * settings from a {@link Configuration} object.
1393 *
1394 * @param cr The ContentResolver to access.
1395 * @param config The settings to write.
1396 * @return true if the values were set, false on database errors
1397 */
1398 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Christopher Tate06efb532012-08-24 15:29:27 -07001399 return putConfigurationForUser(cr, config, UserHandle.myUserId());
1400 }
1401
1402 /** @hide */
1403 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
1404 int userHandle) {
1405 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001406 }
1407
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001408 /** @hide */
1409 public static boolean hasInterestingConfigurationChanges(int changes) {
1410 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1411 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001412
Christopher Tate06efb532012-08-24 15:29:27 -07001413 /** @deprecated - Do not use */
1414 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001415 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Christopher Tate06efb532012-08-24 15:29:27 -07001416 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001417 }
1418
Christopher Tate06efb532012-08-24 15:29:27 -07001419 /**
1420 * @hide
1421 * @deprecated - Do not use
1422 */
1423 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
1424 int userHandle) {
1425 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
1426 }
1427
1428 /** @deprecated - Do not use */
1429 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001430 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Christopher Tatec8c08382012-09-19 17:18:18 -07001431 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07001432 }
1433
1434 /**
1435 * @hide
1436 * @deprecated - Do not use
1437 */
1438 @Deprecated
1439 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
1440 int userHandle) {
1441 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001442 }
1443
1444 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001445 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001446 */
Christopher Tate06efb532012-08-24 15:29:27 -07001447 @Deprecated
1448 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 -08001449
1450 /**
1451 * What happens when the user presses the end call button if they're not
1452 * on a call.<br/>
1453 * <b>Values:</b><br/>
1454 * 0 - The end button does nothing.<br/>
1455 * 1 - The end button goes to the home screen.<br/>
1456 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1457 * 3 - The end button goes to the home screen. If the user is already on the
1458 * home screen, it puts the device to sleep.
1459 */
1460 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1461
1462 /**
David Brown458e8062010-03-08 21:52:11 -08001463 * END_BUTTON_BEHAVIOR value for "go home".
1464 * @hide
1465 */
1466 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1467
1468 /**
1469 * END_BUTTON_BEHAVIOR value for "go to sleep".
1470 * @hide
1471 */
1472 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
1473
1474 /**
1475 * END_BUTTON_BEHAVIOR default value.
1476 * @hide
1477 */
1478 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
1479
1480 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07001481 * Is advanced settings mode turned on. 0 == no, 1 == yes
1482 * @hide
1483 */
1484 public static final String ADVANCED_SETTINGS = "advanced_settings";
1485
1486 /**
1487 * ADVANCED_SETTINGS default value.
1488 * @hide
1489 */
1490 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
1491
1492 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001493 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001494 */
Christopher Tate06efb532012-08-24 15:29:27 -07001495 @Deprecated
1496 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001497
1498 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001499 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001500 */
Christopher Tate06efb532012-08-24 15:29:27 -07001501 @Deprecated
1502 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001503
1504 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001505 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001506 */
Christopher Tate06efb532012-08-24 15:29:27 -07001507 @Deprecated
1508 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001509
Robert Greenwalt8588e472011-11-08 10:12:25 -08001510 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001511 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08001512 * {@hide}
1513 */
Christopher Tate06efb532012-08-24 15:29:27 -07001514 @Deprecated
1515 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001516
1517 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001518 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07001519 */
Christopher Tate06efb532012-08-24 15:29:27 -07001520 @Deprecated
1521 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07001522
1523 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001524 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001525 */
Christopher Tate06efb532012-08-24 15:29:27 -07001526 @Deprecated
1527 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001528
1529 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001530 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
1531 */
1532 @Deprecated
1533 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
1534
1535 /**
1536 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001537 *
1538 * {@hide}
1539 */
Christopher Tate06efb532012-08-24 15:29:27 -07001540 @Deprecated
1541 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
1542 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001543
1544 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001545 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001546 */
Christopher Tate06efb532012-08-24 15:29:27 -07001547 @Deprecated
1548 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001549
1550 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001551 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001552 */
Christopher Tate06efb532012-08-24 15:29:27 -07001553 @Deprecated
1554 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001555
1556 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001557 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001558 */
Christopher Tate06efb532012-08-24 15:29:27 -07001559 @Deprecated
1560 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
1561 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001562
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001563 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001564 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001565 */
Christopher Tate06efb532012-08-24 15:29:27 -07001566 @Deprecated
1567 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001568
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001569 /**
1570 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
1571 */
1572 @Deprecated
1573 public static final String MODE_RINGER = Global.MODE_RINGER;
1574
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001575 /**
1576 * Whether to use static IP and other static network attributes.
1577 * <p>
1578 * Set to 1 for true and 0 for false.
Jeff Sharkey625239a2012-09-26 22:03:49 -07001579 *
1580 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001581 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001582 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001583 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
1584
1585 /**
1586 * The static IP address.
1587 * <p>
1588 * Example: "192.168.1.51"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001589 *
1590 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001591 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001592 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001593 public static final String WIFI_STATIC_IP = "wifi_static_ip";
1594
1595 /**
1596 * If using static IP, the gateway's IP address.
1597 * <p>
1598 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001599 *
1600 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001601 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001602 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001603 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
1604
1605 /**
1606 * If using static IP, the net mask.
1607 * <p>
1608 * Example: "255.255.255.0"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001609 *
1610 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001611 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001612 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001613 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
1614
1615 /**
1616 * If using static IP, the primary DNS's IP address.
1617 * <p>
1618 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001619 *
1620 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001621 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001622 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001623 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
1624
1625 /**
1626 * If using static IP, the secondary DNS's IP address.
1627 * <p>
1628 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001629 *
1630 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001631 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001632 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001633 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
1634
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001635
1636 /**
1637 * Determines whether remote devices may discover and/or connect to
1638 * this device.
1639 * <P>Type: INT</P>
1640 * 2 -- discoverable and connectable
1641 * 1 -- connectable but not discoverable
1642 * 0 -- neither connectable nor discoverable
1643 */
1644 public static final String BLUETOOTH_DISCOVERABILITY =
1645 "bluetooth_discoverability";
1646
1647 /**
1648 * Bluetooth discoverability timeout. If this value is nonzero, then
1649 * Bluetooth becomes discoverable for a certain number of seconds,
1650 * after which is becomes simply connectable. The value is in seconds.
1651 */
1652 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
1653 "bluetooth_discoverability_timeout";
1654
1655 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001656 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
1657 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001658 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001659 @Deprecated
1660 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001661
1662 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001663 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
1664 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001665 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001666 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001667 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
1668
1669 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001670 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08001671 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
1672 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001673 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001674 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001675 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
1676 "lock_pattern_tactile_feedback_enabled";
1677
1678
1679 /**
1680 * A formatted string of the next alarm that is set, or the empty string
1681 * if there is no alarm set.
1682 */
1683 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
1684
1685 /**
1686 * Scaling factor for fonts, float.
1687 */
1688 public static final String FONT_SCALE = "font_scale";
1689
1690 /**
1691 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001692 *
1693 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001694 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001695 @Deprecated
1696 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001697
1698 /**
1699 * If 1, when launching DEBUG_APP it will wait for the debugger before
1700 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001701 *
1702 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001703 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001704 @Deprecated
1705 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001706
1707 /**
1708 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07001709 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001710 */
Jeff Brown96307042012-07-27 15:51:34 -07001711 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001712 public static final String DIM_SCREEN = "dim_screen";
1713
1714 /**
1715 * The timeout before the screen turns off.
1716 */
1717 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
1718
1719 /**
1720 * The screen backlight brightness between 0 and 255.
1721 */
1722 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
1723
1724 /**
Dan Murphy951764b2009-08-27 14:59:03 -05001725 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05001726 */
1727 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
1728
1729 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08001730 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
1731 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07001732 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08001733 */
1734 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
1735
1736 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001737 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001738 */
1739 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
1740
1741 /**
Scott Main52bfc242012-02-09 10:09:14 -08001742 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001743 */
1744 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
1745
1746 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001747 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001748 *
1749 * @deprecated Use {@link Global#SHOW_PROCESSES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001750 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001751 @Deprecated
1752 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001753
1754 /**
1755 * If 1, the activity manager will aggressively finish activities and
1756 * processes as soon as they are no longer needed. If 0, the normal
1757 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001758 *
1759 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001760 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001761 @Deprecated
1762 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001763
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001764 /**
1765 * Determines which streams are affected by ringer mode changes. The
1766 * stream type's bit should be set to 1 if it should be muted when going
1767 * into an inaudible ringer mode.
1768 */
1769 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
1770
1771 /**
1772 * Determines which streams are affected by mute. The
1773 * stream type's bit should be set to 1 if it should be muted when a mute request
1774 * is received.
1775 */
1776 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
1777
1778 /**
1779 * Whether vibrate is on for different events. This is used internally,
1780 * changing this value will not change the vibrate. See AudioManager.
1781 */
1782 public static final String VIBRATE_ON = "vibrate_on";
1783
1784 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07001785 * If 1, redirects the system vibrator to all currently attached input devices
1786 * that support vibration. If there are no such input devices, then the system
1787 * vibrator is used instead.
1788 * If 0, does not register the system vibrator.
1789 *
1790 * This setting is mainly intended to provide a compatibility mechanism for
1791 * applications that only know about the system vibrator and do not use the
1792 * input device vibrator API.
1793 *
1794 * @hide
1795 */
1796 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
1797
1798 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001799 * Ringer volume. This is used internally, changing this value will not
1800 * change the volume. See AudioManager.
1801 */
1802 public static final String VOLUME_RING = "volume_ring";
1803
1804 /**
1805 * System/notifications volume. This is used internally, changing this
1806 * value will not change the volume. See AudioManager.
1807 */
1808 public static final String VOLUME_SYSTEM = "volume_system";
1809
1810 /**
1811 * Voice call volume. This is used internally, changing this value will
1812 * not change the volume. See AudioManager.
1813 */
1814 public static final String VOLUME_VOICE = "volume_voice";
1815
1816 /**
1817 * Music/media/gaming volume. This is used internally, changing this
1818 * value will not change the volume. See AudioManager.
1819 */
1820 public static final String VOLUME_MUSIC = "volume_music";
1821
1822 /**
1823 * Alarm volume. This is used internally, changing this
1824 * value will not change the volume. See AudioManager.
1825 */
1826 public static final String VOLUME_ALARM = "volume_alarm";
1827
1828 /**
1829 * Notification volume. This is used internally, changing this
1830 * value will not change the volume. See AudioManager.
1831 */
1832 public static final String VOLUME_NOTIFICATION = "volume_notification";
1833
1834 /**
Eric Laurent484d2882009-12-08 09:05:45 -08001835 * Bluetooth Headset volume. This is used internally, changing this value will
1836 * not change the volume. See AudioManager.
1837 */
1838 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
1839
1840 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04001841 * Master volume (float in the range 0.0f to 1.0f).
1842 * @hide
1843 */
1844 public static final String VOLUME_MASTER = "volume_master";
1845
1846 /**
Justin Koh57978ed2012-04-03 17:37:58 -07001847 * Master volume mute (int 1 = mute, 0 = not muted).
1848 *
1849 * @hide
1850 */
1851 public static final String VOLUME_MASTER_MUTE = "volume_master_mute";
1852
1853 /**
1854 * Whether the notifications should use the ring volume (value of 1) or
1855 * a separate notification volume (value of 0). In most cases, users
1856 * will have this enabled so the notification and ringer volumes will be
1857 * the same. However, power users can disable this and use the separate
1858 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001859 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07001860 * Note: This is a one-off setting that will be removed in the future
1861 * when there is profile support. For this reason, it is kept hidden
1862 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001863 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001864 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07001865 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001866 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07001867 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001868 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001869 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001870
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001871 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05001872 * Whether silent mode should allow vibration feedback. This is used
1873 * internally in AudioService and the Sound settings activity to
1874 * coordinate decoupling of vibrate and silent modes. This setting
1875 * will likely be removed in a future release with support for
1876 * audio/vibe feedback profiles.
1877 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07001878 * Not used anymore. On devices with vibrator, the user explicitly selects
1879 * silent or vibrate mode.
1880 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05001881 * @hide
1882 */
1883 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
1884
1885 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001886 * The mapping of stream type (integer) to its setting.
1887 */
1888 public static final String[] VOLUME_SETTINGS = {
1889 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08001890 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001891 };
1892
1893 /**
1894 * Appended to various volume related settings to record the previous
1895 * values before they the settings were affected by a silent/vibrate
1896 * ringer mode change.
1897 */
1898 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
1899
1900 /**
1901 * Persistent store for the system-wide default ringtone URI.
1902 * <p>
1903 * If you need to play the default ringtone at any given time, it is recommended
1904 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
1905 * to the set default ringtone at the time of playing.
1906 *
1907 * @see #DEFAULT_RINGTONE_URI
1908 */
1909 public static final String RINGTONE = "ringtone";
1910
1911 /**
1912 * A {@link Uri} that will point to the current default ringtone at any
1913 * given time.
1914 * <p>
1915 * If the current default ringtone is in the DRM provider and the caller
1916 * does not have permission, the exception will be a
1917 * FileNotFoundException.
1918 */
1919 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
1920
1921 /**
1922 * Persistent store for the system-wide default notification sound.
1923 *
1924 * @see #RINGTONE
1925 * @see #DEFAULT_NOTIFICATION_URI
1926 */
1927 public static final String NOTIFICATION_SOUND = "notification_sound";
1928
1929 /**
1930 * A {@link Uri} that will point to the current default notification
1931 * sound at any given time.
1932 *
1933 * @see #DEFAULT_RINGTONE_URI
1934 */
1935 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
1936
1937 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07001938 * Persistent store for the system-wide default alarm alert.
1939 *
1940 * @see #RINGTONE
1941 * @see #DEFAULT_ALARM_ALERT_URI
1942 */
1943 public static final String ALARM_ALERT = "alarm_alert";
1944
1945 /**
1946 * A {@link Uri} that will point to the current default alarm alert at
1947 * any given time.
1948 *
1949 * @see #DEFAULT_ALARM_ALERT_URI
1950 */
1951 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
1952
1953 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07001954 * Persistent store for the system default media button event receiver.
1955 *
1956 * @hide
1957 */
1958 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
1959
1960 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001961 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
1962 */
1963 public static final String TEXT_AUTO_REPLACE = "auto_replace";
1964
1965 /**
1966 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
1967 */
1968 public static final String TEXT_AUTO_CAPS = "auto_caps";
1969
1970 /**
1971 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
1972 * feature converts two spaces to a "." and space.
1973 */
1974 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001975
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001976 /**
1977 * Setting to showing password characters in text editors. 1 = On, 0 = Off
1978 */
1979 public static final String TEXT_SHOW_PASSWORD = "show_password";
1980
1981 public static final String SHOW_GTALK_SERVICE_STATUS =
1982 "SHOW_GTALK_SERVICE_STATUS";
1983
1984 /**
1985 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001986 *
1987 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001988 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001989 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001990 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
1991
1992 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001993 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
1994 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001995 */
Christopher Tate06efb532012-08-24 15:29:27 -07001996 @Deprecated
1997 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001998
1999 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002000 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
2001 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07002002 */
Christopher Tate06efb532012-08-24 15:29:27 -07002003 @Deprecated
2004 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07002005
2006 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002007 * Display times as 12 or 24 hours
2008 * 12
2009 * 24
2010 */
2011 public static final String TIME_12_24 = "time_12_24";
2012
2013 /**
2014 * Date format string
2015 * mm/dd/yyyy
2016 * dd/mm/yyyy
2017 * yyyy/mm/dd
2018 */
2019 public static final String DATE_FORMAT = "date_format";
2020
2021 /**
2022 * Whether the setup wizard has been run before (on first boot), or if
2023 * it still needs to be run.
2024 *
2025 * nonzero = it has been run in the past
2026 * 0 = it has not been run in the past
2027 */
2028 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
2029
2030 /**
2031 * Scaling factor for normal window animations. Setting to 0 will disable window
2032 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002033 *
2034 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002035 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002036 @Deprecated
2037 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002038
2039 /**
2040 * Scaling factor for activity transition animations. Setting to 0 will disable window
2041 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002042 *
2043 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002044 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002045 @Deprecated
2046 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002047
2048 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08002049 * Scaling factor for Animator-based animations. This affects both the start delay and
2050 * duration of all such animations. Setting to 0 will cause animations to end immediately.
2051 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002052 *
2053 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08002054 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002055 @Deprecated
2056 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002057
2058 /**
2059 * Control whether the accelerometer will be used to change screen
2060 * orientation. If 0, it will not be used unless explicitly requested
2061 * by the application; if 1, it will be used by default unless explicitly
2062 * disabled by the application.
2063 */
2064 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
2065
2066 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002067 * Default screen rotation when no other policy applies.
2068 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
2069 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08002070 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002071 *
2072 * @see Display#getRotation
2073 */
2074 public static final String USER_ROTATION = "user_rotation";
2075
2076 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07002077 * Control whether the rotation lock toggle in the System UI should be hidden.
2078 * Typically this is done for accessibility purposes to make it harder for
2079 * the user to accidentally toggle the rotation lock while the display rotation
2080 * has been locked for accessibility.
2081 *
2082 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
2083 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
2084 *
2085 * @hide
2086 */
2087 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
2088 "hide_rotation_lock_toggle_for_accessibility";
2089
2090 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002091 * Whether the phone vibrates when it is ringing due to an incoming call. This will
2092 * be used by Phone and Setting apps; it shouldn't affect other apps.
2093 * The value is boolean (1 or 0).
2094 *
2095 * Note: this is not same as "vibrate on ring", which had been available until ICS.
2096 * It was about AudioManager's setting and thus affected all the applications which
2097 * relied on the setting, while this is purely about the vibration setting for incoming
2098 * calls.
2099 *
2100 * @hide
2101 */
2102 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
2103
2104 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002105 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
2106 * boolean (1 or 0).
2107 */
2108 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
2109
2110 /**
David Kraused0f67152009-06-13 18:01:13 -05002111 * CDMA only settings
2112 * DTMF tone type played by the dialer when dialing.
2113 * 0 = Normal
2114 * 1 = Long
2115 * @hide
2116 */
2117 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
2118
2119 /**
David Kraused0f67152009-06-13 18:01:13 -05002120 * Whether the hearing aid is enabled. The value is
2121 * boolean (1 or 0).
2122 * @hide
2123 */
2124 public static final String HEARING_AID = "hearing_aid";
2125
2126 /**
2127 * CDMA only settings
2128 * TTY Mode
2129 * 0 = OFF
2130 * 1 = FULL
2131 * 2 = VCO
2132 * 3 = HCO
2133 * @hide
2134 */
2135 public static final String TTY_MODE = "tty_mode";
2136
2137 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002138 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
2139 * boolean (1 or 0).
2140 */
2141 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002142
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002143 /**
2144 * Whether the haptic feedback (long presses, ...) are enabled. The value is
2145 * boolean (1 or 0).
2146 */
2147 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07002148
Mike LeBeau48603e72009-06-05 00:27:00 +01002149 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01002150 * @deprecated Each application that shows web suggestions should have its own
2151 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01002152 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01002153 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01002154 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002155
-b master501eec92009-07-06 13:53:11 -07002156 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002157 * Whether the notification LED should repeatedly flash when a notification is
2158 * pending. The value is boolean (1 or 0).
2159 * @hide
2160 */
2161 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
2162
2163 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002164 * Show pointer location on screen?
2165 * 0 = no
2166 * 1 = yes
2167 * @hide
2168 */
2169 public static final String POINTER_LOCATION = "pointer_location";
2170
2171 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07002172 * Show touch positions on screen?
2173 * 0 = no
2174 * 1 = yes
2175 * @hide
2176 */
2177 public static final String SHOW_TOUCHES = "show_touches";
2178
2179 /**
Jeff Brown4519f072011-01-23 13:16:01 -08002180 * Log raw orientation data from {@link WindowOrientationListener} for use with the
2181 * orientationplot.py tool.
2182 * 0 = no
2183 * 1 = yes
2184 * @hide
2185 */
2186 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
2187 "window_orientation_listener_log";
2188
2189 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002190 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
2191 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002192 * @hide
2193 */
Christopher Tate06efb532012-08-24 15:29:27 -07002194 @Deprecated
2195 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002196
2197 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002198 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
2199 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002200 * @hide
2201 */
Christopher Tate06efb532012-08-24 15:29:27 -07002202 @Deprecated
2203 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002204
2205 /**
2206 * Whether to play sounds when the keyguard is shown and dismissed.
2207 * @hide
2208 */
2209 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
2210
2211 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04002212 * Whether the lockscreen should be completely disabled.
2213 * @hide
2214 */
2215 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
2216
2217 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002218 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
2219 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002220 * @hide
2221 */
Christopher Tate06efb532012-08-24 15:29:27 -07002222 @Deprecated
2223 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002224
2225 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002226 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
2227 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002228 * @hide
2229 */
Christopher Tate06efb532012-08-24 15:29:27 -07002230 @Deprecated
2231 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002232
2233 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002234 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
2235 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002236 * @hide
2237 */
Christopher Tate06efb532012-08-24 15:29:27 -07002238 @Deprecated
2239 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002240
2241 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002242 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
2243 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002244 * @hide
2245 */
Christopher Tate06efb532012-08-24 15:29:27 -07002246 @Deprecated
2247 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002248
2249 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002250 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
2251 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002252 * @hide
2253 */
Christopher Tate06efb532012-08-24 15:29:27 -07002254 @Deprecated
2255 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002256
2257 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002258 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
2259 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002260 * @hide
2261 */
Christopher Tate06efb532012-08-24 15:29:27 -07002262 @Deprecated
2263 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002264
2265 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002266 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
2267 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002268 * @hide
2269 */
Christopher Tate06efb532012-08-24 15:29:27 -07002270 @Deprecated
2271 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002272
2273 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002274 * Receive incoming SIP calls?
2275 * 0 = no
2276 * 1 = yes
2277 * @hide
2278 */
2279 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
2280
2281 /**
2282 * Call Preference String.
2283 * "SIP_ALWAYS" : Always use SIP with network access
2284 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
2285 * "SIP_ASK_ME_EACH_TIME" : Always ask me each time
2286 * @hide
2287 */
2288 public static final String SIP_CALL_OPTIONS = "sip_call_options";
2289
2290 /**
2291 * One of the sip call options: Always use SIP with network access.
2292 * @hide
2293 */
2294 public static final String SIP_ALWAYS = "SIP_ALWAYS";
2295
2296 /**
2297 * One of the sip call options: Only if destination is a SIP address.
2298 * @hide
2299 */
2300 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
2301
2302 /**
2303 * One of the sip call options: Always ask me each time.
2304 * @hide
2305 */
2306 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
2307
2308 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07002309 * Pointer speed setting.
2310 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
2311 * -7 = slowest
2312 * 0 = default speed
2313 * +7 = fastest
2314 * @hide
2315 */
2316 public static final String POINTER_SPEED = "pointer_speed";
2317
2318 /**
-b master501eec92009-07-06 13:53:11 -07002319 * Settings to backup. This is here so that it's in the same place as the settings
2320 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07002321 *
2322 * NOTE: Settings are backed up and restored in the order they appear
2323 * in this array. If you have one setting depending on another,
2324 * make sure that they are ordered appropriately.
2325 *
-b master501eec92009-07-06 13:53:11 -07002326 * @hide
2327 */
2328 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07002329 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07002330 WIFI_USE_STATIC_IP,
2331 WIFI_STATIC_IP,
2332 WIFI_STATIC_GATEWAY,
2333 WIFI_STATIC_NETMASK,
2334 WIFI_STATIC_DNS1,
2335 WIFI_STATIC_DNS2,
2336 BLUETOOTH_DISCOVERABILITY,
2337 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
2338 DIM_SCREEN,
2339 SCREEN_OFF_TIMEOUT,
2340 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07002341 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002342 SCREEN_AUTO_BRIGHTNESS_ADJ,
Jeff Brown7f6c2312012-04-13 20:38:38 -07002343 VIBRATE_INPUT_DEVICES,
Christopher Tate66488d62012-10-02 11:58:01 -07002344 MODE_RINGER, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07002345 MODE_RINGER_STREAMS_AFFECTED,
2346 MUTE_STREAMS_AFFECTED,
2347 VOLUME_VOICE,
2348 VOLUME_SYSTEM,
2349 VOLUME_RING,
2350 VOLUME_MUSIC,
2351 VOLUME_ALARM,
2352 VOLUME_NOTIFICATION,
Eric Laurent484d2882009-12-08 09:05:45 -08002353 VOLUME_BLUETOOTH_SCO,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07002354 VOLUME_VOICE + APPEND_FOR_LAST_AUDIBLE,
2355 VOLUME_SYSTEM + APPEND_FOR_LAST_AUDIBLE,
2356 VOLUME_RING + APPEND_FOR_LAST_AUDIBLE,
2357 VOLUME_MUSIC + APPEND_FOR_LAST_AUDIBLE,
2358 VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE,
2359 VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE,
Eric Laurent484d2882009-12-08 09:05:45 -08002360 VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE,
-b master501eec92009-07-06 13:53:11 -07002361 TEXT_AUTO_REPLACE,
2362 TEXT_AUTO_CAPS,
2363 TEXT_AUTO_PUNCTUATE,
2364 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07002365 AUTO_TIME, // moved to global
2366 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07002367 TIME_12_24,
2368 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07002369 DTMF_TONE_WHEN_DIALING,
2370 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07002371 HEARING_AID,
2372 TTY_MODE,
2373 SOUND_EFFECTS_ENABLED,
2374 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07002375 POWER_SOUNDS_ENABLED, // moved to global
2376 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08002377 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002378 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04002379 NOTIFICATION_LIGHT_PULSE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002380 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07002381 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07002382 POINTER_SPEED,
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002383 VIBRATE_WHEN_RINGING
-b master501eec92009-07-06 13:53:11 -07002384 };
2385
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002386 // Settings moved to Settings.Secure
2387
2388 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002389 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002390 * instead
2391 */
2392 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002393 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002394
2395 /**
2396 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
2397 */
2398 @Deprecated
2399 public static final String ANDROID_ID = Secure.ANDROID_ID;
2400
2401 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002402 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002403 */
2404 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002405 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002406
2407 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002408 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002409 */
2410 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002411 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002412
2413 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002414 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002415 */
2416 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002417 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002418
2419 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07002420 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002421 */
2422 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07002423 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002424
2425 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002426 * @deprecated Use {@link android.provider.Settings.Global#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002427 */
2428 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002429 public static final String INSTALL_NON_MARKET_APPS = Global.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002430
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002431 /**
2432 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
2433 * instead
2434 */
2435 @Deprecated
2436 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
2437
2438 /**
2439 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
2440 */
2441 @Deprecated
2442 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002443
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002444 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002445 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002446 */
2447 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002448 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002449
2450 /**
2451 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
2452 * instead
2453 */
2454 @Deprecated
2455 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
2456
2457 /**
2458 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
2459 * instead
2460 */
2461 @Deprecated
2462 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
2463
2464 /**
2465 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
2466 * instead
2467 */
2468 @Deprecated
2469 public static final String PARENTAL_CONTROL_REDIRECT_URL =
2470 Secure.PARENTAL_CONTROL_REDIRECT_URL;
2471
2472 /**
2473 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
2474 */
2475 @Deprecated
2476 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
2477
2478 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002479 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002480 */
2481 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002482 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002483
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002484 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002485 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002486 */
2487 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002488 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002489
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002490 /**
2491 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002492 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002493 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002494 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002495 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 -08002496
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002497 /**
2498 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002499 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002500 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002501 @Deprecated
2502 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07002503 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002504
2505 /**
2506 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002507 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002508 */
2509 @Deprecated
2510 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07002511 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002512
2513 /**
2514 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002515 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002516 */
2517 @Deprecated
2518 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07002519 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002520
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002521 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002522 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002523 * instead
2524 */
2525 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002526 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 -08002527
2528 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002529 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002530 */
2531 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002532 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002533
2534 /**
2535 * @deprecated Use
2536 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
2537 * instead
2538 */
2539 @Deprecated
2540 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
2541 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
2542
2543 /**
2544 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
2545 */
2546 @Deprecated
2547 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
2548
2549 /**
2550 * @deprecated Use
2551 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
2552 */
2553 @Deprecated
2554 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
2555 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002556
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002557 /**
2558 * @deprecated Use
2559 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
2560 */
2561 @Deprecated
2562 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
2563 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
2564
2565 /**
2566 * @deprecated Use
2567 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
2568 * instead
2569 */
2570 @Deprecated
2571 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
2572 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
2573
2574 /**
2575 * @deprecated Use
2576 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
2577 */
2578 @Deprecated
2579 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
2580 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
2581
2582 /**
2583 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
2584 * instead
2585 */
2586 @Deprecated
2587 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
2588
2589 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002590 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002591 */
2592 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002593 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002594
2595 /**
2596 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
2597 */
2598 @Deprecated
2599 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
2600
2601 /**
2602 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
2603 * instead
2604 */
2605 @Deprecated
2606 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
2607
2608 /**
2609 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
2610 * instead
2611 */
2612 @Deprecated
2613 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
2614 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
2615 }
2616
2617 /**
2618 * Secure system settings, containing system preferences that applications
2619 * can read but are not allowed to write. These are for preferences that
2620 * the user must explicitly modify through the system UI or specialized
2621 * APIs for those values, not modified directly by applications.
2622 */
2623 public static final class Secure extends NameValueTable {
2624 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
2625
Dianne Hackborn139748f2012-09-24 11:36:57 -07002626 /**
2627 * The content:// style URL for this table
2628 */
2629 public static final Uri CONTENT_URI =
2630 Uri.parse("content://" + AUTHORITY + "/secure");
2631
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002632 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07002633 private static final NameValueCache sNameValueCache = new NameValueCache(
2634 SYS_PROP_SETTING_VERSION,
2635 CONTENT_URI,
2636 CALL_METHOD_GET_SECURE,
2637 CALL_METHOD_PUT_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002638
Amith Yamasani52c489c2012-03-28 11:42:42 -07002639 private static ILockSettings sLockSettings = null;
2640
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07002641 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07002642 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07002643 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07002644 static {
2645 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
2646 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
2647 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
2648 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07002649
2650 MOVED_TO_GLOBAL = new HashSet<String>();
2651 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
2652 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
2653 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate58f41ec2013-01-11 15:40:36 -08002654 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
Christopher Tate06efb532012-08-24 15:29:27 -07002655 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
2656 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
2657 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
2658 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
2659 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
2660 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
2661 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
2662 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
2663 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_DENSITY_FORCED);
2664 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
2665 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
2666 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
2667 MOVED_TO_GLOBAL.add(Settings.Global.INSTALL_NON_MARKET_APPS);
2668 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
2669 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
2670 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
2671 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
2672 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
2673 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
2674 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
2675 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
2676 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_REPORT_XT_OVER_DEV);
2677 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
2678 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
2679 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
2680 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
2681 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
2682 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
2683 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
2684 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
2685 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
2686 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
2687 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
2688 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
2689 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
2690 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
2691 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
2692 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
2693 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
2694 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
2695 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
2696 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
2697 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
2698 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
2699 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
2700 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
2701 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
2702 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
2703 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07002704 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
2705 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
2706 MOVED_TO_GLOBAL.add(Settings.Global.WEB_AUTOFILL_QUERY_URL);
2707 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
2708 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
2709 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
2710 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
2711 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
2712 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
2713 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
2714 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
2715 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
2716 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
2717 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
2718 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
2719 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
2720 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07002721 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
2722 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07002723 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07002724 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
2725 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
2726 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
2727 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
2728 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
2729 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07002730 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07002731 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
2732 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
2733 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
2734 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
2735 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
2736 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
2737 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
2738 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
2739 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
2740 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
2741 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
2742 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
2743 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
2744 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
2745 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
2746 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
2747 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
2748 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
2749 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
2750 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
2751 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
2752 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
2753 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
2754 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
2755 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
2756 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
2757 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
2758 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
2759 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
2760 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
2761 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002762 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
2763 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_CDMA_SUBSCRIPTION);
Christopher Tate06efb532012-08-24 15:29:27 -07002764 }
2765
Christopher Tate66488d62012-10-02 11:58:01 -07002766 /** @hide */
2767 public static void getMovedKeys(HashSet<String> outKeySet) {
2768 outKeySet.addAll(MOVED_TO_GLOBAL);
2769 }
2770
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002771 /**
2772 * Look up a name in the database.
2773 * @param resolver to access the database with
2774 * @param name to look up in the table
2775 * @return the corresponding value, or null if not present
2776 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07002777 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07002778 return getStringForUser(resolver, name, UserHandle.myUserId());
2779 }
2780
2781 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07002782 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07002783 int userHandle) {
2784 if (MOVED_TO_GLOBAL.contains(name)) {
2785 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
2786 + " to android.provider.Settings.Global.");
2787 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002788 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07002789
Dianne Hackborn139748f2012-09-24 11:36:57 -07002790 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
2791 synchronized (Secure.class) {
2792 if (sLockSettings == null) {
2793 sLockSettings = ILockSettings.Stub.asInterface(
2794 (IBinder) ServiceManager.getService("lock_settings"));
2795 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
2796 }
2797 }
2798 if (sLockSettings != null && !sIsSystemProcess) {
2799 try {
2800 return sLockSettings.getString(name, "0", userHandle);
2801 } catch (RemoteException re) {
2802 // Fall through
2803 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07002804 }
2805 }
2806
Christopher Tate06efb532012-08-24 15:29:27 -07002807 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002808 }
2809
2810 /**
2811 * Store a name/value pair into the database.
2812 * @param resolver to access the database with
2813 * @param name to store
2814 * @param value to associate with the name
2815 * @return true if the value was set, false on database errors
2816 */
Christopher Tate06efb532012-08-24 15:29:27 -07002817 public static boolean putString(ContentResolver resolver, String name, String value) {
2818 return putStringForUser(resolver, name, value, UserHandle.myUserId());
2819 }
2820
2821 /** @hide */
2822 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
2823 int userHandle) {
2824 if (MOVED_TO_GLOBAL.contains(name)) {
2825 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2826 + " to android.provider.Settings.Global");
2827 return Global.putStringForUser(resolver, name, value, userHandle);
2828 }
Christopher Tate06efb532012-08-24 15:29:27 -07002829 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002830 }
2831
2832 /**
2833 * Construct the content URI for a particular name/value pair,
2834 * useful for monitoring changes with a ContentObserver.
2835 * @param name to look up in the table
2836 * @return the corresponding content URI, or null if not present
2837 */
2838 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07002839 if (MOVED_TO_GLOBAL.contains(name)) {
2840 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
2841 + " to android.provider.Settings.Global, returning global URI.");
2842 return Global.getUriFor(Global.CONTENT_URI, name);
2843 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002844 return getUriFor(CONTENT_URI, name);
2845 }
2846
2847 /**
2848 * Convenience function for retrieving a single secure settings value
2849 * as an integer. Note that internally setting values are always
2850 * stored as strings; this function converts the string to an integer
2851 * for you. The default value will be returned if the setting is
2852 * not defined or not an integer.
2853 *
2854 * @param cr The ContentResolver to access.
2855 * @param name The name of the setting to retrieve.
2856 * @param def Value to return if the setting is not defined.
2857 *
2858 * @return The setting's current value, or 'def' if it is not defined
2859 * or not a valid integer.
2860 */
2861 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002862 return getIntForUser(cr, name, def, UserHandle.myUserId());
2863 }
2864
2865 /** @hide */
2866 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
2867 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002868 try {
2869 return v != null ? Integer.parseInt(v) : def;
2870 } catch (NumberFormatException e) {
2871 return def;
2872 }
2873 }
2874
2875 /**
2876 * Convenience function for retrieving a single secure settings value
2877 * as an integer. Note that internally setting values are always
2878 * stored as strings; this function converts the string to an integer
2879 * for you.
2880 * <p>
2881 * This version does not take a default value. If the setting has not
2882 * been set, or the string value is not a number,
2883 * it throws {@link SettingNotFoundException}.
2884 *
2885 * @param cr The ContentResolver to access.
2886 * @param name The name of the setting to retrieve.
2887 *
2888 * @throws SettingNotFoundException Thrown if a setting by the given
2889 * name can't be found or the setting value is not an integer.
2890 *
2891 * @return The setting's current value.
2892 */
2893 public static int getInt(ContentResolver cr, String name)
2894 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07002895 return getIntForUser(cr, name, UserHandle.myUserId());
2896 }
2897
2898 /** @hide */
2899 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
2900 throws SettingNotFoundException {
2901 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002902 try {
2903 return Integer.parseInt(v);
2904 } catch (NumberFormatException e) {
2905 throw new SettingNotFoundException(name);
2906 }
2907 }
2908
2909 /**
2910 * Convenience function for updating a single settings value as an
2911 * integer. This will either create a new entry in the table if the
2912 * given name does not exist, or modify the value of the existing row
2913 * with that name. Note that internally setting values are always
2914 * stored as strings, so this function converts the given value to a
2915 * string before storing it.
2916 *
2917 * @param cr The ContentResolver to access.
2918 * @param name The name of the setting to modify.
2919 * @param value The new value for the setting.
2920 * @return true if the value was set, false on database errors
2921 */
2922 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07002923 return putIntForUser(cr, name, value, UserHandle.myUserId());
2924 }
2925
2926 /** @hide */
2927 public static boolean putIntForUser(ContentResolver cr, String name, int value,
2928 int userHandle) {
2929 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002930 }
2931
2932 /**
2933 * Convenience function for retrieving a single secure settings value
2934 * as a {@code long}. Note that internally setting values are always
2935 * stored as strings; this function converts the string to a {@code long}
2936 * for you. The default value will be returned if the setting is
2937 * not defined or not a {@code long}.
2938 *
2939 * @param cr The ContentResolver to access.
2940 * @param name The name of the setting to retrieve.
2941 * @param def Value to return if the setting is not defined.
2942 *
2943 * @return The setting's current value, or 'def' if it is not defined
2944 * or not a valid {@code long}.
2945 */
2946 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002947 return getLongForUser(cr, name, def, UserHandle.myUserId());
2948 }
2949
2950 /** @hide */
2951 public static long getLongForUser(ContentResolver cr, String name, long def,
2952 int userHandle) {
2953 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002954 long value;
2955 try {
2956 value = valString != null ? Long.parseLong(valString) : def;
2957 } catch (NumberFormatException e) {
2958 value = def;
2959 }
2960 return value;
2961 }
2962
2963 /**
2964 * Convenience function for retrieving a single secure settings value
2965 * as a {@code long}. Note that internally setting values are always
2966 * stored as strings; this function converts the string to a {@code long}
2967 * for you.
2968 * <p>
2969 * This version does not take a default value. If the setting has not
2970 * been set, or the string value is not a number,
2971 * it throws {@link SettingNotFoundException}.
2972 *
2973 * @param cr The ContentResolver to access.
2974 * @param name The name of the setting to retrieve.
2975 *
2976 * @return The setting's current value.
2977 * @throws SettingNotFoundException Thrown if a setting by the given
2978 * name can't be found or the setting value is not an integer.
2979 */
2980 public static long getLong(ContentResolver cr, String name)
2981 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07002982 return getLongForUser(cr, name, UserHandle.myUserId());
2983 }
2984
2985 /** @hide */
2986 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
2987 throws SettingNotFoundException {
2988 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002989 try {
2990 return Long.parseLong(valString);
2991 } catch (NumberFormatException e) {
2992 throw new SettingNotFoundException(name);
2993 }
2994 }
2995
2996 /**
2997 * Convenience function for updating a secure settings value as a long
2998 * integer. This will either create a new entry in the table if the
2999 * given name does not exist, or modify the value of the existing row
3000 * with that name. Note that internally setting values are always
3001 * stored as strings, so this function converts the given value to a
3002 * string before storing it.
3003 *
3004 * @param cr The ContentResolver to access.
3005 * @param name The name of the setting to modify.
3006 * @param value The new value for the setting.
3007 * @return true if the value was set, false on database errors
3008 */
3009 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003010 return putLongForUser(cr, name, value, UserHandle.myUserId());
3011 }
3012
3013 /** @hide */
3014 public static boolean putLongForUser(ContentResolver cr, String name, long value,
3015 int userHandle) {
3016 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003017 }
3018
3019 /**
3020 * Convenience function for retrieving a single secure settings value
3021 * as a floating point number. Note that internally setting values are
3022 * always stored as strings; this function converts the string to an
3023 * float for you. The default value will be returned if the setting
3024 * is not defined or not a valid float.
3025 *
3026 * @param cr The ContentResolver to access.
3027 * @param name The name of the setting to retrieve.
3028 * @param def Value to return if the setting is not defined.
3029 *
3030 * @return The setting's current value, or 'def' if it is not defined
3031 * or not a valid float.
3032 */
3033 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003034 return getFloatForUser(cr, name, def, UserHandle.myUserId());
3035 }
3036
3037 /** @hide */
3038 public static float getFloatForUser(ContentResolver cr, String name, float def,
3039 int userHandle) {
3040 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003041 try {
3042 return v != null ? Float.parseFloat(v) : def;
3043 } catch (NumberFormatException e) {
3044 return def;
3045 }
3046 }
3047
3048 /**
3049 * Convenience function for retrieving a single secure settings value
3050 * as a float. Note that internally setting values are always
3051 * stored as strings; this function converts the string to a float
3052 * for you.
3053 * <p>
3054 * This version does not take a default value. If the setting has not
3055 * been set, or the string value is not a number,
3056 * it throws {@link SettingNotFoundException}.
3057 *
3058 * @param cr The ContentResolver to access.
3059 * @param name The name of the setting to retrieve.
3060 *
3061 * @throws SettingNotFoundException Thrown if a setting by the given
3062 * name can't be found or the setting value is not a float.
3063 *
3064 * @return The setting's current value.
3065 */
3066 public static float getFloat(ContentResolver cr, String name)
3067 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003068 return getFloatForUser(cr, name, UserHandle.myUserId());
3069 }
3070
3071 /** @hide */
3072 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
3073 throws SettingNotFoundException {
3074 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08003075 if (v == null) {
3076 throw new SettingNotFoundException(name);
3077 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003078 try {
3079 return Float.parseFloat(v);
3080 } catch (NumberFormatException e) {
3081 throw new SettingNotFoundException(name);
3082 }
3083 }
3084
3085 /**
3086 * Convenience function for updating a single settings value as a
3087 * floating point number. This will either create a new entry in the
3088 * table if the given name does not exist, or modify the value of the
3089 * existing row with that name. Note that internally setting values
3090 * are always stored as strings, so this function converts the given
3091 * value to a string before storing it.
3092 *
3093 * @param cr The ContentResolver to access.
3094 * @param name The name of the setting to modify.
3095 * @param value The new value for the setting.
3096 * @return true if the value was set, false on database errors
3097 */
3098 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003099 return putFloatForUser(cr, name, value, UserHandle.myUserId());
3100 }
3101
3102 /** @hide */
3103 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
3104 int userHandle) {
3105 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003106 }
3107
3108 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003109 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
3110 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08003111 */
Christopher Tate06efb532012-08-24 15:29:27 -07003112 @Deprecated
3113 public static final String DEVELOPMENT_SETTINGS_ENABLED =
3114 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08003115
3116 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003117 * When the user has enable the option to have a "bug report" command
3118 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08003119 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003120 * @hide
3121 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08003122 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003123 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
3124
3125 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003126 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003127 */
Christopher Tate06efb532012-08-24 15:29:27 -07003128 @Deprecated
3129 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003130
3131 /**
3132 * Setting to allow mock locations and location provider status to be injected into the
3133 * LocationManager service for testing purposes during application development. These
3134 * locations and status values override actual location and status information generated
3135 * by network, gps, or other location providers.
3136 */
3137 public static final String ALLOW_MOCK_LOCATION = "mock_location";
3138
3139 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08003140 * A 64-bit number (as a hex string) that is randomly
3141 * generated on the device's first boot and should remain
3142 * constant for the lifetime of the device. (The value may
3143 * change if a factory reset is performed on the device.)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003144 */
3145 public static final String ANDROID_ID = "android_id";
3146
3147 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003148 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003149 */
Christopher Tate06efb532012-08-24 15:29:27 -07003150 @Deprecated
3151 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003152
3153 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003154 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003155 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07003156 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003157 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003158
3159 /**
3160 * Setting to record the input method used by default, holding the ID
3161 * of the desired method.
3162 */
3163 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
3164
3165 /**
satokab751aa2010-09-14 19:17:36 +09003166 * Setting to record the input method subtype used by default, holding the ID
3167 * of the desired method.
3168 */
3169 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
3170 "selected_input_method_subtype";
3171
3172 /**
satok723a27e2010-11-11 14:58:11 +09003173 * Setting to record the history of input method subtype, holding the pair of ID of IME
3174 * and its last used subtype.
3175 * @hide
3176 */
3177 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
3178 "input_methods_subtype_history";
3179
3180 /**
satok5c58dfc2010-12-14 21:54:47 +09003181 * Setting to record the visibility of input method selector
3182 */
3183 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
3184 "input_method_selector_visibility";
3185
3186 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003187 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003188 */
Christopher Tate06efb532012-08-24 15:29:27 -07003189 @Deprecated
3190 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003191
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003192 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07003193 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
3194 * @hide
3195 */
3196 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
3197
3198 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003199 * List of input methods that are currently enabled. This is a string
3200 * containing the IDs of all enabled input methods, each ID separated
3201 * by ':'.
3202 */
3203 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003204
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003205 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07003206 * List of system input methods that are currently disabled. This is a string
3207 * containing the IDs of all disabled input methods, each ID separated
3208 * by ':'.
3209 * @hide
3210 */
3211 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
3212
3213 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003214 * Host name and port for global http proxy. Uses ':' seperator for
3215 * between host and port.
3216 *
3217 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003218 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07003219 @Deprecated
3220 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07003221
3222 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003223 * @deprecated Use {@link android.provider.Settings.Global#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003224 */
Christopher Tate06efb532012-08-24 15:29:27 -07003225 @Deprecated
3226 public static final String INSTALL_NON_MARKET_APPS = Global.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003227
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003228 /**
3229 * Comma-separated list of location providers that activities may access.
3230 */
3231 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003232
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003233 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04003234 * A flag containing settings used for biometric weak
3235 * @hide
3236 */
3237 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
3238 "lock_biometric_weak_flags";
3239
3240 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08003241 * Whether autolock is enabled (0 = false, 1 = true)
3242 */
3243 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
3244
3245 /**
3246 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
3247 */
3248 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
3249
3250 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07003251 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
3252 * true)
3253 *
3254 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
3255 * lockscreen uses
3256 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Amith Yamasani156c4352010-03-05 17:10:03 -08003257 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07003258 @Deprecated
3259 public static final String
3260 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08003261
3262 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07003263 * This preference allows the device to be locked given time after screen goes off,
3264 * subject to current DeviceAdmin policy limits.
3265 * @hide
3266 */
3267 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
3268
3269
3270 /**
John Spurlock5f050e52012-10-27 10:44:19 -04003271 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07003272 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07003273 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07003274 */
3275 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
3276
3277 /**
John Spurlock5f050e52012-10-27 10:44:19 -04003278 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07003279 * @hide
3280 */
Michael Jurkaaa2859a2012-10-24 12:46:49 -07003281 public static final String LOCK_SCREEN_APPWIDGET_IDS =
3282 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07003283
3284 /**
Jim Miller51117262012-11-04 17:58:09 -08003285 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
3286 * @hide
3287 */
3288 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
3289 "lock_screen_fallback_appwidget_id";
3290
3291 /**
John Spurlock5f050e52012-10-27 10:44:19 -04003292 * Index of the lockscreen appwidget to restore, -1 if none.
3293 * @hide
3294 */
3295 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
3296 "lock_screen_sticky_appwidget";
3297
3298 /**
3299 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07003300 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07003301 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07003302 */
3303 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
3304 "lock_screen_owner_info_enabled";
3305
3306 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003307 * The Logging ID (a unique 64-bit value) as a hex string.
3308 * Used as a pseudonymous identifier for logging.
3309 * @deprecated This identifier is poorly initialized and has
3310 * many collisions. It should not be used.
3311 */
3312 @Deprecated
3313 public static final String LOGGING_ID = "logging_id";
3314
3315 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003316 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003317 */
Christopher Tate06efb532012-08-24 15:29:27 -07003318 @Deprecated
3319 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003320
3321 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08003322 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003323 */
3324 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003325
3326 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08003327 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003328 */
3329 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003330
3331 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08003332 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003333 */
3334 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003335
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003336 /**
3337 * Settings classname to launch when Settings is clicked from All
3338 * Applications. Needed because of user testing between the old
3339 * and new Settings apps.
3340 */
3341 // TODO: 881807
3342 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003343
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003344 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003345 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003346 */
Christopher Tate06efb532012-08-24 15:29:27 -07003347 @Deprecated
3348 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003349
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003350 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003351 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003352 */
Christopher Tate06efb532012-08-24 15:29:27 -07003353 @Deprecated
3354 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003355
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003356 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07003357 * If accessibility is enabled.
3358 */
3359 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
3360
3361 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07003362 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07003363 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07003364 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07003365
3366 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07003367 * List of the enabled accessibility providers.
3368 */
3369 public static final String ENABLED_ACCESSIBILITY_SERVICES =
3370 "enabled_accessibility_services";
3371
3372 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07003373 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07003374 * permission to put the device into touch exploration mode.
3375 *
3376 * @hide
3377 */
3378 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
3379 "touch_exploration_granted_accessibility_services";
3380
3381 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08003382 * Whether to speak passwords while in accessibility mode.
3383 */
3384 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
3385
3386 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003387 * If injection of accessibility enhancing JavaScript screen-reader
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003388 * is enabled.
3389 * <p>
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003390 * Note: The JavaScript based screen-reader is served by the
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003391 * Google infrastructure and enable users with disabilities to
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07003392 * efficiently navigate in and explore web content.
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003393 * </p>
3394 * <p>
3395 * This property represents a boolean value.
3396 * </p>
3397 * @hide
3398 */
3399 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
3400 "accessibility_script_injection";
3401
3402 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003403 * The URL for the injected JavaScript based screen-reader used
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07003404 * for providing accessibility of content in WebView.
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003405 * <p>
3406 * Note: The JavaScript based screen-reader is served by the
3407 * Google infrastructure and enable users with disabilities to
3408 * efficiently navigate in and explore web content.
3409 * </p>
3410 * <p>
3411 * This property represents a string value.
3412 * </p>
3413 * @hide
3414 */
3415 public static final String ACCESSIBILITY_SCREEN_READER_URL =
3416 "accessibility_script_injection_url";
3417
3418 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003419 * Key bindings for navigation in built-in accessibility support for web content.
3420 * <p>
3421 * Note: These key bindings are for the built-in accessibility navigation for
3422 * web content which is used as a fall back solution if JavaScript in a WebView
3423 * is not enabled or the user has not opted-in script injection from Google.
3424 * </p>
3425 * <p>
3426 * The bindings are separated by semi-colon. A binding is a mapping from
3427 * a key to a sequence of actions (for more details look at
3428 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
3429 * string representation of an integer obtained from a meta state (optional) shifted
3430 * sixteen times left and bitwise ored with a key code. An action is represented
3431 * as a hexademical string representation of an integer where the first two digits
3432 * are navigation action index, the second, the third, and the fourth digit pairs
3433 * represent the action arguments. The separate actions in a binding are colon
3434 * separated. The key and the action sequence it maps to are separated by equals.
3435 * </p>
3436 * <p>
3437 * For example, the binding below maps the DPAD right button to traverse the
3438 * current navigation axis once without firing an accessibility event and to
3439 * perform the same traversal again but to fire an event:
3440 * <code>
3441 * 0x16=0x01000100:0x01000101;
3442 * </code>
3443 * </p>
3444 * <p>
3445 * The goal of this binding is to enable dynamic rebinding of keys to
3446 * navigation actions for web content without requiring a framework change.
3447 * </p>
3448 * <p>
3449 * This property represents a string value.
3450 * </p>
3451 * @hide
3452 */
3453 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
3454 "accessibility_web_content_key_bindings";
3455
3456 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07003457 * Setting that specifies whether the display magnification is enabled.
3458 * Display magnifications allows the user to zoom in the display content
3459 * and is targeted to low vision users. The current magnification scale
3460 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
3461 *
3462 * @hide
3463 */
3464 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
3465 "accessibility_display_magnification_enabled";
3466
3467 /**
3468 * Setting that specifies what the display magnification scale is.
3469 * Display magnifications allows the user to zoom in the display
3470 * content and is targeted to low vision users. Whether a display
3471 * magnification is performed is controlled by
3472 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
3473 *
3474 * @hide
3475 */
3476 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
3477 "accessibility_display_magnification_scale";
3478
3479 /**
3480 * Setting that specifies whether the display magnification should be
3481 * automatically updated. If this fearture is enabled the system will
3482 * exit magnification mode or pan the viewport when a context change
3483 * occurs. For example, on staring a new activity or rotating the screen,
3484 * the system may zoom out so the user can see the new context he is in.
3485 * Another example is on showing a window that is not visible in the
3486 * magnified viewport the system may pan the viewport to make the window
3487 * the has popped up so the user knows that the context has changed.
3488 * Whether a screen magnification is performed is controlled by
3489 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
3490 *
3491 * @hide
3492 */
3493 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
3494 "accessibility_display_magnification_auto_update";
3495
3496 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08003497 * The timout for considering a press to be a long press in milliseconds.
3498 * @hide
3499 */
3500 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
3501
3502 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07003503 * Setting to always use the default text-to-speech settings regardless
3504 * of the application settings.
3505 * 1 = override application settings,
3506 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01003507 *
3508 * @deprecated The value of this setting is no longer respected by
3509 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07003510 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003511 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07003512 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
3513
3514 /**
3515 * Default text-to-speech engine speech rate. 100 = 1x
3516 */
3517 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
3518
3519 /**
3520 * Default text-to-speech engine pitch. 100 = 1x
3521 */
3522 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
3523
3524 /**
3525 * Default text-to-speech engine.
3526 */
3527 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
3528
3529 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07003530 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01003531 *
3532 * @deprecated this setting is no longer in use, as of the Ice Cream
3533 * Sandwich release. Apps should never need to read this setting directly,
3534 * instead can query the TextToSpeech framework classes for the default
3535 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07003536 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003537 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07003538 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
3539
3540 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003541 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01003542 *
3543 * @deprecated this setting is no longer in use, as of the Ice Cream
3544 * Sandwich release. Apps should never need to read this setting directly,
3545 * instead can query the TextToSpeech framework classes for the default
3546 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003547 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003548 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003549 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
3550
3551 /**
3552 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01003553 *
3554 * @deprecated this setting is no longer in use, as of the Ice Cream
3555 * Sandwich release. Apps should never need to read this setting directly,
3556 * instead can query the TextToSpeech framework classes for the
3557 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003558 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003559 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003560 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
3561
3562 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01003563 * Stores the default tts locales on a per engine basis. Stored as
3564 * a comma seperated list of values, each value being of the form
3565 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01003566 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
3567 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
3568 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
3569 * setting directly, and can query the TextToSpeech framework classes
3570 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01003571 *
3572 * @hide
3573 */
3574 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
3575
3576 /**
Charles Chenceffa152010-03-16 21:18:10 -07003577 * Space delimited list of plugin packages that are enabled.
3578 */
3579 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
3580
3581 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003582 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
3583 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003584 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003585 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003586 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003587 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003588
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003589 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003590 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
3591 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003592 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003593 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003594 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003595 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003596
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003597 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003598 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
3599 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003600 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003601 @Deprecated
3602 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
3603 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003604
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003605 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003606 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
3607 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003608 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003609 @Deprecated
3610 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003611
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003612 /**
3613 * The acceptable packet loss percentage (range 0 - 100) before trying
3614 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003615 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003616 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003617 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003618 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
3619 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003620
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003621 /**
3622 * The number of access points required for a network in order for the
3623 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003624 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003625 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003626 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003627 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003628
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003629 /**
3630 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003631 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003632 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003633 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003634 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
3635 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003636
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003637 /**
3638 * Whether the Wi-Fi watchdog is enabled for background checking even
3639 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003640 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003641 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003642 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003643 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
3644 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003645
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003646 /**
3647 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003648 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003649 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003650 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003651 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
3652 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003653
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003654 /**
3655 * The number of initial pings to perform that *may* be ignored if they
3656 * fail. Again, if these fail, they will *not* be used in packet loss
3657 * calculation. For example, one network always seemed to time out for
3658 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003659 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003660 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003661 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003662 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
3663 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003664
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003665 /**
3666 * The maximum number of access points (per network) to attempt to test.
3667 * If this number is reached, the watchdog will no longer monitor the
3668 * initial connection state for the network. This is a safeguard for
3669 * networks containing multiple APs whose DNS does not respond to pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003670 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003671 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003672 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003673 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003674
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003675 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07003676 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003677 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07003678 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003679 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
3680
3681 /**
3682 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003683 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003684 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003685 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003686 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
3687
3688 /**
3689 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003690 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003691 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003692 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003693 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003694
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003695 /**
3696 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003697 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003698 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003699 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003700 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003701
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003702 /**
3703 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003704 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003705 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003706 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003707 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003708
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003709 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003710 * @deprecated Use
3711 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003712 */
Christopher Tate06efb532012-08-24 15:29:27 -07003713 @Deprecated
3714 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003715
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003716 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003717 * @deprecated Use
3718 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003719 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07003720 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003721 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003722 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003723
3724 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003725 * Whether background data usage is allowed.
3726 *
3727 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
3728 * availability of background data depends on several
3729 * combined factors. When background data is unavailable,
3730 * {@link ConnectivityManager#getActiveNetworkInfo()} will
3731 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003732 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07003733 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003734 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07003735
3736 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00003737 * Origins for which browsers should allow geolocation by default.
3738 * The value is a space-separated list of origins.
3739 */
3740 public static final String ALLOWED_GEOLOCATION_ORIGINS
3741 = "allowed_geolocation_origins";
3742
3743 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07003744 * The preferred TTY mode 0 = TTy Off, CDMA default
3745 * 1 = TTY Full
3746 * 2 = TTY HCO
3747 * 3 = TTY VCO
3748 * @hide
3749 */
3750 public static final String PREFERRED_TTY_MODE =
3751 "preferred_tty_mode";
3752
Wink Saville04e71b32009-04-02 11:00:54 -07003753 /**
Wink Saville04e71b32009-04-02 11:00:54 -07003754 * Whether the enhanced voice privacy mode is enabled.
3755 * 0 = normal voice privacy
3756 * 1 = enhanced voice privacy
3757 * @hide
3758 */
3759 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
3760
3761 /**
3762 * Whether the TTY mode mode is enabled.
3763 * 0 = disabled
3764 * 1 = enabled
3765 * @hide
3766 */
3767 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003768
3769 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07003770 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07003771 * Type: int ( 0 = disabled, 1 = enabled )
3772 * @hide
3773 */
3774 public static final String BACKUP_ENABLED = "backup_enabled";
3775
3776 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08003777 * Controls whether application data is automatically restored from backup
3778 * at install time.
3779 * Type: int ( 0 = disabled, 1 = enabled )
3780 * @hide
3781 */
3782 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
3783
3784 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07003785 * Indicates whether settings backup has been fully provisioned.
3786 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
3787 * @hide
3788 */
3789 public static final String BACKUP_PROVISIONED = "backup_provisioned";
3790
3791 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07003792 * Component of the transport to use for backup/restore.
3793 * @hide
3794 */
3795 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07003796
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07003797 /**
3798 * Version for which the setup wizard was last shown. Bumped for
3799 * each release when there is new setup information to show.
3800 * @hide
3801 */
3802 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07003803
3804 /**
Doug Zongker43866e02010-01-07 12:09:54 -08003805 * The interval in milliseconds after which Wi-Fi is considered idle.
3806 * When idle, it is possible for the device to be switched from Wi-Fi to
3807 * the mobile data network.
3808 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003809 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
3810 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08003811 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003812 @Deprecated
3813 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08003814
3815 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01003816 * The global search provider chosen by the user (if multiple global
3817 * search providers are installed). This will be the provider returned
3818 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
3819 * installed. This setting is stored as a flattened component name as
3820 * per {@link ComponentName#flattenToString()}.
3821 *
3822 * @hide
3823 */
3824 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
3825 "search_global_search_activity";
3826
3827 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003828 * The number of promoted sources in GlobalSearch.
3829 * @hide
3830 */
3831 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
3832 /**
3833 * The maximum number of suggestions returned by GlobalSearch.
3834 * @hide
3835 */
3836 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
3837 /**
3838 * The number of suggestions GlobalSearch will ask each non-web search source for.
3839 * @hide
3840 */
3841 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
3842 /**
3843 * The number of suggestions the GlobalSearch will ask the web search source for.
3844 * @hide
3845 */
3846 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
3847 "search_web_results_override_limit";
3848 /**
3849 * The number of milliseconds that GlobalSearch will wait for suggestions from
3850 * promoted sources before continuing with all other sources.
3851 * @hide
3852 */
3853 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
3854 "search_promoted_source_deadline_millis";
3855 /**
3856 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
3857 * @hide
3858 */
3859 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
3860 /**
3861 * The maximum number of milliseconds that GlobalSearch shows the previous results
3862 * after receiving a new query.
3863 * @hide
3864 */
3865 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
3866 /**
3867 * The maximum age of log data used for shortcuts in GlobalSearch.
3868 * @hide
3869 */
3870 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
3871 /**
3872 * The maximum age of log data used for source ranking in GlobalSearch.
3873 * @hide
3874 */
3875 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
3876 "search_max_source_event_age_millis";
3877 /**
3878 * The minimum number of impressions needed to rank a source in GlobalSearch.
3879 * @hide
3880 */
3881 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
3882 "search_min_impressions_for_source_ranking";
3883 /**
3884 * The minimum number of clicks needed to rank a source in GlobalSearch.
3885 * @hide
3886 */
3887 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
3888 "search_min_clicks_for_source_ranking";
3889 /**
3890 * The maximum number of shortcuts shown by GlobalSearch.
3891 * @hide
3892 */
3893 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
3894 /**
3895 * The size of the core thread pool for suggestion queries in GlobalSearch.
3896 * @hide
3897 */
3898 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
3899 "search_query_thread_core_pool_size";
3900 /**
3901 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
3902 * @hide
3903 */
3904 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
3905 "search_query_thread_max_pool_size";
3906 /**
3907 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
3908 * @hide
3909 */
3910 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
3911 "search_shortcut_refresh_core_pool_size";
3912 /**
3913 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
3914 * @hide
3915 */
3916 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
3917 "search_shortcut_refresh_max_pool_size";
3918 /**
3919 * The maximun time that excess threads in the GlobalSeach thread pools will
3920 * wait before terminating.
3921 * @hide
3922 */
3923 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
3924 "search_thread_keepalive_seconds";
3925 /**
3926 * The maximum number of concurrent suggestion queries to each source.
3927 * @hide
3928 */
3929 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
3930 "search_per_source_concurrent_query_limit";
3931
San Mehat87734d32010-01-08 12:53:06 -08003932 /**
3933 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
3934 * @hide
3935 */
3936 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
3937
3938 /**
3939 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
3940 * @hide
3941 */
3942 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
3943
3944 /**
3945 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
3946 * @hide
3947 */
3948 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
3949
3950 /**
3951 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
3952 * @hide
3953 */
3954 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003955
Dan Egnor42471dd2010-01-07 17:25:22 -08003956 /**
3957 * If nonzero, ANRs in invisible background processes bring up a dialog.
3958 * Otherwise, the process will be silently killed.
3959 * @hide
3960 */
3961 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08003962
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08003963 /**
3964 * The {@link ComponentName} string of the service to be used as the voice recognition
3965 * service.
Erikeebc8e22010-02-18 13:27:19 -08003966 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08003967 * @hide
3968 */
3969 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08003970
satok988323c2011-06-22 16:38:13 +09003971
3972 /**
satokada8c4e2011-08-23 14:56:56 +09003973 * The {@link ComponentName} string of the selected spell checker service which is
3974 * one of the services managed by the text service manager.
3975 *
3976 * @hide
3977 */
3978 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
3979
3980 /**
3981 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09003982 * service which is one of the services managed by the text service manager.
3983 *
3984 * @hide
3985 */
satokada8c4e2011-08-23 14:56:56 +09003986 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
3987 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09003988
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003989 /**
satoka33c4fc2011-08-25 16:50:11 +09003990 * The {@link ComponentName} string whether spell checker is enabled or not.
3991 *
3992 * @hide
3993 */
3994 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
3995
3996 /**
David Brown458e8062010-03-08 21:52:11 -08003997 * What happens when the user presses the Power button while in-call
3998 * and the screen is on.<br/>
3999 * <b>Values:</b><br/>
4000 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
4001 * 2 - The Power button hangs up the current call.<br/>
4002 *
4003 * @hide
4004 */
4005 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
4006
4007 /**
4008 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
4009 * @hide
4010 */
4011 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
4012
4013 /**
4014 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
4015 * @hide
4016 */
4017 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
4018
4019 /**
4020 * INCALL_POWER_BUTTON_BEHAVIOR default value.
4021 * @hide
4022 */
4023 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
4024 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
4025
4026 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07004027 * The current night mode that has been selected by the user. Owned
4028 * and controlled by UiModeManagerService. Constants are as per
4029 * UiModeManager.
4030 * @hide
4031 */
4032 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07004033
4034 /**
John Spurlock1a868b72012-08-22 09:56:51 -04004035 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04004036 * @hide
4037 */
Daniel Sandler2d545362011-11-17 10:38:37 -08004038 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04004039
4040 /**
John Spurlock1a868b72012-08-22 09:56:51 -04004041 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08004042 *
John Spurlock1a868b72012-08-22 09:56:51 -04004043 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08004044 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04004045 * @hide
4046 */
John Spurlock1a868b72012-08-22 09:56:51 -04004047 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08004048
4049 /**
John Spurlock1a868b72012-08-22 09:56:51 -04004050 * If screensavers are enabled, whether the screensaver should be automatically launched
4051 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08004052 * @hide
4053 */
4054 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04004055
John Spurlock1a868b72012-08-22 09:56:51 -04004056 /**
4057 * If screensavers are enabled, whether the screensaver should be automatically launched
4058 * when the screen times out when not on battery.
4059 * @hide
4060 */
4061 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
4062
4063 /**
4064 * If screensavers are enabled, the default screensaver component.
4065 * @hide
4066 */
4067 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
4068
Daniel Sandler0601eb72011-04-13 01:01:32 -04004069 /**
Daniel Sandler4b749ef2013-03-18 21:53:04 -04004070 * Name of a package that the current user has explicitly allowed to see all of that
4071 * user's notifications.
4072 *
4073 * @hide
4074 */
4075 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
4076
4077 /**
Yorke Lee647f8f32013-05-07 10:49:44 -07004078 * Whether or not to enable the dial pad autocomplete functionality.
4079 *
4080 * @hide
4081 */
4082 public static final String DIALPAD_AUTOCOMPLETE = "dialpad_autocomplete";
4083
4084 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07004085 * This are the settings to be backed up.
4086 *
4087 * NOTE: Settings are backed up and restored in the order they appear
4088 * in this array. If you have one setting depending on another,
4089 * make sure that they are ordered appropriately.
4090 *
-b master501eec92009-07-06 13:53:11 -07004091 * @hide
4092 */
4093 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08004094 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07004095 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07004096 PARENTAL_CONTROL_ENABLED,
4097 PARENTAL_CONTROL_REDIRECT_URL,
Christopher Tate66488d62012-10-02 11:58:01 -07004098 USB_MASS_STORAGE_ENABLED, // moved to global
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07004099 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
4100 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
4101 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004102 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08004103 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07004104 ENABLED_ACCESSIBILITY_SERVICES,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07004105 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07004106 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07004107 ACCESSIBILITY_ENABLED,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08004108 ACCESSIBILITY_SPEAK_PASSWORD,
-b master501eec92009-07-06 13:53:11 -07004109 TTS_USE_DEFAULTS,
4110 TTS_DEFAULT_RATE,
4111 TTS_DEFAULT_PITCH,
4112 TTS_DEFAULT_SYNTH,
4113 TTS_DEFAULT_LANG,
4114 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07004115 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01004116 TTS_DEFAULT_LOCALE,
Christopher Tate66488d62012-10-02 11:58:01 -07004117 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
4118 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
4119 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
San Mehat87734d32010-01-08 12:53:06 -08004120 MOUNT_PLAY_NOTIFICATION_SND,
4121 MOUNT_UMS_AUTOSTART,
4122 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07004123 MOUNT_UMS_NOTIFY_ENABLED,
Yorke Lee647f8f32013-05-07 10:49:44 -07004124 UI_NIGHT_MODE,
4125 DIALPAD_AUTOCOMPLETE
-b master501eec92009-07-06 13:53:11 -07004126 };
4127
4128 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004129 * Helper method for determining if a location provider is enabled.
4130 * @param cr the content resolver to use
4131 * @param provider the location provider to query
4132 * @return true if the provider is enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004133 */
4134 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Victoria Leaseb711d572012-10-02 13:14:11 -07004135 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
4136 }
4137
4138 /**
4139 * Helper method for determining if a location provider is enabled.
4140 * @param cr the content resolver to use
4141 * @param provider the location provider to query
4142 * @param userId the userId to query
4143 * @return true if the provider is enabled
4144 * @hide
4145 */
4146 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
4147 String allowedProviders = Settings.Secure.getStringForUser(cr,
4148 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07004149 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004150 }
4151
4152 /**
4153 * Thread-safe method for enabling or disabling a single location provider.
4154 * @param cr the content resolver to use
4155 * @param provider the location provider to enable or disable
4156 * @param enabled true if the provider should be enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004157 */
4158 public static final void setLocationProviderEnabled(ContentResolver cr,
4159 String provider, boolean enabled) {
Victoria Leaseb711d572012-10-02 13:14:11 -07004160 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
4161 }
4162
4163 /**
4164 * Thread-safe method for enabling or disabling a single location provider.
4165 * @param cr the content resolver to use
4166 * @param provider the location provider to enable or disable
4167 * @param enabled true if the provider should be enabled
4168 * @param userId the userId for which to enable/disable providers
4169 * @hide
4170 */
4171 public static final void setLocationProviderEnabledForUser(ContentResolver cr,
4172 String provider, boolean enabled, int userId) {
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004173 // to ensure thread safety, we write the provider name with a '+' or '-'
4174 // and let the SettingsProvider handle it rather than reading and modifying
4175 // the list of enabled providers.
4176 if (enabled) {
4177 provider = "+" + provider;
4178 } else {
4179 provider = "-" + provider;
4180 }
Victoria Leaseb711d572012-10-02 13:14:11 -07004181 putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
4182 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004183 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004184 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004185
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004186 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004187 * Global system settings, containing preferences that always apply identically
4188 * to all defined users. Applications can read these but are not allowed to write;
4189 * like the "Secure" settings, these are for preferences that the user must
4190 * explicitly modify through the system UI or specialized APIs for those values.
4191 */
4192 public static final class Global extends NameValueTable {
4193 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_global_version";
4194
4195 /**
4196 * The content:// style URL for global secure settings items. Not public.
4197 */
4198 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
4199
4200 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004201 * Setting whether the global gesture for enabling accessibility is enabled.
4202 * If this gesture is enabled the user will be able to perfrom it to enable
4203 * the accessibility state without visiting the settings app.
4204 * @hide
4205 */
4206 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
4207 "enable_accessibility_global_gesture_enabled";
4208
4209 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004210 * Whether Airplane Mode is on.
4211 */
4212 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
4213
4214 /**
4215 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
4216 */
4217 public static final String RADIO_BLUETOOTH = "bluetooth";
4218
4219 /**
4220 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
4221 */
4222 public static final String RADIO_WIFI = "wifi";
4223
4224 /**
4225 * {@hide}
4226 */
4227 public static final String RADIO_WIMAX = "wimax";
4228 /**
4229 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
4230 */
4231 public static final String RADIO_CELL = "cell";
4232
4233 /**
4234 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
4235 */
4236 public static final String RADIO_NFC = "nfc";
4237
4238 /**
4239 * A comma separated list of radios that need to be disabled when airplane mode
4240 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
4241 * included in the comma separated list.
4242 */
4243 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
4244
4245 /**
4246 * A comma separated list of radios that should to be disabled when airplane mode
4247 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
4248 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
4249 * will be turned off when entering airplane mode, but the user will be able to reenable
4250 * Wifi in the Settings app.
4251 *
4252 * {@hide}
4253 */
4254 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
4255
4256 /**
4257 * The policy for deciding when Wi-Fi should go to sleep (which will in
4258 * turn switch to using the mobile data as an Internet connection).
4259 * <p>
4260 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
4261 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
4262 * {@link #WIFI_SLEEP_POLICY_NEVER}.
4263 */
4264 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
4265
4266 /**
4267 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
4268 * policy, which is to sleep shortly after the turning off
4269 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
4270 */
4271 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
4272
4273 /**
4274 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
4275 * the device is on battery, and never go to sleep when the device is
4276 * plugged in.
4277 */
4278 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
4279
4280 /**
4281 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
4282 */
4283 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
4284
4285 /**
4286 * Value to specify if the user prefers the date, time and time zone
4287 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
4288 */
4289 public static final String AUTO_TIME = "auto_time";
4290
4291 /**
4292 * Value to specify if the user prefers the time zone
4293 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
4294 */
4295 public static final String AUTO_TIME_ZONE = "auto_time_zone";
4296
4297 /**
4298 * URI for the car dock "in" event sound.
4299 * @hide
4300 */
4301 public static final String CAR_DOCK_SOUND = "car_dock_sound";
4302
4303 /**
4304 * URI for the car dock "out" event sound.
4305 * @hide
4306 */
4307 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
4308
4309 /**
4310 * URI for the desk dock "in" event sound.
4311 * @hide
4312 */
4313 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
4314
4315 /**
4316 * URI for the desk dock "out" event sound.
4317 * @hide
4318 */
4319 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
4320
4321 /**
4322 * Whether to play a sound for dock events.
4323 * @hide
4324 */
4325 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
4326
4327 /**
4328 * URI for the "device locked" (keyguard shown) sound.
4329 * @hide
4330 */
4331 public static final String LOCK_SOUND = "lock_sound";
4332
4333 /**
4334 * URI for the "device unlocked" sound.
4335 * @hide
4336 */
4337 public static final String UNLOCK_SOUND = "unlock_sound";
4338
4339 /**
4340 * URI for the low battery sound file.
4341 * @hide
4342 */
4343 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
4344
4345 /**
4346 * Whether to play a sound for low-battery alerts.
4347 * @hide
4348 */
4349 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
4350
4351 /**
Jeff Brown84e27562012-12-07 13:56:34 -08004352 * URI for the "wireless charging started" sound.
4353 * @hide
4354 */
4355 public static final String WIRELESS_CHARGING_STARTED_SOUND =
4356 "wireless_charging_started_sound";
4357
4358 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004359 * Whether we keep the device on while the device is plugged in.
4360 * Supported values are:
4361 * <ul>
4362 * <li>{@code 0} to never stay on while plugged in</li>
4363 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
4364 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
4365 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
4366 * </ul>
4367 * These values can be OR-ed together.
4368 */
4369 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
4370
4371 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08004372 * When the user has enable the option to have a "bug report" command
4373 * in the power menu.
4374 * @hide
4375 */
4376 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
4377
4378 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004379 * Whether ADB is enabled.
4380 */
4381 public static final String ADB_ENABLED = "adb_enabled";
4382
4383 /**
4384 * Whether assisted GPS should be enabled or not.
4385 * @hide
4386 */
4387 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
4388
4389 /**
4390 * Whether bluetooth is enabled/disabled
4391 * 0=disabled. 1=enabled.
4392 */
4393 public static final String BLUETOOTH_ON = "bluetooth_on";
4394
4395 /**
4396 * CDMA Cell Broadcast SMS
4397 * 0 = CDMA Cell Broadcast SMS disabled
4398 * 1 = CDMA Cell Broadcast SMS enabled
4399 * @hide
4400 */
4401 public static final String CDMA_CELL_BROADCAST_SMS =
4402 "cdma_cell_broadcast_sms";
4403
4404 /**
4405 * The CDMA roaming mode 0 = Home Networks, CDMA default
4406 * 1 = Roaming on Affiliated networks
4407 * 2 = Roaming on any networks
4408 * @hide
4409 */
4410 public static final String CDMA_ROAMING_MODE = "roaming_settings";
4411
4412 /**
4413 * The CDMA subscription mode 0 = RUIM/SIM (default)
4414 * 1 = NV
4415 * @hide
4416 */
4417 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
4418
4419 /** Inactivity timeout to track mobile data activity.
4420 *
4421 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
4422 * infer the data activity of mobile network. After a period of no activity on mobile
4423 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
4424 * intent is fired to indicate a transition of network status from "active" to "idle". Any
4425 * subsequent activity on mobile networks triggers the firing of {@code
4426 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
4427 *
4428 * Network activity refers to transmitting or receiving data on the network interfaces.
4429 *
4430 * Tracking is disabled if set to zero or negative value.
4431 *
4432 * @hide
4433 */
4434 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
4435
4436 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
4437 * but for Wifi network.
4438 * @hide
4439 */
4440 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
4441
4442 /**
4443 * Whether or not data roaming is enabled. (0 = false, 1 = true)
4444 */
4445 public static final String DATA_ROAMING = "data_roaming";
4446
4447 /**
Wink Saville75c1e692013-03-20 17:06:50 -07004448 * The value passed to a Mobile DataConnection via bringUp which defines the
4449 * number of retries to preform when setting up the initial connection. The default
4450 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
4451 * @hide
4452 */
4453 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
4454
4455 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004456 * Whether user has enabled development settings.
4457 */
4458 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
4459
4460 /**
4461 * Whether the device has been provisioned (0 = false, 1 = true)
4462 */
4463 public static final String DEVICE_PROVISIONED = "device_provisioned";
4464
4465 /**
4466 * The saved value for WindowManagerService.setForcedDisplayDensity().
4467 * One integer in dpi. If unset, then use the real display density.
4468 * @hide
4469 */
4470 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
4471
4472 /**
4473 * The saved value for WindowManagerService.setForcedDisplaySize().
4474 * Two integers separated by a comma. If unset, then use the real display size.
4475 * @hide
4476 */
4477 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
4478
4479 /**
4480 * The maximum size, in bytes, of a download that the download manager will transfer over
4481 * a non-wifi connection.
4482 * @hide
4483 */
4484 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
4485 "download_manager_max_bytes_over_mobile";
4486
4487 /**
4488 * The recommended maximum size, in bytes, of a download that the download manager should
4489 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
4490 * have the option to start the download over the mobile connection anyway.
4491 * @hide
4492 */
4493 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
4494 "download_manager_recommended_max_bytes_over_mobile";
4495
4496 /**
4497 * Whether the package installer should allow installation of apps downloaded from
4498 * sources other than Google Play.
4499 *
4500 * 1 = allow installing from other sources
4501 * 0 = only allow installing from Google Play
4502 */
4503 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
4504
4505 /**
4506 * Whether mobile data connections are allowed by the user. See
4507 * ConnectivityManager for more info.
4508 * @hide
4509 */
4510 public static final String MOBILE_DATA = "mobile_data";
4511
4512 /** {@hide} */
4513 public static final String NETSTATS_ENABLED = "netstats_enabled";
4514 /** {@hide} */
4515 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
4516 /** {@hide} */
4517 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
4518 /** {@hide} */
4519 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
4520 /** {@hide} */
4521 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
4522 /** {@hide} */
4523 public static final String NETSTATS_REPORT_XT_OVER_DEV = "netstats_report_xt_over_dev";
4524
4525 /** {@hide} */
4526 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
4527 /** {@hide} */
4528 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
4529 /** {@hide} */
4530 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
4531 /** {@hide} */
4532 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
4533
4534 /** {@hide} */
4535 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
4536 /** {@hide} */
4537 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
4538 /** {@hide} */
4539 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
4540 /** {@hide} */
4541 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
4542
4543 /** {@hide} */
4544 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
4545 /** {@hide} */
4546 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
4547 /** {@hide} */
4548 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
4549 /** {@hide} */
4550 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
4551
4552 /**
4553 * User preference for which network(s) should be used. Only the
4554 * connectivity service should touch this.
4555 */
4556 public static final String NETWORK_PREFERENCE = "network_preference";
4557
4558 /**
4559 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
4560 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
4561 * exceeded.
4562 * @hide
4563 */
4564 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
4565
4566 /**
4567 * The length of time in milli-seconds that automatic small adjustments to
4568 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
4569 * @hide
4570 */
4571 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
4572
4573 /** Preferred NTP server. {@hide} */
4574 public static final String NTP_SERVER = "ntp_server";
4575 /** Timeout in milliseconds to wait for NTP server. {@hide} */
4576 public static final String NTP_TIMEOUT = "ntp_timeout";
4577
4578 /**
rich cannings4d8fc792012-09-07 14:43:43 -07004579 * Whether the package manager should send package verification broadcasts for verifiers to
4580 * review apps prior to installation.
4581 * 1 = request apps to be verified prior to installation, if a verifier exists.
4582 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07004583 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07004584 */
4585 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
4586
4587 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07004588 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07004589 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
4590
4591 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07004592 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07004593 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
4594
rich cannings4e5753f2012-09-19 16:03:56 -07004595 /**
4596 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07004597 * 1 = show (default)
4598 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07004599 * @hide
rich canningse6686b32012-09-16 14:02:20 -07004600 */
4601 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
4602
rich cannings4d8fc792012-09-07 14:43:43 -07004603 /**
rich cannings4e5753f2012-09-19 16:03:56 -07004604 * Run package verificaiton on apps installed through ADB/ADT/USB
4605 * 1 = perform package verification on ADB installs (default)
4606 * 0 = bypass package verification on ADB installs
4607 * @hide
4608 */
4609 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
4610
4611 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004612 * The interval in milliseconds at which to check packet counts on the
4613 * mobile data interface when screen is on, to detect possible data
4614 * connection problems.
4615 * @hide
4616 */
4617 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
4618 "pdp_watchdog_poll_interval_ms";
4619
4620 /**
4621 * The interval in milliseconds at which to check packet counts on the
4622 * mobile data interface when screen is off, to detect possible data
4623 * connection problems.
4624 * @hide
4625 */
4626 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
4627 "pdp_watchdog_long_poll_interval_ms";
4628
4629 /**
4630 * The interval in milliseconds at which to check packet counts on the
4631 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
4632 * outgoing packets has been reached without incoming packets.
4633 * @hide
4634 */
4635 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
4636 "pdp_watchdog_error_poll_interval_ms";
4637
4638 /**
4639 * The number of outgoing packets sent without seeing an incoming packet
4640 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
4641 * device is logged to the event log
4642 * @hide
4643 */
4644 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
4645 "pdp_watchdog_trigger_packet_count";
4646
4647 /**
4648 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
4649 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
4650 * attempting data connection recovery.
4651 * @hide
4652 */
4653 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
4654 "pdp_watchdog_error_poll_count";
4655
4656 /**
4657 * The number of failed PDP reset attempts before moving to something more
4658 * drastic: re-registering to the network.
4659 * @hide
4660 */
4661 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
4662 "pdp_watchdog_max_pdp_reset_fail_count";
4663
4664 /**
4665 * A positive value indicates how often the SamplingProfiler
4666 * should take snapshots. Zero value means SamplingProfiler
4667 * is disabled.
4668 *
4669 * @hide
4670 */
4671 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
4672
4673 /**
4674 * URL to open browser on to allow user to manage a prepay account
4675 * @hide
4676 */
4677 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
4678 "setup_prepaid_data_service_url";
4679
4680 /**
4681 * URL to attempt a GET on to see if this is a prepay device
4682 * @hide
4683 */
4684 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
4685 "setup_prepaid_detection_target_url";
4686
4687 /**
4688 * Host to check for a redirect to after an attempt to GET
4689 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
4690 * this is a prepaid device with zero balance.)
4691 * @hide
4692 */
4693 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
4694 "setup_prepaid_detection_redir_host";
4695
4696 /**
Jake Hamby76a61422012-09-06 17:40:21 -07004697 * The interval in milliseconds at which to check the number of SMS sent out without asking
4698 * for use permit, to limit the un-authorized SMS usage.
4699 *
4700 * @hide
4701 */
4702 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
4703 "sms_outgoing_check_interval_ms";
4704
4705 /**
4706 * The number of outgoing SMS sent without asking for user permit (of {@link
4707 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
4708 *
4709 * @hide
4710 */
4711 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
4712 "sms_outgoing_check_max_count";
4713
4714 /**
4715 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07004716 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07004717 * @see com.android.internal.telephony.SmsUsageMonitor
4718 * @hide
4719 */
4720 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
4721
Robert Greenwalt026efcc2012-09-24 10:03:21 -07004722 /**
4723 * Used to select which country we use to determine premium sms codes.
4724 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
4725 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
4726 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
4727 * @hide
4728 */
4729 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
4730
Jake Hamby76a61422012-09-06 17:40:21 -07004731 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004732 * Used to disable Tethering on a device - defaults to true
4733 * @hide
4734 */
4735 public static final String TETHER_SUPPORTED = "tether_supported";
4736
4737 /**
4738 * Used to require DUN APN on the device or not - defaults to a build config value
4739 * which defaults to false
4740 * @hide
4741 */
4742 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
4743
4744 /**
4745 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
4746 * corresponding build config values are set it will override the APN DB
4747 * values.
4748 * Consists of a comma seperated list of strings:
4749 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
4750 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
4751 * @hide
4752 */
4753 public static final String TETHER_DUN_APN = "tether_dun_apn";
4754
4755 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004756 * USB Mass Storage Enabled
4757 */
4758 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
4759
4760 /**
4761 * If this setting is set (to anything), then all references
4762 * to Gmail on the device must change to Google Mail.
4763 */
4764 public static final String USE_GOOGLE_MAIL = "use_google_mail";
4765
4766 /** Autofill server address (Used in WebView/browser).
4767 * {@hide} */
4768 public static final String WEB_AUTOFILL_QUERY_URL =
4769 "web_autofill_query_url";
4770
4771 /**
Jeff Brown89d55462012-09-19 11:33:42 -07004772 * Whether Wifi display is enabled/disabled
4773 * 0=disabled. 1=enabled.
4774 * @hide
4775 */
4776 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
4777
4778 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004779 * Whether to notify the user of open networks.
4780 * <p>
4781 * If not connected and the scan results have an open network, we will
4782 * put this notification up. If we attempt to connect to a network or
4783 * the open network(s) disappear, we remove the notification. When we
4784 * show the notification, we will not show it again for
4785 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
4786 */
4787 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
4788 "wifi_networks_available_notification_on";
4789 /**
4790 * {@hide}
4791 */
4792 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
4793 "wimax_networks_available_notification_on";
4794
4795 /**
4796 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
4797 * Connecting to a network will reset the timer.
4798 */
4799 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
4800 "wifi_networks_available_repeat_delay";
4801
4802 /**
4803 * 802.11 country code in ISO 3166 format
4804 * @hide
4805 */
4806 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
4807
4808 /**
4809 * The interval in milliseconds to issue wake up scans when wifi needs
4810 * to connect. This is necessary to connect to an access point when
4811 * device is on the move and the screen is off.
4812 * @hide
4813 */
4814 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
4815 "wifi_framework_scan_interval_ms";
4816
4817 /**
4818 * The interval in milliseconds after which Wi-Fi is considered idle.
4819 * When idle, it is possible for the device to be switched from Wi-Fi to
4820 * the mobile data network.
4821 * @hide
4822 */
4823 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
4824
4825 /**
4826 * When the number of open networks exceeds this number, the
4827 * least-recently-used excess networks will be removed.
4828 */
4829 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
4830
4831 /**
4832 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
4833 */
4834 public static final String WIFI_ON = "wifi_on";
4835
4836 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08004837 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
4838 * @hide
4839 */
4840 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
4841 "wifi_scan_always_enabled";
4842
4843 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004844 * Used to save the Wifi_ON state prior to tethering.
4845 * This state will be checked to restore Wifi after
4846 * the user turns off tethering.
4847 *
4848 * @hide
4849 */
4850 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
4851
4852 /**
4853 * The interval in milliseconds to scan as used by the wifi supplicant
4854 * @hide
4855 */
4856 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
4857 "wifi_supplicant_scan_interval_ms";
4858
4859 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07004860 * The interval in milliseconds to scan at supplicant when p2p is connected
4861 * @hide
4862 */
4863 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
4864 "wifi_scan_interval_p2p_connected_ms";
4865
4866 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004867 * Whether the Wi-Fi watchdog is enabled.
4868 */
4869 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
4870
4871 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004872 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
4873 * the setting needs to be set to 0 to disable it.
4874 * @hide
4875 */
4876 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
4877 "wifi_watchdog_poor_network_test_enabled";
4878
4879 /**
4880 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
4881 * needs to be set to 0 to disable it.
4882 * @hide
4883 */
4884 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
4885 "wifi_suspend_optimizations_enabled";
4886
4887 /**
4888 * The maximum number of times we will retry a connection to an access
4889 * point for which we have failed in acquiring an IP address from DHCP.
4890 * A value of N means that we will make N+1 connection attempts in all.
4891 */
4892 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
4893
4894 /**
4895 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
4896 * data connectivity to be established after a disconnect from Wi-Fi.
4897 */
4898 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
4899 "wifi_mobile_data_transition_wakelock_timeout_ms";
4900
4901 /**
4902 * The operational wifi frequency band
4903 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
4904 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
4905 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
4906 *
4907 * @hide
4908 */
4909 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
4910
4911 /**
4912 * The Wi-Fi peer-to-peer device name
4913 * @hide
4914 */
4915 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
4916
4917 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07004918 * The min time between wifi disable and wifi enable
4919 * @hide
4920 */
4921 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
4922
4923 /**
Christopher Tatec868b642012-09-12 17:41:04 -07004924 * The number of milliseconds to delay when checking for data stalls during
4925 * non-aggressive detection. (screen is turned off.)
4926 * @hide
4927 */
4928 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
4929 "data_stall_alarm_non_aggressive_delay_in_ms";
4930
4931 /**
4932 * The number of milliseconds to delay when checking for data stalls during
4933 * aggressive detection. (screen on or suspected data stall)
4934 * @hide
4935 */
4936 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
4937 "data_stall_alarm_aggressive_delay_in_ms";
4938
4939 /**
4940 * The interval in milliseconds at which to check gprs registration
4941 * after the first registration mismatch of gprs and voice service,
4942 * to detect possible data network registration problems.
4943 *
4944 * @hide
4945 */
4946 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
4947 "gprs_register_check_period_ms";
4948
4949 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004950 * Nonzero causes Log.wtf() to crash.
4951 * @hide
4952 */
4953 public static final String WTF_IS_FATAL = "wtf_is_fatal";
4954
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07004955 /**
4956 * Ringer mode. This is used internally, changing this value will not
4957 * change the ringer mode. See AudioManager.
4958 */
4959 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07004960
Jeff Brownd4935962012-09-25 13:27:20 -07004961 /**
4962 * Overlay display devices setting.
4963 * The associated value is a specially formatted string that describes the
4964 * size and density of simulated secondary display devices.
4965 * <p>
4966 * Format: {width}x{height}/{dpi};...
4967 * </p><p>
4968 * Example:
4969 * <ul>
4970 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
4971 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
4972 * at 1080p and the second at 720p.</li>
4973 * <li>If the value is empty, then no overlay display devices are created.</li>
4974 * </ul></p>
4975 *
4976 * @hide
4977 */
4978 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07004979
Jeff Sharkey625239a2012-09-26 22:03:49 -07004980 /**
4981 * Threshold values for the duration and level of a discharge cycle,
4982 * under which we log discharge cycle info.
4983 *
4984 * @hide
4985 */
4986 public static final String
4987 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
4988
4989 /** @hide */
4990 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
4991
4992 /**
4993 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
4994 * intents on application crashes and ANRs. If this is disabled, the
4995 * crash/ANR dialog will never display the "Report" button.
4996 * <p>
4997 * Type: int (0 = disallow, 1 = allow)
4998 *
4999 * @hide
5000 */
5001 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
5002
5003 /**
5004 * Maximum age of entries kept by {@link DropBoxManager}.
5005 *
5006 * @hide
5007 */
5008 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
5009
5010 /**
5011 * Maximum number of entry files which {@link DropBoxManager} will keep
5012 * around.
5013 *
5014 * @hide
5015 */
5016 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
5017
5018 /**
5019 * Maximum amount of disk space used by {@link DropBoxManager} no matter
5020 * what.
5021 *
5022 * @hide
5023 */
5024 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
5025
5026 /**
5027 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
5028 * will use.
5029 *
5030 * @hide
5031 */
5032 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
5033
5034 /**
5035 * Percent of total disk which {@link DropBoxManager} will never dip
5036 * into.
5037 *
5038 * @hide
5039 */
5040 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
5041
5042 /**
5043 * Prefix for per-tag dropbox disable/enable settings.
5044 *
5045 * @hide
5046 */
5047 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
5048
5049 /**
5050 * Lines of logcat to include with system crash/ANR/etc. reports, as a
5051 * prefix of the dropbox tag of the report type. For example,
5052 * "logcat_for_system_server_anr" controls the lines of logcat captured
5053 * with system server ANR reports. 0 to disable.
5054 *
5055 * @hide
5056 */
5057 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
5058
5059 /**
5060 * The interval in minutes after which the amount of free storage left
5061 * on the device is logged to the event log
5062 *
5063 * @hide
5064 */
5065 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
5066
5067 /**
5068 * Threshold for the amount of change in disk free space required to
5069 * report the amount of free space. Used to prevent spamming the logs
5070 * when the disk free space isn't changing frequently.
5071 *
5072 * @hide
5073 */
5074 public static final String
5075 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
5076
5077 /**
5078 * Minimum percentage of free storage on the device that is used to
5079 * determine if the device is running low on storage. The default is 10.
5080 * <p>
5081 * Say this value is set to 10, the device is considered running low on
5082 * storage if 90% or more of the device storage is filled up.
5083 *
5084 * @hide
5085 */
5086 public static final String
5087 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
5088
5089 /**
5090 * Maximum byte size of the low storage threshold. This is to ensure
5091 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
5092 * overly large threshold for large storage devices. Currently this must
5093 * be less than 2GB. This default is 500MB.
5094 *
5095 * @hide
5096 */
5097 public static final String
5098 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
5099
5100 /**
5101 * Minimum bytes of free storage on the device before the data partition
5102 * is considered full. By default, 1 MB is reserved to avoid system-wide
5103 * SQLite disk full exceptions.
5104 *
5105 * @hide
5106 */
5107 public static final String
5108 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
5109
5110 /**
5111 * The maximum reconnect delay for short network outages or when the
5112 * network is suspended due to phone use.
5113 *
5114 * @hide
5115 */
5116 public static final String
5117 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
5118
5119 /**
5120 * The number of milliseconds to delay before sending out
5121 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts.
5122 *
5123 * @hide
5124 */
5125 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
5126
5127 /**
5128 * Setting to turn off captive portal detection. Feature is enabled by
5129 * default and the setting needs to be set to 0 to disable it.
5130 *
5131 * @hide
5132 */
5133 public static final String
5134 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
5135
5136 /**
5137 * The server used for captive portal detection upon a new conection. A
5138 * 204 response code from the server is used for validation.
5139 *
5140 * @hide
5141 */
5142 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
5143
5144 /**
5145 * Whether network service discovery is enabled.
5146 *
5147 * @hide
5148 */
5149 public static final String NSD_ON = "nsd_on";
5150
5151 /**
5152 * Let user pick default install location.
5153 *
5154 * @hide
5155 */
5156 public static final String SET_INSTALL_LOCATION = "set_install_location";
5157
5158 /**
5159 * Default install location value.
5160 * 0 = auto, let system decide
5161 * 1 = internal
5162 * 2 = sdcard
5163 * @hide
5164 */
5165 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
5166
5167 /**
5168 * ms during which to consume extra events related to Inet connection
5169 * condition after a transtion to fully-connected
5170 *
5171 * @hide
5172 */
5173 public static final String
5174 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
5175
5176 /**
5177 * ms during which to consume extra events related to Inet connection
5178 * condtion after a transtion to partly-connected
5179 *
5180 * @hide
5181 */
5182 public static final String
5183 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
5184
5185 /** {@hide} */
5186 public static final String
5187 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
5188
5189 /**
5190 * Host name and port for global http proxy. Uses ':' seperator for
5191 * between host and port.
5192 */
5193 public static final String HTTP_PROXY = "http_proxy";
5194
5195 /**
5196 * Host name for global http proxy. Set via ConnectivityManager.
5197 *
5198 * @hide
5199 */
5200 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
5201
5202 /**
5203 * Integer host port for global http proxy. Set via ConnectivityManager.
5204 *
5205 * @hide
5206 */
5207 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
5208
5209 /**
5210 * Exclusion list for global proxy. This string contains a list of
5211 * comma-separated domains where the global proxy does not apply.
5212 * Domains should be listed in a comma- separated list. Example of
5213 * acceptable formats: ".domain1.com,my.domain2.com" Use
5214 * ConnectivityManager to set/get.
5215 *
5216 * @hide
5217 */
5218 public static final String
5219 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
5220
5221 /**
5222 * Enables the UI setting to allow the user to specify the global HTTP
5223 * proxy and associated exclusion list.
5224 *
5225 * @hide
5226 */
5227 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
5228
5229 /**
5230 * Setting for default DNS in case nobody suggests one
5231 *
5232 * @hide
5233 */
5234 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
5235
Jeff Sharkey0ac10282012-10-01 12:50:22 -07005236 /** {@hide} */
5237 public static final String
5238 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
5239 /** {@hide} */
5240 public static final String
5241 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
5242 /** {@hide} */
5243 public static final String
5244 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
5245
5246 /**
5247 * Get the key that retrieves a bluetooth headset's priority.
5248 * @hide
5249 */
5250 public static final String getBluetoothHeadsetPriorityKey(String address) {
5251 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase();
5252 }
5253
5254 /**
5255 * Get the key that retrieves a bluetooth a2dp sink's priority.
5256 * @hide
5257 */
5258 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
5259 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase();
5260 }
5261
5262 /**
5263 * Get the key that retrieves a bluetooth Input Device's priority.
5264 * @hide
5265 */
5266 public static final String getBluetoothInputDevicePriorityKey(String address) {
5267 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase();
5268 }
5269
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07005270 /**
5271 * Scaling factor for normal window animations. Setting to 0 will
5272 * disable window animations.
5273 */
5274 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
5275
5276 /**
5277 * Scaling factor for activity transition animations. Setting to 0 will
5278 * disable window animations.
5279 */
5280 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
5281
5282 /**
5283 * Scaling factor for Animator-based animations. This affects both the
5284 * start delay and duration of all such animations. Setting to 0 will
5285 * cause animations to end immediately. The default value is 1.
5286 */
5287 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
5288
5289 /**
5290 * Scaling factor for normal window animations. Setting to 0 will
5291 * disable window animations.
5292 *
5293 * @hide
5294 */
5295 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
5296
5297 /**
5298 * If 0, the compatibility mode is off for all applications.
5299 * If 1, older applications run under compatibility mode.
5300 * TODO: remove this settings before code freeze (bug/1907571)
5301 * @hide
5302 */
5303 public static final String COMPATIBILITY_MODE = "compatibility_mode";
5304
5305 /**
5306 * CDMA only settings
5307 * Emergency Tone 0 = Off
5308 * 1 = Alert
5309 * 2 = Vibrate
5310 * @hide
5311 */
5312 public static final String EMERGENCY_TONE = "emergency_tone";
5313
5314 /**
5315 * CDMA only settings
5316 * Whether the auto retry is enabled. The value is
5317 * boolean (1 or 0).
5318 * @hide
5319 */
5320 public static final String CALL_AUTO_RETRY = "call_auto_retry";
5321
5322 /**
5323 * The preferred network mode 7 = Global
5324 * 6 = EvDo only
5325 * 5 = CDMA w/o EvDo
5326 * 4 = CDMA / EvDo auto
5327 * 3 = GSM / WCDMA auto
5328 * 2 = WCDMA only
5329 * 1 = GSM only
5330 * 0 = GSM / WCDMA preferred
5331 * @hide
5332 */
5333 public static final String PREFERRED_NETWORK_MODE =
5334 "preferred_network_mode";
5335
5336 /**
5337 * The cdma subscription 0 = Subscription from RUIM, when available
5338 * 1 = Subscription from NV
5339 * @hide
5340 */
5341 public static final String PREFERRED_CDMA_SUBSCRIPTION =
5342 "preferred_cdma_subscription";
5343
5344 /**
5345 * Name of an application package to be debugged.
5346 */
5347 public static final String DEBUG_APP = "debug_app";
5348
5349 /**
5350 * If 1, when launching DEBUG_APP it will wait for the debugger before
5351 * starting user code. If 0, it will run normally.
5352 */
5353 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
5354
5355 /**
5356 * Control whether the process CPU usage meter should be shown.
5357 */
5358 public static final String SHOW_PROCESSES = "show_processes";
5359
5360 /**
5361 * If 1, the activity manager will aggressively finish activities and
5362 * processes as soon as they are no longer needed. If 0, the normal
5363 * extended lifetime is used.
5364 */
5365 public static final String ALWAYS_FINISH_ACTIVITIES =
5366 "always_finish_activities";
5367
Christopher Tate66488d62012-10-02 11:58:01 -07005368 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07005369 * Use Dock audio output for media:
5370 * 0 = disabled
5371 * 1 = enabled
5372 * @hide
5373 */
5374 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
5375
5376 /**
Eric Laurent05274f32012-11-29 12:48:18 -08005377 * Persisted safe headphone volume management state by AudioService
5378 * @hide
5379 */
5380 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
5381
5382 /**
Geremy Condra77118fb2013-03-26 21:09:01 -07005383 * URL for tzinfo (time zone) updates
5384 * @hide
5385 */
5386 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
5387
5388 /**
5389 * URL for tzinfo (time zone) update metadata
5390 * @hide
5391 */
5392 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
5393
5394 /**
5395 * URL for selinux (mandatory access control) updates
5396 * @hide
5397 */
5398 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
5399
5400 /**
5401 * URL for selinux (mandatory access control) update metadata
5402 * @hide
5403 */
5404 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
5405
5406 /**
5407 * URL for sms short code updates
5408 * @hide
5409 */
5410 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
5411 "sms_short_codes_content_url";
5412
5413 /**
5414 * URL for sms short code update metadata
5415 * @hide
5416 */
5417 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
5418 "sms_short_codes_metadata_url";
5419
5420 /**
5421 * URL for cert pinlist updates
5422 * @hide
5423 */
5424 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
5425
5426 /**
5427 * URL for cert pinlist updates
5428 * @hide
5429 */
5430 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
5431
5432 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -07005433 * URL for intent firewall updates
5434 * @hide
5435 */
5436 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
5437 "intent_firewall_content_url";
5438
5439 /**
5440 * URL for intent firewall update metadata
5441 * @hide
5442 */
5443 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
5444 "intent_firewall_metadata_url";
5445
5446 /**
Geremy Condra77118fb2013-03-26 21:09:01 -07005447 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
5448 * @hide
5449 */
5450 public static final String SELINUX_STATUS = "selinux_status";
5451
5452 /**
Christopher Tate66488d62012-10-02 11:58:01 -07005453 * Settings to backup. This is here so that it's in the same place as the settings
5454 * keys and easy to update.
5455 *
5456 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
5457 * and Secure as well. This is because those tables drive both backup and
5458 * restore, and restore needs to properly whitelist keys that used to live
5459 * in those namespaces. The keys will only actually be backed up / restored
5460 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
5461 *
5462 * NOTE: Settings are backed up and restored in the order they appear
5463 * in this array. If you have one setting depending on another,
5464 * make sure that they are ordered appropriately.
5465 *
5466 * @hide
5467 */
5468 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08005469 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -07005470 STAY_ON_WHILE_PLUGGED_IN,
5471 MODE_RINGER,
5472 AUTO_TIME,
5473 AUTO_TIME_ZONE,
5474 POWER_SOUNDS_ENABLED,
5475 DOCK_SOUNDS_ENABLED,
5476 USB_MASS_STORAGE_ENABLED,
5477 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
5478 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
5479 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
Christopher Tate16eb7cd2012-10-09 15:26:30 -07005480 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07005481 WIFI_NUM_OPEN_NETWORKS_KEPT,
5482 EMERGENCY_TONE,
5483 CALL_AUTO_RETRY,
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07005484 DOCK_AUDIO_MEDIA_ENABLED
Christopher Tate66488d62012-10-02 11:58:01 -07005485 };
5486
Christopher Tate06efb532012-08-24 15:29:27 -07005487 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07005488 private static NameValueCache sNameValueCache = new NameValueCache(
5489 SYS_PROP_SETTING_VERSION,
5490 CONTENT_URI,
5491 CALL_METHOD_GET_GLOBAL,
5492 CALL_METHOD_PUT_GLOBAL);
Christopher Tate06efb532012-08-24 15:29:27 -07005493
5494 /**
5495 * Look up a name in the database.
5496 * @param resolver to access the database with
5497 * @param name to look up in the table
5498 * @return the corresponding value, or null if not present
5499 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07005500 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07005501 return getStringForUser(resolver, name, UserHandle.myUserId());
5502 }
5503
5504 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07005505 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07005506 int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07005507 return sNameValueCache.getStringForUser(resolver, name, userHandle);
5508 }
5509
5510 /**
5511 * Store a name/value pair into the database.
5512 * @param resolver to access the database with
5513 * @param name to store
5514 * @param value to associate with the name
5515 * @return true if the value was set, false on database errors
5516 */
5517 public static boolean putString(ContentResolver resolver,
5518 String name, String value) {
5519 return putStringForUser(resolver, name, value, UserHandle.myUserId());
5520 }
5521
5522 /** @hide */
5523 public static boolean putStringForUser(ContentResolver resolver,
5524 String name, String value, int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07005525 if (LOCAL_LOGV) {
5526 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
5527 + " for " + userHandle);
5528 }
5529 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
5530 }
5531
5532 /**
5533 * Construct the content URI for a particular name/value pair,
5534 * useful for monitoring changes with a ContentObserver.
5535 * @param name to look up in the table
5536 * @return the corresponding content URI, or null if not present
5537 */
5538 public static Uri getUriFor(String name) {
5539 return getUriFor(CONTENT_URI, name);
5540 }
5541
5542 /**
5543 * Convenience function for retrieving a single secure settings value
5544 * as an integer. Note that internally setting values are always
5545 * stored as strings; this function converts the string to an integer
5546 * for you. The default value will be returned if the setting is
5547 * not defined or not an integer.
5548 *
5549 * @param cr The ContentResolver to access.
5550 * @param name The name of the setting to retrieve.
5551 * @param def Value to return if the setting is not defined.
5552 *
5553 * @return The setting's current value, or 'def' if it is not defined
5554 * or not a valid integer.
5555 */
5556 public static int getInt(ContentResolver cr, String name, int def) {
5557 String v = getString(cr, name);
5558 try {
5559 return v != null ? Integer.parseInt(v) : def;
5560 } catch (NumberFormatException e) {
5561 return def;
5562 }
5563 }
5564
5565 /**
5566 * Convenience function for retrieving a single secure settings value
5567 * as an integer. Note that internally setting values are always
5568 * stored as strings; this function converts the string to an integer
5569 * for you.
5570 * <p>
5571 * This version does not take a default value. If the setting has not
5572 * been set, or the string value is not a number,
5573 * it throws {@link SettingNotFoundException}.
5574 *
5575 * @param cr The ContentResolver to access.
5576 * @param name The name of the setting to retrieve.
5577 *
5578 * @throws SettingNotFoundException Thrown if a setting by the given
5579 * name can't be found or the setting value is not an integer.
5580 *
5581 * @return The setting's current value.
5582 */
5583 public static int getInt(ContentResolver cr, String name)
5584 throws SettingNotFoundException {
5585 String v = getString(cr, name);
5586 try {
5587 return Integer.parseInt(v);
5588 } catch (NumberFormatException e) {
5589 throw new SettingNotFoundException(name);
5590 }
5591 }
5592
5593 /**
5594 * Convenience function for updating a single settings value as an
5595 * integer. This will either create a new entry in the table if the
5596 * given name does not exist, or modify the value of the existing row
5597 * with that name. Note that internally setting values are always
5598 * stored as strings, so this function converts the given value to a
5599 * string before storing it.
5600 *
5601 * @param cr The ContentResolver to access.
5602 * @param name The name of the setting to modify.
5603 * @param value The new value for the setting.
5604 * @return true if the value was set, false on database errors
5605 */
5606 public static boolean putInt(ContentResolver cr, String name, int value) {
5607 return putString(cr, name, Integer.toString(value));
5608 }
5609
5610 /**
5611 * Convenience function for retrieving a single secure settings value
5612 * as a {@code long}. Note that internally setting values are always
5613 * stored as strings; this function converts the string to a {@code long}
5614 * for you. The default value will be returned if the setting is
5615 * not defined or not a {@code long}.
5616 *
5617 * @param cr The ContentResolver to access.
5618 * @param name The name of the setting to retrieve.
5619 * @param def Value to return if the setting is not defined.
5620 *
5621 * @return The setting's current value, or 'def' if it is not defined
5622 * or not a valid {@code long}.
5623 */
5624 public static long getLong(ContentResolver cr, String name, long def) {
5625 String valString = getString(cr, name);
5626 long value;
5627 try {
5628 value = valString != null ? Long.parseLong(valString) : def;
5629 } catch (NumberFormatException e) {
5630 value = def;
5631 }
5632 return value;
5633 }
5634
5635 /**
5636 * Convenience function for retrieving a single secure settings value
5637 * as a {@code long}. Note that internally setting values are always
5638 * stored as strings; this function converts the string to a {@code long}
5639 * for you.
5640 * <p>
5641 * This version does not take a default value. If the setting has not
5642 * been set, or the string value is not a number,
5643 * it throws {@link SettingNotFoundException}.
5644 *
5645 * @param cr The ContentResolver to access.
5646 * @param name The name of the setting to retrieve.
5647 *
5648 * @return The setting's current value.
5649 * @throws SettingNotFoundException Thrown if a setting by the given
5650 * name can't be found or the setting value is not an integer.
5651 */
5652 public static long getLong(ContentResolver cr, String name)
5653 throws SettingNotFoundException {
5654 String valString = getString(cr, name);
5655 try {
5656 return Long.parseLong(valString);
5657 } catch (NumberFormatException e) {
5658 throw new SettingNotFoundException(name);
5659 }
5660 }
5661
5662 /**
5663 * Convenience function for updating a secure settings value as a long
5664 * integer. This will either create a new entry in the table if the
5665 * given name does not exist, or modify the value of the existing row
5666 * with that name. Note that internally setting values are always
5667 * stored as strings, so this function converts the given value to a
5668 * string before storing it.
5669 *
5670 * @param cr The ContentResolver to access.
5671 * @param name The name of the setting to modify.
5672 * @param value The new value for the setting.
5673 * @return true if the value was set, false on database errors
5674 */
5675 public static boolean putLong(ContentResolver cr, String name, long value) {
5676 return putString(cr, name, Long.toString(value));
5677 }
5678
5679 /**
5680 * Convenience function for retrieving a single secure settings value
5681 * as a floating point number. Note that internally setting values are
5682 * always stored as strings; this function converts the string to an
5683 * float for you. The default value will be returned if the setting
5684 * is not defined or not a valid float.
5685 *
5686 * @param cr The ContentResolver to access.
5687 * @param name The name of the setting to retrieve.
5688 * @param def Value to return if the setting is not defined.
5689 *
5690 * @return The setting's current value, or 'def' if it is not defined
5691 * or not a valid float.
5692 */
5693 public static float getFloat(ContentResolver cr, String name, float def) {
5694 String v = getString(cr, name);
5695 try {
5696 return v != null ? Float.parseFloat(v) : def;
5697 } catch (NumberFormatException e) {
5698 return def;
5699 }
5700 }
5701
5702 /**
5703 * Convenience function for retrieving a single secure settings value
5704 * as a float. Note that internally setting values are always
5705 * stored as strings; this function converts the string to a float
5706 * for you.
5707 * <p>
5708 * This version does not take a default value. If the setting has not
5709 * been set, or the string value is not a number,
5710 * it throws {@link SettingNotFoundException}.
5711 *
5712 * @param cr The ContentResolver to access.
5713 * @param name The name of the setting to retrieve.
5714 *
5715 * @throws SettingNotFoundException Thrown if a setting by the given
5716 * name can't be found or the setting value is not a float.
5717 *
5718 * @return The setting's current value.
5719 */
5720 public static float getFloat(ContentResolver cr, String name)
5721 throws SettingNotFoundException {
5722 String v = getString(cr, name);
5723 if (v == null) {
5724 throw new SettingNotFoundException(name);
5725 }
5726 try {
5727 return Float.parseFloat(v);
5728 } catch (NumberFormatException e) {
5729 throw new SettingNotFoundException(name);
5730 }
5731 }
5732
5733 /**
5734 * Convenience function for updating a single settings value as a
5735 * floating point number. This will either create a new entry in the
5736 * table if the given name does not exist, or modify the value of the
5737 * existing row with that name. Note that internally setting values
5738 * are always stored as strings, so this function converts the given
5739 * value to a string before storing it.
5740 *
5741 * @param cr The ContentResolver to access.
5742 * @param name The name of the setting to modify.
5743 * @param value The new value for the setting.
5744 * @return true if the value was set, false on database errors
5745 */
5746 public static boolean putFloat(ContentResolver cr, String name, float value) {
5747 return putString(cr, name, Float.toString(value));
5748 }
5749 }
5750
5751 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005752 * User-defined bookmarks and shortcuts. The target of each bookmark is an
5753 * Intent URL, allowing it to be either a web page or a particular
5754 * application activity.
5755 *
5756 * @hide
5757 */
5758 public static final class Bookmarks implements BaseColumns
5759 {
5760 private static final String TAG = "Bookmarks";
5761
5762 /**
5763 * The content:// style URL for this table
5764 */
5765 public static final Uri CONTENT_URI =
5766 Uri.parse("content://" + AUTHORITY + "/bookmarks");
5767
5768 /**
5769 * The row ID.
5770 * <p>Type: INTEGER</p>
5771 */
5772 public static final String ID = "_id";
5773
5774 /**
5775 * Descriptive name of the bookmark that can be displayed to the user.
5776 * If this is empty, the title should be resolved at display time (use
5777 * {@link #getTitle(Context, Cursor)} any time you want to display the
5778 * title of a bookmark.)
5779 * <P>
5780 * Type: TEXT
5781 * </P>
5782 */
5783 public static final String TITLE = "title";
5784
5785 /**
5786 * Arbitrary string (displayed to the user) that allows bookmarks to be
5787 * organized into categories. There are some special names for
5788 * standard folders, which all start with '@'. The label displayed for
5789 * the folder changes with the locale (via {@link #getLabelForFolder}) but
5790 * the folder name does not change so you can consistently query for
5791 * the folder regardless of the current locale.
5792 *
5793 * <P>Type: TEXT</P>
5794 *
5795 */
5796 public static final String FOLDER = "folder";
5797
5798 /**
5799 * The Intent URL of the bookmark, describing what it points to. This
5800 * value is given to {@link android.content.Intent#getIntent} to create
5801 * an Intent that can be launched.
5802 * <P>Type: TEXT</P>
5803 */
5804 public static final String INTENT = "intent";
5805
5806 /**
5807 * Optional shortcut character associated with this bookmark.
5808 * <P>Type: INTEGER</P>
5809 */
5810 public static final String SHORTCUT = "shortcut";
5811
5812 /**
5813 * The order in which the bookmark should be displayed
5814 * <P>Type: INTEGER</P>
5815 */
5816 public static final String ORDERING = "ordering";
5817
5818 private static final String[] sIntentProjection = { INTENT };
5819 private static final String[] sShortcutProjection = { ID, SHORTCUT };
5820 private static final String sShortcutSelection = SHORTCUT + "=?";
5821
5822 /**
5823 * Convenience function to retrieve the bookmarked Intent for a
5824 * particular shortcut key.
5825 *
5826 * @param cr The ContentResolver to query.
5827 * @param shortcut The shortcut key.
5828 *
5829 * @return Intent The bookmarked URL, or null if there is no bookmark
5830 * matching the given shortcut.
5831 */
5832 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
5833 {
5834 Intent intent = null;
5835
5836 Cursor c = cr.query(CONTENT_URI,
5837 sIntentProjection, sShortcutSelection,
5838 new String[] { String.valueOf((int) shortcut) }, ORDERING);
5839 // Keep trying until we find a valid shortcut
5840 try {
5841 while (intent == null && c.moveToNext()) {
5842 try {
5843 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02005844 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005845 } catch (java.net.URISyntaxException e) {
5846 // The stored URL is bad... ignore it.
5847 } catch (IllegalArgumentException e) {
5848 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07005849 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005850 }
5851 }
5852 } finally {
5853 if (c != null) c.close();
5854 }
5855
5856 return intent;
5857 }
5858
5859 /**
5860 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005861 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005862 * @param cr The ContentResolver to query.
5863 * @param intent The desired target of the bookmark.
5864 * @param title Bookmark title that is shown to the user; null if none
5865 * or it should be resolved to the intent's title.
5866 * @param folder Folder in which to place the bookmark; null if none.
5867 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
5868 * this is non-zero and there is an existing bookmark entry
5869 * with this same shortcut, then that existing shortcut is
5870 * cleared (the bookmark is not removed).
5871 * @return The unique content URL for the new bookmark entry.
5872 */
5873 public static Uri add(ContentResolver cr,
5874 Intent intent,
5875 String title,
5876 String folder,
5877 char shortcut,
5878 int ordering)
5879 {
5880 // If a shortcut is supplied, and it is already defined for
5881 // another bookmark, then remove the old definition.
5882 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05005883 cr.delete(CONTENT_URI, sShortcutSelection,
5884 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005885 }
5886
5887 ContentValues values = new ContentValues();
5888 if (title != null) values.put(TITLE, title);
5889 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07005890 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005891 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
5892 values.put(ORDERING, ordering);
5893 return cr.insert(CONTENT_URI, values);
5894 }
5895
5896 /**
5897 * Return the folder name as it should be displayed to the user. This
5898 * takes care of localizing special folders.
5899 *
5900 * @param r Resources object for current locale; only need access to
5901 * system resources.
5902 * @param folder The value found in the {@link #FOLDER} column.
5903 *
5904 * @return CharSequence The label for this folder that should be shown
5905 * to the user.
5906 */
5907 public static CharSequence getLabelForFolder(Resources r, String folder) {
5908 return folder;
5909 }
5910
5911 /**
5912 * Return the title as it should be displayed to the user. This takes
5913 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005914 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005915 * @param context A context.
5916 * @param cursor A cursor pointing to the row whose title should be
5917 * returned. The cursor must contain at least the {@link #TITLE}
5918 * and {@link #INTENT} columns.
5919 * @return A title that is localized and can be displayed to the user,
5920 * or the empty string if one could not be found.
5921 */
5922 public static CharSequence getTitle(Context context, Cursor cursor) {
5923 int titleColumn = cursor.getColumnIndex(TITLE);
5924 int intentColumn = cursor.getColumnIndex(INTENT);
5925 if (titleColumn == -1 || intentColumn == -1) {
5926 throw new IllegalArgumentException(
5927 "The cursor must contain the TITLE and INTENT columns.");
5928 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005929
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005930 String title = cursor.getString(titleColumn);
5931 if (!TextUtils.isEmpty(title)) {
5932 return title;
5933 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005934
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005935 String intentUri = cursor.getString(intentColumn);
5936 if (TextUtils.isEmpty(intentUri)) {
5937 return "";
5938 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005939
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005940 Intent intent;
5941 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02005942 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005943 } catch (URISyntaxException e) {
5944 return "";
5945 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005946
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005947 PackageManager packageManager = context.getPackageManager();
5948 ResolveInfo info = packageManager.resolveActivity(intent, 0);
5949 return info != null ? info.loadLabel(packageManager) : "";
5950 }
5951 }
5952
5953 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005954 * Returns the device ID that we should use when connecting to the mobile gtalk server.
5955 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
5956 * from the GoogleLoginService.
5957 *
5958 * @param androidId The Android ID for this device.
5959 * @return The device ID that should be used when connecting to the mobile gtalk server.
5960 * @hide
5961 */
5962 public static String getGTalkDeviceId(long androidId) {
5963 return "android-" + Long.toHexString(androidId);
5964 }
5965}