blob: 4dbc4b4fa0fdb8705d8a4355ef4414d44677984c [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;
Gilles Debunnee90bed12011-08-30 14:28:27 -070053import android.view.WindowOrientationListener;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080054
Amith Yamasani52c489c2012-03-28 11:42:42 -070055import com.android.internal.widget.ILockSettings;
56
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080057import java.net.URISyntaxException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080058import java.util.HashMap;
59import java.util.HashSet;
60
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080061/**
62 * The Settings provider contains global system-level device preferences.
63 */
64public final class Settings {
65
66 // Intent actions for Settings
67
68 /**
69 * Activity Action: Show system settings.
70 * <p>
71 * Input: Nothing.
72 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070073 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080074 */
75 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
76 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
77
78 /**
79 * Activity Action: Show settings to allow configuration of APNs.
80 * <p>
81 * Input: Nothing.
82 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070083 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080084 */
85 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
86 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
87
88 /**
89 * Activity Action: Show settings to allow configuration of current location
90 * sources.
91 * <p>
92 * In some cases, a matching Activity may not exist, so ensure you
93 * safeguard against this.
94 * <p>
95 * Input: Nothing.
96 * <p>
97 * Output: Nothing.
98 */
99 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
100 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
101 "android.settings.LOCATION_SOURCE_SETTINGS";
102
103 /**
104 * Activity Action: Show settings to allow configuration of wireless controls
105 * such as Wi-Fi, Bluetooth and Mobile networks.
106 * <p>
107 * In some cases, a matching Activity may not exist, so ensure you
108 * safeguard against this.
109 * <p>
110 * Input: Nothing.
111 * <p>
112 * Output: Nothing.
113 */
114 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
115 public static final String ACTION_WIRELESS_SETTINGS =
116 "android.settings.WIRELESS_SETTINGS";
117
118 /**
119 * Activity Action: Show settings to allow entering/exiting airplane mode.
120 * <p>
121 * In some cases, a matching Activity may not exist, so ensure you
122 * safeguard against this.
123 * <p>
124 * Input: Nothing.
125 * <p>
126 * Output: Nothing.
127 */
128 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
129 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
130 "android.settings.AIRPLANE_MODE_SETTINGS";
131
132 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700133 * Activity Action: Show settings for accessibility modules.
134 * <p>
135 * In some cases, a matching Activity may not exist, so ensure you
136 * safeguard against this.
137 * <p>
138 * Input: Nothing.
139 * <p>
140 * Output: Nothing.
141 */
142 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
143 public static final String ACTION_ACCESSIBILITY_SETTINGS =
144 "android.settings.ACCESSIBILITY_SETTINGS";
145
146 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800147 * Activity Action: Show settings to allow configuration of security and
148 * location privacy.
149 * <p>
150 * In some cases, a matching Activity may not exist, so ensure you
151 * safeguard against this.
152 * <p>
153 * Input: Nothing.
154 * <p>
155 * Output: Nothing.
156 */
157 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
158 public static final String ACTION_SECURITY_SETTINGS =
159 "android.settings.SECURITY_SETTINGS";
160
161 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700162 * Activity Action: Show settings to allow configuration of privacy options.
163 * <p>
164 * In some cases, a matching Activity may not exist, so ensure you
165 * safeguard against this.
166 * <p>
167 * Input: Nothing.
168 * <p>
169 * Output: Nothing.
170 */
171 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
172 public static final String ACTION_PRIVACY_SETTINGS =
173 "android.settings.PRIVACY_SETTINGS";
174
175 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800176 * Activity Action: Show settings to allow configuration of Wi-Fi.
177
178 * <p>
179 * In some cases, a matching Activity may not exist, so ensure you
180 * safeguard against this.
181 * <p>
182 * Input: Nothing.
183 * <p>
184 * Output: Nothing.
185
186 */
187 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
188 public static final String ACTION_WIFI_SETTINGS =
189 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700190
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800191 /**
192 * Activity Action: Show settings to allow configuration of a static IP
193 * address for Wi-Fi.
194 * <p>
195 * In some cases, a matching Activity may not exist, so ensure you safeguard
196 * against this.
197 * <p>
198 * Input: Nothing.
199 * <p>
200 * Output: Nothing.
201 */
202 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
203 public static final String ACTION_WIFI_IP_SETTINGS =
204 "android.settings.WIFI_IP_SETTINGS";
205
206 /**
207 * Activity Action: Show settings to allow configuration of Bluetooth.
208 * <p>
209 * In some cases, a matching Activity may not exist, so ensure you
210 * safeguard against this.
211 * <p>
212 * Input: Nothing.
213 * <p>
214 * Output: Nothing.
215 */
216 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
217 public static final String ACTION_BLUETOOTH_SETTINGS =
218 "android.settings.BLUETOOTH_SETTINGS";
219
220 /**
Jeff Brown89d55462012-09-19 11:33:42 -0700221 * Activity Action: Show settings to allow configuration of Wifi Displays.
222 * <p>
223 * In some cases, a matching Activity may not exist, so ensure you
224 * safeguard against this.
225 * <p>
226 * Input: Nothing.
227 * <p>
228 * Output: Nothing.
229 * @hide
230 */
231 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
232 public static final String ACTION_WIFI_DISPLAY_SETTINGS =
233 "android.settings.WIFI_DISPLAY_SETTINGS";
234
235 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800236 * Activity Action: Show settings to allow configuration of date and time.
237 * <p>
238 * In some cases, a matching Activity may not exist, so ensure you
239 * safeguard against this.
240 * <p>
241 * Input: Nothing.
242 * <p>
243 * Output: Nothing.
244 */
245 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
246 public static final String ACTION_DATE_SETTINGS =
247 "android.settings.DATE_SETTINGS";
248
249 /**
250 * Activity Action: Show settings to allow configuration of sound and volume.
251 * <p>
252 * In some cases, a matching Activity may not exist, so ensure you
253 * safeguard against this.
254 * <p>
255 * Input: Nothing.
256 * <p>
257 * Output: Nothing.
258 */
259 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
260 public static final String ACTION_SOUND_SETTINGS =
261 "android.settings.SOUND_SETTINGS";
262
263 /**
264 * Activity Action: Show settings to allow configuration of display.
265 * <p>
266 * In some cases, a matching Activity may not exist, so ensure you
267 * safeguard against this.
268 * <p>
269 * Input: Nothing.
270 * <p>
271 * Output: Nothing.
272 */
273 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
274 public static final String ACTION_DISPLAY_SETTINGS =
275 "android.settings.DISPLAY_SETTINGS";
276
277 /**
278 * Activity Action: Show settings to allow configuration of locale.
279 * <p>
280 * In some cases, a matching Activity may not exist, so ensure you
281 * safeguard against this.
282 * <p>
283 * Input: Nothing.
284 * <p>
285 * Output: Nothing.
286 */
287 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
288 public static final String ACTION_LOCALE_SETTINGS =
289 "android.settings.LOCALE_SETTINGS";
290
291 /**
292 * Activity Action: Show settings to configure input methods, in particular
293 * allowing the user to enable input methods.
294 * <p>
295 * In some cases, a matching Activity may not exist, so ensure you
296 * safeguard against this.
297 * <p>
298 * Input: Nothing.
299 * <p>
300 * Output: Nothing.
301 */
302 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
303 public static final String ACTION_INPUT_METHOD_SETTINGS =
304 "android.settings.INPUT_METHOD_SETTINGS";
305
306 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900307 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900308 * <p>
309 * In some cases, a matching Activity may not exist, so ensure you
310 * safeguard against this.
311 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900312 * To tell which input method's subtypes are displayed in the settings, add
313 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
314 * If there is no extra in this Intent, subtypes from all installed input methods
315 * will be displayed in the settings.
316 *
317 * @see android.view.inputmethod.InputMethodInfo#getId
318 * <p>
satok86417ea2010-10-27 14:11:03 +0900319 * Input: Nothing.
320 * <p>
321 * Output: Nothing.
322 */
323 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900324 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
325 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900326
327 /**
satok7cfc0ed2011-06-20 21:29:36 +0900328 * Activity Action: Show a dialog to select input method.
329 * <p>
330 * In some cases, a matching Activity may not exist, so ensure you
331 * safeguard against this.
332 * <p>
333 * Input: Nothing.
334 * <p>
335 * Output: Nothing.
336 * @hide
337 */
338 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
339 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
340 "android.settings.SHOW_INPUT_METHOD_PICKER";
341
342 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800343 * Activity Action: Show settings to manage the user input dictionary.
344 * <p>
345 * In some cases, a matching Activity may not exist, so ensure you
346 * safeguard against this.
347 * <p>
348 * Input: Nothing.
349 * <p>
350 * Output: Nothing.
351 */
352 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
353 public static final String ACTION_USER_DICTIONARY_SETTINGS =
354 "android.settings.USER_DICTIONARY_SETTINGS";
355
356 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700357 * Activity Action: Adds a word to the user dictionary.
358 * <p>
359 * In some cases, a matching Activity may not exist, so ensure you
360 * safeguard against this.
361 * <p>
362 * Input: An extra with key <code>word</code> that contains the word
363 * that should be added to the dictionary.
364 * <p>
365 * Output: Nothing.
366 *
367 * @hide
368 */
369 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
370 public static final String ACTION_USER_DICTIONARY_INSERT =
371 "com.android.settings.USER_DICTIONARY_INSERT";
372
373 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800374 * Activity Action: Show settings to allow configuration of application-related settings.
375 * <p>
376 * In some cases, a matching Activity may not exist, so ensure you
377 * safeguard against this.
378 * <p>
379 * Input: Nothing.
380 * <p>
381 * Output: Nothing.
382 */
383 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
384 public static final String ACTION_APPLICATION_SETTINGS =
385 "android.settings.APPLICATION_SETTINGS";
386
387 /**
388 * Activity Action: Show settings to allow configuration of application
Dianne Hackborn8d866e52012-10-10 18:39:45 -0700389 * development-related settings. As of
390 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
391 * a required part of the platform.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800392 * <p>
393 * Input: Nothing.
394 * <p>
395 * Output: Nothing.
396 */
397 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
398 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
399 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
400
401 /**
402 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
403 * <p>
404 * In some cases, a matching Activity may not exist, so ensure you
405 * safeguard against this.
406 * <p>
407 * Input: Nothing.
408 * <p>
409 * Output: Nothing.
410 */
411 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
412 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
413 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700414
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800415 /**
416 * Activity Action: Show settings to manage installed applications.
417 * <p>
418 * In some cases, a matching Activity may not exist, so ensure you
419 * safeguard against this.
420 * <p>
421 * Input: Nothing.
422 * <p>
423 * Output: Nothing.
424 */
425 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
426 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
427 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700428
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800429 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700430 * Activity Action: Show settings to manage all applications.
431 * <p>
432 * In some cases, a matching Activity may not exist, so ensure you
433 * safeguard against this.
434 * <p>
435 * Input: Nothing.
436 * <p>
437 * Output: Nothing.
438 */
439 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
440 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
441 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
442
443 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700444 * Activity Action: Show screen of details about a particular application.
445 * <p>
446 * In some cases, a matching Activity may not exist, so ensure you
447 * safeguard against this.
448 * <p>
449 * Input: The Intent's data URI specifies the application package name
450 * to be shown, with the "package" scheme. That is "package:com.my.app".
451 * <p>
452 * Output: Nothing.
453 */
454 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
455 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
456 "android.settings.APPLICATION_DETAILS_SETTINGS";
457
458 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800459 * Activity Action: Show settings for system update functionality.
460 * <p>
461 * In some cases, a matching Activity may not exist, so ensure you
462 * safeguard against this.
463 * <p>
464 * Input: Nothing.
465 * <p>
466 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700467 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800468 * @hide
469 */
470 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
471 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
472 "android.settings.SYSTEM_UPDATE_SETTINGS";
473
474 /**
475 * Activity Action: Show settings to allow configuration of sync settings.
476 * <p>
477 * In some cases, a matching Activity may not exist, so ensure you
478 * safeguard against this.
479 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800480 * The account types available to add via the add account button may be restricted by adding an
481 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
482 * authorities. Only account types which can sync with that content provider will be offered to
483 * the user.
484 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800485 * Input: Nothing.
486 * <p>
487 * Output: Nothing.
488 */
489 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
490 public static final String ACTION_SYNC_SETTINGS =
491 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700492
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800493 /**
Erikeebc8e22010-02-18 13:27:19 -0800494 * Activity Action: Show add account screen for creating a new account.
495 * <p>
496 * In some cases, a matching Activity may not exist, so ensure you
497 * safeguard against this.
498 * <p>
499 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
500 * extra to the Intent with one or more syncable content provider's authorities. Only account
501 * types which can sync with that content provider will be offered to the user.
502 * <p>
503 * Input: Nothing.
504 * <p>
505 * Output: Nothing.
506 */
507 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
508 public static final String ACTION_ADD_ACCOUNT =
509 "android.settings.ADD_ACCOUNT_SETTINGS";
510
511 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800512 * Activity Action: Show settings for selecting the network operator.
513 * <p>
514 * In some cases, a matching Activity may not exist, so ensure you
515 * safeguard against this.
516 * <p>
517 * Input: Nothing.
518 * <p>
519 * Output: Nothing.
520 */
521 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
522 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
523 "android.settings.NETWORK_OPERATOR_SETTINGS";
524
525 /**
526 * Activity Action: Show settings for selection of 2G/3G.
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_DATA_ROAMING_SETTINGS =
537 "android.settings.DATA_ROAMING_SETTINGS";
538
539 /**
540 * Activity Action: Show settings for internal storage.
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_INTERNAL_STORAGE_SETTINGS =
551 "android.settings.INTERNAL_STORAGE_SETTINGS";
552 /**
553 * Activity Action: Show settings for memory card storage.
554 * <p>
555 * In some cases, a matching Activity may not exist, so ensure you
556 * safeguard against this.
557 * <p>
558 * Input: Nothing.
559 * <p>
560 * Output: Nothing.
561 */
562 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
563 public static final String ACTION_MEMORY_CARD_SETTINGS =
564 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700565
Justin Mattsonef340352010-01-13 21:05:46 -0800566 /**
567 * Activity Action: Show settings for global search.
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_SEARCH_SETTINGS =
578 "android.search.action.SEARCH_SETTINGS";
579
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500580 /**
581 * Activity Action: Show general device information settings (serial
582 * number, software version, phone number, etc.).
583 * <p>
584 * In some cases, a matching Activity may not exist, so ensure you
585 * safeguard against this.
586 * <p>
587 * Input: Nothing.
588 * <p>
589 * Output: Nothing
590 */
591 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
592 public static final String ACTION_DEVICE_INFO_SETTINGS =
593 "android.settings.DEVICE_INFO_SETTINGS";
594
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500595 /**
Nick Pellycccf01d2011-10-31 14:49:40 -0700596 * Activity Action: Show NFC settings.
597 * <p>
598 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500599 * <p>
600 * In some cases, a matching Activity may not exist, so ensure you
601 * safeguard against this.
602 * <p>
603 * Input: Nothing.
604 * <p>
605 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -0700606 * @see android.nfc.NfcAdapter#isEnabled()
607 */
608 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
609 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
610
611 /**
612 * Activity Action: Show NFC Sharing settings.
613 * <p>
614 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
615 * off.
616 * <p>
617 * In some cases, a matching Activity may not exist, so ensure you
618 * safeguard against this.
619 * <p>
620 * Input: Nothing.
621 * <p>
622 * Output: Nothing
623 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500624 */
625 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
626 public static final String ACTION_NFCSHARING_SETTINGS =
627 "android.settings.NFCSHARING_SETTINGS";
628
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500629 /**
630 * Activity Action: Show Daydream settings.
631 * <p>
632 * In some cases, a matching Activity may not exist, so ensure you
633 * safeguard against this.
634 * <p>
635 * Input: Nothing.
636 * <p>
637 * Output: Nothing.
638 * @see android.service.dreams.DreamService
639 * @hide
640 */
641 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
642 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
643
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800644 // End of Intent actions for Settings
645
Erikeebc8e22010-02-18 13:27:19 -0800646 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800647 * @hide - Private call() method on SettingsProvider to read from 'system' table.
648 */
649 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
650
651 /**
652 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
653 */
654 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
655
656 /**
Christopher Tate06efb532012-08-24 15:29:27 -0700657 * @hide - Private call() method on SettingsProvider to read from 'global' table.
658 */
659 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
660
661 /**
662 * @hide - User handle argument extra to the fast-path call()-based requests
663 */
664 public static final String CALL_METHOD_USER_KEY = "_user";
665
666 /** @hide - Private call() method to write to 'system' table */
667 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
668
669 /** @hide - Private call() method to write to 'secure' table */
670 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
671
672 /** @hide - Private call() method to write to 'global' table */
673 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
674
675 /**
Erikeebc8e22010-02-18 13:27:19 -0800676 * Activity Extra: Limit available options in launched activity based on the given authority.
677 * <p>
678 * This can be passed as an extra field in an Activity Intent with one or more syncable content
679 * provider's authorities as a String[]. This field is used by some intents to alter the
680 * behavior of the called activity.
681 * <p>
682 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
683 * on the authority given.
684 */
685 public static final String EXTRA_AUTHORITIES =
686 "authorities";
687
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900688 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
689
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800690 private static final String JID_RESOURCE_PREFIX = "android";
691
692 public static final String AUTHORITY = "settings";
693
694 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -0700695 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800696
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800697 public static class SettingNotFoundException extends AndroidException {
698 public SettingNotFoundException(String msg) {
699 super(msg);
700 }
701 }
702
703 /**
704 * Common base for tables of name/value settings.
705 */
706 public static class NameValueTable implements BaseColumns {
707 public static final String NAME = "name";
708 public static final String VALUE = "value";
709
710 protected static boolean putString(ContentResolver resolver, Uri uri,
711 String name, String value) {
712 // The database will take care of replacing duplicates.
713 try {
714 ContentValues values = new ContentValues();
715 values.put(NAME, name);
716 values.put(VALUE, value);
717 resolver.insert(uri, values);
718 return true;
719 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -0700720 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800721 return false;
722 }
723 }
724
725 public static Uri getUriFor(Uri uri, String name) {
726 return Uri.withAppendedPath(uri, name);
727 }
728 }
729
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800730 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800731 private static class NameValueCache {
732 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800733 private final Uri mUri;
734
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800735 private static final String[] SELECT_VALUE =
736 new String[] { Settings.NameValueTable.VALUE };
737 private static final String NAME_EQ_PLACEHOLDER = "name=?";
738
739 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -0800740 private final HashMap<String, String> mValues = new HashMap<String, String>();
741 private long mValuesVersion = 0;
742
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800743 // Initially null; set lazily and held forever. Synchronized on 'this'.
744 private IContentProvider mContentProvider = null;
745
746 // The method we'll call (or null, to not use) on the provider
747 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -0700748 private final String mCallGetCommand;
749 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800750
Christopher Tate06efb532012-08-24 15:29:27 -0700751 public NameValueCache(String versionSystemProperty, Uri uri,
752 String getCommand, String setCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800753 mVersionSystemProperty = versionSystemProperty;
754 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -0700755 mCallGetCommand = getCommand;
756 mCallSetCommand = setCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800757 }
758
Christopher Tate06efb532012-08-24 15:29:27 -0700759 private IContentProvider lazyGetProvider(ContentResolver cr) {
760 IContentProvider cp = null;
761 synchronized (this) {
762 cp = mContentProvider;
763 if (cp == null) {
764 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
765 }
766 }
767 return cp;
768 }
769
770 public boolean putStringForUser(ContentResolver cr, String name, String value,
771 final int userHandle) {
772 try {
773 Bundle arg = new Bundle();
774 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -0700775 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -0700776 IContentProvider cp = lazyGetProvider(cr);
777 cp.call(mCallSetCommand, name, arg);
778 } catch (RemoteException e) {
779 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
780 return false;
781 }
782 return true;
783 }
784
Christopher Tate06efb532012-08-24 15:29:27 -0700785 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -0700786 final boolean isSelf = (userHandle == UserHandle.myUserId());
787 if (isSelf) {
788 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -0800789
Christopher Tate78d2a662012-09-13 16:19:44 -0700790 // Our own user's settings data uses a client-side cache
791 synchronized (this) {
792 if (mValuesVersion != newValuesVersion) {
793 if (LOCAL_LOGV || false) {
794 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current "
795 + newValuesVersion + " != cached " + mValuesVersion);
796 }
797
798 mValues.clear();
799 mValuesVersion = newValuesVersion;
Dan Egnor799f7212009-11-24 16:24:44 -0800800 }
801
Christopher Tate78d2a662012-09-13 16:19:44 -0700802 if (mValues.containsKey(name)) {
803 return mValues.get(name); // Could be null, that's OK -- negative caching
804 }
Dan Egnor799f7212009-11-24 16:24:44 -0800805 }
Christopher Tate78d2a662012-09-13 16:19:44 -0700806 } else {
807 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
808 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800809 }
Dan Egnor799f7212009-11-24 16:24:44 -0800810
Christopher Tate06efb532012-08-24 15:29:27 -0700811 IContentProvider cp = lazyGetProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800812
813 // Try the fast path first, not using query(). If this
814 // fails (alternate Settings provider that doesn't support
815 // this interface?) then we fall back to the query/table
816 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -0700817 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800818 try {
Christopher Tate06efb532012-08-24 15:29:27 -0700819 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -0700820 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -0700821 args = new Bundle();
822 args.putInt(CALL_METHOD_USER_KEY, userHandle);
823 }
824 Bundle b = cp.call(mCallGetCommand, name, args);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800825 if (b != null) {
826 String value = b.getPairValue();
Christopher Tate78d2a662012-09-13 16:19:44 -0700827 // Don't update our cache for reads of other users' data
828 if (isSelf) {
829 synchronized (this) {
830 mValues.put(name, value);
831 }
832 } else {
833 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
834 + " by " + UserHandle.myUserId()
835 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800836 }
837 return value;
838 }
839 // If the response Bundle is null, we fall through
840 // to the query interface below.
841 } catch (RemoteException e) {
842 // Not supported by the remote side? Fall through
843 // to query().
844 }
845 }
846
Dan Egnor799f7212009-11-24 16:24:44 -0800847 Cursor c = null;
848 try {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800849 c = cp.query(mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
Jeff Brown75ea64f2012-01-25 19:37:13 -0800850 new String[]{name}, null, null);
Dan Egnor799f7212009-11-24 16:24:44 -0800851 if (c == null) {
852 Log.w(TAG, "Can't get key " + name + " from " + mUri);
853 return null;
854 }
855
856 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800857 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -0800858 mValues.put(name, value);
859 }
860 if (LOCAL_LOGV) {
861 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
862 name + " = " + (value == null ? "(null)" : value));
863 }
864 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800865 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -0800866 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
867 return null; // Return null, but don't cache it.
868 } finally {
869 if (c != null) c.close();
870 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800871 }
872 }
873
874 /**
875 * System settings, containing miscellaneous system preferences. This
876 * table holds simple name/value pairs. There are convenience
877 * functions for accessing individual settings entries.
878 */
879 public static final class System extends NameValueTable {
880 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
881
Dianne Hackborn139748f2012-09-24 11:36:57 -0700882 /**
883 * The content:// style URL for this table
884 */
885 public static final Uri CONTENT_URI =
886 Uri.parse("content://" + AUTHORITY + "/system");
887
888 private static final NameValueCache sNameValueCache = new NameValueCache(
889 SYS_PROP_SETTING_VERSION,
890 CONTENT_URI,
891 CALL_METHOD_GET_SYSTEM,
892 CALL_METHOD_PUT_SYSTEM);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700893
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800894 private static final HashSet<String> MOVED_TO_SECURE;
895 static {
896 MOVED_TO_SECURE = new HashSet<String>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800897 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800898 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800899 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -0400900 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -0800901 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
902 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
903 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800904 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
905 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
906 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
907 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
908 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800909 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
910 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
911 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
912 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
913 MOVED_TO_SECURE.add(Secure.WIFI_ON);
914 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
915 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
916 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
917 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
918 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
919 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
920 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
921 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
922 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
923 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
924 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
925 }
926
Christopher Tate06efb532012-08-24 15:29:27 -0700927 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -0700928 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -0700929 static {
930 MOVED_TO_GLOBAL = new HashSet<String>();
Christopher Tate66488d62012-10-02 11:58:01 -0700931 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
932
Christopher Tate92198742012-09-07 12:00:13 -0700933 // these were originally in system but migrated to secure in the past,
934 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -0700935 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
936 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
937 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
938 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
939 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.INSTALL_NON_MARKET_APPS);
940 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
941 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -0700942
Christopher Tate92198742012-09-07 12:00:13 -0700943 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -0700944 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
945 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
946 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
947 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
948 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
949 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
950 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
951 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
952 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
953 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
954 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
955 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
956 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
957 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
958 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
959 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -0700960 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -0700961 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
962 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
963 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
964 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
965 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
966 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
967 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
968 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
969 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
970 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
971 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Christopher Tate06efb532012-08-24 15:29:27 -0700972 }
973
Christopher Tate66488d62012-10-02 11:58:01 -0700974 /** @hide */
975 public static void getMovedKeys(HashSet<String> outKeySet) {
976 outKeySet.addAll(MOVED_TO_GLOBAL);
977 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
978 }
979
980 /** @hide */
981 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
982 outKeySet.addAll(MOVED_TO_GLOBAL);
983 }
984
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800985 /**
986 * Look up a name in the database.
987 * @param resolver to access the database with
988 * @param name to look up in the table
989 * @return the corresponding value, or null if not present
990 */
Dianne Hackborn139748f2012-09-24 11:36:57 -0700991 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -0700992 return getStringForUser(resolver, name, UserHandle.myUserId());
993 }
994
995 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -0700996 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -0700997 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800998 if (MOVED_TO_SECURE.contains(name)) {
999 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1000 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07001001 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001002 }
Christopher Tate66488d62012-10-02 11:58:01 -07001003 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001004 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1005 + " to android.provider.Settings.Global, returning read-only value.");
1006 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001007 }
Christopher Tate06efb532012-08-24 15:29:27 -07001008 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001009 }
1010
1011 /**
1012 * Store a name/value pair into the database.
1013 * @param resolver to access the database with
1014 * @param name to store
1015 * @param value to associate with the name
1016 * @return true if the value was set, false on database errors
1017 */
1018 public static boolean putString(ContentResolver resolver, String name, String value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001019 return putStringForUser(resolver, name, value, UserHandle.myUserId());
1020 }
1021
1022 /** @hide */
1023 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
1024 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001025 if (MOVED_TO_SECURE.contains(name)) {
1026 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1027 + " to android.provider.Settings.Secure, value is unchanged.");
1028 return false;
1029 }
Christopher Tate66488d62012-10-02 11:58:01 -07001030 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001031 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1032 + " to android.provider.Settings.Global, value is unchanged.");
1033 return false;
1034 }
Christopher Tate06efb532012-08-24 15:29:27 -07001035 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001036 }
1037
1038 /**
1039 * Construct the content URI for a particular name/value pair,
1040 * useful for monitoring changes with a ContentObserver.
1041 * @param name to look up in the table
1042 * @return the corresponding content URI, or null if not present
1043 */
1044 public static Uri getUriFor(String name) {
1045 if (MOVED_TO_SECURE.contains(name)) {
1046 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1047 + " to android.provider.Settings.Secure, returning Secure URI.");
1048 return Secure.getUriFor(Secure.CONTENT_URI, name);
1049 }
Christopher Tate66488d62012-10-02 11:58:01 -07001050 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001051 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1052 + " to android.provider.Settings.Global, returning read-only global URI.");
1053 return Global.getUriFor(Global.CONTENT_URI, name);
1054 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001055 return getUriFor(CONTENT_URI, name);
1056 }
1057
1058 /**
1059 * Convenience function for retrieving a single system settings value
1060 * as an integer. Note that internally setting values are always
1061 * stored as strings; this function converts the string to an integer
1062 * for you. The default value will be returned if the setting is
1063 * not defined or not an integer.
1064 *
1065 * @param cr The ContentResolver to access.
1066 * @param name The name of the setting to retrieve.
1067 * @param def Value to return if the setting is not defined.
1068 *
1069 * @return The setting's current value, or 'def' if it is not defined
1070 * or not a valid integer.
1071 */
1072 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001073 return getIntForUser(cr, name, def, UserHandle.myUserId());
1074 }
1075
1076 /** @hide */
1077 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
1078 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001079 try {
1080 return v != null ? Integer.parseInt(v) : def;
1081 } catch (NumberFormatException e) {
1082 return def;
1083 }
1084 }
1085
1086 /**
1087 * Convenience function for retrieving a single system settings value
1088 * as an integer. Note that internally setting values are always
1089 * stored as strings; this function converts the string to an integer
1090 * for you.
1091 * <p>
1092 * This version does not take a default value. If the setting has not
1093 * been set, or the string value is not a number,
1094 * it throws {@link SettingNotFoundException}.
1095 *
1096 * @param cr The ContentResolver to access.
1097 * @param name The name of the setting to retrieve.
1098 *
1099 * @throws SettingNotFoundException Thrown if a setting by the given
1100 * name can't be found or the setting value is not an integer.
1101 *
1102 * @return The setting's current value.
1103 */
1104 public static int getInt(ContentResolver cr, String name)
1105 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001106 return getIntForUser(cr, name, UserHandle.myUserId());
1107 }
1108
1109 /** @hide */
1110 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
1111 throws SettingNotFoundException {
1112 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001113 try {
1114 return Integer.parseInt(v);
1115 } catch (NumberFormatException e) {
1116 throw new SettingNotFoundException(name);
1117 }
1118 }
1119
1120 /**
1121 * Convenience function for updating a single settings value as an
1122 * integer. This will either create a new entry in the table if the
1123 * given name does not exist, or modify the value of the existing row
1124 * with that name. Note that internally setting values are always
1125 * stored as strings, so this function converts the given value to a
1126 * string before storing it.
1127 *
1128 * @param cr The ContentResolver to access.
1129 * @param name The name of the setting to modify.
1130 * @param value The new value for the setting.
1131 * @return true if the value was set, false on database errors
1132 */
1133 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001134 return putIntForUser(cr, name, value, UserHandle.myUserId());
1135 }
1136
1137 /** @hide */
1138 public static boolean putIntForUser(ContentResolver cr, String name, int value,
1139 int userHandle) {
1140 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001141 }
1142
1143 /**
1144 * Convenience function for retrieving a single system settings value
1145 * as a {@code long}. Note that internally setting values are always
1146 * stored as strings; this function converts the string to a {@code long}
1147 * for you. The default value will be returned if the setting is
1148 * not defined or not a {@code long}.
1149 *
1150 * @param cr The ContentResolver to access.
1151 * @param name The name of the setting to retrieve.
1152 * @param def Value to return if the setting is not defined.
1153 *
1154 * @return The setting's current value, or 'def' if it is not defined
1155 * or not a valid {@code long}.
1156 */
1157 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001158 return getLongForUser(cr, name, def, UserHandle.myUserId());
1159 }
1160
1161 /** @hide */
1162 public static long getLongForUser(ContentResolver cr, String name, long def,
1163 int userHandle) {
1164 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001165 long value;
1166 try {
1167 value = valString != null ? Long.parseLong(valString) : def;
1168 } catch (NumberFormatException e) {
1169 value = def;
1170 }
1171 return value;
1172 }
1173
1174 /**
1175 * Convenience function for retrieving a single system settings value
1176 * as a {@code long}. Note that internally setting values are always
1177 * stored as strings; this function converts the string to a {@code long}
1178 * for you.
1179 * <p>
1180 * This version does not take a default value. If the setting has not
1181 * been set, or the string value is not a number,
1182 * it throws {@link SettingNotFoundException}.
1183 *
1184 * @param cr The ContentResolver to access.
1185 * @param name The name of the setting to retrieve.
1186 *
1187 * @return The setting's current value.
1188 * @throws SettingNotFoundException Thrown if a setting by the given
1189 * name can't be found or the setting value is not an integer.
1190 */
1191 public static long getLong(ContentResolver cr, String name)
1192 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001193 return getLongForUser(cr, name, UserHandle.myUserId());
1194 }
1195
1196 /** @hide */
1197 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
1198 throws SettingNotFoundException {
1199 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001200 try {
1201 return Long.parseLong(valString);
1202 } catch (NumberFormatException e) {
1203 throw new SettingNotFoundException(name);
1204 }
1205 }
1206
1207 /**
1208 * Convenience function for updating a single settings value as a long
1209 * integer. This will either create a new entry in the table if the
1210 * given name does not exist, or modify the value of the existing row
1211 * with that name. Note that internally setting values are always
1212 * stored as strings, so this function converts the given value to a
1213 * string before storing it.
1214 *
1215 * @param cr The ContentResolver to access.
1216 * @param name The name of the setting to modify.
1217 * @param value The new value for the setting.
1218 * @return true if the value was set, false on database errors
1219 */
1220 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001221 return putLongForUser(cr, name, value, UserHandle.myUserId());
1222 }
1223
1224 /** @hide */
1225 public static boolean putLongForUser(ContentResolver cr, String name, long value,
1226 int userHandle) {
1227 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001228 }
1229
1230 /**
1231 * Convenience function for retrieving a single system settings value
1232 * as a floating point number. Note that internally setting values are
1233 * always stored as strings; this function converts the string to an
1234 * float for you. The default value will be returned if the setting
1235 * is not defined or not a valid float.
1236 *
1237 * @param cr The ContentResolver to access.
1238 * @param name The name of the setting to retrieve.
1239 * @param def Value to return if the setting is not defined.
1240 *
1241 * @return The setting's current value, or 'def' if it is not defined
1242 * or not a valid float.
1243 */
1244 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001245 return getFloatForUser(cr, name, def, UserHandle.myUserId());
1246 }
1247
1248 /** @hide */
1249 public static float getFloatForUser(ContentResolver cr, String name, float def,
1250 int userHandle) {
1251 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001252 try {
1253 return v != null ? Float.parseFloat(v) : def;
1254 } catch (NumberFormatException e) {
1255 return def;
1256 }
1257 }
1258
1259 /**
1260 * Convenience function for retrieving a single system settings value
1261 * as a float. Note that internally setting values are always
1262 * stored as strings; this function converts the string to a float
1263 * for you.
1264 * <p>
1265 * This version does not take a default value. If the setting has not
1266 * been set, or the string value is not a number,
1267 * it throws {@link SettingNotFoundException}.
1268 *
1269 * @param cr The ContentResolver to access.
1270 * @param name The name of the setting to retrieve.
1271 *
1272 * @throws SettingNotFoundException Thrown if a setting by the given
1273 * name can't be found or the setting value is not a float.
1274 *
1275 * @return The setting's current value.
1276 */
1277 public static float getFloat(ContentResolver cr, String name)
1278 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001279 return getFloatForUser(cr, name, UserHandle.myUserId());
1280 }
1281
1282 /** @hide */
1283 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
1284 throws SettingNotFoundException {
1285 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08001286 if (v == null) {
1287 throw new SettingNotFoundException(name);
1288 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001289 try {
1290 return Float.parseFloat(v);
1291 } catch (NumberFormatException e) {
1292 throw new SettingNotFoundException(name);
1293 }
1294 }
1295
1296 /**
1297 * Convenience function for updating a single settings value as a
1298 * floating point number. This will either create a new entry in the
1299 * table if the given name does not exist, or modify the value of the
1300 * existing row with that name. Note that internally setting values
1301 * are always stored as strings, so this function converts the given
1302 * value to a string before storing it.
1303 *
1304 * @param cr The ContentResolver to access.
1305 * @param name The name of the setting to modify.
1306 * @param value The new value for the setting.
1307 * @return true if the value was set, false on database errors
1308 */
1309 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001310 return putFloatForUser(cr, name, value, UserHandle.myUserId());
1311 }
1312
1313 /** @hide */
1314 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
1315 int userHandle) {
1316 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001317 }
1318
1319 /**
1320 * Convenience function to read all of the current
1321 * configuration-related settings into a
1322 * {@link Configuration} object.
1323 *
1324 * @param cr The ContentResolver to access.
1325 * @param outConfig Where to place the configuration settings.
1326 */
1327 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Christopher Tate06efb532012-08-24 15:29:27 -07001328 getConfigurationForUser(cr, outConfig, UserHandle.myUserId());
1329 }
1330
1331 /** @hide */
1332 public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig,
1333 int userHandle) {
1334 outConfig.fontScale = Settings.System.getFloatForUser(
1335 cr, FONT_SCALE, outConfig.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001336 if (outConfig.fontScale < 0) {
1337 outConfig.fontScale = 1;
1338 }
1339 }
1340
1341 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001342 * @hide Erase the fields in the Configuration that should be applied
1343 * by the settings.
1344 */
1345 public static void clearConfiguration(Configuration inoutConfig) {
1346 inoutConfig.fontScale = 0;
1347 }
Narayan Kamath6d632962011-08-24 11:51:37 +01001348
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001349 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001350 * Convenience function to write a batch of configuration-related
1351 * settings from a {@link Configuration} object.
1352 *
1353 * @param cr The ContentResolver to access.
1354 * @param config The settings to write.
1355 * @return true if the values were set, false on database errors
1356 */
1357 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Christopher Tate06efb532012-08-24 15:29:27 -07001358 return putConfigurationForUser(cr, config, UserHandle.myUserId());
1359 }
1360
1361 /** @hide */
1362 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
1363 int userHandle) {
1364 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001365 }
1366
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001367 /** @hide */
1368 public static boolean hasInterestingConfigurationChanges(int changes) {
1369 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1370 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001371
Christopher Tate06efb532012-08-24 15:29:27 -07001372 /** @deprecated - Do not use */
1373 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001374 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Christopher Tate06efb532012-08-24 15:29:27 -07001375 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001376 }
1377
Christopher Tate06efb532012-08-24 15:29:27 -07001378 /**
1379 * @hide
1380 * @deprecated - Do not use
1381 */
1382 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
1383 int userHandle) {
1384 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
1385 }
1386
1387 /** @deprecated - Do not use */
1388 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001389 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Christopher Tatec8c08382012-09-19 17:18:18 -07001390 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07001391 }
1392
1393 /**
1394 * @hide
1395 * @deprecated - Do not use
1396 */
1397 @Deprecated
1398 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
1399 int userHandle) {
1400 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001401 }
1402
1403 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001404 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001405 */
Christopher Tate06efb532012-08-24 15:29:27 -07001406 @Deprecated
1407 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 -08001408
1409 /**
1410 * What happens when the user presses the end call button if they're not
1411 * on a call.<br/>
1412 * <b>Values:</b><br/>
1413 * 0 - The end button does nothing.<br/>
1414 * 1 - The end button goes to the home screen.<br/>
1415 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1416 * 3 - The end button goes to the home screen. If the user is already on the
1417 * home screen, it puts the device to sleep.
1418 */
1419 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1420
1421 /**
David Brown458e8062010-03-08 21:52:11 -08001422 * END_BUTTON_BEHAVIOR value for "go home".
1423 * @hide
1424 */
1425 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1426
1427 /**
1428 * END_BUTTON_BEHAVIOR value for "go to sleep".
1429 * @hide
1430 */
1431 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
1432
1433 /**
1434 * END_BUTTON_BEHAVIOR default value.
1435 * @hide
1436 */
1437 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
1438
1439 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07001440 * Is advanced settings mode turned on. 0 == no, 1 == yes
1441 * @hide
1442 */
1443 public static final String ADVANCED_SETTINGS = "advanced_settings";
1444
1445 /**
1446 * ADVANCED_SETTINGS default value.
1447 * @hide
1448 */
1449 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
1450
1451 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001452 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001453 */
Christopher Tate06efb532012-08-24 15:29:27 -07001454 @Deprecated
1455 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001456
1457 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001458 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001459 */
Christopher Tate06efb532012-08-24 15:29:27 -07001460 @Deprecated
1461 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001462
1463 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001464 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001465 */
Christopher Tate06efb532012-08-24 15:29:27 -07001466 @Deprecated
1467 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001468
Robert Greenwalt8588e472011-11-08 10:12:25 -08001469 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001470 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08001471 * {@hide}
1472 */
Christopher Tate06efb532012-08-24 15:29:27 -07001473 @Deprecated
1474 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001475
1476 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001477 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07001478 */
Christopher Tate06efb532012-08-24 15:29:27 -07001479 @Deprecated
1480 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07001481
1482 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001483 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001484 */
Christopher Tate06efb532012-08-24 15:29:27 -07001485 @Deprecated
1486 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001487
1488 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001489 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
1490 */
1491 @Deprecated
1492 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
1493
1494 /**
1495 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001496 *
1497 * {@hide}
1498 */
Christopher Tate06efb532012-08-24 15:29:27 -07001499 @Deprecated
1500 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
1501 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001502
1503 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001504 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001505 */
Christopher Tate06efb532012-08-24 15:29:27 -07001506 @Deprecated
1507 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001508
1509 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001510 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001511 */
Christopher Tate06efb532012-08-24 15:29:27 -07001512 @Deprecated
1513 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001514
1515 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001516 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001517 */
Christopher Tate06efb532012-08-24 15:29:27 -07001518 @Deprecated
1519 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
1520 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001521
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001522 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001523 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001524 */
Christopher Tate06efb532012-08-24 15:29:27 -07001525 @Deprecated
1526 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001527
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001528 /**
1529 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
1530 */
1531 @Deprecated
1532 public static final String MODE_RINGER = Global.MODE_RINGER;
1533
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001534 /**
1535 * Whether to use static IP and other static network attributes.
1536 * <p>
1537 * Set to 1 for true and 0 for false.
Jeff Sharkey625239a2012-09-26 22:03:49 -07001538 *
1539 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001540 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001541 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001542 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
1543
1544 /**
1545 * The static IP address.
1546 * <p>
1547 * Example: "192.168.1.51"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001548 *
1549 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001550 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001551 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001552 public static final String WIFI_STATIC_IP = "wifi_static_ip";
1553
1554 /**
1555 * If using static IP, the gateway's IP address.
1556 * <p>
1557 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001558 *
1559 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001560 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001561 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001562 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
1563
1564 /**
1565 * If using static IP, the net mask.
1566 * <p>
1567 * Example: "255.255.255.0"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001568 *
1569 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001570 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001571 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001572 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
1573
1574 /**
1575 * If using static IP, the primary DNS's IP address.
1576 * <p>
1577 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001578 *
1579 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001580 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001581 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001582 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
1583
1584 /**
1585 * If using static IP, the secondary DNS's IP address.
1586 * <p>
1587 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001588 *
1589 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001590 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001591 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001592 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
1593
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001594
1595 /**
1596 * Determines whether remote devices may discover and/or connect to
1597 * this device.
1598 * <P>Type: INT</P>
1599 * 2 -- discoverable and connectable
1600 * 1 -- connectable but not discoverable
1601 * 0 -- neither connectable nor discoverable
1602 */
1603 public static final String BLUETOOTH_DISCOVERABILITY =
1604 "bluetooth_discoverability";
1605
1606 /**
1607 * Bluetooth discoverability timeout. If this value is nonzero, then
1608 * Bluetooth becomes discoverable for a certain number of seconds,
1609 * after which is becomes simply connectable. The value is in seconds.
1610 */
1611 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
1612 "bluetooth_discoverability_timeout";
1613
1614 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001615 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
1616 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001617 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001618 @Deprecated
1619 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001620
1621 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001622 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
1623 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001624 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001625 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001626 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
1627
1628 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001629 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08001630 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
1631 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001632 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001633 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001634 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
1635 "lock_pattern_tactile_feedback_enabled";
1636
1637
1638 /**
1639 * A formatted string of the next alarm that is set, or the empty string
1640 * if there is no alarm set.
1641 */
1642 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
1643
1644 /**
1645 * Scaling factor for fonts, float.
1646 */
1647 public static final String FONT_SCALE = "font_scale";
1648
1649 /**
1650 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001651 *
1652 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001653 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001654 @Deprecated
1655 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001656
1657 /**
1658 * If 1, when launching DEBUG_APP it will wait for the debugger before
1659 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001660 *
1661 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001662 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001663 @Deprecated
1664 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001665
1666 /**
1667 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07001668 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001669 */
Jeff Brown96307042012-07-27 15:51:34 -07001670 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001671 public static final String DIM_SCREEN = "dim_screen";
1672
1673 /**
1674 * The timeout before the screen turns off.
1675 */
1676 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
1677
1678 /**
1679 * The screen backlight brightness between 0 and 255.
1680 */
1681 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
1682
1683 /**
Dan Murphy951764b2009-08-27 14:59:03 -05001684 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05001685 */
1686 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
1687
1688 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08001689 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
1690 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07001691 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08001692 */
1693 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
1694
1695 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001696 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001697 */
1698 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
1699
1700 /**
Scott Main52bfc242012-02-09 10:09:14 -08001701 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001702 */
1703 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
1704
1705 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001706 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001707 *
1708 * @deprecated Use {@link Global#SHOW_PROCESSES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001709 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001710 @Deprecated
1711 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001712
1713 /**
1714 * If 1, the activity manager will aggressively finish activities and
1715 * processes as soon as they are no longer needed. If 0, the normal
1716 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001717 *
1718 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001719 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001720 @Deprecated
1721 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001722
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001723 /**
1724 * Determines which streams are affected by ringer mode changes. The
1725 * stream type's bit should be set to 1 if it should be muted when going
1726 * into an inaudible ringer mode.
1727 */
1728 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
1729
1730 /**
1731 * Determines which streams are affected by mute. The
1732 * stream type's bit should be set to 1 if it should be muted when a mute request
1733 * is received.
1734 */
1735 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
1736
1737 /**
1738 * Whether vibrate is on for different events. This is used internally,
1739 * changing this value will not change the vibrate. See AudioManager.
1740 */
1741 public static final String VIBRATE_ON = "vibrate_on";
1742
1743 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07001744 * If 1, redirects the system vibrator to all currently attached input devices
1745 * that support vibration. If there are no such input devices, then the system
1746 * vibrator is used instead.
1747 * If 0, does not register the system vibrator.
1748 *
1749 * This setting is mainly intended to provide a compatibility mechanism for
1750 * applications that only know about the system vibrator and do not use the
1751 * input device vibrator API.
1752 *
1753 * @hide
1754 */
1755 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
1756
1757 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001758 * Ringer volume. This is used internally, changing this value will not
1759 * change the volume. See AudioManager.
1760 */
1761 public static final String VOLUME_RING = "volume_ring";
1762
1763 /**
1764 * System/notifications volume. This is used internally, changing this
1765 * value will not change the volume. See AudioManager.
1766 */
1767 public static final String VOLUME_SYSTEM = "volume_system";
1768
1769 /**
1770 * Voice call volume. This is used internally, changing this value will
1771 * not change the volume. See AudioManager.
1772 */
1773 public static final String VOLUME_VOICE = "volume_voice";
1774
1775 /**
1776 * Music/media/gaming volume. This is used internally, changing this
1777 * value will not change the volume. See AudioManager.
1778 */
1779 public static final String VOLUME_MUSIC = "volume_music";
1780
1781 /**
1782 * Alarm volume. This is used internally, changing this
1783 * value will not change the volume. See AudioManager.
1784 */
1785 public static final String VOLUME_ALARM = "volume_alarm";
1786
1787 /**
1788 * Notification volume. This is used internally, changing this
1789 * value will not change the volume. See AudioManager.
1790 */
1791 public static final String VOLUME_NOTIFICATION = "volume_notification";
1792
1793 /**
Eric Laurent484d2882009-12-08 09:05:45 -08001794 * Bluetooth Headset volume. This is used internally, changing this value will
1795 * not change the volume. See AudioManager.
1796 */
1797 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
1798
1799 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04001800 * Master volume (float in the range 0.0f to 1.0f).
1801 * @hide
1802 */
1803 public static final String VOLUME_MASTER = "volume_master";
1804
1805 /**
Justin Koh57978ed2012-04-03 17:37:58 -07001806 * Master volume mute (int 1 = mute, 0 = not muted).
1807 *
1808 * @hide
1809 */
1810 public static final String VOLUME_MASTER_MUTE = "volume_master_mute";
1811
1812 /**
1813 * Whether the notifications should use the ring volume (value of 1) or
1814 * a separate notification volume (value of 0). In most cases, users
1815 * will have this enabled so the notification and ringer volumes will be
1816 * the same. However, power users can disable this and use the separate
1817 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001818 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07001819 * Note: This is a one-off setting that will be removed in the future
1820 * when there is profile support. For this reason, it is kept hidden
1821 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001822 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001823 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07001824 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001825 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07001826 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001827 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001828 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001829
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001830 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05001831 * Whether silent mode should allow vibration feedback. This is used
1832 * internally in AudioService and the Sound settings activity to
1833 * coordinate decoupling of vibrate and silent modes. This setting
1834 * will likely be removed in a future release with support for
1835 * audio/vibe feedback profiles.
1836 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07001837 * Not used anymore. On devices with vibrator, the user explicitly selects
1838 * silent or vibrate mode.
1839 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05001840 * @hide
1841 */
1842 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
1843
1844 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001845 * The mapping of stream type (integer) to its setting.
1846 */
1847 public static final String[] VOLUME_SETTINGS = {
1848 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08001849 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001850 };
1851
1852 /**
1853 * Appended to various volume related settings to record the previous
1854 * values before they the settings were affected by a silent/vibrate
1855 * ringer mode change.
1856 */
1857 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
1858
1859 /**
1860 * Persistent store for the system-wide default ringtone URI.
1861 * <p>
1862 * If you need to play the default ringtone at any given time, it is recommended
1863 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
1864 * to the set default ringtone at the time of playing.
1865 *
1866 * @see #DEFAULT_RINGTONE_URI
1867 */
1868 public static final String RINGTONE = "ringtone";
1869
1870 /**
1871 * A {@link Uri} that will point to the current default ringtone at any
1872 * given time.
1873 * <p>
1874 * If the current default ringtone is in the DRM provider and the caller
1875 * does not have permission, the exception will be a
1876 * FileNotFoundException.
1877 */
1878 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
1879
1880 /**
1881 * Persistent store for the system-wide default notification sound.
1882 *
1883 * @see #RINGTONE
1884 * @see #DEFAULT_NOTIFICATION_URI
1885 */
1886 public static final String NOTIFICATION_SOUND = "notification_sound";
1887
1888 /**
1889 * A {@link Uri} that will point to the current default notification
1890 * sound at any given time.
1891 *
1892 * @see #DEFAULT_RINGTONE_URI
1893 */
1894 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
1895
1896 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07001897 * Persistent store for the system-wide default alarm alert.
1898 *
1899 * @see #RINGTONE
1900 * @see #DEFAULT_ALARM_ALERT_URI
1901 */
1902 public static final String ALARM_ALERT = "alarm_alert";
1903
1904 /**
1905 * A {@link Uri} that will point to the current default alarm alert at
1906 * any given time.
1907 *
1908 * @see #DEFAULT_ALARM_ALERT_URI
1909 */
1910 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
1911
1912 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07001913 * Persistent store for the system default media button event receiver.
1914 *
1915 * @hide
1916 */
1917 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
1918
1919 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001920 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
1921 */
1922 public static final String TEXT_AUTO_REPLACE = "auto_replace";
1923
1924 /**
1925 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
1926 */
1927 public static final String TEXT_AUTO_CAPS = "auto_caps";
1928
1929 /**
1930 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
1931 * feature converts two spaces to a "." and space.
1932 */
1933 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001934
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001935 /**
1936 * Setting to showing password characters in text editors. 1 = On, 0 = Off
1937 */
1938 public static final String TEXT_SHOW_PASSWORD = "show_password";
1939
1940 public static final String SHOW_GTALK_SERVICE_STATUS =
1941 "SHOW_GTALK_SERVICE_STATUS";
1942
1943 /**
1944 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001945 *
1946 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001947 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001948 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001949 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
1950
1951 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001952 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
1953 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001954 */
Christopher Tate06efb532012-08-24 15:29:27 -07001955 @Deprecated
1956 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001957
1958 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001959 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
1960 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07001961 */
Christopher Tate06efb532012-08-24 15:29:27 -07001962 @Deprecated
1963 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07001964
1965 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001966 * Display times as 12 or 24 hours
1967 * 12
1968 * 24
1969 */
1970 public static final String TIME_12_24 = "time_12_24";
1971
1972 /**
1973 * Date format string
1974 * mm/dd/yyyy
1975 * dd/mm/yyyy
1976 * yyyy/mm/dd
1977 */
1978 public static final String DATE_FORMAT = "date_format";
1979
1980 /**
1981 * Whether the setup wizard has been run before (on first boot), or if
1982 * it still needs to be run.
1983 *
1984 * nonzero = it has been run in the past
1985 * 0 = it has not been run in the past
1986 */
1987 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
1988
1989 /**
1990 * Scaling factor for normal window animations. Setting to 0 will disable window
1991 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001992 *
1993 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001994 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001995 @Deprecated
1996 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001997
1998 /**
1999 * Scaling factor for activity transition animations. Setting to 0 will disable window
2000 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002001 *
2002 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002003 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002004 @Deprecated
2005 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002006
2007 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08002008 * Scaling factor for Animator-based animations. This affects both the start delay and
2009 * duration of all such animations. Setting to 0 will cause animations to end immediately.
2010 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002011 *
2012 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08002013 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002014 @Deprecated
2015 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002016
2017 /**
2018 * Control whether the accelerometer will be used to change screen
2019 * orientation. If 0, it will not be used unless explicitly requested
2020 * by the application; if 1, it will be used by default unless explicitly
2021 * disabled by the application.
2022 */
2023 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
2024
2025 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002026 * Default screen rotation when no other policy applies.
2027 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
2028 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08002029 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002030 *
2031 * @see Display#getRotation
2032 */
2033 public static final String USER_ROTATION = "user_rotation";
2034
2035 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07002036 * Control whether the rotation lock toggle in the System UI should be hidden.
2037 * Typically this is done for accessibility purposes to make it harder for
2038 * the user to accidentally toggle the rotation lock while the display rotation
2039 * has been locked for accessibility.
2040 *
2041 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
2042 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
2043 *
2044 * @hide
2045 */
2046 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
2047 "hide_rotation_lock_toggle_for_accessibility";
2048
2049 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002050 * Whether the phone vibrates when it is ringing due to an incoming call. This will
2051 * be used by Phone and Setting apps; it shouldn't affect other apps.
2052 * The value is boolean (1 or 0).
2053 *
2054 * Note: this is not same as "vibrate on ring", which had been available until ICS.
2055 * It was about AudioManager's setting and thus affected all the applications which
2056 * relied on the setting, while this is purely about the vibration setting for incoming
2057 * calls.
2058 *
2059 * @hide
2060 */
2061 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
2062
2063 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002064 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
2065 * boolean (1 or 0).
2066 */
2067 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
2068
2069 /**
David Kraused0f67152009-06-13 18:01:13 -05002070 * CDMA only settings
2071 * DTMF tone type played by the dialer when dialing.
2072 * 0 = Normal
2073 * 1 = Long
2074 * @hide
2075 */
2076 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
2077
2078 /**
David Kraused0f67152009-06-13 18:01:13 -05002079 * Whether the hearing aid is enabled. The value is
2080 * boolean (1 or 0).
2081 * @hide
2082 */
2083 public static final String HEARING_AID = "hearing_aid";
2084
2085 /**
2086 * CDMA only settings
2087 * TTY Mode
2088 * 0 = OFF
2089 * 1 = FULL
2090 * 2 = VCO
2091 * 3 = HCO
2092 * @hide
2093 */
2094 public static final String TTY_MODE = "tty_mode";
2095
2096 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002097 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
2098 * boolean (1 or 0).
2099 */
2100 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002101
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002102 /**
2103 * Whether the haptic feedback (long presses, ...) are enabled. The value is
2104 * boolean (1 or 0).
2105 */
2106 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07002107
Mike LeBeau48603e72009-06-05 00:27:00 +01002108 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01002109 * @deprecated Each application that shows web suggestions should have its own
2110 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01002111 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01002112 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01002113 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002114
-b master501eec92009-07-06 13:53:11 -07002115 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002116 * Whether the notification LED should repeatedly flash when a notification is
2117 * pending. The value is boolean (1 or 0).
2118 * @hide
2119 */
2120 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
2121
2122 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002123 * Show pointer location on screen?
2124 * 0 = no
2125 * 1 = yes
2126 * @hide
2127 */
2128 public static final String POINTER_LOCATION = "pointer_location";
2129
2130 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07002131 * Show touch positions on screen?
2132 * 0 = no
2133 * 1 = yes
2134 * @hide
2135 */
2136 public static final String SHOW_TOUCHES = "show_touches";
2137
2138 /**
Jeff Brown4519f072011-01-23 13:16:01 -08002139 * Log raw orientation data from {@link WindowOrientationListener} for use with the
2140 * orientationplot.py tool.
2141 * 0 = no
2142 * 1 = yes
2143 * @hide
2144 */
2145 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
2146 "window_orientation_listener_log";
2147
2148 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002149 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
2150 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002151 * @hide
2152 */
Christopher Tate06efb532012-08-24 15:29:27 -07002153 @Deprecated
2154 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002155
2156 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002157 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
2158 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002159 * @hide
2160 */
Christopher Tate06efb532012-08-24 15:29:27 -07002161 @Deprecated
2162 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002163
2164 /**
2165 * Whether to play sounds when the keyguard is shown and dismissed.
2166 * @hide
2167 */
2168 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
2169
2170 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04002171 * Whether the lockscreen should be completely disabled.
2172 * @hide
2173 */
2174 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
2175
2176 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002177 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
2178 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002179 * @hide
2180 */
Christopher Tate06efb532012-08-24 15:29:27 -07002181 @Deprecated
2182 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002183
2184 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002185 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
2186 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002187 * @hide
2188 */
Christopher Tate06efb532012-08-24 15:29:27 -07002189 @Deprecated
2190 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002191
2192 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002193 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
2194 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002195 * @hide
2196 */
Christopher Tate06efb532012-08-24 15:29:27 -07002197 @Deprecated
2198 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002199
2200 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002201 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
2202 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002203 * @hide
2204 */
Christopher Tate06efb532012-08-24 15:29:27 -07002205 @Deprecated
2206 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002207
2208 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002209 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
2210 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002211 * @hide
2212 */
Christopher Tate06efb532012-08-24 15:29:27 -07002213 @Deprecated
2214 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002215
2216 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002217 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
2218 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002219 * @hide
2220 */
Christopher Tate06efb532012-08-24 15:29:27 -07002221 @Deprecated
2222 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002223
2224 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002225 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
2226 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002227 * @hide
2228 */
Christopher Tate06efb532012-08-24 15:29:27 -07002229 @Deprecated
2230 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002231
2232 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002233 * Receive incoming SIP calls?
2234 * 0 = no
2235 * 1 = yes
2236 * @hide
2237 */
2238 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
2239
2240 /**
2241 * Call Preference String.
2242 * "SIP_ALWAYS" : Always use SIP with network access
2243 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
2244 * "SIP_ASK_ME_EACH_TIME" : Always ask me each time
2245 * @hide
2246 */
2247 public static final String SIP_CALL_OPTIONS = "sip_call_options";
2248
2249 /**
2250 * One of the sip call options: Always use SIP with network access.
2251 * @hide
2252 */
2253 public static final String SIP_ALWAYS = "SIP_ALWAYS";
2254
2255 /**
2256 * One of the sip call options: Only if destination is a SIP address.
2257 * @hide
2258 */
2259 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
2260
2261 /**
2262 * One of the sip call options: Always ask me each time.
2263 * @hide
2264 */
2265 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
2266
2267 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07002268 * Pointer speed setting.
2269 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
2270 * -7 = slowest
2271 * 0 = default speed
2272 * +7 = fastest
2273 * @hide
2274 */
2275 public static final String POINTER_SPEED = "pointer_speed";
2276
2277 /**
-b master501eec92009-07-06 13:53:11 -07002278 * Settings to backup. This is here so that it's in the same place as the settings
2279 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07002280 *
2281 * NOTE: Settings are backed up and restored in the order they appear
2282 * in this array. If you have one setting depending on another,
2283 * make sure that they are ordered appropriately.
2284 *
-b master501eec92009-07-06 13:53:11 -07002285 * @hide
2286 */
2287 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07002288 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07002289 WIFI_USE_STATIC_IP,
2290 WIFI_STATIC_IP,
2291 WIFI_STATIC_GATEWAY,
2292 WIFI_STATIC_NETMASK,
2293 WIFI_STATIC_DNS1,
2294 WIFI_STATIC_DNS2,
2295 BLUETOOTH_DISCOVERABILITY,
2296 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
2297 DIM_SCREEN,
2298 SCREEN_OFF_TIMEOUT,
2299 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07002300 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002301 SCREEN_AUTO_BRIGHTNESS_ADJ,
Jeff Brown7f6c2312012-04-13 20:38:38 -07002302 VIBRATE_INPUT_DEVICES,
Christopher Tate66488d62012-10-02 11:58:01 -07002303 MODE_RINGER, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07002304 MODE_RINGER_STREAMS_AFFECTED,
2305 MUTE_STREAMS_AFFECTED,
2306 VOLUME_VOICE,
2307 VOLUME_SYSTEM,
2308 VOLUME_RING,
2309 VOLUME_MUSIC,
2310 VOLUME_ALARM,
2311 VOLUME_NOTIFICATION,
Eric Laurent484d2882009-12-08 09:05:45 -08002312 VOLUME_BLUETOOTH_SCO,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07002313 VOLUME_VOICE + APPEND_FOR_LAST_AUDIBLE,
2314 VOLUME_SYSTEM + APPEND_FOR_LAST_AUDIBLE,
2315 VOLUME_RING + APPEND_FOR_LAST_AUDIBLE,
2316 VOLUME_MUSIC + APPEND_FOR_LAST_AUDIBLE,
2317 VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE,
2318 VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE,
Eric Laurent484d2882009-12-08 09:05:45 -08002319 VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE,
-b master501eec92009-07-06 13:53:11 -07002320 TEXT_AUTO_REPLACE,
2321 TEXT_AUTO_CAPS,
2322 TEXT_AUTO_PUNCTUATE,
2323 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07002324 AUTO_TIME, // moved to global
2325 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07002326 TIME_12_24,
2327 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07002328 DTMF_TONE_WHEN_DIALING,
2329 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07002330 HEARING_AID,
2331 TTY_MODE,
2332 SOUND_EFFECTS_ENABLED,
2333 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07002334 POWER_SOUNDS_ENABLED, // moved to global
2335 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08002336 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002337 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04002338 NOTIFICATION_LIGHT_PULSE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002339 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07002340 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07002341 POINTER_SPEED,
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002342 VIBRATE_WHEN_RINGING
-b master501eec92009-07-06 13:53:11 -07002343 };
2344
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002345 // Settings moved to Settings.Secure
2346
2347 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002348 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002349 * instead
2350 */
2351 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002352 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002353
2354 /**
2355 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
2356 */
2357 @Deprecated
2358 public static final String ANDROID_ID = Secure.ANDROID_ID;
2359
2360 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002361 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002362 */
2363 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002364 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002365
2366 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002367 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002368 */
2369 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002370 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002371
2372 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002373 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002374 */
2375 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002376 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002377
2378 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07002379 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002380 */
2381 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07002382 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002383
2384 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002385 * @deprecated Use {@link android.provider.Settings.Global#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002386 */
2387 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002388 public static final String INSTALL_NON_MARKET_APPS = Global.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002389
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002390 /**
2391 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
2392 * instead
2393 */
2394 @Deprecated
2395 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
2396
2397 /**
2398 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
2399 */
2400 @Deprecated
2401 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002402
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002403 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002404 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002405 */
2406 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002407 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002408
2409 /**
2410 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
2411 * instead
2412 */
2413 @Deprecated
2414 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
2415
2416 /**
2417 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
2418 * instead
2419 */
2420 @Deprecated
2421 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
2422
2423 /**
2424 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
2425 * instead
2426 */
2427 @Deprecated
2428 public static final String PARENTAL_CONTROL_REDIRECT_URL =
2429 Secure.PARENTAL_CONTROL_REDIRECT_URL;
2430
2431 /**
2432 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
2433 */
2434 @Deprecated
2435 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
2436
2437 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002438 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002439 */
2440 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002441 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002442
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002443 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002444 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002445 */
2446 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002447 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002448
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002449 /**
2450 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002451 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002452 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002453 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002454 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 -08002455
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002456 /**
2457 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002458 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002459 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002460 @Deprecated
2461 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07002462 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002463
2464 /**
2465 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002466 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002467 */
2468 @Deprecated
2469 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07002470 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002471
2472 /**
2473 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002474 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002475 */
2476 @Deprecated
2477 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07002478 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002479
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002480 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002481 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002482 * instead
2483 */
2484 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002485 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 -08002486
2487 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002488 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002489 */
2490 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002491 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002492
2493 /**
2494 * @deprecated Use
2495 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
2496 * instead
2497 */
2498 @Deprecated
2499 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
2500 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
2501
2502 /**
2503 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
2504 */
2505 @Deprecated
2506 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
2507
2508 /**
2509 * @deprecated Use
2510 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
2511 */
2512 @Deprecated
2513 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
2514 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002515
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002516 /**
2517 * @deprecated Use
2518 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
2519 */
2520 @Deprecated
2521 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
2522 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
2523
2524 /**
2525 * @deprecated Use
2526 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
2527 * instead
2528 */
2529 @Deprecated
2530 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
2531 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
2532
2533 /**
2534 * @deprecated Use
2535 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
2536 */
2537 @Deprecated
2538 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
2539 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
2540
2541 /**
2542 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
2543 * instead
2544 */
2545 @Deprecated
2546 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
2547
2548 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002549 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002550 */
2551 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002552 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002553
2554 /**
2555 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
2556 */
2557 @Deprecated
2558 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
2559
2560 /**
2561 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
2562 * instead
2563 */
2564 @Deprecated
2565 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
2566
2567 /**
2568 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
2569 * instead
2570 */
2571 @Deprecated
2572 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
2573 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
2574 }
2575
2576 /**
2577 * Secure system settings, containing system preferences that applications
2578 * can read but are not allowed to write. These are for preferences that
2579 * the user must explicitly modify through the system UI or specialized
2580 * APIs for those values, not modified directly by applications.
2581 */
2582 public static final class Secure extends NameValueTable {
2583 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
2584
Dianne Hackborn139748f2012-09-24 11:36:57 -07002585 /**
2586 * The content:// style URL for this table
2587 */
2588 public static final Uri CONTENT_URI =
2589 Uri.parse("content://" + AUTHORITY + "/secure");
2590
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002591 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07002592 private static final NameValueCache sNameValueCache = new NameValueCache(
2593 SYS_PROP_SETTING_VERSION,
2594 CONTENT_URI,
2595 CALL_METHOD_GET_SECURE,
2596 CALL_METHOD_PUT_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002597
Amith Yamasani52c489c2012-03-28 11:42:42 -07002598 private static ILockSettings sLockSettings = null;
2599
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07002600 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07002601 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07002602 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07002603 static {
2604 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
2605 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
2606 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
2607 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07002608
2609 MOVED_TO_GLOBAL = new HashSet<String>();
2610 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
2611 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
2612 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
2613 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
2614 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
2615 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
2616 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
2617 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
2618 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
2619 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
2620 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
2621 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_DENSITY_FORCED);
2622 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
2623 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
2624 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
2625 MOVED_TO_GLOBAL.add(Settings.Global.INSTALL_NON_MARKET_APPS);
2626 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
2627 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
2628 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
2629 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
2630 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
2631 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
2632 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
2633 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
2634 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_REPORT_XT_OVER_DEV);
2635 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
2636 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
2637 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
2638 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
2639 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
2640 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
2641 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
2642 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
2643 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
2644 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
2645 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
2646 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
2647 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
2648 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
2649 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
2650 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
2651 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
2652 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
2653 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
2654 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
2655 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
2656 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
2657 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
2658 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
2659 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
2660 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
2661 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
2662 MOVED_TO_GLOBAL.add(Settings.Global.THROTTLE_HELP_URI);
2663 MOVED_TO_GLOBAL.add(Settings.Global.THROTTLE_MAX_NTP_CACHE_AGE_SEC);
2664 MOVED_TO_GLOBAL.add(Settings.Global.THROTTLE_NOTIFICATION_TYPE);
2665 MOVED_TO_GLOBAL.add(Settings.Global.THROTTLE_POLLING_SEC);
2666 MOVED_TO_GLOBAL.add(Settings.Global.THROTTLE_RESET_DAY);
2667 MOVED_TO_GLOBAL.add(Settings.Global.THROTTLE_THRESHOLD_BYTES);
2668 MOVED_TO_GLOBAL.add(Settings.Global.THROTTLE_VALUE_KBITSPS);
2669 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
2670 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
2671 MOVED_TO_GLOBAL.add(Settings.Global.WEB_AUTOFILL_QUERY_URL);
2672 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
2673 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
2674 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
2675 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
2676 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
2677 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
2678 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
2679 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
2680 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
2681 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
2682 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
2683 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
2684 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
2685 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07002686 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
2687 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07002688 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07002689 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
2690 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
2691 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
2692 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
2693 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
2694 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07002695 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07002696 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
2697 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
2698 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
2699 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
2700 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
2701 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
2702 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
2703 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
2704 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
2705 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
2706 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
2707 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
2708 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
2709 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
2710 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
2711 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
2712 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
2713 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
2714 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
2715 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
2716 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
2717 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
2718 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
2719 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
2720 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
2721 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
2722 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
2723 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
2724 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
2725 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
2726 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002727 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
2728 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_CDMA_SUBSCRIPTION);
Christopher Tate06efb532012-08-24 15:29:27 -07002729 }
2730
Christopher Tate66488d62012-10-02 11:58:01 -07002731 /** @hide */
2732 public static void getMovedKeys(HashSet<String> outKeySet) {
2733 outKeySet.addAll(MOVED_TO_GLOBAL);
2734 }
2735
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002736 /**
2737 * Look up a name in the database.
2738 * @param resolver to access the database with
2739 * @param name to look up in the table
2740 * @return the corresponding value, or null if not present
2741 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07002742 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07002743 return getStringForUser(resolver, name, UserHandle.myUserId());
2744 }
2745
2746 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07002747 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07002748 int userHandle) {
2749 if (MOVED_TO_GLOBAL.contains(name)) {
2750 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
2751 + " to android.provider.Settings.Global.");
2752 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002753 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07002754
Dianne Hackborn139748f2012-09-24 11:36:57 -07002755 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
2756 synchronized (Secure.class) {
2757 if (sLockSettings == null) {
2758 sLockSettings = ILockSettings.Stub.asInterface(
2759 (IBinder) ServiceManager.getService("lock_settings"));
2760 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
2761 }
2762 }
2763 if (sLockSettings != null && !sIsSystemProcess) {
2764 try {
2765 return sLockSettings.getString(name, "0", userHandle);
2766 } catch (RemoteException re) {
2767 // Fall through
2768 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07002769 }
2770 }
2771
Christopher Tate06efb532012-08-24 15:29:27 -07002772 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002773 }
2774
2775 /**
2776 * Store a name/value pair into the database.
2777 * @param resolver to access the database with
2778 * @param name to store
2779 * @param value to associate with the name
2780 * @return true if the value was set, false on database errors
2781 */
Christopher Tate06efb532012-08-24 15:29:27 -07002782 public static boolean putString(ContentResolver resolver, String name, String value) {
2783 return putStringForUser(resolver, name, value, UserHandle.myUserId());
2784 }
2785
2786 /** @hide */
2787 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
2788 int userHandle) {
2789 if (MOVED_TO_GLOBAL.contains(name)) {
2790 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2791 + " to android.provider.Settings.Global");
2792 return Global.putStringForUser(resolver, name, value, userHandle);
2793 }
Christopher Tate06efb532012-08-24 15:29:27 -07002794 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002795 }
2796
2797 /**
2798 * Construct the content URI for a particular name/value pair,
2799 * useful for monitoring changes with a ContentObserver.
2800 * @param name to look up in the table
2801 * @return the corresponding content URI, or null if not present
2802 */
2803 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07002804 if (MOVED_TO_GLOBAL.contains(name)) {
2805 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
2806 + " to android.provider.Settings.Global, returning global URI.");
2807 return Global.getUriFor(Global.CONTENT_URI, name);
2808 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002809 return getUriFor(CONTENT_URI, name);
2810 }
2811
2812 /**
2813 * Convenience function for retrieving a single secure settings value
2814 * as an integer. Note that internally setting values are always
2815 * stored as strings; this function converts the string to an integer
2816 * for you. The default value will be returned if the setting is
2817 * not defined or not an integer.
2818 *
2819 * @param cr The ContentResolver to access.
2820 * @param name The name of the setting to retrieve.
2821 * @param def Value to return if the setting is not defined.
2822 *
2823 * @return The setting's current value, or 'def' if it is not defined
2824 * or not a valid integer.
2825 */
2826 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002827 return getIntForUser(cr, name, def, UserHandle.myUserId());
2828 }
2829
2830 /** @hide */
2831 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
2832 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002833 try {
2834 return v != null ? Integer.parseInt(v) : def;
2835 } catch (NumberFormatException e) {
2836 return def;
2837 }
2838 }
2839
2840 /**
2841 * Convenience function for retrieving a single secure settings value
2842 * as an integer. Note that internally setting values are always
2843 * stored as strings; this function converts the string to an integer
2844 * for you.
2845 * <p>
2846 * This version does not take a default value. If the setting has not
2847 * been set, or the string value is not a number,
2848 * it throws {@link SettingNotFoundException}.
2849 *
2850 * @param cr The ContentResolver to access.
2851 * @param name The name of the setting to retrieve.
2852 *
2853 * @throws SettingNotFoundException Thrown if a setting by the given
2854 * name can't be found or the setting value is not an integer.
2855 *
2856 * @return The setting's current value.
2857 */
2858 public static int getInt(ContentResolver cr, String name)
2859 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07002860 return getIntForUser(cr, name, UserHandle.myUserId());
2861 }
2862
2863 /** @hide */
2864 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
2865 throws SettingNotFoundException {
2866 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002867 try {
2868 return Integer.parseInt(v);
2869 } catch (NumberFormatException e) {
2870 throw new SettingNotFoundException(name);
2871 }
2872 }
2873
2874 /**
2875 * Convenience function for updating a single settings value as an
2876 * integer. This will either create a new entry in the table if the
2877 * given name does not exist, or modify the value of the existing row
2878 * with that name. Note that internally setting values are always
2879 * stored as strings, so this function converts the given value to a
2880 * string before storing it.
2881 *
2882 * @param cr The ContentResolver to access.
2883 * @param name The name of the setting to modify.
2884 * @param value The new value for the setting.
2885 * @return true if the value was set, false on database errors
2886 */
2887 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07002888 return putIntForUser(cr, name, value, UserHandle.myUserId());
2889 }
2890
2891 /** @hide */
2892 public static boolean putIntForUser(ContentResolver cr, String name, int value,
2893 int userHandle) {
2894 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002895 }
2896
2897 /**
2898 * Convenience function for retrieving a single secure settings value
2899 * as a {@code long}. Note that internally setting values are always
2900 * stored as strings; this function converts the string to a {@code long}
2901 * for you. The default value will be returned if the setting is
2902 * not defined or not a {@code long}.
2903 *
2904 * @param cr The ContentResolver to access.
2905 * @param name The name of the setting to retrieve.
2906 * @param def Value to return if the setting is not defined.
2907 *
2908 * @return The setting's current value, or 'def' if it is not defined
2909 * or not a valid {@code long}.
2910 */
2911 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002912 return getLongForUser(cr, name, def, UserHandle.myUserId());
2913 }
2914
2915 /** @hide */
2916 public static long getLongForUser(ContentResolver cr, String name, long def,
2917 int userHandle) {
2918 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002919 long value;
2920 try {
2921 value = valString != null ? Long.parseLong(valString) : def;
2922 } catch (NumberFormatException e) {
2923 value = def;
2924 }
2925 return value;
2926 }
2927
2928 /**
2929 * Convenience function for retrieving a single secure settings value
2930 * as a {@code long}. Note that internally setting values are always
2931 * stored as strings; this function converts the string to a {@code long}
2932 * for you.
2933 * <p>
2934 * This version does not take a default value. If the setting has not
2935 * been set, or the string value is not a number,
2936 * it throws {@link SettingNotFoundException}.
2937 *
2938 * @param cr The ContentResolver to access.
2939 * @param name The name of the setting to retrieve.
2940 *
2941 * @return The setting's current value.
2942 * @throws SettingNotFoundException Thrown if a setting by the given
2943 * name can't be found or the setting value is not an integer.
2944 */
2945 public static long getLong(ContentResolver cr, String name)
2946 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07002947 return getLongForUser(cr, name, UserHandle.myUserId());
2948 }
2949
2950 /** @hide */
2951 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
2952 throws SettingNotFoundException {
2953 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002954 try {
2955 return Long.parseLong(valString);
2956 } catch (NumberFormatException e) {
2957 throw new SettingNotFoundException(name);
2958 }
2959 }
2960
2961 /**
2962 * Convenience function for updating a secure settings value as a long
2963 * integer. This will either create a new entry in the table if the
2964 * given name does not exist, or modify the value of the existing row
2965 * with that name. Note that internally setting values are always
2966 * stored as strings, so this function converts the given value to a
2967 * string before storing it.
2968 *
2969 * @param cr The ContentResolver to access.
2970 * @param name The name of the setting to modify.
2971 * @param value The new value for the setting.
2972 * @return true if the value was set, false on database errors
2973 */
2974 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07002975 return putLongForUser(cr, name, value, UserHandle.myUserId());
2976 }
2977
2978 /** @hide */
2979 public static boolean putLongForUser(ContentResolver cr, String name, long value,
2980 int userHandle) {
2981 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002982 }
2983
2984 /**
2985 * Convenience function for retrieving a single secure settings value
2986 * as a floating point number. Note that internally setting values are
2987 * always stored as strings; this function converts the string to an
2988 * float for you. The default value will be returned if the setting
2989 * is not defined or not a valid float.
2990 *
2991 * @param cr The ContentResolver to access.
2992 * @param name The name of the setting to retrieve.
2993 * @param def Value to return if the setting is not defined.
2994 *
2995 * @return The setting's current value, or 'def' if it is not defined
2996 * or not a valid float.
2997 */
2998 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002999 return getFloatForUser(cr, name, def, UserHandle.myUserId());
3000 }
3001
3002 /** @hide */
3003 public static float getFloatForUser(ContentResolver cr, String name, float def,
3004 int userHandle) {
3005 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003006 try {
3007 return v != null ? Float.parseFloat(v) : def;
3008 } catch (NumberFormatException e) {
3009 return def;
3010 }
3011 }
3012
3013 /**
3014 * Convenience function for retrieving a single secure settings value
3015 * as a float. Note that internally setting values are always
3016 * stored as strings; this function converts the string to a float
3017 * for you.
3018 * <p>
3019 * This version does not take a default value. If the setting has not
3020 * been set, or the string value is not a number,
3021 * it throws {@link SettingNotFoundException}.
3022 *
3023 * @param cr The ContentResolver to access.
3024 * @param name The name of the setting to retrieve.
3025 *
3026 * @throws SettingNotFoundException Thrown if a setting by the given
3027 * name can't be found or the setting value is not a float.
3028 *
3029 * @return The setting's current value.
3030 */
3031 public static float getFloat(ContentResolver cr, String name)
3032 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003033 return getFloatForUser(cr, name, UserHandle.myUserId());
3034 }
3035
3036 /** @hide */
3037 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
3038 throws SettingNotFoundException {
3039 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08003040 if (v == null) {
3041 throw new SettingNotFoundException(name);
3042 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003043 try {
3044 return Float.parseFloat(v);
3045 } catch (NumberFormatException e) {
3046 throw new SettingNotFoundException(name);
3047 }
3048 }
3049
3050 /**
3051 * Convenience function for updating a single settings value as a
3052 * floating point number. This will either create a new entry in the
3053 * table if the given name does not exist, or modify the value of the
3054 * existing row with that name. Note that internally setting values
3055 * are always stored as strings, so this function converts the given
3056 * value to a string before storing it.
3057 *
3058 * @param cr The ContentResolver to access.
3059 * @param name The name of the setting to modify.
3060 * @param value The new value for the setting.
3061 * @return true if the value was set, false on database errors
3062 */
3063 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003064 return putFloatForUser(cr, name, value, UserHandle.myUserId());
3065 }
3066
3067 /** @hide */
3068 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
3069 int userHandle) {
3070 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003071 }
3072
3073 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003074 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
3075 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08003076 */
Christopher Tate06efb532012-08-24 15:29:27 -07003077 @Deprecated
3078 public static final String DEVELOPMENT_SETTINGS_ENABLED =
3079 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08003080
3081 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003082 * When the user has enable the option to have a "bug report" command
3083 * in the power menu.
3084 * @hide
3085 */
3086 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
3087
3088 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003089 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003090 */
Christopher Tate06efb532012-08-24 15:29:27 -07003091 @Deprecated
3092 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003093
3094 /**
3095 * Setting to allow mock locations and location provider status to be injected into the
3096 * LocationManager service for testing purposes during application development. These
3097 * locations and status values override actual location and status information generated
3098 * by network, gps, or other location providers.
3099 */
3100 public static final String ALLOW_MOCK_LOCATION = "mock_location";
3101
3102 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08003103 * A 64-bit number (as a hex string) that is randomly
3104 * generated on the device's first boot and should remain
3105 * constant for the lifetime of the device. (The value may
3106 * change if a factory reset is performed on the device.)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003107 */
3108 public static final String ANDROID_ID = "android_id";
3109
3110 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003111 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003112 */
Christopher Tate06efb532012-08-24 15:29:27 -07003113 @Deprecated
3114 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003115
3116 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003117 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003118 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07003119 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003120 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003121
3122 /**
3123 * Setting to record the input method used by default, holding the ID
3124 * of the desired method.
3125 */
3126 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
3127
3128 /**
satokab751aa2010-09-14 19:17:36 +09003129 * Setting to record the input method subtype used by default, holding the ID
3130 * of the desired method.
3131 */
3132 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
3133 "selected_input_method_subtype";
3134
3135 /**
satok723a27e2010-11-11 14:58:11 +09003136 * Setting to record the history of input method subtype, holding the pair of ID of IME
3137 * and its last used subtype.
3138 * @hide
3139 */
3140 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
3141 "input_methods_subtype_history";
3142
3143 /**
satok5c58dfc2010-12-14 21:54:47 +09003144 * Setting to record the visibility of input method selector
3145 */
3146 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
3147 "input_method_selector_visibility";
3148
3149 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003150 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003151 */
Christopher Tate06efb532012-08-24 15:29:27 -07003152 @Deprecated
3153 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003154
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003155 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07003156 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
3157 * @hide
3158 */
3159 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
3160
3161 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003162 * List of input methods that are currently enabled. This is a string
3163 * containing the IDs of all enabled input methods, each ID separated
3164 * by ':'.
3165 */
3166 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003167
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003168 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07003169 * List of system input methods that are currently disabled. This is a string
3170 * containing the IDs of all disabled input methods, each ID separated
3171 * by ':'.
3172 * @hide
3173 */
3174 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
3175
3176 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003177 * Host name and port for global http proxy. Uses ':' seperator for
3178 * between host and port.
3179 *
3180 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003181 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07003182 @Deprecated
3183 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07003184
3185 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003186 * @deprecated Use {@link android.provider.Settings.Global#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003187 */
Christopher Tate06efb532012-08-24 15:29:27 -07003188 @Deprecated
3189 public static final String INSTALL_NON_MARKET_APPS = Global.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003190
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003191 /**
3192 * Comma-separated list of location providers that activities may access.
3193 */
3194 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003195
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003196 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04003197 * A flag containing settings used for biometric weak
3198 * @hide
3199 */
3200 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
3201 "lock_biometric_weak_flags";
3202
3203 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08003204 * Whether autolock is enabled (0 = false, 1 = true)
3205 */
3206 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
3207
3208 /**
3209 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
3210 */
3211 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
3212
3213 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07003214 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
3215 * true)
3216 *
3217 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
3218 * lockscreen uses
3219 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Amith Yamasani156c4352010-03-05 17:10:03 -08003220 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07003221 @Deprecated
3222 public static final String
3223 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08003224
3225 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07003226 * This preference allows the device to be locked given time after screen goes off,
3227 * subject to current DeviceAdmin policy limits.
3228 * @hide
3229 */
3230 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
3231
3232
3233 /**
John Spurlock5f050e52012-10-27 10:44:19 -04003234 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07003235 * @hide
3236 */
3237 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
3238
3239 /**
John Spurlock5f050e52012-10-27 10:44:19 -04003240 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07003241 * @hide
3242 */
Michael Jurkaaa2859a2012-10-24 12:46:49 -07003243 public static final String LOCK_SCREEN_APPWIDGET_IDS =
3244 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07003245
3246 /**
Jim Miller51117262012-11-04 17:58:09 -08003247 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
3248 * @hide
3249 */
3250 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
3251 "lock_screen_fallback_appwidget_id";
3252
3253 /**
John Spurlock5f050e52012-10-27 10:44:19 -04003254 * Index of the lockscreen appwidget to restore, -1 if none.
3255 * @hide
3256 */
3257 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
3258 "lock_screen_sticky_appwidget";
3259
3260 /**
3261 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07003262 * @hide
3263 */
3264 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
3265 "lock_screen_owner_info_enabled";
3266
3267 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003268 * The Logging ID (a unique 64-bit value) as a hex string.
3269 * Used as a pseudonymous identifier for logging.
3270 * @deprecated This identifier is poorly initialized and has
3271 * many collisions. It should not be used.
3272 */
3273 @Deprecated
3274 public static final String LOGGING_ID = "logging_id";
3275
3276 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003277 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003278 */
Christopher Tate06efb532012-08-24 15:29:27 -07003279 @Deprecated
3280 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003281
3282 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08003283 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003284 */
3285 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003286
3287 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08003288 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003289 */
3290 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003291
3292 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08003293 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003294 */
3295 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003296
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003297 /**
3298 * Settings classname to launch when Settings is clicked from All
3299 * Applications. Needed because of user testing between the old
3300 * and new Settings apps.
3301 */
3302 // TODO: 881807
3303 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003304
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003305 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003306 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003307 */
Christopher Tate06efb532012-08-24 15:29:27 -07003308 @Deprecated
3309 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003310
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003311 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003312 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003313 */
Christopher Tate06efb532012-08-24 15:29:27 -07003314 @Deprecated
3315 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003316
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003317 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07003318 * If accessibility is enabled.
3319 */
3320 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
3321
3322 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07003323 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07003324 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07003325 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07003326
3327 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07003328 * List of the enabled accessibility providers.
3329 */
3330 public static final String ENABLED_ACCESSIBILITY_SERVICES =
3331 "enabled_accessibility_services";
3332
3333 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07003334 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07003335 * permission to put the device into touch exploration mode.
3336 *
3337 * @hide
3338 */
3339 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
3340 "touch_exploration_granted_accessibility_services";
3341
3342 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08003343 * Whether to speak passwords while in accessibility mode.
3344 */
3345 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
3346
3347 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003348 * If injection of accessibility enhancing JavaScript screen-reader
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003349 * is enabled.
3350 * <p>
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003351 * Note: The JavaScript based screen-reader is served by the
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003352 * Google infrastructure and enable users with disabilities to
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07003353 * efficiently navigate in and explore web content.
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003354 * </p>
3355 * <p>
3356 * This property represents a boolean value.
3357 * </p>
3358 * @hide
3359 */
3360 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
3361 "accessibility_script_injection";
3362
3363 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003364 * The URL for the injected JavaScript based screen-reader used
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07003365 * for providing accessibility of content in WebView.
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003366 * <p>
3367 * Note: The JavaScript based screen-reader is served by the
3368 * Google infrastructure and enable users with disabilities to
3369 * efficiently navigate in and explore web content.
3370 * </p>
3371 * <p>
3372 * This property represents a string value.
3373 * </p>
3374 * @hide
3375 */
3376 public static final String ACCESSIBILITY_SCREEN_READER_URL =
3377 "accessibility_script_injection_url";
3378
3379 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003380 * Key bindings for navigation in built-in accessibility support for web content.
3381 * <p>
3382 * Note: These key bindings are for the built-in accessibility navigation for
3383 * web content which is used as a fall back solution if JavaScript in a WebView
3384 * is not enabled or the user has not opted-in script injection from Google.
3385 * </p>
3386 * <p>
3387 * The bindings are separated by semi-colon. A binding is a mapping from
3388 * a key to a sequence of actions (for more details look at
3389 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
3390 * string representation of an integer obtained from a meta state (optional) shifted
3391 * sixteen times left and bitwise ored with a key code. An action is represented
3392 * as a hexademical string representation of an integer where the first two digits
3393 * are navigation action index, the second, the third, and the fourth digit pairs
3394 * represent the action arguments. The separate actions in a binding are colon
3395 * separated. The key and the action sequence it maps to are separated by equals.
3396 * </p>
3397 * <p>
3398 * For example, the binding below maps the DPAD right button to traverse the
3399 * current navigation axis once without firing an accessibility event and to
3400 * perform the same traversal again but to fire an event:
3401 * <code>
3402 * 0x16=0x01000100:0x01000101;
3403 * </code>
3404 * </p>
3405 * <p>
3406 * The goal of this binding is to enable dynamic rebinding of keys to
3407 * navigation actions for web content without requiring a framework change.
3408 * </p>
3409 * <p>
3410 * This property represents a string value.
3411 * </p>
3412 * @hide
3413 */
3414 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
3415 "accessibility_web_content_key_bindings";
3416
3417 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07003418 * Setting that specifies whether the display magnification is enabled.
3419 * Display magnifications allows the user to zoom in the display content
3420 * and is targeted to low vision users. The current magnification scale
3421 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
3422 *
3423 * @hide
3424 */
3425 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
3426 "accessibility_display_magnification_enabled";
3427
3428 /**
3429 * Setting that specifies what the display magnification scale is.
3430 * Display magnifications allows the user to zoom in the display
3431 * content and is targeted to low vision users. Whether a display
3432 * magnification is performed is controlled by
3433 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
3434 *
3435 * @hide
3436 */
3437 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
3438 "accessibility_display_magnification_scale";
3439
3440 /**
3441 * Setting that specifies whether the display magnification should be
3442 * automatically updated. If this fearture is enabled the system will
3443 * exit magnification mode or pan the viewport when a context change
3444 * occurs. For example, on staring a new activity or rotating the screen,
3445 * the system may zoom out so the user can see the new context he is in.
3446 * Another example is on showing a window that is not visible in the
3447 * magnified viewport the system may pan the viewport to make the window
3448 * the has popped up so the user knows that the context has changed.
3449 * Whether a screen magnification is performed is controlled by
3450 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
3451 *
3452 * @hide
3453 */
3454 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
3455 "accessibility_display_magnification_auto_update";
3456
3457 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08003458 * The timout for considering a press to be a long press in milliseconds.
3459 * @hide
3460 */
3461 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
3462
3463 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07003464 * Setting to always use the default text-to-speech settings regardless
3465 * of the application settings.
3466 * 1 = override application settings,
3467 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01003468 *
3469 * @deprecated The value of this setting is no longer respected by
3470 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07003471 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003472 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07003473 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
3474
3475 /**
3476 * Default text-to-speech engine speech rate. 100 = 1x
3477 */
3478 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
3479
3480 /**
3481 * Default text-to-speech engine pitch. 100 = 1x
3482 */
3483 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
3484
3485 /**
3486 * Default text-to-speech engine.
3487 */
3488 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
3489
3490 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07003491 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01003492 *
3493 * @deprecated this setting is no longer in use, as of the Ice Cream
3494 * Sandwich release. Apps should never need to read this setting directly,
3495 * instead can query the TextToSpeech framework classes for the default
3496 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07003497 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003498 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07003499 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
3500
3501 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003502 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01003503 *
3504 * @deprecated this setting is no longer in use, as of the Ice Cream
3505 * Sandwich release. Apps should never need to read this setting directly,
3506 * instead can query the TextToSpeech framework classes for the default
3507 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003508 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003509 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003510 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
3511
3512 /**
3513 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01003514 *
3515 * @deprecated this setting is no longer in use, as of the Ice Cream
3516 * Sandwich release. Apps should never need to read this setting directly,
3517 * instead can query the TextToSpeech framework classes for the
3518 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003519 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003520 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003521 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
3522
3523 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01003524 * Stores the default tts locales on a per engine basis. Stored as
3525 * a comma seperated list of values, each value being of the form
3526 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01003527 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
3528 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
3529 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
3530 * setting directly, and can query the TextToSpeech framework classes
3531 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01003532 *
3533 * @hide
3534 */
3535 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
3536
3537 /**
Charles Chenceffa152010-03-16 21:18:10 -07003538 * Space delimited list of plugin packages that are enabled.
3539 */
3540 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
3541
3542 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003543 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
3544 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003545 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003546 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003547 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003548 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003549
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003550 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003551 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
3552 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003553 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003554 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003555 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003556 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003557
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003558 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003559 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
3560 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003561 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003562 @Deprecated
3563 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
3564 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003565
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003566 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003567 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
3568 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003569 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003570 @Deprecated
3571 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003572
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003573 /**
3574 * The acceptable packet loss percentage (range 0 - 100) before trying
3575 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003576 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003577 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003578 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003579 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
3580 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003581
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003582 /**
3583 * The number of access points required for a network in order for the
3584 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003585 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003586 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003587 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003588 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003589
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003590 /**
3591 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003592 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003593 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003594 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003595 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
3596 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003597
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003598 /**
3599 * Whether the Wi-Fi watchdog is enabled for background checking even
3600 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003601 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003602 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003603 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003604 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
3605 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003606
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003607 /**
3608 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003609 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003610 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003611 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003612 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
3613 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003614
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003615 /**
3616 * The number of initial pings to perform that *may* be ignored if they
3617 * fail. Again, if these fail, they will *not* be used in packet loss
3618 * calculation. For example, one network always seemed to time out for
3619 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003620 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003621 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003622 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003623 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
3624 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003625
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003626 /**
3627 * The maximum number of access points (per network) to attempt to test.
3628 * If this number is reached, the watchdog will no longer monitor the
3629 * initial connection state for the network. This is a safeguard for
3630 * networks containing multiple APs whose DNS does not respond to pings.
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_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003635
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003636 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07003637 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003638 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07003639 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003640 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
3641
3642 /**
3643 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003644 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003645 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003646 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003647 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
3648
3649 /**
3650 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003651 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003652 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003653 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003654 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003655
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003656 /**
3657 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003658 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003659 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003660 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003661 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003662
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003663 /**
3664 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003665 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003666 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003667 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003668 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003669
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003670 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003671 * @deprecated Use
3672 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003673 */
Christopher Tate06efb532012-08-24 15:29:27 -07003674 @Deprecated
3675 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003676
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003677 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003678 * @deprecated Use
3679 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003680 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07003681 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003682 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003683 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003684
3685 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003686 * Whether background data usage is allowed.
3687 *
3688 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
3689 * availability of background data depends on several
3690 * combined factors. When background data is unavailable,
3691 * {@link ConnectivityManager#getActiveNetworkInfo()} will
3692 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003693 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07003694 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003695 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07003696
3697 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00003698 * Origins for which browsers should allow geolocation by default.
3699 * The value is a space-separated list of origins.
3700 */
3701 public static final String ALLOWED_GEOLOCATION_ORIGINS
3702 = "allowed_geolocation_origins";
3703
3704 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07003705 * The preferred TTY mode 0 = TTy Off, CDMA default
3706 * 1 = TTY Full
3707 * 2 = TTY HCO
3708 * 3 = TTY VCO
3709 * @hide
3710 */
3711 public static final String PREFERRED_TTY_MODE =
3712 "preferred_tty_mode";
3713
Wink Saville04e71b32009-04-02 11:00:54 -07003714 /**
Wink Saville04e71b32009-04-02 11:00:54 -07003715 * Whether the enhanced voice privacy mode is enabled.
3716 * 0 = normal voice privacy
3717 * 1 = enhanced voice privacy
3718 * @hide
3719 */
3720 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
3721
3722 /**
3723 * Whether the TTY mode mode is enabled.
3724 * 0 = disabled
3725 * 1 = enabled
3726 * @hide
3727 */
3728 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003729
3730 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07003731 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07003732 * Type: int ( 0 = disabled, 1 = enabled )
3733 * @hide
3734 */
3735 public static final String BACKUP_ENABLED = "backup_enabled";
3736
3737 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08003738 * Controls whether application data is automatically restored from backup
3739 * at install time.
3740 * Type: int ( 0 = disabled, 1 = enabled )
3741 * @hide
3742 */
3743 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
3744
3745 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07003746 * Indicates whether settings backup has been fully provisioned.
3747 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
3748 * @hide
3749 */
3750 public static final String BACKUP_PROVISIONED = "backup_provisioned";
3751
3752 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07003753 * Component of the transport to use for backup/restore.
3754 * @hide
3755 */
3756 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07003757
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07003758 /**
3759 * Version for which the setup wizard was last shown. Bumped for
3760 * each release when there is new setup information to show.
3761 * @hide
3762 */
3763 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07003764
3765 /**
Doug Zongker43866e02010-01-07 12:09:54 -08003766 * The interval in milliseconds after which Wi-Fi is considered idle.
3767 * When idle, it is possible for the device to be switched from Wi-Fi to
3768 * the mobile data network.
3769 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003770 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
3771 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08003772 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003773 @Deprecated
3774 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08003775
3776 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01003777 * The global search provider chosen by the user (if multiple global
3778 * search providers are installed). This will be the provider returned
3779 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
3780 * installed. This setting is stored as a flattened component name as
3781 * per {@link ComponentName#flattenToString()}.
3782 *
3783 * @hide
3784 */
3785 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
3786 "search_global_search_activity";
3787
3788 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003789 * The number of promoted sources in GlobalSearch.
3790 * @hide
3791 */
3792 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
3793 /**
3794 * The maximum number of suggestions returned by GlobalSearch.
3795 * @hide
3796 */
3797 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
3798 /**
3799 * The number of suggestions GlobalSearch will ask each non-web search source for.
3800 * @hide
3801 */
3802 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
3803 /**
3804 * The number of suggestions the GlobalSearch will ask the web search source for.
3805 * @hide
3806 */
3807 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
3808 "search_web_results_override_limit";
3809 /**
3810 * The number of milliseconds that GlobalSearch will wait for suggestions from
3811 * promoted sources before continuing with all other sources.
3812 * @hide
3813 */
3814 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
3815 "search_promoted_source_deadline_millis";
3816 /**
3817 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
3818 * @hide
3819 */
3820 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
3821 /**
3822 * The maximum number of milliseconds that GlobalSearch shows the previous results
3823 * after receiving a new query.
3824 * @hide
3825 */
3826 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
3827 /**
3828 * The maximum age of log data used for shortcuts in GlobalSearch.
3829 * @hide
3830 */
3831 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
3832 /**
3833 * The maximum age of log data used for source ranking in GlobalSearch.
3834 * @hide
3835 */
3836 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
3837 "search_max_source_event_age_millis";
3838 /**
3839 * The minimum number of impressions needed to rank a source in GlobalSearch.
3840 * @hide
3841 */
3842 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
3843 "search_min_impressions_for_source_ranking";
3844 /**
3845 * The minimum number of clicks needed to rank a source in GlobalSearch.
3846 * @hide
3847 */
3848 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
3849 "search_min_clicks_for_source_ranking";
3850 /**
3851 * The maximum number of shortcuts shown by GlobalSearch.
3852 * @hide
3853 */
3854 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
3855 /**
3856 * The size of the core thread pool for suggestion queries in GlobalSearch.
3857 * @hide
3858 */
3859 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
3860 "search_query_thread_core_pool_size";
3861 /**
3862 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
3863 * @hide
3864 */
3865 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
3866 "search_query_thread_max_pool_size";
3867 /**
3868 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
3869 * @hide
3870 */
3871 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
3872 "search_shortcut_refresh_core_pool_size";
3873 /**
3874 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
3875 * @hide
3876 */
3877 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
3878 "search_shortcut_refresh_max_pool_size";
3879 /**
3880 * The maximun time that excess threads in the GlobalSeach thread pools will
3881 * wait before terminating.
3882 * @hide
3883 */
3884 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
3885 "search_thread_keepalive_seconds";
3886 /**
3887 * The maximum number of concurrent suggestion queries to each source.
3888 * @hide
3889 */
3890 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
3891 "search_per_source_concurrent_query_limit";
3892
San Mehat87734d32010-01-08 12:53:06 -08003893 /**
3894 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
3895 * @hide
3896 */
3897 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
3898
3899 /**
3900 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
3901 * @hide
3902 */
3903 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
3904
3905 /**
3906 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
3907 * @hide
3908 */
3909 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
3910
3911 /**
3912 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
3913 * @hide
3914 */
3915 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003916
Dan Egnor42471dd2010-01-07 17:25:22 -08003917 /**
3918 * If nonzero, ANRs in invisible background processes bring up a dialog.
3919 * Otherwise, the process will be silently killed.
3920 * @hide
3921 */
3922 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08003923
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08003924 /**
3925 * The {@link ComponentName} string of the service to be used as the voice recognition
3926 * service.
Erikeebc8e22010-02-18 13:27:19 -08003927 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08003928 * @hide
3929 */
3930 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08003931
satok988323c2011-06-22 16:38:13 +09003932
3933 /**
satokada8c4e2011-08-23 14:56:56 +09003934 * The {@link ComponentName} string of the selected spell checker service which is
3935 * one of the services managed by the text service manager.
3936 *
3937 * @hide
3938 */
3939 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
3940
3941 /**
3942 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09003943 * service which is one of the services managed by the text service manager.
3944 *
3945 * @hide
3946 */
satokada8c4e2011-08-23 14:56:56 +09003947 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
3948 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09003949
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003950 /**
satoka33c4fc2011-08-25 16:50:11 +09003951 * The {@link ComponentName} string whether spell checker is enabled or not.
3952 *
3953 * @hide
3954 */
3955 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
3956
3957 /**
David Brown458e8062010-03-08 21:52:11 -08003958 * What happens when the user presses the Power button while in-call
3959 * and the screen is on.<br/>
3960 * <b>Values:</b><br/>
3961 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
3962 * 2 - The Power button hangs up the current call.<br/>
3963 *
3964 * @hide
3965 */
3966 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
3967
3968 /**
3969 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
3970 * @hide
3971 */
3972 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
3973
3974 /**
3975 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
3976 * @hide
3977 */
3978 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
3979
3980 /**
3981 * INCALL_POWER_BUTTON_BEHAVIOR default value.
3982 * @hide
3983 */
3984 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
3985 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
3986
3987 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07003988 * The current night mode that has been selected by the user. Owned
3989 * and controlled by UiModeManagerService. Constants are as per
3990 * UiModeManager.
3991 * @hide
3992 */
3993 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07003994
3995 /**
John Spurlock1a868b72012-08-22 09:56:51 -04003996 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04003997 * @hide
3998 */
Daniel Sandler2d545362011-11-17 10:38:37 -08003999 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04004000
4001 /**
John Spurlock1a868b72012-08-22 09:56:51 -04004002 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08004003 *
John Spurlock1a868b72012-08-22 09:56:51 -04004004 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08004005 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04004006 * @hide
4007 */
John Spurlock1a868b72012-08-22 09:56:51 -04004008 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08004009
4010 /**
John Spurlock1a868b72012-08-22 09:56:51 -04004011 * If screensavers are enabled, whether the screensaver should be automatically launched
4012 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08004013 * @hide
4014 */
4015 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04004016
John Spurlock1a868b72012-08-22 09:56:51 -04004017 /**
4018 * If screensavers are enabled, whether the screensaver should be automatically launched
4019 * when the screen times out when not on battery.
4020 * @hide
4021 */
4022 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
4023
4024 /**
4025 * If screensavers are enabled, the default screensaver component.
4026 * @hide
4027 */
4028 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
4029
Daniel Sandler0601eb72011-04-13 01:01:32 -04004030 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07004031 * This are the settings to be backed up.
4032 *
4033 * NOTE: Settings are backed up and restored in the order they appear
4034 * in this array. If you have one setting depending on another,
4035 * make sure that they are ordered appropriately.
4036 *
-b master501eec92009-07-06 13:53:11 -07004037 * @hide
4038 */
4039 public static final String[] SETTINGS_TO_BACKUP = {
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004040 BUGREPORT_IN_POWER_MENU,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07004041 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07004042 PARENTAL_CONTROL_ENABLED,
4043 PARENTAL_CONTROL_REDIRECT_URL,
Christopher Tate66488d62012-10-02 11:58:01 -07004044 USB_MASS_STORAGE_ENABLED, // moved to global
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07004045 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
4046 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
4047 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004048 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08004049 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07004050 ENABLED_ACCESSIBILITY_SERVICES,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07004051 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07004052 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07004053 ACCESSIBILITY_ENABLED,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08004054 ACCESSIBILITY_SPEAK_PASSWORD,
-b master501eec92009-07-06 13:53:11 -07004055 TTS_USE_DEFAULTS,
4056 TTS_DEFAULT_RATE,
4057 TTS_DEFAULT_PITCH,
4058 TTS_DEFAULT_SYNTH,
4059 TTS_DEFAULT_LANG,
4060 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07004061 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01004062 TTS_DEFAULT_LOCALE,
Christopher Tate66488d62012-10-02 11:58:01 -07004063 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
4064 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
4065 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
San Mehat87734d32010-01-08 12:53:06 -08004066 MOUNT_PLAY_NOTIFICATION_SND,
4067 MOUNT_UMS_AUTOSTART,
4068 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07004069 MOUNT_UMS_NOTIFY_ENABLED,
Amith Yamasaniaee26872011-10-11 13:53:30 -07004070 UI_NIGHT_MODE,
4071 LOCK_SCREEN_OWNER_INFO,
Tom Taylor994da2a2011-11-10 11:17:38 -08004072 LOCK_SCREEN_OWNER_INFO_ENABLED
-b master501eec92009-07-06 13:53:11 -07004073 };
4074
4075 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004076 * Helper method for determining if a location provider is enabled.
4077 * @param cr the content resolver to use
4078 * @param provider the location provider to query
4079 * @return true if the provider is enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004080 */
4081 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Victoria Leaseb711d572012-10-02 13:14:11 -07004082 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
4083 }
4084
4085 /**
4086 * Helper method for determining if a location provider is enabled.
4087 * @param cr the content resolver to use
4088 * @param provider the location provider to query
4089 * @param userId the userId to query
4090 * @return true if the provider is enabled
4091 * @hide
4092 */
4093 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
4094 String allowedProviders = Settings.Secure.getStringForUser(cr,
4095 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07004096 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004097 }
4098
4099 /**
4100 * Thread-safe method for enabling or disabling a single location provider.
4101 * @param cr the content resolver to use
4102 * @param provider the location provider to enable or disable
4103 * @param enabled true if the provider should be enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004104 */
4105 public static final void setLocationProviderEnabled(ContentResolver cr,
4106 String provider, boolean enabled) {
Victoria Leaseb711d572012-10-02 13:14:11 -07004107 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
4108 }
4109
4110 /**
4111 * Thread-safe method for enabling or disabling a single location provider.
4112 * @param cr the content resolver to use
4113 * @param provider the location provider to enable or disable
4114 * @param enabled true if the provider should be enabled
4115 * @param userId the userId for which to enable/disable providers
4116 * @hide
4117 */
4118 public static final void setLocationProviderEnabledForUser(ContentResolver cr,
4119 String provider, boolean enabled, int userId) {
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004120 // to ensure thread safety, we write the provider name with a '+' or '-'
4121 // and let the SettingsProvider handle it rather than reading and modifying
4122 // the list of enabled providers.
4123 if (enabled) {
4124 provider = "+" + provider;
4125 } else {
4126 provider = "-" + provider;
4127 }
Victoria Leaseb711d572012-10-02 13:14:11 -07004128 putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
4129 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004130 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004131 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004132
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004133 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004134 * Global system settings, containing preferences that always apply identically
4135 * to all defined users. Applications can read these but are not allowed to write;
4136 * like the "Secure" settings, these are for preferences that the user must
4137 * explicitly modify through the system UI or specialized APIs for those values.
4138 */
4139 public static final class Global extends NameValueTable {
4140 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_global_version";
4141
4142 /**
4143 * The content:// style URL for global secure settings items. Not public.
4144 */
4145 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
4146
4147 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004148 * Setting whether the global gesture for enabling accessibility is enabled.
4149 * If this gesture is enabled the user will be able to perfrom it to enable
4150 * the accessibility state without visiting the settings app.
4151 * @hide
4152 */
4153 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
4154 "enable_accessibility_global_gesture_enabled";
4155
4156 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004157 * Whether Airplane Mode is on.
4158 */
4159 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
4160
4161 /**
4162 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
4163 */
4164 public static final String RADIO_BLUETOOTH = "bluetooth";
4165
4166 /**
4167 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
4168 */
4169 public static final String RADIO_WIFI = "wifi";
4170
4171 /**
4172 * {@hide}
4173 */
4174 public static final String RADIO_WIMAX = "wimax";
4175 /**
4176 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
4177 */
4178 public static final String RADIO_CELL = "cell";
4179
4180 /**
4181 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
4182 */
4183 public static final String RADIO_NFC = "nfc";
4184
4185 /**
4186 * A comma separated list of radios that need to be disabled when airplane mode
4187 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
4188 * included in the comma separated list.
4189 */
4190 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
4191
4192 /**
4193 * A comma separated list of radios that should to be disabled when airplane mode
4194 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
4195 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
4196 * will be turned off when entering airplane mode, but the user will be able to reenable
4197 * Wifi in the Settings app.
4198 *
4199 * {@hide}
4200 */
4201 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
4202
4203 /**
4204 * The policy for deciding when Wi-Fi should go to sleep (which will in
4205 * turn switch to using the mobile data as an Internet connection).
4206 * <p>
4207 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
4208 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
4209 * {@link #WIFI_SLEEP_POLICY_NEVER}.
4210 */
4211 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
4212
4213 /**
4214 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
4215 * policy, which is to sleep shortly after the turning off
4216 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
4217 */
4218 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
4219
4220 /**
4221 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
4222 * the device is on battery, and never go to sleep when the device is
4223 * plugged in.
4224 */
4225 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
4226
4227 /**
4228 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
4229 */
4230 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
4231
4232 /**
4233 * Value to specify if the user prefers the date, time and time zone
4234 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
4235 */
4236 public static final String AUTO_TIME = "auto_time";
4237
4238 /**
4239 * Value to specify if the user prefers the time zone
4240 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
4241 */
4242 public static final String AUTO_TIME_ZONE = "auto_time_zone";
4243
4244 /**
4245 * URI for the car dock "in" event sound.
4246 * @hide
4247 */
4248 public static final String CAR_DOCK_SOUND = "car_dock_sound";
4249
4250 /**
4251 * URI for the car dock "out" event sound.
4252 * @hide
4253 */
4254 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
4255
4256 /**
4257 * URI for the desk dock "in" event sound.
4258 * @hide
4259 */
4260 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
4261
4262 /**
4263 * URI for the desk dock "out" event sound.
4264 * @hide
4265 */
4266 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
4267
4268 /**
4269 * Whether to play a sound for dock events.
4270 * @hide
4271 */
4272 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
4273
4274 /**
4275 * URI for the "device locked" (keyguard shown) sound.
4276 * @hide
4277 */
4278 public static final String LOCK_SOUND = "lock_sound";
4279
4280 /**
4281 * URI for the "device unlocked" sound.
4282 * @hide
4283 */
4284 public static final String UNLOCK_SOUND = "unlock_sound";
4285
4286 /**
4287 * URI for the low battery sound file.
4288 * @hide
4289 */
4290 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
4291
4292 /**
4293 * Whether to play a sound for low-battery alerts.
4294 * @hide
4295 */
4296 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
4297
4298 /**
Jeff Brown84e27562012-12-07 13:56:34 -08004299 * URI for the "wireless charging started" sound.
4300 * @hide
4301 */
4302 public static final String WIRELESS_CHARGING_STARTED_SOUND =
4303 "wireless_charging_started_sound";
4304
4305 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004306 * Whether we keep the device on while the device is plugged in.
4307 * Supported values are:
4308 * <ul>
4309 * <li>{@code 0} to never stay on while plugged in</li>
4310 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
4311 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
4312 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
4313 * </ul>
4314 * These values can be OR-ed together.
4315 */
4316 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
4317
4318 /**
4319 * Whether ADB is enabled.
4320 */
4321 public static final String ADB_ENABLED = "adb_enabled";
4322
4323 /**
4324 * Whether assisted GPS should be enabled or not.
4325 * @hide
4326 */
4327 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
4328
4329 /**
4330 * Whether bluetooth is enabled/disabled
4331 * 0=disabled. 1=enabled.
4332 */
4333 public static final String BLUETOOTH_ON = "bluetooth_on";
4334
4335 /**
4336 * CDMA Cell Broadcast SMS
4337 * 0 = CDMA Cell Broadcast SMS disabled
4338 * 1 = CDMA Cell Broadcast SMS enabled
4339 * @hide
4340 */
4341 public static final String CDMA_CELL_BROADCAST_SMS =
4342 "cdma_cell_broadcast_sms";
4343
4344 /**
4345 * The CDMA roaming mode 0 = Home Networks, CDMA default
4346 * 1 = Roaming on Affiliated networks
4347 * 2 = Roaming on any networks
4348 * @hide
4349 */
4350 public static final String CDMA_ROAMING_MODE = "roaming_settings";
4351
4352 /**
4353 * The CDMA subscription mode 0 = RUIM/SIM (default)
4354 * 1 = NV
4355 * @hide
4356 */
4357 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
4358
4359 /** Inactivity timeout to track mobile data activity.
4360 *
4361 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
4362 * infer the data activity of mobile network. After a period of no activity on mobile
4363 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
4364 * intent is fired to indicate a transition of network status from "active" to "idle". Any
4365 * subsequent activity on mobile networks triggers the firing of {@code
4366 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
4367 *
4368 * Network activity refers to transmitting or receiving data on the network interfaces.
4369 *
4370 * Tracking is disabled if set to zero or negative value.
4371 *
4372 * @hide
4373 */
4374 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
4375
4376 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
4377 * but for Wifi network.
4378 * @hide
4379 */
4380 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
4381
4382 /**
4383 * Whether or not data roaming is enabled. (0 = false, 1 = true)
4384 */
4385 public static final String DATA_ROAMING = "data_roaming";
4386
4387 /**
4388 * Whether user has enabled development settings.
4389 */
4390 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
4391
4392 /**
4393 * Whether the device has been provisioned (0 = false, 1 = true)
4394 */
4395 public static final String DEVICE_PROVISIONED = "device_provisioned";
4396
4397 /**
4398 * The saved value for WindowManagerService.setForcedDisplayDensity().
4399 * One integer in dpi. If unset, then use the real display density.
4400 * @hide
4401 */
4402 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
4403
4404 /**
4405 * The saved value for WindowManagerService.setForcedDisplaySize().
4406 * Two integers separated by a comma. If unset, then use the real display size.
4407 * @hide
4408 */
4409 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
4410
4411 /**
4412 * The maximum size, in bytes, of a download that the download manager will transfer over
4413 * a non-wifi connection.
4414 * @hide
4415 */
4416 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
4417 "download_manager_max_bytes_over_mobile";
4418
4419 /**
4420 * The recommended maximum size, in bytes, of a download that the download manager should
4421 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
4422 * have the option to start the download over the mobile connection anyway.
4423 * @hide
4424 */
4425 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
4426 "download_manager_recommended_max_bytes_over_mobile";
4427
4428 /**
4429 * Whether the package installer should allow installation of apps downloaded from
4430 * sources other than Google Play.
4431 *
4432 * 1 = allow installing from other sources
4433 * 0 = only allow installing from Google Play
4434 */
4435 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
4436
4437 /**
4438 * Whether mobile data connections are allowed by the user. See
4439 * ConnectivityManager for more info.
4440 * @hide
4441 */
4442 public static final String MOBILE_DATA = "mobile_data";
4443
4444 /** {@hide} */
4445 public static final String NETSTATS_ENABLED = "netstats_enabled";
4446 /** {@hide} */
4447 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
4448 /** {@hide} */
4449 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
4450 /** {@hide} */
4451 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
4452 /** {@hide} */
4453 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
4454 /** {@hide} */
4455 public static final String NETSTATS_REPORT_XT_OVER_DEV = "netstats_report_xt_over_dev";
4456
4457 /** {@hide} */
4458 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
4459 /** {@hide} */
4460 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
4461 /** {@hide} */
4462 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
4463 /** {@hide} */
4464 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
4465
4466 /** {@hide} */
4467 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
4468 /** {@hide} */
4469 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
4470 /** {@hide} */
4471 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
4472 /** {@hide} */
4473 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
4474
4475 /** {@hide} */
4476 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
4477 /** {@hide} */
4478 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
4479 /** {@hide} */
4480 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
4481 /** {@hide} */
4482 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
4483
4484 /**
4485 * User preference for which network(s) should be used. Only the
4486 * connectivity service should touch this.
4487 */
4488 public static final String NETWORK_PREFERENCE = "network_preference";
4489
4490 /**
4491 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
4492 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
4493 * exceeded.
4494 * @hide
4495 */
4496 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
4497
4498 /**
4499 * The length of time in milli-seconds that automatic small adjustments to
4500 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
4501 * @hide
4502 */
4503 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
4504
4505 /** Preferred NTP server. {@hide} */
4506 public static final String NTP_SERVER = "ntp_server";
4507 /** Timeout in milliseconds to wait for NTP server. {@hide} */
4508 public static final String NTP_TIMEOUT = "ntp_timeout";
4509
4510 /**
rich cannings4d8fc792012-09-07 14:43:43 -07004511 * Whether the package manager should send package verification broadcasts for verifiers to
4512 * review apps prior to installation.
4513 * 1 = request apps to be verified prior to installation, if a verifier exists.
4514 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07004515 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07004516 */
4517 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
4518
4519 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07004520 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07004521 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
4522
4523 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07004524 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07004525 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
4526
rich cannings4e5753f2012-09-19 16:03:56 -07004527 /**
4528 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07004529 * 1 = show (default)
4530 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07004531 * @hide
rich canningse6686b32012-09-16 14:02:20 -07004532 */
4533 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
4534
rich cannings4d8fc792012-09-07 14:43:43 -07004535 /**
rich cannings4e5753f2012-09-19 16:03:56 -07004536 * Run package verificaiton on apps installed through ADB/ADT/USB
4537 * 1 = perform package verification on ADB installs (default)
4538 * 0 = bypass package verification on ADB installs
4539 * @hide
4540 */
4541 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
4542
4543 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004544 * The interval in milliseconds at which to check packet counts on the
4545 * mobile data interface when screen is on, to detect possible data
4546 * connection problems.
4547 * @hide
4548 */
4549 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
4550 "pdp_watchdog_poll_interval_ms";
4551
4552 /**
4553 * The interval in milliseconds at which to check packet counts on the
4554 * mobile data interface when screen is off, to detect possible data
4555 * connection problems.
4556 * @hide
4557 */
4558 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
4559 "pdp_watchdog_long_poll_interval_ms";
4560
4561 /**
4562 * The interval in milliseconds at which to check packet counts on the
4563 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
4564 * outgoing packets has been reached without incoming packets.
4565 * @hide
4566 */
4567 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
4568 "pdp_watchdog_error_poll_interval_ms";
4569
4570 /**
4571 * The number of outgoing packets sent without seeing an incoming packet
4572 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
4573 * device is logged to the event log
4574 * @hide
4575 */
4576 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
4577 "pdp_watchdog_trigger_packet_count";
4578
4579 /**
4580 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
4581 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
4582 * attempting data connection recovery.
4583 * @hide
4584 */
4585 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
4586 "pdp_watchdog_error_poll_count";
4587
4588 /**
4589 * The number of failed PDP reset attempts before moving to something more
4590 * drastic: re-registering to the network.
4591 * @hide
4592 */
4593 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
4594 "pdp_watchdog_max_pdp_reset_fail_count";
4595
4596 /**
4597 * A positive value indicates how often the SamplingProfiler
4598 * should take snapshots. Zero value means SamplingProfiler
4599 * is disabled.
4600 *
4601 * @hide
4602 */
4603 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
4604
4605 /**
4606 * URL to open browser on to allow user to manage a prepay account
4607 * @hide
4608 */
4609 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
4610 "setup_prepaid_data_service_url";
4611
4612 /**
4613 * URL to attempt a GET on to see if this is a prepay device
4614 * @hide
4615 */
4616 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
4617 "setup_prepaid_detection_target_url";
4618
4619 /**
4620 * Host to check for a redirect to after an attempt to GET
4621 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
4622 * this is a prepaid device with zero balance.)
4623 * @hide
4624 */
4625 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
4626 "setup_prepaid_detection_redir_host";
4627
4628 /**
Jake Hamby76a61422012-09-06 17:40:21 -07004629 * The interval in milliseconds at which to check the number of SMS sent out without asking
4630 * for use permit, to limit the un-authorized SMS usage.
4631 *
4632 * @hide
4633 */
4634 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
4635 "sms_outgoing_check_interval_ms";
4636
4637 /**
4638 * The number of outgoing SMS sent without asking for user permit (of {@link
4639 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
4640 *
4641 * @hide
4642 */
4643 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
4644 "sms_outgoing_check_max_count";
4645
4646 /**
4647 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07004648 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07004649 * @see com.android.internal.telephony.SmsUsageMonitor
4650 * @hide
4651 */
4652 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
4653
Robert Greenwalt026efcc2012-09-24 10:03:21 -07004654 /**
4655 * Used to select which country we use to determine premium sms codes.
4656 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
4657 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
4658 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
4659 * @hide
4660 */
4661 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
4662
Jake Hamby76a61422012-09-06 17:40:21 -07004663 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004664 * Used to disable Tethering on a device - defaults to true
4665 * @hide
4666 */
4667 public static final String TETHER_SUPPORTED = "tether_supported";
4668
4669 /**
4670 * Used to require DUN APN on the device or not - defaults to a build config value
4671 * which defaults to false
4672 * @hide
4673 */
4674 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
4675
4676 /**
4677 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
4678 * corresponding build config values are set it will override the APN DB
4679 * values.
4680 * Consists of a comma seperated list of strings:
4681 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
4682 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
4683 * @hide
4684 */
4685 public static final String TETHER_DUN_APN = "tether_dun_apn";
4686
4687 /**
4688 * The bandwidth throttle polling freqency in seconds
4689 * @hide
4690 */
4691 public static final String THROTTLE_POLLING_SEC = "throttle_polling_sec";
4692
4693 /**
4694 * The bandwidth throttle threshold (long)
4695 * @hide
4696 */
4697 public static final String THROTTLE_THRESHOLD_BYTES = "throttle_threshold_bytes";
4698
4699 /**
4700 * The bandwidth throttle value (kbps)
4701 * @hide
4702 */
4703 public static final String THROTTLE_VALUE_KBITSPS = "throttle_value_kbitsps";
4704
4705 /**
4706 * The bandwidth throttle reset calendar day (1-28)
4707 * @hide
4708 */
4709 public static final String THROTTLE_RESET_DAY = "throttle_reset_day";
4710
4711 /**
4712 * The throttling notifications we should send
4713 * @hide
4714 */
4715 public static final String THROTTLE_NOTIFICATION_TYPE = "throttle_notification_type";
4716
4717 /**
4718 * Help URI for data throttling policy
4719 * @hide
4720 */
4721 public static final String THROTTLE_HELP_URI = "throttle_help_uri";
4722
4723 /**
4724 * The length of time in Sec that we allow our notion of NTP time
4725 * to be cached before we refresh it
4726 * @hide
4727 */
4728 public static final String THROTTLE_MAX_NTP_CACHE_AGE_SEC =
4729 "throttle_max_ntp_cache_age_sec";
4730
4731 /**
4732 * USB Mass Storage Enabled
4733 */
4734 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
4735
4736 /**
4737 * If this setting is set (to anything), then all references
4738 * to Gmail on the device must change to Google Mail.
4739 */
4740 public static final String USE_GOOGLE_MAIL = "use_google_mail";
4741
4742 /** Autofill server address (Used in WebView/browser).
4743 * {@hide} */
4744 public static final String WEB_AUTOFILL_QUERY_URL =
4745 "web_autofill_query_url";
4746
4747 /**
Jeff Brown89d55462012-09-19 11:33:42 -07004748 * Whether Wifi display is enabled/disabled
4749 * 0=disabled. 1=enabled.
4750 * @hide
4751 */
4752 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
4753
4754 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004755 * Whether to notify the user of open networks.
4756 * <p>
4757 * If not connected and the scan results have an open network, we will
4758 * put this notification up. If we attempt to connect to a network or
4759 * the open network(s) disappear, we remove the notification. When we
4760 * show the notification, we will not show it again for
4761 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
4762 */
4763 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
4764 "wifi_networks_available_notification_on";
4765 /**
4766 * {@hide}
4767 */
4768 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
4769 "wimax_networks_available_notification_on";
4770
4771 /**
4772 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
4773 * Connecting to a network will reset the timer.
4774 */
4775 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
4776 "wifi_networks_available_repeat_delay";
4777
4778 /**
4779 * 802.11 country code in ISO 3166 format
4780 * @hide
4781 */
4782 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
4783
4784 /**
4785 * The interval in milliseconds to issue wake up scans when wifi needs
4786 * to connect. This is necessary to connect to an access point when
4787 * device is on the move and the screen is off.
4788 * @hide
4789 */
4790 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
4791 "wifi_framework_scan_interval_ms";
4792
4793 /**
4794 * The interval in milliseconds after which Wi-Fi is considered idle.
4795 * When idle, it is possible for the device to be switched from Wi-Fi to
4796 * the mobile data network.
4797 * @hide
4798 */
4799 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
4800
4801 /**
4802 * When the number of open networks exceeds this number, the
4803 * least-recently-used excess networks will be removed.
4804 */
4805 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
4806
4807 /**
4808 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
4809 */
4810 public static final String WIFI_ON = "wifi_on";
4811
4812 /**
4813 * Used to save the Wifi_ON state prior to tethering.
4814 * This state will be checked to restore Wifi after
4815 * the user turns off tethering.
4816 *
4817 * @hide
4818 */
4819 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
4820
4821 /**
4822 * The interval in milliseconds to scan as used by the wifi supplicant
4823 * @hide
4824 */
4825 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
4826 "wifi_supplicant_scan_interval_ms";
4827
4828 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07004829 * The interval in milliseconds to scan at supplicant when p2p is connected
4830 * @hide
4831 */
4832 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
4833 "wifi_scan_interval_p2p_connected_ms";
4834
4835 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004836 * Whether the Wi-Fi watchdog is enabled.
4837 */
4838 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
4839
4840 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004841 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
4842 * the setting needs to be set to 0 to disable it.
4843 * @hide
4844 */
4845 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
4846 "wifi_watchdog_poor_network_test_enabled";
4847
4848 /**
4849 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
4850 * needs to be set to 0 to disable it.
4851 * @hide
4852 */
4853 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
4854 "wifi_suspend_optimizations_enabled";
4855
4856 /**
4857 * The maximum number of times we will retry a connection to an access
4858 * point for which we have failed in acquiring an IP address from DHCP.
4859 * A value of N means that we will make N+1 connection attempts in all.
4860 */
4861 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
4862
4863 /**
4864 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
4865 * data connectivity to be established after a disconnect from Wi-Fi.
4866 */
4867 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
4868 "wifi_mobile_data_transition_wakelock_timeout_ms";
4869
4870 /**
4871 * The operational wifi frequency band
4872 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
4873 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
4874 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
4875 *
4876 * @hide
4877 */
4878 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
4879
4880 /**
4881 * The Wi-Fi peer-to-peer device name
4882 * @hide
4883 */
4884 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
4885
4886 /**
Christopher Tatec868b642012-09-12 17:41:04 -07004887 * The number of milliseconds to delay when checking for data stalls during
4888 * non-aggressive detection. (screen is turned off.)
4889 * @hide
4890 */
4891 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
4892 "data_stall_alarm_non_aggressive_delay_in_ms";
4893
4894 /**
4895 * The number of milliseconds to delay when checking for data stalls during
4896 * aggressive detection. (screen on or suspected data stall)
4897 * @hide
4898 */
4899 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
4900 "data_stall_alarm_aggressive_delay_in_ms";
4901
4902 /**
4903 * The interval in milliseconds at which to check gprs registration
4904 * after the first registration mismatch of gprs and voice service,
4905 * to detect possible data network registration problems.
4906 *
4907 * @hide
4908 */
4909 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
4910 "gprs_register_check_period_ms";
4911
4912 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004913 * Nonzero causes Log.wtf() to crash.
4914 * @hide
4915 */
4916 public static final String WTF_IS_FATAL = "wtf_is_fatal";
4917
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07004918 /**
4919 * Ringer mode. This is used internally, changing this value will not
4920 * change the ringer mode. See AudioManager.
4921 */
4922 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07004923
Jeff Brownd4935962012-09-25 13:27:20 -07004924 /**
4925 * Overlay display devices setting.
4926 * The associated value is a specially formatted string that describes the
4927 * size and density of simulated secondary display devices.
4928 * <p>
4929 * Format: {width}x{height}/{dpi};...
4930 * </p><p>
4931 * Example:
4932 * <ul>
4933 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
4934 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
4935 * at 1080p and the second at 720p.</li>
4936 * <li>If the value is empty, then no overlay display devices are created.</li>
4937 * </ul></p>
4938 *
4939 * @hide
4940 */
4941 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07004942
Jeff Sharkey625239a2012-09-26 22:03:49 -07004943 /**
4944 * Threshold values for the duration and level of a discharge cycle,
4945 * under which we log discharge cycle info.
4946 *
4947 * @hide
4948 */
4949 public static final String
4950 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
4951
4952 /** @hide */
4953 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
4954
4955 /**
4956 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
4957 * intents on application crashes and ANRs. If this is disabled, the
4958 * crash/ANR dialog will never display the "Report" button.
4959 * <p>
4960 * Type: int (0 = disallow, 1 = allow)
4961 *
4962 * @hide
4963 */
4964 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
4965
4966 /**
4967 * Maximum age of entries kept by {@link DropBoxManager}.
4968 *
4969 * @hide
4970 */
4971 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
4972
4973 /**
4974 * Maximum number of entry files which {@link DropBoxManager} will keep
4975 * around.
4976 *
4977 * @hide
4978 */
4979 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
4980
4981 /**
4982 * Maximum amount of disk space used by {@link DropBoxManager} no matter
4983 * what.
4984 *
4985 * @hide
4986 */
4987 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
4988
4989 /**
4990 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
4991 * will use.
4992 *
4993 * @hide
4994 */
4995 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
4996
4997 /**
4998 * Percent of total disk which {@link DropBoxManager} will never dip
4999 * into.
5000 *
5001 * @hide
5002 */
5003 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
5004
5005 /**
5006 * Prefix for per-tag dropbox disable/enable settings.
5007 *
5008 * @hide
5009 */
5010 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
5011
5012 /**
5013 * Lines of logcat to include with system crash/ANR/etc. reports, as a
5014 * prefix of the dropbox tag of the report type. For example,
5015 * "logcat_for_system_server_anr" controls the lines of logcat captured
5016 * with system server ANR reports. 0 to disable.
5017 *
5018 * @hide
5019 */
5020 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
5021
5022 /**
5023 * The interval in minutes after which the amount of free storage left
5024 * on the device is logged to the event log
5025 *
5026 * @hide
5027 */
5028 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
5029
5030 /**
5031 * Threshold for the amount of change in disk free space required to
5032 * report the amount of free space. Used to prevent spamming the logs
5033 * when the disk free space isn't changing frequently.
5034 *
5035 * @hide
5036 */
5037 public static final String
5038 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
5039
5040 /**
5041 * Minimum percentage of free storage on the device that is used to
5042 * determine if the device is running low on storage. The default is 10.
5043 * <p>
5044 * Say this value is set to 10, the device is considered running low on
5045 * storage if 90% or more of the device storage is filled up.
5046 *
5047 * @hide
5048 */
5049 public static final String
5050 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
5051
5052 /**
5053 * Maximum byte size of the low storage threshold. This is to ensure
5054 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
5055 * overly large threshold for large storage devices. Currently this must
5056 * be less than 2GB. This default is 500MB.
5057 *
5058 * @hide
5059 */
5060 public static final String
5061 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
5062
5063 /**
5064 * Minimum bytes of free storage on the device before the data partition
5065 * is considered full. By default, 1 MB is reserved to avoid system-wide
5066 * SQLite disk full exceptions.
5067 *
5068 * @hide
5069 */
5070 public static final String
5071 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
5072
5073 /**
5074 * The maximum reconnect delay for short network outages or when the
5075 * network is suspended due to phone use.
5076 *
5077 * @hide
5078 */
5079 public static final String
5080 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
5081
5082 /**
5083 * The number of milliseconds to delay before sending out
5084 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts.
5085 *
5086 * @hide
5087 */
5088 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
5089
5090 /**
5091 * Setting to turn off captive portal detection. Feature is enabled by
5092 * default and the setting needs to be set to 0 to disable it.
5093 *
5094 * @hide
5095 */
5096 public static final String
5097 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
5098
5099 /**
5100 * The server used for captive portal detection upon a new conection. A
5101 * 204 response code from the server is used for validation.
5102 *
5103 * @hide
5104 */
5105 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
5106
5107 /**
5108 * Whether network service discovery is enabled.
5109 *
5110 * @hide
5111 */
5112 public static final String NSD_ON = "nsd_on";
5113
5114 /**
5115 * Let user pick default install location.
5116 *
5117 * @hide
5118 */
5119 public static final String SET_INSTALL_LOCATION = "set_install_location";
5120
5121 /**
5122 * Default install location value.
5123 * 0 = auto, let system decide
5124 * 1 = internal
5125 * 2 = sdcard
5126 * @hide
5127 */
5128 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
5129
5130 /**
5131 * ms during which to consume extra events related to Inet connection
5132 * condition after a transtion to fully-connected
5133 *
5134 * @hide
5135 */
5136 public static final String
5137 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
5138
5139 /**
5140 * ms during which to consume extra events related to Inet connection
5141 * condtion after a transtion to partly-connected
5142 *
5143 * @hide
5144 */
5145 public static final String
5146 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
5147
5148 /** {@hide} */
5149 public static final String
5150 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
5151
5152 /**
5153 * Host name and port for global http proxy. Uses ':' seperator for
5154 * between host and port.
5155 */
5156 public static final String HTTP_PROXY = "http_proxy";
5157
5158 /**
5159 * Host name for global http proxy. Set via ConnectivityManager.
5160 *
5161 * @hide
5162 */
5163 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
5164
5165 /**
5166 * Integer host port for global http proxy. Set via ConnectivityManager.
5167 *
5168 * @hide
5169 */
5170 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
5171
5172 /**
5173 * Exclusion list for global proxy. This string contains a list of
5174 * comma-separated domains where the global proxy does not apply.
5175 * Domains should be listed in a comma- separated list. Example of
5176 * acceptable formats: ".domain1.com,my.domain2.com" Use
5177 * ConnectivityManager to set/get.
5178 *
5179 * @hide
5180 */
5181 public static final String
5182 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
5183
5184 /**
5185 * Enables the UI setting to allow the user to specify the global HTTP
5186 * proxy and associated exclusion list.
5187 *
5188 * @hide
5189 */
5190 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
5191
5192 /**
5193 * Setting for default DNS in case nobody suggests one
5194 *
5195 * @hide
5196 */
5197 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
5198
Jeff Sharkey0ac10282012-10-01 12:50:22 -07005199 /** {@hide} */
5200 public static final String
5201 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
5202 /** {@hide} */
5203 public static final String
5204 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
5205 /** {@hide} */
5206 public static final String
5207 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
5208
5209 /**
5210 * Get the key that retrieves a bluetooth headset's priority.
5211 * @hide
5212 */
5213 public static final String getBluetoothHeadsetPriorityKey(String address) {
5214 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase();
5215 }
5216
5217 /**
5218 * Get the key that retrieves a bluetooth a2dp sink's priority.
5219 * @hide
5220 */
5221 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
5222 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase();
5223 }
5224
5225 /**
5226 * Get the key that retrieves a bluetooth Input Device's priority.
5227 * @hide
5228 */
5229 public static final String getBluetoothInputDevicePriorityKey(String address) {
5230 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase();
5231 }
5232
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07005233 /**
5234 * Scaling factor for normal window animations. Setting to 0 will
5235 * disable window animations.
5236 */
5237 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
5238
5239 /**
5240 * Scaling factor for activity transition animations. Setting to 0 will
5241 * disable window animations.
5242 */
5243 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
5244
5245 /**
5246 * Scaling factor for Animator-based animations. This affects both the
5247 * start delay and duration of all such animations. Setting to 0 will
5248 * cause animations to end immediately. The default value is 1.
5249 */
5250 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
5251
5252 /**
5253 * Scaling factor for normal window animations. Setting to 0 will
5254 * disable window animations.
5255 *
5256 * @hide
5257 */
5258 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
5259
5260 /**
5261 * If 0, the compatibility mode is off for all applications.
5262 * If 1, older applications run under compatibility mode.
5263 * TODO: remove this settings before code freeze (bug/1907571)
5264 * @hide
5265 */
5266 public static final String COMPATIBILITY_MODE = "compatibility_mode";
5267
5268 /**
5269 * CDMA only settings
5270 * Emergency Tone 0 = Off
5271 * 1 = Alert
5272 * 2 = Vibrate
5273 * @hide
5274 */
5275 public static final String EMERGENCY_TONE = "emergency_tone";
5276
5277 /**
5278 * CDMA only settings
5279 * Whether the auto retry is enabled. The value is
5280 * boolean (1 or 0).
5281 * @hide
5282 */
5283 public static final String CALL_AUTO_RETRY = "call_auto_retry";
5284
5285 /**
5286 * The preferred network mode 7 = Global
5287 * 6 = EvDo only
5288 * 5 = CDMA w/o EvDo
5289 * 4 = CDMA / EvDo auto
5290 * 3 = GSM / WCDMA auto
5291 * 2 = WCDMA only
5292 * 1 = GSM only
5293 * 0 = GSM / WCDMA preferred
5294 * @hide
5295 */
5296 public static final String PREFERRED_NETWORK_MODE =
5297 "preferred_network_mode";
5298
5299 /**
5300 * The cdma subscription 0 = Subscription from RUIM, when available
5301 * 1 = Subscription from NV
5302 * @hide
5303 */
5304 public static final String PREFERRED_CDMA_SUBSCRIPTION =
5305 "preferred_cdma_subscription";
5306
5307 /**
5308 * Name of an application package to be debugged.
5309 */
5310 public static final String DEBUG_APP = "debug_app";
5311
5312 /**
5313 * If 1, when launching DEBUG_APP it will wait for the debugger before
5314 * starting user code. If 0, it will run normally.
5315 */
5316 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
5317
5318 /**
5319 * Control whether the process CPU usage meter should be shown.
5320 */
5321 public static final String SHOW_PROCESSES = "show_processes";
5322
5323 /**
5324 * If 1, the activity manager will aggressively finish activities and
5325 * processes as soon as they are no longer needed. If 0, the normal
5326 * extended lifetime is used.
5327 */
5328 public static final String ALWAYS_FINISH_ACTIVITIES =
5329 "always_finish_activities";
5330
Christopher Tate66488d62012-10-02 11:58:01 -07005331 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07005332 * Use Dock audio output for media:
5333 * 0 = disabled
5334 * 1 = enabled
5335 * @hide
5336 */
5337 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
5338
5339 /**
Eric Laurent05274f32012-11-29 12:48:18 -08005340 * Persisted safe headphone volume management state by AudioService
5341 * @hide
5342 */
5343 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
5344
5345 /**
Christopher Tate66488d62012-10-02 11:58:01 -07005346 * Settings to backup. This is here so that it's in the same place as the settings
5347 * keys and easy to update.
5348 *
5349 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
5350 * and Secure as well. This is because those tables drive both backup and
5351 * restore, and restore needs to properly whitelist keys that used to live
5352 * in those namespaces. The keys will only actually be backed up / restored
5353 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
5354 *
5355 * NOTE: Settings are backed up and restored in the order they appear
5356 * in this array. If you have one setting depending on another,
5357 * make sure that they are ordered appropriately.
5358 *
5359 * @hide
5360 */
5361 public static final String[] SETTINGS_TO_BACKUP = {
5362 STAY_ON_WHILE_PLUGGED_IN,
5363 MODE_RINGER,
5364 AUTO_TIME,
5365 AUTO_TIME_ZONE,
5366 POWER_SOUNDS_ENABLED,
5367 DOCK_SOUNDS_ENABLED,
5368 USB_MASS_STORAGE_ENABLED,
5369 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
5370 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
5371 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
Christopher Tate16eb7cd2012-10-09 15:26:30 -07005372 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07005373 WIFI_NUM_OPEN_NETWORKS_KEPT,
5374 EMERGENCY_TONE,
5375 CALL_AUTO_RETRY,
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07005376 DOCK_AUDIO_MEDIA_ENABLED
Christopher Tate66488d62012-10-02 11:58:01 -07005377 };
5378
Christopher Tate06efb532012-08-24 15:29:27 -07005379 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07005380 private static NameValueCache sNameValueCache = new NameValueCache(
5381 SYS_PROP_SETTING_VERSION,
5382 CONTENT_URI,
5383 CALL_METHOD_GET_GLOBAL,
5384 CALL_METHOD_PUT_GLOBAL);
Christopher Tate06efb532012-08-24 15:29:27 -07005385
5386 /**
5387 * Look up a name in the database.
5388 * @param resolver to access the database with
5389 * @param name to look up in the table
5390 * @return the corresponding value, or null if not present
5391 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07005392 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07005393 return getStringForUser(resolver, name, UserHandle.myUserId());
5394 }
5395
5396 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07005397 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07005398 int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07005399 return sNameValueCache.getStringForUser(resolver, name, userHandle);
5400 }
5401
5402 /**
5403 * Store a name/value pair into the database.
5404 * @param resolver to access the database with
5405 * @param name to store
5406 * @param value to associate with the name
5407 * @return true if the value was set, false on database errors
5408 */
5409 public static boolean putString(ContentResolver resolver,
5410 String name, String value) {
5411 return putStringForUser(resolver, name, value, UserHandle.myUserId());
5412 }
5413
5414 /** @hide */
5415 public static boolean putStringForUser(ContentResolver resolver,
5416 String name, String value, int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07005417 if (LOCAL_LOGV) {
5418 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
5419 + " for " + userHandle);
5420 }
5421 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
5422 }
5423
5424 /**
5425 * Construct the content URI for a particular name/value pair,
5426 * useful for monitoring changes with a ContentObserver.
5427 * @param name to look up in the table
5428 * @return the corresponding content URI, or null if not present
5429 */
5430 public static Uri getUriFor(String name) {
5431 return getUriFor(CONTENT_URI, name);
5432 }
5433
5434 /**
5435 * Convenience function for retrieving a single secure settings value
5436 * as an integer. Note that internally setting values are always
5437 * stored as strings; this function converts the string to an integer
5438 * for you. The default value will be returned if the setting is
5439 * not defined or not an integer.
5440 *
5441 * @param cr The ContentResolver to access.
5442 * @param name The name of the setting to retrieve.
5443 * @param def Value to return if the setting is not defined.
5444 *
5445 * @return The setting's current value, or 'def' if it is not defined
5446 * or not a valid integer.
5447 */
5448 public static int getInt(ContentResolver cr, String name, int def) {
5449 String v = getString(cr, name);
5450 try {
5451 return v != null ? Integer.parseInt(v) : def;
5452 } catch (NumberFormatException e) {
5453 return def;
5454 }
5455 }
5456
5457 /**
5458 * Convenience function for retrieving a single secure settings value
5459 * as an integer. Note that internally setting values are always
5460 * stored as strings; this function converts the string to an integer
5461 * for you.
5462 * <p>
5463 * This version does not take a default value. If the setting has not
5464 * been set, or the string value is not a number,
5465 * it throws {@link SettingNotFoundException}.
5466 *
5467 * @param cr The ContentResolver to access.
5468 * @param name The name of the setting to retrieve.
5469 *
5470 * @throws SettingNotFoundException Thrown if a setting by the given
5471 * name can't be found or the setting value is not an integer.
5472 *
5473 * @return The setting's current value.
5474 */
5475 public static int getInt(ContentResolver cr, String name)
5476 throws SettingNotFoundException {
5477 String v = getString(cr, name);
5478 try {
5479 return Integer.parseInt(v);
5480 } catch (NumberFormatException e) {
5481 throw new SettingNotFoundException(name);
5482 }
5483 }
5484
5485 /**
5486 * Convenience function for updating a single settings value as an
5487 * integer. This will either create a new entry in the table if the
5488 * given name does not exist, or modify the value of the existing row
5489 * with that name. Note that internally setting values are always
5490 * stored as strings, so this function converts the given value to a
5491 * string before storing it.
5492 *
5493 * @param cr The ContentResolver to access.
5494 * @param name The name of the setting to modify.
5495 * @param value The new value for the setting.
5496 * @return true if the value was set, false on database errors
5497 */
5498 public static boolean putInt(ContentResolver cr, String name, int value) {
5499 return putString(cr, name, Integer.toString(value));
5500 }
5501
5502 /**
5503 * Convenience function for retrieving a single secure settings value
5504 * as a {@code long}. Note that internally setting values are always
5505 * stored as strings; this function converts the string to a {@code long}
5506 * for you. The default value will be returned if the setting is
5507 * not defined or not a {@code long}.
5508 *
5509 * @param cr The ContentResolver to access.
5510 * @param name The name of the setting to retrieve.
5511 * @param def Value to return if the setting is not defined.
5512 *
5513 * @return The setting's current value, or 'def' if it is not defined
5514 * or not a valid {@code long}.
5515 */
5516 public static long getLong(ContentResolver cr, String name, long def) {
5517 String valString = getString(cr, name);
5518 long value;
5519 try {
5520 value = valString != null ? Long.parseLong(valString) : def;
5521 } catch (NumberFormatException e) {
5522 value = def;
5523 }
5524 return value;
5525 }
5526
5527 /**
5528 * Convenience function for retrieving a single secure settings value
5529 * as a {@code long}. Note that internally setting values are always
5530 * stored as strings; this function converts the string to a {@code long}
5531 * for you.
5532 * <p>
5533 * This version does not take a default value. If the setting has not
5534 * been set, or the string value is not a number,
5535 * it throws {@link SettingNotFoundException}.
5536 *
5537 * @param cr The ContentResolver to access.
5538 * @param name The name of the setting to retrieve.
5539 *
5540 * @return The setting's current value.
5541 * @throws SettingNotFoundException Thrown if a setting by the given
5542 * name can't be found or the setting value is not an integer.
5543 */
5544 public static long getLong(ContentResolver cr, String name)
5545 throws SettingNotFoundException {
5546 String valString = getString(cr, name);
5547 try {
5548 return Long.parseLong(valString);
5549 } catch (NumberFormatException e) {
5550 throw new SettingNotFoundException(name);
5551 }
5552 }
5553
5554 /**
5555 * Convenience function for updating a secure settings value as a long
5556 * integer. This will either create a new entry in the table if the
5557 * given name does not exist, or modify the value of the existing row
5558 * with that name. Note that internally setting values are always
5559 * stored as strings, so this function converts the given value to a
5560 * string before storing it.
5561 *
5562 * @param cr The ContentResolver to access.
5563 * @param name The name of the setting to modify.
5564 * @param value The new value for the setting.
5565 * @return true if the value was set, false on database errors
5566 */
5567 public static boolean putLong(ContentResolver cr, String name, long value) {
5568 return putString(cr, name, Long.toString(value));
5569 }
5570
5571 /**
5572 * Convenience function for retrieving a single secure settings value
5573 * as a floating point number. Note that internally setting values are
5574 * always stored as strings; this function converts the string to an
5575 * float for you. The default value will be returned if the setting
5576 * is not defined or not a valid float.
5577 *
5578 * @param cr The ContentResolver to access.
5579 * @param name The name of the setting to retrieve.
5580 * @param def Value to return if the setting is not defined.
5581 *
5582 * @return The setting's current value, or 'def' if it is not defined
5583 * or not a valid float.
5584 */
5585 public static float getFloat(ContentResolver cr, String name, float def) {
5586 String v = getString(cr, name);
5587 try {
5588 return v != null ? Float.parseFloat(v) : def;
5589 } catch (NumberFormatException e) {
5590 return def;
5591 }
5592 }
5593
5594 /**
5595 * Convenience function for retrieving a single secure settings value
5596 * as a float. Note that internally setting values are always
5597 * stored as strings; this function converts the string to a float
5598 * for you.
5599 * <p>
5600 * This version does not take a default value. If the setting has not
5601 * been set, or the string value is not a number,
5602 * it throws {@link SettingNotFoundException}.
5603 *
5604 * @param cr The ContentResolver to access.
5605 * @param name The name of the setting to retrieve.
5606 *
5607 * @throws SettingNotFoundException Thrown if a setting by the given
5608 * name can't be found or the setting value is not a float.
5609 *
5610 * @return The setting's current value.
5611 */
5612 public static float getFloat(ContentResolver cr, String name)
5613 throws SettingNotFoundException {
5614 String v = getString(cr, name);
5615 if (v == null) {
5616 throw new SettingNotFoundException(name);
5617 }
5618 try {
5619 return Float.parseFloat(v);
5620 } catch (NumberFormatException e) {
5621 throw new SettingNotFoundException(name);
5622 }
5623 }
5624
5625 /**
5626 * Convenience function for updating a single settings value as a
5627 * floating point number. This will either create a new entry in the
5628 * table if the given name does not exist, or modify the value of the
5629 * existing row with that name. Note that internally setting values
5630 * are always stored as strings, so this function converts the given
5631 * value to a string before storing it.
5632 *
5633 * @param cr The ContentResolver to access.
5634 * @param name The name of the setting to modify.
5635 * @param value The new value for the setting.
5636 * @return true if the value was set, false on database errors
5637 */
5638 public static boolean putFloat(ContentResolver cr, String name, float value) {
5639 return putString(cr, name, Float.toString(value));
5640 }
5641 }
5642
5643 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005644 * User-defined bookmarks and shortcuts. The target of each bookmark is an
5645 * Intent URL, allowing it to be either a web page or a particular
5646 * application activity.
5647 *
5648 * @hide
5649 */
5650 public static final class Bookmarks implements BaseColumns
5651 {
5652 private static final String TAG = "Bookmarks";
5653
5654 /**
5655 * The content:// style URL for this table
5656 */
5657 public static final Uri CONTENT_URI =
5658 Uri.parse("content://" + AUTHORITY + "/bookmarks");
5659
5660 /**
5661 * The row ID.
5662 * <p>Type: INTEGER</p>
5663 */
5664 public static final String ID = "_id";
5665
5666 /**
5667 * Descriptive name of the bookmark that can be displayed to the user.
5668 * If this is empty, the title should be resolved at display time (use
5669 * {@link #getTitle(Context, Cursor)} any time you want to display the
5670 * title of a bookmark.)
5671 * <P>
5672 * Type: TEXT
5673 * </P>
5674 */
5675 public static final String TITLE = "title";
5676
5677 /**
5678 * Arbitrary string (displayed to the user) that allows bookmarks to be
5679 * organized into categories. There are some special names for
5680 * standard folders, which all start with '@'. The label displayed for
5681 * the folder changes with the locale (via {@link #getLabelForFolder}) but
5682 * the folder name does not change so you can consistently query for
5683 * the folder regardless of the current locale.
5684 *
5685 * <P>Type: TEXT</P>
5686 *
5687 */
5688 public static final String FOLDER = "folder";
5689
5690 /**
5691 * The Intent URL of the bookmark, describing what it points to. This
5692 * value is given to {@link android.content.Intent#getIntent} to create
5693 * an Intent that can be launched.
5694 * <P>Type: TEXT</P>
5695 */
5696 public static final String INTENT = "intent";
5697
5698 /**
5699 * Optional shortcut character associated with this bookmark.
5700 * <P>Type: INTEGER</P>
5701 */
5702 public static final String SHORTCUT = "shortcut";
5703
5704 /**
5705 * The order in which the bookmark should be displayed
5706 * <P>Type: INTEGER</P>
5707 */
5708 public static final String ORDERING = "ordering";
5709
5710 private static final String[] sIntentProjection = { INTENT };
5711 private static final String[] sShortcutProjection = { ID, SHORTCUT };
5712 private static final String sShortcutSelection = SHORTCUT + "=?";
5713
5714 /**
5715 * Convenience function to retrieve the bookmarked Intent for a
5716 * particular shortcut key.
5717 *
5718 * @param cr The ContentResolver to query.
5719 * @param shortcut The shortcut key.
5720 *
5721 * @return Intent The bookmarked URL, or null if there is no bookmark
5722 * matching the given shortcut.
5723 */
5724 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
5725 {
5726 Intent intent = null;
5727
5728 Cursor c = cr.query(CONTENT_URI,
5729 sIntentProjection, sShortcutSelection,
5730 new String[] { String.valueOf((int) shortcut) }, ORDERING);
5731 // Keep trying until we find a valid shortcut
5732 try {
5733 while (intent == null && c.moveToNext()) {
5734 try {
5735 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02005736 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005737 } catch (java.net.URISyntaxException e) {
5738 // The stored URL is bad... ignore it.
5739 } catch (IllegalArgumentException e) {
5740 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07005741 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005742 }
5743 }
5744 } finally {
5745 if (c != null) c.close();
5746 }
5747
5748 return intent;
5749 }
5750
5751 /**
5752 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005753 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005754 * @param cr The ContentResolver to query.
5755 * @param intent The desired target of the bookmark.
5756 * @param title Bookmark title that is shown to the user; null if none
5757 * or it should be resolved to the intent's title.
5758 * @param folder Folder in which to place the bookmark; null if none.
5759 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
5760 * this is non-zero and there is an existing bookmark entry
5761 * with this same shortcut, then that existing shortcut is
5762 * cleared (the bookmark is not removed).
5763 * @return The unique content URL for the new bookmark entry.
5764 */
5765 public static Uri add(ContentResolver cr,
5766 Intent intent,
5767 String title,
5768 String folder,
5769 char shortcut,
5770 int ordering)
5771 {
5772 // If a shortcut is supplied, and it is already defined for
5773 // another bookmark, then remove the old definition.
5774 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05005775 cr.delete(CONTENT_URI, sShortcutSelection,
5776 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005777 }
5778
5779 ContentValues values = new ContentValues();
5780 if (title != null) values.put(TITLE, title);
5781 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07005782 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005783 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
5784 values.put(ORDERING, ordering);
5785 return cr.insert(CONTENT_URI, values);
5786 }
5787
5788 /**
5789 * Return the folder name as it should be displayed to the user. This
5790 * takes care of localizing special folders.
5791 *
5792 * @param r Resources object for current locale; only need access to
5793 * system resources.
5794 * @param folder The value found in the {@link #FOLDER} column.
5795 *
5796 * @return CharSequence The label for this folder that should be shown
5797 * to the user.
5798 */
5799 public static CharSequence getLabelForFolder(Resources r, String folder) {
5800 return folder;
5801 }
5802
5803 /**
5804 * Return the title as it should be displayed to the user. This takes
5805 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005806 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005807 * @param context A context.
5808 * @param cursor A cursor pointing to the row whose title should be
5809 * returned. The cursor must contain at least the {@link #TITLE}
5810 * and {@link #INTENT} columns.
5811 * @return A title that is localized and can be displayed to the user,
5812 * or the empty string if one could not be found.
5813 */
5814 public static CharSequence getTitle(Context context, Cursor cursor) {
5815 int titleColumn = cursor.getColumnIndex(TITLE);
5816 int intentColumn = cursor.getColumnIndex(INTENT);
5817 if (titleColumn == -1 || intentColumn == -1) {
5818 throw new IllegalArgumentException(
5819 "The cursor must contain the TITLE and INTENT columns.");
5820 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005821
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005822 String title = cursor.getString(titleColumn);
5823 if (!TextUtils.isEmpty(title)) {
5824 return title;
5825 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005826
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005827 String intentUri = cursor.getString(intentColumn);
5828 if (TextUtils.isEmpty(intentUri)) {
5829 return "";
5830 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005831
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005832 Intent intent;
5833 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02005834 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005835 } catch (URISyntaxException e) {
5836 return "";
5837 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07005838
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005839 PackageManager packageManager = context.getPackageManager();
5840 ResolveInfo info = packageManager.resolveActivity(intent, 0);
5841 return info != null ? info.loadLabel(packageManager) : "";
5842 }
5843 }
5844
5845 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005846 * Returns the device ID that we should use when connecting to the mobile gtalk server.
5847 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
5848 * from the GoogleLoginService.
5849 *
5850 * @param androidId The Android ID for this device.
5851 * @return The device ID that should be used when connecting to the mobile gtalk server.
5852 * @hide
5853 */
5854 public static String getGTalkDeviceId(long androidId) {
5855 return "android-" + Long.toHexString(androidId);
5856 }
5857}