blob: 248a96fd7ebc8482276b087bb6ffa992caec48eb [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;
Mike LeBeau5d34e9b2010-02-10 19:34:56 -080022import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023import android.content.ContentResolver;
24import android.content.ContentValues;
25import android.content.Context;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -080026import android.content.IContentProvider;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080027import android.content.Intent;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -080028import android.content.pm.ActivityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080029import android.content.pm.PackageManager;
30import android.content.pm.ResolveInfo;
31import android.content.res.Configuration;
32import android.content.res.Resources;
33import android.database.Cursor;
34import android.database.SQLException;
35import android.net.Uri;
Irfan Sheriff36f74132010-11-04 16:57:37 -070036import android.net.wifi.WifiManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070037import android.os.BatteryManager;
38import android.os.Bundle;
Amith Yamasani52c489c2012-03-28 11:42:42 -070039import android.os.IBinder;
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -070040import android.os.Process;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070041import android.os.RemoteException;
Amith Yamasani52c489c2012-03-28 11:42:42 -070042import android.os.ServiceManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070043import android.os.SystemProperties;
Dianne Hackbornf02b60a2012-08-16 10:48:27 -070044import android.os.UserHandle;
Narayan Kamath6d632962011-08-24 11:51:37 +010045import android.speech.tts.TextToSpeech;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046import android.text.TextUtils;
47import android.util.AndroidException;
48import android.util.Log;
Gilles Debunnee90bed12011-08-30 14:28:27 -070049import android.view.WindowOrientationListener;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080050
Amith Yamasani52c489c2012-03-28 11:42:42 -070051import com.android.internal.widget.ILockSettings;
52
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080053import java.net.URISyntaxException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080054import java.util.HashMap;
55import java.util.HashSet;
56
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080057/**
58 * The Settings provider contains global system-level device preferences.
59 */
60public final class Settings {
61
62 // Intent actions for Settings
63
64 /**
65 * Activity Action: Show system settings.
66 * <p>
67 * Input: Nothing.
68 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070069 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080070 */
71 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
72 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
73
74 /**
75 * Activity Action: Show settings to allow configuration of APNs.
76 * <p>
77 * Input: Nothing.
78 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070079 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080080 */
81 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
82 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
83
84 /**
85 * Activity Action: Show settings to allow configuration of current location
86 * sources.
87 * <p>
88 * In some cases, a matching Activity may not exist, so ensure you
89 * safeguard against this.
90 * <p>
91 * Input: Nothing.
92 * <p>
93 * Output: Nothing.
94 */
95 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
96 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
97 "android.settings.LOCATION_SOURCE_SETTINGS";
98
99 /**
100 * Activity Action: Show settings to allow configuration of wireless controls
101 * such as Wi-Fi, Bluetooth and Mobile networks.
102 * <p>
103 * In some cases, a matching Activity may not exist, so ensure you
104 * safeguard against this.
105 * <p>
106 * Input: Nothing.
107 * <p>
108 * Output: Nothing.
109 */
110 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
111 public static final String ACTION_WIRELESS_SETTINGS =
112 "android.settings.WIRELESS_SETTINGS";
113
114 /**
115 * Activity Action: Show settings to allow entering/exiting airplane mode.
116 * <p>
117 * In some cases, a matching Activity may not exist, so ensure you
118 * safeguard against this.
119 * <p>
120 * Input: Nothing.
121 * <p>
122 * Output: Nothing.
123 */
124 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
125 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
126 "android.settings.AIRPLANE_MODE_SETTINGS";
127
128 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700129 * Activity Action: Show settings for accessibility modules.
130 * <p>
131 * In some cases, a matching Activity may not exist, so ensure you
132 * safeguard against this.
133 * <p>
134 * Input: Nothing.
135 * <p>
136 * Output: Nothing.
137 */
138 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
139 public static final String ACTION_ACCESSIBILITY_SETTINGS =
140 "android.settings.ACCESSIBILITY_SETTINGS";
141
142 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800143 * Activity Action: Show settings to allow configuration of security and
144 * location privacy.
145 * <p>
146 * In some cases, a matching Activity may not exist, so ensure you
147 * safeguard against this.
148 * <p>
149 * Input: Nothing.
150 * <p>
151 * Output: Nothing.
152 */
153 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
154 public static final String ACTION_SECURITY_SETTINGS =
155 "android.settings.SECURITY_SETTINGS";
156
157 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700158 * Activity Action: Show settings to allow configuration of privacy options.
159 * <p>
160 * In some cases, a matching Activity may not exist, so ensure you
161 * safeguard against this.
162 * <p>
163 * Input: Nothing.
164 * <p>
165 * Output: Nothing.
166 */
167 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
168 public static final String ACTION_PRIVACY_SETTINGS =
169 "android.settings.PRIVACY_SETTINGS";
170
171 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800172 * Activity Action: Show settings to allow configuration of Wi-Fi.
173
174 * <p>
175 * In some cases, a matching Activity may not exist, so ensure you
176 * safeguard against this.
177 * <p>
178 * Input: Nothing.
179 * <p>
180 * Output: Nothing.
181
182 */
183 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
184 public static final String ACTION_WIFI_SETTINGS =
185 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700186
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800187 /**
188 * Activity Action: Show settings to allow configuration of a static IP
189 * address for Wi-Fi.
190 * <p>
191 * In some cases, a matching Activity may not exist, so ensure you safeguard
192 * against this.
193 * <p>
194 * Input: Nothing.
195 * <p>
196 * Output: Nothing.
197 */
198 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
199 public static final String ACTION_WIFI_IP_SETTINGS =
200 "android.settings.WIFI_IP_SETTINGS";
201
202 /**
203 * Activity Action: Show settings to allow configuration of Bluetooth.
204 * <p>
205 * In some cases, a matching Activity may not exist, so ensure you
206 * safeguard against this.
207 * <p>
208 * Input: Nothing.
209 * <p>
210 * Output: Nothing.
211 */
212 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
213 public static final String ACTION_BLUETOOTH_SETTINGS =
214 "android.settings.BLUETOOTH_SETTINGS";
215
216 /**
Jeff Brown89d55462012-09-19 11:33:42 -0700217 * Activity Action: Show settings to allow configuration of Wifi Displays.
218 * <p>
219 * In some cases, a matching Activity may not exist, so ensure you
220 * safeguard against this.
221 * <p>
222 * Input: Nothing.
223 * <p>
224 * Output: Nothing.
225 * @hide
226 */
227 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
228 public static final String ACTION_WIFI_DISPLAY_SETTINGS =
229 "android.settings.WIFI_DISPLAY_SETTINGS";
230
231 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800232 * Activity Action: Show settings to allow configuration of date and time.
233 * <p>
234 * In some cases, a matching Activity may not exist, so ensure you
235 * safeguard against this.
236 * <p>
237 * Input: Nothing.
238 * <p>
239 * Output: Nothing.
240 */
241 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
242 public static final String ACTION_DATE_SETTINGS =
243 "android.settings.DATE_SETTINGS";
244
245 /**
246 * Activity Action: Show settings to allow configuration of sound and volume.
247 * <p>
248 * In some cases, a matching Activity may not exist, so ensure you
249 * safeguard against this.
250 * <p>
251 * Input: Nothing.
252 * <p>
253 * Output: Nothing.
254 */
255 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
256 public static final String ACTION_SOUND_SETTINGS =
257 "android.settings.SOUND_SETTINGS";
258
259 /**
260 * Activity Action: Show settings to allow configuration of display.
261 * <p>
262 * In some cases, a matching Activity may not exist, so ensure you
263 * safeguard against this.
264 * <p>
265 * Input: Nothing.
266 * <p>
267 * Output: Nothing.
268 */
269 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
270 public static final String ACTION_DISPLAY_SETTINGS =
271 "android.settings.DISPLAY_SETTINGS";
272
273 /**
274 * Activity Action: Show settings to allow configuration of locale.
275 * <p>
276 * In some cases, a matching Activity may not exist, so ensure you
277 * safeguard against this.
278 * <p>
279 * Input: Nothing.
280 * <p>
281 * Output: Nothing.
282 */
283 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
284 public static final String ACTION_LOCALE_SETTINGS =
285 "android.settings.LOCALE_SETTINGS";
286
287 /**
288 * Activity Action: Show settings to configure input methods, in particular
289 * allowing the user to enable input methods.
290 * <p>
291 * In some cases, a matching Activity may not exist, so ensure you
292 * safeguard against this.
293 * <p>
294 * Input: Nothing.
295 * <p>
296 * Output: Nothing.
297 */
298 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
299 public static final String ACTION_INPUT_METHOD_SETTINGS =
300 "android.settings.INPUT_METHOD_SETTINGS";
301
302 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900303 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900304 * <p>
305 * In some cases, a matching Activity may not exist, so ensure you
306 * safeguard against this.
307 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900308 * To tell which input method's subtypes are displayed in the settings, add
309 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
310 * If there is no extra in this Intent, subtypes from all installed input methods
311 * will be displayed in the settings.
312 *
313 * @see android.view.inputmethod.InputMethodInfo#getId
314 * <p>
satok86417ea2010-10-27 14:11:03 +0900315 * Input: Nothing.
316 * <p>
317 * Output: Nothing.
318 */
319 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900320 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
321 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900322
323 /**
satok7cfc0ed2011-06-20 21:29:36 +0900324 * Activity Action: Show a dialog to select input method.
325 * <p>
326 * In some cases, a matching Activity may not exist, so ensure you
327 * safeguard against this.
328 * <p>
329 * Input: Nothing.
330 * <p>
331 * Output: Nothing.
332 * @hide
333 */
334 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
335 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
336 "android.settings.SHOW_INPUT_METHOD_PICKER";
337
338 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800339 * Activity Action: Show settings to manage the user input dictionary.
340 * <p>
341 * In some cases, a matching Activity may not exist, so ensure you
342 * safeguard against this.
343 * <p>
344 * Input: Nothing.
345 * <p>
346 * Output: Nothing.
347 */
348 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
349 public static final String ACTION_USER_DICTIONARY_SETTINGS =
350 "android.settings.USER_DICTIONARY_SETTINGS";
351
352 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700353 * Activity Action: Adds a word to the user dictionary.
354 * <p>
355 * In some cases, a matching Activity may not exist, so ensure you
356 * safeguard against this.
357 * <p>
358 * Input: An extra with key <code>word</code> that contains the word
359 * that should be added to the dictionary.
360 * <p>
361 * Output: Nothing.
362 *
363 * @hide
364 */
365 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
366 public static final String ACTION_USER_DICTIONARY_INSERT =
367 "com.android.settings.USER_DICTIONARY_INSERT";
368
369 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800370 * Activity Action: Show settings to allow configuration of application-related settings.
371 * <p>
372 * In some cases, a matching Activity may not exist, so ensure you
373 * safeguard against this.
374 * <p>
375 * Input: Nothing.
376 * <p>
377 * Output: Nothing.
378 */
379 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
380 public static final String ACTION_APPLICATION_SETTINGS =
381 "android.settings.APPLICATION_SETTINGS";
382
383 /**
384 * Activity Action: Show settings to allow configuration of application
385 * development-related settings.
386 * <p>
387 * In some cases, a matching Activity may not exist, so ensure you safeguard
388 * against this.
389 * <p>
390 * Input: Nothing.
391 * <p>
392 * Output: Nothing.
393 */
394 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
395 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
396 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
397
398 /**
399 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
400 * <p>
401 * In some cases, a matching Activity may not exist, so ensure you
402 * safeguard against this.
403 * <p>
404 * Input: Nothing.
405 * <p>
406 * Output: Nothing.
407 */
408 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
409 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
410 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700411
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800412 /**
413 * Activity Action: Show settings to manage installed applications.
414 * <p>
415 * In some cases, a matching Activity may not exist, so ensure you
416 * safeguard against this.
417 * <p>
418 * Input: Nothing.
419 * <p>
420 * Output: Nothing.
421 */
422 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
423 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
424 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700425
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800426 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700427 * Activity Action: Show settings to manage all applications.
428 * <p>
429 * In some cases, a matching Activity may not exist, so ensure you
430 * safeguard against this.
431 * <p>
432 * Input: Nothing.
433 * <p>
434 * Output: Nothing.
435 */
436 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
437 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
438 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
439
440 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700441 * Activity Action: Show screen of details about a particular application.
442 * <p>
443 * In some cases, a matching Activity may not exist, so ensure you
444 * safeguard against this.
445 * <p>
446 * Input: The Intent's data URI specifies the application package name
447 * to be shown, with the "package" scheme. That is "package:com.my.app".
448 * <p>
449 * Output: Nothing.
450 */
451 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
452 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
453 "android.settings.APPLICATION_DETAILS_SETTINGS";
454
455 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800456 * Activity Action: Show settings for system update functionality.
457 * <p>
458 * In some cases, a matching Activity may not exist, so ensure you
459 * safeguard against this.
460 * <p>
461 * Input: Nothing.
462 * <p>
463 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700464 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800465 * @hide
466 */
467 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
468 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
469 "android.settings.SYSTEM_UPDATE_SETTINGS";
470
471 /**
472 * Activity Action: Show settings to allow configuration of sync settings.
473 * <p>
474 * In some cases, a matching Activity may not exist, so ensure you
475 * safeguard against this.
476 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800477 * The account types available to add via the add account button may be restricted by adding an
478 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
479 * authorities. Only account types which can sync with that content provider will be offered to
480 * the user.
481 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800482 * Input: Nothing.
483 * <p>
484 * Output: Nothing.
485 */
486 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
487 public static final String ACTION_SYNC_SETTINGS =
488 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700489
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800490 /**
Erikeebc8e22010-02-18 13:27:19 -0800491 * Activity Action: Show add account screen for creating a new account.
492 * <p>
493 * In some cases, a matching Activity may not exist, so ensure you
494 * safeguard against this.
495 * <p>
496 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
497 * extra to the Intent with one or more syncable content provider's authorities. Only account
498 * types which can sync with that content provider will be offered to the user.
499 * <p>
500 * Input: Nothing.
501 * <p>
502 * Output: Nothing.
503 */
504 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
505 public static final String ACTION_ADD_ACCOUNT =
506 "android.settings.ADD_ACCOUNT_SETTINGS";
507
508 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800509 * Activity Action: Show settings for selecting the network operator.
510 * <p>
511 * In some cases, a matching Activity may not exist, so ensure you
512 * safeguard against this.
513 * <p>
514 * Input: Nothing.
515 * <p>
516 * Output: Nothing.
517 */
518 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
519 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
520 "android.settings.NETWORK_OPERATOR_SETTINGS";
521
522 /**
523 * Activity Action: Show settings for selection of 2G/3G.
524 * <p>
525 * In some cases, a matching Activity may not exist, so ensure you
526 * safeguard against this.
527 * <p>
528 * Input: Nothing.
529 * <p>
530 * Output: Nothing.
531 */
532 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
533 public static final String ACTION_DATA_ROAMING_SETTINGS =
534 "android.settings.DATA_ROAMING_SETTINGS";
535
536 /**
537 * Activity Action: Show settings for internal storage.
538 * <p>
539 * In some cases, a matching Activity may not exist, so ensure you
540 * safeguard against this.
541 * <p>
542 * Input: Nothing.
543 * <p>
544 * Output: Nothing.
545 */
546 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
547 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
548 "android.settings.INTERNAL_STORAGE_SETTINGS";
549 /**
550 * Activity Action: Show settings for memory card storage.
551 * <p>
552 * In some cases, a matching Activity may not exist, so ensure you
553 * safeguard against this.
554 * <p>
555 * Input: Nothing.
556 * <p>
557 * Output: Nothing.
558 */
559 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
560 public static final String ACTION_MEMORY_CARD_SETTINGS =
561 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700562
Justin Mattsonef340352010-01-13 21:05:46 -0800563 /**
564 * Activity Action: Show settings for global search.
565 * <p>
566 * In some cases, a matching Activity may not exist, so ensure you
567 * safeguard against this.
568 * <p>
569 * Input: Nothing.
570 * <p>
571 * Output: Nothing
572 */
573 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
574 public static final String ACTION_SEARCH_SETTINGS =
575 "android.search.action.SEARCH_SETTINGS";
576
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500577 /**
578 * Activity Action: Show general device information settings (serial
579 * number, software version, phone number, etc.).
580 * <p>
581 * In some cases, a matching Activity may not exist, so ensure you
582 * safeguard against this.
583 * <p>
584 * Input: Nothing.
585 * <p>
586 * Output: Nothing
587 */
588 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
589 public static final String ACTION_DEVICE_INFO_SETTINGS =
590 "android.settings.DEVICE_INFO_SETTINGS";
591
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500592 /**
Nick Pellycccf01d2011-10-31 14:49:40 -0700593 * Activity Action: Show NFC settings.
594 * <p>
595 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500596 * <p>
597 * In some cases, a matching Activity may not exist, so ensure you
598 * safeguard against this.
599 * <p>
600 * Input: Nothing.
601 * <p>
602 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -0700603 * @see android.nfc.NfcAdapter#isEnabled()
604 */
605 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
606 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
607
608 /**
609 * Activity Action: Show NFC Sharing settings.
610 * <p>
611 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
612 * off.
613 * <p>
614 * In some cases, a matching Activity may not exist, so ensure you
615 * safeguard against this.
616 * <p>
617 * Input: Nothing.
618 * <p>
619 * Output: Nothing
620 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500621 */
622 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
623 public static final String ACTION_NFCSHARING_SETTINGS =
624 "android.settings.NFCSHARING_SETTINGS";
625
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800626 // End of Intent actions for Settings
627
Erikeebc8e22010-02-18 13:27:19 -0800628 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800629 * @hide - Private call() method on SettingsProvider to read from 'system' table.
630 */
631 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
632
633 /**
634 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
635 */
636 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
637
638 /**
Christopher Tate06efb532012-08-24 15:29:27 -0700639 * @hide - Private call() method on SettingsProvider to read from 'global' table.
640 */
641 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
642
643 /**
644 * @hide - User handle argument extra to the fast-path call()-based requests
645 */
646 public static final String CALL_METHOD_USER_KEY = "_user";
647
648 /** @hide - Private call() method to write to 'system' table */
649 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
650
651 /** @hide - Private call() method to write to 'secure' table */
652 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
653
654 /** @hide - Private call() method to write to 'global' table */
655 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
656
657 /**
Erikeebc8e22010-02-18 13:27:19 -0800658 * Activity Extra: Limit available options in launched activity based on the given authority.
659 * <p>
660 * This can be passed as an extra field in an Activity Intent with one or more syncable content
661 * provider's authorities as a String[]. This field is used by some intents to alter the
662 * behavior of the called activity.
663 * <p>
664 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
665 * on the authority given.
666 */
667 public static final String EXTRA_AUTHORITIES =
668 "authorities";
669
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900670 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
671
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800672 private static final String JID_RESOURCE_PREFIX = "android";
673
674 public static final String AUTHORITY = "settings";
675
676 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -0700677 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800678
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800679 public static class SettingNotFoundException extends AndroidException {
680 public SettingNotFoundException(String msg) {
681 super(msg);
682 }
683 }
684
685 /**
686 * Common base for tables of name/value settings.
687 */
688 public static class NameValueTable implements BaseColumns {
689 public static final String NAME = "name";
690 public static final String VALUE = "value";
691
692 protected static boolean putString(ContentResolver resolver, Uri uri,
693 String name, String value) {
694 // The database will take care of replacing duplicates.
695 try {
696 ContentValues values = new ContentValues();
697 values.put(NAME, name);
698 values.put(VALUE, value);
699 resolver.insert(uri, values);
700 return true;
701 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -0700702 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800703 return false;
704 }
705 }
706
707 public static Uri getUriFor(Uri uri, String name) {
708 return Uri.withAppendedPath(uri, name);
709 }
710 }
711
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800712 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800713 private static class NameValueCache {
714 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800715 private final Uri mUri;
716
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800717 private static final String[] SELECT_VALUE =
718 new String[] { Settings.NameValueTable.VALUE };
719 private static final String NAME_EQ_PLACEHOLDER = "name=?";
720
721 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -0800722 private final HashMap<String, String> mValues = new HashMap<String, String>();
723 private long mValuesVersion = 0;
724
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800725 // Initially null; set lazily and held forever. Synchronized on 'this'.
726 private IContentProvider mContentProvider = null;
727
728 // The method we'll call (or null, to not use) on the provider
729 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -0700730 private final String mCallGetCommand;
731 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800732
Christopher Tate06efb532012-08-24 15:29:27 -0700733 public NameValueCache(String versionSystemProperty, Uri uri,
734 String getCommand, String setCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800735 mVersionSystemProperty = versionSystemProperty;
736 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -0700737 mCallGetCommand = getCommand;
738 mCallSetCommand = setCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800739 }
740
Christopher Tate06efb532012-08-24 15:29:27 -0700741 private IContentProvider lazyGetProvider(ContentResolver cr) {
742 IContentProvider cp = null;
743 synchronized (this) {
744 cp = mContentProvider;
745 if (cp == null) {
746 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
747 }
748 }
749 return cp;
750 }
751
752 public boolean putStringForUser(ContentResolver cr, String name, String value,
753 final int userHandle) {
754 try {
755 Bundle arg = new Bundle();
756 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -0700757 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -0700758 IContentProvider cp = lazyGetProvider(cr);
759 cp.call(mCallSetCommand, name, arg);
760 } catch (RemoteException e) {
761 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
762 return false;
763 }
764 return true;
765 }
766
767 public boolean putString(ContentResolver cr, String name, String value) {
768 return putStringForUser(cr, name, value, UserHandle.myUserId());
769 }
770
771 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -0700772 final boolean isSelf = (userHandle == UserHandle.myUserId());
773 if (isSelf) {
774 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -0800775
Christopher Tate78d2a662012-09-13 16:19:44 -0700776 // Our own user's settings data uses a client-side cache
777 synchronized (this) {
778 if (mValuesVersion != newValuesVersion) {
779 if (LOCAL_LOGV || false) {
780 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current "
781 + newValuesVersion + " != cached " + mValuesVersion);
782 }
783
784 mValues.clear();
785 mValuesVersion = newValuesVersion;
Dan Egnor799f7212009-11-24 16:24:44 -0800786 }
787
Christopher Tate78d2a662012-09-13 16:19:44 -0700788 if (mValues.containsKey(name)) {
789 return mValues.get(name); // Could be null, that's OK -- negative caching
790 }
Dan Egnor799f7212009-11-24 16:24:44 -0800791 }
Christopher Tate78d2a662012-09-13 16:19:44 -0700792 } else {
793 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
794 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800795 }
Dan Egnor799f7212009-11-24 16:24:44 -0800796
Christopher Tate06efb532012-08-24 15:29:27 -0700797 IContentProvider cp = lazyGetProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800798
799 // Try the fast path first, not using query(). If this
800 // fails (alternate Settings provider that doesn't support
801 // this interface?) then we fall back to the query/table
802 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -0700803 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800804 try {
Christopher Tate06efb532012-08-24 15:29:27 -0700805 Bundle args = null;
806 if (userHandle != UserHandle.myUserId()) {
807 args = new Bundle();
808 args.putInt(CALL_METHOD_USER_KEY, userHandle);
809 }
810 Bundle b = cp.call(mCallGetCommand, name, args);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800811 if (b != null) {
812 String value = b.getPairValue();
Christopher Tate78d2a662012-09-13 16:19:44 -0700813 // Don't update our cache for reads of other users' data
814 if (isSelf) {
815 synchronized (this) {
816 mValues.put(name, value);
817 }
818 } else {
819 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
820 + " by " + UserHandle.myUserId()
821 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800822 }
823 return value;
824 }
825 // If the response Bundle is null, we fall through
826 // to the query interface below.
827 } catch (RemoteException e) {
828 // Not supported by the remote side? Fall through
829 // to query().
830 }
831 }
832
Dan Egnor799f7212009-11-24 16:24:44 -0800833 Cursor c = null;
834 try {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800835 c = cp.query(mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
Jeff Brown75ea64f2012-01-25 19:37:13 -0800836 new String[]{name}, null, null);
Dan Egnor799f7212009-11-24 16:24:44 -0800837 if (c == null) {
838 Log.w(TAG, "Can't get key " + name + " from " + mUri);
839 return null;
840 }
841
842 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800843 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -0800844 mValues.put(name, value);
845 }
846 if (LOCAL_LOGV) {
847 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
848 name + " = " + (value == null ? "(null)" : value));
849 }
850 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800851 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -0800852 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
853 return null; // Return null, but don't cache it.
854 } finally {
855 if (c != null) c.close();
856 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800857 }
Christopher Tate06efb532012-08-24 15:29:27 -0700858
859 public String getString(ContentResolver cr, String name) {
860 return getStringForUser(cr, name, UserHandle.myUserId());
861 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800862 }
863
864 /**
865 * System settings, containing miscellaneous system preferences. This
866 * table holds simple name/value pairs. There are convenience
867 * functions for accessing individual settings entries.
868 */
869 public static final class System extends NameValueTable {
870 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
871
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800872 // Populated lazily, guarded by class object:
873 private static NameValueCache sNameValueCache = null;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700874
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800875 private static final HashSet<String> MOVED_TO_SECURE;
876 static {
877 MOVED_TO_SECURE = new HashSet<String>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800878 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800879 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800880 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -0400881 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -0800882 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
883 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
884 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800885 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
886 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
887 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
888 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
889 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800890 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
891 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
892 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
893 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
894 MOVED_TO_SECURE.add(Secure.WIFI_ON);
895 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
896 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
897 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
898 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
899 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
900 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
901 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
902 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
903 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
904 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
905 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
906 }
907
Christopher Tate06efb532012-08-24 15:29:27 -0700908 private static final HashSet<String> MOVED_TO_GLOBAL;
909 static {
910 MOVED_TO_GLOBAL = new HashSet<String>();
Christopher Tate92198742012-09-07 12:00:13 -0700911 // these were originally in system but migrated to secure in the past,
912 // so are duplicated in the Secure.* namespace
Christopher Tate06efb532012-08-24 15:29:27 -0700913 MOVED_TO_GLOBAL.add(Global.ADB_ENABLED);
914 MOVED_TO_GLOBAL.add(Global.BLUETOOTH_ON);
915 MOVED_TO_GLOBAL.add(Global.DATA_ROAMING);
916 MOVED_TO_GLOBAL.add(Global.DEVICE_PROVISIONED);
917 MOVED_TO_GLOBAL.add(Global.INSTALL_NON_MARKET_APPS);
918 MOVED_TO_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
919
Christopher Tate92198742012-09-07 12:00:13 -0700920 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -0700921 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
922 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
923 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
924 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
925 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
926 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
927 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
928 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
929 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
930 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
931 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
932 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
933 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
934 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
935 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
936 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -0700937 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Christopher Tate06efb532012-08-24 15:29:27 -0700938 }
939
940 private static void lazyInitCache() {
941 if (sNameValueCache == null) {
942 sNameValueCache = new NameValueCache(
943 SYS_PROP_SETTING_VERSION + '_' + UserHandle.myUserId(),
944 CONTENT_URI,
945 CALL_METHOD_GET_SYSTEM,
946 CALL_METHOD_PUT_SYSTEM);
947 }
948 }
949
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800950 /**
951 * Look up a name in the database.
952 * @param resolver to access the database with
953 * @param name to look up in the table
954 * @return the corresponding value, or null if not present
955 */
956 public synchronized static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -0700957 return getStringForUser(resolver, name, UserHandle.myUserId());
958 }
959
960 /** @hide */
961 public synchronized static String getStringForUser(ContentResolver resolver, String name,
962 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800963 if (MOVED_TO_SECURE.contains(name)) {
964 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
965 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -0700966 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800967 }
Christopher Tate06efb532012-08-24 15:29:27 -0700968 if (MOVED_TO_GLOBAL.contains(name)) {
969 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
970 + " to android.provider.Settings.Global, returning read-only value.");
971 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800972 }
Christopher Tate06efb532012-08-24 15:29:27 -0700973 lazyInitCache();
974 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800975 }
976
977 /**
978 * Store a name/value pair into the database.
979 * @param resolver to access the database with
980 * @param name to store
981 * @param value to associate with the name
982 * @return true if the value was set, false on database errors
983 */
984 public static boolean putString(ContentResolver resolver, String name, String value) {
Christopher Tate06efb532012-08-24 15:29:27 -0700985 return putStringForUser(resolver, name, value, UserHandle.myUserId());
986 }
987
988 /** @hide */
989 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
990 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800991 if (MOVED_TO_SECURE.contains(name)) {
992 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
993 + " to android.provider.Settings.Secure, value is unchanged.");
994 return false;
995 }
Christopher Tate06efb532012-08-24 15:29:27 -0700996 if (MOVED_TO_GLOBAL.contains(name)) {
997 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
998 + " to android.provider.Settings.Global, value is unchanged.");
999 return false;
1000 }
1001 lazyInitCache();
1002 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001003 }
1004
1005 /**
1006 * Construct the content URI for a particular name/value pair,
1007 * useful for monitoring changes with a ContentObserver.
1008 * @param name to look up in the table
1009 * @return the corresponding content URI, or null if not present
1010 */
1011 public static Uri getUriFor(String name) {
1012 if (MOVED_TO_SECURE.contains(name)) {
1013 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1014 + " to android.provider.Settings.Secure, returning Secure URI.");
1015 return Secure.getUriFor(Secure.CONTENT_URI, name);
1016 }
Christopher Tate06efb532012-08-24 15:29:27 -07001017 if (MOVED_TO_GLOBAL.contains(name)) {
1018 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1019 + " to android.provider.Settings.Global, returning read-only global URI.");
1020 return Global.getUriFor(Global.CONTENT_URI, name);
1021 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001022 return getUriFor(CONTENT_URI, name);
1023 }
1024
1025 /**
1026 * Convenience function for retrieving a single system settings value
1027 * as an integer. Note that internally setting values are always
1028 * stored as strings; this function converts the string to an integer
1029 * for you. The default value will be returned if the setting is
1030 * not defined or not an integer.
1031 *
1032 * @param cr The ContentResolver to access.
1033 * @param name The name of the setting to retrieve.
1034 * @param def Value to return if the setting is not defined.
1035 *
1036 * @return The setting's current value, or 'def' if it is not defined
1037 * or not a valid integer.
1038 */
1039 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001040 return getIntForUser(cr, name, def, UserHandle.myUserId());
1041 }
1042
1043 /** @hide */
1044 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
1045 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001046 try {
1047 return v != null ? Integer.parseInt(v) : def;
1048 } catch (NumberFormatException e) {
1049 return def;
1050 }
1051 }
1052
1053 /**
1054 * Convenience function for retrieving a single system settings value
1055 * as an integer. Note that internally setting values are always
1056 * stored as strings; this function converts the string to an integer
1057 * for you.
1058 * <p>
1059 * This version does not take a default value. If the setting has not
1060 * been set, or the string value is not a number,
1061 * it throws {@link SettingNotFoundException}.
1062 *
1063 * @param cr The ContentResolver to access.
1064 * @param name The name of the setting to retrieve.
1065 *
1066 * @throws SettingNotFoundException Thrown if a setting by the given
1067 * name can't be found or the setting value is not an integer.
1068 *
1069 * @return The setting's current value.
1070 */
1071 public static int getInt(ContentResolver cr, String name)
1072 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001073 return getIntForUser(cr, name, UserHandle.myUserId());
1074 }
1075
1076 /** @hide */
1077 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
1078 throws SettingNotFoundException {
1079 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001080 try {
1081 return Integer.parseInt(v);
1082 } catch (NumberFormatException e) {
1083 throw new SettingNotFoundException(name);
1084 }
1085 }
1086
1087 /**
1088 * Convenience function for updating a single settings value as an
1089 * integer. This will either create a new entry in the table if the
1090 * given name does not exist, or modify the value of the existing row
1091 * with that name. Note that internally setting values are always
1092 * stored as strings, so this function converts the given value to a
1093 * string before storing it.
1094 *
1095 * @param cr The ContentResolver to access.
1096 * @param name The name of the setting to modify.
1097 * @param value The new value for the setting.
1098 * @return true if the value was set, false on database errors
1099 */
1100 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001101 return putIntForUser(cr, name, value, UserHandle.myUserId());
1102 }
1103
1104 /** @hide */
1105 public static boolean putIntForUser(ContentResolver cr, String name, int value,
1106 int userHandle) {
1107 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001108 }
1109
1110 /**
1111 * Convenience function for retrieving a single system settings value
1112 * as a {@code long}. Note that internally setting values are always
1113 * stored as strings; this function converts the string to a {@code long}
1114 * for you. The default value will be returned if the setting is
1115 * not defined or not a {@code long}.
1116 *
1117 * @param cr The ContentResolver to access.
1118 * @param name The name of the setting to retrieve.
1119 * @param def Value to return if the setting is not defined.
1120 *
1121 * @return The setting's current value, or 'def' if it is not defined
1122 * or not a valid {@code long}.
1123 */
1124 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001125 return getLongForUser(cr, name, def, UserHandle.myUserId());
1126 }
1127
1128 /** @hide */
1129 public static long getLongForUser(ContentResolver cr, String name, long def,
1130 int userHandle) {
1131 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001132 long value;
1133 try {
1134 value = valString != null ? Long.parseLong(valString) : def;
1135 } catch (NumberFormatException e) {
1136 value = def;
1137 }
1138 return value;
1139 }
1140
1141 /**
1142 * Convenience function for retrieving a single system settings value
1143 * as a {@code long}. Note that internally setting values are always
1144 * stored as strings; this function converts the string to a {@code long}
1145 * for you.
1146 * <p>
1147 * This version does not take a default value. If the setting has not
1148 * been set, or the string value is not a number,
1149 * it throws {@link SettingNotFoundException}.
1150 *
1151 * @param cr The ContentResolver to access.
1152 * @param name The name of the setting to retrieve.
1153 *
1154 * @return The setting's current value.
1155 * @throws SettingNotFoundException Thrown if a setting by the given
1156 * name can't be found or the setting value is not an integer.
1157 */
1158 public static long getLong(ContentResolver cr, String name)
1159 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001160 return getLongForUser(cr, name, UserHandle.myUserId());
1161 }
1162
1163 /** @hide */
1164 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
1165 throws SettingNotFoundException {
1166 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001167 try {
1168 return Long.parseLong(valString);
1169 } catch (NumberFormatException e) {
1170 throw new SettingNotFoundException(name);
1171 }
1172 }
1173
1174 /**
1175 * Convenience function for updating a single settings value as a long
1176 * integer. This will either create a new entry in the table if the
1177 * given name does not exist, or modify the value of the existing row
1178 * with that name. Note that internally setting values are always
1179 * stored as strings, so this function converts the given value to a
1180 * string before storing it.
1181 *
1182 * @param cr The ContentResolver to access.
1183 * @param name The name of the setting to modify.
1184 * @param value The new value for the setting.
1185 * @return true if the value was set, false on database errors
1186 */
1187 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001188 return putLongForUser(cr, name, value, UserHandle.myUserId());
1189 }
1190
1191 /** @hide */
1192 public static boolean putLongForUser(ContentResolver cr, String name, long value,
1193 int userHandle) {
1194 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001195 }
1196
1197 /**
1198 * Convenience function for retrieving a single system settings value
1199 * as a floating point number. Note that internally setting values are
1200 * always stored as strings; this function converts the string to an
1201 * float for you. The default value will be returned if the setting
1202 * is not defined or not a valid float.
1203 *
1204 * @param cr The ContentResolver to access.
1205 * @param name The name of the setting to retrieve.
1206 * @param def Value to return if the setting is not defined.
1207 *
1208 * @return The setting's current value, or 'def' if it is not defined
1209 * or not a valid float.
1210 */
1211 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001212 return getFloatForUser(cr, name, def, UserHandle.myUserId());
1213 }
1214
1215 /** @hide */
1216 public static float getFloatForUser(ContentResolver cr, String name, float def,
1217 int userHandle) {
1218 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001219 try {
1220 return v != null ? Float.parseFloat(v) : def;
1221 } catch (NumberFormatException e) {
1222 return def;
1223 }
1224 }
1225
1226 /**
1227 * Convenience function for retrieving a single system settings value
1228 * as a float. Note that internally setting values are always
1229 * stored as strings; this function converts the string to a float
1230 * for you.
1231 * <p>
1232 * This version does not take a default value. If the setting has not
1233 * been set, or the string value is not a number,
1234 * it throws {@link SettingNotFoundException}.
1235 *
1236 * @param cr The ContentResolver to access.
1237 * @param name The name of the setting to retrieve.
1238 *
1239 * @throws SettingNotFoundException Thrown if a setting by the given
1240 * name can't be found or the setting value is not a float.
1241 *
1242 * @return The setting's current value.
1243 */
1244 public static float getFloat(ContentResolver cr, String name)
1245 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001246 return getFloatForUser(cr, name, UserHandle.myUserId());
1247 }
1248
1249 /** @hide */
1250 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
1251 throws SettingNotFoundException {
1252 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08001253 if (v == null) {
1254 throw new SettingNotFoundException(name);
1255 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001256 try {
1257 return Float.parseFloat(v);
1258 } catch (NumberFormatException e) {
1259 throw new SettingNotFoundException(name);
1260 }
1261 }
1262
1263 /**
1264 * Convenience function for updating a single settings value as a
1265 * floating point number. This will either create a new entry in the
1266 * table if the given name does not exist, or modify the value of the
1267 * existing row with that name. Note that internally setting values
1268 * are always stored as strings, so this function converts the given
1269 * value to a string before storing it.
1270 *
1271 * @param cr The ContentResolver to access.
1272 * @param name The name of the setting to modify.
1273 * @param value The new value for the setting.
1274 * @return true if the value was set, false on database errors
1275 */
1276 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001277 return putFloatForUser(cr, name, value, UserHandle.myUserId());
1278 }
1279
1280 /** @hide */
1281 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
1282 int userHandle) {
1283 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001284 }
1285
1286 /**
1287 * Convenience function to read all of the current
1288 * configuration-related settings into a
1289 * {@link Configuration} object.
1290 *
1291 * @param cr The ContentResolver to access.
1292 * @param outConfig Where to place the configuration settings.
1293 */
1294 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Christopher Tate06efb532012-08-24 15:29:27 -07001295 getConfigurationForUser(cr, outConfig, UserHandle.myUserId());
1296 }
1297
1298 /** @hide */
1299 public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig,
1300 int userHandle) {
1301 outConfig.fontScale = Settings.System.getFloatForUser(
1302 cr, FONT_SCALE, outConfig.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001303 if (outConfig.fontScale < 0) {
1304 outConfig.fontScale = 1;
1305 }
1306 }
1307
1308 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001309 * @hide Erase the fields in the Configuration that should be applied
1310 * by the settings.
1311 */
1312 public static void clearConfiguration(Configuration inoutConfig) {
1313 inoutConfig.fontScale = 0;
1314 }
Narayan Kamath6d632962011-08-24 11:51:37 +01001315
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001316 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001317 * Convenience function to write a batch of configuration-related
1318 * settings from a {@link Configuration} object.
1319 *
1320 * @param cr The ContentResolver to access.
1321 * @param config The settings to write.
1322 * @return true if the values were set, false on database errors
1323 */
1324 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Christopher Tate06efb532012-08-24 15:29:27 -07001325 return putConfigurationForUser(cr, config, UserHandle.myUserId());
1326 }
1327
1328 /** @hide */
1329 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
1330 int userHandle) {
1331 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001332 }
1333
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001334 /** @hide */
1335 public static boolean hasInterestingConfigurationChanges(int changes) {
1336 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1337 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001338
Christopher Tate06efb532012-08-24 15:29:27 -07001339 /** @deprecated - Do not use */
1340 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001341 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Christopher Tate06efb532012-08-24 15:29:27 -07001342 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001343 }
1344
Christopher Tate06efb532012-08-24 15:29:27 -07001345 /**
1346 * @hide
1347 * @deprecated - Do not use
1348 */
1349 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
1350 int userHandle) {
1351 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
1352 }
1353
1354 /** @deprecated - Do not use */
1355 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001356 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Christopher Tatec8c08382012-09-19 17:18:18 -07001357 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07001358 }
1359
1360 /**
1361 * @hide
1362 * @deprecated - Do not use
1363 */
1364 @Deprecated
1365 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
1366 int userHandle) {
1367 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001368 }
1369
1370 /**
1371 * The content:// style URL for this table
1372 */
1373 public static final Uri CONTENT_URI =
1374 Uri.parse("content://" + AUTHORITY + "/system");
1375
1376 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001377 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001378 */
Christopher Tate06efb532012-08-24 15:29:27 -07001379 @Deprecated
1380 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 -08001381
1382 /**
1383 * What happens when the user presses the end call button if they're not
1384 * on a call.<br/>
1385 * <b>Values:</b><br/>
1386 * 0 - The end button does nothing.<br/>
1387 * 1 - The end button goes to the home screen.<br/>
1388 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1389 * 3 - The end button goes to the home screen. If the user is already on the
1390 * home screen, it puts the device to sleep.
1391 */
1392 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1393
1394 /**
David Brown458e8062010-03-08 21:52:11 -08001395 * END_BUTTON_BEHAVIOR value for "go home".
1396 * @hide
1397 */
1398 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1399
1400 /**
1401 * END_BUTTON_BEHAVIOR value for "go to sleep".
1402 * @hide
1403 */
1404 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
1405
1406 /**
1407 * END_BUTTON_BEHAVIOR default value.
1408 * @hide
1409 */
1410 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
1411
1412 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07001413 * Is advanced settings mode turned on. 0 == no, 1 == yes
1414 * @hide
1415 */
1416 public static final String ADVANCED_SETTINGS = "advanced_settings";
1417
1418 /**
1419 * ADVANCED_SETTINGS default value.
1420 * @hide
1421 */
1422 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
1423
1424 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001425 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001426 */
Christopher Tate06efb532012-08-24 15:29:27 -07001427 @Deprecated
1428 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001429
1430 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001431 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001432 */
Christopher Tate06efb532012-08-24 15:29:27 -07001433 @Deprecated
1434 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001435
1436 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001437 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001438 */
Christopher Tate06efb532012-08-24 15:29:27 -07001439 @Deprecated
1440 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001441
Robert Greenwalt8588e472011-11-08 10:12:25 -08001442 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001443 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08001444 * {@hide}
1445 */
Christopher Tate06efb532012-08-24 15:29:27 -07001446 @Deprecated
1447 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001448
1449 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001450 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07001451 */
Christopher Tate06efb532012-08-24 15:29:27 -07001452 @Deprecated
1453 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07001454
1455 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001456 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001457 */
Christopher Tate06efb532012-08-24 15:29:27 -07001458 @Deprecated
1459 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001460
1461 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001462 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
1463 */
1464 @Deprecated
1465 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
1466
1467 /**
1468 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001469 *
1470 * {@hide}
1471 */
Christopher Tate06efb532012-08-24 15:29:27 -07001472 @Deprecated
1473 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
1474 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001475
1476 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001477 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001478 */
Christopher Tate06efb532012-08-24 15:29:27 -07001479 @Deprecated
1480 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001481
1482 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001483 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} 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 int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
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#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001490 */
Christopher Tate06efb532012-08-24 15:29:27 -07001491 @Deprecated
1492 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
1493 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001494
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001495 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001496 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001497 */
Christopher Tate06efb532012-08-24 15:29:27 -07001498 @Deprecated
1499 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001500
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001501 /**
1502 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
1503 */
1504 @Deprecated
1505 public static final String MODE_RINGER = Global.MODE_RINGER;
1506
Irfan Sheriff31b62322010-08-30 12:26:00 -07001507 //TODO: deprecate static IP constants
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001508 /**
1509 * Whether to use static IP and other static network attributes.
1510 * <p>
1511 * Set to 1 for true and 0 for false.
1512 */
1513 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
1514
1515 /**
1516 * The static IP address.
1517 * <p>
1518 * Example: "192.168.1.51"
1519 */
1520 public static final String WIFI_STATIC_IP = "wifi_static_ip";
1521
1522 /**
1523 * If using static IP, the gateway's IP address.
1524 * <p>
1525 * Example: "192.168.1.1"
1526 */
1527 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
1528
1529 /**
1530 * If using static IP, the net mask.
1531 * <p>
1532 * Example: "255.255.255.0"
1533 */
1534 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
1535
1536 /**
1537 * If using static IP, the primary DNS's IP address.
1538 * <p>
1539 * Example: "192.168.1.1"
1540 */
1541 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
1542
1543 /**
1544 * If using static IP, the secondary DNS's IP address.
1545 * <p>
1546 * Example: "192.168.1.2"
1547 */
1548 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
1549
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001550
1551 /**
1552 * Determines whether remote devices may discover and/or connect to
1553 * this device.
1554 * <P>Type: INT</P>
1555 * 2 -- discoverable and connectable
1556 * 1 -- connectable but not discoverable
1557 * 0 -- neither connectable nor discoverable
1558 */
1559 public static final String BLUETOOTH_DISCOVERABILITY =
1560 "bluetooth_discoverability";
1561
1562 /**
1563 * Bluetooth discoverability timeout. If this value is nonzero, then
1564 * Bluetooth becomes discoverable for a certain number of seconds,
1565 * after which is becomes simply connectable. The value is in seconds.
1566 */
1567 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
1568 "bluetooth_discoverability_timeout";
1569
1570 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001571 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
1572 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001573 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001574 @Deprecated
1575 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001576
1577 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001578 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
1579 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001580 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001581 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001582 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
1583
1584 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001585 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08001586 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
1587 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001588 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001589 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001590 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
1591 "lock_pattern_tactile_feedback_enabled";
1592
1593
1594 /**
1595 * A formatted string of the next alarm that is set, or the empty string
1596 * if there is no alarm set.
1597 */
1598 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
1599
1600 /**
1601 * Scaling factor for fonts, float.
1602 */
1603 public static final String FONT_SCALE = "font_scale";
1604
1605 /**
1606 * Name of an application package to be debugged.
1607 */
1608 public static final String DEBUG_APP = "debug_app";
1609
1610 /**
1611 * If 1, when launching DEBUG_APP it will wait for the debugger before
1612 * starting user code. If 0, it will run normally.
1613 */
1614 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
1615
1616 /**
1617 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07001618 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001619 */
Jeff Brown96307042012-07-27 15:51:34 -07001620 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001621 public static final String DIM_SCREEN = "dim_screen";
1622
1623 /**
1624 * The timeout before the screen turns off.
1625 */
1626 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
1627
1628 /**
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001629 * If 0, the compatibility mode is off for all applications.
1630 * If 1, older applications run under compatibility mode.
1631 * TODO: remove this settings before code freeze (bug/1907571)
1632 * @hide
1633 */
1634 public static final String COMPATIBILITY_MODE = "compatibility_mode";
1635
1636 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001637 * The screen backlight brightness between 0 and 255.
1638 */
1639 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
1640
1641 /**
Dan Murphy951764b2009-08-27 14:59:03 -05001642 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05001643 */
1644 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
1645
1646 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08001647 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
1648 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07001649 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08001650 */
1651 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
1652
1653 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001654 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001655 */
1656 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
1657
1658 /**
Scott Main52bfc242012-02-09 10:09:14 -08001659 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001660 */
1661 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
1662
1663 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001664 * Control whether the process CPU usage meter should be shown.
1665 */
1666 public static final String SHOW_PROCESSES = "show_processes";
1667
1668 /**
1669 * If 1, the activity manager will aggressively finish activities and
1670 * processes as soon as they are no longer needed. If 0, the normal
1671 * extended lifetime is used.
1672 */
1673 public static final String ALWAYS_FINISH_ACTIVITIES =
1674 "always_finish_activities";
1675
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001676 /**
1677 * Determines which streams are affected by ringer mode changes. The
1678 * stream type's bit should be set to 1 if it should be muted when going
1679 * into an inaudible ringer mode.
1680 */
1681 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
1682
1683 /**
1684 * Determines which streams are affected by mute. The
1685 * stream type's bit should be set to 1 if it should be muted when a mute request
1686 * is received.
1687 */
1688 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
1689
1690 /**
1691 * Whether vibrate is on for different events. This is used internally,
1692 * changing this value will not change the vibrate. See AudioManager.
1693 */
1694 public static final String VIBRATE_ON = "vibrate_on";
1695
1696 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07001697 * If 1, redirects the system vibrator to all currently attached input devices
1698 * that support vibration. If there are no such input devices, then the system
1699 * vibrator is used instead.
1700 * If 0, does not register the system vibrator.
1701 *
1702 * This setting is mainly intended to provide a compatibility mechanism for
1703 * applications that only know about the system vibrator and do not use the
1704 * input device vibrator API.
1705 *
1706 * @hide
1707 */
1708 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
1709
1710 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001711 * Ringer volume. This is used internally, changing this value will not
1712 * change the volume. See AudioManager.
1713 */
1714 public static final String VOLUME_RING = "volume_ring";
1715
1716 /**
1717 * System/notifications volume. This is used internally, changing this
1718 * value will not change the volume. See AudioManager.
1719 */
1720 public static final String VOLUME_SYSTEM = "volume_system";
1721
1722 /**
1723 * Voice call volume. This is used internally, changing this value will
1724 * not change the volume. See AudioManager.
1725 */
1726 public static final String VOLUME_VOICE = "volume_voice";
1727
1728 /**
1729 * Music/media/gaming volume. This is used internally, changing this
1730 * value will not change the volume. See AudioManager.
1731 */
1732 public static final String VOLUME_MUSIC = "volume_music";
1733
1734 /**
1735 * Alarm volume. This is used internally, changing this
1736 * value will not change the volume. See AudioManager.
1737 */
1738 public static final String VOLUME_ALARM = "volume_alarm";
1739
1740 /**
1741 * Notification volume. This is used internally, changing this
1742 * value will not change the volume. See AudioManager.
1743 */
1744 public static final String VOLUME_NOTIFICATION = "volume_notification";
1745
1746 /**
Eric Laurent484d2882009-12-08 09:05:45 -08001747 * Bluetooth Headset volume. This is used internally, changing this value will
1748 * not change the volume. See AudioManager.
1749 */
1750 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
1751
1752 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04001753 * Master volume (float in the range 0.0f to 1.0f).
1754 * @hide
1755 */
1756 public static final String VOLUME_MASTER = "volume_master";
1757
1758 /**
Justin Koh57978ed2012-04-03 17:37:58 -07001759 * Master volume mute (int 1 = mute, 0 = not muted).
1760 *
1761 * @hide
1762 */
1763 public static final String VOLUME_MASTER_MUTE = "volume_master_mute";
1764
1765 /**
1766 * Whether the notifications should use the ring volume (value of 1) or
1767 * a separate notification volume (value of 0). In most cases, users
1768 * will have this enabled so the notification and ringer volumes will be
1769 * the same. However, power users can disable this and use the separate
1770 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001771 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07001772 * Note: This is a one-off setting that will be removed in the future
1773 * when there is profile support. For this reason, it is kept hidden
1774 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001775 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001776 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07001777 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001778 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07001779 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001780 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001781 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001782
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001783 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05001784 * Whether silent mode should allow vibration feedback. This is used
1785 * internally in AudioService and the Sound settings activity to
1786 * coordinate decoupling of vibrate and silent modes. This setting
1787 * will likely be removed in a future release with support for
1788 * audio/vibe feedback profiles.
1789 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07001790 * Not used anymore. On devices with vibrator, the user explicitly selects
1791 * silent or vibrate mode.
1792 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05001793 * @hide
1794 */
1795 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
1796
1797 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001798 * The mapping of stream type (integer) to its setting.
1799 */
1800 public static final String[] VOLUME_SETTINGS = {
1801 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08001802 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001803 };
1804
1805 /**
1806 * Appended to various volume related settings to record the previous
1807 * values before they the settings were affected by a silent/vibrate
1808 * ringer mode change.
1809 */
1810 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
1811
1812 /**
1813 * Persistent store for the system-wide default ringtone URI.
1814 * <p>
1815 * If you need to play the default ringtone at any given time, it is recommended
1816 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
1817 * to the set default ringtone at the time of playing.
1818 *
1819 * @see #DEFAULT_RINGTONE_URI
1820 */
1821 public static final String RINGTONE = "ringtone";
1822
1823 /**
1824 * A {@link Uri} that will point to the current default ringtone at any
1825 * given time.
1826 * <p>
1827 * If the current default ringtone is in the DRM provider and the caller
1828 * does not have permission, the exception will be a
1829 * FileNotFoundException.
1830 */
1831 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
1832
1833 /**
1834 * Persistent store for the system-wide default notification sound.
1835 *
1836 * @see #RINGTONE
1837 * @see #DEFAULT_NOTIFICATION_URI
1838 */
1839 public static final String NOTIFICATION_SOUND = "notification_sound";
1840
1841 /**
1842 * A {@link Uri} that will point to the current default notification
1843 * sound at any given time.
1844 *
1845 * @see #DEFAULT_RINGTONE_URI
1846 */
1847 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
1848
1849 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07001850 * Persistent store for the system-wide default alarm alert.
1851 *
1852 * @see #RINGTONE
1853 * @see #DEFAULT_ALARM_ALERT_URI
1854 */
1855 public static final String ALARM_ALERT = "alarm_alert";
1856
1857 /**
1858 * A {@link Uri} that will point to the current default alarm alert at
1859 * any given time.
1860 *
1861 * @see #DEFAULT_ALARM_ALERT_URI
1862 */
1863 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
1864
1865 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07001866 * Persistent store for the system default media button event receiver.
1867 *
1868 * @hide
1869 */
1870 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
1871
1872 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001873 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
1874 */
1875 public static final String TEXT_AUTO_REPLACE = "auto_replace";
1876
1877 /**
1878 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
1879 */
1880 public static final String TEXT_AUTO_CAPS = "auto_caps";
1881
1882 /**
1883 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
1884 * feature converts two spaces to a "." and space.
1885 */
1886 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001887
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001888 /**
1889 * Setting to showing password characters in text editors. 1 = On, 0 = Off
1890 */
1891 public static final String TEXT_SHOW_PASSWORD = "show_password";
1892
1893 public static final String SHOW_GTALK_SERVICE_STATUS =
1894 "SHOW_GTALK_SERVICE_STATUS";
1895
1896 /**
1897 * Name of activity to use for wallpaper on the home screen.
1898 */
1899 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
1900
1901 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001902 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
1903 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001904 */
Christopher Tate06efb532012-08-24 15:29:27 -07001905 @Deprecated
1906 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001907
1908 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001909 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
1910 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07001911 */
Christopher Tate06efb532012-08-24 15:29:27 -07001912 @Deprecated
1913 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07001914
1915 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001916 * Display times as 12 or 24 hours
1917 * 12
1918 * 24
1919 */
1920 public static final String TIME_12_24 = "time_12_24";
1921
1922 /**
1923 * Date format string
1924 * mm/dd/yyyy
1925 * dd/mm/yyyy
1926 * yyyy/mm/dd
1927 */
1928 public static final String DATE_FORMAT = "date_format";
1929
1930 /**
1931 * Whether the setup wizard has been run before (on first boot), or if
1932 * it still needs to be run.
1933 *
1934 * nonzero = it has been run in the past
1935 * 0 = it has not been run in the past
1936 */
1937 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
1938
1939 /**
1940 * Scaling factor for normal window animations. Setting to 0 will disable window
1941 * animations.
1942 */
1943 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
1944
1945 /**
1946 * Scaling factor for activity transition animations. Setting to 0 will disable window
1947 * animations.
1948 */
1949 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
1950
1951 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08001952 * Scaling factor for Animator-based animations. This affects both the start delay and
1953 * duration of all such animations. Setting to 0 will cause animations to end immediately.
1954 * The default value is 1.
1955 */
1956 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
1957
1958 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001959 * Scaling factor for normal window animations. Setting to 0 will disable window
1960 * animations.
1961 * @hide
1962 */
1963 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
1964
1965 /**
1966 * Control whether the accelerometer will be used to change screen
1967 * orientation. If 0, it will not be used unless explicitly requested
1968 * by the application; if 1, it will be used by default unless explicitly
1969 * disabled by the application.
1970 */
1971 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
1972
1973 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04001974 * Default screen rotation when no other policy applies.
1975 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
1976 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08001977 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04001978 *
1979 * @see Display#getRotation
1980 */
1981 public static final String USER_ROTATION = "user_rotation";
1982
1983 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07001984 * Control whether the rotation lock toggle in the System UI should be hidden.
1985 * Typically this is done for accessibility purposes to make it harder for
1986 * the user to accidentally toggle the rotation lock while the display rotation
1987 * has been locked for accessibility.
1988 *
1989 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
1990 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
1991 *
1992 * @hide
1993 */
1994 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
1995 "hide_rotation_lock_toggle_for_accessibility";
1996
1997 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07001998 * Whether the phone vibrates when it is ringing due to an incoming call. This will
1999 * be used by Phone and Setting apps; it shouldn't affect other apps.
2000 * The value is boolean (1 or 0).
2001 *
2002 * Note: this is not same as "vibrate on ring", which had been available until ICS.
2003 * It was about AudioManager's setting and thus affected all the applications which
2004 * relied on the setting, while this is purely about the vibration setting for incoming
2005 * calls.
2006 *
2007 * @hide
2008 */
2009 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
2010
2011 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002012 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
2013 * boolean (1 or 0).
2014 */
2015 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
2016
2017 /**
David Kraused0f67152009-06-13 18:01:13 -05002018 * CDMA only settings
2019 * DTMF tone type played by the dialer when dialing.
2020 * 0 = Normal
2021 * 1 = Long
2022 * @hide
2023 */
2024 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
2025
2026 /**
2027 * CDMA only settings
2028 * Emergency Tone 0 = Off
2029 * 1 = Alert
2030 * 2 = Vibrate
2031 * @hide
2032 */
2033 public static final String EMERGENCY_TONE = "emergency_tone";
2034
2035 /**
2036 * CDMA only settings
2037 * Whether the auto retry is enabled. The value is
2038 * boolean (1 or 0).
2039 * @hide
2040 */
2041 public static final String CALL_AUTO_RETRY = "call_auto_retry";
2042
2043 /**
2044 * Whether the hearing aid is enabled. The value is
2045 * boolean (1 or 0).
2046 * @hide
2047 */
2048 public static final String HEARING_AID = "hearing_aid";
2049
2050 /**
2051 * CDMA only settings
2052 * TTY Mode
2053 * 0 = OFF
2054 * 1 = FULL
2055 * 2 = VCO
2056 * 3 = HCO
2057 * @hide
2058 */
2059 public static final String TTY_MODE = "tty_mode";
2060
2061 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002062 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
2063 * boolean (1 or 0).
2064 */
2065 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002066
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002067 /**
2068 * Whether the haptic feedback (long presses, ...) are enabled. The value is
2069 * boolean (1 or 0).
2070 */
2071 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07002072
Mike LeBeau48603e72009-06-05 00:27:00 +01002073 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01002074 * @deprecated Each application that shows web suggestions should have its own
2075 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01002076 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01002077 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01002078 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002079
-b master501eec92009-07-06 13:53:11 -07002080 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002081 * Whether the notification LED should repeatedly flash when a notification is
2082 * pending. The value is boolean (1 or 0).
2083 * @hide
2084 */
2085 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
2086
2087 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002088 * Show pointer location on screen?
2089 * 0 = no
2090 * 1 = yes
2091 * @hide
2092 */
2093 public static final String POINTER_LOCATION = "pointer_location";
2094
2095 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07002096 * Show touch positions on screen?
2097 * 0 = no
2098 * 1 = yes
2099 * @hide
2100 */
2101 public static final String SHOW_TOUCHES = "show_touches";
2102
2103 /**
Jeff Brown4519f072011-01-23 13:16:01 -08002104 * Log raw orientation data from {@link WindowOrientationListener} for use with the
2105 * orientationplot.py tool.
2106 * 0 = no
2107 * 1 = yes
2108 * @hide
2109 */
2110 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
2111 "window_orientation_listener_log";
2112
2113 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002114 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
2115 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002116 * @hide
2117 */
Christopher Tate06efb532012-08-24 15:29:27 -07002118 @Deprecated
2119 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002120
2121 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002122 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
2123 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002124 * @hide
2125 */
Christopher Tate06efb532012-08-24 15:29:27 -07002126 @Deprecated
2127 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002128
2129 /**
2130 * Whether to play sounds when the keyguard is shown and dismissed.
2131 * @hide
2132 */
2133 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
2134
2135 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04002136 * Whether the lockscreen should be completely disabled.
2137 * @hide
2138 */
2139 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
2140
2141 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002142 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
2143 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002144 * @hide
2145 */
Christopher Tate06efb532012-08-24 15:29:27 -07002146 @Deprecated
2147 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002148
2149 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002150 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
2151 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002152 * @hide
2153 */
Christopher Tate06efb532012-08-24 15:29:27 -07002154 @Deprecated
2155 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002156
2157 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002158 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
2159 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002160 * @hide
2161 */
Christopher Tate06efb532012-08-24 15:29:27 -07002162 @Deprecated
2163 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002164
2165 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002166 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
2167 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002168 * @hide
2169 */
Christopher Tate06efb532012-08-24 15:29:27 -07002170 @Deprecated
2171 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002172
2173 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002174 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
2175 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002176 * @hide
2177 */
Christopher Tate06efb532012-08-24 15:29:27 -07002178 @Deprecated
2179 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002180
2181 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002182 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
2183 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002184 * @hide
2185 */
Christopher Tate06efb532012-08-24 15:29:27 -07002186 @Deprecated
2187 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002188
2189 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002190 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
2191 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002192 * @hide
2193 */
Christopher Tate06efb532012-08-24 15:29:27 -07002194 @Deprecated
2195 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002196
2197 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002198 * Receive incoming SIP calls?
2199 * 0 = no
2200 * 1 = yes
2201 * @hide
2202 */
2203 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
2204
2205 /**
2206 * Call Preference String.
2207 * "SIP_ALWAYS" : Always use SIP with network access
2208 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
2209 * "SIP_ASK_ME_EACH_TIME" : Always ask me each time
2210 * @hide
2211 */
2212 public static final String SIP_CALL_OPTIONS = "sip_call_options";
2213
2214 /**
2215 * One of the sip call options: Always use SIP with network access.
2216 * @hide
2217 */
2218 public static final String SIP_ALWAYS = "SIP_ALWAYS";
2219
2220 /**
2221 * One of the sip call options: Only if destination is a SIP address.
2222 * @hide
2223 */
2224 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
2225
2226 /**
2227 * One of the sip call options: Always ask me each time.
2228 * @hide
2229 */
2230 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
2231
2232 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07002233 * Pointer speed setting.
2234 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
2235 * -7 = slowest
2236 * 0 = default speed
2237 * +7 = fastest
2238 * @hide
2239 */
2240 public static final String POINTER_SPEED = "pointer_speed";
2241
2242 /**
-b master501eec92009-07-06 13:53:11 -07002243 * Settings to backup. This is here so that it's in the same place as the settings
2244 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07002245 *
2246 * NOTE: Settings are backed up and restored in the order they appear
2247 * in this array. If you have one setting depending on another,
2248 * make sure that they are ordered appropriately.
2249 *
-b master501eec92009-07-06 13:53:11 -07002250 * @hide
2251 */
2252 public static final String[] SETTINGS_TO_BACKUP = {
2253 STAY_ON_WHILE_PLUGGED_IN,
-b master501eec92009-07-06 13:53:11 -07002254 WIFI_USE_STATIC_IP,
2255 WIFI_STATIC_IP,
2256 WIFI_STATIC_GATEWAY,
2257 WIFI_STATIC_NETMASK,
2258 WIFI_STATIC_DNS1,
2259 WIFI_STATIC_DNS2,
2260 BLUETOOTH_DISCOVERABILITY,
2261 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
2262 DIM_SCREEN,
2263 SCREEN_OFF_TIMEOUT,
2264 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07002265 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002266 SCREEN_AUTO_BRIGHTNESS_ADJ,
Jeff Brown7f6c2312012-04-13 20:38:38 -07002267 VIBRATE_INPUT_DEVICES,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07002268 MODE_RINGER,
2269 MODE_RINGER_STREAMS_AFFECTED,
2270 MUTE_STREAMS_AFFECTED,
2271 VOLUME_VOICE,
2272 VOLUME_SYSTEM,
2273 VOLUME_RING,
2274 VOLUME_MUSIC,
2275 VOLUME_ALARM,
2276 VOLUME_NOTIFICATION,
Eric Laurent484d2882009-12-08 09:05:45 -08002277 VOLUME_BLUETOOTH_SCO,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07002278 VOLUME_VOICE + APPEND_FOR_LAST_AUDIBLE,
2279 VOLUME_SYSTEM + APPEND_FOR_LAST_AUDIBLE,
2280 VOLUME_RING + APPEND_FOR_LAST_AUDIBLE,
2281 VOLUME_MUSIC + APPEND_FOR_LAST_AUDIBLE,
2282 VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE,
2283 VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE,
Eric Laurent484d2882009-12-08 09:05:45 -08002284 VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE,
-b master501eec92009-07-06 13:53:11 -07002285 TEXT_AUTO_REPLACE,
2286 TEXT_AUTO_CAPS,
2287 TEXT_AUTO_PUNCTUATE,
2288 TEXT_SHOW_PASSWORD,
2289 AUTO_TIME,
Amith Yamasaniad450be2010-09-16 16:47:00 -07002290 AUTO_TIME_ZONE,
-b master501eec92009-07-06 13:53:11 -07002291 TIME_12_24,
2292 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07002293 DTMF_TONE_WHEN_DIALING,
2294 DTMF_TONE_TYPE_WHEN_DIALING,
2295 EMERGENCY_TONE,
2296 CALL_AUTO_RETRY,
2297 HEARING_AID,
2298 TTY_MODE,
2299 SOUND_EFFECTS_ENABLED,
2300 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate14c2d792010-02-25 16:49:44 -08002301 POWER_SOUNDS_ENABLED,
2302 DOCK_SOUNDS_ENABLED,
2303 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002304 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04002305 NOTIFICATION_LIGHT_PULSE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002306 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07002307 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07002308 POINTER_SPEED,
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002309 VIBRATE_WHEN_RINGING
-b master501eec92009-07-06 13:53:11 -07002310 };
2311
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002312 // Settings moved to Settings.Secure
2313
2314 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002315 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002316 * instead
2317 */
2318 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002319 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002320
2321 /**
2322 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
2323 */
2324 @Deprecated
2325 public static final String ANDROID_ID = Secure.ANDROID_ID;
2326
2327 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002328 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002329 */
2330 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002331 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002332
2333 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002334 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002335 */
2336 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002337 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002338
2339 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002340 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002341 */
2342 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002343 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002344
2345 /**
2346 * @deprecated Use {@link android.provider.Settings.Secure#HTTP_PROXY} instead
2347 */
2348 @Deprecated
2349 public static final String HTTP_PROXY = Secure.HTTP_PROXY;
2350
2351 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002352 * @deprecated Use {@link android.provider.Settings.Global#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002353 */
2354 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002355 public static final String INSTALL_NON_MARKET_APPS = Global.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002356
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002357 /**
2358 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
2359 * instead
2360 */
2361 @Deprecated
2362 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
2363
2364 /**
2365 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
2366 */
2367 @Deprecated
2368 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002369
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002370 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002371 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002372 */
2373 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002374 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002375
2376 /**
2377 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
2378 * instead
2379 */
2380 @Deprecated
2381 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
2382
2383 /**
2384 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
2385 * instead
2386 */
2387 @Deprecated
2388 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
2389
2390 /**
2391 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
2392 * instead
2393 */
2394 @Deprecated
2395 public static final String PARENTAL_CONTROL_REDIRECT_URL =
2396 Secure.PARENTAL_CONTROL_REDIRECT_URL;
2397
2398 /**
2399 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
2400 */
2401 @Deprecated
2402 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
2403
2404 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002405 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002406 */
2407 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002408 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002409
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002410 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002411 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002412 */
2413 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002414 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002415
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002416 /**
2417 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002418 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002419 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002420 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002421 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 -08002422
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002423 /**
2424 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002425 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002426 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002427 @Deprecated
2428 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07002429 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002430
2431 /**
2432 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002433 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002434 */
2435 @Deprecated
2436 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07002437 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002438
2439 /**
2440 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002441 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002442 */
2443 @Deprecated
2444 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07002445 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002446
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002447 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002448 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002449 * instead
2450 */
2451 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002452 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 -08002453
2454 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002455 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002456 */
2457 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002458 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002459
2460 /**
2461 * @deprecated Use
2462 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
2463 * instead
2464 */
2465 @Deprecated
2466 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
2467 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
2468
2469 /**
2470 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
2471 */
2472 @Deprecated
2473 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
2474
2475 /**
2476 * @deprecated Use
2477 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
2478 */
2479 @Deprecated
2480 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
2481 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002482
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002483 /**
2484 * @deprecated Use
2485 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
2486 */
2487 @Deprecated
2488 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
2489 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
2490
2491 /**
2492 * @deprecated Use
2493 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
2494 * instead
2495 */
2496 @Deprecated
2497 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
2498 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
2499
2500 /**
2501 * @deprecated Use
2502 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
2503 */
2504 @Deprecated
2505 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
2506 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
2507
2508 /**
2509 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
2510 * instead
2511 */
2512 @Deprecated
2513 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
2514
2515 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002516 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002517 */
2518 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002519 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002520
2521 /**
2522 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
2523 */
2524 @Deprecated
2525 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
2526
2527 /**
2528 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
2529 * instead
2530 */
2531 @Deprecated
2532 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
2533
2534 /**
2535 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
2536 * instead
2537 */
2538 @Deprecated
2539 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
2540 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
2541 }
2542
2543 /**
2544 * Secure system settings, containing system preferences that applications
2545 * can read but are not allowed to write. These are for preferences that
2546 * the user must explicitly modify through the system UI or specialized
2547 * APIs for those values, not modified directly by applications.
2548 */
2549 public static final class Secure extends NameValueTable {
2550 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
2551
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002552 // Populated lazily, guarded by class object:
2553 private static NameValueCache sNameValueCache = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002554
Amith Yamasani52c489c2012-03-28 11:42:42 -07002555 private static ILockSettings sLockSettings = null;
2556
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07002557 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07002558 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07002559 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07002560 static {
2561 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
2562 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
2563 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
2564 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07002565
2566 MOVED_TO_GLOBAL = new HashSet<String>();
2567 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
2568 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
2569 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
2570 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
2571 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
2572 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
2573 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
2574 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
2575 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
2576 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
2577 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
2578 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_DENSITY_FORCED);
2579 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
2580 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
2581 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
2582 MOVED_TO_GLOBAL.add(Settings.Global.INSTALL_NON_MARKET_APPS);
2583 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
2584 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
2585 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
2586 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
2587 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
2588 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
2589 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
2590 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
2591 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_REPORT_XT_OVER_DEV);
2592 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
2593 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
2594 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
2595 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
2596 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
2597 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
2598 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
2599 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
2600 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
2601 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
2602 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
2603 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
2604 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
2605 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
2606 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
2607 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
2608 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
2609 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
2610 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
2611 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
2612 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
2613 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
2614 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
2615 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
2616 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
2617 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
2618 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
2619 MOVED_TO_GLOBAL.add(Settings.Global.THROTTLE_HELP_URI);
2620 MOVED_TO_GLOBAL.add(Settings.Global.THROTTLE_MAX_NTP_CACHE_AGE_SEC);
2621 MOVED_TO_GLOBAL.add(Settings.Global.THROTTLE_NOTIFICATION_TYPE);
2622 MOVED_TO_GLOBAL.add(Settings.Global.THROTTLE_POLLING_SEC);
2623 MOVED_TO_GLOBAL.add(Settings.Global.THROTTLE_RESET_DAY);
2624 MOVED_TO_GLOBAL.add(Settings.Global.THROTTLE_THRESHOLD_BYTES);
2625 MOVED_TO_GLOBAL.add(Settings.Global.THROTTLE_VALUE_KBITSPS);
2626 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
2627 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
2628 MOVED_TO_GLOBAL.add(Settings.Global.WEB_AUTOFILL_QUERY_URL);
2629 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
2630 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
2631 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
2632 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
2633 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
2634 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
2635 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
2636 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
2637 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
2638 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
2639 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
2640 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
2641 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
2642 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
2643 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_NUM_ARP_PINGS);
2644 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
2645 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
2646 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_RSSI_FETCH_INTERVAL_MS);
2647 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07002648 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
2649 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
2650 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
2651 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
2652 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
2653 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07002654 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
2655 }
2656
2657 private static void lazyInitCache() {
2658 if (sNameValueCache == null) {
2659 sNameValueCache = new NameValueCache(
2660 SYS_PROP_SETTING_VERSION + '_' + UserHandle.myUserId(),
2661 CONTENT_URI,
2662 CALL_METHOD_GET_SECURE,
2663 CALL_METHOD_PUT_SECURE);
2664 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07002665 }
2666
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002667 /**
2668 * Look up a name in the database.
2669 * @param resolver to access the database with
2670 * @param name to look up in the table
2671 * @return the corresponding value, or null if not present
2672 */
2673 public synchronized static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07002674 return getStringForUser(resolver, name, UserHandle.myUserId());
2675 }
2676
2677 /** @hide */
2678 public synchronized static String getStringForUser(ContentResolver resolver, String name,
2679 int userHandle) {
2680 if (MOVED_TO_GLOBAL.contains(name)) {
2681 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
2682 + " to android.provider.Settings.Global.");
2683 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002684 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07002685
2686 if (sLockSettings == null) {
2687 sLockSettings = ILockSettings.Stub.asInterface(
2688 (IBinder) ServiceManager.getService("lock_settings"));
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07002689 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
Amith Yamasani52c489c2012-03-28 11:42:42 -07002690 }
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07002691 if (sLockSettings != null && !sIsSystemProcess
2692 && MOVED_TO_LOCK_SETTINGS.contains(name)) {
Amith Yamasani52c489c2012-03-28 11:42:42 -07002693 try {
Christopher Tate06efb532012-08-24 15:29:27 -07002694 return sLockSettings.getString(name, "0", userHandle);
Amith Yamasani52c489c2012-03-28 11:42:42 -07002695 } catch (RemoteException re) {
2696 // Fall through
2697 }
2698 }
2699
Christopher Tate06efb532012-08-24 15:29:27 -07002700 lazyInitCache();
2701 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002702 }
2703
2704 /**
2705 * Store a name/value pair into the database.
2706 * @param resolver to access the database with
2707 * @param name to store
2708 * @param value to associate with the name
2709 * @return true if the value was set, false on database errors
2710 */
Christopher Tate06efb532012-08-24 15:29:27 -07002711 public static boolean putString(ContentResolver resolver, String name, String value) {
2712 return putStringForUser(resolver, name, value, UserHandle.myUserId());
2713 }
2714
2715 /** @hide */
2716 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
2717 int userHandle) {
2718 if (MOVED_TO_GLOBAL.contains(name)) {
2719 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2720 + " to android.provider.Settings.Global");
2721 return Global.putStringForUser(resolver, name, value, userHandle);
2722 }
2723 lazyInitCache();
2724 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002725 }
2726
2727 /**
2728 * Construct the content URI for a particular name/value pair,
2729 * useful for monitoring changes with a ContentObserver.
2730 * @param name to look up in the table
2731 * @return the corresponding content URI, or null if not present
2732 */
2733 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07002734 if (MOVED_TO_GLOBAL.contains(name)) {
2735 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
2736 + " to android.provider.Settings.Global, returning global URI.");
2737 return Global.getUriFor(Global.CONTENT_URI, name);
2738 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002739 return getUriFor(CONTENT_URI, name);
2740 }
2741
2742 /**
2743 * Convenience function for retrieving a single secure settings value
2744 * as an integer. Note that internally setting values are always
2745 * stored as strings; this function converts the string to an integer
2746 * for you. The default value will be returned if the setting is
2747 * not defined or not an integer.
2748 *
2749 * @param cr The ContentResolver to access.
2750 * @param name The name of the setting to retrieve.
2751 * @param def Value to return if the setting is not defined.
2752 *
2753 * @return The setting's current value, or 'def' if it is not defined
2754 * or not a valid integer.
2755 */
2756 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002757 return getIntForUser(cr, name, def, UserHandle.myUserId());
2758 }
2759
2760 /** @hide */
2761 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
2762 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002763 try {
2764 return v != null ? Integer.parseInt(v) : def;
2765 } catch (NumberFormatException e) {
2766 return def;
2767 }
2768 }
2769
2770 /**
2771 * Convenience function for retrieving a single secure settings value
2772 * as an integer. Note that internally setting values are always
2773 * stored as strings; this function converts the string to an integer
2774 * for you.
2775 * <p>
2776 * This version does not take a default value. If the setting has not
2777 * been set, or the string value is not a number,
2778 * it throws {@link SettingNotFoundException}.
2779 *
2780 * @param cr The ContentResolver to access.
2781 * @param name The name of the setting to retrieve.
2782 *
2783 * @throws SettingNotFoundException Thrown if a setting by the given
2784 * name can't be found or the setting value is not an integer.
2785 *
2786 * @return The setting's current value.
2787 */
2788 public static int getInt(ContentResolver cr, String name)
2789 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07002790 return getIntForUser(cr, name, UserHandle.myUserId());
2791 }
2792
2793 /** @hide */
2794 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
2795 throws SettingNotFoundException {
2796 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002797 try {
2798 return Integer.parseInt(v);
2799 } catch (NumberFormatException e) {
2800 throw new SettingNotFoundException(name);
2801 }
2802 }
2803
2804 /**
2805 * Convenience function for updating a single settings value as an
2806 * integer. This will either create a new entry in the table if the
2807 * given name does not exist, or modify the value of the existing row
2808 * with that name. Note that internally setting values are always
2809 * stored as strings, so this function converts the given value to a
2810 * string before storing it.
2811 *
2812 * @param cr The ContentResolver to access.
2813 * @param name The name of the setting to modify.
2814 * @param value The new value for the setting.
2815 * @return true if the value was set, false on database errors
2816 */
2817 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07002818 return putIntForUser(cr, name, value, UserHandle.myUserId());
2819 }
2820
2821 /** @hide */
2822 public static boolean putIntForUser(ContentResolver cr, String name, int value,
2823 int userHandle) {
2824 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002825 }
2826
2827 /**
2828 * Convenience function for retrieving a single secure settings value
2829 * as a {@code long}. Note that internally setting values are always
2830 * stored as strings; this function converts the string to a {@code long}
2831 * for you. The default value will be returned if the setting is
2832 * not defined or not a {@code long}.
2833 *
2834 * @param cr The ContentResolver to access.
2835 * @param name The name of the setting to retrieve.
2836 * @param def Value to return if the setting is not defined.
2837 *
2838 * @return The setting's current value, or 'def' if it is not defined
2839 * or not a valid {@code long}.
2840 */
2841 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002842 return getLongForUser(cr, name, def, UserHandle.myUserId());
2843 }
2844
2845 /** @hide */
2846 public static long getLongForUser(ContentResolver cr, String name, long def,
2847 int userHandle) {
2848 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002849 long value;
2850 try {
2851 value = valString != null ? Long.parseLong(valString) : def;
2852 } catch (NumberFormatException e) {
2853 value = def;
2854 }
2855 return value;
2856 }
2857
2858 /**
2859 * Convenience function for retrieving a single secure settings value
2860 * as a {@code long}. Note that internally setting values are always
2861 * stored as strings; this function converts the string to a {@code long}
2862 * for you.
2863 * <p>
2864 * This version does not take a default value. If the setting has not
2865 * been set, or the string value is not a number,
2866 * it throws {@link SettingNotFoundException}.
2867 *
2868 * @param cr The ContentResolver to access.
2869 * @param name The name of the setting to retrieve.
2870 *
2871 * @return The setting's current value.
2872 * @throws SettingNotFoundException Thrown if a setting by the given
2873 * name can't be found or the setting value is not an integer.
2874 */
2875 public static long getLong(ContentResolver cr, String name)
2876 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07002877 return getLongForUser(cr, name, UserHandle.myUserId());
2878 }
2879
2880 /** @hide */
2881 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
2882 throws SettingNotFoundException {
2883 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002884 try {
2885 return Long.parseLong(valString);
2886 } catch (NumberFormatException e) {
2887 throw new SettingNotFoundException(name);
2888 }
2889 }
2890
2891 /**
2892 * Convenience function for updating a secure settings value as a long
2893 * integer. This will either create a new entry in the table if the
2894 * given name does not exist, or modify the value of the existing row
2895 * with that name. Note that internally setting values are always
2896 * stored as strings, so this function converts the given value to a
2897 * string before storing it.
2898 *
2899 * @param cr The ContentResolver to access.
2900 * @param name The name of the setting to modify.
2901 * @param value The new value for the setting.
2902 * @return true if the value was set, false on database errors
2903 */
2904 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07002905 return putLongForUser(cr, name, value, UserHandle.myUserId());
2906 }
2907
2908 /** @hide */
2909 public static boolean putLongForUser(ContentResolver cr, String name, long value,
2910 int userHandle) {
2911 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002912 }
2913
2914 /**
2915 * Convenience function for retrieving a single secure settings value
2916 * as a floating point number. Note that internally setting values are
2917 * always stored as strings; this function converts the string to an
2918 * float for you. The default value will be returned if the setting
2919 * is not defined or not a valid float.
2920 *
2921 * @param cr The ContentResolver to access.
2922 * @param name The name of the setting to retrieve.
2923 * @param def Value to return if the setting is not defined.
2924 *
2925 * @return The setting's current value, or 'def' if it is not defined
2926 * or not a valid float.
2927 */
2928 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002929 return getFloatForUser(cr, name, def, UserHandle.myUserId());
2930 }
2931
2932 /** @hide */
2933 public static float getFloatForUser(ContentResolver cr, String name, float def,
2934 int userHandle) {
2935 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002936 try {
2937 return v != null ? Float.parseFloat(v) : def;
2938 } catch (NumberFormatException e) {
2939 return def;
2940 }
2941 }
2942
2943 /**
2944 * Convenience function for retrieving a single secure settings value
2945 * as a float. Note that internally setting values are always
2946 * stored as strings; this function converts the string to a float
2947 * for you.
2948 * <p>
2949 * This version does not take a default value. If the setting has not
2950 * been set, or the string value is not a number,
2951 * it throws {@link SettingNotFoundException}.
2952 *
2953 * @param cr The ContentResolver to access.
2954 * @param name The name of the setting to retrieve.
2955 *
2956 * @throws SettingNotFoundException Thrown if a setting by the given
2957 * name can't be found or the setting value is not a float.
2958 *
2959 * @return The setting's current value.
2960 */
2961 public static float getFloat(ContentResolver cr, String name)
2962 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07002963 return getFloatForUser(cr, name, UserHandle.myUserId());
2964 }
2965
2966 /** @hide */
2967 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
2968 throws SettingNotFoundException {
2969 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08002970 if (v == null) {
2971 throw new SettingNotFoundException(name);
2972 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002973 try {
2974 return Float.parseFloat(v);
2975 } catch (NumberFormatException e) {
2976 throw new SettingNotFoundException(name);
2977 }
2978 }
2979
2980 /**
2981 * Convenience function for updating a single settings value as a
2982 * floating point number. This will either create a new entry in the
2983 * table if the given name does not exist, or modify the value of the
2984 * existing row with that name. Note that internally setting values
2985 * are always stored as strings, so this function converts the given
2986 * value to a string before storing it.
2987 *
2988 * @param cr The ContentResolver to access.
2989 * @param name The name of the setting to modify.
2990 * @param value The new value for the setting.
2991 * @return true if the value was set, false on database errors
2992 */
2993 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07002994 return putFloatForUser(cr, name, value, UserHandle.myUserId());
2995 }
2996
2997 /** @hide */
2998 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
2999 int userHandle) {
3000 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003001 }
3002
3003 /**
3004 * The content:// style URL for this table
3005 */
3006 public static final Uri CONTENT_URI =
3007 Uri.parse("content://" + AUTHORITY + "/secure");
3008
3009 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003010 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
3011 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08003012 */
Christopher Tate06efb532012-08-24 15:29:27 -07003013 @Deprecated
3014 public static final String DEVELOPMENT_SETTINGS_ENABLED =
3015 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08003016
3017 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003018 * When the user has enable the option to have a "bug report" command
3019 * in the power menu.
3020 * @hide
3021 */
3022 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
3023
3024 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003025 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003026 */
Christopher Tate06efb532012-08-24 15:29:27 -07003027 @Deprecated
3028 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003029
3030 /**
3031 * Setting to allow mock locations and location provider status to be injected into the
3032 * LocationManager service for testing purposes during application development. These
3033 * locations and status values override actual location and status information generated
3034 * by network, gps, or other location providers.
3035 */
3036 public static final String ALLOW_MOCK_LOCATION = "mock_location";
3037
3038 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08003039 * A 64-bit number (as a hex string) that is randomly
3040 * generated on the device's first boot and should remain
3041 * constant for the lifetime of the device. (The value may
3042 * change if a factory reset is performed on the device.)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003043 */
3044 public static final String ANDROID_ID = "android_id";
3045
3046 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003047 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003048 */
Christopher Tate06efb532012-08-24 15:29:27 -07003049 @Deprecated
3050 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003051
3052 /**
3053 * Get the key that retrieves a bluetooth headset's priority.
3054 * @hide
3055 */
3056 public static final String getBluetoothHeadsetPriorityKey(String address) {
3057 return ("bluetooth_headset_priority_" + address.toUpperCase());
3058 }
3059
3060 /**
3061 * Get the key that retrieves a bluetooth a2dp sink's priority.
3062 * @hide
3063 */
3064 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
3065 return ("bluetooth_a2dp_sink_priority_" + address.toUpperCase());
3066 }
3067
3068 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07003069 * Get the key that retrieves a bluetooth Input Device's priority.
3070 * @hide
3071 */
3072 public static final String getBluetoothInputDevicePriorityKey(String address) {
3073 return ("bluetooth_input_device_priority_" + address.toUpperCase());
3074 }
3075
3076 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003077 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003078 */
Christopher Tate06efb532012-08-24 15:29:27 -07003079 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003080
3081 /**
3082 * Setting to record the input method used by default, holding the ID
3083 * of the desired method.
3084 */
3085 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
3086
3087 /**
satokab751aa2010-09-14 19:17:36 +09003088 * Setting to record the input method subtype used by default, holding the ID
3089 * of the desired method.
3090 */
3091 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
3092 "selected_input_method_subtype";
3093
3094 /**
satok723a27e2010-11-11 14:58:11 +09003095 * Setting to record the history of input method subtype, holding the pair of ID of IME
3096 * and its last used subtype.
3097 * @hide
3098 */
3099 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
3100 "input_methods_subtype_history";
3101
3102 /**
satok5c58dfc2010-12-14 21:54:47 +09003103 * Setting to record the visibility of input method selector
3104 */
3105 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
3106 "input_method_selector_visibility";
3107
3108 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003109 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003110 */
Christopher Tate06efb532012-08-24 15:29:27 -07003111 @Deprecated
3112 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003113
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003114 /**
3115 * List of input methods that are currently enabled. This is a string
3116 * containing the IDs of all enabled input methods, each ID separated
3117 * by ':'.
3118 */
3119 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003120
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003121 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07003122 * List of system input methods that are currently disabled. This is a string
3123 * containing the IDs of all disabled input methods, each ID separated
3124 * by ':'.
3125 * @hide
3126 */
3127 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
3128
3129 /**
Robert Greenwalt434203a2010-10-11 16:00:27 -07003130 * Host name and port for global http proxy. Uses ':' seperator for between host and port
3131 * TODO - deprecate in favor of global_http_proxy_host, etc
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003132 */
3133 public static final String HTTP_PROXY = "http_proxy";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003134
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003135 /**
Robert Greenwalt434203a2010-10-11 16:00:27 -07003136 * Host name for global http proxy. Set via ConnectivityManager.
3137 * @hide
3138 */
3139 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
3140
3141 /**
3142 * Integer host port for global http proxy. Set via ConnectivityManager.
3143 * @hide
3144 */
3145 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
3146
3147 /**
Oscar Montemayor16fb7912010-08-02 09:38:48 -07003148 * Exclusion list for global proxy. This string contains a list of comma-separated
3149 * domains where the global proxy does not apply. Domains should be listed in a comma-
3150 * separated list. Example of acceptable formats: ".domain1.com,my.domain2.com"
Robert Greenwalt434203a2010-10-11 16:00:27 -07003151 * Use ConnectivityManager to set/get.
Oscar Montemayor16fb7912010-08-02 09:38:48 -07003152 * @hide
3153 */
Robert Greenwalt434203a2010-10-11 16:00:27 -07003154 public static final String GLOBAL_HTTP_PROXY_EXCLUSION_LIST =
3155 "global_http_proxy_exclusion_list";
Oscar Montemayor16fb7912010-08-02 09:38:48 -07003156
3157 /**
3158 * Enables the UI setting to allow the user to specify the global HTTP proxy
3159 * and associated exclusion list.
3160 * @hide
3161 */
3162 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
3163
3164 /**
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07003165 * Setting for default DNS in case nobody suggests one
3166 * @hide
3167 */
3168 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
3169
3170 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003171 * @deprecated Use {@link android.provider.Settings.Global#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003172 */
Christopher Tate06efb532012-08-24 15:29:27 -07003173 @Deprecated
3174 public static final String INSTALL_NON_MARKET_APPS = Global.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003175
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003176 /**
3177 * Comma-separated list of location providers that activities may access.
3178 */
3179 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003180
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003181 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04003182 * A flag containing settings used for biometric weak
3183 * @hide
3184 */
3185 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
3186 "lock_biometric_weak_flags";
3187
3188 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08003189 * Whether autolock is enabled (0 = false, 1 = true)
3190 */
3191 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
3192
3193 /**
3194 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
3195 */
3196 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
3197
3198 /**
3199 * Whether lock pattern will vibrate as user enters (0 = false, 1 = true)
3200 */
3201 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
3202 "lock_pattern_tactile_feedback_enabled";
3203
3204 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07003205 * This preference allows the device to be locked given time after screen goes off,
3206 * subject to current DeviceAdmin policy limits.
3207 * @hide
3208 */
3209 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
3210
3211
3212 /**
Jim Miller253a5ef2010-10-13 20:57:29 -07003213 * This preference contains the string that shows for owner info on LockScren.
3214 * @hide
3215 */
3216 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
3217
3218 /**
Jim Millerf229e4d2012-09-12 20:32:50 -07003219 * Id of the time appwidget on the lockscreen, or -1 if none
3220 * @hide
3221 */
3222 public static final String LOCK_SCREEN_CLOCK_APPWIDGET_ID =
3223 "lock_screen_clock_appwidget_id";
3224
3225 /**
3226 * Id of the user-selected appwidget on the lockscreen, or -1 if none
3227 * @hide
3228 */
3229 public static final String LOCK_SCREEN_USER_SELECTED_APPWIDGET_ID =
3230 "lock_screen_user_selected_appwidget_id";
3231
3232 /**
Jim Miller253a5ef2010-10-13 20:57:29 -07003233 * This preference enables showing the owner info on LockScren.
3234 * @hide
3235 */
3236 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
3237 "lock_screen_owner_info_enabled";
3238
3239 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003240 * @deprecated Use {@link android.provider.Settings.Global#DISPLAY_SIZE_FORCED} instead
Joe Onorato571ae902011-05-24 13:48:43 -07003241 * @hide
3242 */
Christopher Tate06efb532012-08-24 15:29:27 -07003243 @Deprecated
3244 public static final String DISPLAY_SIZE_FORCED = Global.DISPLAY_SIZE_FORCED;
Joe Onorato571ae902011-05-24 13:48:43 -07003245
3246 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003247 * @deprecated Use {@link android.provider.Settings.Global#DISPLAY_DENSITY_FORCED} instead
Dianne Hackborndde331c2012-08-03 14:01:57 -07003248 * @hide
3249 */
Christopher Tate06efb532012-08-24 15:29:27 -07003250 @Deprecated
3251 public static final String DISPLAY_DENSITY_FORCED = Global.DISPLAY_DENSITY_FORCED;
Dianne Hackborndde331c2012-08-03 14:01:57 -07003252
3253 /**
Jake Hamby76a61422012-09-06 17:40:21 -07003254 * @deprecated Use {@link android.provider.Settings.Global#ASSISTED_GPS_ENABLED} instead
Mike Lockwoodbcab8df2009-06-25 16:39:09 -04003255 * @hide
3256 */
Christopher Tate06efb532012-08-24 15:29:27 -07003257 @Deprecated
3258 public static final String ASSISTED_GPS_ENABLED = Global.ASSISTED_GPS_ENABLED;
Mike Lockwoodbcab8df2009-06-25 16:39:09 -04003259
3260 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003261 * The Logging ID (a unique 64-bit value) as a hex string.
3262 * Used as a pseudonymous identifier for logging.
3263 * @deprecated This identifier is poorly initialized and has
3264 * many collisions. It should not be used.
3265 */
3266 @Deprecated
3267 public static final String LOGGING_ID = "logging_id";
3268
3269 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003270 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003271 */
Christopher Tate06efb532012-08-24 15:29:27 -07003272 @Deprecated
3273 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003274
3275 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003276 * @deprecated Use {@link android.provider.Settings.Global#TETHER_SUPPORTED} instead
Robert Greenwalt2a091d72010-02-11 18:18:40 -08003277 * @hide
3278 */
Christopher Tate06efb532012-08-24 15:29:27 -07003279 @Deprecated
3280 public static final String TETHER_SUPPORTED = Global.TETHER_SUPPORTED;
Robert Greenwalt2a091d72010-02-11 18:18:40 -08003281
3282 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003283 * @deprecated Use {@link android.provider.Settings.Global#TETHER_DUN_REQUIRED} instead
Robert Greenwalt77b32dd2010-06-03 18:57:26 -07003284 * @hide
3285 */
Christopher Tate06efb532012-08-24 15:29:27 -07003286 @Deprecated
3287 public static final String TETHER_DUN_REQUIRED = Global.TETHER_DUN_REQUIRED;
Robert Greenwalt77b32dd2010-06-03 18:57:26 -07003288
3289 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003290 * @deprecated Use {@link android.provider.Settings.Global#TETHER_DUN_REQUIRED} instead
Robert Greenwalt77b32dd2010-06-03 18:57:26 -07003291 * @hide
3292 */
Christopher Tate06efb532012-08-24 15:29:27 -07003293 @Deprecated
3294 public static final String TETHER_DUN_APN = Global.TETHER_DUN_APN;
Robert Greenwalt77b32dd2010-06-03 18:57:26 -07003295
Christopher Tate06efb532012-08-24 15:29:27 -07003296 /**
3297 * @deprecated Use {@link android.provider.Settings.Global#DATA_ACTIVITY_TIMEOUT_MOBILE}
3298 * instead
Haoyu Bai04124232012-06-28 15:26:19 -07003299 * @hide
3300 */
Christopher Tate06efb532012-08-24 15:29:27 -07003301 @Deprecated
3302 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE =
3303 Global.DATA_ACTIVITY_TIMEOUT_MOBILE;
Haoyu Bai04124232012-06-28 15:26:19 -07003304
Christopher Tate06efb532012-08-24 15:29:27 -07003305 /**
3306 * @deprecated Use {@link android.provider.Settings.Global#DATA_ACTIVITY_TIMEOUT_MOBILE}
3307 * instead
Haoyu Bai04124232012-06-28 15:26:19 -07003308 * @hide
3309 */
Christopher Tate06efb532012-08-24 15:29:27 -07003310 @Deprecated
3311 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = Global.DATA_ACTIVITY_TIMEOUT_WIFI;
Haoyu Bai04124232012-06-28 15:26:19 -07003312
Robert Greenwalt77b32dd2010-06-03 18:57:26 -07003313 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08003314 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003315 */
3316 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003317
3318 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08003319 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003320 */
3321 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003322
3323 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08003324 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003325 */
3326 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003327
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003328 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003329 * @deprecated Use {@link android.provider.Settings.Global#SAMPLING_PROFILER_MS} instead
Sen Hubde75702010-05-28 01:54:03 -07003330 * @hide
3331 */
Christopher Tate06efb532012-08-24 15:29:27 -07003332 @Deprecated
3333 public static final String SAMPLING_PROFILER_MS = Global.SAMPLING_PROFILER_MS;
Sen Hubde75702010-05-28 01:54:03 -07003334
3335 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003336 * Settings classname to launch when Settings is clicked from All
3337 * Applications. Needed because of user testing between the old
3338 * and new Settings apps.
3339 */
3340 // TODO: 881807
3341 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003342
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003343 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003344 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003345 */
Christopher Tate06efb532012-08-24 15:29:27 -07003346 @Deprecated
3347 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003348
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003349 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003350 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003351 */
Christopher Tate06efb532012-08-24 15:29:27 -07003352 @Deprecated
3353 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003354
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003355 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07003356 * If accessibility is enabled.
3357 */
3358 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
3359
3360 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07003361 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07003362 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07003363 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07003364
3365 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07003366 * List of the enabled accessibility providers.
3367 */
3368 public static final String ENABLED_ACCESSIBILITY_SERVICES =
3369 "enabled_accessibility_services";
3370
3371 /**
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07003372 * List of the accessibility services to which the user has graned
3373 * permission to put the device into touch exploration mode.
3374 *
3375 * @hide
3376 */
3377 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
3378 "touch_exploration_granted_accessibility_services";
3379
3380 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08003381 * Whether to speak passwords while in accessibility mode.
3382 */
3383 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
3384
3385 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003386 * If injection of accessibility enhancing JavaScript screen-reader
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003387 * is enabled.
3388 * <p>
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003389 * Note: The JavaScript based screen-reader is served by the
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003390 * Google infrastructure and enable users with disabilities to
3391 * efficiantly navigate in and explore web content.
3392 * </p>
3393 * <p>
3394 * This property represents a boolean value.
3395 * </p>
3396 * @hide
3397 */
3398 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
3399 "accessibility_script_injection";
3400
3401 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003402 * The URL for the injected JavaScript based screen-reader used
3403 * for providing accessiblity of content in WebView.
3404 * <p>
3405 * Note: The JavaScript based screen-reader is served by the
3406 * Google infrastructure and enable users with disabilities to
3407 * efficiently navigate in and explore web content.
3408 * </p>
3409 * <p>
3410 * This property represents a string value.
3411 * </p>
3412 * @hide
3413 */
3414 public static final String ACCESSIBILITY_SCREEN_READER_URL =
3415 "accessibility_script_injection_url";
3416
3417 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003418 * Key bindings for navigation in built-in accessibility support for web content.
3419 * <p>
3420 * Note: These key bindings are for the built-in accessibility navigation for
3421 * web content which is used as a fall back solution if JavaScript in a WebView
3422 * is not enabled or the user has not opted-in script injection from Google.
3423 * </p>
3424 * <p>
3425 * The bindings are separated by semi-colon. A binding is a mapping from
3426 * a key to a sequence of actions (for more details look at
3427 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
3428 * string representation of an integer obtained from a meta state (optional) shifted
3429 * sixteen times left and bitwise ored with a key code. An action is represented
3430 * as a hexademical string representation of an integer where the first two digits
3431 * are navigation action index, the second, the third, and the fourth digit pairs
3432 * represent the action arguments. The separate actions in a binding are colon
3433 * separated. The key and the action sequence it maps to are separated by equals.
3434 * </p>
3435 * <p>
3436 * For example, the binding below maps the DPAD right button to traverse the
3437 * current navigation axis once without firing an accessibility event and to
3438 * perform the same traversal again but to fire an event:
3439 * <code>
3440 * 0x16=0x01000100:0x01000101;
3441 * </code>
3442 * </p>
3443 * <p>
3444 * The goal of this binding is to enable dynamic rebinding of keys to
3445 * navigation actions for web content without requiring a framework change.
3446 * </p>
3447 * <p>
3448 * This property represents a string value.
3449 * </p>
3450 * @hide
3451 */
3452 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
3453 "accessibility_web_content_key_bindings";
3454
3455 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07003456 * Setting that specifies whether the display magnification is enabled.
3457 * Display magnifications allows the user to zoom in the display content
3458 * and is targeted to low vision users. The current magnification scale
3459 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
3460 *
3461 * @hide
3462 */
3463 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
3464 "accessibility_display_magnification_enabled";
3465
3466 /**
3467 * Setting that specifies what the display magnification scale is.
3468 * Display magnifications allows the user to zoom in the display
3469 * content and is targeted to low vision users. Whether a display
3470 * magnification is performed is controlled by
3471 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
3472 *
3473 * @hide
3474 */
3475 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
3476 "accessibility_display_magnification_scale";
3477
3478 /**
3479 * Setting that specifies whether the display magnification should be
3480 * automatically updated. If this fearture is enabled the system will
3481 * exit magnification mode or pan the viewport when a context change
3482 * occurs. For example, on staring a new activity or rotating the screen,
3483 * the system may zoom out so the user can see the new context he is in.
3484 * Another example is on showing a window that is not visible in the
3485 * magnified viewport the system may pan the viewport to make the window
3486 * the has popped up so the user knows that the context has changed.
3487 * Whether a screen magnification is performed is controlled by
3488 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
3489 *
3490 * @hide
3491 */
3492 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
3493 "accessibility_display_magnification_auto_update";
3494
3495 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08003496 * The timout for considering a press to be a long press in milliseconds.
3497 * @hide
3498 */
3499 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
3500
3501 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07003502 * Setting to always use the default text-to-speech settings regardless
3503 * of the application settings.
3504 * 1 = override application settings,
3505 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01003506 *
3507 * @deprecated The value of this setting is no longer respected by
3508 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07003509 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003510 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07003511 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
3512
3513 /**
3514 * Default text-to-speech engine speech rate. 100 = 1x
3515 */
3516 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
3517
3518 /**
3519 * Default text-to-speech engine pitch. 100 = 1x
3520 */
3521 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
3522
3523 /**
3524 * Default text-to-speech engine.
3525 */
3526 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
3527
3528 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07003529 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01003530 *
3531 * @deprecated this setting is no longer in use, as of the Ice Cream
3532 * Sandwich release. Apps should never need to read this setting directly,
3533 * instead can query the TextToSpeech framework classes for the default
3534 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07003535 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003536 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07003537 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
3538
3539 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003540 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01003541 *
3542 * @deprecated this setting is no longer in use, as of the Ice Cream
3543 * Sandwich release. Apps should never need to read this setting directly,
3544 * instead can query the TextToSpeech framework classes for the default
3545 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003546 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003547 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003548 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
3549
3550 /**
3551 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01003552 *
3553 * @deprecated this setting is no longer in use, as of the Ice Cream
3554 * Sandwich release. Apps should never need to read this setting directly,
3555 * instead can query the TextToSpeech framework classes for the
3556 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003557 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003558 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003559 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
3560
3561 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01003562 * Stores the default tts locales on a per engine basis. Stored as
3563 * a comma seperated list of values, each value being of the form
3564 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01003565 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
3566 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
3567 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
3568 * setting directly, and can query the TextToSpeech framework classes
3569 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01003570 *
3571 * @hide
3572 */
3573 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
3574
3575 /**
Charles Chenceffa152010-03-16 21:18:10 -07003576 * Space delimited list of plugin packages that are enabled.
3577 */
3578 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
3579
3580 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003581 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
3582 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003583 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003584 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003585 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003586 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Robert Greenwalt8588e472011-11-08 10:12:25 -08003587 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003588 * @deprecated Moved to Global namespace
Robert Greenwalt8588e472011-11-08 10:12:25 -08003589 * {@hide}
3590 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003591 @Deprecated
tk.mun148c7d02011-10-13 22:51:57 +09003592 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003593 Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003594
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003595 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003596 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
3597 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003598 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003599 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003600 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003601 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003602
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003603 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003604 * @deprecated Use {@link android.provider.Settings.Global#WIFI_COUNTRY_CODE}
3605 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003606 * @hide
3607 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003608 @Deprecated
3609 public static final String WIFI_COUNTRY_CODE = Global.WIFI_COUNTRY_CODE;
Irfan Sheriffed4f28b2010-10-29 15:32:10 -07003610
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003611
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003612 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003613 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
3614 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003615 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003616 @Deprecated
3617 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
3618 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003619
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003620 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003621 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
3622 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003623 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003624 @Deprecated
3625 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003626
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003627 /**
Irfan Sheriffa3bd4092010-03-24 17:58:59 -07003628 * Used to save the Wifi_ON state prior to tethering.
3629 * This state will be checked to restore Wifi after
3630 * the user turns off tethering.
Irfan Sheriff5321aef2010-02-12 12:35:59 -08003631 *
3632 * @hide
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003633 * @deprecated moved to Global
Irfan Sheriff5321aef2010-02-12 12:35:59 -08003634 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003635 @Deprecated
3636 public static final String WIFI_SAVED_STATE = Global.WIFI_SAVED_STATE;
Irfan Sheriff5321aef2010-02-12 12:35:59 -08003637
3638 /**
Irfan Sheriff9ab518ad2010-03-12 15:48:17 -08003639 * AP SSID
3640 *
3641 * @hide
3642 */
3643 public static final String WIFI_AP_SSID = "wifi_ap_ssid";
3644
3645 /**
3646 * AP security
3647 *
3648 * @hide
3649 */
3650 public static final String WIFI_AP_SECURITY = "wifi_ap_security";
3651
3652 /**
3653 * AP passphrase
3654 *
3655 * @hide
3656 */
3657 public static final String WIFI_AP_PASSWD = "wifi_ap_passwd";
3658
3659 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003660 * The acceptable packet loss percentage (range 0 - 100) before trying
3661 * another AP on the same network.
3662 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003663 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003664 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
3665 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003666
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003667 /**
3668 * The number of access points required for a network in order for the
3669 * watchdog to monitor it.
3670 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003671 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003672 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003673
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003674 /**
3675 * The delay between background checks.
3676 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003677 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003678 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
3679 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003680
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003681 /**
3682 * Whether the Wi-Fi watchdog is enabled for background checking even
3683 * after it thinks the user has connected to a good access point.
3684 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003685 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003686 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
3687 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003688
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003689 /**
3690 * The timeout for a background ping
3691 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003692 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003693 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
3694 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003695
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003696 /**
3697 * The number of initial pings to perform that *may* be ignored if they
3698 * fail. Again, if these fail, they will *not* be used in packet loss
3699 * calculation. For example, one network always seemed to time out for
3700 * the first couple pings, so this is set to 3 by default.
3701 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003702 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003703 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
3704 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003705
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003706 /**
3707 * The maximum number of access points (per network) to attempt to test.
3708 * If this number is reached, the watchdog will no longer monitor the
3709 * initial connection state for the network. This is a safeguard for
3710 * networks containing multiple APs whose DNS does not respond to pings.
3711 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003712 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003713 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003714
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003715 /**
3716 * Whether the Wi-Fi watchdog is enabled.
3717 */
3718 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
3719
3720 /**
3721 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003722 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003723 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003724 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
3725
3726 /**
3727 * The number of pings to test if an access point is a good connection.
3728 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003729 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003730 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003731
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003732 /**
3733 * The delay between pings.
3734 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003735 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003736 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003737
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003738 /**
3739 * The timeout per ping.
3740 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003741 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003742 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003743
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003744 /**
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003745 * ms delay before rechecking an 'online' wifi connection when it is thought to be unstable.
3746 * @hide
3747 */
Irfan Sheriff07573b32012-01-27 21:00:19 -08003748 public static final String WIFI_WATCHDOG_ARP_CHECK_INTERVAL_MS =
3749 "wifi_watchdog_arp_interval_ms";
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003750
3751 /**
Irfan Sheriff4c8982a2012-03-08 16:11:02 -08003752 * ms delay interval between rssi polling when the signal is known to be weak
3753 * @hide
3754 */
3755 public static final String WIFI_WATCHDOG_RSSI_FETCH_INTERVAL_MS =
3756 "wifi_watchdog_rssi_fetch_interval_ms";
3757
3758
3759 /**
Irfan Sheriff07573b32012-01-27 21:00:19 -08003760 * Number of ARP pings per check.
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003761 * @hide
3762 */
Irfan Sheriff07573b32012-01-27 21:00:19 -08003763 public static final String WIFI_WATCHDOG_NUM_ARP_PINGS = "wifi_watchdog_num_arp_pings";
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003764
3765 /**
Irfan Sheriff07573b32012-01-27 21:00:19 -08003766 * Minimum number of responses to the arp pings to consider the test 'successful'.
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003767 * @hide
3768 */
Irfan Sheriff07573b32012-01-27 21:00:19 -08003769 public static final String WIFI_WATCHDOG_MIN_ARP_RESPONSES =
3770 "wifi_watchdog_min_arp_responses";
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003771
3772 /**
Irfan Sheriff07573b32012-01-27 21:00:19 -08003773 * Timeout on ARP pings
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003774 * @hide
3775 */
Irfan Sheriff07573b32012-01-27 21:00:19 -08003776 public static final String WIFI_WATCHDOG_ARP_PING_TIMEOUT_MS =
3777 "wifi_watchdog_arp_ping_timeout_ms";
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003778
3779 /**
Irfan Sheriff07573b32012-01-27 21:00:19 -08003780 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
3781 * the setting needs to be set to 0 to disable it.
Irfan Sheriff19380da2011-12-06 14:41:14 -08003782 * @hide
3783 */
3784 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
3785 "wifi_watchdog_poor_network_test_enabled";
3786
3787 /**
Irfan Sheriff3fb4ba62012-08-09 15:07:45 -07003788 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
3789 * needs to be set to 0 to disable it.
3790 * @hide
3791 */
3792 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
3793 "wifi_suspend_optimizations_enabled";
3794
3795 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003796 * @deprecated Use
3797 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003798 */
Christopher Tate06efb532012-08-24 15:29:27 -07003799 @Deprecated
3800 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003801
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003802 /**
Irfan Sheriff36f74132010-11-04 16:57:37 -07003803 * The operational wifi frequency band
3804 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
3805 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
3806 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
3807 *
3808 * @hide
3809 */
3810 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
3811
3812 /**
Irfan Sheriff2bdefca2012-04-25 16:40:14 -07003813 * The Wi-Fi peer-to-peer device name
3814 * @hide
3815 */
3816 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
3817
3818 /**
Irfan Sheriffda6da092012-08-16 12:49:23 -07003819 * Setting to turn off captive portal detection. Feature is enabled by default and
3820 * the setting needs to be set to 0 to disable it.
3821 * @hide
3822 */
3823 public static final String CAPTIVE_PORTAL_DETECTION_ENABLED =
3824 "captive_portal_detection_enabled";
3825
3826 /**
3827 * The server used for captive portal detection upon a new conection. A 204 response
3828 * code from the server is used for validation.
3829 * @hide
3830 */
3831 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
3832
3833 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003834 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
3835 * data connectivity to be established after a disconnect from Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003836 */
3837 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
3838 "wifi_mobile_data_transition_wakelock_timeout_ms";
3839
3840 /**
Irfan Sheriff3ef889b2012-04-17 23:15:29 -07003841 * Whether network service discovery is enabled.
3842 * @hide
3843 */
3844 public static final String NSD_ON = "nsd_on";
3845
3846 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003847 * Whether background data usage is allowed by the user. See
3848 * ConnectivityManager for more info.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003849 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07003850 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003851 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07003852
3853 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00003854 * Origins for which browsers should allow geolocation by default.
3855 * The value is a space-separated list of origins.
3856 */
3857 public static final String ALLOWED_GEOLOCATION_ORIGINS
3858 = "allowed_geolocation_origins";
3859
3860 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003861 * @deprecated Use {@link android.provider.Settings.Global#MOBILE_DATA} instead
Robert Greenwaltc03fa502010-02-23 18:58:05 -08003862 * @hide
3863 */
Christopher Tate06efb532012-08-24 15:29:27 -07003864 @Deprecated
3865 public static final String MOBILE_DATA = Global.MOBILE_DATA;
Robert Greenwaltc03fa502010-02-23 18:58:05 -08003866
3867 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003868 * @deprecated Use {@link android.provider.Settings.Global#CDMA_ROAMING_MODE} instead
Wink Saville04e71b32009-04-02 11:00:54 -07003869 * @hide
3870 */
Christopher Tate06efb532012-08-24 15:29:27 -07003871 @Deprecated
3872 public static final String CDMA_ROAMING_MODE = Global.CDMA_ROAMING_MODE;
Wink Saville04e71b32009-04-02 11:00:54 -07003873
3874 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003875 * @deprecated Use {@link android.provider.Settings.Global#CDMA_ROAMING_MODE} instead
Wink Saville04e71b32009-04-02 11:00:54 -07003876 * @hide
3877 */
Christopher Tate06efb532012-08-24 15:29:27 -07003878 @Deprecated
3879 public static final String CDMA_SUBSCRIPTION_MODE = Global.CDMA_SUBSCRIPTION_MODE;
Wink Saville04e71b32009-04-02 11:00:54 -07003880
3881 /**
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003882 * The preferred network mode 7 = Global
3883 * 6 = EvDo only
3884 * 5 = CDMA w/o EvDo
3885 * 4 = CDMA / EvDo auto
3886 * 3 = GSM / WCDMA auto
3887 * 2 = WCDMA only
3888 * 1 = GSM only
3889 * 0 = GSM / WCDMA preferred
Wink Saville04e71b32009-04-02 11:00:54 -07003890 * @hide
3891 */
3892 public static final String PREFERRED_NETWORK_MODE =
3893 "preferred_network_mode";
3894
3895 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07003896 * The preferred TTY mode 0 = TTy Off, CDMA default
3897 * 1 = TTY Full
3898 * 2 = TTY HCO
3899 * 3 = TTY VCO
3900 * @hide
3901 */
3902 public static final String PREFERRED_TTY_MODE =
3903 "preferred_tty_mode";
3904
3905
3906 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003907 * @deprecated Use {@link android.provider.Settings.Global#CDMA_CELL_BROADCAST_SMS} instead
Wink Saville04e71b32009-04-02 11:00:54 -07003908 * @hide
3909 */
Christopher Tate06efb532012-08-24 15:29:27 -07003910 @Deprecated
3911 public static final String CDMA_CELL_BROADCAST_SMS = Global.CDMA_CELL_BROADCAST_SMS;
Wink Saville04e71b32009-04-02 11:00:54 -07003912
3913 /**
3914 * The cdma subscription 0 = Subscription from RUIM, when available
3915 * 1 = Subscription from NV
3916 * @hide
3917 */
3918 public static final String PREFERRED_CDMA_SUBSCRIPTION =
3919 "preferred_cdma_subscription";
3920
3921 /**
3922 * Whether the enhanced voice privacy mode is enabled.
3923 * 0 = normal voice privacy
3924 * 1 = enhanced voice privacy
3925 * @hide
3926 */
3927 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
3928
3929 /**
3930 * Whether the TTY mode mode is enabled.
3931 * 0 = disabled
3932 * 1 = enabled
3933 * @hide
3934 */
3935 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003936
3937 /**
Wink Saville628b0852011-08-04 15:01:58 -07003938 * The number of milliseconds to delay before sending out Connectivyt Change broadcasts
3939 * @hide
3940 */
3941 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
3942
3943 /**
3944 * Default value for CONNECTIVITY_CHANGE_DELAY in milliseconds.
3945 * @hide
3946 */
3947 public static final int CONNECTIVITY_CHANGE_DELAY_DEFAULT = 3000;
3948
3949 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07003950 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07003951 * Type: int ( 0 = disabled, 1 = enabled )
3952 * @hide
3953 */
3954 public static final String BACKUP_ENABLED = "backup_enabled";
3955
3956 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08003957 * Controls whether application data is automatically restored from backup
3958 * at install time.
3959 * Type: int ( 0 = disabled, 1 = enabled )
3960 * @hide
3961 */
3962 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
3963
3964 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07003965 * Indicates whether settings backup has been fully provisioned.
3966 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
3967 * @hide
3968 */
3969 public static final String BACKUP_PROVISIONED = "backup_provisioned";
3970
3971 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07003972 * Component of the transport to use for backup/restore.
3973 * @hide
3974 */
3975 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07003976
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07003977 /**
3978 * Version for which the setup wizard was last shown. Bumped for
3979 * each release when there is new setup information to show.
3980 * @hide
3981 */
3982 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07003983
3984 /**
Doug Zongkerf6888892010-01-06 16:38:14 -08003985 * How frequently (in seconds) to check the memory status of the
3986 * device.
3987 * @hide
3988 */
3989 public static final String MEMCHECK_INTERVAL = "memcheck_interval";
3990
3991 /**
3992 * Max frequency (in seconds) to log memory check stats, in realtime
3993 * seconds. This allows for throttling of logs when the device is
3994 * running for large amounts of time.
3995 * @hide
3996 */
3997 public static final String MEMCHECK_LOG_REALTIME_INTERVAL =
3998 "memcheck_log_realtime_interval";
3999
4000 /**
4001 * Boolean indicating whether rebooting due to system memory checks
4002 * is enabled.
4003 * @hide
4004 */
4005 public static final String MEMCHECK_SYSTEM_ENABLED = "memcheck_system_enabled";
4006
4007 /**
4008 * How many bytes the system process must be below to avoid scheduling
4009 * a soft reboot. This reboot will happen when it is next determined
4010 * to be a good time.
4011 * @hide
4012 */
4013 public static final String MEMCHECK_SYSTEM_SOFT_THRESHOLD = "memcheck_system_soft";
4014
4015 /**
4016 * How many bytes the system process must be below to avoid scheduling
4017 * a hard reboot. This reboot will happen immediately.
4018 * @hide
4019 */
4020 public static final String MEMCHECK_SYSTEM_HARD_THRESHOLD = "memcheck_system_hard";
4021
4022 /**
4023 * How many bytes the phone process must be below to avoid scheduling
4024 * a soft restart. This restart will happen when it is next determined
4025 * to be a good time.
4026 * @hide
4027 */
4028 public static final String MEMCHECK_PHONE_SOFT_THRESHOLD = "memcheck_phone_soft";
4029
4030 /**
4031 * How many bytes the phone process must be below to avoid scheduling
4032 * a hard restart. This restart will happen immediately.
4033 * @hide
4034 */
4035 public static final String MEMCHECK_PHONE_HARD_THRESHOLD = "memcheck_phone_hard";
4036
4037 /**
4038 * Boolean indicating whether restarting the phone process due to
4039 * memory checks is enabled.
4040 * @hide
4041 */
4042 public static final String MEMCHECK_PHONE_ENABLED = "memcheck_phone_enabled";
4043
4044 /**
4045 * First time during the day it is okay to kill processes
4046 * or reboot the device due to low memory situations. This number is
4047 * in seconds since midnight.
4048 * @hide
4049 */
4050 public static final String MEMCHECK_EXEC_START_TIME = "memcheck_exec_start_time";
4051
4052 /**
4053 * Last time during the day it is okay to kill processes
4054 * or reboot the device due to low memory situations. This number is
4055 * in seconds since midnight.
4056 * @hide
4057 */
4058 public static final String MEMCHECK_EXEC_END_TIME = "memcheck_exec_end_time";
4059
4060 /**
4061 * How long the screen must have been off in order to kill processes
4062 * or reboot. This number is in seconds. A value of -1 means to
4063 * entirely disregard whether the screen is on.
4064 * @hide
4065 */
4066 public static final String MEMCHECK_MIN_SCREEN_OFF = "memcheck_min_screen_off";
4067
4068 /**
4069 * How much time there must be until the next alarm in order to kill processes
4070 * or reboot. This number is in seconds. Note: this value must be
4071 * smaller than {@link #MEMCHECK_RECHECK_INTERVAL} or else it will
4072 * always see an alarm scheduled within its time.
4073 * @hide
4074 */
4075 public static final String MEMCHECK_MIN_ALARM = "memcheck_min_alarm";
4076
4077 /**
4078 * How frequently to check whether it is a good time to restart things,
4079 * if the device is in a bad state. This number is in seconds. Note:
4080 * this value must be larger than {@link #MEMCHECK_MIN_ALARM} or else
4081 * the alarm to schedule the recheck will always appear within the
4082 * minimum "do not execute now" time.
4083 * @hide
4084 */
4085 public static final String MEMCHECK_RECHECK_INTERVAL = "memcheck_recheck_interval";
4086
4087 /**
4088 * How frequently (in DAYS) to reboot the device. If 0, no reboots
4089 * will occur.
4090 * @hide
4091 */
4092 public static final String REBOOT_INTERVAL = "reboot_interval";
4093
4094 /**
4095 * First time during the day it is okay to force a reboot of the
4096 * device (if REBOOT_INTERVAL is set). This number is
4097 * in seconds since midnight.
4098 * @hide
4099 */
4100 public static final String REBOOT_START_TIME = "reboot_start_time";
4101
4102 /**
4103 * The window of time (in seconds) after each REBOOT_INTERVAL in which
4104 * a reboot can be executed. If 0, a reboot will always be executed at
4105 * exactly the given time. Otherwise, it will only be executed if
4106 * the device is idle within the window.
4107 * @hide
4108 */
4109 public static final String REBOOT_WINDOW = "reboot_window";
4110
4111 /**
Doug Zongker43866e02010-01-07 12:09:54 -08004112 * Threshold values for the duration and level of a discharge cycle, under
4113 * which we log discharge cycle info.
4114 * @hide
4115 */
4116 public static final String BATTERY_DISCHARGE_DURATION_THRESHOLD =
4117 "battery_discharge_duration_threshold";
4118 /** @hide */
4119 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
4120
4121 /**
4122 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR intents
4123 * on application crashes and ANRs. If this is disabled, the crash/ANR dialog
4124 * will never display the "Report" button.
4125 * Type: int ( 0 = disallow, 1 = allow )
4126 * @hide
4127 */
4128 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
4129
4130 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004131 * @deprecated Use {@link android.provider.Settings.Global#WTF_IS_FATAL} instead
Doug Zongker43866e02010-01-07 12:09:54 -08004132 * @hide
4133 */
Christopher Tate06efb532012-08-24 15:29:27 -07004134 @Deprecated
4135 public static final String WTF_IS_FATAL = Global.WTF_IS_FATAL;
Doug Zongker43866e02010-01-07 12:09:54 -08004136
4137 /**
Jake Hambybb371632010-08-23 18:16:48 -07004138 * Maximum age of entries kept by {@link com.android.internal.os.IDropBoxManagerService}.
Doug Zongker43866e02010-01-07 12:09:54 -08004139 * @hide
4140 */
4141 public static final String DROPBOX_AGE_SECONDS =
4142 "dropbox_age_seconds";
4143 /**
Jake Hambybb371632010-08-23 18:16:48 -07004144 * Maximum number of entry files which {@link com.android.internal.os.IDropBoxManagerService} will keep around.
Dan Egnor3a8b0c12010-03-24 17:48:20 -07004145 * @hide
4146 */
4147 public static final String DROPBOX_MAX_FILES =
4148 "dropbox_max_files";
4149 /**
Jake Hambybb371632010-08-23 18:16:48 -07004150 * Maximum amount of disk space used by {@link com.android.internal.os.IDropBoxManagerService} no matter what.
Doug Zongker43866e02010-01-07 12:09:54 -08004151 * @hide
4152 */
4153 public static final String DROPBOX_QUOTA_KB =
4154 "dropbox_quota_kb";
4155 /**
Jake Hambybb371632010-08-23 18:16:48 -07004156 * Percent of free disk (excluding reserve) which {@link com.android.internal.os.IDropBoxManagerService} will use.
Doug Zongker43866e02010-01-07 12:09:54 -08004157 * @hide
4158 */
4159 public static final String DROPBOX_QUOTA_PERCENT =
4160 "dropbox_quota_percent";
4161 /**
Jake Hambybb371632010-08-23 18:16:48 -07004162 * Percent of total disk which {@link com.android.internal.os.IDropBoxManagerService} will never dip into.
Doug Zongker43866e02010-01-07 12:09:54 -08004163 * @hide
4164 */
4165 public static final String DROPBOX_RESERVE_PERCENT =
4166 "dropbox_reserve_percent";
4167 /**
4168 * Prefix for per-tag dropbox disable/enable settings.
4169 * @hide
4170 */
4171 public static final String DROPBOX_TAG_PREFIX =
4172 "dropbox:";
Dan Egnora455d192010-03-12 08:52:28 -08004173 /**
4174 * Lines of logcat to include with system crash/ANR/etc. reports,
4175 * as a prefix of the dropbox tag of the report type.
4176 * For example, "logcat_for_system_server_anr" controls the lines
4177 * of logcat captured with system server ANR reports. 0 to disable.
4178 * @hide
4179 */
4180 public static final String ERROR_LOGCAT_PREFIX =
4181 "logcat_for_";
Doug Zongker43866e02010-01-07 12:09:54 -08004182
4183
4184 /**
4185 * Screen timeout in milliseconds corresponding to the
4186 * PowerManager's POKE_LOCK_SHORT_TIMEOUT flag (i.e. the fastest
4187 * possible screen timeout behavior.)
4188 * @hide
4189 */
4190 public static final String SHORT_KEYLIGHT_DELAY_MS =
4191 "short_keylight_delay_ms";
4192
4193 /**
4194 * The interval in minutes after which the amount of free storage left on the
4195 * device is logged to the event log
4196 * @hide
4197 */
4198 public static final String SYS_FREE_STORAGE_LOG_INTERVAL =
4199 "sys_free_storage_log_interval";
4200
4201 /**
4202 * Threshold for the amount of change in disk free space required to report the amount of
4203 * free space. Used to prevent spamming the logs when the disk free space isn't changing
4204 * frequently.
4205 * @hide
4206 */
4207 public static final String DISK_FREE_CHANGE_REPORTING_THRESHOLD =
4208 "disk_free_change_reporting_threshold";
4209
4210
4211 /**
4212 * Minimum percentage of free storage on the device that is used to determine if
Dianne Hackborn247fe742011-01-08 17:25:57 -08004213 * the device is running low on storage. The default is 10.
4214 * <p>Say this value is set to 10, the device is considered running low on storage
Doug Zongker43866e02010-01-07 12:09:54 -08004215 * if 90% or more of the device storage is filled up.
4216 * @hide
4217 */
4218 public static final String SYS_STORAGE_THRESHOLD_PERCENTAGE =
4219 "sys_storage_threshold_percentage";
4220
4221 /**
Dianne Hackborn247fe742011-01-08 17:25:57 -08004222 * Maximum byte size of the low storage threshold. This is to ensure
4223 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in
4224 * an overly large threshold for large storage devices. Currently this
4225 * must be less than 2GB. This default is 500MB.
4226 * @hide
4227 */
4228 public static final String SYS_STORAGE_THRESHOLD_MAX_BYTES =
4229 "sys_storage_threshold_max_bytes";
4230
4231 /**
Jake Hambybb371632010-08-23 18:16:48 -07004232 * Minimum bytes of free storage on the device before the data
4233 * partition is considered full. By default, 1 MB is reserved
4234 * to avoid system-wide SQLite disk full exceptions.
4235 * @hide
4236 */
4237 public static final String SYS_STORAGE_FULL_THRESHOLD_BYTES =
4238 "sys_storage_full_threshold_bytes";
4239
4240 /**
Doug Zongker43866e02010-01-07 12:09:54 -08004241 * The interval in milliseconds after which Wi-Fi is considered idle.
4242 * When idle, it is possible for the device to be switched from Wi-Fi to
4243 * the mobile data network.
4244 * @hide
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004245 * @deprecated Moved to Global
Doug Zongker43866e02010-01-07 12:09:54 -08004246 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004247 @Deprecated
4248 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08004249
4250 /**
Irfan Sheriff2b7f6382011-03-25 14:29:19 -07004251 * The interval in milliseconds to issue wake up scans when wifi needs
4252 * to connect. This is necessary to connect to an access point when
4253 * device is on the move and the screen is off.
Irfan Sheriff4f5f7c92010-10-14 17:01:27 -07004254 * @hide
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004255 * @deprecated Moved to Global
Irfan Sheriff4f5f7c92010-10-14 17:01:27 -07004256 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004257 @Deprecated
Irfan Sheriff2b7f6382011-03-25 14:29:19 -07004258 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004259 Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS;
Irfan Sheriff2b7f6382011-03-25 14:29:19 -07004260
4261 /**
4262 * The interval in milliseconds to scan as used by the wifi supplicant
4263 * @hide
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004264 * @deprecated Moved to Global
Irfan Sheriff2b7f6382011-03-25 14:29:19 -07004265 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004266 @Deprecated
Irfan Sheriff2b7f6382011-03-25 14:29:19 -07004267 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004268 Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS;
Irfan Sheriff4f5f7c92010-10-14 17:01:27 -07004269
4270 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004271 * @deprecated Moved to Settings.Global
Doug Zongkeredc51892010-01-07 13:51:16 -08004272 * @hide
4273 */
Christopher Tate06efb532012-08-24 15:29:27 -07004274 @Deprecated
Doug Zongkeredc51892010-01-07 13:51:16 -08004275 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07004276 Global.PDP_WATCHDOG_POLL_INTERVAL_MS;
Doug Zongkeredc51892010-01-07 13:51:16 -08004277
4278 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004279 * @deprecated Moved to Settings.Global
Doug Zongkeredc51892010-01-07 13:51:16 -08004280 * @hide
4281 */
Christopher Tate06efb532012-08-24 15:29:27 -07004282 @Deprecated
Doug Zongkeredc51892010-01-07 13:51:16 -08004283 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07004284 Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS;
Doug Zongkeredc51892010-01-07 13:51:16 -08004285
4286 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004287 * @deprecated Moved to Settings.Global
Doug Zongkeredc51892010-01-07 13:51:16 -08004288 * @hide
4289 */
Christopher Tate06efb532012-08-24 15:29:27 -07004290 @Deprecated
Doug Zongkeredc51892010-01-07 13:51:16 -08004291 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07004292 Global.PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS;
Doug Zongkeredc51892010-01-07 13:51:16 -08004293
4294 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004295 * @deprecated Moved to Settings.Global
Doug Zongkeredc51892010-01-07 13:51:16 -08004296 * @hide
4297 */
Christopher Tate06efb532012-08-24 15:29:27 -07004298 @Deprecated
Doug Zongkeredc51892010-01-07 13:51:16 -08004299 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
Christopher Tate06efb532012-08-24 15:29:27 -07004300 Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT;
Doug Zongkeredc51892010-01-07 13:51:16 -08004301
4302 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004303 * @deprecated Moved to Settings.Global
Doug Zongkeredc51892010-01-07 13:51:16 -08004304 * @hide
4305 */
Christopher Tate06efb532012-08-24 15:29:27 -07004306 @Deprecated
Doug Zongkeredc51892010-01-07 13:51:16 -08004307 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
Christopher Tate06efb532012-08-24 15:29:27 -07004308 Global.PDP_WATCHDOG_ERROR_POLL_COUNT;
Doug Zongkeredc51892010-01-07 13:51:16 -08004309
4310 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004311 * @deprecated Moved to Settings.Global
Doug Zongkeredc51892010-01-07 13:51:16 -08004312 * @hide
4313 */
Christopher Tate06efb532012-08-24 15:29:27 -07004314 @Deprecated
Doug Zongkeredc51892010-01-07 13:51:16 -08004315 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
Christopher Tate06efb532012-08-24 15:29:27 -07004316 Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT;
Doug Zongkeredc51892010-01-07 13:51:16 -08004317
4318 /**
Christopher Tatec868b642012-09-12 17:41:04 -07004319 * @deprecated Moved to Settings.Global
Wink Saville2861d232011-11-03 18:52:58 -07004320 * @hide
4321 */
Christopher Tatec868b642012-09-12 17:41:04 -07004322 @Deprecated
Kazuhiro Ondo7efb89b2011-12-21 20:54:03 -06004323 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
Christopher Tatec868b642012-09-12 17:41:04 -07004324 Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS;
Kazuhiro Ondo7efb89b2011-12-21 20:54:03 -06004325
4326 /**
Christopher Tatec868b642012-09-12 17:41:04 -07004327 * @deprecated Moved to Settings.Global
Kazuhiro Ondo7efb89b2011-12-21 20:54:03 -06004328 * @hide
4329 */
Christopher Tatec868b642012-09-12 17:41:04 -07004330 @Deprecated
Kazuhiro Ondo7efb89b2011-12-21 20:54:03 -06004331 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
Christopher Tatec868b642012-09-12 17:41:04 -07004332 Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS;
Wink Saville2861d232011-11-03 18:52:58 -07004333
4334 /**
Christopher Tatec868b642012-09-12 17:41:04 -07004335 * @deprecated Moved to Settings.Global
Doug Zongkeredc51892010-01-07 13:51:16 -08004336 * @hide
4337 */
Christopher Tatec868b642012-09-12 17:41:04 -07004338 @Deprecated
Doug Zongkeredc51892010-01-07 13:51:16 -08004339 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
Christopher Tatec868b642012-09-12 17:41:04 -07004340 Global.GPRS_REGISTER_CHECK_PERIOD_MS;
Doug Zongkeredc51892010-01-07 13:51:16 -08004341
4342 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004343 * @deprecated Use {@link android.provider.Settings.Global#NITZ_UPDATE_SPACING} instead
Doug Zongkeredc51892010-01-07 13:51:16 -08004344 * @hide
4345 */
Christopher Tate06efb532012-08-24 15:29:27 -07004346 public static final String NITZ_UPDATE_SPACING = Global.NITZ_UPDATE_SPACING;
Doug Zongkeredc51892010-01-07 13:51:16 -08004347
4348 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004349 * @deprecated Use {@link android.provider.Settings.Global#NITZ_UPDATE_SPACING} instead
Doug Zongkeredc51892010-01-07 13:51:16 -08004350 * @hide
4351 */
Christopher Tate06efb532012-08-24 15:29:27 -07004352 public static final String NITZ_UPDATE_DIFF = Global.NITZ_UPDATE_DIFF;
Doug Zongkeredc51892010-01-07 13:51:16 -08004353
4354 /**
4355 * The maximum reconnect delay for short network outages or when the network is suspended
4356 * due to phone use.
4357 * @hide
4358 */
4359 public static final String SYNC_MAX_RETRY_DELAY_IN_SECONDS =
4360 "sync_max_retry_delay_in_seconds";
4361
4362 /**
Jake Hamby76a61422012-09-06 17:40:21 -07004363 * @deprecated Use {@link Settings.Global#SMS_OUTGOING_CHECK_INTERVAL_MS} instead.
Doug Zongkeredc51892010-01-07 13:51:16 -08004364 * @hide
4365 */
4366 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
Jake Hamby76a61422012-09-06 17:40:21 -07004367 Global.SMS_OUTGOING_CHECK_INTERVAL_MS;
Doug Zongkeredc51892010-01-07 13:51:16 -08004368
4369 /**
Jake Hamby76a61422012-09-06 17:40:21 -07004370 * @deprecated Use {@link Settings.Global#SMS_OUTGOING_CHECK_MAX_COUNT} instead.
Doug Zongkeredc51892010-01-07 13:51:16 -08004371 * @hide
4372 */
4373 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
Jake Hamby76a61422012-09-06 17:40:21 -07004374 Global.SMS_OUTGOING_CHECK_MAX_COUNT;
Doug Zongkeredc51892010-01-07 13:51:16 -08004375
4376 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01004377 * The global search provider chosen by the user (if multiple global
4378 * search providers are installed). This will be the provider returned
4379 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
4380 * installed. This setting is stored as a flattened component name as
4381 * per {@link ComponentName#flattenToString()}.
4382 *
4383 * @hide
4384 */
4385 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
4386 "search_global_search_activity";
4387
4388 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08004389 * The number of promoted sources in GlobalSearch.
4390 * @hide
4391 */
4392 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
4393 /**
4394 * The maximum number of suggestions returned by GlobalSearch.
4395 * @hide
4396 */
4397 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
4398 /**
4399 * The number of suggestions GlobalSearch will ask each non-web search source for.
4400 * @hide
4401 */
4402 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
4403 /**
4404 * The number of suggestions the GlobalSearch will ask the web search source for.
4405 * @hide
4406 */
4407 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
4408 "search_web_results_override_limit";
4409 /**
4410 * The number of milliseconds that GlobalSearch will wait for suggestions from
4411 * promoted sources before continuing with all other sources.
4412 * @hide
4413 */
4414 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
4415 "search_promoted_source_deadline_millis";
4416 /**
4417 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
4418 * @hide
4419 */
4420 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
4421 /**
4422 * The maximum number of milliseconds that GlobalSearch shows the previous results
4423 * after receiving a new query.
4424 * @hide
4425 */
4426 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
4427 /**
4428 * The maximum age of log data used for shortcuts in GlobalSearch.
4429 * @hide
4430 */
4431 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
4432 /**
4433 * The maximum age of log data used for source ranking in GlobalSearch.
4434 * @hide
4435 */
4436 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
4437 "search_max_source_event_age_millis";
4438 /**
4439 * The minimum number of impressions needed to rank a source in GlobalSearch.
4440 * @hide
4441 */
4442 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
4443 "search_min_impressions_for_source_ranking";
4444 /**
4445 * The minimum number of clicks needed to rank a source in GlobalSearch.
4446 * @hide
4447 */
4448 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
4449 "search_min_clicks_for_source_ranking";
4450 /**
4451 * The maximum number of shortcuts shown by GlobalSearch.
4452 * @hide
4453 */
4454 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
4455 /**
4456 * The size of the core thread pool for suggestion queries in GlobalSearch.
4457 * @hide
4458 */
4459 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
4460 "search_query_thread_core_pool_size";
4461 /**
4462 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
4463 * @hide
4464 */
4465 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
4466 "search_query_thread_max_pool_size";
4467 /**
4468 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
4469 * @hide
4470 */
4471 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
4472 "search_shortcut_refresh_core_pool_size";
4473 /**
4474 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
4475 * @hide
4476 */
4477 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
4478 "search_shortcut_refresh_max_pool_size";
4479 /**
4480 * The maximun time that excess threads in the GlobalSeach thread pools will
4481 * wait before terminating.
4482 * @hide
4483 */
4484 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
4485 "search_thread_keepalive_seconds";
4486 /**
4487 * The maximum number of concurrent suggestion queries to each source.
4488 * @hide
4489 */
4490 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
4491 "search_per_source_concurrent_query_limit";
4492
San Mehat87734d32010-01-08 12:53:06 -08004493 /**
4494 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
4495 * @hide
4496 */
4497 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
4498
4499 /**
4500 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
4501 * @hide
4502 */
4503 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
4504
4505 /**
4506 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
4507 * @hide
4508 */
4509 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
4510
4511 /**
4512 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
4513 * @hide
4514 */
4515 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08004516
Dan Egnor42471dd2010-01-07 17:25:22 -08004517 /**
4518 * If nonzero, ANRs in invisible background processes bring up a dialog.
4519 * Otherwise, the process will be silently killed.
4520 * @hide
4521 */
4522 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08004523
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08004524 /**
4525 * The {@link ComponentName} string of the service to be used as the voice recognition
4526 * service.
Erikeebc8e22010-02-18 13:27:19 -08004527 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08004528 * @hide
4529 */
4530 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08004531
satok988323c2011-06-22 16:38:13 +09004532
4533 /**
satokada8c4e2011-08-23 14:56:56 +09004534 * The {@link ComponentName} string of the selected spell checker service which is
4535 * one of the services managed by the text service manager.
4536 *
4537 * @hide
4538 */
4539 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
4540
4541 /**
4542 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09004543 * service which is one of the services managed by the text service manager.
4544 *
4545 * @hide
4546 */
satokada8c4e2011-08-23 14:56:56 +09004547 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
4548 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09004549
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08004550 /**
satoka33c4fc2011-08-25 16:50:11 +09004551 * The {@link ComponentName} string whether spell checker is enabled or not.
4552 *
4553 * @hide
4554 */
4555 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
4556
4557 /**
David Brown458e8062010-03-08 21:52:11 -08004558 * What happens when the user presses the Power button while in-call
4559 * and the screen is on.<br/>
4560 * <b>Values:</b><br/>
4561 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
4562 * 2 - The Power button hangs up the current call.<br/>
4563 *
4564 * @hide
4565 */
4566 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
4567
4568 /**
4569 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
4570 * @hide
4571 */
4572 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
4573
4574 /**
4575 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
4576 * @hide
4577 */
4578 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
4579
4580 /**
4581 * INCALL_POWER_BUTTON_BEHAVIOR default value.
4582 * @hide
4583 */
4584 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
4585 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
4586
4587 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07004588 * The current night mode that has been selected by the user. Owned
4589 * and controlled by UiModeManagerService. Constants are as per
4590 * UiModeManager.
4591 * @hide
4592 */
4593 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07004594
4595 /**
4596 * Let user pick default install location.
4597 * @hide
4598 */
4599 public static final String SET_INSTALL_LOCATION = "set_install_location";
4600
4601 /**
4602 * Default install location value.
4603 * 0 = auto, let system decide
4604 * 1 = internal
4605 * 2 = sdcard
4606 * @hide
4607 */
4608 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07004609
4610 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004611 * @deprecated Use {@link android.provider.Settings.Global#THROTTLE_POLLING_SEC} instead
Robert Greenwalt9e696c22010-04-01 14:45:18 -07004612 * @hide
4613 */
Christopher Tate06efb532012-08-24 15:29:27 -07004614 @Deprecated
4615 public static final String THROTTLE_POLLING_SEC = Global.THROTTLE_POLLING_SEC;
Robert Greenwalt9e696c22010-04-01 14:45:18 -07004616
4617 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004618 * @deprecated Use {@link android.provider.Settings.Global#THROTTLE_THRESHOLD_BYTES} instead
Robert Greenwalt9e696c22010-04-01 14:45:18 -07004619 * @hide
4620 */
Christopher Tate06efb532012-08-24 15:29:27 -07004621 @Deprecated
4622 public static final String THROTTLE_THRESHOLD_BYTES = Global.THROTTLE_THRESHOLD_BYTES;
Robert Greenwalt9e696c22010-04-01 14:45:18 -07004623
4624 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004625 * @deprecated Use {@link android.provider.Settings.Global#THROTTLE_VALUE_KBITSPS} instead
Robert Greenwalt9e696c22010-04-01 14:45:18 -07004626 * @hide
4627 */
Christopher Tate06efb532012-08-24 15:29:27 -07004628 @Deprecated
4629 public static final String THROTTLE_VALUE_KBITSPS = Global.THROTTLE_VALUE_KBITSPS;
Robert Greenwalt9e696c22010-04-01 14:45:18 -07004630
4631 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004632 * @deprecated Use {@link android.provider.Settings.Global#THROTTLE_VALUE_KBITSPS} instead
Robert Greenwalt9e696c22010-04-01 14:45:18 -07004633 * @hide
4634 */
Christopher Tate06efb532012-08-24 15:29:27 -07004635 @Deprecated
4636 public static final String THROTTLE_RESET_DAY = Global.THROTTLE_RESET_DAY;
Robert Greenwalt9e696c22010-04-01 14:45:18 -07004637
4638 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004639 * @deprecated Use {@link android.provider.Settings.Global#THROTTLE_NOTIFICATION_TYPE} instead
Robert Greenwalt9e696c22010-04-01 14:45:18 -07004640 * @hide
4641 */
Christopher Tate06efb532012-08-24 15:29:27 -07004642 @Deprecated
4643 public static final String THROTTLE_NOTIFICATION_TYPE = Global.THROTTLE_NOTIFICATION_TYPE;
Robert Greenwalt9e696c22010-04-01 14:45:18 -07004644
4645 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004646 * @deprecated Use {@link android.provider.Settings.Global#THROTTLE_HELP_URI} instead
Irfan Sheriffc9b68512010-04-08 14:12:33 -07004647 * @hide
4648 */
Christopher Tate06efb532012-08-24 15:29:27 -07004649 @Deprecated
4650 public static final String THROTTLE_HELP_URI = Global.THROTTLE_HELP_URI;
Irfan Sheriffc9b68512010-04-08 14:12:33 -07004651
Robert Greenwaltd1055a22010-05-25 15:54:52 -07004652 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004653 * @deprecated Use {@link android.provider.Settings.Global#THROTTLE_MAX_NTP_CACHE_AGE_SEC} instead
Robert Greenwaltd1055a22010-05-25 15:54:52 -07004654 * @hide
4655 */
Christopher Tate06efb532012-08-24 15:29:27 -07004656 @Deprecated
Robert Greenwaltd1055a22010-05-25 15:54:52 -07004657 public static final String THROTTLE_MAX_NTP_CACHE_AGE_SEC =
Christopher Tate06efb532012-08-24 15:29:27 -07004658 Global.THROTTLE_MAX_NTP_CACHE_AGE_SEC;
Robert Greenwaltd1055a22010-05-25 15:54:52 -07004659
Steve Howard9c4e33e2010-07-28 15:59:29 -07004660 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004661 * @deprecated Use {@link android.provider.Settings.Global#DOWNLOAD_MAX_BYTES_OVER_MOBILE} instead
Steve Howard9c4e33e2010-07-28 15:59:29 -07004662 * @hide
4663 */
Christopher Tate06efb532012-08-24 15:29:27 -07004664 @Deprecated
Steve Howard9c4e33e2010-07-28 15:59:29 -07004665 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
Christopher Tate06efb532012-08-24 15:29:27 -07004666 Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE;
Steve Howard9c4e33e2010-07-28 15:59:29 -07004667
Robert Greenwaltd7085fc2010-09-08 15:24:47 -07004668 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004669 * @deprecated Use {@link android.provider.Settings.Global#DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE} instead
Steve Howardf1766812010-09-17 16:46:19 -07004670 * @hide
4671 */
Christopher Tate06efb532012-08-24 15:29:27 -07004672 @Deprecated
Steve Howardf1766812010-09-17 16:46:19 -07004673 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
Christopher Tate06efb532012-08-24 15:29:27 -07004674 Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE;
Steve Howardf1766812010-09-17 16:46:19 -07004675
4676 /**
Robert Greenwaltd7085fc2010-09-08 15:24:47 -07004677 * ms during which to consume extra events related to Inet connection condition
4678 * after a transtion to fully-connected
4679 * @hide
4680 */
4681 public static final String INET_CONDITION_DEBOUNCE_UP_DELAY =
4682 "inet_condition_debounce_up_delay";
4683
4684 /**
4685 * ms during which to consume extra events related to Inet connection condtion
4686 * after a transtion to partly-connected
4687 * @hide
4688 */
4689 public static final String INET_CONDITION_DEBOUNCE_DOWN_DELAY =
4690 "inet_condition_debounce_down_delay";
Irfan Sheriffc9b68512010-04-08 14:12:33 -07004691
4692 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004693 * @deprecated Use {@link android.provider.Settings.Global#SETUP_PREPAID_DATA_SERVICE_URL} instead
Freeman Ng96be4e02011-04-07 18:21:40 -07004694 * @hide
4695 */
Christopher Tate06efb532012-08-24 15:29:27 -07004696 @Deprecated
Freeman Ng96be4e02011-04-07 18:21:40 -07004697 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
Christopher Tate06efb532012-08-24 15:29:27 -07004698 Global.SETUP_PREPAID_DATA_SERVICE_URL;
Freeman Ng96be4e02011-04-07 18:21:40 -07004699
4700 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004701 * @deprecated Use {@link android.provider.Settings.Global#SETUP_PREPAID_DETECTION_TARGET_URL} instead
Freeman Ng3b9089c2011-04-22 16:42:57 -07004702 * @hide
4703 */
Christopher Tate06efb532012-08-24 15:29:27 -07004704 @Deprecated
Freeman Ng3b9089c2011-04-22 16:42:57 -07004705 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
Christopher Tate06efb532012-08-24 15:29:27 -07004706 Global.SETUP_PREPAID_DETECTION_TARGET_URL;
Freeman Ng3b9089c2011-04-22 16:42:57 -07004707
4708 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004709 * @deprecated Use {@link android.provider.Settings.Global#SETUP_PREPAID_DETECTION_REDIR_HOST} instead
Freeman Ng3b9089c2011-04-22 16:42:57 -07004710 * @hide
4711 */
Christopher Tate06efb532012-08-24 15:29:27 -07004712 @Deprecated
Freeman Ng3b9089c2011-04-22 16:42:57 -07004713 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
Christopher Tate06efb532012-08-24 15:29:27 -07004714 Global.SETUP_PREPAID_DETECTION_REDIR_HOST;
Freeman Ng3b9089c2011-04-22 16:42:57 -07004715
4716 /**
John Spurlock1a868b72012-08-22 09:56:51 -04004717 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04004718 * @hide
4719 */
Daniel Sandler2d545362011-11-17 10:38:37 -08004720 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04004721
4722 /**
John Spurlock1a868b72012-08-22 09:56:51 -04004723 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08004724 *
John Spurlock1a868b72012-08-22 09:56:51 -04004725 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08004726 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04004727 * @hide
4728 */
John Spurlock1a868b72012-08-22 09:56:51 -04004729 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08004730
4731 /**
John Spurlock1a868b72012-08-22 09:56:51 -04004732 * If screensavers are enabled, whether the screensaver should be automatically launched
4733 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08004734 * @hide
4735 */
4736 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04004737
John Spurlock1a868b72012-08-22 09:56:51 -04004738 /**
4739 * If screensavers are enabled, whether the screensaver should be automatically launched
4740 * when the screen times out when not on battery.
4741 * @hide
4742 */
4743 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
4744
4745 /**
4746 * If screensavers are enabled, the default screensaver component.
4747 * @hide
4748 */
4749 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
4750
Christopher Tate06efb532012-08-24 15:29:27 -07004751 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4752 * {@hide} */
4753 @Deprecated
4754 public static final String NETSTATS_ENABLED = Global.NETSTATS_ENABLED;
4755 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4756 * {@hide} */
4757 @Deprecated
4758 public static final String NETSTATS_POLL_INTERVAL = Global.NETSTATS_POLL_INTERVAL;
4759 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4760 * {@hide} */
4761 @Deprecated
4762 public static final String NETSTATS_TIME_CACHE_MAX_AGE = Global.NETSTATS_TIME_CACHE_MAX_AGE;
4763 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4764 * {@hide} */
4765 @Deprecated
4766 public static final String NETSTATS_GLOBAL_ALERT_BYTES = Global.NETSTATS_GLOBAL_ALERT_BYTES;
4767 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4768 * {@hide} */
4769 @Deprecated
4770 public static final String NETSTATS_SAMPLE_ENABLED = Global.NETSTATS_SAMPLE_ENABLED;
4771 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4772 * {@hide} */
4773 @Deprecated
4774 public static final String NETSTATS_REPORT_XT_OVER_DEV = Global.NETSTATS_REPORT_XT_OVER_DEV;
Jeff Sharkey63abc372012-01-11 18:38:16 -08004775
Christopher Tate06efb532012-08-24 15:29:27 -07004776 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4777 * {@hide} */
4778 @Deprecated
4779 public static final String NETSTATS_DEV_BUCKET_DURATION = Global.NETSTATS_DEV_BUCKET_DURATION;
4780 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4781 * {@hide} */
4782 @Deprecated
4783 public static final String NETSTATS_DEV_PERSIST_BYTES = Global.NETSTATS_DEV_PERSIST_BYTES;
4784 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4785 * {@hide} */
4786 @Deprecated
4787 public static final String NETSTATS_DEV_ROTATE_AGE = Global.NETSTATS_DEV_ROTATE_AGE;
4788 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4789 * {@hide} */
4790 @Deprecated
4791 public static final String NETSTATS_DEV_DELETE_AGE = Global.NETSTATS_DEV_DELETE_AGE;
Jeff Sharkey63abc372012-01-11 18:38:16 -08004792
Christopher Tate06efb532012-08-24 15:29:27 -07004793 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4794 * {@hide} */
4795 @Deprecated
4796 public static final String NETSTATS_UID_BUCKET_DURATION = Global.NETSTATS_UID_BUCKET_DURATION;
4797 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4798 * {@hide} */
4799 @Deprecated
4800 public static final String NETSTATS_UID_PERSIST_BYTES = Global.NETSTATS_UID_PERSIST_BYTES;
4801 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4802 * {@hide} */
4803 @Deprecated
4804 public static final String NETSTATS_UID_ROTATE_AGE = Global.NETSTATS_UID_ROTATE_AGE;
4805 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4806 * {@hide} */
4807 @Deprecated
4808 public static final String NETSTATS_UID_DELETE_AGE = Global.NETSTATS_UID_DELETE_AGE;
Jeff Sharkey63abc372012-01-11 18:38:16 -08004809
Christopher Tate06efb532012-08-24 15:29:27 -07004810 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4811 * {@hide} */
4812 @Deprecated
4813 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = Global.NETSTATS_UID_TAG_BUCKET_DURATION;
4814 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4815 * {@hide} */
4816 @Deprecated
4817 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = Global.NETSTATS_UID_TAG_PERSIST_BYTES;
4818 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4819 * {@hide} */
4820 @Deprecated
4821 public static final String NETSTATS_UID_TAG_ROTATE_AGE = Global.NETSTATS_UID_TAG_ROTATE_AGE;
4822 /** @deprecated The NETSTATS_* symbols live in Settings.Global.* now
4823 * {@hide} */
4824 @Deprecated
4825 public static final String NETSTATS_UID_TAG_DELETE_AGE = Global.NETSTATS_UID_TAG_DELETE_AGE;
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07004826
Christopher Tate06efb532012-08-24 15:29:27 -07004827 /** Preferred NTP server. {@hide}
4828 * @deprecated moved to Settings.Global */
4829 public static final String NTP_SERVER = Global.NTP_SERVER;
Jeff Sharkey104344e2011-07-10 14:20:41 -07004830
Christopher Tate06efb532012-08-24 15:29:27 -07004831 /** Timeout in milliseconds to wait for NTP server. {@hide}
4832 * @deprecated moved to Settings.Global */
4833 public static final String NTP_TIMEOUT = Global.NTP_TIMEOUT;
4834
4835 /** Autofill server address (Used in WebView/browser).
4836 * @deprecated moved to Settings.Global
4837 * {@hide} */
4838 public static final String WEB_AUTOFILL_QUERY_URL = Global.WEB_AUTOFILL_QUERY_URL;
Ben Murdoch9999c1d2011-07-19 16:51:24 +01004839
rich cannings16e119e2012-09-06 12:04:37 -07004840 /**
4841 * Whether the package manager should send package verification broadcasts for verifiers to
4842 * review apps prior to installation.
rich cannings4d8fc792012-09-07 14:43:43 -07004843 * @deprecated moved to Settings.Global
rich cannings16e119e2012-09-06 12:04:37 -07004844 * 1 = request apps to be verified prior to installation, if a verifier exists.
4845 * 0 = do not verify apps before installation
4846 * {@hide}
4847 */
rich cannings4d8fc792012-09-07 14:43:43 -07004848 @Deprecated
rich cannings16e119e2012-09-06 12:04:37 -07004849 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
Kenny Root5ab21572011-07-27 11:11:19 -07004850
rich cannings4d8fc792012-09-07 14:43:43 -07004851 /** Timeout for package verification.
4852 * @deprecated moved to Settings.Global
4853 * {@hide} */
4854 @Deprecated
Kenny Root5ab21572011-07-27 11:11:19 -07004855 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
4856
rich cannings4d8fc792012-09-07 14:43:43 -07004857 /** Default response code for package verification.
4858 * @deprecated moved to Settings.Global
4859 * {@hide} */
4860 @Deprecated
rich canningsa6cfe522012-05-21 15:50:56 -07004861 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
4862
Jeff Sharkeyf5385772012-05-11 14:04:41 -07004863 /** {@hide} */
4864 public static final String
4865 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
4866
Daniel Sandler0601eb72011-04-13 01:01:32 -04004867 /**
Dave Santoroe43185e2011-10-10 18:11:00 -07004868 * Duration in milliseconds before pre-authorized URIs for the contacts
4869 * provider should expire.
4870 * @hide
4871 */
4872 public static final String CONTACTS_PREAUTH_URI_EXPIRATION =
4873 "contacts_preauth_uri_expiration";
4874
4875 /**
Jeff Brownbd6e1502012-08-28 03:27:37 -07004876 * Overlay display devices setting.
4877 * The associated value is a specially formatted string that describes the
4878 * size and density of simulated secondary display devices.
4879 * <p>
4880 * Format: {width}x{height}/{dpi};...
4881 * </p><p>
4882 * Example:
4883 * <ul>
4884 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
4885 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
4886 * at 1080p and the second at 720p.</li>
4887 * <li>If the value is empty, then no overlay display devices are created.</li>
4888 * </ul></p>
4889 *
4890 * @hide
4891 */
4892 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
4893
4894 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07004895 * This are the settings to be backed up.
4896 *
4897 * NOTE: Settings are backed up and restored in the order they appear
4898 * in this array. If you have one setting depending on another,
4899 * make sure that they are ordered appropriately.
4900 *
-b master501eec92009-07-06 13:53:11 -07004901 * @hide
4902 */
4903 public static final String[] SETTINGS_TO_BACKUP = {
Amith Yamasani8823c0a82009-07-07 14:30:17 -07004904 ADB_ENABLED,
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07004905 BUGREPORT_IN_POWER_MENU,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07004906 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07004907 PARENTAL_CONTROL_ENABLED,
4908 PARENTAL_CONTROL_REDIRECT_URL,
4909 USB_MASS_STORAGE_ENABLED,
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07004910 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
4911 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
4912 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004913 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08004914 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07004915 ENABLED_ACCESSIBILITY_SERVICES,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07004916 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07004917 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07004918 ACCESSIBILITY_ENABLED,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08004919 ACCESSIBILITY_SPEAK_PASSWORD,
-b master501eec92009-07-06 13:53:11 -07004920 TTS_USE_DEFAULTS,
4921 TTS_DEFAULT_RATE,
4922 TTS_DEFAULT_PITCH,
4923 TTS_DEFAULT_SYNTH,
4924 TTS_DEFAULT_LANG,
4925 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07004926 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01004927 TTS_DEFAULT_LOCALE,
-b master501eec92009-07-06 13:53:11 -07004928 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
4929 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
-b master501eec92009-07-06 13:53:11 -07004930 WIFI_NUM_OPEN_NETWORKS_KEPT,
San Mehat87734d32010-01-08 12:53:06 -08004931 MOUNT_PLAY_NOTIFICATION_SND,
4932 MOUNT_UMS_AUTOSTART,
4933 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07004934 MOUNT_UMS_NOTIFY_ENABLED,
Amith Yamasaniaee26872011-10-11 13:53:30 -07004935 UI_NIGHT_MODE,
4936 LOCK_SCREEN_OWNER_INFO,
Tom Taylor994da2a2011-11-10 11:17:38 -08004937 LOCK_SCREEN_OWNER_INFO_ENABLED
-b master501eec92009-07-06 13:53:11 -07004938 };
4939
4940 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004941 * Helper method for determining if a location provider is enabled.
4942 * @param cr the content resolver to use
4943 * @param provider the location provider to query
4944 * @return true if the provider is enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004945 */
4946 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
4947 String allowedProviders = Settings.Secure.getString(cr, LOCATION_PROVIDERS_ALLOWED);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07004948 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004949 }
4950
4951 /**
4952 * Thread-safe method for enabling or disabling a single location provider.
4953 * @param cr the content resolver to use
4954 * @param provider the location provider to enable or disable
4955 * @param enabled true if the provider should be enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004956 */
4957 public static final void setLocationProviderEnabled(ContentResolver cr,
4958 String provider, boolean enabled) {
4959 // to ensure thread safety, we write the provider name with a '+' or '-'
4960 // and let the SettingsProvider handle it rather than reading and modifying
4961 // the list of enabled providers.
4962 if (enabled) {
4963 provider = "+" + provider;
4964 } else {
4965 provider = "-" + provider;
4966 }
4967 putString(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider);
4968 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004969 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004970
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004971 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004972 * Global system settings, containing preferences that always apply identically
4973 * to all defined users. Applications can read these but are not allowed to write;
4974 * like the "Secure" settings, these are for preferences that the user must
4975 * explicitly modify through the system UI or specialized APIs for those values.
4976 */
4977 public static final class Global extends NameValueTable {
4978 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_global_version";
4979
4980 /**
4981 * The content:// style URL for global secure settings items. Not public.
4982 */
4983 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
4984
4985 /**
4986 * Whether Airplane Mode is on.
4987 */
4988 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
4989
4990 /**
4991 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
4992 */
4993 public static final String RADIO_BLUETOOTH = "bluetooth";
4994
4995 /**
4996 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
4997 */
4998 public static final String RADIO_WIFI = "wifi";
4999
5000 /**
5001 * {@hide}
5002 */
5003 public static final String RADIO_WIMAX = "wimax";
5004 /**
5005 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
5006 */
5007 public static final String RADIO_CELL = "cell";
5008
5009 /**
5010 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
5011 */
5012 public static final String RADIO_NFC = "nfc";
5013
5014 /**
5015 * A comma separated list of radios that need to be disabled when airplane mode
5016 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
5017 * included in the comma separated list.
5018 */
5019 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
5020
5021 /**
5022 * A comma separated list of radios that should to be disabled when airplane mode
5023 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
5024 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
5025 * will be turned off when entering airplane mode, but the user will be able to reenable
5026 * Wifi in the Settings app.
5027 *
5028 * {@hide}
5029 */
5030 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
5031
5032 /**
5033 * The policy for deciding when Wi-Fi should go to sleep (which will in
5034 * turn switch to using the mobile data as an Internet connection).
5035 * <p>
5036 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
5037 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
5038 * {@link #WIFI_SLEEP_POLICY_NEVER}.
5039 */
5040 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
5041
5042 /**
5043 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
5044 * policy, which is to sleep shortly after the turning off
5045 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
5046 */
5047 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
5048
5049 /**
5050 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
5051 * the device is on battery, and never go to sleep when the device is
5052 * plugged in.
5053 */
5054 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
5055
5056 /**
5057 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
5058 */
5059 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
5060
5061 /**
5062 * Value to specify if the user prefers the date, time and time zone
5063 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5064 */
5065 public static final String AUTO_TIME = "auto_time";
5066
5067 /**
5068 * Value to specify if the user prefers the time zone
5069 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
5070 */
5071 public static final String AUTO_TIME_ZONE = "auto_time_zone";
5072
5073 /**
5074 * URI for the car dock "in" event sound.
5075 * @hide
5076 */
5077 public static final String CAR_DOCK_SOUND = "car_dock_sound";
5078
5079 /**
5080 * URI for the car dock "out" event sound.
5081 * @hide
5082 */
5083 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
5084
5085 /**
5086 * URI for the desk dock "in" event sound.
5087 * @hide
5088 */
5089 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
5090
5091 /**
5092 * URI for the desk dock "out" event sound.
5093 * @hide
5094 */
5095 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
5096
5097 /**
5098 * Whether to play a sound for dock events.
5099 * @hide
5100 */
5101 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
5102
5103 /**
5104 * URI for the "device locked" (keyguard shown) sound.
5105 * @hide
5106 */
5107 public static final String LOCK_SOUND = "lock_sound";
5108
5109 /**
5110 * URI for the "device unlocked" sound.
5111 * @hide
5112 */
5113 public static final String UNLOCK_SOUND = "unlock_sound";
5114
5115 /**
5116 * URI for the low battery sound file.
5117 * @hide
5118 */
5119 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
5120
5121 /**
5122 * Whether to play a sound for low-battery alerts.
5123 * @hide
5124 */
5125 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
5126
5127 /**
5128 * Whether we keep the device on while the device is plugged in.
5129 * Supported values are:
5130 * <ul>
5131 * <li>{@code 0} to never stay on while plugged in</li>
5132 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
5133 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
5134 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
5135 * </ul>
5136 * These values can be OR-ed together.
5137 */
5138 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
5139
5140 /**
5141 * Whether ADB is enabled.
5142 */
5143 public static final String ADB_ENABLED = "adb_enabled";
5144
5145 /**
5146 * Whether assisted GPS should be enabled or not.
5147 * @hide
5148 */
5149 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
5150
5151 /**
5152 * Whether bluetooth is enabled/disabled
5153 * 0=disabled. 1=enabled.
5154 */
5155 public static final String BLUETOOTH_ON = "bluetooth_on";
5156
5157 /**
5158 * CDMA Cell Broadcast SMS
5159 * 0 = CDMA Cell Broadcast SMS disabled
5160 * 1 = CDMA Cell Broadcast SMS enabled
5161 * @hide
5162 */
5163 public static final String CDMA_CELL_BROADCAST_SMS =
5164 "cdma_cell_broadcast_sms";
5165
5166 /**
5167 * The CDMA roaming mode 0 = Home Networks, CDMA default
5168 * 1 = Roaming on Affiliated networks
5169 * 2 = Roaming on any networks
5170 * @hide
5171 */
5172 public static final String CDMA_ROAMING_MODE = "roaming_settings";
5173
5174 /**
5175 * The CDMA subscription mode 0 = RUIM/SIM (default)
5176 * 1 = NV
5177 * @hide
5178 */
5179 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
5180
5181 /** Inactivity timeout to track mobile data activity.
5182 *
5183 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
5184 * infer the data activity of mobile network. After a period of no activity on mobile
5185 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
5186 * intent is fired to indicate a transition of network status from "active" to "idle". Any
5187 * subsequent activity on mobile networks triggers the firing of {@code
5188 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
5189 *
5190 * Network activity refers to transmitting or receiving data on the network interfaces.
5191 *
5192 * Tracking is disabled if set to zero or negative value.
5193 *
5194 * @hide
5195 */
5196 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
5197
5198 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
5199 * but for Wifi network.
5200 * @hide
5201 */
5202 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
5203
5204 /**
5205 * Whether or not data roaming is enabled. (0 = false, 1 = true)
5206 */
5207 public static final String DATA_ROAMING = "data_roaming";
5208
5209 /**
5210 * Whether user has enabled development settings.
5211 */
5212 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
5213
5214 /**
5215 * Whether the device has been provisioned (0 = false, 1 = true)
5216 */
5217 public static final String DEVICE_PROVISIONED = "device_provisioned";
5218
5219 /**
5220 * The saved value for WindowManagerService.setForcedDisplayDensity().
5221 * One integer in dpi. If unset, then use the real display density.
5222 * @hide
5223 */
5224 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
5225
5226 /**
5227 * The saved value for WindowManagerService.setForcedDisplaySize().
5228 * Two integers separated by a comma. If unset, then use the real display size.
5229 * @hide
5230 */
5231 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
5232
5233 /**
5234 * The maximum size, in bytes, of a download that the download manager will transfer over
5235 * a non-wifi connection.
5236 * @hide
5237 */
5238 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
5239 "download_manager_max_bytes_over_mobile";
5240
5241 /**
5242 * The recommended maximum size, in bytes, of a download that the download manager should
5243 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
5244 * have the option to start the download over the mobile connection anyway.
5245 * @hide
5246 */
5247 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
5248 "download_manager_recommended_max_bytes_over_mobile";
5249
5250 /**
5251 * Whether the package installer should allow installation of apps downloaded from
5252 * sources other than Google Play.
5253 *
5254 * 1 = allow installing from other sources
5255 * 0 = only allow installing from Google Play
5256 */
5257 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
5258
5259 /**
5260 * Whether mobile data connections are allowed by the user. See
5261 * ConnectivityManager for more info.
5262 * @hide
5263 */
5264 public static final String MOBILE_DATA = "mobile_data";
5265
5266 /** {@hide} */
5267 public static final String NETSTATS_ENABLED = "netstats_enabled";
5268 /** {@hide} */
5269 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
5270 /** {@hide} */
5271 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
5272 /** {@hide} */
5273 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
5274 /** {@hide} */
5275 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
5276 /** {@hide} */
5277 public static final String NETSTATS_REPORT_XT_OVER_DEV = "netstats_report_xt_over_dev";
5278
5279 /** {@hide} */
5280 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
5281 /** {@hide} */
5282 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
5283 /** {@hide} */
5284 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
5285 /** {@hide} */
5286 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
5287
5288 /** {@hide} */
5289 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
5290 /** {@hide} */
5291 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
5292 /** {@hide} */
5293 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
5294 /** {@hide} */
5295 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
5296
5297 /** {@hide} */
5298 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
5299 /** {@hide} */
5300 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
5301 /** {@hide} */
5302 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
5303 /** {@hide} */
5304 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
5305
5306 /**
5307 * User preference for which network(s) should be used. Only the
5308 * connectivity service should touch this.
5309 */
5310 public static final String NETWORK_PREFERENCE = "network_preference";
5311
5312 /**
5313 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
5314 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
5315 * exceeded.
5316 * @hide
5317 */
5318 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
5319
5320 /**
5321 * The length of time in milli-seconds that automatic small adjustments to
5322 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
5323 * @hide
5324 */
5325 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
5326
5327 /** Preferred NTP server. {@hide} */
5328 public static final String NTP_SERVER = "ntp_server";
5329 /** Timeout in milliseconds to wait for NTP server. {@hide} */
5330 public static final String NTP_TIMEOUT = "ntp_timeout";
5331
5332 /**
rich cannings4d8fc792012-09-07 14:43:43 -07005333 * Whether the package manager should send package verification broadcasts for verifiers to
5334 * review apps prior to installation.
5335 * 1 = request apps to be verified prior to installation, if a verifier exists.
5336 * 0 = do not verify apps before installation
5337 * {@hide}
5338 */
5339 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
5340
5341 /** Timeout for package verification.
5342 * {@hide} */
5343 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
5344
5345 /** Default response code for package verification.
5346 * {@hide} */
5347 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
5348
rich canningse6686b32012-09-16 14:02:20 -07005349 /** Show package verification setting in the Settings app.
5350 * 1 = show (default)
5351 * 0 = hide
5352 * {@hide}
5353 */
5354 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
5355
rich cannings4d8fc792012-09-07 14:43:43 -07005356 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005357 * The interval in milliseconds at which to check packet counts on the
5358 * mobile data interface when screen is on, to detect possible data
5359 * connection problems.
5360 * @hide
5361 */
5362 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
5363 "pdp_watchdog_poll_interval_ms";
5364
5365 /**
5366 * The interval in milliseconds at which to check packet counts on the
5367 * mobile data interface when screen is off, to detect possible data
5368 * connection problems.
5369 * @hide
5370 */
5371 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
5372 "pdp_watchdog_long_poll_interval_ms";
5373
5374 /**
5375 * The interval in milliseconds at which to check packet counts on the
5376 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
5377 * outgoing packets has been reached without incoming packets.
5378 * @hide
5379 */
5380 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
5381 "pdp_watchdog_error_poll_interval_ms";
5382
5383 /**
5384 * The number of outgoing packets sent without seeing an incoming packet
5385 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
5386 * device is logged to the event log
5387 * @hide
5388 */
5389 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
5390 "pdp_watchdog_trigger_packet_count";
5391
5392 /**
5393 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
5394 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
5395 * attempting data connection recovery.
5396 * @hide
5397 */
5398 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
5399 "pdp_watchdog_error_poll_count";
5400
5401 /**
5402 * The number of failed PDP reset attempts before moving to something more
5403 * drastic: re-registering to the network.
5404 * @hide
5405 */
5406 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
5407 "pdp_watchdog_max_pdp_reset_fail_count";
5408
5409 /**
5410 * A positive value indicates how often the SamplingProfiler
5411 * should take snapshots. Zero value means SamplingProfiler
5412 * is disabled.
5413 *
5414 * @hide
5415 */
5416 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
5417
5418 /**
5419 * URL to open browser on to allow user to manage a prepay account
5420 * @hide
5421 */
5422 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
5423 "setup_prepaid_data_service_url";
5424
5425 /**
5426 * URL to attempt a GET on to see if this is a prepay device
5427 * @hide
5428 */
5429 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
5430 "setup_prepaid_detection_target_url";
5431
5432 /**
5433 * Host to check for a redirect to after an attempt to GET
5434 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
5435 * this is a prepaid device with zero balance.)
5436 * @hide
5437 */
5438 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
5439 "setup_prepaid_detection_redir_host";
5440
5441 /**
Jake Hamby76a61422012-09-06 17:40:21 -07005442 * The interval in milliseconds at which to check the number of SMS sent out without asking
5443 * for use permit, to limit the un-authorized SMS usage.
5444 *
5445 * @hide
5446 */
5447 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
5448 "sms_outgoing_check_interval_ms";
5449
5450 /**
5451 * The number of outgoing SMS sent without asking for user permit (of {@link
5452 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
5453 *
5454 * @hide
5455 */
5456 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
5457 "sms_outgoing_check_max_count";
5458
5459 /**
5460 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07005461 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07005462 * @see com.android.internal.telephony.SmsUsageMonitor
5463 * @hide
5464 */
5465 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
5466
Robert Greenwalt026efcc2012-09-24 10:03:21 -07005467 /**
5468 * Used to select which country we use to determine premium sms codes.
5469 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
5470 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
5471 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
5472 * @hide
5473 */
5474 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
5475
Jake Hamby76a61422012-09-06 17:40:21 -07005476 /**
5477 * Prefix for SMS short code regex patterns (country code is appended).
5478 * @see com.android.internal.telephony.SmsUsageMonitor
5479 * @hide
5480 */
5481 public static final String SMS_SHORT_CODES_PREFIX = "sms_short_codes_";
5482
5483 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005484 * Used to disable Tethering on a device - defaults to true
5485 * @hide
5486 */
5487 public static final String TETHER_SUPPORTED = "tether_supported";
5488
5489 /**
5490 * Used to require DUN APN on the device or not - defaults to a build config value
5491 * which defaults to false
5492 * @hide
5493 */
5494 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
5495
5496 /**
5497 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
5498 * corresponding build config values are set it will override the APN DB
5499 * values.
5500 * Consists of a comma seperated list of strings:
5501 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
5502 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
5503 * @hide
5504 */
5505 public static final String TETHER_DUN_APN = "tether_dun_apn";
5506
5507 /**
5508 * The bandwidth throttle polling freqency in seconds
5509 * @hide
5510 */
5511 public static final String THROTTLE_POLLING_SEC = "throttle_polling_sec";
5512
5513 /**
5514 * The bandwidth throttle threshold (long)
5515 * @hide
5516 */
5517 public static final String THROTTLE_THRESHOLD_BYTES = "throttle_threshold_bytes";
5518
5519 /**
5520 * The bandwidth throttle value (kbps)
5521 * @hide
5522 */
5523 public static final String THROTTLE_VALUE_KBITSPS = "throttle_value_kbitsps";
5524
5525 /**
5526 * The bandwidth throttle reset calendar day (1-28)
5527 * @hide
5528 */
5529 public static final String THROTTLE_RESET_DAY = "throttle_reset_day";
5530
5531 /**
5532 * The throttling notifications we should send
5533 * @hide
5534 */
5535 public static final String THROTTLE_NOTIFICATION_TYPE = "throttle_notification_type";
5536
5537 /**
5538 * Help URI for data throttling policy
5539 * @hide
5540 */
5541 public static final String THROTTLE_HELP_URI = "throttle_help_uri";
5542
5543 /**
5544 * The length of time in Sec that we allow our notion of NTP time
5545 * to be cached before we refresh it
5546 * @hide
5547 */
5548 public static final String THROTTLE_MAX_NTP_CACHE_AGE_SEC =
5549 "throttle_max_ntp_cache_age_sec";
5550
5551 /**
5552 * USB Mass Storage Enabled
5553 */
5554 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
5555
5556 /**
5557 * If this setting is set (to anything), then all references
5558 * to Gmail on the device must change to Google Mail.
5559 */
5560 public static final String USE_GOOGLE_MAIL = "use_google_mail";
5561
5562 /** Autofill server address (Used in WebView/browser).
5563 * {@hide} */
5564 public static final String WEB_AUTOFILL_QUERY_URL =
5565 "web_autofill_query_url";
5566
5567 /**
Jeff Brown89d55462012-09-19 11:33:42 -07005568 * Whether Wifi display is enabled/disabled
5569 * 0=disabled. 1=enabled.
5570 * @hide
5571 */
5572 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
5573
5574 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005575 * Whether to notify the user of open networks.
5576 * <p>
5577 * If not connected and the scan results have an open network, we will
5578 * put this notification up. If we attempt to connect to a network or
5579 * the open network(s) disappear, we remove the notification. When we
5580 * show the notification, we will not show it again for
5581 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
5582 */
5583 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
5584 "wifi_networks_available_notification_on";
5585 /**
5586 * {@hide}
5587 */
5588 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
5589 "wimax_networks_available_notification_on";
5590
5591 /**
5592 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
5593 * Connecting to a network will reset the timer.
5594 */
5595 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
5596 "wifi_networks_available_repeat_delay";
5597
5598 /**
5599 * 802.11 country code in ISO 3166 format
5600 * @hide
5601 */
5602 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
5603
5604 /**
5605 * The interval in milliseconds to issue wake up scans when wifi needs
5606 * to connect. This is necessary to connect to an access point when
5607 * device is on the move and the screen is off.
5608 * @hide
5609 */
5610 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
5611 "wifi_framework_scan_interval_ms";
5612
5613 /**
5614 * The interval in milliseconds after which Wi-Fi is considered idle.
5615 * When idle, it is possible for the device to be switched from Wi-Fi to
5616 * the mobile data network.
5617 * @hide
5618 */
5619 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
5620
5621 /**
5622 * When the number of open networks exceeds this number, the
5623 * least-recently-used excess networks will be removed.
5624 */
5625 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
5626
5627 /**
5628 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
5629 */
5630 public static final String WIFI_ON = "wifi_on";
5631
5632 /**
5633 * Used to save the Wifi_ON state prior to tethering.
5634 * This state will be checked to restore Wifi after
5635 * the user turns off tethering.
5636 *
5637 * @hide
5638 */
5639 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
5640
5641 /**
5642 * The interval in milliseconds to scan as used by the wifi supplicant
5643 * @hide
5644 */
5645 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
5646 "wifi_supplicant_scan_interval_ms";
5647
5648 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07005649 * The interval in milliseconds to scan at supplicant when p2p is connected
5650 * @hide
5651 */
5652 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
5653 "wifi_scan_interval_p2p_connected_ms";
5654
5655 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005656 * Whether the Wi-Fi watchdog is enabled.
5657 */
5658 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
5659
5660 /**
5661 * ms delay interval between rssi polling when the signal is known to be weak
5662 * @hide
5663 */
5664 public static final String WIFI_WATCHDOG_RSSI_FETCH_INTERVAL_MS =
5665 "wifi_watchdog_rssi_fetch_interval_ms";
5666
5667 /**
5668 * Number of ARP pings per check.
5669 * @hide
5670 */
5671 public static final String WIFI_WATCHDOG_NUM_ARP_PINGS = "wifi_watchdog_num_arp_pings";
5672
5673 /**
5674 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
5675 * the setting needs to be set to 0 to disable it.
5676 * @hide
5677 */
5678 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
5679 "wifi_watchdog_poor_network_test_enabled";
5680
5681 /**
5682 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
5683 * needs to be set to 0 to disable it.
5684 * @hide
5685 */
5686 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
5687 "wifi_suspend_optimizations_enabled";
5688
5689 /**
5690 * The maximum number of times we will retry a connection to an access
5691 * point for which we have failed in acquiring an IP address from DHCP.
5692 * A value of N means that we will make N+1 connection attempts in all.
5693 */
5694 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
5695
5696 /**
5697 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
5698 * data connectivity to be established after a disconnect from Wi-Fi.
5699 */
5700 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
5701 "wifi_mobile_data_transition_wakelock_timeout_ms";
5702
5703 /**
5704 * The operational wifi frequency band
5705 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
5706 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
5707 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
5708 *
5709 * @hide
5710 */
5711 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
5712
5713 /**
5714 * The Wi-Fi peer-to-peer device name
5715 * @hide
5716 */
5717 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
5718
5719 /**
Christopher Tatec868b642012-09-12 17:41:04 -07005720 * The number of milliseconds to delay when checking for data stalls during
5721 * non-aggressive detection. (screen is turned off.)
5722 * @hide
5723 */
5724 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
5725 "data_stall_alarm_non_aggressive_delay_in_ms";
5726
5727 /**
5728 * The number of milliseconds to delay when checking for data stalls during
5729 * aggressive detection. (screen on or suspected data stall)
5730 * @hide
5731 */
5732 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
5733 "data_stall_alarm_aggressive_delay_in_ms";
5734
5735 /**
5736 * The interval in milliseconds at which to check gprs registration
5737 * after the first registration mismatch of gprs and voice service,
5738 * to detect possible data network registration problems.
5739 *
5740 * @hide
5741 */
5742 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
5743 "gprs_register_check_period_ms";
5744
5745 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005746 * Nonzero causes Log.wtf() to crash.
5747 * @hide
5748 */
5749 public static final String WTF_IS_FATAL = "wtf_is_fatal";
5750
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07005751 /**
5752 * Ringer mode. This is used internally, changing this value will not
5753 * change the ringer mode. See AudioManager.
5754 */
5755 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07005756
5757
5758 // Populated lazily, guarded by class object:
5759 private static NameValueCache sNameValueCache = null;
5760
5761 private static void lazyInitCache() {
5762 if (sNameValueCache == null) {
5763 sNameValueCache = new NameValueCache(
5764 SYS_PROP_SETTING_VERSION,
5765 CONTENT_URI,
5766 CALL_METHOD_GET_GLOBAL,
5767 CALL_METHOD_PUT_GLOBAL);
5768 }
5769 }
5770
5771 /**
5772 * Look up a name in the database.
5773 * @param resolver to access the database with
5774 * @param name to look up in the table
5775 * @return the corresponding value, or null if not present
5776 */
5777 public synchronized static String getString(ContentResolver resolver, String name) {
5778 return getStringForUser(resolver, name, UserHandle.myUserId());
5779 }
5780
5781 /** @hide */
5782 public synchronized static String getStringForUser(ContentResolver resolver, String name,
5783 int userHandle) {
5784 lazyInitCache();
5785 return sNameValueCache.getStringForUser(resolver, name, userHandle);
5786 }
5787
5788 /**
5789 * Store a name/value pair into the database.
5790 * @param resolver to access the database with
5791 * @param name to store
5792 * @param value to associate with the name
5793 * @return true if the value was set, false on database errors
5794 */
5795 public static boolean putString(ContentResolver resolver,
5796 String name, String value) {
5797 return putStringForUser(resolver, name, value, UserHandle.myUserId());
5798 }
5799
5800 /** @hide */
5801 public static boolean putStringForUser(ContentResolver resolver,
5802 String name, String value, int userHandle) {
5803 lazyInitCache();
5804 if (LOCAL_LOGV) {
5805 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
5806 + " for " + userHandle);
5807 }
5808 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
5809 }
5810
5811 /**
5812 * Construct the content URI for a particular name/value pair,
5813 * useful for monitoring changes with a ContentObserver.
5814 * @param name to look up in the table
5815 * @return the corresponding content URI, or null if not present
5816 */
5817 public static Uri getUriFor(String name) {
5818 return getUriFor(CONTENT_URI, name);
5819 }
5820
5821 /**
5822 * Convenience function for retrieving a single secure settings value
5823 * as an integer. Note that internally setting values are always
5824 * stored as strings; this function converts the string to an integer
5825 * for you. The default value will be returned if the setting is
5826 * not defined or not an integer.
5827 *
5828 * @param cr The ContentResolver to access.
5829 * @param name The name of the setting to retrieve.
5830 * @param def Value to return if the setting is not defined.
5831 *
5832 * @return The setting's current value, or 'def' if it is not defined
5833 * or not a valid integer.
5834 */
5835 public static int getInt(ContentResolver cr, String name, int def) {
5836 String v = getString(cr, name);
5837 try {
5838 return v != null ? Integer.parseInt(v) : def;
5839 } catch (NumberFormatException e) {
5840 return def;
5841 }
5842 }
5843
5844 /**
5845 * Convenience function for retrieving a single secure settings value
5846 * as an integer. Note that internally setting values are always
5847 * stored as strings; this function converts the string to an integer
5848 * for you.
5849 * <p>
5850 * This version does not take a default value. If the setting has not
5851 * been set, or the string value is not a number,
5852 * it throws {@link SettingNotFoundException}.
5853 *
5854 * @param cr The ContentResolver to access.
5855 * @param name The name of the setting to retrieve.
5856 *
5857 * @throws SettingNotFoundException Thrown if a setting by the given
5858 * name can't be found or the setting value is not an integer.
5859 *
5860 * @return The setting's current value.
5861 */
5862 public static int getInt(ContentResolver cr, String name)
5863 throws SettingNotFoundException {
5864 String v = getString(cr, name);
5865 try {
5866 return Integer.parseInt(v);
5867 } catch (NumberFormatException e) {
5868 throw new SettingNotFoundException(name);
5869 }
5870 }
5871
5872 /**
5873 * Convenience function for updating a single settings value as an
5874 * integer. This will either create a new entry in the table if the
5875 * given name does not exist, or modify the value of the existing row
5876 * with that name. Note that internally setting values are always
5877 * stored as strings, so this function converts the given value to a
5878 * string before storing it.
5879 *
5880 * @param cr The ContentResolver to access.
5881 * @param name The name of the setting to modify.
5882 * @param value The new value for the setting.
5883 * @return true if the value was set, false on database errors
5884 */
5885 public static boolean putInt(ContentResolver cr, String name, int value) {
5886 return putString(cr, name, Integer.toString(value));
5887 }
5888
5889 /**
5890 * Convenience function for retrieving a single secure settings value
5891 * as a {@code long}. Note that internally setting values are always
5892 * stored as strings; this function converts the string to a {@code long}
5893 * for you. The default value will be returned if the setting is
5894 * not defined or not a {@code long}.
5895 *
5896 * @param cr The ContentResolver to access.
5897 * @param name The name of the setting to retrieve.
5898 * @param def Value to return if the setting is not defined.
5899 *
5900 * @return The setting's current value, or 'def' if it is not defined
5901 * or not a valid {@code long}.
5902 */
5903 public static long getLong(ContentResolver cr, String name, long def) {
5904 String valString = getString(cr, name);
5905 long value;
5906 try {
5907 value = valString != null ? Long.parseLong(valString) : def;
5908 } catch (NumberFormatException e) {
5909 value = def;
5910 }
5911 return value;
5912 }
5913
5914 /**
5915 * Convenience function for retrieving a single secure settings value
5916 * as a {@code long}. Note that internally setting values are always
5917 * stored as strings; this function converts the string to a {@code long}
5918 * for you.
5919 * <p>
5920 * This version does not take a default value. If the setting has not
5921 * been set, or the string value is not a number,
5922 * it throws {@link SettingNotFoundException}.
5923 *
5924 * @param cr The ContentResolver to access.
5925 * @param name The name of the setting to retrieve.
5926 *
5927 * @return The setting's current value.
5928 * @throws SettingNotFoundException Thrown if a setting by the given
5929 * name can't be found or the setting value is not an integer.
5930 */
5931 public static long getLong(ContentResolver cr, String name)
5932 throws SettingNotFoundException {
5933 String valString = getString(cr, name);
5934 try {
5935 return Long.parseLong(valString);
5936 } catch (NumberFormatException e) {
5937 throw new SettingNotFoundException(name);
5938 }
5939 }
5940
5941 /**
5942 * Convenience function for updating a secure settings value as a long
5943 * integer. This will either create a new entry in the table if the
5944 * given name does not exist, or modify the value of the existing row
5945 * with that name. Note that internally setting values are always
5946 * stored as strings, so this function converts the given value to a
5947 * string before storing it.
5948 *
5949 * @param cr The ContentResolver to access.
5950 * @param name The name of the setting to modify.
5951 * @param value The new value for the setting.
5952 * @return true if the value was set, false on database errors
5953 */
5954 public static boolean putLong(ContentResolver cr, String name, long value) {
5955 return putString(cr, name, Long.toString(value));
5956 }
5957
5958 /**
5959 * Convenience function for retrieving a single secure settings value
5960 * as a floating point number. Note that internally setting values are
5961 * always stored as strings; this function converts the string to an
5962 * float for you. The default value will be returned if the setting
5963 * is not defined or not a valid float.
5964 *
5965 * @param cr The ContentResolver to access.
5966 * @param name The name of the setting to retrieve.
5967 * @param def Value to return if the setting is not defined.
5968 *
5969 * @return The setting's current value, or 'def' if it is not defined
5970 * or not a valid float.
5971 */
5972 public static float getFloat(ContentResolver cr, String name, float def) {
5973 String v = getString(cr, name);
5974 try {
5975 return v != null ? Float.parseFloat(v) : def;
5976 } catch (NumberFormatException e) {
5977 return def;
5978 }
5979 }
5980
5981 /**
5982 * Convenience function for retrieving a single secure settings value
5983 * as a float. Note that internally setting values are always
5984 * stored as strings; this function converts the string to a float
5985 * for you.
5986 * <p>
5987 * This version does not take a default value. If the setting has not
5988 * been set, or the string value is not a number,
5989 * it throws {@link SettingNotFoundException}.
5990 *
5991 * @param cr The ContentResolver to access.
5992 * @param name The name of the setting to retrieve.
5993 *
5994 * @throws SettingNotFoundException Thrown if a setting by the given
5995 * name can't be found or the setting value is not a float.
5996 *
5997 * @return The setting's current value.
5998 */
5999 public static float getFloat(ContentResolver cr, String name)
6000 throws SettingNotFoundException {
6001 String v = getString(cr, name);
6002 if (v == null) {
6003 throw new SettingNotFoundException(name);
6004 }
6005 try {
6006 return Float.parseFloat(v);
6007 } catch (NumberFormatException e) {
6008 throw new SettingNotFoundException(name);
6009 }
6010 }
6011
6012 /**
6013 * Convenience function for updating a single settings value as a
6014 * floating point number. This will either create a new entry in the
6015 * table if the given name does not exist, or modify the value of the
6016 * existing row with that name. Note that internally setting values
6017 * are always stored as strings, so this function converts the given
6018 * value to a string before storing it.
6019 *
6020 * @param cr The ContentResolver to access.
6021 * @param name The name of the setting to modify.
6022 * @param value The new value for the setting.
6023 * @return true if the value was set, false on database errors
6024 */
6025 public static boolean putFloat(ContentResolver cr, String name, float value) {
6026 return putString(cr, name, Float.toString(value));
6027 }
6028 }
6029
6030 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006031 * User-defined bookmarks and shortcuts. The target of each bookmark is an
6032 * Intent URL, allowing it to be either a web page or a particular
6033 * application activity.
6034 *
6035 * @hide
6036 */
6037 public static final class Bookmarks implements BaseColumns
6038 {
6039 private static final String TAG = "Bookmarks";
6040
6041 /**
6042 * The content:// style URL for this table
6043 */
6044 public static final Uri CONTENT_URI =
6045 Uri.parse("content://" + AUTHORITY + "/bookmarks");
6046
6047 /**
6048 * The row ID.
6049 * <p>Type: INTEGER</p>
6050 */
6051 public static final String ID = "_id";
6052
6053 /**
6054 * Descriptive name of the bookmark that can be displayed to the user.
6055 * If this is empty, the title should be resolved at display time (use
6056 * {@link #getTitle(Context, Cursor)} any time you want to display the
6057 * title of a bookmark.)
6058 * <P>
6059 * Type: TEXT
6060 * </P>
6061 */
6062 public static final String TITLE = "title";
6063
6064 /**
6065 * Arbitrary string (displayed to the user) that allows bookmarks to be
6066 * organized into categories. There are some special names for
6067 * standard folders, which all start with '@'. The label displayed for
6068 * the folder changes with the locale (via {@link #getLabelForFolder}) but
6069 * the folder name does not change so you can consistently query for
6070 * the folder regardless of the current locale.
6071 *
6072 * <P>Type: TEXT</P>
6073 *
6074 */
6075 public static final String FOLDER = "folder";
6076
6077 /**
6078 * The Intent URL of the bookmark, describing what it points to. This
6079 * value is given to {@link android.content.Intent#getIntent} to create
6080 * an Intent that can be launched.
6081 * <P>Type: TEXT</P>
6082 */
6083 public static final String INTENT = "intent";
6084
6085 /**
6086 * Optional shortcut character associated with this bookmark.
6087 * <P>Type: INTEGER</P>
6088 */
6089 public static final String SHORTCUT = "shortcut";
6090
6091 /**
6092 * The order in which the bookmark should be displayed
6093 * <P>Type: INTEGER</P>
6094 */
6095 public static final String ORDERING = "ordering";
6096
6097 private static final String[] sIntentProjection = { INTENT };
6098 private static final String[] sShortcutProjection = { ID, SHORTCUT };
6099 private static final String sShortcutSelection = SHORTCUT + "=?";
6100
6101 /**
6102 * Convenience function to retrieve the bookmarked Intent for a
6103 * particular shortcut key.
6104 *
6105 * @param cr The ContentResolver to query.
6106 * @param shortcut The shortcut key.
6107 *
6108 * @return Intent The bookmarked URL, or null if there is no bookmark
6109 * matching the given shortcut.
6110 */
6111 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
6112 {
6113 Intent intent = null;
6114
6115 Cursor c = cr.query(CONTENT_URI,
6116 sIntentProjection, sShortcutSelection,
6117 new String[] { String.valueOf((int) shortcut) }, ORDERING);
6118 // Keep trying until we find a valid shortcut
6119 try {
6120 while (intent == null && c.moveToNext()) {
6121 try {
6122 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02006123 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006124 } catch (java.net.URISyntaxException e) {
6125 // The stored URL is bad... ignore it.
6126 } catch (IllegalArgumentException e) {
6127 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07006128 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006129 }
6130 }
6131 } finally {
6132 if (c != null) c.close();
6133 }
6134
6135 return intent;
6136 }
6137
6138 /**
6139 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006140 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006141 * @param cr The ContentResolver to query.
6142 * @param intent The desired target of the bookmark.
6143 * @param title Bookmark title that is shown to the user; null if none
6144 * or it should be resolved to the intent's title.
6145 * @param folder Folder in which to place the bookmark; null if none.
6146 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
6147 * this is non-zero and there is an existing bookmark entry
6148 * with this same shortcut, then that existing shortcut is
6149 * cleared (the bookmark is not removed).
6150 * @return The unique content URL for the new bookmark entry.
6151 */
6152 public static Uri add(ContentResolver cr,
6153 Intent intent,
6154 String title,
6155 String folder,
6156 char shortcut,
6157 int ordering)
6158 {
6159 // If a shortcut is supplied, and it is already defined for
6160 // another bookmark, then remove the old definition.
6161 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05006162 cr.delete(CONTENT_URI, sShortcutSelection,
6163 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006164 }
6165
6166 ContentValues values = new ContentValues();
6167 if (title != null) values.put(TITLE, title);
6168 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07006169 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006170 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
6171 values.put(ORDERING, ordering);
6172 return cr.insert(CONTENT_URI, values);
6173 }
6174
6175 /**
6176 * Return the folder name as it should be displayed to the user. This
6177 * takes care of localizing special folders.
6178 *
6179 * @param r Resources object for current locale; only need access to
6180 * system resources.
6181 * @param folder The value found in the {@link #FOLDER} column.
6182 *
6183 * @return CharSequence The label for this folder that should be shown
6184 * to the user.
6185 */
6186 public static CharSequence getLabelForFolder(Resources r, String folder) {
6187 return folder;
6188 }
6189
6190 /**
6191 * Return the title as it should be displayed to the user. This takes
6192 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006193 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006194 * @param context A context.
6195 * @param cursor A cursor pointing to the row whose title should be
6196 * returned. The cursor must contain at least the {@link #TITLE}
6197 * and {@link #INTENT} columns.
6198 * @return A title that is localized and can be displayed to the user,
6199 * or the empty string if one could not be found.
6200 */
6201 public static CharSequence getTitle(Context context, Cursor cursor) {
6202 int titleColumn = cursor.getColumnIndex(TITLE);
6203 int intentColumn = cursor.getColumnIndex(INTENT);
6204 if (titleColumn == -1 || intentColumn == -1) {
6205 throw new IllegalArgumentException(
6206 "The cursor must contain the TITLE and INTENT columns.");
6207 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006208
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006209 String title = cursor.getString(titleColumn);
6210 if (!TextUtils.isEmpty(title)) {
6211 return title;
6212 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006213
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006214 String intentUri = cursor.getString(intentColumn);
6215 if (TextUtils.isEmpty(intentUri)) {
6216 return "";
6217 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006218
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006219 Intent intent;
6220 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02006221 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006222 } catch (URISyntaxException e) {
6223 return "";
6224 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006225
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006226 PackageManager packageManager = context.getPackageManager();
6227 ResolveInfo info = packageManager.resolveActivity(intent, 0);
6228 return info != null ? info.loadLabel(packageManager) : "";
6229 }
6230 }
6231
6232 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006233 * Returns the device ID that we should use when connecting to the mobile gtalk server.
6234 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
6235 * from the GoogleLoginService.
6236 *
6237 * @param androidId The Android ID for this device.
6238 * @return The device ID that should be used when connecting to the mobile gtalk server.
6239 * @hide
6240 */
6241 public static String getGTalkDeviceId(long androidId) {
6242 return "android-" + Long.toHexString(androidId);
6243 }
6244}