blob: b0321694c67599d1946cd96125a9da68e7ebcd00 [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;
39import android.os.RemoteException;
40import android.os.SystemProperties;
Narayan Kamath6d632962011-08-24 11:51:37 +010041import android.speech.tts.TextToSpeech;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080042import android.text.TextUtils;
43import android.util.AndroidException;
44import android.util.Log;
Gilles Debunnee90bed12011-08-30 14:28:27 -070045import android.view.WindowOrientationListener;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046
47import java.net.URISyntaxException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080048import java.util.HashMap;
49import java.util.HashSet;
50
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080051/**
52 * The Settings provider contains global system-level device preferences.
53 */
54public final class Settings {
55
56 // Intent actions for Settings
57
58 /**
59 * Activity Action: Show system settings.
60 * <p>
61 * Input: Nothing.
62 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070063 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080064 */
65 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
66 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
67
68 /**
69 * Activity Action: Show settings to allow configuration of APNs.
70 * <p>
71 * Input: Nothing.
72 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070073 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080074 */
75 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
76 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
77
78 /**
79 * Activity Action: Show settings to allow configuration of current location
80 * sources.
81 * <p>
82 * In some cases, a matching Activity may not exist, so ensure you
83 * safeguard against this.
84 * <p>
85 * Input: Nothing.
86 * <p>
87 * Output: Nothing.
88 */
89 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
90 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
91 "android.settings.LOCATION_SOURCE_SETTINGS";
92
93 /**
94 * Activity Action: Show settings to allow configuration of wireless controls
95 * such as Wi-Fi, Bluetooth and Mobile networks.
96 * <p>
97 * In some cases, a matching Activity may not exist, so ensure you
98 * safeguard against this.
99 * <p>
100 * Input: Nothing.
101 * <p>
102 * Output: Nothing.
103 */
104 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
105 public static final String ACTION_WIRELESS_SETTINGS =
106 "android.settings.WIRELESS_SETTINGS";
107
108 /**
109 * Activity Action: Show settings to allow entering/exiting airplane mode.
110 * <p>
111 * In some cases, a matching Activity may not exist, so ensure you
112 * safeguard against this.
113 * <p>
114 * Input: Nothing.
115 * <p>
116 * Output: Nothing.
117 */
118 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
119 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
120 "android.settings.AIRPLANE_MODE_SETTINGS";
121
122 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700123 * Activity Action: Show settings for accessibility modules.
124 * <p>
125 * In some cases, a matching Activity may not exist, so ensure you
126 * safeguard against this.
127 * <p>
128 * Input: Nothing.
129 * <p>
130 * Output: Nothing.
131 */
132 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
133 public static final String ACTION_ACCESSIBILITY_SETTINGS =
134 "android.settings.ACCESSIBILITY_SETTINGS";
135
136 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800137 * Activity Action: Show settings to allow configuration of security and
138 * location privacy.
139 * <p>
140 * In some cases, a matching Activity may not exist, so ensure you
141 * safeguard against this.
142 * <p>
143 * Input: Nothing.
144 * <p>
145 * Output: Nothing.
146 */
147 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
148 public static final String ACTION_SECURITY_SETTINGS =
149 "android.settings.SECURITY_SETTINGS";
150
151 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700152 * Activity Action: Show settings to allow configuration of privacy options.
153 * <p>
154 * In some cases, a matching Activity may not exist, so ensure you
155 * safeguard against this.
156 * <p>
157 * Input: Nothing.
158 * <p>
159 * Output: Nothing.
160 */
161 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
162 public static final String ACTION_PRIVACY_SETTINGS =
163 "android.settings.PRIVACY_SETTINGS";
164
165 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800166 * Activity Action: Show settings to allow configuration of Wi-Fi.
167
168 * <p>
169 * In some cases, a matching Activity may not exist, so ensure you
170 * safeguard against this.
171 * <p>
172 * Input: Nothing.
173 * <p>
174 * Output: Nothing.
175
176 */
177 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
178 public static final String ACTION_WIFI_SETTINGS =
179 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700180
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800181 /**
182 * Activity Action: Show settings to allow configuration of a static IP
183 * address for Wi-Fi.
184 * <p>
185 * In some cases, a matching Activity may not exist, so ensure you safeguard
186 * against this.
187 * <p>
188 * Input: Nothing.
189 * <p>
190 * Output: Nothing.
191 */
192 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
193 public static final String ACTION_WIFI_IP_SETTINGS =
194 "android.settings.WIFI_IP_SETTINGS";
195
196 /**
197 * Activity Action: Show settings to allow configuration of Bluetooth.
198 * <p>
199 * In some cases, a matching Activity may not exist, so ensure you
200 * safeguard against this.
201 * <p>
202 * Input: Nothing.
203 * <p>
204 * Output: Nothing.
205 */
206 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
207 public static final String ACTION_BLUETOOTH_SETTINGS =
208 "android.settings.BLUETOOTH_SETTINGS";
209
210 /**
211 * Activity Action: Show settings to allow configuration of date and time.
212 * <p>
213 * In some cases, a matching Activity may not exist, so ensure you
214 * safeguard against this.
215 * <p>
216 * Input: Nothing.
217 * <p>
218 * Output: Nothing.
219 */
220 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
221 public static final String ACTION_DATE_SETTINGS =
222 "android.settings.DATE_SETTINGS";
223
224 /**
225 * Activity Action: Show settings to allow configuration of sound and volume.
226 * <p>
227 * In some cases, a matching Activity may not exist, so ensure you
228 * safeguard against this.
229 * <p>
230 * Input: Nothing.
231 * <p>
232 * Output: Nothing.
233 */
234 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
235 public static final String ACTION_SOUND_SETTINGS =
236 "android.settings.SOUND_SETTINGS";
237
238 /**
239 * Activity Action: Show settings to allow configuration of display.
240 * <p>
241 * In some cases, a matching Activity may not exist, so ensure you
242 * safeguard against this.
243 * <p>
244 * Input: Nothing.
245 * <p>
246 * Output: Nothing.
247 */
248 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
249 public static final String ACTION_DISPLAY_SETTINGS =
250 "android.settings.DISPLAY_SETTINGS";
251
252 /**
253 * Activity Action: Show settings to allow configuration of locale.
254 * <p>
255 * In some cases, a matching Activity may not exist, so ensure you
256 * safeguard against this.
257 * <p>
258 * Input: Nothing.
259 * <p>
260 * Output: Nothing.
261 */
262 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
263 public static final String ACTION_LOCALE_SETTINGS =
264 "android.settings.LOCALE_SETTINGS";
265
266 /**
267 * Activity Action: Show settings to configure input methods, in particular
268 * allowing the user to enable input methods.
269 * <p>
270 * In some cases, a matching Activity may not exist, so ensure you
271 * safeguard against this.
272 * <p>
273 * Input: Nothing.
274 * <p>
275 * Output: Nothing.
276 */
277 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
278 public static final String ACTION_INPUT_METHOD_SETTINGS =
279 "android.settings.INPUT_METHOD_SETTINGS";
280
281 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900282 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900283 * <p>
284 * In some cases, a matching Activity may not exist, so ensure you
285 * safeguard against this.
286 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900287 * To tell which input method's subtypes are displayed in the settings, add
288 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
289 * If there is no extra in this Intent, subtypes from all installed input methods
290 * will be displayed in the settings.
291 *
292 * @see android.view.inputmethod.InputMethodInfo#getId
293 * <p>
satok86417ea2010-10-27 14:11:03 +0900294 * Input: Nothing.
295 * <p>
296 * Output: Nothing.
297 */
298 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900299 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
300 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900301
302 /**
satok7cfc0ed2011-06-20 21:29:36 +0900303 * Activity Action: Show a dialog to select input method.
304 * <p>
305 * In some cases, a matching Activity may not exist, so ensure you
306 * safeguard against this.
307 * <p>
308 * Input: Nothing.
309 * <p>
310 * Output: Nothing.
311 * @hide
312 */
313 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
314 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
315 "android.settings.SHOW_INPUT_METHOD_PICKER";
316
317 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800318 * Activity Action: Show settings to manage the user input dictionary.
319 * <p>
320 * In some cases, a matching Activity may not exist, so ensure you
321 * safeguard against this.
322 * <p>
323 * Input: Nothing.
324 * <p>
325 * Output: Nothing.
326 */
327 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
328 public static final String ACTION_USER_DICTIONARY_SETTINGS =
329 "android.settings.USER_DICTIONARY_SETTINGS";
330
331 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700332 * Activity Action: Adds a word to the user dictionary.
333 * <p>
334 * In some cases, a matching Activity may not exist, so ensure you
335 * safeguard against this.
336 * <p>
337 * Input: An extra with key <code>word</code> that contains the word
338 * that should be added to the dictionary.
339 * <p>
340 * Output: Nothing.
341 *
342 * @hide
343 */
344 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
345 public static final String ACTION_USER_DICTIONARY_INSERT =
346 "com.android.settings.USER_DICTIONARY_INSERT";
347
348 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800349 * Activity Action: Show settings to allow configuration of application-related settings.
350 * <p>
351 * In some cases, a matching Activity may not exist, so ensure you
352 * safeguard against this.
353 * <p>
354 * Input: Nothing.
355 * <p>
356 * Output: Nothing.
357 */
358 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
359 public static final String ACTION_APPLICATION_SETTINGS =
360 "android.settings.APPLICATION_SETTINGS";
361
362 /**
363 * Activity Action: Show settings to allow configuration of application
364 * development-related settings.
365 * <p>
366 * In some cases, a matching Activity may not exist, so ensure you safeguard
367 * against this.
368 * <p>
369 * Input: Nothing.
370 * <p>
371 * Output: Nothing.
372 */
373 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
374 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
375 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
376
377 /**
378 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
379 * <p>
380 * In some cases, a matching Activity may not exist, so ensure you
381 * safeguard against this.
382 * <p>
383 * Input: Nothing.
384 * <p>
385 * Output: Nothing.
386 */
387 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
388 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
389 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700390
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800391 /**
392 * Activity Action: Show settings to manage installed applications.
393 * <p>
394 * In some cases, a matching Activity may not exist, so ensure you
395 * safeguard against this.
396 * <p>
397 * Input: Nothing.
398 * <p>
399 * Output: Nothing.
400 */
401 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
402 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
403 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700404
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800405 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700406 * Activity Action: Show settings to manage all applications.
407 * <p>
408 * In some cases, a matching Activity may not exist, so ensure you
409 * safeguard against this.
410 * <p>
411 * Input: Nothing.
412 * <p>
413 * Output: Nothing.
414 */
415 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
416 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
417 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
418
419 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700420 * Activity Action: Show screen of details about a particular application.
421 * <p>
422 * In some cases, a matching Activity may not exist, so ensure you
423 * safeguard against this.
424 * <p>
425 * Input: The Intent's data URI specifies the application package name
426 * to be shown, with the "package" scheme. That is "package:com.my.app".
427 * <p>
428 * Output: Nothing.
429 */
430 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
431 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
432 "android.settings.APPLICATION_DETAILS_SETTINGS";
433
434 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800435 * Activity Action: Show settings for system update functionality.
436 * <p>
437 * In some cases, a matching Activity may not exist, so ensure you
438 * safeguard against this.
439 * <p>
440 * Input: Nothing.
441 * <p>
442 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700443 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800444 * @hide
445 */
446 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
447 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
448 "android.settings.SYSTEM_UPDATE_SETTINGS";
449
450 /**
451 * Activity Action: Show settings to allow configuration of sync settings.
452 * <p>
453 * In some cases, a matching Activity may not exist, so ensure you
454 * safeguard against this.
455 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800456 * The account types available to add via the add account button may be restricted by adding an
457 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
458 * authorities. Only account types which can sync with that content provider will be offered to
459 * the user.
460 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800461 * Input: Nothing.
462 * <p>
463 * Output: Nothing.
464 */
465 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
466 public static final String ACTION_SYNC_SETTINGS =
467 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700468
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800469 /**
Erikeebc8e22010-02-18 13:27:19 -0800470 * Activity Action: Show add account screen for creating a new account.
471 * <p>
472 * In some cases, a matching Activity may not exist, so ensure you
473 * safeguard against this.
474 * <p>
475 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
476 * extra to the Intent with one or more syncable content provider's authorities. Only account
477 * types which can sync with that content provider will be offered to the user.
478 * <p>
479 * Input: Nothing.
480 * <p>
481 * Output: Nothing.
482 */
483 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
484 public static final String ACTION_ADD_ACCOUNT =
485 "android.settings.ADD_ACCOUNT_SETTINGS";
486
487 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800488 * Activity Action: Show settings for selecting the network operator.
489 * <p>
490 * In some cases, a matching Activity may not exist, so ensure you
491 * safeguard against this.
492 * <p>
493 * Input: Nothing.
494 * <p>
495 * Output: Nothing.
496 */
497 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
498 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
499 "android.settings.NETWORK_OPERATOR_SETTINGS";
500
501 /**
502 * Activity Action: Show settings for selection of 2G/3G.
503 * <p>
504 * In some cases, a matching Activity may not exist, so ensure you
505 * safeguard against this.
506 * <p>
507 * Input: Nothing.
508 * <p>
509 * Output: Nothing.
510 */
511 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
512 public static final String ACTION_DATA_ROAMING_SETTINGS =
513 "android.settings.DATA_ROAMING_SETTINGS";
514
515 /**
516 * Activity Action: Show settings for internal storage.
517 * <p>
518 * In some cases, a matching Activity may not exist, so ensure you
519 * safeguard against this.
520 * <p>
521 * Input: Nothing.
522 * <p>
523 * Output: Nothing.
524 */
525 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
526 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
527 "android.settings.INTERNAL_STORAGE_SETTINGS";
528 /**
529 * Activity Action: Show settings for memory card storage.
530 * <p>
531 * In some cases, a matching Activity may not exist, so ensure you
532 * safeguard against this.
533 * <p>
534 * Input: Nothing.
535 * <p>
536 * Output: Nothing.
537 */
538 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
539 public static final String ACTION_MEMORY_CARD_SETTINGS =
540 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700541
Justin Mattsonef340352010-01-13 21:05:46 -0800542 /**
543 * Activity Action: Show settings for global search.
544 * <p>
545 * In some cases, a matching Activity may not exist, so ensure you
546 * safeguard against this.
547 * <p>
548 * Input: Nothing.
549 * <p>
550 * Output: Nothing
551 */
552 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
553 public static final String ACTION_SEARCH_SETTINGS =
554 "android.search.action.SEARCH_SETTINGS";
555
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500556 /**
557 * Activity Action: Show general device information settings (serial
558 * number, software version, phone number, etc.).
559 * <p>
560 * In some cases, a matching Activity may not exist, so ensure you
561 * safeguard against this.
562 * <p>
563 * Input: Nothing.
564 * <p>
565 * Output: Nothing
566 */
567 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
568 public static final String ACTION_DEVICE_INFO_SETTINGS =
569 "android.settings.DEVICE_INFO_SETTINGS";
570
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500571 /**
572 * Activity Action: Show NFC sharing settings.
573 * <p>
574 * In some cases, a matching Activity may not exist, so ensure you
575 * safeguard against this.
576 * <p>
577 * Input: Nothing.
578 * <p>
579 * Output: Nothing
580 */
581 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
582 public static final String ACTION_NFCSHARING_SETTINGS =
583 "android.settings.NFCSHARING_SETTINGS";
584
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800585 // End of Intent actions for Settings
586
Erikeebc8e22010-02-18 13:27:19 -0800587 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800588 * @hide - Private call() method on SettingsProvider to read from 'system' table.
589 */
590 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
591
592 /**
593 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
594 */
595 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
596
597 /**
Erikeebc8e22010-02-18 13:27:19 -0800598 * Activity Extra: Limit available options in launched activity based on the given authority.
599 * <p>
600 * This can be passed as an extra field in an Activity Intent with one or more syncable content
601 * provider's authorities as a String[]. This field is used by some intents to alter the
602 * behavior of the called activity.
603 * <p>
604 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
605 * on the authority given.
606 */
607 public static final String EXTRA_AUTHORITIES =
608 "authorities";
609
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900610 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
611
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800612 private static final String JID_RESOURCE_PREFIX = "android";
613
614 public static final String AUTHORITY = "settings";
615
616 private static final String TAG = "Settings";
Joe Onorato43a17652011-04-06 19:22:23 -0700617 private static final boolean LOCAL_LOGV = false || false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800618
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800619 public static class SettingNotFoundException extends AndroidException {
620 public SettingNotFoundException(String msg) {
621 super(msg);
622 }
623 }
624
625 /**
626 * Common base for tables of name/value settings.
627 */
628 public static class NameValueTable implements BaseColumns {
629 public static final String NAME = "name";
630 public static final String VALUE = "value";
631
632 protected static boolean putString(ContentResolver resolver, Uri uri,
633 String name, String value) {
634 // The database will take care of replacing duplicates.
635 try {
636 ContentValues values = new ContentValues();
637 values.put(NAME, name);
638 values.put(VALUE, value);
639 resolver.insert(uri, values);
640 return true;
641 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -0700642 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800643 return false;
644 }
645 }
646
647 public static Uri getUriFor(Uri uri, String name) {
648 return Uri.withAppendedPath(uri, name);
649 }
650 }
651
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800652 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800653 private static class NameValueCache {
654 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800655 private final Uri mUri;
656
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800657 private static final String[] SELECT_VALUE =
658 new String[] { Settings.NameValueTable.VALUE };
659 private static final String NAME_EQ_PLACEHOLDER = "name=?";
660
661 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -0800662 private final HashMap<String, String> mValues = new HashMap<String, String>();
663 private long mValuesVersion = 0;
664
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800665 // Initially null; set lazily and held forever. Synchronized on 'this'.
666 private IContentProvider mContentProvider = null;
667
668 // The method we'll call (or null, to not use) on the provider
669 // for the fast path of retrieving settings.
670 private final String mCallCommand;
671
672 public NameValueCache(String versionSystemProperty, Uri uri, String callCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800673 mVersionSystemProperty = versionSystemProperty;
674 mUri = uri;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800675 mCallCommand = callCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800676 }
677
Dan Egnor799f7212009-11-24 16:24:44 -0800678 public String getString(ContentResolver cr, String name) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800679 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -0800680
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800681 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -0800682 if (mValuesVersion != newValuesVersion) {
683 if (LOCAL_LOGV) {
684 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current " +
685 newValuesVersion + " != cached " + mValuesVersion);
686 }
687
688 mValues.clear();
689 mValuesVersion = newValuesVersion;
690 }
691
692 if (mValues.containsKey(name)) {
693 return mValues.get(name); // Could be null, that's OK -- negative caching
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800694 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800695 }
Dan Egnor799f7212009-11-24 16:24:44 -0800696
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800697 IContentProvider cp = null;
698 synchronized (this) {
699 cp = mContentProvider;
700 if (cp == null) {
701 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
702 }
703 }
704
705 // Try the fast path first, not using query(). If this
706 // fails (alternate Settings provider that doesn't support
707 // this interface?) then we fall back to the query/table
708 // interface.
709 if (mCallCommand != null) {
710 try {
711 Bundle b = cp.call(mCallCommand, name, null);
712 if (b != null) {
713 String value = b.getPairValue();
714 synchronized (this) {
715 mValues.put(name, value);
716 }
717 return value;
718 }
719 // If the response Bundle is null, we fall through
720 // to the query interface below.
721 } catch (RemoteException e) {
722 // Not supported by the remote side? Fall through
723 // to query().
724 }
725 }
726
Dan Egnor799f7212009-11-24 16:24:44 -0800727 Cursor c = null;
728 try {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800729 c = cp.query(mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
730 new String[]{name}, null);
Dan Egnor799f7212009-11-24 16:24:44 -0800731 if (c == null) {
732 Log.w(TAG, "Can't get key " + name + " from " + mUri);
733 return null;
734 }
735
736 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800737 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -0800738 mValues.put(name, value);
739 }
740 if (LOCAL_LOGV) {
741 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
742 name + " = " + (value == null ? "(null)" : value));
743 }
744 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800745 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -0800746 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
747 return null; // Return null, but don't cache it.
748 } finally {
749 if (c != null) c.close();
750 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800751 }
752 }
753
754 /**
755 * System settings, containing miscellaneous system preferences. This
756 * table holds simple name/value pairs. There are convenience
757 * functions for accessing individual settings entries.
758 */
759 public static final class System extends NameValueTable {
760 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
761
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800762 // Populated lazily, guarded by class object:
763 private static NameValueCache sNameValueCache = null;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700764
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800765 private static final HashSet<String> MOVED_TO_SECURE;
766 static {
767 MOVED_TO_SECURE = new HashSet<String>(30);
768 MOVED_TO_SECURE.add(Secure.ADB_ENABLED);
769 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
770 MOVED_TO_SECURE.add(Secure.BLUETOOTH_ON);
771 MOVED_TO_SECURE.add(Secure.DATA_ROAMING);
772 MOVED_TO_SECURE.add(Secure.DEVICE_PROVISIONED);
773 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
774 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
775 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Amith Yamasani156c4352010-03-05 17:10:03 -0800776 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
777 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
778 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800779 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
780 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
781 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
782 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
783 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
784 MOVED_TO_SECURE.add(Secure.USB_MASS_STORAGE_ENABLED);
785 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
786 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
787 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
788 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
789 MOVED_TO_SECURE.add(Secure.WIFI_ON);
790 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
791 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
792 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
793 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
794 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
795 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
796 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
797 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
798 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
799 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
800 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
801 }
802
803 /**
804 * Look up a name in the database.
805 * @param resolver to access the database with
806 * @param name to look up in the table
807 * @return the corresponding value, or null if not present
808 */
809 public synchronized static String getString(ContentResolver resolver, String name) {
810 if (MOVED_TO_SECURE.contains(name)) {
811 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
812 + " to android.provider.Settings.Secure, returning read-only value.");
813 return Secure.getString(resolver, name);
814 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800815 if (sNameValueCache == null) {
816 sNameValueCache = new NameValueCache(SYS_PROP_SETTING_VERSION, CONTENT_URI,
817 CALL_METHOD_GET_SYSTEM);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800818 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800819 return sNameValueCache.getString(resolver, name);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800820 }
821
822 /**
823 * Store a name/value pair into the database.
824 * @param resolver to access the database with
825 * @param name to store
826 * @param value to associate with the name
827 * @return true if the value was set, false on database errors
828 */
829 public static boolean putString(ContentResolver resolver, String name, String value) {
830 if (MOVED_TO_SECURE.contains(name)) {
831 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
832 + " to android.provider.Settings.Secure, value is unchanged.");
833 return false;
834 }
835 return putString(resolver, CONTENT_URI, name, value);
836 }
837
838 /**
839 * Construct the content URI for a particular name/value pair,
840 * useful for monitoring changes with a ContentObserver.
841 * @param name to look up in the table
842 * @return the corresponding content URI, or null if not present
843 */
844 public static Uri getUriFor(String name) {
845 if (MOVED_TO_SECURE.contains(name)) {
846 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
847 + " to android.provider.Settings.Secure, returning Secure URI.");
848 return Secure.getUriFor(Secure.CONTENT_URI, name);
849 }
850 return getUriFor(CONTENT_URI, name);
851 }
852
853 /**
854 * Convenience function for retrieving a single system settings value
855 * as an integer. Note that internally setting values are always
856 * stored as strings; this function converts the string to an integer
857 * for you. The default value will be returned if the setting is
858 * not defined or not an integer.
859 *
860 * @param cr The ContentResolver to access.
861 * @param name The name of the setting to retrieve.
862 * @param def Value to return if the setting is not defined.
863 *
864 * @return The setting's current value, or 'def' if it is not defined
865 * or not a valid integer.
866 */
867 public static int getInt(ContentResolver cr, String name, int def) {
868 String v = getString(cr, name);
869 try {
870 return v != null ? Integer.parseInt(v) : def;
871 } catch (NumberFormatException e) {
872 return def;
873 }
874 }
875
876 /**
877 * Convenience function for retrieving a single system settings value
878 * as an integer. Note that internally setting values are always
879 * stored as strings; this function converts the string to an integer
880 * for you.
881 * <p>
882 * This version does not take a default value. If the setting has not
883 * been set, or the string value is not a number,
884 * it throws {@link SettingNotFoundException}.
885 *
886 * @param cr The ContentResolver to access.
887 * @param name The name of the setting to retrieve.
888 *
889 * @throws SettingNotFoundException Thrown if a setting by the given
890 * name can't be found or the setting value is not an integer.
891 *
892 * @return The setting's current value.
893 */
894 public static int getInt(ContentResolver cr, String name)
895 throws SettingNotFoundException {
896 String v = getString(cr, name);
897 try {
898 return Integer.parseInt(v);
899 } catch (NumberFormatException e) {
900 throw new SettingNotFoundException(name);
901 }
902 }
903
904 /**
905 * Convenience function for updating a single settings value as an
906 * integer. This will either create a new entry in the table if the
907 * given name does not exist, or modify the value of the existing row
908 * with that name. Note that internally setting values are always
909 * stored as strings, so this function converts the given value to a
910 * string before storing it.
911 *
912 * @param cr The ContentResolver to access.
913 * @param name The name of the setting to modify.
914 * @param value The new value for the setting.
915 * @return true if the value was set, false on database errors
916 */
917 public static boolean putInt(ContentResolver cr, String name, int value) {
918 return putString(cr, name, Integer.toString(value));
919 }
920
921 /**
922 * Convenience function for retrieving a single system settings value
923 * as a {@code long}. Note that internally setting values are always
924 * stored as strings; this function converts the string to a {@code long}
925 * for you. The default value will be returned if the setting is
926 * not defined or not a {@code long}.
927 *
928 * @param cr The ContentResolver to access.
929 * @param name The name of the setting to retrieve.
930 * @param def Value to return if the setting is not defined.
931 *
932 * @return The setting's current value, or 'def' if it is not defined
933 * or not a valid {@code long}.
934 */
935 public static long getLong(ContentResolver cr, String name, long def) {
936 String valString = getString(cr, name);
937 long value;
938 try {
939 value = valString != null ? Long.parseLong(valString) : def;
940 } catch (NumberFormatException e) {
941 value = def;
942 }
943 return value;
944 }
945
946 /**
947 * Convenience function for retrieving a single system settings value
948 * as a {@code long}. Note that internally setting values are always
949 * stored as strings; this function converts the string to a {@code long}
950 * for you.
951 * <p>
952 * This version does not take a default value. If the setting has not
953 * been set, or the string value is not a number,
954 * it throws {@link SettingNotFoundException}.
955 *
956 * @param cr The ContentResolver to access.
957 * @param name The name of the setting to retrieve.
958 *
959 * @return The setting's current value.
960 * @throws SettingNotFoundException Thrown if a setting by the given
961 * name can't be found or the setting value is not an integer.
962 */
963 public static long getLong(ContentResolver cr, String name)
964 throws SettingNotFoundException {
965 String valString = getString(cr, name);
966 try {
967 return Long.parseLong(valString);
968 } catch (NumberFormatException e) {
969 throw new SettingNotFoundException(name);
970 }
971 }
972
973 /**
974 * Convenience function for updating a single settings value as a long
975 * integer. This will either create a new entry in the table if the
976 * given name does not exist, or modify the value of the existing row
977 * with that name. Note that internally setting values are always
978 * stored as strings, so this function converts the given value to a
979 * string before storing it.
980 *
981 * @param cr The ContentResolver to access.
982 * @param name The name of the setting to modify.
983 * @param value The new value for the setting.
984 * @return true if the value was set, false on database errors
985 */
986 public static boolean putLong(ContentResolver cr, String name, long value) {
987 return putString(cr, name, Long.toString(value));
988 }
989
990 /**
991 * Convenience function for retrieving a single system settings value
992 * as a floating point number. Note that internally setting values are
993 * always stored as strings; this function converts the string to an
994 * float for you. The default value will be returned if the setting
995 * is not defined or not a valid float.
996 *
997 * @param cr The ContentResolver to access.
998 * @param name The name of the setting to retrieve.
999 * @param def Value to return if the setting is not defined.
1000 *
1001 * @return The setting's current value, or 'def' if it is not defined
1002 * or not a valid float.
1003 */
1004 public static float getFloat(ContentResolver cr, String name, float def) {
1005 String v = getString(cr, name);
1006 try {
1007 return v != null ? Float.parseFloat(v) : def;
1008 } catch (NumberFormatException e) {
1009 return def;
1010 }
1011 }
1012
1013 /**
1014 * Convenience function for retrieving a single system settings value
1015 * as a float. Note that internally setting values are always
1016 * stored as strings; this function converts the string to a float
1017 * for you.
1018 * <p>
1019 * This version does not take a default value. If the setting has not
1020 * been set, or the string value is not a number,
1021 * it throws {@link SettingNotFoundException}.
1022 *
1023 * @param cr The ContentResolver to access.
1024 * @param name The name of the setting to retrieve.
1025 *
1026 * @throws SettingNotFoundException Thrown if a setting by the given
1027 * name can't be found or the setting value is not a float.
1028 *
1029 * @return The setting's current value.
1030 */
1031 public static float getFloat(ContentResolver cr, String name)
1032 throws SettingNotFoundException {
1033 String v = getString(cr, name);
Brian Muramatsue1d46982010-12-06 17:34:20 -08001034 if (v == null) {
1035 throw new SettingNotFoundException(name);
1036 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001037 try {
1038 return Float.parseFloat(v);
1039 } catch (NumberFormatException e) {
1040 throw new SettingNotFoundException(name);
1041 }
1042 }
1043
1044 /**
1045 * Convenience function for updating a single settings value as a
1046 * floating point number. This will either create a new entry in the
1047 * table if the given name does not exist, or modify the value of the
1048 * existing row with that name. Note that internally setting values
1049 * are always stored as strings, so this function converts the given
1050 * value to a string before storing it.
1051 *
1052 * @param cr The ContentResolver to access.
1053 * @param name The name of the setting to modify.
1054 * @param value The new value for the setting.
1055 * @return true if the value was set, false on database errors
1056 */
1057 public static boolean putFloat(ContentResolver cr, String name, float value) {
1058 return putString(cr, name, Float.toString(value));
1059 }
1060
1061 /**
1062 * Convenience function to read all of the current
1063 * configuration-related settings into a
1064 * {@link Configuration} object.
1065 *
1066 * @param cr The ContentResolver to access.
1067 * @param outConfig Where to place the configuration settings.
1068 */
1069 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
1070 outConfig.fontScale = Settings.System.getFloat(
1071 cr, FONT_SCALE, outConfig.fontScale);
1072 if (outConfig.fontScale < 0) {
1073 outConfig.fontScale = 1;
1074 }
1075 }
1076
1077 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001078 * @hide Erase the fields in the Configuration that should be applied
1079 * by the settings.
1080 */
1081 public static void clearConfiguration(Configuration inoutConfig) {
1082 inoutConfig.fontScale = 0;
1083 }
Narayan Kamath6d632962011-08-24 11:51:37 +01001084
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001085 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001086 * Convenience function to write a batch of configuration-related
1087 * settings from a {@link Configuration} object.
1088 *
1089 * @param cr The ContentResolver to access.
1090 * @param config The settings to write.
1091 * @return true if the values were set, false on database errors
1092 */
1093 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
1094 return Settings.System.putFloat(cr, FONT_SCALE, config.fontScale);
1095 }
1096
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001097 /** @hide */
1098 public static boolean hasInterestingConfigurationChanges(int changes) {
1099 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1100 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001101
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001102 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
1103 return getInt(cr, SHOW_GTALK_SERVICE_STATUS, 0) != 0;
1104 }
1105
1106 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
1107 putInt(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0);
1108 }
1109
1110 /**
1111 * The content:// style URL for this table
1112 */
1113 public static final Uri CONTENT_URI =
1114 Uri.parse("content://" + AUTHORITY + "/system");
1115
1116 /**
1117 * Whether we keep the device on while the device is plugged in.
1118 * Supported values are:
1119 * <ul>
1120 * <li>{@code 0} to never stay on while plugged in</li>
1121 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
1122 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
1123 * </ul>
1124 * These values can be OR-ed together.
1125 */
1126 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
1127
1128 /**
1129 * What happens when the user presses the end call button if they're not
1130 * on a call.<br/>
1131 * <b>Values:</b><br/>
1132 * 0 - The end button does nothing.<br/>
1133 * 1 - The end button goes to the home screen.<br/>
1134 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1135 * 3 - The end button goes to the home screen. If the user is already on the
1136 * home screen, it puts the device to sleep.
1137 */
1138 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1139
1140 /**
David Brown458e8062010-03-08 21:52:11 -08001141 * END_BUTTON_BEHAVIOR value for "go home".
1142 * @hide
1143 */
1144 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1145
1146 /**
1147 * END_BUTTON_BEHAVIOR value for "go to sleep".
1148 * @hide
1149 */
1150 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
1151
1152 /**
1153 * END_BUTTON_BEHAVIOR default value.
1154 * @hide
1155 */
1156 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
1157
1158 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07001159 * Is advanced settings mode turned on. 0 == no, 1 == yes
1160 * @hide
1161 */
1162 public static final String ADVANCED_SETTINGS = "advanced_settings";
1163
1164 /**
1165 * ADVANCED_SETTINGS default value.
1166 * @hide
1167 */
1168 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
1169
1170 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001171 * Whether Airplane Mode is on.
1172 */
1173 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
1174
1175 /**
1176 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
1177 */
1178 public static final String RADIO_BLUETOOTH = "bluetooth";
1179
1180 /**
1181 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
1182 */
1183 public static final String RADIO_WIFI = "wifi";
1184
Robert Greenwalt8588e472011-11-08 10:12:25 -08001185 /**
1186 * {@hide}
1187 */
tk.mun148c7d02011-10-13 22:51:57 +09001188 public static final String RADIO_WIMAX = "wimax";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001189 /**
1190 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
1191 */
1192 public static final String RADIO_CELL = "cell";
1193
1194 /**
Nick Pelly8d32a012011-08-09 07:03:49 -07001195 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
1196 */
1197 public static final String RADIO_NFC = "nfc";
1198
1199 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001200 * A comma separated list of radios that need to be disabled when airplane mode
1201 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
1202 * included in the comma separated list.
1203 */
1204 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
1205
1206 /**
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001207 * A comma separated list of radios that should to be disabled when airplane mode
1208 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
1209 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
1210 * will be turned off when entering airplane mode, but the user will be able to reenable
1211 * Wifi in the Settings app.
1212 *
1213 * {@hide}
1214 */
1215 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
1216
1217 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001218 * The policy for deciding when Wi-Fi should go to sleep (which will in
1219 * turn switch to using the mobile data as an Internet connection).
1220 * <p>
1221 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
1222 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
1223 * {@link #WIFI_SLEEP_POLICY_NEVER}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001224 */
1225 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
1226
1227 /**
1228 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
1229 * policy, which is to sleep shortly after the turning off
1230 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001231 */
1232 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
1233
1234 /**
1235 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
1236 * the device is on battery, and never go to sleep when the device is
1237 * plugged in.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001238 */
1239 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001240
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001241 /**
1242 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001243 */
1244 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001245
Irfan Sheriff31b62322010-08-30 12:26:00 -07001246 //TODO: deprecate static IP constants
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001247 /**
1248 * Whether to use static IP and other static network attributes.
1249 * <p>
1250 * Set to 1 for true and 0 for false.
1251 */
1252 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
1253
1254 /**
1255 * The static IP address.
1256 * <p>
1257 * Example: "192.168.1.51"
1258 */
1259 public static final String WIFI_STATIC_IP = "wifi_static_ip";
1260
1261 /**
1262 * If using static IP, the gateway's IP address.
1263 * <p>
1264 * Example: "192.168.1.1"
1265 */
1266 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
1267
1268 /**
1269 * If using static IP, the net mask.
1270 * <p>
1271 * Example: "255.255.255.0"
1272 */
1273 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
1274
1275 /**
1276 * If using static IP, the primary DNS's IP address.
1277 * <p>
1278 * Example: "192.168.1.1"
1279 */
1280 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
1281
1282 /**
1283 * If using static IP, the secondary DNS's IP address.
1284 * <p>
1285 * Example: "192.168.1.2"
1286 */
1287 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
1288
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001289
1290 /**
1291 * Determines whether remote devices may discover and/or connect to
1292 * this device.
1293 * <P>Type: INT</P>
1294 * 2 -- discoverable and connectable
1295 * 1 -- connectable but not discoverable
1296 * 0 -- neither connectable nor discoverable
1297 */
1298 public static final String BLUETOOTH_DISCOVERABILITY =
1299 "bluetooth_discoverability";
1300
1301 /**
1302 * Bluetooth discoverability timeout. If this value is nonzero, then
1303 * Bluetooth becomes discoverable for a certain number of seconds,
1304 * after which is becomes simply connectable. The value is in seconds.
1305 */
1306 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
1307 "bluetooth_discoverability_timeout";
1308
1309 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001310 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
1311 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001312 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001313 @Deprecated
1314 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001315
1316 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001317 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
1318 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001319 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001320 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001321 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
1322
1323 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001324 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08001325 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
1326 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001327 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001328 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001329 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
1330 "lock_pattern_tactile_feedback_enabled";
1331
1332
1333 /**
1334 * A formatted string of the next alarm that is set, or the empty string
1335 * if there is no alarm set.
1336 */
1337 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
1338
1339 /**
1340 * Scaling factor for fonts, float.
1341 */
1342 public static final String FONT_SCALE = "font_scale";
1343
1344 /**
1345 * Name of an application package to be debugged.
1346 */
1347 public static final String DEBUG_APP = "debug_app";
1348
1349 /**
1350 * If 1, when launching DEBUG_APP it will wait for the debugger before
1351 * starting user code. If 0, it will run normally.
1352 */
1353 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
1354
1355 /**
1356 * Whether or not to dim the screen. 0=no 1=yes
1357 */
1358 public static final String DIM_SCREEN = "dim_screen";
1359
1360 /**
1361 * The timeout before the screen turns off.
1362 */
1363 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
1364
1365 /**
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001366 * If 0, the compatibility mode is off for all applications.
1367 * If 1, older applications run under compatibility mode.
1368 * TODO: remove this settings before code freeze (bug/1907571)
1369 * @hide
1370 */
1371 public static final String COMPATIBILITY_MODE = "compatibility_mode";
1372
1373 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001374 * The screen backlight brightness between 0 and 255.
1375 */
1376 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
1377
1378 /**
Dan Murphy951764b2009-08-27 14:59:03 -05001379 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05001380 */
1381 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
1382
1383 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001384 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001385 */
1386 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
1387
1388 /**
1389 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001390 */
1391 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
1392
1393 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001394 * Control whether the process CPU usage meter should be shown.
1395 */
1396 public static final String SHOW_PROCESSES = "show_processes";
1397
1398 /**
1399 * If 1, the activity manager will aggressively finish activities and
1400 * processes as soon as they are no longer needed. If 0, the normal
1401 * extended lifetime is used.
1402 */
1403 public static final String ALWAYS_FINISH_ACTIVITIES =
1404 "always_finish_activities";
1405
1406
1407 /**
1408 * Ringer mode. This is used internally, changing this value will not
1409 * change the ringer mode. See AudioManager.
1410 */
1411 public static final String MODE_RINGER = "mode_ringer";
1412
1413 /**
1414 * Determines which streams are affected by ringer mode changes. The
1415 * stream type's bit should be set to 1 if it should be muted when going
1416 * into an inaudible ringer mode.
1417 */
1418 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
1419
1420 /**
1421 * Determines which streams are affected by mute. The
1422 * stream type's bit should be set to 1 if it should be muted when a mute request
1423 * is received.
1424 */
1425 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
1426
1427 /**
1428 * Whether vibrate is on for different events. This is used internally,
1429 * changing this value will not change the vibrate. See AudioManager.
1430 */
1431 public static final String VIBRATE_ON = "vibrate_on";
1432
1433 /**
1434 * Ringer volume. This is used internally, changing this value will not
1435 * change the volume. See AudioManager.
1436 */
1437 public static final String VOLUME_RING = "volume_ring";
1438
1439 /**
1440 * System/notifications volume. This is used internally, changing this
1441 * value will not change the volume. See AudioManager.
1442 */
1443 public static final String VOLUME_SYSTEM = "volume_system";
1444
1445 /**
1446 * Voice call volume. This is used internally, changing this value will
1447 * not change the volume. See AudioManager.
1448 */
1449 public static final String VOLUME_VOICE = "volume_voice";
1450
1451 /**
1452 * Music/media/gaming volume. This is used internally, changing this
1453 * value will not change the volume. See AudioManager.
1454 */
1455 public static final String VOLUME_MUSIC = "volume_music";
1456
1457 /**
1458 * Alarm volume. This is used internally, changing this
1459 * value will not change the volume. See AudioManager.
1460 */
1461 public static final String VOLUME_ALARM = "volume_alarm";
1462
1463 /**
1464 * Notification volume. This is used internally, changing this
1465 * value will not change the volume. See AudioManager.
1466 */
1467 public static final String VOLUME_NOTIFICATION = "volume_notification";
1468
1469 /**
Eric Laurent484d2882009-12-08 09:05:45 -08001470 * Bluetooth Headset volume. This is used internally, changing this value will
1471 * not change the volume. See AudioManager.
1472 */
1473 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
1474
1475 /**
Amith Yamasani42722bf2011-07-22 10:34:27 -07001476 * Whether the notifications should use the ring volume (value of 1) or a separate
1477 * notification volume (value of 0). In most cases, users will have this enabled so the
1478 * notification and ringer volumes will be the same. However, power users can disable this
1479 * and use the separate notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001480 * <p>
Amith Yamasani42722bf2011-07-22 10:34:27 -07001481 * Note: This is a one-off setting that will be removed in the future when there is profile
1482 * support. For this reason, it is kept hidden from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001483 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001484 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07001485 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001486 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07001487 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001488 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001489 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001490
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001491 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05001492 * Whether silent mode should allow vibration feedback. This is used
1493 * internally in AudioService and the Sound settings activity to
1494 * coordinate decoupling of vibrate and silent modes. This setting
1495 * will likely be removed in a future release with support for
1496 * audio/vibe feedback profiles.
1497 *
1498 * @hide
1499 */
1500 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
1501
1502 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001503 * The mapping of stream type (integer) to its setting.
1504 */
1505 public static final String[] VOLUME_SETTINGS = {
1506 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08001507 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001508 };
1509
1510 /**
1511 * Appended to various volume related settings to record the previous
1512 * values before they the settings were affected by a silent/vibrate
1513 * ringer mode change.
1514 */
1515 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
1516
1517 /**
1518 * Persistent store for the system-wide default ringtone URI.
1519 * <p>
1520 * If you need to play the default ringtone at any given time, it is recommended
1521 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
1522 * to the set default ringtone at the time of playing.
1523 *
1524 * @see #DEFAULT_RINGTONE_URI
1525 */
1526 public static final String RINGTONE = "ringtone";
1527
1528 /**
1529 * A {@link Uri} that will point to the current default ringtone at any
1530 * given time.
1531 * <p>
1532 * If the current default ringtone is in the DRM provider and the caller
1533 * does not have permission, the exception will be a
1534 * FileNotFoundException.
1535 */
1536 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
1537
1538 /**
1539 * Persistent store for the system-wide default notification sound.
1540 *
1541 * @see #RINGTONE
1542 * @see #DEFAULT_NOTIFICATION_URI
1543 */
1544 public static final String NOTIFICATION_SOUND = "notification_sound";
1545
1546 /**
1547 * A {@link Uri} that will point to the current default notification
1548 * sound at any given time.
1549 *
1550 * @see #DEFAULT_RINGTONE_URI
1551 */
1552 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
1553
1554 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07001555 * Persistent store for the system-wide default alarm alert.
1556 *
1557 * @see #RINGTONE
1558 * @see #DEFAULT_ALARM_ALERT_URI
1559 */
1560 public static final String ALARM_ALERT = "alarm_alert";
1561
1562 /**
1563 * A {@link Uri} that will point to the current default alarm alert at
1564 * any given time.
1565 *
1566 * @see #DEFAULT_ALARM_ALERT_URI
1567 */
1568 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
1569
1570 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07001571 * Persistent store for the system default media button event receiver.
1572 *
1573 * @hide
1574 */
1575 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
1576
1577 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001578 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
1579 */
1580 public static final String TEXT_AUTO_REPLACE = "auto_replace";
1581
1582 /**
1583 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
1584 */
1585 public static final String TEXT_AUTO_CAPS = "auto_caps";
1586
1587 /**
1588 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
1589 * feature converts two spaces to a "." and space.
1590 */
1591 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001592
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001593 /**
1594 * Setting to showing password characters in text editors. 1 = On, 0 = Off
1595 */
1596 public static final String TEXT_SHOW_PASSWORD = "show_password";
1597
1598 public static final String SHOW_GTALK_SERVICE_STATUS =
1599 "SHOW_GTALK_SERVICE_STATUS";
1600
1601 /**
1602 * Name of activity to use for wallpaper on the home screen.
1603 */
1604 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
1605
1606 /**
1607 * Value to specify if the user prefers the date, time and time zone
1608 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
1609 */
1610 public static final String AUTO_TIME = "auto_time";
1611
1612 /**
Amith Yamasaniad450be2010-09-16 16:47:00 -07001613 * Value to specify if the user prefers the time zone
1614 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
1615 */
1616 public static final String AUTO_TIME_ZONE = "auto_time_zone";
1617
1618 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001619 * Display times as 12 or 24 hours
1620 * 12
1621 * 24
1622 */
1623 public static final String TIME_12_24 = "time_12_24";
1624
1625 /**
1626 * Date format string
1627 * mm/dd/yyyy
1628 * dd/mm/yyyy
1629 * yyyy/mm/dd
1630 */
1631 public static final String DATE_FORMAT = "date_format";
1632
1633 /**
1634 * Whether the setup wizard has been run before (on first boot), or if
1635 * it still needs to be run.
1636 *
1637 * nonzero = it has been run in the past
1638 * 0 = it has not been run in the past
1639 */
1640 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
1641
1642 /**
1643 * Scaling factor for normal window animations. Setting to 0 will disable window
1644 * animations.
1645 */
1646 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
1647
1648 /**
1649 * Scaling factor for activity transition animations. Setting to 0 will disable window
1650 * animations.
1651 */
1652 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
1653
1654 /**
1655 * Scaling factor for normal window animations. Setting to 0 will disable window
1656 * animations.
1657 * @hide
1658 */
1659 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
1660
1661 /**
1662 * Control whether the accelerometer will be used to change screen
1663 * orientation. If 0, it will not be used unless explicitly requested
1664 * by the application; if 1, it will be used by default unless explicitly
1665 * disabled by the application.
1666 */
1667 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
1668
1669 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04001670 * Default screen rotation when no other policy applies.
1671 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
1672 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08001673 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04001674 *
1675 * @see Display#getRotation
1676 */
1677 public static final String USER_ROTATION = "user_rotation";
1678
1679 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001680 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
1681 * boolean (1 or 0).
1682 */
1683 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
1684
1685 /**
David Kraused0f67152009-06-13 18:01:13 -05001686 * CDMA only settings
1687 * DTMF tone type played by the dialer when dialing.
1688 * 0 = Normal
1689 * 1 = Long
1690 * @hide
1691 */
1692 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
1693
1694 /**
1695 * CDMA only settings
1696 * Emergency Tone 0 = Off
1697 * 1 = Alert
1698 * 2 = Vibrate
1699 * @hide
1700 */
1701 public static final String EMERGENCY_TONE = "emergency_tone";
1702
1703 /**
1704 * CDMA only settings
1705 * Whether the auto retry is enabled. The value is
1706 * boolean (1 or 0).
1707 * @hide
1708 */
1709 public static final String CALL_AUTO_RETRY = "call_auto_retry";
1710
1711 /**
1712 * Whether the hearing aid is enabled. The value is
1713 * boolean (1 or 0).
1714 * @hide
1715 */
1716 public static final String HEARING_AID = "hearing_aid";
1717
1718 /**
1719 * CDMA only settings
1720 * TTY Mode
1721 * 0 = OFF
1722 * 1 = FULL
1723 * 2 = VCO
1724 * 3 = HCO
1725 * @hide
1726 */
1727 public static final String TTY_MODE = "tty_mode";
1728
1729 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001730 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
1731 * boolean (1 or 0).
1732 */
1733 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001734
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001735 /**
1736 * Whether the haptic feedback (long presses, ...) are enabled. The value is
1737 * boolean (1 or 0).
1738 */
1739 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07001740
Mike LeBeau48603e72009-06-05 00:27:00 +01001741 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01001742 * @deprecated Each application that shows web suggestions should have its own
1743 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01001744 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01001745 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01001746 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001747
-b master501eec92009-07-06 13:53:11 -07001748 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08001749 * Whether the notification LED should repeatedly flash when a notification is
1750 * pending. The value is boolean (1 or 0).
1751 * @hide
1752 */
1753 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
1754
1755 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08001756 * Show pointer location on screen?
1757 * 0 = no
1758 * 1 = yes
1759 * @hide
1760 */
1761 public static final String POINTER_LOCATION = "pointer_location";
1762
1763 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07001764 * Show touch positions on screen?
1765 * 0 = no
1766 * 1 = yes
1767 * @hide
1768 */
1769 public static final String SHOW_TOUCHES = "show_touches";
1770
1771 /**
Jeff Brown4519f072011-01-23 13:16:01 -08001772 * Log raw orientation data from {@link WindowOrientationListener} for use with the
1773 * orientationplot.py tool.
1774 * 0 = no
1775 * 1 = yes
1776 * @hide
1777 */
1778 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
1779 "window_orientation_listener_log";
1780
1781 /**
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05001782 * Whether to play a sound for low-battery alerts.
1783 * @hide
1784 */
1785 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
1786
1787 /**
1788 * Whether to play a sound for dock events.
1789 * @hide
1790 */
1791 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
1792
1793 /**
1794 * Whether to play sounds when the keyguard is shown and dismissed.
1795 * @hide
1796 */
1797 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
1798
1799 /**
1800 * URI for the low battery sound file.
1801 * @hide
1802 */
1803 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
1804
1805 /**
1806 * URI for the desk dock "in" event sound.
1807 * @hide
1808 */
1809 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
1810
1811 /**
1812 * URI for the desk dock "out" event sound.
1813 * @hide
1814 */
1815 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
1816
1817 /**
1818 * URI for the car dock "in" event sound.
1819 * @hide
1820 */
1821 public static final String CAR_DOCK_SOUND = "car_dock_sound";
1822
1823 /**
1824 * URI for the car dock "out" event sound.
1825 * @hide
1826 */
1827 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
1828
1829 /**
1830 * URI for the "device locked" (keyguard shown) sound.
1831 * @hide
1832 */
1833 public static final String LOCK_SOUND = "lock_sound";
1834
1835 /**
1836 * URI for the "device unlocked" (keyguard dismissed) sound.
1837 * @hide
1838 */
1839 public static final String UNLOCK_SOUND = "unlock_sound";
1840
1841 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08001842 * Receive incoming SIP calls?
1843 * 0 = no
1844 * 1 = yes
1845 * @hide
1846 */
1847 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
1848
1849 /**
1850 * Call Preference String.
1851 * "SIP_ALWAYS" : Always use SIP with network access
1852 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
1853 * "SIP_ASK_ME_EACH_TIME" : Always ask me each time
1854 * @hide
1855 */
1856 public static final String SIP_CALL_OPTIONS = "sip_call_options";
1857
1858 /**
1859 * One of the sip call options: Always use SIP with network access.
1860 * @hide
1861 */
1862 public static final String SIP_ALWAYS = "SIP_ALWAYS";
1863
1864 /**
1865 * One of the sip call options: Only if destination is a SIP address.
1866 * @hide
1867 */
1868 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
1869
1870 /**
1871 * One of the sip call options: Always ask me each time.
1872 * @hide
1873 */
1874 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
1875
1876 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07001877 * Pointer speed setting.
1878 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
1879 * -7 = slowest
1880 * 0 = default speed
1881 * +7 = fastest
1882 * @hide
1883 */
1884 public static final String POINTER_SPEED = "pointer_speed";
1885
1886 /**
-b master501eec92009-07-06 13:53:11 -07001887 * Settings to backup. This is here so that it's in the same place as the settings
1888 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07001889 *
1890 * NOTE: Settings are backed up and restored in the order they appear
1891 * in this array. If you have one setting depending on another,
1892 * make sure that they are ordered appropriately.
1893 *
-b master501eec92009-07-06 13:53:11 -07001894 * @hide
1895 */
1896 public static final String[] SETTINGS_TO_BACKUP = {
1897 STAY_ON_WHILE_PLUGGED_IN,
-b master501eec92009-07-06 13:53:11 -07001898 WIFI_USE_STATIC_IP,
1899 WIFI_STATIC_IP,
1900 WIFI_STATIC_GATEWAY,
1901 WIFI_STATIC_NETMASK,
1902 WIFI_STATIC_DNS1,
1903 WIFI_STATIC_DNS2,
1904 BLUETOOTH_DISCOVERABILITY,
1905 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
1906 DIM_SCREEN,
1907 SCREEN_OFF_TIMEOUT,
1908 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07001909 SCREEN_BRIGHTNESS_MODE,
-b master501eec92009-07-06 13:53:11 -07001910 VIBRATE_ON,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07001911 MODE_RINGER,
1912 MODE_RINGER_STREAMS_AFFECTED,
1913 MUTE_STREAMS_AFFECTED,
1914 VOLUME_VOICE,
1915 VOLUME_SYSTEM,
1916 VOLUME_RING,
1917 VOLUME_MUSIC,
1918 VOLUME_ALARM,
1919 VOLUME_NOTIFICATION,
Eric Laurent484d2882009-12-08 09:05:45 -08001920 VOLUME_BLUETOOTH_SCO,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07001921 VOLUME_VOICE + APPEND_FOR_LAST_AUDIBLE,
1922 VOLUME_SYSTEM + APPEND_FOR_LAST_AUDIBLE,
1923 VOLUME_RING + APPEND_FOR_LAST_AUDIBLE,
1924 VOLUME_MUSIC + APPEND_FOR_LAST_AUDIBLE,
1925 VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE,
1926 VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE,
Eric Laurent484d2882009-12-08 09:05:45 -08001927 VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE,
Daniel Sandler1c7fa482010-03-10 09:45:01 -05001928 VIBRATE_IN_SILENT,
-b master501eec92009-07-06 13:53:11 -07001929 TEXT_AUTO_REPLACE,
1930 TEXT_AUTO_CAPS,
1931 TEXT_AUTO_PUNCTUATE,
1932 TEXT_SHOW_PASSWORD,
1933 AUTO_TIME,
Amith Yamasaniad450be2010-09-16 16:47:00 -07001934 AUTO_TIME_ZONE,
-b master501eec92009-07-06 13:53:11 -07001935 TIME_12_24,
1936 DATE_FORMAT,
1937 ACCELEROMETER_ROTATION,
Daniel Sandlerb73617d2010-08-17 00:41:00 -04001938 USER_ROTATION,
-b master501eec92009-07-06 13:53:11 -07001939 DTMF_TONE_WHEN_DIALING,
1940 DTMF_TONE_TYPE_WHEN_DIALING,
1941 EMERGENCY_TONE,
1942 CALL_AUTO_RETRY,
1943 HEARING_AID,
1944 TTY_MODE,
1945 SOUND_EFFECTS_ENABLED,
1946 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate14c2d792010-02-25 16:49:44 -08001947 POWER_SOUNDS_ENABLED,
1948 DOCK_SOUNDS_ENABLED,
1949 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08001950 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04001951 NOTIFICATION_LIGHT_PULSE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08001952 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07001953 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07001954 POINTER_SPEED,
-b master501eec92009-07-06 13:53:11 -07001955 };
1956
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001957 // Settings moved to Settings.Secure
1958
1959 /**
Mike Lockwood460ae0c2009-04-02 22:33:27 -07001960 * @deprecated Use {@link android.provider.Settings.Secure#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001961 * instead
1962 */
1963 @Deprecated
1964 public static final String ADB_ENABLED = Secure.ADB_ENABLED;
1965
1966 /**
1967 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
1968 */
1969 @Deprecated
1970 public static final String ANDROID_ID = Secure.ANDROID_ID;
1971
1972 /**
1973 * @deprecated Use {@link android.provider.Settings.Secure#BLUETOOTH_ON} instead
1974 */
1975 @Deprecated
1976 public static final String BLUETOOTH_ON = Secure.BLUETOOTH_ON;
1977
1978 /**
1979 * @deprecated Use {@link android.provider.Settings.Secure#DATA_ROAMING} instead
1980 */
1981 @Deprecated
1982 public static final String DATA_ROAMING = Secure.DATA_ROAMING;
1983
1984 /**
1985 * @deprecated Use {@link android.provider.Settings.Secure#DEVICE_PROVISIONED} instead
1986 */
1987 @Deprecated
1988 public static final String DEVICE_PROVISIONED = Secure.DEVICE_PROVISIONED;
1989
1990 /**
1991 * @deprecated Use {@link android.provider.Settings.Secure#HTTP_PROXY} instead
1992 */
1993 @Deprecated
1994 public static final String HTTP_PROXY = Secure.HTTP_PROXY;
1995
1996 /**
1997 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
1998 */
1999 @Deprecated
2000 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002001
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002002 /**
2003 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
2004 * instead
2005 */
2006 @Deprecated
2007 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
2008
2009 /**
2010 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
2011 */
2012 @Deprecated
2013 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002014
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002015 /**
2016 * @deprecated Use {@link android.provider.Settings.Secure#NETWORK_PREFERENCE} instead
2017 */
2018 @Deprecated
2019 public static final String NETWORK_PREFERENCE = Secure.NETWORK_PREFERENCE;
2020
2021 /**
2022 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
2023 * instead
2024 */
2025 @Deprecated
2026 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
2027
2028 /**
2029 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
2030 * instead
2031 */
2032 @Deprecated
2033 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
2034
2035 /**
2036 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
2037 * instead
2038 */
2039 @Deprecated
2040 public static final String PARENTAL_CONTROL_REDIRECT_URL =
2041 Secure.PARENTAL_CONTROL_REDIRECT_URL;
2042
2043 /**
2044 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
2045 */
2046 @Deprecated
2047 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
2048
2049 /**
2050 * @deprecated Use {@link android.provider.Settings.Secure#USB_MASS_STORAGE_ENABLED} instead
2051 */
2052 @Deprecated
2053 public static final String USB_MASS_STORAGE_ENABLED = Secure.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002054
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002055 /**
2056 * @deprecated Use {@link android.provider.Settings.Secure#USE_GOOGLE_MAIL} instead
2057 */
2058 @Deprecated
2059 public static final String USE_GOOGLE_MAIL = Secure.USE_GOOGLE_MAIL;
2060
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002061 /**
2062 * @deprecated Use
2063 * {@link android.provider.Settings.Secure#WIFI_MAX_DHCP_RETRY_COUNT} instead
2064 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002065 @Deprecated
2066 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Secure.WIFI_MAX_DHCP_RETRY_COUNT;
2067
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002068 /**
2069 * @deprecated Use
2070 * {@link android.provider.Settings.Secure#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
2071 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002072 @Deprecated
2073 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
2074 Secure.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
2075
2076 /**
2077 * @deprecated Use
2078 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
2079 */
2080 @Deprecated
2081 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
2082 Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
2083
2084 /**
2085 * @deprecated Use
2086 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
2087 */
2088 @Deprecated
2089 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
2090 Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002091
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002092 /**
2093 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_NUM_OPEN_NETWORKS_KEPT}
2094 * instead
2095 */
2096 @Deprecated
2097 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Secure.WIFI_NUM_OPEN_NETWORKS_KEPT;
2098
2099 /**
2100 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_ON} instead
2101 */
2102 @Deprecated
2103 public static final String WIFI_ON = Secure.WIFI_ON;
2104
2105 /**
2106 * @deprecated Use
2107 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
2108 * instead
2109 */
2110 @Deprecated
2111 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
2112 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
2113
2114 /**
2115 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
2116 */
2117 @Deprecated
2118 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
2119
2120 /**
2121 * @deprecated Use
2122 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
2123 */
2124 @Deprecated
2125 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
2126 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002127
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002128 /**
2129 * @deprecated Use
2130 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
2131 */
2132 @Deprecated
2133 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
2134 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
2135
2136 /**
2137 * @deprecated Use
2138 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
2139 * instead
2140 */
2141 @Deprecated
2142 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
2143 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
2144
2145 /**
2146 * @deprecated Use
2147 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
2148 */
2149 @Deprecated
2150 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
2151 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
2152
2153 /**
2154 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
2155 * instead
2156 */
2157 @Deprecated
2158 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
2159
2160 /**
2161 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ON} instead
2162 */
2163 @Deprecated
2164 public static final String WIFI_WATCHDOG_ON = Secure.WIFI_WATCHDOG_ON;
2165
2166 /**
2167 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
2168 */
2169 @Deprecated
2170 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
2171
2172 /**
2173 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
2174 * instead
2175 */
2176 @Deprecated
2177 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
2178
2179 /**
2180 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
2181 * instead
2182 */
2183 @Deprecated
2184 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
2185 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
2186 }
2187
2188 /**
2189 * Secure system settings, containing system preferences that applications
2190 * can read but are not allowed to write. These are for preferences that
2191 * the user must explicitly modify through the system UI or specialized
2192 * APIs for those values, not modified directly by applications.
2193 */
2194 public static final class Secure extends NameValueTable {
2195 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
2196
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002197 // Populated lazily, guarded by class object:
2198 private static NameValueCache sNameValueCache = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002199
2200 /**
2201 * Look up a name in the database.
2202 * @param resolver to access the database with
2203 * @param name to look up in the table
2204 * @return the corresponding value, or null if not present
2205 */
2206 public synchronized static String getString(ContentResolver resolver, String name) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002207 if (sNameValueCache == null) {
2208 sNameValueCache = new NameValueCache(SYS_PROP_SETTING_VERSION, CONTENT_URI,
2209 CALL_METHOD_GET_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002210 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002211 return sNameValueCache.getString(resolver, name);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002212 }
2213
2214 /**
2215 * Store a name/value pair into the database.
2216 * @param resolver to access the database with
2217 * @param name to store
2218 * @param value to associate with the name
2219 * @return true if the value was set, false on database errors
2220 */
2221 public static boolean putString(ContentResolver resolver,
2222 String name, String value) {
2223 return putString(resolver, CONTENT_URI, name, value);
2224 }
2225
2226 /**
2227 * Construct the content URI for a particular name/value pair,
2228 * useful for monitoring changes with a ContentObserver.
2229 * @param name to look up in the table
2230 * @return the corresponding content URI, or null if not present
2231 */
2232 public static Uri getUriFor(String name) {
2233 return getUriFor(CONTENT_URI, name);
2234 }
2235
2236 /**
2237 * Convenience function for retrieving a single secure settings value
2238 * as an integer. Note that internally setting values are always
2239 * stored as strings; this function converts the string to an integer
2240 * for you. The default value will be returned if the setting is
2241 * not defined or not an integer.
2242 *
2243 * @param cr The ContentResolver to access.
2244 * @param name The name of the setting to retrieve.
2245 * @param def Value to return if the setting is not defined.
2246 *
2247 * @return The setting's current value, or 'def' if it is not defined
2248 * or not a valid integer.
2249 */
2250 public static int getInt(ContentResolver cr, String name, int def) {
2251 String v = getString(cr, name);
2252 try {
2253 return v != null ? Integer.parseInt(v) : def;
2254 } catch (NumberFormatException e) {
2255 return def;
2256 }
2257 }
2258
2259 /**
2260 * Convenience function for retrieving a single secure settings value
2261 * as an integer. Note that internally setting values are always
2262 * stored as strings; this function converts the string to an integer
2263 * for you.
2264 * <p>
2265 * This version does not take a default value. If the setting has not
2266 * been set, or the string value is not a number,
2267 * it throws {@link SettingNotFoundException}.
2268 *
2269 * @param cr The ContentResolver to access.
2270 * @param name The name of the setting to retrieve.
2271 *
2272 * @throws SettingNotFoundException Thrown if a setting by the given
2273 * name can't be found or the setting value is not an integer.
2274 *
2275 * @return The setting's current value.
2276 */
2277 public static int getInt(ContentResolver cr, String name)
2278 throws SettingNotFoundException {
2279 String v = getString(cr, name);
2280 try {
2281 return Integer.parseInt(v);
2282 } catch (NumberFormatException e) {
2283 throw new SettingNotFoundException(name);
2284 }
2285 }
2286
2287 /**
2288 * Convenience function for updating a single settings value as an
2289 * integer. This will either create a new entry in the table if the
2290 * given name does not exist, or modify the value of the existing row
2291 * with that name. Note that internally setting values are always
2292 * stored as strings, so this function converts the given value to a
2293 * string before storing it.
2294 *
2295 * @param cr The ContentResolver to access.
2296 * @param name The name of the setting to modify.
2297 * @param value The new value for the setting.
2298 * @return true if the value was set, false on database errors
2299 */
2300 public static boolean putInt(ContentResolver cr, String name, int value) {
2301 return putString(cr, name, Integer.toString(value));
2302 }
2303
2304 /**
2305 * Convenience function for retrieving a single secure settings value
2306 * as a {@code long}. Note that internally setting values are always
2307 * stored as strings; this function converts the string to a {@code long}
2308 * for you. The default value will be returned if the setting is
2309 * not defined or not a {@code long}.
2310 *
2311 * @param cr The ContentResolver to access.
2312 * @param name The name of the setting to retrieve.
2313 * @param def Value to return if the setting is not defined.
2314 *
2315 * @return The setting's current value, or 'def' if it is not defined
2316 * or not a valid {@code long}.
2317 */
2318 public static long getLong(ContentResolver cr, String name, long def) {
2319 String valString = getString(cr, name);
2320 long value;
2321 try {
2322 value = valString != null ? Long.parseLong(valString) : def;
2323 } catch (NumberFormatException e) {
2324 value = def;
2325 }
2326 return value;
2327 }
2328
2329 /**
2330 * Convenience function for retrieving a single secure settings value
2331 * as a {@code long}. Note that internally setting values are always
2332 * stored as strings; this function converts the string to a {@code long}
2333 * for you.
2334 * <p>
2335 * This version does not take a default value. If the setting has not
2336 * been set, or the string value is not a number,
2337 * it throws {@link SettingNotFoundException}.
2338 *
2339 * @param cr The ContentResolver to access.
2340 * @param name The name of the setting to retrieve.
2341 *
2342 * @return The setting's current value.
2343 * @throws SettingNotFoundException Thrown if a setting by the given
2344 * name can't be found or the setting value is not an integer.
2345 */
2346 public static long getLong(ContentResolver cr, String name)
2347 throws SettingNotFoundException {
2348 String valString = getString(cr, name);
2349 try {
2350 return Long.parseLong(valString);
2351 } catch (NumberFormatException e) {
2352 throw new SettingNotFoundException(name);
2353 }
2354 }
2355
2356 /**
2357 * Convenience function for updating a secure settings value as a long
2358 * integer. This will either create a new entry in the table if the
2359 * given name does not exist, or modify the value of the existing row
2360 * with that name. Note that internally setting values are always
2361 * stored as strings, so this function converts the given value to a
2362 * string before storing it.
2363 *
2364 * @param cr The ContentResolver to access.
2365 * @param name The name of the setting to modify.
2366 * @param value The new value for the setting.
2367 * @return true if the value was set, false on database errors
2368 */
2369 public static boolean putLong(ContentResolver cr, String name, long value) {
2370 return putString(cr, name, Long.toString(value));
2371 }
2372
2373 /**
2374 * Convenience function for retrieving a single secure settings value
2375 * as a floating point number. Note that internally setting values are
2376 * always stored as strings; this function converts the string to an
2377 * float for you. The default value will be returned if the setting
2378 * is not defined or not a valid float.
2379 *
2380 * @param cr The ContentResolver to access.
2381 * @param name The name of the setting to retrieve.
2382 * @param def Value to return if the setting is not defined.
2383 *
2384 * @return The setting's current value, or 'def' if it is not defined
2385 * or not a valid float.
2386 */
2387 public static float getFloat(ContentResolver cr, String name, float def) {
2388 String v = getString(cr, name);
2389 try {
2390 return v != null ? Float.parseFloat(v) : def;
2391 } catch (NumberFormatException e) {
2392 return def;
2393 }
2394 }
2395
2396 /**
2397 * Convenience function for retrieving a single secure settings value
2398 * as a float. Note that internally setting values are always
2399 * stored as strings; this function converts the string to a float
2400 * for you.
2401 * <p>
2402 * This version does not take a default value. If the setting has not
2403 * been set, or the string value is not a number,
2404 * it throws {@link SettingNotFoundException}.
2405 *
2406 * @param cr The ContentResolver to access.
2407 * @param name The name of the setting to retrieve.
2408 *
2409 * @throws SettingNotFoundException Thrown if a setting by the given
2410 * name can't be found or the setting value is not a float.
2411 *
2412 * @return The setting's current value.
2413 */
2414 public static float getFloat(ContentResolver cr, String name)
2415 throws SettingNotFoundException {
2416 String v = getString(cr, name);
Brian Muramatsue1d46982010-12-06 17:34:20 -08002417 if (v == null) {
2418 throw new SettingNotFoundException(name);
2419 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002420 try {
2421 return Float.parseFloat(v);
2422 } catch (NumberFormatException e) {
2423 throw new SettingNotFoundException(name);
2424 }
2425 }
2426
2427 /**
2428 * Convenience function for updating a single settings value as a
2429 * floating point number. This will either create a new entry in the
2430 * table if the given name does not exist, or modify the value of the
2431 * existing row with that name. Note that internally setting values
2432 * are always stored as strings, so this function converts the given
2433 * value to a string before storing it.
2434 *
2435 * @param cr The ContentResolver to access.
2436 * @param name The name of the setting to modify.
2437 * @param value The new value for the setting.
2438 * @return true if the value was set, false on database errors
2439 */
2440 public static boolean putFloat(ContentResolver cr, String name, float value) {
2441 return putString(cr, name, Float.toString(value));
2442 }
2443
2444 /**
2445 * The content:// style URL for this table
2446 */
2447 public static final Uri CONTENT_URI =
2448 Uri.parse("content://" + AUTHORITY + "/secure");
2449
2450 /**
2451 * Whether ADB is enabled.
2452 */
2453 public static final String ADB_ENABLED = "adb_enabled";
2454
2455 /**
2456 * Setting to allow mock locations and location provider status to be injected into the
2457 * LocationManager service for testing purposes during application development. These
2458 * locations and status values override actual location and status information generated
2459 * by network, gps, or other location providers.
2460 */
2461 public static final String ALLOW_MOCK_LOCATION = "mock_location";
2462
2463 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08002464 * A 64-bit number (as a hex string) that is randomly
2465 * generated on the device's first boot and should remain
2466 * constant for the lifetime of the device. (The value may
2467 * change if a factory reset is performed on the device.)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002468 */
2469 public static final String ANDROID_ID = "android_id";
2470
2471 /**
2472 * Whether bluetooth is enabled/disabled
2473 * 0=disabled. 1=enabled.
2474 */
2475 public static final String BLUETOOTH_ON = "bluetooth_on";
2476
2477 /**
2478 * Get the key that retrieves a bluetooth headset's priority.
2479 * @hide
2480 */
2481 public static final String getBluetoothHeadsetPriorityKey(String address) {
2482 return ("bluetooth_headset_priority_" + address.toUpperCase());
2483 }
2484
2485 /**
2486 * Get the key that retrieves a bluetooth a2dp sink's priority.
2487 * @hide
2488 */
2489 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
2490 return ("bluetooth_a2dp_sink_priority_" + address.toUpperCase());
2491 }
2492
2493 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002494 * Get the key that retrieves a bluetooth Input Device's priority.
2495 * @hide
2496 */
2497 public static final String getBluetoothInputDevicePriorityKey(String address) {
2498 return ("bluetooth_input_device_priority_" + address.toUpperCase());
2499 }
2500
2501 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002502 * Whether or not data roaming is enabled. (0 = false, 1 = true)
2503 */
2504 public static final String DATA_ROAMING = "data_roaming";
2505
2506 /**
2507 * Setting to record the input method used by default, holding the ID
2508 * of the desired method.
2509 */
2510 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
2511
2512 /**
satokab751aa2010-09-14 19:17:36 +09002513 * Setting to record the input method subtype used by default, holding the ID
2514 * of the desired method.
2515 */
2516 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
2517 "selected_input_method_subtype";
2518
2519 /**
satok723a27e2010-11-11 14:58:11 +09002520 * Setting to record the history of input method subtype, holding the pair of ID of IME
2521 * and its last used subtype.
2522 * @hide
2523 */
2524 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
2525 "input_methods_subtype_history";
2526
2527 /**
satok5c58dfc2010-12-14 21:54:47 +09002528 * Setting to record the visibility of input method selector
2529 */
2530 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
2531 "input_method_selector_visibility";
2532
2533 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002534 * Whether the device has been provisioned (0 = false, 1 = true)
2535 */
2536 public static final String DEVICE_PROVISIONED = "device_provisioned";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002537
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002538 /**
2539 * List of input methods that are currently enabled. This is a string
2540 * containing the IDs of all enabled input methods, each ID separated
2541 * by ':'.
2542 */
2543 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002544
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002545 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07002546 * List of system input methods that are currently disabled. This is a string
2547 * containing the IDs of all disabled input methods, each ID separated
2548 * by ':'.
2549 * @hide
2550 */
2551 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
2552
2553 /**
Robert Greenwalt434203a2010-10-11 16:00:27 -07002554 * Host name and port for global http proxy. Uses ':' seperator for between host and port
2555 * TODO - deprecate in favor of global_http_proxy_host, etc
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002556 */
2557 public static final String HTTP_PROXY = "http_proxy";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002558
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002559 /**
Robert Greenwalt434203a2010-10-11 16:00:27 -07002560 * Host name for global http proxy. Set via ConnectivityManager.
2561 * @hide
2562 */
2563 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
2564
2565 /**
2566 * Integer host port for global http proxy. Set via ConnectivityManager.
2567 * @hide
2568 */
2569 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
2570
2571 /**
Oscar Montemayor16fb7912010-08-02 09:38:48 -07002572 * Exclusion list for global proxy. This string contains a list of comma-separated
2573 * domains where the global proxy does not apply. Domains should be listed in a comma-
2574 * separated list. Example of acceptable formats: ".domain1.com,my.domain2.com"
Robert Greenwalt434203a2010-10-11 16:00:27 -07002575 * Use ConnectivityManager to set/get.
Oscar Montemayor16fb7912010-08-02 09:38:48 -07002576 * @hide
2577 */
Robert Greenwalt434203a2010-10-11 16:00:27 -07002578 public static final String GLOBAL_HTTP_PROXY_EXCLUSION_LIST =
2579 "global_http_proxy_exclusion_list";
Oscar Montemayor16fb7912010-08-02 09:38:48 -07002580
2581 /**
2582 * Enables the UI setting to allow the user to specify the global HTTP proxy
2583 * and associated exclusion list.
2584 * @hide
2585 */
2586 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
2587
2588 /**
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07002589 * Setting for default DNS in case nobody suggests one
2590 * @hide
2591 */
2592 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
2593
2594 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002595 * Whether the package installer should allow installation of apps downloaded from
2596 * sources other than the Android Market (vending machine).
2597 *
2598 * 1 = allow installing from other sources
2599 * 0 = only allow installing from the Android Market
2600 */
2601 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002602
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002603 /**
2604 * Comma-separated list of location providers that activities may access.
2605 */
2606 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002607
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002608 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002609 * Whether autolock is enabled (0 = false, 1 = true)
2610 */
2611 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
2612
2613 /**
2614 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
2615 */
2616 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2617
2618 /**
2619 * Whether lock pattern will vibrate as user enters (0 = false, 1 = true)
2620 */
2621 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2622 "lock_pattern_tactile_feedback_enabled";
2623
2624 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07002625 * This preference allows the device to be locked given time after screen goes off,
2626 * subject to current DeviceAdmin policy limits.
2627 * @hide
2628 */
2629 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
2630
2631
2632 /**
Jim Miller253a5ef2010-10-13 20:57:29 -07002633 * This preference contains the string that shows for owner info on LockScren.
2634 * @hide
2635 */
2636 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
2637
2638 /**
2639 * This preference enables showing the owner info on LockScren.
2640 * @hide
2641 */
2642 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
2643 "lock_screen_owner_info_enabled";
2644
2645 /**
Joe Onorato571ae902011-05-24 13:48:43 -07002646 * The saved value for WindowManagerService.setForcedDisplaySize().
2647 * Two integers separated by a comma. If unset, then use the real display size.
2648 * @hide
2649 */
2650 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
2651
2652 /**
Mike Lockwoodbcab8df2009-06-25 16:39:09 -04002653 * Whether assisted GPS should be enabled or not.
2654 * @hide
2655 */
2656 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
2657
2658 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002659 * The Logging ID (a unique 64-bit value) as a hex string.
2660 * Used as a pseudonymous identifier for logging.
2661 * @deprecated This identifier is poorly initialized and has
2662 * many collisions. It should not be used.
2663 */
2664 @Deprecated
2665 public static final String LOGGING_ID = "logging_id";
2666
2667 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002668 * User preference for which network(s) should be used. Only the
2669 * connectivity service should touch this.
2670 */
2671 public static final String NETWORK_PREFERENCE = "network_preference";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002672
2673 /**
Robert Greenwalt2a091d72010-02-11 18:18:40 -08002674 * Used to disable Tethering on a device - defaults to true
2675 * @hide
2676 */
2677 public static final String TETHER_SUPPORTED = "tether_supported";
2678
2679 /**
Robert Greenwalt77b32dd2010-06-03 18:57:26 -07002680 * Used to require DUN APN on the device or not - defaults to a build config value
2681 * which defaults to false
2682 * @hide
2683 */
2684 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
2685
2686 /**
2687 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
2688 * corresponding build config values are set it will override the APN DB
2689 * values.
2690 * Consists of a comma seperated list of strings:
2691 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
2692 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
2693 * @hide
2694 */
2695 public static final String TETHER_DUN_APN = "tether_dun_apn";
2696
2697 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08002698 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002699 */
2700 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002701
2702 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08002703 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002704 */
2705 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002706
2707 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08002708 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002709 */
2710 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002711
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002712 /**
Brad Fitzpatrickd7ad0d22010-12-02 15:30:23 -08002713 * A positive value indicates how often the SamplingProfiler
2714 * should take snapshots. Zero value means SamplingProfiler
2715 * is disabled.
Sen Hubde75702010-05-28 01:54:03 -07002716 *
2717 * @hide
2718 */
Brad Fitzpatrickd7ad0d22010-12-02 15:30:23 -08002719 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
Sen Hubde75702010-05-28 01:54:03 -07002720
2721 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002722 * Settings classname to launch when Settings is clicked from All
2723 * Applications. Needed because of user testing between the old
2724 * and new Settings apps.
2725 */
2726 // TODO: 881807
2727 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002728
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002729 /**
2730 * USB Mass Storage Enabled
2731 */
2732 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002733
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002734 /**
2735 * If this setting is set (to anything), then all references
2736 * to Gmail on the device must change to Google Mail.
2737 */
2738 public static final String USE_GOOGLE_MAIL = "use_google_mail";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002739
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002740 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07002741 * If accessibility is enabled.
2742 */
2743 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
2744
2745 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07002746 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07002747 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07002748 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07002749
2750 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07002751 * List of the enabled accessibility providers.
2752 */
2753 public static final String ENABLED_ACCESSIBILITY_SERVICES =
2754 "enabled_accessibility_services";
2755
2756 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07002757 * If injection of accessibility enhancing JavaScript scripts
2758 * is enabled.
2759 * <p>
2760 * Note: Accessibility injecting scripts are served by the
2761 * Google infrastructure and enable users with disabilities to
2762 * efficiantly navigate in and explore web content.
2763 * </p>
2764 * <p>
2765 * This property represents a boolean value.
2766 * </p>
2767 * @hide
2768 */
2769 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
2770 "accessibility_script_injection";
2771
2772 /**
2773 * Key bindings for navigation in built-in accessibility support for web content.
2774 * <p>
2775 * Note: These key bindings are for the built-in accessibility navigation for
2776 * web content which is used as a fall back solution if JavaScript in a WebView
2777 * is not enabled or the user has not opted-in script injection from Google.
2778 * </p>
2779 * <p>
2780 * The bindings are separated by semi-colon. A binding is a mapping from
2781 * a key to a sequence of actions (for more details look at
2782 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
2783 * string representation of an integer obtained from a meta state (optional) shifted
2784 * sixteen times left and bitwise ored with a key code. An action is represented
2785 * as a hexademical string representation of an integer where the first two digits
2786 * are navigation action index, the second, the third, and the fourth digit pairs
2787 * represent the action arguments. The separate actions in a binding are colon
2788 * separated. The key and the action sequence it maps to are separated by equals.
2789 * </p>
2790 * <p>
2791 * For example, the binding below maps the DPAD right button to traverse the
2792 * current navigation axis once without firing an accessibility event and to
2793 * perform the same traversal again but to fire an event:
2794 * <code>
2795 * 0x16=0x01000100:0x01000101;
2796 * </code>
2797 * </p>
2798 * <p>
2799 * The goal of this binding is to enable dynamic rebinding of keys to
2800 * navigation actions for web content without requiring a framework change.
2801 * </p>
2802 * <p>
2803 * This property represents a string value.
2804 * </p>
2805 * @hide
2806 */
2807 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
2808 "accessibility_web_content_key_bindings";
2809
2810 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08002811 * The timout for considering a press to be a long press in milliseconds.
2812 * @hide
2813 */
2814 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
2815
2816 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07002817 * Setting to always use the default text-to-speech settings regardless
2818 * of the application settings.
2819 * 1 = override application settings,
2820 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01002821 *
2822 * @deprecated The value of this setting is no longer respected by
2823 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07002824 */
Narayan Kamath6d632962011-08-24 11:51:37 +01002825 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07002826 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
2827
2828 /**
2829 * Default text-to-speech engine speech rate. 100 = 1x
2830 */
2831 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
2832
2833 /**
2834 * Default text-to-speech engine pitch. 100 = 1x
2835 */
2836 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
2837
2838 /**
2839 * Default text-to-speech engine.
2840 */
2841 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
2842
2843 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07002844 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01002845 *
2846 * @deprecated this setting is no longer in use, as of the Ice Cream
2847 * Sandwich release. Apps should never need to read this setting directly,
2848 * instead can query the TextToSpeech framework classes for the default
2849 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07002850 */
Narayan Kamath6d632962011-08-24 11:51:37 +01002851 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07002852 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
2853
2854 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07002855 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01002856 *
2857 * @deprecated this setting is no longer in use, as of the Ice Cream
2858 * Sandwich release. Apps should never need to read this setting directly,
2859 * instead can query the TextToSpeech framework classes for the default
2860 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07002861 */
Narayan Kamath6d632962011-08-24 11:51:37 +01002862 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07002863 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
2864
2865 /**
2866 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01002867 *
2868 * @deprecated this setting is no longer in use, as of the Ice Cream
2869 * Sandwich release. Apps should never need to read this setting directly,
2870 * instead can query the TextToSpeech framework classes for the
2871 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07002872 */
Narayan Kamath6d632962011-08-24 11:51:37 +01002873 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07002874 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
2875
2876 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01002877 * Stores the default tts locales on a per engine basis. Stored as
2878 * a comma seperated list of values, each value being of the form
2879 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01002880 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
2881 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
2882 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
2883 * setting directly, and can query the TextToSpeech framework classes
2884 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01002885 *
2886 * @hide
2887 */
2888 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
2889
2890 /**
Charles Chenceffa152010-03-16 21:18:10 -07002891 * Space delimited list of plugin packages that are enabled.
2892 */
2893 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
2894
2895 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002896 * Whether to notify the user of open networks.
2897 * <p>
2898 * If not connected and the scan results have an open network, we will
2899 * put this notification up. If we attempt to connect to a network or
2900 * the open network(s) disappear, we remove the notification. When we
2901 * show the notification, we will not show it again for
2902 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
2903 */
2904 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
2905 "wifi_networks_available_notification_on";
Robert Greenwalt8588e472011-11-08 10:12:25 -08002906 /**
2907 * {@hide}
2908 */
tk.mun148c7d02011-10-13 22:51:57 +09002909 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
2910 "wimax_networks_available_notification_on";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002911
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002912 /**
2913 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
2914 * Connecting to a network will reset the timer.
2915 */
2916 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
2917 "wifi_networks_available_repeat_delay";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002918
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002919 /**
Irfan Sheriffed4f28b2010-10-29 15:32:10 -07002920 * 802.11 country code in ISO 3166 format
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002921 * @hide
2922 */
Irfan Sheriffed4f28b2010-10-29 15:32:10 -07002923 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
2924
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002925
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002926 /**
2927 * When the number of open networks exceeds this number, the
2928 * least-recently-used excess networks will be removed.
2929 */
2930 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002931
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002932 /**
2933 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
2934 */
2935 public static final String WIFI_ON = "wifi_on";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002936
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002937 /**
Irfan Sheriffa3bd4092010-03-24 17:58:59 -07002938 * Used to save the Wifi_ON state prior to tethering.
2939 * This state will be checked to restore Wifi after
2940 * the user turns off tethering.
Irfan Sheriff5321aef2010-02-12 12:35:59 -08002941 *
2942 * @hide
2943 */
Irfan Sheriffa3bd4092010-03-24 17:58:59 -07002944 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
Irfan Sheriff5321aef2010-02-12 12:35:59 -08002945
2946 /**
Irfan Sheriff9ab518ad2010-03-12 15:48:17 -08002947 * AP SSID
2948 *
2949 * @hide
2950 */
2951 public static final String WIFI_AP_SSID = "wifi_ap_ssid";
2952
2953 /**
2954 * AP security
2955 *
2956 * @hide
2957 */
2958 public static final String WIFI_AP_SECURITY = "wifi_ap_security";
2959
2960 /**
2961 * AP passphrase
2962 *
2963 * @hide
2964 */
2965 public static final String WIFI_AP_PASSWD = "wifi_ap_passwd";
2966
2967 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002968 * The acceptable packet loss percentage (range 0 - 100) before trying
2969 * another AP on the same network.
2970 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002971 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002972 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
2973 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002974
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002975 /**
2976 * The number of access points required for a network in order for the
2977 * watchdog to monitor it.
2978 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002979 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002980 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002981
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002982 /**
2983 * The delay between background checks.
2984 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002985 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002986 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
2987 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002988
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002989 /**
2990 * Whether the Wi-Fi watchdog is enabled for background checking even
2991 * after it thinks the user has connected to a good access point.
2992 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002993 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002994 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
2995 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002996
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002997 /**
2998 * The timeout for a background ping
2999 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003000 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003001 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
3002 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003003
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003004 /**
3005 * The number of initial pings to perform that *may* be ignored if they
3006 * fail. Again, if these fail, they will *not* be used in packet loss
3007 * calculation. For example, one network always seemed to time out for
3008 * the first couple pings, so this is set to 3 by default.
3009 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003010 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003011 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
3012 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003013
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003014 /**
3015 * The maximum number of access points (per network) to attempt to test.
3016 * If this number is reached, the watchdog will no longer monitor the
3017 * initial connection state for the network. This is a safeguard for
3018 * networks containing multiple APs whose DNS does not respond to pings.
3019 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003020 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003021 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003022
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003023 /**
3024 * Whether the Wi-Fi watchdog is enabled.
3025 */
3026 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
3027
3028 /**
3029 * 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 -08003030 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003031 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003032 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
3033
3034 /**
3035 * The number of pings to test if an access point is a good connection.
3036 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003037 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003038 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003039
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003040 /**
3041 * The delay between pings.
3042 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003043 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003044 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003045
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003046 /**
3047 * The timeout per ping.
3048 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003049 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003050 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003051
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003052 /**
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003053 * ms delay before rechecking an 'online' wifi connection when it is thought to be unstable.
3054 * @hide
3055 */
3056 public static final String WIFI_WATCHDOG_DNS_CHECK_SHORT_INTERVAL_MS =
3057 "wifi_watchdog_dns_check_short_interval_ms";
3058
3059 /**
3060 * ms delay before rechecking an 'online' wifi connection when it is thought to be stable.
3061 * @hide
3062 */
3063 public static final String WIFI_WATCHDOG_DNS_CHECK_LONG_INTERVAL_MS =
3064 "wifi_watchdog_dns_check_long_interval_ms";
3065
3066 /**
3067 * ms delay before rechecking a connect SSID for walled garden with a http download.
3068 * @hide
3069 */
3070 public static final String WIFI_WATCHDOG_WALLED_GARDEN_INTERVAL_MS =
3071 "wifi_watchdog_walled_garden_interval_ms";
3072
3073 /**
3074 * max blacklist calls on an SSID before full dns check failures disable the network.
3075 * @hide
3076 */
3077 public static final String WIFI_WATCHDOG_MAX_SSID_BLACKLISTS =
3078 "wifi_watchdog_max_ssid_blacklists";
3079
3080 /**
3081 * Number of dns pings per check.
3082 * @hide
3083 */
3084 public static final String WIFI_WATCHDOG_NUM_DNS_PINGS = "wifi_watchdog_num_dns_pings";
3085
3086 /**
3087 * Minimum number of responses to the dns pings to consider the test 'successful'.
3088 * @hide
3089 */
3090 public static final String WIFI_WATCHDOG_MIN_DNS_RESPONSES =
3091 "wifi_watchdog_min_dns_responses";
3092
3093 /**
3094 * Timeout on dns pings
3095 * @hide
3096 */
3097 public static final String WIFI_WATCHDOG_DNS_PING_TIMEOUT_MS =
3098 "wifi_watchdog_dns_ping_timeout_ms";
3099
3100 /**
3101 * We consider action from a 'blacklist' call to have finished by the end of
3102 * this interval. If we are connected to the same AP with no network connection,
3103 * we are likely stuck on an SSID with no external connectivity.
3104 * @hide
3105 */
3106 public static final String WIFI_WATCHDOG_BLACKLIST_FOLLOWUP_INTERVAL_MS =
3107 "wifi_watchdog_blacklist_followup_interval_ms";
3108
3109 /**
Irfan Sheriff5ea65d62011-06-05 21:29:56 -07003110 * Setting to turn off walled garden test on Wi-Fi. Feature is enabled by default and
3111 * the setting needs to be set to 0 to disable it.
3112 * @hide
3113 */
3114 public static final String WIFI_WATCHDOG_WALLED_GARDEN_TEST_ENABLED =
3115 "wifi_watchdog_walled_garden_test_enabled";
3116
3117 /**
3118 * The URL used for walled garden check upon a new conection. WifiWatchdogService
3119 * fetches the URL and checks to see if {@link #WIFI_WATCHDOG_WALLED_GARDEN_PATTERN}
3120 * is not part of the title string to notify the user on the presence of a walled garden.
3121 * @hide
3122 */
3123 public static final String WIFI_WATCHDOG_WALLED_GARDEN_URL =
3124 "wifi_watchdog_walled_garden_url";
3125
3126 /**
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003127 * Boolean to determine whether to notify on disabling a network. Secure setting used
Isaac Levy8dc6a1b2011-07-27 08:00:03 -07003128 * to notify user only once.
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003129 * @hide
3130 */
3131 public static final String WIFI_WATCHDOG_SHOW_DISABLED_NETWORK_POPUP =
3132 "wifi_watchdog_show_disabled_network_popup";
3133
3134 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003135 * The maximum number of times we will retry a connection to an access
3136 * point for which we have failed in acquiring an IP address from DHCP.
3137 * A value of N means that we will make N+1 connection attempts in all.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003138 */
3139 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003140
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003141 /**
Irfan Sheriff36f74132010-11-04 16:57:37 -07003142 * The operational wifi frequency band
3143 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
3144 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
3145 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
3146 *
3147 * @hide
3148 */
3149 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
3150
3151 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003152 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
3153 * data connectivity to be established after a disconnect from Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003154 */
3155 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
3156 "wifi_mobile_data_transition_wakelock_timeout_ms";
3157
3158 /**
3159 * Whether background data usage is allowed by the user. See
3160 * ConnectivityManager for more info.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003161 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07003162 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003163 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07003164
3165 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00003166 * Origins for which browsers should allow geolocation by default.
3167 * The value is a space-separated list of origins.
3168 */
3169 public static final String ALLOWED_GEOLOCATION_ORIGINS
3170 = "allowed_geolocation_origins";
3171
3172 /**
Robert Greenwaltc03fa502010-02-23 18:58:05 -08003173 * Whether mobile data connections are allowed by the user. See
3174 * ConnectivityManager for more info.
3175 * @hide
3176 */
3177 public static final String MOBILE_DATA = "mobile_data";
3178
3179 /**
Wink Saville04e71b32009-04-02 11:00:54 -07003180 * The CDMA roaming mode 0 = Home Networks, CDMA default
3181 * 1 = Roaming on Affiliated networks
3182 * 2 = Roaming on any networks
3183 * @hide
3184 */
3185 public static final String CDMA_ROAMING_MODE = "roaming_settings";
3186
3187 /**
3188 * The CDMA subscription mode 0 = RUIM/SIM (default)
3189 * 1 = NV
3190 * @hide
3191 */
3192 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
3193
3194 /**
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003195 * The preferred network mode 7 = Global
3196 * 6 = EvDo only
3197 * 5 = CDMA w/o EvDo
3198 * 4 = CDMA / EvDo auto
3199 * 3 = GSM / WCDMA auto
3200 * 2 = WCDMA only
3201 * 1 = GSM only
3202 * 0 = GSM / WCDMA preferred
Wink Saville04e71b32009-04-02 11:00:54 -07003203 * @hide
3204 */
3205 public static final String PREFERRED_NETWORK_MODE =
3206 "preferred_network_mode";
3207
3208 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07003209 * The preferred TTY mode 0 = TTy Off, CDMA default
3210 * 1 = TTY Full
3211 * 2 = TTY HCO
3212 * 3 = TTY VCO
3213 * @hide
3214 */
3215 public static final String PREFERRED_TTY_MODE =
3216 "preferred_tty_mode";
3217
3218
3219 /**
Wink Saville04e71b32009-04-02 11:00:54 -07003220 * CDMA Cell Broadcast SMS
3221 * 0 = CDMA Cell Broadcast SMS disabled
3222 * 1 = CDMA Cell Broadcast SMS enabled
3223 * @hide
3224 */
3225 public static final String CDMA_CELL_BROADCAST_SMS =
3226 "cdma_cell_broadcast_sms";
3227
3228 /**
3229 * The cdma subscription 0 = Subscription from RUIM, when available
3230 * 1 = Subscription from NV
3231 * @hide
3232 */
3233 public static final String PREFERRED_CDMA_SUBSCRIPTION =
3234 "preferred_cdma_subscription";
3235
3236 /**
3237 * Whether the enhanced voice privacy mode is enabled.
3238 * 0 = normal voice privacy
3239 * 1 = enhanced voice privacy
3240 * @hide
3241 */
3242 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
3243
3244 /**
3245 * Whether the TTY mode mode is enabled.
3246 * 0 = disabled
3247 * 1 = enabled
3248 * @hide
3249 */
3250 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003251
3252 /**
Wink Saville628b0852011-08-04 15:01:58 -07003253 * The number of milliseconds to delay before sending out Connectivyt Change broadcasts
3254 * @hide
3255 */
3256 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
3257
3258 /**
3259 * Default value for CONNECTIVITY_CHANGE_DELAY in milliseconds.
3260 * @hide
3261 */
3262 public static final int CONNECTIVITY_CHANGE_DELAY_DEFAULT = 3000;
3263
3264 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07003265 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07003266 * Type: int ( 0 = disabled, 1 = enabled )
3267 * @hide
3268 */
3269 public static final String BACKUP_ENABLED = "backup_enabled";
3270
3271 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08003272 * Controls whether application data is automatically restored from backup
3273 * at install time.
3274 * Type: int ( 0 = disabled, 1 = enabled )
3275 * @hide
3276 */
3277 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
3278
3279 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07003280 * Indicates whether settings backup has been fully provisioned.
3281 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
3282 * @hide
3283 */
3284 public static final String BACKUP_PROVISIONED = "backup_provisioned";
3285
3286 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07003287 * Component of the transport to use for backup/restore.
3288 * @hide
3289 */
3290 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07003291
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07003292 /**
3293 * Version for which the setup wizard was last shown. Bumped for
3294 * each release when there is new setup information to show.
3295 * @hide
3296 */
3297 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07003298
3299 /**
Doug Zongkerf6888892010-01-06 16:38:14 -08003300 * How frequently (in seconds) to check the memory status of the
3301 * device.
3302 * @hide
3303 */
3304 public static final String MEMCHECK_INTERVAL = "memcheck_interval";
3305
3306 /**
3307 * Max frequency (in seconds) to log memory check stats, in realtime
3308 * seconds. This allows for throttling of logs when the device is
3309 * running for large amounts of time.
3310 * @hide
3311 */
3312 public static final String MEMCHECK_LOG_REALTIME_INTERVAL =
3313 "memcheck_log_realtime_interval";
3314
3315 /**
3316 * Boolean indicating whether rebooting due to system memory checks
3317 * is enabled.
3318 * @hide
3319 */
3320 public static final String MEMCHECK_SYSTEM_ENABLED = "memcheck_system_enabled";
3321
3322 /**
3323 * How many bytes the system process must be below to avoid scheduling
3324 * a soft reboot. This reboot will happen when it is next determined
3325 * to be a good time.
3326 * @hide
3327 */
3328 public static final String MEMCHECK_SYSTEM_SOFT_THRESHOLD = "memcheck_system_soft";
3329
3330 /**
3331 * How many bytes the system process must be below to avoid scheduling
3332 * a hard reboot. This reboot will happen immediately.
3333 * @hide
3334 */
3335 public static final String MEMCHECK_SYSTEM_HARD_THRESHOLD = "memcheck_system_hard";
3336
3337 /**
3338 * How many bytes the phone process must be below to avoid scheduling
3339 * a soft restart. This restart will happen when it is next determined
3340 * to be a good time.
3341 * @hide
3342 */
3343 public static final String MEMCHECK_PHONE_SOFT_THRESHOLD = "memcheck_phone_soft";
3344
3345 /**
3346 * How many bytes the phone process must be below to avoid scheduling
3347 * a hard restart. This restart will happen immediately.
3348 * @hide
3349 */
3350 public static final String MEMCHECK_PHONE_HARD_THRESHOLD = "memcheck_phone_hard";
3351
3352 /**
3353 * Boolean indicating whether restarting the phone process due to
3354 * memory checks is enabled.
3355 * @hide
3356 */
3357 public static final String MEMCHECK_PHONE_ENABLED = "memcheck_phone_enabled";
3358
3359 /**
3360 * First time during the day it is okay to kill processes
3361 * or reboot the device due to low memory situations. This number is
3362 * in seconds since midnight.
3363 * @hide
3364 */
3365 public static final String MEMCHECK_EXEC_START_TIME = "memcheck_exec_start_time";
3366
3367 /**
3368 * Last time during the day it is okay to kill processes
3369 * or reboot the device due to low memory situations. This number is
3370 * in seconds since midnight.
3371 * @hide
3372 */
3373 public static final String MEMCHECK_EXEC_END_TIME = "memcheck_exec_end_time";
3374
3375 /**
3376 * How long the screen must have been off in order to kill processes
3377 * or reboot. This number is in seconds. A value of -1 means to
3378 * entirely disregard whether the screen is on.
3379 * @hide
3380 */
3381 public static final String MEMCHECK_MIN_SCREEN_OFF = "memcheck_min_screen_off";
3382
3383 /**
3384 * How much time there must be until the next alarm in order to kill processes
3385 * or reboot. This number is in seconds. Note: this value must be
3386 * smaller than {@link #MEMCHECK_RECHECK_INTERVAL} or else it will
3387 * always see an alarm scheduled within its time.
3388 * @hide
3389 */
3390 public static final String MEMCHECK_MIN_ALARM = "memcheck_min_alarm";
3391
3392 /**
3393 * How frequently to check whether it is a good time to restart things,
3394 * if the device is in a bad state. This number is in seconds. Note:
3395 * this value must be larger than {@link #MEMCHECK_MIN_ALARM} or else
3396 * the alarm to schedule the recheck will always appear within the
3397 * minimum "do not execute now" time.
3398 * @hide
3399 */
3400 public static final String MEMCHECK_RECHECK_INTERVAL = "memcheck_recheck_interval";
3401
3402 /**
3403 * How frequently (in DAYS) to reboot the device. If 0, no reboots
3404 * will occur.
3405 * @hide
3406 */
3407 public static final String REBOOT_INTERVAL = "reboot_interval";
3408
3409 /**
3410 * First time during the day it is okay to force a reboot of the
3411 * device (if REBOOT_INTERVAL is set). This number is
3412 * in seconds since midnight.
3413 * @hide
3414 */
3415 public static final String REBOOT_START_TIME = "reboot_start_time";
3416
3417 /**
3418 * The window of time (in seconds) after each REBOOT_INTERVAL in which
3419 * a reboot can be executed. If 0, a reboot will always be executed at
3420 * exactly the given time. Otherwise, it will only be executed if
3421 * the device is idle within the window.
3422 * @hide
3423 */
3424 public static final String REBOOT_WINDOW = "reboot_window";
3425
3426 /**
Doug Zongker43866e02010-01-07 12:09:54 -08003427 * Threshold values for the duration and level of a discharge cycle, under
3428 * which we log discharge cycle info.
3429 * @hide
3430 */
3431 public static final String BATTERY_DISCHARGE_DURATION_THRESHOLD =
3432 "battery_discharge_duration_threshold";
3433 /** @hide */
3434 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
3435
3436 /**
3437 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR intents
3438 * on application crashes and ANRs. If this is disabled, the crash/ANR dialog
3439 * will never display the "Report" button.
3440 * Type: int ( 0 = disallow, 1 = allow )
3441 * @hide
3442 */
3443 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
3444
3445 /**
3446 * Nonzero causes Log.wtf() to crash.
3447 * @hide
3448 */
3449 public static final String WTF_IS_FATAL = "wtf_is_fatal";
3450
3451 /**
Jake Hambybb371632010-08-23 18:16:48 -07003452 * Maximum age of entries kept by {@link com.android.internal.os.IDropBoxManagerService}.
Doug Zongker43866e02010-01-07 12:09:54 -08003453 * @hide
3454 */
3455 public static final String DROPBOX_AGE_SECONDS =
3456 "dropbox_age_seconds";
3457 /**
Jake Hambybb371632010-08-23 18:16:48 -07003458 * Maximum number of entry files which {@link com.android.internal.os.IDropBoxManagerService} will keep around.
Dan Egnor3a8b0c12010-03-24 17:48:20 -07003459 * @hide
3460 */
3461 public static final String DROPBOX_MAX_FILES =
3462 "dropbox_max_files";
3463 /**
Jake Hambybb371632010-08-23 18:16:48 -07003464 * Maximum amount of disk space used by {@link com.android.internal.os.IDropBoxManagerService} no matter what.
Doug Zongker43866e02010-01-07 12:09:54 -08003465 * @hide
3466 */
3467 public static final String DROPBOX_QUOTA_KB =
3468 "dropbox_quota_kb";
3469 /**
Jake Hambybb371632010-08-23 18:16:48 -07003470 * Percent of free disk (excluding reserve) which {@link com.android.internal.os.IDropBoxManagerService} will use.
Doug Zongker43866e02010-01-07 12:09:54 -08003471 * @hide
3472 */
3473 public static final String DROPBOX_QUOTA_PERCENT =
3474 "dropbox_quota_percent";
3475 /**
Jake Hambybb371632010-08-23 18:16:48 -07003476 * Percent of total disk which {@link com.android.internal.os.IDropBoxManagerService} will never dip into.
Doug Zongker43866e02010-01-07 12:09:54 -08003477 * @hide
3478 */
3479 public static final String DROPBOX_RESERVE_PERCENT =
3480 "dropbox_reserve_percent";
3481 /**
3482 * Prefix for per-tag dropbox disable/enable settings.
3483 * @hide
3484 */
3485 public static final String DROPBOX_TAG_PREFIX =
3486 "dropbox:";
Dan Egnora455d192010-03-12 08:52:28 -08003487 /**
3488 * Lines of logcat to include with system crash/ANR/etc. reports,
3489 * as a prefix of the dropbox tag of the report type.
3490 * For example, "logcat_for_system_server_anr" controls the lines
3491 * of logcat captured with system server ANR reports. 0 to disable.
3492 * @hide
3493 */
3494 public static final String ERROR_LOGCAT_PREFIX =
3495 "logcat_for_";
Doug Zongker43866e02010-01-07 12:09:54 -08003496
3497
3498 /**
3499 * Screen timeout in milliseconds corresponding to the
3500 * PowerManager's POKE_LOCK_SHORT_TIMEOUT flag (i.e. the fastest
3501 * possible screen timeout behavior.)
3502 * @hide
3503 */
3504 public static final String SHORT_KEYLIGHT_DELAY_MS =
3505 "short_keylight_delay_ms";
3506
3507 /**
3508 * The interval in minutes after which the amount of free storage left on the
3509 * device is logged to the event log
3510 * @hide
3511 */
3512 public static final String SYS_FREE_STORAGE_LOG_INTERVAL =
3513 "sys_free_storage_log_interval";
3514
3515 /**
3516 * Threshold for the amount of change in disk free space required to report the amount of
3517 * free space. Used to prevent spamming the logs when the disk free space isn't changing
3518 * frequently.
3519 * @hide
3520 */
3521 public static final String DISK_FREE_CHANGE_REPORTING_THRESHOLD =
3522 "disk_free_change_reporting_threshold";
3523
3524
3525 /**
3526 * Minimum percentage of free storage on the device that is used to determine if
Dianne Hackborn247fe742011-01-08 17:25:57 -08003527 * the device is running low on storage. The default is 10.
3528 * <p>Say this value is set to 10, the device is considered running low on storage
Doug Zongker43866e02010-01-07 12:09:54 -08003529 * if 90% or more of the device storage is filled up.
3530 * @hide
3531 */
3532 public static final String SYS_STORAGE_THRESHOLD_PERCENTAGE =
3533 "sys_storage_threshold_percentage";
3534
3535 /**
Dianne Hackborn247fe742011-01-08 17:25:57 -08003536 * Maximum byte size of the low storage threshold. This is to ensure
3537 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in
3538 * an overly large threshold for large storage devices. Currently this
3539 * must be less than 2GB. This default is 500MB.
3540 * @hide
3541 */
3542 public static final String SYS_STORAGE_THRESHOLD_MAX_BYTES =
3543 "sys_storage_threshold_max_bytes";
3544
3545 /**
Jake Hambybb371632010-08-23 18:16:48 -07003546 * Minimum bytes of free storage on the device before the data
3547 * partition is considered full. By default, 1 MB is reserved
3548 * to avoid system-wide SQLite disk full exceptions.
3549 * @hide
3550 */
3551 public static final String SYS_STORAGE_FULL_THRESHOLD_BYTES =
3552 "sys_storage_full_threshold_bytes";
3553
3554 /**
Doug Zongker43866e02010-01-07 12:09:54 -08003555 * The interval in milliseconds after which Wi-Fi is considered idle.
3556 * When idle, it is possible for the device to be switched from Wi-Fi to
3557 * the mobile data network.
3558 * @hide
3559 */
3560 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
3561
3562 /**
Irfan Sheriff2b7f6382011-03-25 14:29:19 -07003563 * The interval in milliseconds to issue wake up scans when wifi needs
3564 * to connect. This is necessary to connect to an access point when
3565 * device is on the move and the screen is off.
Irfan Sheriff4f5f7c92010-10-14 17:01:27 -07003566 * @hide
3567 */
Irfan Sheriff2b7f6382011-03-25 14:29:19 -07003568 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
3569 "wifi_framework_scan_interval_ms";
3570
3571 /**
3572 * The interval in milliseconds to scan as used by the wifi supplicant
3573 * @hide
3574 */
3575 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
3576 "wifi_supplicant_scan_interval_ms";
Irfan Sheriff4f5f7c92010-10-14 17:01:27 -07003577
3578 /**
Doug Zongkeredc51892010-01-07 13:51:16 -08003579 * The interval in milliseconds at which to check packet counts on the
3580 * mobile data interface when screen is on, to detect possible data
3581 * connection problems.
3582 * @hide
3583 */
3584 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
3585 "pdp_watchdog_poll_interval_ms";
3586
3587 /**
3588 * The interval in milliseconds at which to check packet counts on the
3589 * mobile data interface when screen is off, to detect possible data
3590 * connection problems.
3591 * @hide
3592 */
3593 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
3594 "pdp_watchdog_long_poll_interval_ms";
3595
3596 /**
3597 * The interval in milliseconds at which to check packet counts on the
3598 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
3599 * outgoing packets has been reached without incoming packets.
3600 * @hide
3601 */
3602 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
3603 "pdp_watchdog_error_poll_interval_ms";
3604
3605 /**
3606 * The number of outgoing packets sent without seeing an incoming packet
3607 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
3608 * device is logged to the event log
3609 * @hide
3610 */
3611 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
3612 "pdp_watchdog_trigger_packet_count";
3613
3614 /**
3615 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
3616 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
3617 * attempting data connection recovery.
3618 * @hide
3619 */
3620 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
3621 "pdp_watchdog_error_poll_count";
3622
3623 /**
3624 * The number of failed PDP reset attempts before moving to something more
3625 * drastic: re-registering to the network.
3626 * @hide
3627 */
3628 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
3629 "pdp_watchdog_max_pdp_reset_fail_count";
3630
3631 /**
Wink Saville2861d232011-11-03 18:52:58 -07003632 * The number of milliseconds to delay when checking for data stalls
3633 * @hide
3634 */
3635 public static final String DATA_STALL_ALARM_DELAY_IN_MS =
3636 "data_stall_alarm_delay_in_ms";
3637
3638 /**
Doug Zongkeredc51892010-01-07 13:51:16 -08003639 * The interval in milliseconds at which to check gprs registration
3640 * after the first registration mismatch of gprs and voice service,
3641 * to detect possible data network registration problems.
3642 *
3643 * @hide
3644 */
3645 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
3646 "gprs_register_check_period_ms";
3647
3648 /**
3649 * The length of time in milli-seconds that automatic small adjustments to
3650 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
3651 * @hide
3652 */
3653 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
3654
3655 /**
3656 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
3657 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
3658 * exceeded.
3659 * @hide
3660 */
3661 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
3662
3663 /**
3664 * The maximum reconnect delay for short network outages or when the network is suspended
3665 * due to phone use.
3666 * @hide
3667 */
3668 public static final String SYNC_MAX_RETRY_DELAY_IN_SECONDS =
3669 "sync_max_retry_delay_in_seconds";
3670
3671 /**
3672 * The interval in milliseconds at which to check the number of SMS sent
3673 * out without asking for use permit, to limit the un-authorized SMS
3674 * usage.
3675 * @hide
3676 */
3677 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
3678 "sms_outgoing_check_interval_ms";
3679
3680 /**
3681 * The number of outgoing SMS sent without asking for user permit
3682 * (of {@link #SMS_OUTGOING_CHECK_INTERVAL_MS}
3683 * @hide
3684 */
3685 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
3686 "sms_outgoing_check_max_count";
3687
3688 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01003689 * The global search provider chosen by the user (if multiple global
3690 * search providers are installed). This will be the provider returned
3691 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
3692 * installed. This setting is stored as a flattened component name as
3693 * per {@link ComponentName#flattenToString()}.
3694 *
3695 * @hide
3696 */
3697 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
3698 "search_global_search_activity";
3699
3700 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003701 * The number of promoted sources in GlobalSearch.
3702 * @hide
3703 */
3704 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
3705 /**
3706 * The maximum number of suggestions returned by GlobalSearch.
3707 * @hide
3708 */
3709 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
3710 /**
3711 * The number of suggestions GlobalSearch will ask each non-web search source for.
3712 * @hide
3713 */
3714 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
3715 /**
3716 * The number of suggestions the GlobalSearch will ask the web search source for.
3717 * @hide
3718 */
3719 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
3720 "search_web_results_override_limit";
3721 /**
3722 * The number of milliseconds that GlobalSearch will wait for suggestions from
3723 * promoted sources before continuing with all other sources.
3724 * @hide
3725 */
3726 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
3727 "search_promoted_source_deadline_millis";
3728 /**
3729 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
3730 * @hide
3731 */
3732 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
3733 /**
3734 * The maximum number of milliseconds that GlobalSearch shows the previous results
3735 * after receiving a new query.
3736 * @hide
3737 */
3738 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
3739 /**
3740 * The maximum age of log data used for shortcuts in GlobalSearch.
3741 * @hide
3742 */
3743 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
3744 /**
3745 * The maximum age of log data used for source ranking in GlobalSearch.
3746 * @hide
3747 */
3748 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
3749 "search_max_source_event_age_millis";
3750 /**
3751 * The minimum number of impressions needed to rank a source in GlobalSearch.
3752 * @hide
3753 */
3754 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
3755 "search_min_impressions_for_source_ranking";
3756 /**
3757 * The minimum number of clicks needed to rank a source in GlobalSearch.
3758 * @hide
3759 */
3760 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
3761 "search_min_clicks_for_source_ranking";
3762 /**
3763 * The maximum number of shortcuts shown by GlobalSearch.
3764 * @hide
3765 */
3766 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
3767 /**
3768 * The size of the core thread pool for suggestion queries in GlobalSearch.
3769 * @hide
3770 */
3771 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
3772 "search_query_thread_core_pool_size";
3773 /**
3774 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
3775 * @hide
3776 */
3777 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
3778 "search_query_thread_max_pool_size";
3779 /**
3780 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
3781 * @hide
3782 */
3783 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
3784 "search_shortcut_refresh_core_pool_size";
3785 /**
3786 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
3787 * @hide
3788 */
3789 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
3790 "search_shortcut_refresh_max_pool_size";
3791 /**
3792 * The maximun time that excess threads in the GlobalSeach thread pools will
3793 * wait before terminating.
3794 * @hide
3795 */
3796 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
3797 "search_thread_keepalive_seconds";
3798 /**
3799 * The maximum number of concurrent suggestion queries to each source.
3800 * @hide
3801 */
3802 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
3803 "search_per_source_concurrent_query_limit";
3804
San Mehat87734d32010-01-08 12:53:06 -08003805 /**
3806 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
3807 * @hide
3808 */
3809 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
3810
3811 /**
3812 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
3813 * @hide
3814 */
3815 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
3816
3817 /**
3818 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
3819 * @hide
3820 */
3821 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
3822
3823 /**
3824 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
3825 * @hide
3826 */
3827 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003828
Dan Egnor42471dd2010-01-07 17:25:22 -08003829 /**
3830 * If nonzero, ANRs in invisible background processes bring up a dialog.
3831 * Otherwise, the process will be silently killed.
3832 * @hide
3833 */
3834 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08003835
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08003836 /**
3837 * The {@link ComponentName} string of the service to be used as the voice recognition
3838 * service.
Erikeebc8e22010-02-18 13:27:19 -08003839 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08003840 * @hide
3841 */
3842 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08003843
satok988323c2011-06-22 16:38:13 +09003844
3845 /**
satokada8c4e2011-08-23 14:56:56 +09003846 * The {@link ComponentName} string of the selected spell checker service which is
3847 * one of the services managed by the text service manager.
3848 *
3849 * @hide
3850 */
3851 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
3852
3853 /**
3854 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09003855 * service which is one of the services managed by the text service manager.
3856 *
3857 * @hide
3858 */
satokada8c4e2011-08-23 14:56:56 +09003859 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
3860 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09003861
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003862 /**
satoka33c4fc2011-08-25 16:50:11 +09003863 * The {@link ComponentName} string whether spell checker is enabled or not.
3864 *
3865 * @hide
3866 */
3867 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
3868
3869 /**
David Brown458e8062010-03-08 21:52:11 -08003870 * What happens when the user presses the Power button while in-call
3871 * and the screen is on.<br/>
3872 * <b>Values:</b><br/>
3873 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
3874 * 2 - The Power button hangs up the current call.<br/>
3875 *
3876 * @hide
3877 */
3878 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
3879
3880 /**
3881 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
3882 * @hide
3883 */
3884 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
3885
3886 /**
3887 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
3888 * @hide
3889 */
3890 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
3891
3892 /**
3893 * INCALL_POWER_BUTTON_BEHAVIOR default value.
3894 * @hide
3895 */
3896 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
3897 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
3898
3899 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07003900 * The current night mode that has been selected by the user. Owned
3901 * and controlled by UiModeManagerService. Constants are as per
3902 * UiModeManager.
3903 * @hide
3904 */
3905 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07003906
3907 /**
3908 * Let user pick default install location.
3909 * @hide
3910 */
3911 public static final String SET_INSTALL_LOCATION = "set_install_location";
3912
3913 /**
3914 * Default install location value.
3915 * 0 = auto, let system decide
3916 * 1 = internal
3917 * 2 = sdcard
3918 * @hide
3919 */
3920 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07003921
3922 /**
3923 * The bandwidth throttle polling freqency in seconds
3924 * @hide
3925 */
3926 public static final String THROTTLE_POLLING_SEC = "throttle_polling_sec";
3927
3928 /**
3929 * The bandwidth throttle threshold (long)
3930 * @hide
3931 */
Robert Greenwaltd3bb93f2010-04-12 19:20:55 -07003932 public static final String THROTTLE_THRESHOLD_BYTES = "throttle_threshold_bytes";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07003933
3934 /**
3935 * The bandwidth throttle value (kbps)
3936 * @hide
3937 */
Robert Greenwaltd3bb93f2010-04-12 19:20:55 -07003938 public static final String THROTTLE_VALUE_KBITSPS = "throttle_value_kbitsps";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07003939
3940 /**
3941 * The bandwidth throttle reset calendar day (1-28)
3942 * @hide
3943 */
3944 public static final String THROTTLE_RESET_DAY = "throttle_reset_day";
3945
3946 /**
3947 * The throttling notifications we should send
3948 * @hide
3949 */
3950 public static final String THROTTLE_NOTIFICATION_TYPE = "throttle_notification_type";
3951
3952 /**
Irfan Sheriffc9b68512010-04-08 14:12:33 -07003953 * Help URI for data throttling policy
3954 * @hide
3955 */
3956 public static final String THROTTLE_HELP_URI = "throttle_help_uri";
3957
Robert Greenwaltd1055a22010-05-25 15:54:52 -07003958 /**
3959 * The length of time in Sec that we allow our notion of NTP time
3960 * to be cached before we refresh it
3961 * @hide
3962 */
3963 public static final String THROTTLE_MAX_NTP_CACHE_AGE_SEC =
3964 "throttle_max_ntp_cache_age_sec";
3965
Steve Howard9c4e33e2010-07-28 15:59:29 -07003966 /**
3967 * The maximum size, in bytes, of a download that the download manager will transfer over
3968 * a non-wifi connection.
3969 * @hide
3970 */
3971 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
3972 "download_manager_max_bytes_over_mobile";
3973
Robert Greenwaltd7085fc2010-09-08 15:24:47 -07003974 /**
Steve Howardf1766812010-09-17 16:46:19 -07003975 * The recommended maximum size, in bytes, of a download that the download manager should
3976 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
3977 * have the option to start the download over the mobile connection anyway.
3978 * @hide
3979 */
3980 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
3981 "download_manager_recommended_max_bytes_over_mobile";
3982
3983 /**
Robert Greenwaltd7085fc2010-09-08 15:24:47 -07003984 * ms during which to consume extra events related to Inet connection condition
3985 * after a transtion to fully-connected
3986 * @hide
3987 */
3988 public static final String INET_CONDITION_DEBOUNCE_UP_DELAY =
3989 "inet_condition_debounce_up_delay";
3990
3991 /**
3992 * ms during which to consume extra events related to Inet connection condtion
3993 * after a transtion to partly-connected
3994 * @hide
3995 */
3996 public static final String INET_CONDITION_DEBOUNCE_DOWN_DELAY =
3997 "inet_condition_debounce_down_delay";
Irfan Sheriffc9b68512010-04-08 14:12:33 -07003998
3999 /**
Freeman Ng96be4e02011-04-07 18:21:40 -07004000 * URL to open browser on to allow user to manage a prepay account
4001 * @hide
4002 */
4003 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
4004 "setup_prepaid_data_service_url";
4005
4006 /**
Freeman Ng3b9089c2011-04-22 16:42:57 -07004007 * URL to attempt a GET on to see if this is a prepay device
4008 * @hide
4009 */
4010 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
4011 "setup_prepaid_detection_target_url";
4012
4013 /**
4014 * Host to check for a redirect to after an attempt to GET
4015 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
4016 * this is a prepaid device with zero balance.)
4017 * @hide
4018 */
4019 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
4020 "setup_prepaid_detection_redir_host";
4021
4022 /**
Daniel Sandler0601eb72011-04-13 01:01:32 -04004023 * The user's preferred "dream" (interactive screensaver) component.
4024 *
4025 * This component will be launched by the PhoneWindowManager after the user's chosen idle
4026 * timeout (specified by {@link #DREAM_TIMEOUT}).
4027 * @hide
4028 */
4029 public static final String DREAM_COMPONENT =
4030 "dream_component";
4031
4032 /**
4033 * The delay before a "dream" is started (set to 0 to disable).
4034 * @hide
4035 */
4036 public static final String DREAM_TIMEOUT =
4037 "dream_timeout";
4038
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07004039 /** {@hide} */
Jeff Sharkey0a9ee122011-06-22 16:32:41 -07004040 public static final String NETSTATS_ENABLED = "netstats_enabled";
4041 /** {@hide} */
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07004042 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
4043 /** {@hide} */
4044 public static final String NETSTATS_PERSIST_THRESHOLD = "netstats_persist_threshold";
4045 /** {@hide} */
Jeff Sharkey39ebc212011-06-11 17:25:42 -07004046 public static final String NETSTATS_NETWORK_BUCKET_DURATION = "netstats_network_bucket_duration";
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07004047 /** {@hide} */
Jeff Sharkey39ebc212011-06-11 17:25:42 -07004048 public static final String NETSTATS_NETWORK_MAX_HISTORY = "netstats_network_max_history";
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07004049 /** {@hide} */
Jeff Sharkey39ebc212011-06-11 17:25:42 -07004050 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07004051 /** {@hide} */
Jeff Sharkey39ebc212011-06-11 17:25:42 -07004052 public static final String NETSTATS_UID_MAX_HISTORY = "netstats_uid_max_history";
Jeff Sharkeyd03fd3f2011-06-19 20:55:09 -07004053 /** {@hide} */
4054 public static final String NETSTATS_TAG_MAX_HISTORY = "netstats_tag_max_history";
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07004055
Jeff Sharkey104344e2011-07-10 14:20:41 -07004056 /** Preferred NTP server. {@hide} */
4057 public static final String NTP_SERVER = "ntp_server";
4058 /** Timeout in milliseconds to wait for NTP server. {@hide} */
4059 public static final String NTP_TIMEOUT = "ntp_timeout";
4060
Ben Murdoch9999c1d2011-07-19 16:51:24 +01004061 /** Autofill server address (Used in WebView/browser). {@hide} */
4062 public static final String WEB_AUTOFILL_QUERY_URL =
4063 "web_autofill_query_url";
4064
Kenny Root5ab21572011-07-27 11:11:19 -07004065 /** Whether package verification is enabled. {@hide} */
4066 public static final String PACKAGE_VERIFIER_ENABLE = "verifier_enable";
4067
4068 /** Timeout for package verification. {@hide} */
4069 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
4070
Daniel Sandler0601eb72011-04-13 01:01:32 -04004071 /**
Dave Santoroe43185e2011-10-10 18:11:00 -07004072 * Duration in milliseconds before pre-authorized URIs for the contacts
4073 * provider should expire.
4074 * @hide
4075 */
4076 public static final String CONTACTS_PREAUTH_URI_EXPIRATION =
4077 "contacts_preauth_uri_expiration";
4078
4079 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07004080 * This are the settings to be backed up.
4081 *
4082 * NOTE: Settings are backed up and restored in the order they appear
4083 * in this array. If you have one setting depending on another,
4084 * make sure that they are ordered appropriately.
4085 *
-b master501eec92009-07-06 13:53:11 -07004086 * @hide
4087 */
4088 public static final String[] SETTINGS_TO_BACKUP = {
Amith Yamasani8823c0a82009-07-07 14:30:17 -07004089 ADB_ENABLED,
4090 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07004091 PARENTAL_CONTROL_ENABLED,
4092 PARENTAL_CONTROL_REDIRECT_URL,
4093 USB_MASS_STORAGE_ENABLED,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004094 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08004095 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07004096 ENABLED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07004097 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07004098 ACCESSIBILITY_ENABLED,
-b master501eec92009-07-06 13:53:11 -07004099 TTS_USE_DEFAULTS,
4100 TTS_DEFAULT_RATE,
4101 TTS_DEFAULT_PITCH,
4102 TTS_DEFAULT_SYNTH,
4103 TTS_DEFAULT_LANG,
4104 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07004105 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01004106 TTS_DEFAULT_LOCALE,
-b master501eec92009-07-06 13:53:11 -07004107 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
4108 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
-b master501eec92009-07-06 13:53:11 -07004109 WIFI_NUM_OPEN_NETWORKS_KEPT,
San Mehat87734d32010-01-08 12:53:06 -08004110 MOUNT_PLAY_NOTIFICATION_SND,
4111 MOUNT_UMS_AUTOSTART,
4112 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07004113 MOUNT_UMS_NOTIFY_ENABLED,
Amith Yamasaniaee26872011-10-11 13:53:30 -07004114 UI_NIGHT_MODE,
4115 LOCK_SCREEN_OWNER_INFO,
Tom Taylor994da2a2011-11-10 11:17:38 -08004116 LOCK_SCREEN_OWNER_INFO_ENABLED
-b master501eec92009-07-06 13:53:11 -07004117 };
4118
4119 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004120 * Helper method for determining if a location provider is enabled.
4121 * @param cr the content resolver to use
4122 * @param provider the location provider to query
4123 * @return true if the provider is enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004124 */
4125 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
4126 String allowedProviders = Settings.Secure.getString(cr, LOCATION_PROVIDERS_ALLOWED);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07004127 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004128 }
4129
4130 /**
4131 * Thread-safe method for enabling or disabling a single location provider.
4132 * @param cr the content resolver to use
4133 * @param provider the location provider to enable or disable
4134 * @param enabled true if the provider should be enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004135 */
4136 public static final void setLocationProviderEnabled(ContentResolver cr,
4137 String provider, boolean enabled) {
4138 // to ensure thread safety, we write the provider name with a '+' or '-'
4139 // and let the SettingsProvider handle it rather than reading and modifying
4140 // the list of enabled providers.
4141 if (enabled) {
4142 provider = "+" + provider;
4143 } else {
4144 provider = "-" + provider;
4145 }
4146 putString(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider);
4147 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004148 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004149
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004150 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004151 * User-defined bookmarks and shortcuts. The target of each bookmark is an
4152 * Intent URL, allowing it to be either a web page or a particular
4153 * application activity.
4154 *
4155 * @hide
4156 */
4157 public static final class Bookmarks implements BaseColumns
4158 {
4159 private static final String TAG = "Bookmarks";
4160
4161 /**
4162 * The content:// style URL for this table
4163 */
4164 public static final Uri CONTENT_URI =
4165 Uri.parse("content://" + AUTHORITY + "/bookmarks");
4166
4167 /**
4168 * The row ID.
4169 * <p>Type: INTEGER</p>
4170 */
4171 public static final String ID = "_id";
4172
4173 /**
4174 * Descriptive name of the bookmark that can be displayed to the user.
4175 * If this is empty, the title should be resolved at display time (use
4176 * {@link #getTitle(Context, Cursor)} any time you want to display the
4177 * title of a bookmark.)
4178 * <P>
4179 * Type: TEXT
4180 * </P>
4181 */
4182 public static final String TITLE = "title";
4183
4184 /**
4185 * Arbitrary string (displayed to the user) that allows bookmarks to be
4186 * organized into categories. There are some special names for
4187 * standard folders, which all start with '@'. The label displayed for
4188 * the folder changes with the locale (via {@link #getLabelForFolder}) but
4189 * the folder name does not change so you can consistently query for
4190 * the folder regardless of the current locale.
4191 *
4192 * <P>Type: TEXT</P>
4193 *
4194 */
4195 public static final String FOLDER = "folder";
4196
4197 /**
4198 * The Intent URL of the bookmark, describing what it points to. This
4199 * value is given to {@link android.content.Intent#getIntent} to create
4200 * an Intent that can be launched.
4201 * <P>Type: TEXT</P>
4202 */
4203 public static final String INTENT = "intent";
4204
4205 /**
4206 * Optional shortcut character associated with this bookmark.
4207 * <P>Type: INTEGER</P>
4208 */
4209 public static final String SHORTCUT = "shortcut";
4210
4211 /**
4212 * The order in which the bookmark should be displayed
4213 * <P>Type: INTEGER</P>
4214 */
4215 public static final String ORDERING = "ordering";
4216
4217 private static final String[] sIntentProjection = { INTENT };
4218 private static final String[] sShortcutProjection = { ID, SHORTCUT };
4219 private static final String sShortcutSelection = SHORTCUT + "=?";
4220
4221 /**
4222 * Convenience function to retrieve the bookmarked Intent for a
4223 * particular shortcut key.
4224 *
4225 * @param cr The ContentResolver to query.
4226 * @param shortcut The shortcut key.
4227 *
4228 * @return Intent The bookmarked URL, or null if there is no bookmark
4229 * matching the given shortcut.
4230 */
4231 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
4232 {
4233 Intent intent = null;
4234
4235 Cursor c = cr.query(CONTENT_URI,
4236 sIntentProjection, sShortcutSelection,
4237 new String[] { String.valueOf((int) shortcut) }, ORDERING);
4238 // Keep trying until we find a valid shortcut
4239 try {
4240 while (intent == null && c.moveToNext()) {
4241 try {
4242 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02004243 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004244 } catch (java.net.URISyntaxException e) {
4245 // The stored URL is bad... ignore it.
4246 } catch (IllegalArgumentException e) {
4247 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07004248 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004249 }
4250 }
4251 } finally {
4252 if (c != null) c.close();
4253 }
4254
4255 return intent;
4256 }
4257
4258 /**
4259 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004260 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004261 * @param cr The ContentResolver to query.
4262 * @param intent The desired target of the bookmark.
4263 * @param title Bookmark title that is shown to the user; null if none
4264 * or it should be resolved to the intent's title.
4265 * @param folder Folder in which to place the bookmark; null if none.
4266 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
4267 * this is non-zero and there is an existing bookmark entry
4268 * with this same shortcut, then that existing shortcut is
4269 * cleared (the bookmark is not removed).
4270 * @return The unique content URL for the new bookmark entry.
4271 */
4272 public static Uri add(ContentResolver cr,
4273 Intent intent,
4274 String title,
4275 String folder,
4276 char shortcut,
4277 int ordering)
4278 {
4279 // If a shortcut is supplied, and it is already defined for
4280 // another bookmark, then remove the old definition.
4281 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05004282 cr.delete(CONTENT_URI, sShortcutSelection,
4283 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004284 }
4285
4286 ContentValues values = new ContentValues();
4287 if (title != null) values.put(TITLE, title);
4288 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07004289 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004290 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
4291 values.put(ORDERING, ordering);
4292 return cr.insert(CONTENT_URI, values);
4293 }
4294
4295 /**
4296 * Return the folder name as it should be displayed to the user. This
4297 * takes care of localizing special folders.
4298 *
4299 * @param r Resources object for current locale; only need access to
4300 * system resources.
4301 * @param folder The value found in the {@link #FOLDER} column.
4302 *
4303 * @return CharSequence The label for this folder that should be shown
4304 * to the user.
4305 */
4306 public static CharSequence getLabelForFolder(Resources r, String folder) {
4307 return folder;
4308 }
4309
4310 /**
4311 * Return the title as it should be displayed to the user. This takes
4312 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004313 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004314 * @param context A context.
4315 * @param cursor A cursor pointing to the row whose title should be
4316 * returned. The cursor must contain at least the {@link #TITLE}
4317 * and {@link #INTENT} columns.
4318 * @return A title that is localized and can be displayed to the user,
4319 * or the empty string if one could not be found.
4320 */
4321 public static CharSequence getTitle(Context context, Cursor cursor) {
4322 int titleColumn = cursor.getColumnIndex(TITLE);
4323 int intentColumn = cursor.getColumnIndex(INTENT);
4324 if (titleColumn == -1 || intentColumn == -1) {
4325 throw new IllegalArgumentException(
4326 "The cursor must contain the TITLE and INTENT columns.");
4327 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004328
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004329 String title = cursor.getString(titleColumn);
4330 if (!TextUtils.isEmpty(title)) {
4331 return title;
4332 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004333
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004334 String intentUri = cursor.getString(intentColumn);
4335 if (TextUtils.isEmpty(intentUri)) {
4336 return "";
4337 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004338
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004339 Intent intent;
4340 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02004341 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004342 } catch (URISyntaxException e) {
4343 return "";
4344 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004345
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004346 PackageManager packageManager = context.getPackageManager();
4347 ResolveInfo info = packageManager.resolveActivity(intent, 0);
4348 return info != null ? info.loadLabel(packageManager) : "";
4349 }
4350 }
4351
4352 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004353 * Returns the device ID that we should use when connecting to the mobile gtalk server.
4354 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
4355 * from the GoogleLoginService.
4356 *
4357 * @param androidId The Android ID for this device.
4358 * @return The device ID that should be used when connecting to the mobile gtalk server.
4359 * @hide
4360 */
4361 public static String getGTalkDeviceId(long androidId) {
4362 return "android-" + Long.toHexString(androidId);
4363 }
4364}