blob: 03cba3da429339ced5c7f253bca9461949b7f299 [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;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080041import android.text.TextUtils;
42import android.util.AndroidException;
43import android.util.Log;
44
45import java.net.URISyntaxException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046import java.util.HashMap;
47import java.util.HashSet;
48
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049/**
50 * The Settings provider contains global system-level device preferences.
51 */
52public final class Settings {
53
54 // Intent actions for Settings
55
56 /**
57 * Activity Action: Show system settings.
58 * <p>
59 * Input: Nothing.
60 * <p>
61 * Output: nothing.
62 */
63 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
64 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
65
66 /**
67 * Activity Action: Show settings to allow configuration of APNs.
68 * <p>
69 * Input: Nothing.
70 * <p>
71 * Output: nothing.
72 */
73 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
74 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
75
76 /**
77 * Activity Action: Show settings to allow configuration of current location
78 * sources.
79 * <p>
80 * In some cases, a matching Activity may not exist, so ensure you
81 * safeguard against this.
82 * <p>
83 * Input: Nothing.
84 * <p>
85 * Output: Nothing.
86 */
87 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
88 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
89 "android.settings.LOCATION_SOURCE_SETTINGS";
90
91 /**
92 * Activity Action: Show settings to allow configuration of wireless controls
93 * such as Wi-Fi, Bluetooth and Mobile networks.
94 * <p>
95 * In some cases, a matching Activity may not exist, so ensure you
96 * safeguard against this.
97 * <p>
98 * Input: Nothing.
99 * <p>
100 * Output: Nothing.
101 */
102 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
103 public static final String ACTION_WIRELESS_SETTINGS =
104 "android.settings.WIRELESS_SETTINGS";
105
106 /**
107 * Activity Action: Show settings to allow entering/exiting airplane mode.
108 * <p>
109 * In some cases, a matching Activity may not exist, so ensure you
110 * safeguard against this.
111 * <p>
112 * Input: Nothing.
113 * <p>
114 * Output: Nothing.
115 */
116 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
117 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
118 "android.settings.AIRPLANE_MODE_SETTINGS";
119
120 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700121 * Activity Action: Show settings for accessibility modules.
122 * <p>
123 * In some cases, a matching Activity may not exist, so ensure you
124 * safeguard against this.
125 * <p>
126 * Input: Nothing.
127 * <p>
128 * Output: Nothing.
129 */
130 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
131 public static final String ACTION_ACCESSIBILITY_SETTINGS =
132 "android.settings.ACCESSIBILITY_SETTINGS";
133
134 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800135 * Activity Action: Show settings to allow configuration of security and
136 * location privacy.
137 * <p>
138 * In some cases, a matching Activity may not exist, so ensure you
139 * safeguard against this.
140 * <p>
141 * Input: Nothing.
142 * <p>
143 * Output: Nothing.
144 */
145 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
146 public static final String ACTION_SECURITY_SETTINGS =
147 "android.settings.SECURITY_SETTINGS";
148
149 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700150 * Activity Action: Show settings to allow configuration of privacy options.
151 * <p>
152 * In some cases, a matching Activity may not exist, so ensure you
153 * safeguard against this.
154 * <p>
155 * Input: Nothing.
156 * <p>
157 * Output: Nothing.
158 */
159 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
160 public static final String ACTION_PRIVACY_SETTINGS =
161 "android.settings.PRIVACY_SETTINGS";
162
163 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800164 * Activity Action: Show settings to allow configuration of Wi-Fi.
165
166 * <p>
167 * In some cases, a matching Activity may not exist, so ensure you
168 * safeguard against this.
169 * <p>
170 * Input: Nothing.
171 * <p>
172 * Output: Nothing.
173
174 */
175 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
176 public static final String ACTION_WIFI_SETTINGS =
177 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700178
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800179 /**
180 * Activity Action: Show settings to allow configuration of a static IP
181 * address for Wi-Fi.
182 * <p>
183 * In some cases, a matching Activity may not exist, so ensure you safeguard
184 * against this.
185 * <p>
186 * Input: Nothing.
187 * <p>
188 * Output: Nothing.
189 */
190 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
191 public static final String ACTION_WIFI_IP_SETTINGS =
192 "android.settings.WIFI_IP_SETTINGS";
193
194 /**
195 * Activity Action: Show settings to allow configuration of Bluetooth.
196 * <p>
197 * In some cases, a matching Activity may not exist, so ensure you
198 * safeguard against this.
199 * <p>
200 * Input: Nothing.
201 * <p>
202 * Output: Nothing.
203 */
204 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
205 public static final String ACTION_BLUETOOTH_SETTINGS =
206 "android.settings.BLUETOOTH_SETTINGS";
207
208 /**
209 * Activity Action: Show settings to allow configuration of date and time.
210 * <p>
211 * In some cases, a matching Activity may not exist, so ensure you
212 * safeguard against this.
213 * <p>
214 * Input: Nothing.
215 * <p>
216 * Output: Nothing.
217 */
218 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
219 public static final String ACTION_DATE_SETTINGS =
220 "android.settings.DATE_SETTINGS";
221
222 /**
223 * Activity Action: Show settings to allow configuration of sound and volume.
224 * <p>
225 * In some cases, a matching Activity may not exist, so ensure you
226 * safeguard against this.
227 * <p>
228 * Input: Nothing.
229 * <p>
230 * Output: Nothing.
231 */
232 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
233 public static final String ACTION_SOUND_SETTINGS =
234 "android.settings.SOUND_SETTINGS";
235
236 /**
237 * Activity Action: Show settings to allow configuration of display.
238 * <p>
239 * In some cases, a matching Activity may not exist, so ensure you
240 * safeguard against this.
241 * <p>
242 * Input: Nothing.
243 * <p>
244 * Output: Nothing.
245 */
246 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
247 public static final String ACTION_DISPLAY_SETTINGS =
248 "android.settings.DISPLAY_SETTINGS";
249
250 /**
251 * Activity Action: Show settings to allow configuration of locale.
252 * <p>
253 * In some cases, a matching Activity may not exist, so ensure you
254 * safeguard against this.
255 * <p>
256 * Input: Nothing.
257 * <p>
258 * Output: Nothing.
259 */
260 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
261 public static final String ACTION_LOCALE_SETTINGS =
262 "android.settings.LOCALE_SETTINGS";
263
264 /**
265 * Activity Action: Show settings to configure input methods, in particular
266 * allowing the user to enable input methods.
267 * <p>
268 * In some cases, a matching Activity may not exist, so ensure you
269 * safeguard against this.
270 * <p>
271 * Input: Nothing.
272 * <p>
273 * Output: Nothing.
274 */
275 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
276 public static final String ACTION_INPUT_METHOD_SETTINGS =
277 "android.settings.INPUT_METHOD_SETTINGS";
278
279 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900280 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900281 * <p>
282 * In some cases, a matching Activity may not exist, so ensure you
283 * safeguard against this.
284 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900285 * To tell which input method's subtypes are displayed in the settings, add
286 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
287 * If there is no extra in this Intent, subtypes from all installed input methods
288 * will be displayed in the settings.
289 *
290 * @see android.view.inputmethod.InputMethodInfo#getId
291 * <p>
satok86417ea2010-10-27 14:11:03 +0900292 * Input: Nothing.
293 * <p>
294 * Output: Nothing.
295 */
296 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900297 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
298 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900299
300 /**
satok7cfc0ed2011-06-20 21:29:36 +0900301 * Activity Action: Show a dialog to select input method.
302 * <p>
303 * In some cases, a matching Activity may not exist, so ensure you
304 * safeguard against this.
305 * <p>
306 * Input: Nothing.
307 * <p>
308 * Output: Nothing.
309 * @hide
310 */
311 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
312 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
313 "android.settings.SHOW_INPUT_METHOD_PICKER";
314
315 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800316 * Activity Action: Show settings to manage the user input dictionary.
317 * <p>
318 * In some cases, a matching Activity may not exist, so ensure you
319 * safeguard against this.
320 * <p>
321 * Input: Nothing.
322 * <p>
323 * Output: Nothing.
324 */
325 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
326 public static final String ACTION_USER_DICTIONARY_SETTINGS =
327 "android.settings.USER_DICTIONARY_SETTINGS";
328
329 /**
330 * Activity Action: Show settings to allow configuration of application-related settings.
331 * <p>
332 * In some cases, a matching Activity may not exist, so ensure you
333 * safeguard against this.
334 * <p>
335 * Input: Nothing.
336 * <p>
337 * Output: Nothing.
338 */
339 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
340 public static final String ACTION_APPLICATION_SETTINGS =
341 "android.settings.APPLICATION_SETTINGS";
342
343 /**
344 * Activity Action: Show settings to allow configuration of application
345 * development-related settings.
346 * <p>
347 * In some cases, a matching Activity may not exist, so ensure you safeguard
348 * against this.
349 * <p>
350 * Input: Nothing.
351 * <p>
352 * Output: Nothing.
353 */
354 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
355 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
356 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
357
358 /**
359 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
360 * <p>
361 * In some cases, a matching Activity may not exist, so ensure you
362 * safeguard against this.
363 * <p>
364 * Input: Nothing.
365 * <p>
366 * Output: Nothing.
367 */
368 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
369 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
370 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700371
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800372 /**
373 * Activity Action: Show settings to manage installed applications.
374 * <p>
375 * In some cases, a matching Activity may not exist, so ensure you
376 * safeguard against this.
377 * <p>
378 * Input: Nothing.
379 * <p>
380 * Output: Nothing.
381 */
382 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
383 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
384 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700385
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800386 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700387 * Activity Action: Show settings to manage all applications.
388 * <p>
389 * In some cases, a matching Activity may not exist, so ensure you
390 * safeguard against this.
391 * <p>
392 * Input: Nothing.
393 * <p>
394 * Output: Nothing.
395 */
396 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
397 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
398 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
399
400 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700401 * Activity Action: Show screen of details about a particular application.
402 * <p>
403 * In some cases, a matching Activity may not exist, so ensure you
404 * safeguard against this.
405 * <p>
406 * Input: The Intent's data URI specifies the application package name
407 * to be shown, with the "package" scheme. That is "package:com.my.app".
408 * <p>
409 * Output: Nothing.
410 */
411 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
412 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
413 "android.settings.APPLICATION_DETAILS_SETTINGS";
414
415 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800416 * Activity Action: Show settings for system update functionality.
417 * <p>
418 * In some cases, a matching Activity may not exist, so ensure you
419 * safeguard against this.
420 * <p>
421 * Input: Nothing.
422 * <p>
423 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700424 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800425 * @hide
426 */
427 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
428 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
429 "android.settings.SYSTEM_UPDATE_SETTINGS";
430
431 /**
432 * Activity Action: Show settings to allow configuration of sync settings.
433 * <p>
434 * In some cases, a matching Activity may not exist, so ensure you
435 * safeguard against this.
436 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800437 * The account types available to add via the add account button may be restricted by adding an
438 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
439 * authorities. Only account types which can sync with that content provider will be offered to
440 * the user.
441 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800442 * Input: Nothing.
443 * <p>
444 * Output: Nothing.
445 */
446 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
447 public static final String ACTION_SYNC_SETTINGS =
448 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700449
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800450 /**
Erikeebc8e22010-02-18 13:27:19 -0800451 * Activity Action: Show add account screen for creating a new account.
452 * <p>
453 * In some cases, a matching Activity may not exist, so ensure you
454 * safeguard against this.
455 * <p>
456 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
457 * extra to the Intent with one or more syncable content provider's authorities. Only account
458 * types which can sync with that content provider will be offered to the user.
459 * <p>
460 * Input: Nothing.
461 * <p>
462 * Output: Nothing.
463 */
464 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
465 public static final String ACTION_ADD_ACCOUNT =
466 "android.settings.ADD_ACCOUNT_SETTINGS";
467
468 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800469 * Activity Action: Show settings for selecting the network operator.
470 * <p>
471 * In some cases, a matching Activity may not exist, so ensure you
472 * safeguard against this.
473 * <p>
474 * Input: Nothing.
475 * <p>
476 * Output: Nothing.
477 */
478 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
479 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
480 "android.settings.NETWORK_OPERATOR_SETTINGS";
481
482 /**
483 * Activity Action: Show settings for selection of 2G/3G.
484 * <p>
485 * In some cases, a matching Activity may not exist, so ensure you
486 * safeguard against this.
487 * <p>
488 * Input: Nothing.
489 * <p>
490 * Output: Nothing.
491 */
492 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
493 public static final String ACTION_DATA_ROAMING_SETTINGS =
494 "android.settings.DATA_ROAMING_SETTINGS";
495
496 /**
497 * Activity Action: Show settings for internal storage.
498 * <p>
499 * In some cases, a matching Activity may not exist, so ensure you
500 * safeguard against this.
501 * <p>
502 * Input: Nothing.
503 * <p>
504 * Output: Nothing.
505 */
506 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
507 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
508 "android.settings.INTERNAL_STORAGE_SETTINGS";
509 /**
510 * Activity Action: Show settings for memory card storage.
511 * <p>
512 * In some cases, a matching Activity may not exist, so ensure you
513 * safeguard against this.
514 * <p>
515 * Input: Nothing.
516 * <p>
517 * Output: Nothing.
518 */
519 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
520 public static final String ACTION_MEMORY_CARD_SETTINGS =
521 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700522
Justin Mattsonef340352010-01-13 21:05:46 -0800523 /**
524 * Activity Action: Show settings for global search.
525 * <p>
526 * In some cases, a matching Activity may not exist, so ensure you
527 * safeguard against this.
528 * <p>
529 * Input: Nothing.
530 * <p>
531 * Output: Nothing
532 */
533 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
534 public static final String ACTION_SEARCH_SETTINGS =
535 "android.search.action.SEARCH_SETTINGS";
536
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500537 /**
538 * Activity Action: Show general device information settings (serial
539 * number, software version, phone number, etc.).
540 * <p>
541 * In some cases, a matching Activity may not exist, so ensure you
542 * safeguard against this.
543 * <p>
544 * Input: Nothing.
545 * <p>
546 * Output: Nothing
547 */
548 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
549 public static final String ACTION_DEVICE_INFO_SETTINGS =
550 "android.settings.DEVICE_INFO_SETTINGS";
551
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500552 /**
553 * Activity Action: Show NFC sharing settings.
554 * <p>
555 * In some cases, a matching Activity may not exist, so ensure you
556 * safeguard against this.
557 * <p>
558 * Input: Nothing.
559 * <p>
560 * Output: Nothing
561 */
562 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
563 public static final String ACTION_NFCSHARING_SETTINGS =
564 "android.settings.NFCSHARING_SETTINGS";
565
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800566 // End of Intent actions for Settings
567
Erikeebc8e22010-02-18 13:27:19 -0800568 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800569 * @hide - Private call() method on SettingsProvider to read from 'system' table.
570 */
571 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
572
573 /**
574 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
575 */
576 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
577
578 /**
Erikeebc8e22010-02-18 13:27:19 -0800579 * Activity Extra: Limit available options in launched activity based on the given authority.
580 * <p>
581 * This can be passed as an extra field in an Activity Intent with one or more syncable content
582 * provider's authorities as a String[]. This field is used by some intents to alter the
583 * behavior of the called activity.
584 * <p>
585 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
586 * on the authority given.
587 */
588 public static final String EXTRA_AUTHORITIES =
589 "authorities";
590
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900591 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
592
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800593 private static final String JID_RESOURCE_PREFIX = "android";
594
595 public static final String AUTHORITY = "settings";
596
597 private static final String TAG = "Settings";
Joe Onorato43a17652011-04-06 19:22:23 -0700598 private static final boolean LOCAL_LOGV = false || false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800599
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800600 public static class SettingNotFoundException extends AndroidException {
601 public SettingNotFoundException(String msg) {
602 super(msg);
603 }
604 }
605
606 /**
607 * Common base for tables of name/value settings.
608 */
609 public static class NameValueTable implements BaseColumns {
610 public static final String NAME = "name";
611 public static final String VALUE = "value";
612
613 protected static boolean putString(ContentResolver resolver, Uri uri,
614 String name, String value) {
615 // The database will take care of replacing duplicates.
616 try {
617 ContentValues values = new ContentValues();
618 values.put(NAME, name);
619 values.put(VALUE, value);
620 resolver.insert(uri, values);
621 return true;
622 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -0700623 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800624 return false;
625 }
626 }
627
628 public static Uri getUriFor(Uri uri, String name) {
629 return Uri.withAppendedPath(uri, name);
630 }
631 }
632
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800633 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800634 private static class NameValueCache {
635 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800636 private final Uri mUri;
637
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800638 private static final String[] SELECT_VALUE =
639 new String[] { Settings.NameValueTable.VALUE };
640 private static final String NAME_EQ_PLACEHOLDER = "name=?";
641
642 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -0800643 private final HashMap<String, String> mValues = new HashMap<String, String>();
644 private long mValuesVersion = 0;
645
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800646 // Initially null; set lazily and held forever. Synchronized on 'this'.
647 private IContentProvider mContentProvider = null;
648
649 // The method we'll call (or null, to not use) on the provider
650 // for the fast path of retrieving settings.
651 private final String mCallCommand;
652
653 public NameValueCache(String versionSystemProperty, Uri uri, String callCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800654 mVersionSystemProperty = versionSystemProperty;
655 mUri = uri;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800656 mCallCommand = callCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800657 }
658
Dan Egnor799f7212009-11-24 16:24:44 -0800659 public String getString(ContentResolver cr, String name) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800660 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -0800661
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800662 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -0800663 if (mValuesVersion != newValuesVersion) {
664 if (LOCAL_LOGV) {
665 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current " +
666 newValuesVersion + " != cached " + mValuesVersion);
667 }
668
669 mValues.clear();
670 mValuesVersion = newValuesVersion;
671 }
672
673 if (mValues.containsKey(name)) {
674 return mValues.get(name); // Could be null, that's OK -- negative caching
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800675 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800676 }
Dan Egnor799f7212009-11-24 16:24:44 -0800677
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800678 IContentProvider cp = null;
679 synchronized (this) {
680 cp = mContentProvider;
681 if (cp == null) {
682 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
683 }
684 }
685
686 // Try the fast path first, not using query(). If this
687 // fails (alternate Settings provider that doesn't support
688 // this interface?) then we fall back to the query/table
689 // interface.
690 if (mCallCommand != null) {
691 try {
692 Bundle b = cp.call(mCallCommand, name, null);
693 if (b != null) {
694 String value = b.getPairValue();
695 synchronized (this) {
696 mValues.put(name, value);
697 }
698 return value;
699 }
700 // If the response Bundle is null, we fall through
701 // to the query interface below.
702 } catch (RemoteException e) {
703 // Not supported by the remote side? Fall through
704 // to query().
705 }
706 }
707
Dan Egnor799f7212009-11-24 16:24:44 -0800708 Cursor c = null;
709 try {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800710 c = cp.query(mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
711 new String[]{name}, null);
Dan Egnor799f7212009-11-24 16:24:44 -0800712 if (c == null) {
713 Log.w(TAG, "Can't get key " + name + " from " + mUri);
714 return null;
715 }
716
717 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800718 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -0800719 mValues.put(name, value);
720 }
721 if (LOCAL_LOGV) {
722 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
723 name + " = " + (value == null ? "(null)" : value));
724 }
725 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800726 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -0800727 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
728 return null; // Return null, but don't cache it.
729 } finally {
730 if (c != null) c.close();
731 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800732 }
733 }
734
735 /**
736 * System settings, containing miscellaneous system preferences. This
737 * table holds simple name/value pairs. There are convenience
738 * functions for accessing individual settings entries.
739 */
740 public static final class System extends NameValueTable {
741 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
742
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800743 // Populated lazily, guarded by class object:
744 private static NameValueCache sNameValueCache = null;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700745
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800746 private static final HashSet<String> MOVED_TO_SECURE;
747 static {
748 MOVED_TO_SECURE = new HashSet<String>(30);
749 MOVED_TO_SECURE.add(Secure.ADB_ENABLED);
750 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
751 MOVED_TO_SECURE.add(Secure.BLUETOOTH_ON);
752 MOVED_TO_SECURE.add(Secure.DATA_ROAMING);
753 MOVED_TO_SECURE.add(Secure.DEVICE_PROVISIONED);
754 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
755 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
756 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Amith Yamasani156c4352010-03-05 17:10:03 -0800757 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
758 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
759 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800760 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
761 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
762 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
763 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
764 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
765 MOVED_TO_SECURE.add(Secure.USB_MASS_STORAGE_ENABLED);
766 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
767 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
768 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
769 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
770 MOVED_TO_SECURE.add(Secure.WIFI_ON);
771 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
772 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
773 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
774 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
775 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
776 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
777 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
778 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
779 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
780 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
781 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
782 }
783
784 /**
785 * Look up a name in the database.
786 * @param resolver to access the database with
787 * @param name to look up in the table
788 * @return the corresponding value, or null if not present
789 */
790 public synchronized static String getString(ContentResolver resolver, String name) {
791 if (MOVED_TO_SECURE.contains(name)) {
792 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
793 + " to android.provider.Settings.Secure, returning read-only value.");
794 return Secure.getString(resolver, name);
795 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800796 if (sNameValueCache == null) {
797 sNameValueCache = new NameValueCache(SYS_PROP_SETTING_VERSION, CONTENT_URI,
798 CALL_METHOD_GET_SYSTEM);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800799 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800800 return sNameValueCache.getString(resolver, name);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800801 }
802
803 /**
804 * Store a name/value pair into the database.
805 * @param resolver to access the database with
806 * @param name to store
807 * @param value to associate with the name
808 * @return true if the value was set, false on database errors
809 */
810 public static boolean putString(ContentResolver resolver, String name, String value) {
811 if (MOVED_TO_SECURE.contains(name)) {
812 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
813 + " to android.provider.Settings.Secure, value is unchanged.");
814 return false;
815 }
816 return putString(resolver, CONTENT_URI, name, value);
817 }
818
819 /**
820 * Construct the content URI for a particular name/value pair,
821 * useful for monitoring changes with a ContentObserver.
822 * @param name to look up in the table
823 * @return the corresponding content URI, or null if not present
824 */
825 public static Uri getUriFor(String name) {
826 if (MOVED_TO_SECURE.contains(name)) {
827 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
828 + " to android.provider.Settings.Secure, returning Secure URI.");
829 return Secure.getUriFor(Secure.CONTENT_URI, name);
830 }
831 return getUriFor(CONTENT_URI, name);
832 }
833
834 /**
835 * Convenience function for retrieving a single system settings value
836 * as an integer. Note that internally setting values are always
837 * stored as strings; this function converts the string to an integer
838 * for you. The default value will be returned if the setting is
839 * not defined or not an integer.
840 *
841 * @param cr The ContentResolver to access.
842 * @param name The name of the setting to retrieve.
843 * @param def Value to return if the setting is not defined.
844 *
845 * @return The setting's current value, or 'def' if it is not defined
846 * or not a valid integer.
847 */
848 public static int getInt(ContentResolver cr, String name, int def) {
849 String v = getString(cr, name);
850 try {
851 return v != null ? Integer.parseInt(v) : def;
852 } catch (NumberFormatException e) {
853 return def;
854 }
855 }
856
857 /**
858 * Convenience function for retrieving a single system settings value
859 * as an integer. Note that internally setting values are always
860 * stored as strings; this function converts the string to an integer
861 * for you.
862 * <p>
863 * This version does not take a default value. If the setting has not
864 * been set, or the string value is not a number,
865 * it throws {@link SettingNotFoundException}.
866 *
867 * @param cr The ContentResolver to access.
868 * @param name The name of the setting to retrieve.
869 *
870 * @throws SettingNotFoundException Thrown if a setting by the given
871 * name can't be found or the setting value is not an integer.
872 *
873 * @return The setting's current value.
874 */
875 public static int getInt(ContentResolver cr, String name)
876 throws SettingNotFoundException {
877 String v = getString(cr, name);
878 try {
879 return Integer.parseInt(v);
880 } catch (NumberFormatException e) {
881 throw new SettingNotFoundException(name);
882 }
883 }
884
885 /**
886 * Convenience function for updating a single settings value as an
887 * integer. This will either create a new entry in the table if the
888 * given name does not exist, or modify the value of the existing row
889 * with that name. Note that internally setting values are always
890 * stored as strings, so this function converts the given value to a
891 * string before storing it.
892 *
893 * @param cr The ContentResolver to access.
894 * @param name The name of the setting to modify.
895 * @param value The new value for the setting.
896 * @return true if the value was set, false on database errors
897 */
898 public static boolean putInt(ContentResolver cr, String name, int value) {
899 return putString(cr, name, Integer.toString(value));
900 }
901
902 /**
903 * Convenience function for retrieving a single system settings value
904 * as a {@code long}. Note that internally setting values are always
905 * stored as strings; this function converts the string to a {@code long}
906 * for you. The default value will be returned if the setting is
907 * not defined or not a {@code long}.
908 *
909 * @param cr The ContentResolver to access.
910 * @param name The name of the setting to retrieve.
911 * @param def Value to return if the setting is not defined.
912 *
913 * @return The setting's current value, or 'def' if it is not defined
914 * or not a valid {@code long}.
915 */
916 public static long getLong(ContentResolver cr, String name, long def) {
917 String valString = getString(cr, name);
918 long value;
919 try {
920 value = valString != null ? Long.parseLong(valString) : def;
921 } catch (NumberFormatException e) {
922 value = def;
923 }
924 return value;
925 }
926
927 /**
928 * Convenience function for retrieving a single system settings value
929 * as a {@code long}. Note that internally setting values are always
930 * stored as strings; this function converts the string to a {@code long}
931 * for you.
932 * <p>
933 * This version does not take a default value. If the setting has not
934 * been set, or the string value is not a number,
935 * it throws {@link SettingNotFoundException}.
936 *
937 * @param cr The ContentResolver to access.
938 * @param name The name of the setting to retrieve.
939 *
940 * @return The setting's current value.
941 * @throws SettingNotFoundException Thrown if a setting by the given
942 * name can't be found or the setting value is not an integer.
943 */
944 public static long getLong(ContentResolver cr, String name)
945 throws SettingNotFoundException {
946 String valString = getString(cr, name);
947 try {
948 return Long.parseLong(valString);
949 } catch (NumberFormatException e) {
950 throw new SettingNotFoundException(name);
951 }
952 }
953
954 /**
955 * Convenience function for updating a single settings value as a long
956 * integer. This will either create a new entry in the table if the
957 * given name does not exist, or modify the value of the existing row
958 * with that name. Note that internally setting values are always
959 * stored as strings, so this function converts the given value to a
960 * string before storing it.
961 *
962 * @param cr The ContentResolver to access.
963 * @param name The name of the setting to modify.
964 * @param value The new value for the setting.
965 * @return true if the value was set, false on database errors
966 */
967 public static boolean putLong(ContentResolver cr, String name, long value) {
968 return putString(cr, name, Long.toString(value));
969 }
970
971 /**
972 * Convenience function for retrieving a single system settings value
973 * as a floating point number. Note that internally setting values are
974 * always stored as strings; this function converts the string to an
975 * float for you. The default value will be returned if the setting
976 * is not defined or not a valid float.
977 *
978 * @param cr The ContentResolver to access.
979 * @param name The name of the setting to retrieve.
980 * @param def Value to return if the setting is not defined.
981 *
982 * @return The setting's current value, or 'def' if it is not defined
983 * or not a valid float.
984 */
985 public static float getFloat(ContentResolver cr, String name, float def) {
986 String v = getString(cr, name);
987 try {
988 return v != null ? Float.parseFloat(v) : def;
989 } catch (NumberFormatException e) {
990 return def;
991 }
992 }
993
994 /**
995 * Convenience function for retrieving a single system settings value
996 * as a float. Note that internally setting values are always
997 * stored as strings; this function converts the string to a float
998 * for you.
999 * <p>
1000 * This version does not take a default value. If the setting has not
1001 * been set, or the string value is not a number,
1002 * it throws {@link SettingNotFoundException}.
1003 *
1004 * @param cr The ContentResolver to access.
1005 * @param name The name of the setting to retrieve.
1006 *
1007 * @throws SettingNotFoundException Thrown if a setting by the given
1008 * name can't be found or the setting value is not a float.
1009 *
1010 * @return The setting's current value.
1011 */
1012 public static float getFloat(ContentResolver cr, String name)
1013 throws SettingNotFoundException {
1014 String v = getString(cr, name);
Brian Muramatsue1d46982010-12-06 17:34:20 -08001015 if (v == null) {
1016 throw new SettingNotFoundException(name);
1017 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001018 try {
1019 return Float.parseFloat(v);
1020 } catch (NumberFormatException e) {
1021 throw new SettingNotFoundException(name);
1022 }
1023 }
1024
1025 /**
1026 * Convenience function for updating a single settings value as a
1027 * floating point number. This will either create a new entry in the
1028 * table if the given name does not exist, or modify the value of the
1029 * existing row with that name. Note that internally setting values
1030 * are always stored as strings, so this function converts the given
1031 * value to a string before storing it.
1032 *
1033 * @param cr The ContentResolver to access.
1034 * @param name The name of the setting to modify.
1035 * @param value The new value for the setting.
1036 * @return true if the value was set, false on database errors
1037 */
1038 public static boolean putFloat(ContentResolver cr, String name, float value) {
1039 return putString(cr, name, Float.toString(value));
1040 }
1041
1042 /**
1043 * Convenience function to read all of the current
1044 * configuration-related settings into a
1045 * {@link Configuration} object.
1046 *
1047 * @param cr The ContentResolver to access.
1048 * @param outConfig Where to place the configuration settings.
1049 */
1050 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
1051 outConfig.fontScale = Settings.System.getFloat(
1052 cr, FONT_SCALE, outConfig.fontScale);
1053 if (outConfig.fontScale < 0) {
1054 outConfig.fontScale = 1;
1055 }
1056 }
1057
1058 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001059 * @hide Erase the fields in the Configuration that should be applied
1060 * by the settings.
1061 */
1062 public static void clearConfiguration(Configuration inoutConfig) {
1063 inoutConfig.fontScale = 0;
1064 }
1065
1066 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001067 * Convenience function to write a batch of configuration-related
1068 * settings from a {@link Configuration} object.
1069 *
1070 * @param cr The ContentResolver to access.
1071 * @param config The settings to write.
1072 * @return true if the values were set, false on database errors
1073 */
1074 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
1075 return Settings.System.putFloat(cr, FONT_SCALE, config.fontScale);
1076 }
1077
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001078 /** @hide */
1079 public static boolean hasInterestingConfigurationChanges(int changes) {
1080 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1081 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001082
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001083 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
1084 return getInt(cr, SHOW_GTALK_SERVICE_STATUS, 0) != 0;
1085 }
1086
1087 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
1088 putInt(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0);
1089 }
1090
1091 /**
1092 * The content:// style URL for this table
1093 */
1094 public static final Uri CONTENT_URI =
1095 Uri.parse("content://" + AUTHORITY + "/system");
1096
1097 /**
1098 * Whether we keep the device on while the device is plugged in.
1099 * Supported values are:
1100 * <ul>
1101 * <li>{@code 0} to never stay on while plugged in</li>
1102 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
1103 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
1104 * </ul>
1105 * These values can be OR-ed together.
1106 */
1107 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
1108
1109 /**
1110 * What happens when the user presses the end call button if they're not
1111 * on a call.<br/>
1112 * <b>Values:</b><br/>
1113 * 0 - The end button does nothing.<br/>
1114 * 1 - The end button goes to the home screen.<br/>
1115 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1116 * 3 - The end button goes to the home screen. If the user is already on the
1117 * home screen, it puts the device to sleep.
1118 */
1119 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1120
1121 /**
David Brown458e8062010-03-08 21:52:11 -08001122 * END_BUTTON_BEHAVIOR value for "go home".
1123 * @hide
1124 */
1125 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1126
1127 /**
1128 * END_BUTTON_BEHAVIOR value for "go to sleep".
1129 * @hide
1130 */
1131 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
1132
1133 /**
1134 * END_BUTTON_BEHAVIOR default value.
1135 * @hide
1136 */
1137 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
1138
1139 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07001140 * Is advanced settings mode turned on. 0 == no, 1 == yes
1141 * @hide
1142 */
1143 public static final String ADVANCED_SETTINGS = "advanced_settings";
1144
1145 /**
1146 * ADVANCED_SETTINGS default value.
1147 * @hide
1148 */
1149 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
1150
1151 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001152 * Whether Airplane Mode is on.
1153 */
1154 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
1155
1156 /**
1157 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
1158 */
1159 public static final String RADIO_BLUETOOTH = "bluetooth";
1160
1161 /**
1162 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
1163 */
1164 public static final String RADIO_WIFI = "wifi";
1165
1166 /**
1167 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
1168 */
1169 public static final String RADIO_CELL = "cell";
1170
1171 /**
Nick Pelly8d32a012011-08-09 07:03:49 -07001172 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
1173 */
1174 public static final String RADIO_NFC = "nfc";
1175
1176 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001177 * A comma separated list of radios that need to be disabled when airplane mode
1178 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
1179 * included in the comma separated list.
1180 */
1181 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
1182
1183 /**
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001184 * A comma separated list of radios that should to be disabled when airplane mode
1185 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
1186 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
1187 * will be turned off when entering airplane mode, but the user will be able to reenable
1188 * Wifi in the Settings app.
1189 *
1190 * {@hide}
1191 */
1192 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
1193
1194 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001195 * The policy for deciding when Wi-Fi should go to sleep (which will in
1196 * turn switch to using the mobile data as an Internet connection).
1197 * <p>
1198 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
1199 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
1200 * {@link #WIFI_SLEEP_POLICY_NEVER}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001201 */
1202 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
1203
1204 /**
1205 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
1206 * policy, which is to sleep shortly after the turning off
1207 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001208 */
1209 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
1210
1211 /**
1212 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
1213 * the device is on battery, and never go to sleep when the device is
1214 * plugged in.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001215 */
1216 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001217
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001218 /**
1219 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001220 */
1221 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001222
Irfan Sheriff31b62322010-08-30 12:26:00 -07001223 //TODO: deprecate static IP constants
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001224 /**
1225 * Whether to use static IP and other static network attributes.
1226 * <p>
1227 * Set to 1 for true and 0 for false.
1228 */
1229 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
1230
1231 /**
1232 * The static IP address.
1233 * <p>
1234 * Example: "192.168.1.51"
1235 */
1236 public static final String WIFI_STATIC_IP = "wifi_static_ip";
1237
1238 /**
1239 * If using static IP, the gateway's IP address.
1240 * <p>
1241 * Example: "192.168.1.1"
1242 */
1243 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
1244
1245 /**
1246 * If using static IP, the net mask.
1247 * <p>
1248 * Example: "255.255.255.0"
1249 */
1250 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
1251
1252 /**
1253 * If using static IP, the primary DNS's IP address.
1254 * <p>
1255 * Example: "192.168.1.1"
1256 */
1257 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
1258
1259 /**
1260 * If using static IP, the secondary DNS's IP address.
1261 * <p>
1262 * Example: "192.168.1.2"
1263 */
1264 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
1265
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001266
1267 /**
1268 * Determines whether remote devices may discover and/or connect to
1269 * this device.
1270 * <P>Type: INT</P>
1271 * 2 -- discoverable and connectable
1272 * 1 -- connectable but not discoverable
1273 * 0 -- neither connectable nor discoverable
1274 */
1275 public static final String BLUETOOTH_DISCOVERABILITY =
1276 "bluetooth_discoverability";
1277
1278 /**
1279 * Bluetooth discoverability timeout. If this value is nonzero, then
1280 * Bluetooth becomes discoverable for a certain number of seconds,
1281 * after which is becomes simply connectable. The value is in seconds.
1282 */
1283 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
1284 "bluetooth_discoverability_timeout";
1285
1286 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001287 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
1288 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001289 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001290 @Deprecated
1291 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001292
1293 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001294 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
1295 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001296 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001297 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001298 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
1299
1300 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001301 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08001302 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
1303 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001304 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001305 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001306 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
1307 "lock_pattern_tactile_feedback_enabled";
1308
1309
1310 /**
1311 * A formatted string of the next alarm that is set, or the empty string
1312 * if there is no alarm set.
1313 */
1314 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
1315
1316 /**
1317 * Scaling factor for fonts, float.
1318 */
1319 public static final String FONT_SCALE = "font_scale";
1320
1321 /**
1322 * Name of an application package to be debugged.
1323 */
1324 public static final String DEBUG_APP = "debug_app";
1325
1326 /**
1327 * If 1, when launching DEBUG_APP it will wait for the debugger before
1328 * starting user code. If 0, it will run normally.
1329 */
1330 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
1331
1332 /**
1333 * Whether or not to dim the screen. 0=no 1=yes
1334 */
1335 public static final String DIM_SCREEN = "dim_screen";
1336
1337 /**
1338 * The timeout before the screen turns off.
1339 */
1340 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
1341
1342 /**
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001343 * If 0, the compatibility mode is off for all applications.
1344 * If 1, older applications run under compatibility mode.
1345 * TODO: remove this settings before code freeze (bug/1907571)
1346 * @hide
1347 */
1348 public static final String COMPATIBILITY_MODE = "compatibility_mode";
1349
1350 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001351 * The screen backlight brightness between 0 and 255.
1352 */
1353 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
1354
1355 /**
Dan Murphy951764b2009-08-27 14:59:03 -05001356 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05001357 */
1358 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
1359
1360 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001361 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001362 */
1363 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
1364
1365 /**
1366 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001367 */
1368 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
1369
1370 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001371 * Control whether the process CPU usage meter should be shown.
1372 */
1373 public static final String SHOW_PROCESSES = "show_processes";
1374
1375 /**
1376 * If 1, the activity manager will aggressively finish activities and
1377 * processes as soon as they are no longer needed. If 0, the normal
1378 * extended lifetime is used.
1379 */
1380 public static final String ALWAYS_FINISH_ACTIVITIES =
1381 "always_finish_activities";
1382
1383
1384 /**
1385 * Ringer mode. This is used internally, changing this value will not
1386 * change the ringer mode. See AudioManager.
1387 */
1388 public static final String MODE_RINGER = "mode_ringer";
1389
1390 /**
1391 * Determines which streams are affected by ringer mode changes. The
1392 * stream type's bit should be set to 1 if it should be muted when going
1393 * into an inaudible ringer mode.
1394 */
1395 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
1396
1397 /**
1398 * Determines which streams are affected by mute. The
1399 * stream type's bit should be set to 1 if it should be muted when a mute request
1400 * is received.
1401 */
1402 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
1403
1404 /**
1405 * Whether vibrate is on for different events. This is used internally,
1406 * changing this value will not change the vibrate. See AudioManager.
1407 */
1408 public static final String VIBRATE_ON = "vibrate_on";
1409
1410 /**
1411 * Ringer volume. This is used internally, changing this value will not
1412 * change the volume. See AudioManager.
1413 */
1414 public static final String VOLUME_RING = "volume_ring";
1415
1416 /**
1417 * System/notifications volume. This is used internally, changing this
1418 * value will not change the volume. See AudioManager.
1419 */
1420 public static final String VOLUME_SYSTEM = "volume_system";
1421
1422 /**
1423 * Voice call volume. This is used internally, changing this value will
1424 * not change the volume. See AudioManager.
1425 */
1426 public static final String VOLUME_VOICE = "volume_voice";
1427
1428 /**
1429 * Music/media/gaming volume. This is used internally, changing this
1430 * value will not change the volume. See AudioManager.
1431 */
1432 public static final String VOLUME_MUSIC = "volume_music";
1433
1434 /**
1435 * Alarm volume. This is used internally, changing this
1436 * value will not change the volume. See AudioManager.
1437 */
1438 public static final String VOLUME_ALARM = "volume_alarm";
1439
1440 /**
1441 * Notification volume. This is used internally, changing this
1442 * value will not change the volume. See AudioManager.
1443 */
1444 public static final String VOLUME_NOTIFICATION = "volume_notification";
1445
1446 /**
Eric Laurent484d2882009-12-08 09:05:45 -08001447 * Bluetooth Headset volume. This is used internally, changing this value will
1448 * not change the volume. See AudioManager.
1449 */
1450 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
1451
1452 /**
Amith Yamasani42722bf2011-07-22 10:34:27 -07001453 * Whether the notifications should use the ring volume (value of 1) or a separate
1454 * notification volume (value of 0). In most cases, users will have this enabled so the
1455 * notification and ringer volumes will be the same. However, power users can disable this
1456 * and use the separate notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001457 * <p>
Amith Yamasani42722bf2011-07-22 10:34:27 -07001458 * Note: This is a one-off setting that will be removed in the future when there is profile
1459 * support. For this reason, it is kept hidden from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001460 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001461 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07001462 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001463 */
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001464 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001465 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001466
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001467 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05001468 * Whether silent mode should allow vibration feedback. This is used
1469 * internally in AudioService and the Sound settings activity to
1470 * coordinate decoupling of vibrate and silent modes. This setting
1471 * will likely be removed in a future release with support for
1472 * audio/vibe feedback profiles.
1473 *
1474 * @hide
1475 */
1476 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
1477
1478 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001479 * The mapping of stream type (integer) to its setting.
1480 */
1481 public static final String[] VOLUME_SETTINGS = {
1482 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08001483 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001484 };
1485
1486 /**
1487 * Appended to various volume related settings to record the previous
1488 * values before they the settings were affected by a silent/vibrate
1489 * ringer mode change.
1490 */
1491 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
1492
1493 /**
1494 * Persistent store for the system-wide default ringtone URI.
1495 * <p>
1496 * If you need to play the default ringtone at any given time, it is recommended
1497 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
1498 * to the set default ringtone at the time of playing.
1499 *
1500 * @see #DEFAULT_RINGTONE_URI
1501 */
1502 public static final String RINGTONE = "ringtone";
1503
1504 /**
1505 * A {@link Uri} that will point to the current default ringtone at any
1506 * given time.
1507 * <p>
1508 * If the current default ringtone is in the DRM provider and the caller
1509 * does not have permission, the exception will be a
1510 * FileNotFoundException.
1511 */
1512 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
1513
1514 /**
1515 * Persistent store for the system-wide default notification sound.
1516 *
1517 * @see #RINGTONE
1518 * @see #DEFAULT_NOTIFICATION_URI
1519 */
1520 public static final String NOTIFICATION_SOUND = "notification_sound";
1521
1522 /**
1523 * A {@link Uri} that will point to the current default notification
1524 * sound at any given time.
1525 *
1526 * @see #DEFAULT_RINGTONE_URI
1527 */
1528 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
1529
1530 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07001531 * Persistent store for the system-wide default alarm alert.
1532 *
1533 * @see #RINGTONE
1534 * @see #DEFAULT_ALARM_ALERT_URI
1535 */
1536 public static final String ALARM_ALERT = "alarm_alert";
1537
1538 /**
1539 * A {@link Uri} that will point to the current default alarm alert at
1540 * any given time.
1541 *
1542 * @see #DEFAULT_ALARM_ALERT_URI
1543 */
1544 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
1545
1546 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07001547 * Persistent store for the system default media button event receiver.
1548 *
1549 * @hide
1550 */
1551 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
1552
1553 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001554 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
1555 */
1556 public static final String TEXT_AUTO_REPLACE = "auto_replace";
1557
1558 /**
1559 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
1560 */
1561 public static final String TEXT_AUTO_CAPS = "auto_caps";
1562
1563 /**
1564 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
1565 * feature converts two spaces to a "." and space.
1566 */
1567 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001568
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001569 /**
1570 * Setting to showing password characters in text editors. 1 = On, 0 = Off
1571 */
1572 public static final String TEXT_SHOW_PASSWORD = "show_password";
1573
1574 public static final String SHOW_GTALK_SERVICE_STATUS =
1575 "SHOW_GTALK_SERVICE_STATUS";
1576
1577 /**
1578 * Name of activity to use for wallpaper on the home screen.
1579 */
1580 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
1581
1582 /**
1583 * Value to specify if the user prefers the date, time and time zone
1584 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
1585 */
1586 public static final String AUTO_TIME = "auto_time";
1587
1588 /**
Amith Yamasaniad450be2010-09-16 16:47:00 -07001589 * Value to specify if the user prefers the time zone
1590 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
1591 */
1592 public static final String AUTO_TIME_ZONE = "auto_time_zone";
1593
1594 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001595 * Display times as 12 or 24 hours
1596 * 12
1597 * 24
1598 */
1599 public static final String TIME_12_24 = "time_12_24";
1600
1601 /**
1602 * Date format string
1603 * mm/dd/yyyy
1604 * dd/mm/yyyy
1605 * yyyy/mm/dd
1606 */
1607 public static final String DATE_FORMAT = "date_format";
1608
1609 /**
1610 * Whether the setup wizard has been run before (on first boot), or if
1611 * it still needs to be run.
1612 *
1613 * nonzero = it has been run in the past
1614 * 0 = it has not been run in the past
1615 */
1616 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
1617
1618 /**
1619 * Scaling factor for normal window animations. Setting to 0 will disable window
1620 * animations.
1621 */
1622 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
1623
1624 /**
1625 * Scaling factor for activity transition animations. Setting to 0 will disable window
1626 * animations.
1627 */
1628 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
1629
1630 /**
1631 * Scaling factor for normal window animations. Setting to 0 will disable window
1632 * animations.
1633 * @hide
1634 */
1635 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
1636
1637 /**
1638 * Control whether the accelerometer will be used to change screen
1639 * orientation. If 0, it will not be used unless explicitly requested
1640 * by the application; if 1, it will be used by default unless explicitly
1641 * disabled by the application.
1642 */
1643 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
1644
1645 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04001646 * Default screen rotation when no other policy applies.
1647 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
1648 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08001649 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04001650 *
1651 * @see Display#getRotation
1652 */
1653 public static final String USER_ROTATION = "user_rotation";
1654
1655 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001656 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
1657 * boolean (1 or 0).
1658 */
1659 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
1660
1661 /**
David Kraused0f67152009-06-13 18:01:13 -05001662 * CDMA only settings
1663 * DTMF tone type played by the dialer when dialing.
1664 * 0 = Normal
1665 * 1 = Long
1666 * @hide
1667 */
1668 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
1669
1670 /**
1671 * CDMA only settings
1672 * Emergency Tone 0 = Off
1673 * 1 = Alert
1674 * 2 = Vibrate
1675 * @hide
1676 */
1677 public static final String EMERGENCY_TONE = "emergency_tone";
1678
1679 /**
1680 * CDMA only settings
1681 * Whether the auto retry is enabled. The value is
1682 * boolean (1 or 0).
1683 * @hide
1684 */
1685 public static final String CALL_AUTO_RETRY = "call_auto_retry";
1686
1687 /**
1688 * Whether the hearing aid is enabled. The value is
1689 * boolean (1 or 0).
1690 * @hide
1691 */
1692 public static final String HEARING_AID = "hearing_aid";
1693
1694 /**
1695 * CDMA only settings
1696 * TTY Mode
1697 * 0 = OFF
1698 * 1 = FULL
1699 * 2 = VCO
1700 * 3 = HCO
1701 * @hide
1702 */
1703 public static final String TTY_MODE = "tty_mode";
1704
1705 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001706 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
1707 * boolean (1 or 0).
1708 */
1709 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001710
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001711 /**
1712 * Whether the haptic feedback (long presses, ...) are enabled. The value is
1713 * boolean (1 or 0).
1714 */
1715 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07001716
Mike LeBeau48603e72009-06-05 00:27:00 +01001717 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01001718 * @deprecated Each application that shows web suggestions should have its own
1719 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01001720 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01001721 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01001722 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001723
-b master501eec92009-07-06 13:53:11 -07001724 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08001725 * Whether the notification LED should repeatedly flash when a notification is
1726 * pending. The value is boolean (1 or 0).
1727 * @hide
1728 */
1729 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
1730
1731 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08001732 * Show pointer location on screen?
1733 * 0 = no
1734 * 1 = yes
1735 * @hide
1736 */
1737 public static final String POINTER_LOCATION = "pointer_location";
1738
1739 /**
Jeff Brown4519f072011-01-23 13:16:01 -08001740 * Log raw orientation data from {@link WindowOrientationListener} for use with the
1741 * orientationplot.py tool.
1742 * 0 = no
1743 * 1 = yes
1744 * @hide
1745 */
1746 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
1747 "window_orientation_listener_log";
1748
1749 /**
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05001750 * Whether to play a sound for low-battery alerts.
1751 * @hide
1752 */
1753 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
1754
1755 /**
1756 * Whether to play a sound for dock events.
1757 * @hide
1758 */
1759 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
1760
1761 /**
1762 * Whether to play sounds when the keyguard is shown and dismissed.
1763 * @hide
1764 */
1765 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
1766
1767 /**
1768 * URI for the low battery sound file.
1769 * @hide
1770 */
1771 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
1772
1773 /**
1774 * URI for the desk dock "in" event sound.
1775 * @hide
1776 */
1777 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
1778
1779 /**
1780 * URI for the desk dock "out" event sound.
1781 * @hide
1782 */
1783 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
1784
1785 /**
1786 * URI for the car dock "in" event sound.
1787 * @hide
1788 */
1789 public static final String CAR_DOCK_SOUND = "car_dock_sound";
1790
1791 /**
1792 * URI for the car dock "out" event sound.
1793 * @hide
1794 */
1795 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
1796
1797 /**
1798 * URI for the "device locked" (keyguard shown) sound.
1799 * @hide
1800 */
1801 public static final String LOCK_SOUND = "lock_sound";
1802
1803 /**
1804 * URI for the "device unlocked" (keyguard dismissed) sound.
1805 * @hide
1806 */
1807 public static final String UNLOCK_SOUND = "unlock_sound";
1808
1809 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08001810 * Receive incoming SIP calls?
1811 * 0 = no
1812 * 1 = yes
1813 * @hide
1814 */
1815 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
1816
1817 /**
1818 * Call Preference String.
1819 * "SIP_ALWAYS" : Always use SIP with network access
1820 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
1821 * "SIP_ASK_ME_EACH_TIME" : Always ask me each time
1822 * @hide
1823 */
1824 public static final String SIP_CALL_OPTIONS = "sip_call_options";
1825
1826 /**
1827 * One of the sip call options: Always use SIP with network access.
1828 * @hide
1829 */
1830 public static final String SIP_ALWAYS = "SIP_ALWAYS";
1831
1832 /**
1833 * One of the sip call options: Only if destination is a SIP address.
1834 * @hide
1835 */
1836 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
1837
1838 /**
1839 * One of the sip call options: Always ask me each time.
1840 * @hide
1841 */
1842 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
1843
1844 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07001845 * Pointer speed setting.
1846 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
1847 * -7 = slowest
1848 * 0 = default speed
1849 * +7 = fastest
1850 * @hide
1851 */
1852 public static final String POINTER_SPEED = "pointer_speed";
1853
1854 /**
-b master501eec92009-07-06 13:53:11 -07001855 * Settings to backup. This is here so that it's in the same place as the settings
1856 * keys and easy to update.
1857 * @hide
1858 */
1859 public static final String[] SETTINGS_TO_BACKUP = {
1860 STAY_ON_WHILE_PLUGGED_IN,
-b master501eec92009-07-06 13:53:11 -07001861 WIFI_USE_STATIC_IP,
1862 WIFI_STATIC_IP,
1863 WIFI_STATIC_GATEWAY,
1864 WIFI_STATIC_NETMASK,
1865 WIFI_STATIC_DNS1,
1866 WIFI_STATIC_DNS2,
1867 BLUETOOTH_DISCOVERABILITY,
1868 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
1869 DIM_SCREEN,
1870 SCREEN_OFF_TIMEOUT,
1871 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07001872 SCREEN_BRIGHTNESS_MODE,
-b master501eec92009-07-06 13:53:11 -07001873 VIBRATE_ON,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07001874 MODE_RINGER,
1875 MODE_RINGER_STREAMS_AFFECTED,
1876 MUTE_STREAMS_AFFECTED,
1877 VOLUME_VOICE,
1878 VOLUME_SYSTEM,
1879 VOLUME_RING,
1880 VOLUME_MUSIC,
1881 VOLUME_ALARM,
1882 VOLUME_NOTIFICATION,
Eric Laurent484d2882009-12-08 09:05:45 -08001883 VOLUME_BLUETOOTH_SCO,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07001884 VOLUME_VOICE + APPEND_FOR_LAST_AUDIBLE,
1885 VOLUME_SYSTEM + APPEND_FOR_LAST_AUDIBLE,
1886 VOLUME_RING + APPEND_FOR_LAST_AUDIBLE,
1887 VOLUME_MUSIC + APPEND_FOR_LAST_AUDIBLE,
1888 VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE,
1889 VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE,
Eric Laurent484d2882009-12-08 09:05:45 -08001890 VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE,
Daniel Sandler1c7fa482010-03-10 09:45:01 -05001891 VIBRATE_IN_SILENT,
-b master501eec92009-07-06 13:53:11 -07001892 TEXT_AUTO_REPLACE,
1893 TEXT_AUTO_CAPS,
1894 TEXT_AUTO_PUNCTUATE,
1895 TEXT_SHOW_PASSWORD,
1896 AUTO_TIME,
Amith Yamasaniad450be2010-09-16 16:47:00 -07001897 AUTO_TIME_ZONE,
-b master501eec92009-07-06 13:53:11 -07001898 TIME_12_24,
1899 DATE_FORMAT,
1900 ACCELEROMETER_ROTATION,
Daniel Sandlerb73617d2010-08-17 00:41:00 -04001901 USER_ROTATION,
-b master501eec92009-07-06 13:53:11 -07001902 DTMF_TONE_WHEN_DIALING,
1903 DTMF_TONE_TYPE_WHEN_DIALING,
1904 EMERGENCY_TONE,
1905 CALL_AUTO_RETRY,
1906 HEARING_AID,
1907 TTY_MODE,
1908 SOUND_EFFECTS_ENABLED,
1909 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate14c2d792010-02-25 16:49:44 -08001910 POWER_SOUNDS_ENABLED,
1911 DOCK_SOUNDS_ENABLED,
1912 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08001913 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04001914 NOTIFICATION_LIGHT_PULSE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08001915 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07001916 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07001917 POINTER_SPEED,
-b master501eec92009-07-06 13:53:11 -07001918 };
1919
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001920 // Settings moved to Settings.Secure
1921
1922 /**
Mike Lockwood460ae0c2009-04-02 22:33:27 -07001923 * @deprecated Use {@link android.provider.Settings.Secure#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001924 * instead
1925 */
1926 @Deprecated
1927 public static final String ADB_ENABLED = Secure.ADB_ENABLED;
1928
1929 /**
1930 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
1931 */
1932 @Deprecated
1933 public static final String ANDROID_ID = Secure.ANDROID_ID;
1934
1935 /**
1936 * @deprecated Use {@link android.provider.Settings.Secure#BLUETOOTH_ON} instead
1937 */
1938 @Deprecated
1939 public static final String BLUETOOTH_ON = Secure.BLUETOOTH_ON;
1940
1941 /**
1942 * @deprecated Use {@link android.provider.Settings.Secure#DATA_ROAMING} instead
1943 */
1944 @Deprecated
1945 public static final String DATA_ROAMING = Secure.DATA_ROAMING;
1946
1947 /**
1948 * @deprecated Use {@link android.provider.Settings.Secure#DEVICE_PROVISIONED} instead
1949 */
1950 @Deprecated
1951 public static final String DEVICE_PROVISIONED = Secure.DEVICE_PROVISIONED;
1952
1953 /**
1954 * @deprecated Use {@link android.provider.Settings.Secure#HTTP_PROXY} instead
1955 */
1956 @Deprecated
1957 public static final String HTTP_PROXY = Secure.HTTP_PROXY;
1958
1959 /**
1960 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
1961 */
1962 @Deprecated
1963 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001964
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001965 /**
1966 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
1967 * instead
1968 */
1969 @Deprecated
1970 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
1971
1972 /**
1973 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
1974 */
1975 @Deprecated
1976 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001977
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001978 /**
1979 * @deprecated Use {@link android.provider.Settings.Secure#NETWORK_PREFERENCE} instead
1980 */
1981 @Deprecated
1982 public static final String NETWORK_PREFERENCE = Secure.NETWORK_PREFERENCE;
1983
1984 /**
1985 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
1986 * instead
1987 */
1988 @Deprecated
1989 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
1990
1991 /**
1992 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
1993 * instead
1994 */
1995 @Deprecated
1996 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
1997
1998 /**
1999 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
2000 * instead
2001 */
2002 @Deprecated
2003 public static final String PARENTAL_CONTROL_REDIRECT_URL =
2004 Secure.PARENTAL_CONTROL_REDIRECT_URL;
2005
2006 /**
2007 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
2008 */
2009 @Deprecated
2010 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
2011
2012 /**
2013 * @deprecated Use {@link android.provider.Settings.Secure#USB_MASS_STORAGE_ENABLED} instead
2014 */
2015 @Deprecated
2016 public static final String USB_MASS_STORAGE_ENABLED = Secure.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002017
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002018 /**
2019 * @deprecated Use {@link android.provider.Settings.Secure#USE_GOOGLE_MAIL} instead
2020 */
2021 @Deprecated
2022 public static final String USE_GOOGLE_MAIL = Secure.USE_GOOGLE_MAIL;
2023
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002024 /**
2025 * @deprecated Use
2026 * {@link android.provider.Settings.Secure#WIFI_MAX_DHCP_RETRY_COUNT} instead
2027 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002028 @Deprecated
2029 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Secure.WIFI_MAX_DHCP_RETRY_COUNT;
2030
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002031 /**
2032 * @deprecated Use
2033 * {@link android.provider.Settings.Secure#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
2034 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002035 @Deprecated
2036 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
2037 Secure.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
2038
2039 /**
2040 * @deprecated Use
2041 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
2042 */
2043 @Deprecated
2044 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
2045 Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
2046
2047 /**
2048 * @deprecated Use
2049 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
2050 */
2051 @Deprecated
2052 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
2053 Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
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#WIFI_NUM_OPEN_NETWORKS_KEPT}
2057 * instead
2058 */
2059 @Deprecated
2060 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Secure.WIFI_NUM_OPEN_NETWORKS_KEPT;
2061
2062 /**
2063 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_ON} instead
2064 */
2065 @Deprecated
2066 public static final String WIFI_ON = Secure.WIFI_ON;
2067
2068 /**
2069 * @deprecated Use
2070 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
2071 * instead
2072 */
2073 @Deprecated
2074 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
2075 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
2076
2077 /**
2078 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
2079 */
2080 @Deprecated
2081 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
2082
2083 /**
2084 * @deprecated Use
2085 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
2086 */
2087 @Deprecated
2088 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
2089 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002090
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002091 /**
2092 * @deprecated Use
2093 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
2094 */
2095 @Deprecated
2096 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
2097 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
2098
2099 /**
2100 * @deprecated Use
2101 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
2102 * instead
2103 */
2104 @Deprecated
2105 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
2106 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
2107
2108 /**
2109 * @deprecated Use
2110 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
2111 */
2112 @Deprecated
2113 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
2114 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
2115
2116 /**
2117 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
2118 * instead
2119 */
2120 @Deprecated
2121 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
2122
2123 /**
2124 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ON} instead
2125 */
2126 @Deprecated
2127 public static final String WIFI_WATCHDOG_ON = Secure.WIFI_WATCHDOG_ON;
2128
2129 /**
2130 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
2131 */
2132 @Deprecated
2133 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
2134
2135 /**
2136 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
2137 * instead
2138 */
2139 @Deprecated
2140 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
2141
2142 /**
2143 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
2144 * instead
2145 */
2146 @Deprecated
2147 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
2148 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
2149 }
2150
2151 /**
2152 * Secure system settings, containing system preferences that applications
2153 * can read but are not allowed to write. These are for preferences that
2154 * the user must explicitly modify through the system UI or specialized
2155 * APIs for those values, not modified directly by applications.
2156 */
2157 public static final class Secure extends NameValueTable {
2158 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
2159
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002160 // Populated lazily, guarded by class object:
2161 private static NameValueCache sNameValueCache = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002162
2163 /**
2164 * Look up a name in the database.
2165 * @param resolver to access the database with
2166 * @param name to look up in the table
2167 * @return the corresponding value, or null if not present
2168 */
2169 public synchronized static String getString(ContentResolver resolver, String name) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002170 if (sNameValueCache == null) {
2171 sNameValueCache = new NameValueCache(SYS_PROP_SETTING_VERSION, CONTENT_URI,
2172 CALL_METHOD_GET_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002173 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002174 return sNameValueCache.getString(resolver, name);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002175 }
2176
2177 /**
2178 * Store a name/value pair into the database.
2179 * @param resolver to access the database with
2180 * @param name to store
2181 * @param value to associate with the name
2182 * @return true if the value was set, false on database errors
2183 */
2184 public static boolean putString(ContentResolver resolver,
2185 String name, String value) {
2186 return putString(resolver, CONTENT_URI, name, value);
2187 }
2188
2189 /**
2190 * Construct the content URI for a particular name/value pair,
2191 * useful for monitoring changes with a ContentObserver.
2192 * @param name to look up in the table
2193 * @return the corresponding content URI, or null if not present
2194 */
2195 public static Uri getUriFor(String name) {
2196 return getUriFor(CONTENT_URI, name);
2197 }
2198
2199 /**
2200 * Convenience function for retrieving a single secure settings value
2201 * as an integer. Note that internally setting values are always
2202 * stored as strings; this function converts the string to an integer
2203 * for you. The default value will be returned if the setting is
2204 * not defined or not an integer.
2205 *
2206 * @param cr The ContentResolver to access.
2207 * @param name The name of the setting to retrieve.
2208 * @param def Value to return if the setting is not defined.
2209 *
2210 * @return The setting's current value, or 'def' if it is not defined
2211 * or not a valid integer.
2212 */
2213 public static int getInt(ContentResolver cr, String name, int def) {
2214 String v = getString(cr, name);
2215 try {
2216 return v != null ? Integer.parseInt(v) : def;
2217 } catch (NumberFormatException e) {
2218 return def;
2219 }
2220 }
2221
2222 /**
2223 * Convenience function for retrieving a single secure settings value
2224 * as an integer. Note that internally setting values are always
2225 * stored as strings; this function converts the string to an integer
2226 * for you.
2227 * <p>
2228 * This version does not take a default value. If the setting has not
2229 * been set, or the string value is not a number,
2230 * it throws {@link SettingNotFoundException}.
2231 *
2232 * @param cr The ContentResolver to access.
2233 * @param name The name of the setting to retrieve.
2234 *
2235 * @throws SettingNotFoundException Thrown if a setting by the given
2236 * name can't be found or the setting value is not an integer.
2237 *
2238 * @return The setting's current value.
2239 */
2240 public static int getInt(ContentResolver cr, String name)
2241 throws SettingNotFoundException {
2242 String v = getString(cr, name);
2243 try {
2244 return Integer.parseInt(v);
2245 } catch (NumberFormatException e) {
2246 throw new SettingNotFoundException(name);
2247 }
2248 }
2249
2250 /**
2251 * Convenience function for updating a single settings value as an
2252 * integer. This will either create a new entry in the table if the
2253 * given name does not exist, or modify the value of the existing row
2254 * with that name. Note that internally setting values are always
2255 * stored as strings, so this function converts the given value to a
2256 * string before storing it.
2257 *
2258 * @param cr The ContentResolver to access.
2259 * @param name The name of the setting to modify.
2260 * @param value The new value for the setting.
2261 * @return true if the value was set, false on database errors
2262 */
2263 public static boolean putInt(ContentResolver cr, String name, int value) {
2264 return putString(cr, name, Integer.toString(value));
2265 }
2266
2267 /**
2268 * Convenience function for retrieving a single secure settings value
2269 * as a {@code long}. Note that internally setting values are always
2270 * stored as strings; this function converts the string to a {@code long}
2271 * for you. The default value will be returned if the setting is
2272 * not defined or not a {@code long}.
2273 *
2274 * @param cr The ContentResolver to access.
2275 * @param name The name of the setting to retrieve.
2276 * @param def Value to return if the setting is not defined.
2277 *
2278 * @return The setting's current value, or 'def' if it is not defined
2279 * or not a valid {@code long}.
2280 */
2281 public static long getLong(ContentResolver cr, String name, long def) {
2282 String valString = getString(cr, name);
2283 long value;
2284 try {
2285 value = valString != null ? Long.parseLong(valString) : def;
2286 } catch (NumberFormatException e) {
2287 value = def;
2288 }
2289 return value;
2290 }
2291
2292 /**
2293 * Convenience function for retrieving a single secure settings value
2294 * as a {@code long}. Note that internally setting values are always
2295 * stored as strings; this function converts the string to a {@code long}
2296 * for you.
2297 * <p>
2298 * This version does not take a default value. If the setting has not
2299 * been set, or the string value is not a number,
2300 * it throws {@link SettingNotFoundException}.
2301 *
2302 * @param cr The ContentResolver to access.
2303 * @param name The name of the setting to retrieve.
2304 *
2305 * @return The setting's current value.
2306 * @throws SettingNotFoundException Thrown if a setting by the given
2307 * name can't be found or the setting value is not an integer.
2308 */
2309 public static long getLong(ContentResolver cr, String name)
2310 throws SettingNotFoundException {
2311 String valString = getString(cr, name);
2312 try {
2313 return Long.parseLong(valString);
2314 } catch (NumberFormatException e) {
2315 throw new SettingNotFoundException(name);
2316 }
2317 }
2318
2319 /**
2320 * Convenience function for updating a secure settings value as a long
2321 * integer. This will either create a new entry in the table if the
2322 * given name does not exist, or modify the value of the existing row
2323 * with that name. Note that internally setting values are always
2324 * stored as strings, so this function converts the given value to a
2325 * string before storing it.
2326 *
2327 * @param cr The ContentResolver to access.
2328 * @param name The name of the setting to modify.
2329 * @param value The new value for the setting.
2330 * @return true if the value was set, false on database errors
2331 */
2332 public static boolean putLong(ContentResolver cr, String name, long value) {
2333 return putString(cr, name, Long.toString(value));
2334 }
2335
2336 /**
2337 * Convenience function for retrieving a single secure settings value
2338 * as a floating point number. Note that internally setting values are
2339 * always stored as strings; this function converts the string to an
2340 * float for you. The default value will be returned if the setting
2341 * is not defined or not a valid float.
2342 *
2343 * @param cr The ContentResolver to access.
2344 * @param name The name of the setting to retrieve.
2345 * @param def Value to return if the setting is not defined.
2346 *
2347 * @return The setting's current value, or 'def' if it is not defined
2348 * or not a valid float.
2349 */
2350 public static float getFloat(ContentResolver cr, String name, float def) {
2351 String v = getString(cr, name);
2352 try {
2353 return v != null ? Float.parseFloat(v) : def;
2354 } catch (NumberFormatException e) {
2355 return def;
2356 }
2357 }
2358
2359 /**
2360 * Convenience function for retrieving a single secure settings value
2361 * as a float. Note that internally setting values are always
2362 * stored as strings; this function converts the string to a float
2363 * for you.
2364 * <p>
2365 * This version does not take a default value. If the setting has not
2366 * been set, or the string value is not a number,
2367 * it throws {@link SettingNotFoundException}.
2368 *
2369 * @param cr The ContentResolver to access.
2370 * @param name The name of the setting to retrieve.
2371 *
2372 * @throws SettingNotFoundException Thrown if a setting by the given
2373 * name can't be found or the setting value is not a float.
2374 *
2375 * @return The setting's current value.
2376 */
2377 public static float getFloat(ContentResolver cr, String name)
2378 throws SettingNotFoundException {
2379 String v = getString(cr, name);
Brian Muramatsue1d46982010-12-06 17:34:20 -08002380 if (v == null) {
2381 throw new SettingNotFoundException(name);
2382 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002383 try {
2384 return Float.parseFloat(v);
2385 } catch (NumberFormatException e) {
2386 throw new SettingNotFoundException(name);
2387 }
2388 }
2389
2390 /**
2391 * Convenience function for updating a single settings value as a
2392 * floating point number. This will either create a new entry in the
2393 * table if the given name does not exist, or modify the value of the
2394 * existing row with that name. Note that internally setting values
2395 * are always stored as strings, so this function converts the given
2396 * value to a string before storing it.
2397 *
2398 * @param cr The ContentResolver to access.
2399 * @param name The name of the setting to modify.
2400 * @param value The new value for the setting.
2401 * @return true if the value was set, false on database errors
2402 */
2403 public static boolean putFloat(ContentResolver cr, String name, float value) {
2404 return putString(cr, name, Float.toString(value));
2405 }
2406
2407 /**
2408 * The content:// style URL for this table
2409 */
2410 public static final Uri CONTENT_URI =
2411 Uri.parse("content://" + AUTHORITY + "/secure");
2412
2413 /**
2414 * Whether ADB is enabled.
2415 */
2416 public static final String ADB_ENABLED = "adb_enabled";
2417
2418 /**
2419 * Setting to allow mock locations and location provider status to be injected into the
2420 * LocationManager service for testing purposes during application development. These
2421 * locations and status values override actual location and status information generated
2422 * by network, gps, or other location providers.
2423 */
2424 public static final String ALLOW_MOCK_LOCATION = "mock_location";
2425
2426 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08002427 * A 64-bit number (as a hex string) that is randomly
2428 * generated on the device's first boot and should remain
2429 * constant for the lifetime of the device. (The value may
2430 * change if a factory reset is performed on the device.)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002431 */
2432 public static final String ANDROID_ID = "android_id";
2433
2434 /**
2435 * Whether bluetooth is enabled/disabled
2436 * 0=disabled. 1=enabled.
2437 */
2438 public static final String BLUETOOTH_ON = "bluetooth_on";
2439
2440 /**
2441 * Get the key that retrieves a bluetooth headset's priority.
2442 * @hide
2443 */
2444 public static final String getBluetoothHeadsetPriorityKey(String address) {
2445 return ("bluetooth_headset_priority_" + address.toUpperCase());
2446 }
2447
2448 /**
2449 * Get the key that retrieves a bluetooth a2dp sink's priority.
2450 * @hide
2451 */
2452 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
2453 return ("bluetooth_a2dp_sink_priority_" + address.toUpperCase());
2454 }
2455
2456 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002457 * Get the key that retrieves a bluetooth Input Device's priority.
2458 * @hide
2459 */
2460 public static final String getBluetoothInputDevicePriorityKey(String address) {
2461 return ("bluetooth_input_device_priority_" + address.toUpperCase());
2462 }
2463
2464 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002465 * Whether or not data roaming is enabled. (0 = false, 1 = true)
2466 */
2467 public static final String DATA_ROAMING = "data_roaming";
2468
2469 /**
2470 * Setting to record the input method used by default, holding the ID
2471 * of the desired method.
2472 */
2473 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
2474
2475 /**
satokab751aa2010-09-14 19:17:36 +09002476 * Setting to record the input method subtype used by default, holding the ID
2477 * of the desired method.
2478 */
2479 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
2480 "selected_input_method_subtype";
2481
2482 /**
satok723a27e2010-11-11 14:58:11 +09002483 * Setting to record the history of input method subtype, holding the pair of ID of IME
2484 * and its last used subtype.
2485 * @hide
2486 */
2487 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
2488 "input_methods_subtype_history";
2489
2490 /**
satok5c58dfc2010-12-14 21:54:47 +09002491 * Setting to record the visibility of input method selector
2492 */
2493 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
2494 "input_method_selector_visibility";
2495
2496 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002497 * Whether the device has been provisioned (0 = false, 1 = true)
2498 */
2499 public static final String DEVICE_PROVISIONED = "device_provisioned";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002500
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002501 /**
2502 * List of input methods that are currently enabled. This is a string
2503 * containing the IDs of all enabled input methods, each ID separated
2504 * by ':'.
2505 */
2506 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002507
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002508 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07002509 * List of system input methods that are currently disabled. This is a string
2510 * containing the IDs of all disabled input methods, each ID separated
2511 * by ':'.
2512 * @hide
2513 */
2514 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
2515
2516 /**
Robert Greenwalt434203a2010-10-11 16:00:27 -07002517 * Host name and port for global http proxy. Uses ':' seperator for between host and port
2518 * TODO - deprecate in favor of global_http_proxy_host, etc
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002519 */
2520 public static final String HTTP_PROXY = "http_proxy";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002521
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002522 /**
Robert Greenwalt434203a2010-10-11 16:00:27 -07002523 * Host name for global http proxy. Set via ConnectivityManager.
2524 * @hide
2525 */
2526 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
2527
2528 /**
2529 * Integer host port for global http proxy. Set via ConnectivityManager.
2530 * @hide
2531 */
2532 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
2533
2534 /**
Oscar Montemayor16fb7912010-08-02 09:38:48 -07002535 * Exclusion list for global proxy. This string contains a list of comma-separated
2536 * domains where the global proxy does not apply. Domains should be listed in a comma-
2537 * separated list. Example of acceptable formats: ".domain1.com,my.domain2.com"
Robert Greenwalt434203a2010-10-11 16:00:27 -07002538 * Use ConnectivityManager to set/get.
Oscar Montemayor16fb7912010-08-02 09:38:48 -07002539 * @hide
2540 */
Robert Greenwalt434203a2010-10-11 16:00:27 -07002541 public static final String GLOBAL_HTTP_PROXY_EXCLUSION_LIST =
2542 "global_http_proxy_exclusion_list";
Oscar Montemayor16fb7912010-08-02 09:38:48 -07002543
2544 /**
2545 * Enables the UI setting to allow the user to specify the global HTTP proxy
2546 * and associated exclusion list.
2547 * @hide
2548 */
2549 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
2550
2551 /**
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07002552 * Setting for default DNS in case nobody suggests one
2553 * @hide
2554 */
2555 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
2556
2557 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002558 * Whether the package installer should allow installation of apps downloaded from
2559 * sources other than the Android Market (vending machine).
2560 *
2561 * 1 = allow installing from other sources
2562 * 0 = only allow installing from the Android Market
2563 */
2564 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002565
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002566 /**
2567 * Comma-separated list of location providers that activities may access.
2568 */
2569 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002570
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002571 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002572 * Whether autolock is enabled (0 = false, 1 = true)
2573 */
2574 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
2575
2576 /**
2577 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
2578 */
2579 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2580
2581 /**
2582 * Whether lock pattern will vibrate as user enters (0 = false, 1 = true)
2583 */
2584 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2585 "lock_pattern_tactile_feedback_enabled";
2586
2587 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07002588 * This preference allows the device to be locked given time after screen goes off,
2589 * subject to current DeviceAdmin policy limits.
2590 * @hide
2591 */
2592 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
2593
2594
2595 /**
Jim Miller253a5ef2010-10-13 20:57:29 -07002596 * This preference contains the string that shows for owner info on LockScren.
2597 * @hide
2598 */
2599 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
2600
2601 /**
2602 * This preference enables showing the owner info on LockScren.
2603 * @hide
2604 */
2605 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
2606 "lock_screen_owner_info_enabled";
2607
2608 /**
Joe Onorato571ae902011-05-24 13:48:43 -07002609 * The saved value for WindowManagerService.setForcedDisplaySize().
2610 * Two integers separated by a comma. If unset, then use the real display size.
2611 * @hide
2612 */
2613 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
2614
2615 /**
Mike Lockwoodbcab8df2009-06-25 16:39:09 -04002616 * Whether assisted GPS should be enabled or not.
2617 * @hide
2618 */
2619 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
2620
2621 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002622 * The Logging ID (a unique 64-bit value) as a hex string.
2623 * Used as a pseudonymous identifier for logging.
2624 * @deprecated This identifier is poorly initialized and has
2625 * many collisions. It should not be used.
2626 */
2627 @Deprecated
2628 public static final String LOGGING_ID = "logging_id";
2629
2630 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002631 * User preference for which network(s) should be used. Only the
2632 * connectivity service should touch this.
2633 */
2634 public static final String NETWORK_PREFERENCE = "network_preference";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002635
2636 /**
Robert Greenwalt2a091d72010-02-11 18:18:40 -08002637 * Used to disable Tethering on a device - defaults to true
2638 * @hide
2639 */
2640 public static final String TETHER_SUPPORTED = "tether_supported";
2641
2642 /**
Robert Greenwalt77b32dd2010-06-03 18:57:26 -07002643 * Used to require DUN APN on the device or not - defaults to a build config value
2644 * which defaults to false
2645 * @hide
2646 */
2647 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
2648
2649 /**
2650 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
2651 * corresponding build config values are set it will override the APN DB
2652 * values.
2653 * Consists of a comma seperated list of strings:
2654 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
2655 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
2656 * @hide
2657 */
2658 public static final String TETHER_DUN_APN = "tether_dun_apn";
2659
2660 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08002661 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002662 */
2663 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002664
2665 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08002666 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002667 */
2668 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002669
2670 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08002671 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002672 */
2673 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002674
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002675 /**
Brad Fitzpatrickd7ad0d22010-12-02 15:30:23 -08002676 * A positive value indicates how often the SamplingProfiler
2677 * should take snapshots. Zero value means SamplingProfiler
2678 * is disabled.
Sen Hubde75702010-05-28 01:54:03 -07002679 *
2680 * @hide
2681 */
Brad Fitzpatrickd7ad0d22010-12-02 15:30:23 -08002682 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
Sen Hubde75702010-05-28 01:54:03 -07002683
2684 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002685 * Settings classname to launch when Settings is clicked from All
2686 * Applications. Needed because of user testing between the old
2687 * and new Settings apps.
2688 */
2689 // TODO: 881807
2690 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002691
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002692 /**
2693 * USB Mass Storage Enabled
2694 */
2695 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002696
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002697 /**
2698 * If this setting is set (to anything), then all references
2699 * to Gmail on the device must change to Google Mail.
2700 */
2701 public static final String USE_GOOGLE_MAIL = "use_google_mail";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002702
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002703 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07002704 * If accessibility is enabled.
2705 */
2706 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
2707
2708 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07002709 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07002710 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07002711 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07002712
2713 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07002714 * List of the enabled accessibility providers.
2715 */
2716 public static final String ENABLED_ACCESSIBILITY_SERVICES =
2717 "enabled_accessibility_services";
2718
2719 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07002720 * If injection of accessibility enhancing JavaScript scripts
2721 * is enabled.
2722 * <p>
2723 * Note: Accessibility injecting scripts are served by the
2724 * Google infrastructure and enable users with disabilities to
2725 * efficiantly navigate in and explore web content.
2726 * </p>
2727 * <p>
2728 * This property represents a boolean value.
2729 * </p>
2730 * @hide
2731 */
2732 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
2733 "accessibility_script_injection";
2734
2735 /**
2736 * Key bindings for navigation in built-in accessibility support for web content.
2737 * <p>
2738 * Note: These key bindings are for the built-in accessibility navigation for
2739 * web content which is used as a fall back solution if JavaScript in a WebView
2740 * is not enabled or the user has not opted-in script injection from Google.
2741 * </p>
2742 * <p>
2743 * The bindings are separated by semi-colon. A binding is a mapping from
2744 * a key to a sequence of actions (for more details look at
2745 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
2746 * string representation of an integer obtained from a meta state (optional) shifted
2747 * sixteen times left and bitwise ored with a key code. An action is represented
2748 * as a hexademical string representation of an integer where the first two digits
2749 * are navigation action index, the second, the third, and the fourth digit pairs
2750 * represent the action arguments. The separate actions in a binding are colon
2751 * separated. The key and the action sequence it maps to are separated by equals.
2752 * </p>
2753 * <p>
2754 * For example, the binding below maps the DPAD right button to traverse the
2755 * current navigation axis once without firing an accessibility event and to
2756 * perform the same traversal again but to fire an event:
2757 * <code>
2758 * 0x16=0x01000100:0x01000101;
2759 * </code>
2760 * </p>
2761 * <p>
2762 * The goal of this binding is to enable dynamic rebinding of keys to
2763 * navigation actions for web content without requiring a framework change.
2764 * </p>
2765 * <p>
2766 * This property represents a string value.
2767 * </p>
2768 * @hide
2769 */
2770 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
2771 "accessibility_web_content_key_bindings";
2772
2773 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08002774 * The timout for considering a press to be a long press in milliseconds.
2775 * @hide
2776 */
2777 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
2778
2779 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07002780 * Setting to always use the default text-to-speech settings regardless
2781 * of the application settings.
2782 * 1 = override application settings,
2783 * 0 = use application settings (if specified).
2784 */
2785 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
2786
2787 /**
2788 * Default text-to-speech engine speech rate. 100 = 1x
2789 */
2790 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
2791
2792 /**
2793 * Default text-to-speech engine pitch. 100 = 1x
2794 */
2795 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
2796
2797 /**
2798 * Default text-to-speech engine.
2799 */
2800 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
2801
2802 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07002803 * Default text-to-speech language.
2804 */
2805 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
2806
2807 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07002808 * Default text-to-speech country.
2809 */
2810 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
2811
2812 /**
2813 * Default text-to-speech locale variant.
2814 */
2815 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
2816
2817 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01002818 * Stores the default tts locales on a per engine basis. Stored as
2819 * a comma seperated list of values, each value being of the form
2820 * {@code engine_name:locale} for example,
2821 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}.
2822 *
2823 * @hide
2824 */
2825 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
2826
2827 /**
Charles Chenceffa152010-03-16 21:18:10 -07002828 * Space delimited list of plugin packages that are enabled.
2829 */
2830 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
2831
2832 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002833 * Whether to notify the user of open networks.
2834 * <p>
2835 * If not connected and the scan results have an open network, we will
2836 * put this notification up. If we attempt to connect to a network or
2837 * the open network(s) disappear, we remove the notification. When we
2838 * show the notification, we will not show it again for
2839 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
2840 */
2841 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
2842 "wifi_networks_available_notification_on";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002843
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002844 /**
2845 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
2846 * Connecting to a network will reset the timer.
2847 */
2848 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
2849 "wifi_networks_available_repeat_delay";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002850
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002851 /**
Irfan Sheriffed4f28b2010-10-29 15:32:10 -07002852 * 802.11 country code in ISO 3166 format
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002853 * @hide
2854 */
Irfan Sheriffed4f28b2010-10-29 15:32:10 -07002855 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
2856
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002857
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002858 /**
2859 * When the number of open networks exceeds this number, the
2860 * least-recently-used excess networks will be removed.
2861 */
2862 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002863
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002864 /**
2865 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
2866 */
2867 public static final String WIFI_ON = "wifi_on";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002868
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002869 /**
Irfan Sheriffa3bd4092010-03-24 17:58:59 -07002870 * Used to save the Wifi_ON state prior to tethering.
2871 * This state will be checked to restore Wifi after
2872 * the user turns off tethering.
Irfan Sheriff5321aef2010-02-12 12:35:59 -08002873 *
2874 * @hide
2875 */
Irfan Sheriffa3bd4092010-03-24 17:58:59 -07002876 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
Irfan Sheriff5321aef2010-02-12 12:35:59 -08002877
2878 /**
Irfan Sheriff9ab518ad2010-03-12 15:48:17 -08002879 * AP SSID
2880 *
2881 * @hide
2882 */
2883 public static final String WIFI_AP_SSID = "wifi_ap_ssid";
2884
2885 /**
2886 * AP security
2887 *
2888 * @hide
2889 */
2890 public static final String WIFI_AP_SECURITY = "wifi_ap_security";
2891
2892 /**
2893 * AP passphrase
2894 *
2895 * @hide
2896 */
2897 public static final String WIFI_AP_PASSWD = "wifi_ap_passwd";
2898
2899 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002900 * The acceptable packet loss percentage (range 0 - 100) before trying
2901 * another AP on the same network.
2902 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002903 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002904 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
2905 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002906
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002907 /**
2908 * The number of access points required for a network in order for the
2909 * watchdog to monitor it.
2910 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002911 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002912 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002913
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002914 /**
2915 * The delay between background checks.
2916 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002917 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002918 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
2919 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002920
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002921 /**
2922 * Whether the Wi-Fi watchdog is enabled for background checking even
2923 * after it thinks the user has connected to a good access point.
2924 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002925 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002926 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
2927 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002928
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002929 /**
2930 * The timeout for a background ping
2931 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002932 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002933 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
2934 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002935
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002936 /**
2937 * The number of initial pings to perform that *may* be ignored if they
2938 * fail. Again, if these fail, they will *not* be used in packet loss
2939 * calculation. For example, one network always seemed to time out for
2940 * the first couple pings, so this is set to 3 by default.
2941 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002942 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002943 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
2944 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002945
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002946 /**
2947 * The maximum number of access points (per network) to attempt to test.
2948 * If this number is reached, the watchdog will no longer monitor the
2949 * initial connection state for the network. This is a safeguard for
2950 * networks containing multiple APs whose DNS does not respond to pings.
2951 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002952 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002953 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002954
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002955 /**
2956 * Whether the Wi-Fi watchdog is enabled.
2957 */
2958 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
2959
2960 /**
2961 * 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 -08002962 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002963 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002964 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
2965
2966 /**
2967 * The number of pings to test if an access point is a good connection.
2968 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002969 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002970 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002971
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002972 /**
2973 * The delay between pings.
2974 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002975 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002976 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002977
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002978 /**
2979 * The timeout per ping.
2980 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002981 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002982 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002983
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002984 /**
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07002985 * ms delay before rechecking an 'online' wifi connection when it is thought to be unstable.
2986 * @hide
2987 */
2988 public static final String WIFI_WATCHDOG_DNS_CHECK_SHORT_INTERVAL_MS =
2989 "wifi_watchdog_dns_check_short_interval_ms";
2990
2991 /**
2992 * ms delay before rechecking an 'online' wifi connection when it is thought to be stable.
2993 * @hide
2994 */
2995 public static final String WIFI_WATCHDOG_DNS_CHECK_LONG_INTERVAL_MS =
2996 "wifi_watchdog_dns_check_long_interval_ms";
2997
2998 /**
2999 * ms delay before rechecking a connect SSID for walled garden with a http download.
3000 * @hide
3001 */
3002 public static final String WIFI_WATCHDOG_WALLED_GARDEN_INTERVAL_MS =
3003 "wifi_watchdog_walled_garden_interval_ms";
3004
3005 /**
3006 * max blacklist calls on an SSID before full dns check failures disable the network.
3007 * @hide
3008 */
3009 public static final String WIFI_WATCHDOG_MAX_SSID_BLACKLISTS =
3010 "wifi_watchdog_max_ssid_blacklists";
3011
3012 /**
3013 * Number of dns pings per check.
3014 * @hide
3015 */
3016 public static final String WIFI_WATCHDOG_NUM_DNS_PINGS = "wifi_watchdog_num_dns_pings";
3017
3018 /**
3019 * Minimum number of responses to the dns pings to consider the test 'successful'.
3020 * @hide
3021 */
3022 public static final String WIFI_WATCHDOG_MIN_DNS_RESPONSES =
3023 "wifi_watchdog_min_dns_responses";
3024
3025 /**
3026 * Timeout on dns pings
3027 * @hide
3028 */
3029 public static final String WIFI_WATCHDOG_DNS_PING_TIMEOUT_MS =
3030 "wifi_watchdog_dns_ping_timeout_ms";
3031
3032 /**
3033 * We consider action from a 'blacklist' call to have finished by the end of
3034 * this interval. If we are connected to the same AP with no network connection,
3035 * we are likely stuck on an SSID with no external connectivity.
3036 * @hide
3037 */
3038 public static final String WIFI_WATCHDOG_BLACKLIST_FOLLOWUP_INTERVAL_MS =
3039 "wifi_watchdog_blacklist_followup_interval_ms";
3040
3041 /**
Irfan Sheriff5ea65d62011-06-05 21:29:56 -07003042 * Setting to turn off walled garden test on Wi-Fi. Feature is enabled by default and
3043 * the setting needs to be set to 0 to disable it.
3044 * @hide
3045 */
3046 public static final String WIFI_WATCHDOG_WALLED_GARDEN_TEST_ENABLED =
3047 "wifi_watchdog_walled_garden_test_enabled";
3048
3049 /**
3050 * The URL used for walled garden check upon a new conection. WifiWatchdogService
3051 * fetches the URL and checks to see if {@link #WIFI_WATCHDOG_WALLED_GARDEN_PATTERN}
3052 * is not part of the title string to notify the user on the presence of a walled garden.
3053 * @hide
3054 */
3055 public static final String WIFI_WATCHDOG_WALLED_GARDEN_URL =
3056 "wifi_watchdog_walled_garden_url";
3057
3058 /**
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003059 * Boolean to determine whether to notify on disabling a network. Secure setting used
Isaac Levy8dc6a1b2011-07-27 08:00:03 -07003060 * to notify user only once.
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003061 * @hide
3062 */
3063 public static final String WIFI_WATCHDOG_SHOW_DISABLED_NETWORK_POPUP =
3064 "wifi_watchdog_show_disabled_network_popup";
3065
3066 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003067 * The maximum number of times we will retry a connection to an access
3068 * point for which we have failed in acquiring an IP address from DHCP.
3069 * 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 -08003070 */
3071 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003072
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003073 /**
Irfan Sheriff36f74132010-11-04 16:57:37 -07003074 * The operational wifi frequency band
3075 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
3076 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
3077 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
3078 *
3079 * @hide
3080 */
3081 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
3082
3083 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003084 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
3085 * data connectivity to be established after a disconnect from Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003086 */
3087 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
3088 "wifi_mobile_data_transition_wakelock_timeout_ms";
3089
3090 /**
3091 * Whether background data usage is allowed by the user. See
3092 * ConnectivityManager for more info.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003093 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07003094 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003095 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07003096
3097 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00003098 * Origins for which browsers should allow geolocation by default.
3099 * The value is a space-separated list of origins.
3100 */
3101 public static final String ALLOWED_GEOLOCATION_ORIGINS
3102 = "allowed_geolocation_origins";
3103
3104 /**
Robert Greenwaltc03fa502010-02-23 18:58:05 -08003105 * Whether mobile data connections are allowed by the user. See
3106 * ConnectivityManager for more info.
3107 * @hide
3108 */
3109 public static final String MOBILE_DATA = "mobile_data";
3110
3111 /**
Wink Saville04e71b32009-04-02 11:00:54 -07003112 * The CDMA roaming mode 0 = Home Networks, CDMA default
3113 * 1 = Roaming on Affiliated networks
3114 * 2 = Roaming on any networks
3115 * @hide
3116 */
3117 public static final String CDMA_ROAMING_MODE = "roaming_settings";
3118
3119 /**
3120 * The CDMA subscription mode 0 = RUIM/SIM (default)
3121 * 1 = NV
3122 * @hide
3123 */
3124 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
3125
3126 /**
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003127 * The preferred network mode 7 = Global
3128 * 6 = EvDo only
3129 * 5 = CDMA w/o EvDo
3130 * 4 = CDMA / EvDo auto
3131 * 3 = GSM / WCDMA auto
3132 * 2 = WCDMA only
3133 * 1 = GSM only
3134 * 0 = GSM / WCDMA preferred
Wink Saville04e71b32009-04-02 11:00:54 -07003135 * @hide
3136 */
3137 public static final String PREFERRED_NETWORK_MODE =
3138 "preferred_network_mode";
3139
3140 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07003141 * The preferred TTY mode 0 = TTy Off, CDMA default
3142 * 1 = TTY Full
3143 * 2 = TTY HCO
3144 * 3 = TTY VCO
3145 * @hide
3146 */
3147 public static final String PREFERRED_TTY_MODE =
3148 "preferred_tty_mode";
3149
3150
3151 /**
Wink Saville04e71b32009-04-02 11:00:54 -07003152 * CDMA Cell Broadcast SMS
3153 * 0 = CDMA Cell Broadcast SMS disabled
3154 * 1 = CDMA Cell Broadcast SMS enabled
3155 * @hide
3156 */
3157 public static final String CDMA_CELL_BROADCAST_SMS =
3158 "cdma_cell_broadcast_sms";
3159
3160 /**
3161 * The cdma subscription 0 = Subscription from RUIM, when available
3162 * 1 = Subscription from NV
3163 * @hide
3164 */
3165 public static final String PREFERRED_CDMA_SUBSCRIPTION =
3166 "preferred_cdma_subscription";
3167
3168 /**
3169 * Whether the enhanced voice privacy mode is enabled.
3170 * 0 = normal voice privacy
3171 * 1 = enhanced voice privacy
3172 * @hide
3173 */
3174 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
3175
3176 /**
3177 * Whether the TTY mode mode is enabled.
3178 * 0 = disabled
3179 * 1 = enabled
3180 * @hide
3181 */
3182 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003183
3184 /**
Wink Saville628b0852011-08-04 15:01:58 -07003185 * The number of milliseconds to delay before sending out Connectivyt Change broadcasts
3186 * @hide
3187 */
3188 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
3189
3190 /**
3191 * Default value for CONNECTIVITY_CHANGE_DELAY in milliseconds.
3192 * @hide
3193 */
3194 public static final int CONNECTIVITY_CHANGE_DELAY_DEFAULT = 3000;
3195
3196 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07003197 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07003198 * Type: int ( 0 = disabled, 1 = enabled )
3199 * @hide
3200 */
3201 public static final String BACKUP_ENABLED = "backup_enabled";
3202
3203 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08003204 * Controls whether application data is automatically restored from backup
3205 * at install time.
3206 * Type: int ( 0 = disabled, 1 = enabled )
3207 * @hide
3208 */
3209 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
3210
3211 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07003212 * Indicates whether settings backup has been fully provisioned.
3213 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
3214 * @hide
3215 */
3216 public static final String BACKUP_PROVISIONED = "backup_provisioned";
3217
3218 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07003219 * Component of the transport to use for backup/restore.
3220 * @hide
3221 */
3222 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07003223
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07003224 /**
3225 * Version for which the setup wizard was last shown. Bumped for
3226 * each release when there is new setup information to show.
3227 * @hide
3228 */
3229 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07003230
3231 /**
Doug Zongkerf6888892010-01-06 16:38:14 -08003232 * How frequently (in seconds) to check the memory status of the
3233 * device.
3234 * @hide
3235 */
3236 public static final String MEMCHECK_INTERVAL = "memcheck_interval";
3237
3238 /**
3239 * Max frequency (in seconds) to log memory check stats, in realtime
3240 * seconds. This allows for throttling of logs when the device is
3241 * running for large amounts of time.
3242 * @hide
3243 */
3244 public static final String MEMCHECK_LOG_REALTIME_INTERVAL =
3245 "memcheck_log_realtime_interval";
3246
3247 /**
3248 * Boolean indicating whether rebooting due to system memory checks
3249 * is enabled.
3250 * @hide
3251 */
3252 public static final String MEMCHECK_SYSTEM_ENABLED = "memcheck_system_enabled";
3253
3254 /**
3255 * How many bytes the system process must be below to avoid scheduling
3256 * a soft reboot. This reboot will happen when it is next determined
3257 * to be a good time.
3258 * @hide
3259 */
3260 public static final String MEMCHECK_SYSTEM_SOFT_THRESHOLD = "memcheck_system_soft";
3261
3262 /**
3263 * How many bytes the system process must be below to avoid scheduling
3264 * a hard reboot. This reboot will happen immediately.
3265 * @hide
3266 */
3267 public static final String MEMCHECK_SYSTEM_HARD_THRESHOLD = "memcheck_system_hard";
3268
3269 /**
3270 * How many bytes the phone process must be below to avoid scheduling
3271 * a soft restart. This restart will happen when it is next determined
3272 * to be a good time.
3273 * @hide
3274 */
3275 public static final String MEMCHECK_PHONE_SOFT_THRESHOLD = "memcheck_phone_soft";
3276
3277 /**
3278 * How many bytes the phone process must be below to avoid scheduling
3279 * a hard restart. This restart will happen immediately.
3280 * @hide
3281 */
3282 public static final String MEMCHECK_PHONE_HARD_THRESHOLD = "memcheck_phone_hard";
3283
3284 /**
3285 * Boolean indicating whether restarting the phone process due to
3286 * memory checks is enabled.
3287 * @hide
3288 */
3289 public static final String MEMCHECK_PHONE_ENABLED = "memcheck_phone_enabled";
3290
3291 /**
3292 * First time during the day it is okay to kill processes
3293 * or reboot the device due to low memory situations. This number is
3294 * in seconds since midnight.
3295 * @hide
3296 */
3297 public static final String MEMCHECK_EXEC_START_TIME = "memcheck_exec_start_time";
3298
3299 /**
3300 * Last time during the day it is okay to kill processes
3301 * or reboot the device due to low memory situations. This number is
3302 * in seconds since midnight.
3303 * @hide
3304 */
3305 public static final String MEMCHECK_EXEC_END_TIME = "memcheck_exec_end_time";
3306
3307 /**
3308 * How long the screen must have been off in order to kill processes
3309 * or reboot. This number is in seconds. A value of -1 means to
3310 * entirely disregard whether the screen is on.
3311 * @hide
3312 */
3313 public static final String MEMCHECK_MIN_SCREEN_OFF = "memcheck_min_screen_off";
3314
3315 /**
3316 * How much time there must be until the next alarm in order to kill processes
3317 * or reboot. This number is in seconds. Note: this value must be
3318 * smaller than {@link #MEMCHECK_RECHECK_INTERVAL} or else it will
3319 * always see an alarm scheduled within its time.
3320 * @hide
3321 */
3322 public static final String MEMCHECK_MIN_ALARM = "memcheck_min_alarm";
3323
3324 /**
3325 * How frequently to check whether it is a good time to restart things,
3326 * if the device is in a bad state. This number is in seconds. Note:
3327 * this value must be larger than {@link #MEMCHECK_MIN_ALARM} or else
3328 * the alarm to schedule the recheck will always appear within the
3329 * minimum "do not execute now" time.
3330 * @hide
3331 */
3332 public static final String MEMCHECK_RECHECK_INTERVAL = "memcheck_recheck_interval";
3333
3334 /**
3335 * How frequently (in DAYS) to reboot the device. If 0, no reboots
3336 * will occur.
3337 * @hide
3338 */
3339 public static final String REBOOT_INTERVAL = "reboot_interval";
3340
3341 /**
3342 * First time during the day it is okay to force a reboot of the
3343 * device (if REBOOT_INTERVAL is set). This number is
3344 * in seconds since midnight.
3345 * @hide
3346 */
3347 public static final String REBOOT_START_TIME = "reboot_start_time";
3348
3349 /**
3350 * The window of time (in seconds) after each REBOOT_INTERVAL in which
3351 * a reboot can be executed. If 0, a reboot will always be executed at
3352 * exactly the given time. Otherwise, it will only be executed if
3353 * the device is idle within the window.
3354 * @hide
3355 */
3356 public static final String REBOOT_WINDOW = "reboot_window";
3357
3358 /**
Doug Zongker43866e02010-01-07 12:09:54 -08003359 * Threshold values for the duration and level of a discharge cycle, under
3360 * which we log discharge cycle info.
3361 * @hide
3362 */
3363 public static final String BATTERY_DISCHARGE_DURATION_THRESHOLD =
3364 "battery_discharge_duration_threshold";
3365 /** @hide */
3366 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
3367
3368 /**
3369 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR intents
3370 * on application crashes and ANRs. If this is disabled, the crash/ANR dialog
3371 * will never display the "Report" button.
3372 * Type: int ( 0 = disallow, 1 = allow )
3373 * @hide
3374 */
3375 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
3376
3377 /**
3378 * Nonzero causes Log.wtf() to crash.
3379 * @hide
3380 */
3381 public static final String WTF_IS_FATAL = "wtf_is_fatal";
3382
3383 /**
Jake Hambybb371632010-08-23 18:16:48 -07003384 * Maximum age of entries kept by {@link com.android.internal.os.IDropBoxManagerService}.
Doug Zongker43866e02010-01-07 12:09:54 -08003385 * @hide
3386 */
3387 public static final String DROPBOX_AGE_SECONDS =
3388 "dropbox_age_seconds";
3389 /**
Jake Hambybb371632010-08-23 18:16:48 -07003390 * Maximum number of entry files which {@link com.android.internal.os.IDropBoxManagerService} will keep around.
Dan Egnor3a8b0c12010-03-24 17:48:20 -07003391 * @hide
3392 */
3393 public static final String DROPBOX_MAX_FILES =
3394 "dropbox_max_files";
3395 /**
Jake Hambybb371632010-08-23 18:16:48 -07003396 * Maximum amount of disk space used by {@link com.android.internal.os.IDropBoxManagerService} no matter what.
Doug Zongker43866e02010-01-07 12:09:54 -08003397 * @hide
3398 */
3399 public static final String DROPBOX_QUOTA_KB =
3400 "dropbox_quota_kb";
3401 /**
Jake Hambybb371632010-08-23 18:16:48 -07003402 * Percent of free disk (excluding reserve) which {@link com.android.internal.os.IDropBoxManagerService} will use.
Doug Zongker43866e02010-01-07 12:09:54 -08003403 * @hide
3404 */
3405 public static final String DROPBOX_QUOTA_PERCENT =
3406 "dropbox_quota_percent";
3407 /**
Jake Hambybb371632010-08-23 18:16:48 -07003408 * Percent of total disk which {@link com.android.internal.os.IDropBoxManagerService} will never dip into.
Doug Zongker43866e02010-01-07 12:09:54 -08003409 * @hide
3410 */
3411 public static final String DROPBOX_RESERVE_PERCENT =
3412 "dropbox_reserve_percent";
3413 /**
3414 * Prefix for per-tag dropbox disable/enable settings.
3415 * @hide
3416 */
3417 public static final String DROPBOX_TAG_PREFIX =
3418 "dropbox:";
Dan Egnora455d192010-03-12 08:52:28 -08003419 /**
3420 * Lines of logcat to include with system crash/ANR/etc. reports,
3421 * as a prefix of the dropbox tag of the report type.
3422 * For example, "logcat_for_system_server_anr" controls the lines
3423 * of logcat captured with system server ANR reports. 0 to disable.
3424 * @hide
3425 */
3426 public static final String ERROR_LOGCAT_PREFIX =
3427 "logcat_for_";
Doug Zongker43866e02010-01-07 12:09:54 -08003428
3429
3430 /**
3431 * Screen timeout in milliseconds corresponding to the
3432 * PowerManager's POKE_LOCK_SHORT_TIMEOUT flag (i.e. the fastest
3433 * possible screen timeout behavior.)
3434 * @hide
3435 */
3436 public static final String SHORT_KEYLIGHT_DELAY_MS =
3437 "short_keylight_delay_ms";
3438
3439 /**
3440 * The interval in minutes after which the amount of free storage left on the
3441 * device is logged to the event log
3442 * @hide
3443 */
3444 public static final String SYS_FREE_STORAGE_LOG_INTERVAL =
3445 "sys_free_storage_log_interval";
3446
3447 /**
3448 * Threshold for the amount of change in disk free space required to report the amount of
3449 * free space. Used to prevent spamming the logs when the disk free space isn't changing
3450 * frequently.
3451 * @hide
3452 */
3453 public static final String DISK_FREE_CHANGE_REPORTING_THRESHOLD =
3454 "disk_free_change_reporting_threshold";
3455
3456
3457 /**
3458 * Minimum percentage of free storage on the device that is used to determine if
Dianne Hackborn247fe742011-01-08 17:25:57 -08003459 * the device is running low on storage. The default is 10.
3460 * <p>Say this value is set to 10, the device is considered running low on storage
Doug Zongker43866e02010-01-07 12:09:54 -08003461 * if 90% or more of the device storage is filled up.
3462 * @hide
3463 */
3464 public static final String SYS_STORAGE_THRESHOLD_PERCENTAGE =
3465 "sys_storage_threshold_percentage";
3466
3467 /**
Dianne Hackborn247fe742011-01-08 17:25:57 -08003468 * Maximum byte size of the low storage threshold. This is to ensure
3469 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in
3470 * an overly large threshold for large storage devices. Currently this
3471 * must be less than 2GB. This default is 500MB.
3472 * @hide
3473 */
3474 public static final String SYS_STORAGE_THRESHOLD_MAX_BYTES =
3475 "sys_storage_threshold_max_bytes";
3476
3477 /**
Jake Hambybb371632010-08-23 18:16:48 -07003478 * Minimum bytes of free storage on the device before the data
3479 * partition is considered full. By default, 1 MB is reserved
3480 * to avoid system-wide SQLite disk full exceptions.
3481 * @hide
3482 */
3483 public static final String SYS_STORAGE_FULL_THRESHOLD_BYTES =
3484 "sys_storage_full_threshold_bytes";
3485
3486 /**
Doug Zongker43866e02010-01-07 12:09:54 -08003487 * The interval in milliseconds after which Wi-Fi is considered idle.
3488 * When idle, it is possible for the device to be switched from Wi-Fi to
3489 * the mobile data network.
3490 * @hide
3491 */
3492 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
3493
3494 /**
Irfan Sheriff2b7f6382011-03-25 14:29:19 -07003495 * The interval in milliseconds to issue wake up scans when wifi needs
3496 * to connect. This is necessary to connect to an access point when
3497 * device is on the move and the screen is off.
Irfan Sheriff4f5f7c92010-10-14 17:01:27 -07003498 * @hide
3499 */
Irfan Sheriff2b7f6382011-03-25 14:29:19 -07003500 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
3501 "wifi_framework_scan_interval_ms";
3502
3503 /**
3504 * The interval in milliseconds to scan as used by the wifi supplicant
3505 * @hide
3506 */
3507 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
3508 "wifi_supplicant_scan_interval_ms";
Irfan Sheriff4f5f7c92010-10-14 17:01:27 -07003509
3510 /**
Doug Zongkeredc51892010-01-07 13:51:16 -08003511 * The interval in milliseconds at which to check packet counts on the
3512 * mobile data interface when screen is on, to detect possible data
3513 * connection problems.
3514 * @hide
3515 */
3516 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
3517 "pdp_watchdog_poll_interval_ms";
3518
3519 /**
3520 * The interval in milliseconds at which to check packet counts on the
3521 * mobile data interface when screen is off, to detect possible data
3522 * connection problems.
3523 * @hide
3524 */
3525 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
3526 "pdp_watchdog_long_poll_interval_ms";
3527
3528 /**
3529 * The interval in milliseconds at which to check packet counts on the
3530 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
3531 * outgoing packets has been reached without incoming packets.
3532 * @hide
3533 */
3534 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
3535 "pdp_watchdog_error_poll_interval_ms";
3536
3537 /**
3538 * The number of outgoing packets sent without seeing an incoming packet
3539 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
3540 * device is logged to the event log
3541 * @hide
3542 */
3543 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
3544 "pdp_watchdog_trigger_packet_count";
3545
3546 /**
3547 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
3548 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
3549 * attempting data connection recovery.
3550 * @hide
3551 */
3552 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
3553 "pdp_watchdog_error_poll_count";
3554
3555 /**
3556 * The number of failed PDP reset attempts before moving to something more
3557 * drastic: re-registering to the network.
3558 * @hide
3559 */
3560 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
3561 "pdp_watchdog_max_pdp_reset_fail_count";
3562
3563 /**
Doug Zongkeredc51892010-01-07 13:51:16 -08003564 * The interval in milliseconds at which to check gprs registration
3565 * after the first registration mismatch of gprs and voice service,
3566 * to detect possible data network registration problems.
3567 *
3568 * @hide
3569 */
3570 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
3571 "gprs_register_check_period_ms";
3572
3573 /**
3574 * The length of time in milli-seconds that automatic small adjustments to
3575 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
3576 * @hide
3577 */
3578 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
3579
3580 /**
3581 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
3582 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
3583 * exceeded.
3584 * @hide
3585 */
3586 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
3587
3588 /**
3589 * The maximum reconnect delay for short network outages or when the network is suspended
3590 * due to phone use.
3591 * @hide
3592 */
3593 public static final String SYNC_MAX_RETRY_DELAY_IN_SECONDS =
3594 "sync_max_retry_delay_in_seconds";
3595
3596 /**
3597 * The interval in milliseconds at which to check the number of SMS sent
3598 * out without asking for use permit, to limit the un-authorized SMS
3599 * usage.
3600 * @hide
3601 */
3602 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
3603 "sms_outgoing_check_interval_ms";
3604
3605 /**
3606 * The number of outgoing SMS sent without asking for user permit
3607 * (of {@link #SMS_OUTGOING_CHECK_INTERVAL_MS}
3608 * @hide
3609 */
3610 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
3611 "sms_outgoing_check_max_count";
3612
3613 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01003614 * The global search provider chosen by the user (if multiple global
3615 * search providers are installed). This will be the provider returned
3616 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
3617 * installed. This setting is stored as a flattened component name as
3618 * per {@link ComponentName#flattenToString()}.
3619 *
3620 * @hide
3621 */
3622 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
3623 "search_global_search_activity";
3624
3625 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003626 * The number of promoted sources in GlobalSearch.
3627 * @hide
3628 */
3629 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
3630 /**
3631 * The maximum number of suggestions returned by GlobalSearch.
3632 * @hide
3633 */
3634 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
3635 /**
3636 * The number of suggestions GlobalSearch will ask each non-web search source for.
3637 * @hide
3638 */
3639 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
3640 /**
3641 * The number of suggestions the GlobalSearch will ask the web search source for.
3642 * @hide
3643 */
3644 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
3645 "search_web_results_override_limit";
3646 /**
3647 * The number of milliseconds that GlobalSearch will wait for suggestions from
3648 * promoted sources before continuing with all other sources.
3649 * @hide
3650 */
3651 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
3652 "search_promoted_source_deadline_millis";
3653 /**
3654 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
3655 * @hide
3656 */
3657 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
3658 /**
3659 * The maximum number of milliseconds that GlobalSearch shows the previous results
3660 * after receiving a new query.
3661 * @hide
3662 */
3663 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
3664 /**
3665 * The maximum age of log data used for shortcuts in GlobalSearch.
3666 * @hide
3667 */
3668 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
3669 /**
3670 * The maximum age of log data used for source ranking in GlobalSearch.
3671 * @hide
3672 */
3673 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
3674 "search_max_source_event_age_millis";
3675 /**
3676 * The minimum number of impressions needed to rank a source in GlobalSearch.
3677 * @hide
3678 */
3679 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
3680 "search_min_impressions_for_source_ranking";
3681 /**
3682 * The minimum number of clicks needed to rank a source in GlobalSearch.
3683 * @hide
3684 */
3685 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
3686 "search_min_clicks_for_source_ranking";
3687 /**
3688 * The maximum number of shortcuts shown by GlobalSearch.
3689 * @hide
3690 */
3691 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
3692 /**
3693 * The size of the core thread pool for suggestion queries in GlobalSearch.
3694 * @hide
3695 */
3696 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
3697 "search_query_thread_core_pool_size";
3698 /**
3699 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
3700 * @hide
3701 */
3702 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
3703 "search_query_thread_max_pool_size";
3704 /**
3705 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
3706 * @hide
3707 */
3708 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
3709 "search_shortcut_refresh_core_pool_size";
3710 /**
3711 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
3712 * @hide
3713 */
3714 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
3715 "search_shortcut_refresh_max_pool_size";
3716 /**
3717 * The maximun time that excess threads in the GlobalSeach thread pools will
3718 * wait before terminating.
3719 * @hide
3720 */
3721 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
3722 "search_thread_keepalive_seconds";
3723 /**
3724 * The maximum number of concurrent suggestion queries to each source.
3725 * @hide
3726 */
3727 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
3728 "search_per_source_concurrent_query_limit";
3729
San Mehat87734d32010-01-08 12:53:06 -08003730 /**
3731 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
3732 * @hide
3733 */
3734 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
3735
3736 /**
3737 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
3738 * @hide
3739 */
3740 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
3741
3742 /**
3743 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
3744 * @hide
3745 */
3746 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
3747
3748 /**
3749 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
3750 * @hide
3751 */
3752 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003753
Dan Egnor42471dd2010-01-07 17:25:22 -08003754 /**
3755 * If nonzero, ANRs in invisible background processes bring up a dialog.
3756 * Otherwise, the process will be silently killed.
3757 * @hide
3758 */
3759 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08003760
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08003761 /**
3762 * The {@link ComponentName} string of the service to be used as the voice recognition
3763 * service.
Erikeebc8e22010-02-18 13:27:19 -08003764 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08003765 * @hide
3766 */
3767 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08003768
satok988323c2011-06-22 16:38:13 +09003769
3770 /**
3771 * The {@link ComponentName} string of the service to be used as the spell checker
3772 * service which is one of the services managed by the text service manager.
3773 *
3774 * @hide
3775 */
3776 public static final String SPELL_CHECKER_SERVICE = "spell_checker_service";
3777
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003778 /**
David Brown458e8062010-03-08 21:52:11 -08003779 * What happens when the user presses the Power button while in-call
3780 * and the screen is on.<br/>
3781 * <b>Values:</b><br/>
3782 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
3783 * 2 - The Power button hangs up the current call.<br/>
3784 *
3785 * @hide
3786 */
3787 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
3788
3789 /**
3790 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
3791 * @hide
3792 */
3793 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
3794
3795 /**
3796 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
3797 * @hide
3798 */
3799 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
3800
3801 /**
3802 * INCALL_POWER_BUTTON_BEHAVIOR default value.
3803 * @hide
3804 */
3805 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
3806 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
3807
3808 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07003809 * The current night mode that has been selected by the user. Owned
3810 * and controlled by UiModeManagerService. Constants are as per
3811 * UiModeManager.
3812 * @hide
3813 */
3814 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07003815
3816 /**
3817 * Let user pick default install location.
3818 * @hide
3819 */
3820 public static final String SET_INSTALL_LOCATION = "set_install_location";
3821
3822 /**
3823 * Default install location value.
3824 * 0 = auto, let system decide
3825 * 1 = internal
3826 * 2 = sdcard
3827 * @hide
3828 */
3829 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07003830
3831 /**
3832 * The bandwidth throttle polling freqency in seconds
3833 * @hide
3834 */
3835 public static final String THROTTLE_POLLING_SEC = "throttle_polling_sec";
3836
3837 /**
3838 * The bandwidth throttle threshold (long)
3839 * @hide
3840 */
Robert Greenwaltd3bb93f2010-04-12 19:20:55 -07003841 public static final String THROTTLE_THRESHOLD_BYTES = "throttle_threshold_bytes";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07003842
3843 /**
3844 * The bandwidth throttle value (kbps)
3845 * @hide
3846 */
Robert Greenwaltd3bb93f2010-04-12 19:20:55 -07003847 public static final String THROTTLE_VALUE_KBITSPS = "throttle_value_kbitsps";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07003848
3849 /**
3850 * The bandwidth throttle reset calendar day (1-28)
3851 * @hide
3852 */
3853 public static final String THROTTLE_RESET_DAY = "throttle_reset_day";
3854
3855 /**
3856 * The throttling notifications we should send
3857 * @hide
3858 */
3859 public static final String THROTTLE_NOTIFICATION_TYPE = "throttle_notification_type";
3860
3861 /**
Irfan Sheriffc9b68512010-04-08 14:12:33 -07003862 * Help URI for data throttling policy
3863 * @hide
3864 */
3865 public static final String THROTTLE_HELP_URI = "throttle_help_uri";
3866
Robert Greenwaltd1055a22010-05-25 15:54:52 -07003867 /**
3868 * The length of time in Sec that we allow our notion of NTP time
3869 * to be cached before we refresh it
3870 * @hide
3871 */
3872 public static final String THROTTLE_MAX_NTP_CACHE_AGE_SEC =
3873 "throttle_max_ntp_cache_age_sec";
3874
Steve Howard9c4e33e2010-07-28 15:59:29 -07003875 /**
3876 * The maximum size, in bytes, of a download that the download manager will transfer over
3877 * a non-wifi connection.
3878 * @hide
3879 */
3880 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
3881 "download_manager_max_bytes_over_mobile";
3882
Robert Greenwaltd7085fc2010-09-08 15:24:47 -07003883 /**
Steve Howardf1766812010-09-17 16:46:19 -07003884 * The recommended maximum size, in bytes, of a download that the download manager should
3885 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
3886 * have the option to start the download over the mobile connection anyway.
3887 * @hide
3888 */
3889 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
3890 "download_manager_recommended_max_bytes_over_mobile";
3891
3892 /**
Robert Greenwaltd7085fc2010-09-08 15:24:47 -07003893 * ms during which to consume extra events related to Inet connection condition
3894 * after a transtion to fully-connected
3895 * @hide
3896 */
3897 public static final String INET_CONDITION_DEBOUNCE_UP_DELAY =
3898 "inet_condition_debounce_up_delay";
3899
3900 /**
3901 * ms during which to consume extra events related to Inet connection condtion
3902 * after a transtion to partly-connected
3903 * @hide
3904 */
3905 public static final String INET_CONDITION_DEBOUNCE_DOWN_DELAY =
3906 "inet_condition_debounce_down_delay";
Irfan Sheriffc9b68512010-04-08 14:12:33 -07003907
3908 /**
Freeman Ng96be4e02011-04-07 18:21:40 -07003909 * URL to open browser on to allow user to manage a prepay account
3910 * @hide
3911 */
3912 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
3913 "setup_prepaid_data_service_url";
3914
3915 /**
Freeman Ng3b9089c2011-04-22 16:42:57 -07003916 * URL to attempt a GET on to see if this is a prepay device
3917 * @hide
3918 */
3919 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
3920 "setup_prepaid_detection_target_url";
3921
3922 /**
3923 * Host to check for a redirect to after an attempt to GET
3924 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
3925 * this is a prepaid device with zero balance.)
3926 * @hide
3927 */
3928 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
3929 "setup_prepaid_detection_redir_host";
3930
3931 /**
Daniel Sandler0601eb72011-04-13 01:01:32 -04003932 * The user's preferred "dream" (interactive screensaver) component.
3933 *
3934 * This component will be launched by the PhoneWindowManager after the user's chosen idle
3935 * timeout (specified by {@link #DREAM_TIMEOUT}).
3936 * @hide
3937 */
3938 public static final String DREAM_COMPONENT =
3939 "dream_component";
3940
3941 /**
3942 * The delay before a "dream" is started (set to 0 to disable).
3943 * @hide
3944 */
3945 public static final String DREAM_TIMEOUT =
3946 "dream_timeout";
3947
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07003948 /** {@hide} */
Jeff Sharkey0a9ee122011-06-22 16:32:41 -07003949 public static final String NETSTATS_ENABLED = "netstats_enabled";
3950 /** {@hide} */
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07003951 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
3952 /** {@hide} */
3953 public static final String NETSTATS_PERSIST_THRESHOLD = "netstats_persist_threshold";
3954 /** {@hide} */
Jeff Sharkey39ebc212011-06-11 17:25:42 -07003955 public static final String NETSTATS_NETWORK_BUCKET_DURATION = "netstats_network_bucket_duration";
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07003956 /** {@hide} */
Jeff Sharkey39ebc212011-06-11 17:25:42 -07003957 public static final String NETSTATS_NETWORK_MAX_HISTORY = "netstats_network_max_history";
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07003958 /** {@hide} */
Jeff Sharkey39ebc212011-06-11 17:25:42 -07003959 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07003960 /** {@hide} */
Jeff Sharkey39ebc212011-06-11 17:25:42 -07003961 public static final String NETSTATS_UID_MAX_HISTORY = "netstats_uid_max_history";
Jeff Sharkeyd03fd3f2011-06-19 20:55:09 -07003962 /** {@hide} */
3963 public static final String NETSTATS_TAG_MAX_HISTORY = "netstats_tag_max_history";
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07003964
Jeff Sharkey104344e2011-07-10 14:20:41 -07003965 /** Preferred NTP server. {@hide} */
3966 public static final String NTP_SERVER = "ntp_server";
3967 /** Timeout in milliseconds to wait for NTP server. {@hide} */
3968 public static final String NTP_TIMEOUT = "ntp_timeout";
3969
Ben Murdoch9999c1d2011-07-19 16:51:24 +01003970 /** Autofill server address (Used in WebView/browser). {@hide} */
3971 public static final String WEB_AUTOFILL_QUERY_URL =
3972 "web_autofill_query_url";
3973
Kenny Root5ab21572011-07-27 11:11:19 -07003974 /** Whether package verification is enabled. {@hide} */
3975 public static final String PACKAGE_VERIFIER_ENABLE = "verifier_enable";
3976
3977 /** Timeout for package verification. {@hide} */
3978 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
3979
Daniel Sandler0601eb72011-04-13 01:01:32 -04003980 /**
-b master501eec92009-07-06 13:53:11 -07003981 * @hide
3982 */
3983 public static final String[] SETTINGS_TO_BACKUP = {
Amith Yamasani8823c0a82009-07-07 14:30:17 -07003984 ADB_ENABLED,
3985 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07003986 PARENTAL_CONTROL_ENABLED,
3987 PARENTAL_CONTROL_REDIRECT_URL,
3988 USB_MASS_STORAGE_ENABLED,
3989 ACCESSIBILITY_ENABLED,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003990 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08003991 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07003992 ENABLED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07003993 TOUCH_EXPLORATION_ENABLED,
-b master501eec92009-07-06 13:53:11 -07003994 TTS_USE_DEFAULTS,
3995 TTS_DEFAULT_RATE,
3996 TTS_DEFAULT_PITCH,
3997 TTS_DEFAULT_SYNTH,
3998 TTS_DEFAULT_LANG,
3999 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07004000 TTS_ENABLED_PLUGINS,
-b master501eec92009-07-06 13:53:11 -07004001 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
4002 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
-b master501eec92009-07-06 13:53:11 -07004003 WIFI_NUM_OPEN_NETWORKS_KEPT,
San Mehat87734d32010-01-08 12:53:06 -08004004 MOUNT_PLAY_NOTIFICATION_SND,
4005 MOUNT_UMS_AUTOSTART,
4006 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07004007 MOUNT_UMS_NOTIFY_ENABLED,
4008 UI_NIGHT_MODE
-b master501eec92009-07-06 13:53:11 -07004009 };
4010
4011 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004012 * Helper method for determining if a location provider is enabled.
4013 * @param cr the content resolver to use
4014 * @param provider the location provider to query
4015 * @return true if the provider is enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004016 */
4017 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
4018 String allowedProviders = Settings.Secure.getString(cr, LOCATION_PROVIDERS_ALLOWED);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07004019 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004020 }
4021
4022 /**
4023 * Thread-safe method for enabling or disabling a single location provider.
4024 * @param cr the content resolver to use
4025 * @param provider the location provider to enable or disable
4026 * @param enabled true if the provider should be enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004027 */
4028 public static final void setLocationProviderEnabled(ContentResolver cr,
4029 String provider, boolean enabled) {
4030 // to ensure thread safety, we write the provider name with a '+' or '-'
4031 // and let the SettingsProvider handle it rather than reading and modifying
4032 // the list of enabled providers.
4033 if (enabled) {
4034 provider = "+" + provider;
4035 } else {
4036 provider = "-" + provider;
4037 }
4038 putString(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider);
4039 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004040 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004041
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004042 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004043 * User-defined bookmarks and shortcuts. The target of each bookmark is an
4044 * Intent URL, allowing it to be either a web page or a particular
4045 * application activity.
4046 *
4047 * @hide
4048 */
4049 public static final class Bookmarks implements BaseColumns
4050 {
4051 private static final String TAG = "Bookmarks";
4052
4053 /**
4054 * The content:// style URL for this table
4055 */
4056 public static final Uri CONTENT_URI =
4057 Uri.parse("content://" + AUTHORITY + "/bookmarks");
4058
4059 /**
4060 * The row ID.
4061 * <p>Type: INTEGER</p>
4062 */
4063 public static final String ID = "_id";
4064
4065 /**
4066 * Descriptive name of the bookmark that can be displayed to the user.
4067 * If this is empty, the title should be resolved at display time (use
4068 * {@link #getTitle(Context, Cursor)} any time you want to display the
4069 * title of a bookmark.)
4070 * <P>
4071 * Type: TEXT
4072 * </P>
4073 */
4074 public static final String TITLE = "title";
4075
4076 /**
4077 * Arbitrary string (displayed to the user) that allows bookmarks to be
4078 * organized into categories. There are some special names for
4079 * standard folders, which all start with '@'. The label displayed for
4080 * the folder changes with the locale (via {@link #getLabelForFolder}) but
4081 * the folder name does not change so you can consistently query for
4082 * the folder regardless of the current locale.
4083 *
4084 * <P>Type: TEXT</P>
4085 *
4086 */
4087 public static final String FOLDER = "folder";
4088
4089 /**
4090 * The Intent URL of the bookmark, describing what it points to. This
4091 * value is given to {@link android.content.Intent#getIntent} to create
4092 * an Intent that can be launched.
4093 * <P>Type: TEXT</P>
4094 */
4095 public static final String INTENT = "intent";
4096
4097 /**
4098 * Optional shortcut character associated with this bookmark.
4099 * <P>Type: INTEGER</P>
4100 */
4101 public static final String SHORTCUT = "shortcut";
4102
4103 /**
4104 * The order in which the bookmark should be displayed
4105 * <P>Type: INTEGER</P>
4106 */
4107 public static final String ORDERING = "ordering";
4108
4109 private static final String[] sIntentProjection = { INTENT };
4110 private static final String[] sShortcutProjection = { ID, SHORTCUT };
4111 private static final String sShortcutSelection = SHORTCUT + "=?";
4112
4113 /**
4114 * Convenience function to retrieve the bookmarked Intent for a
4115 * particular shortcut key.
4116 *
4117 * @param cr The ContentResolver to query.
4118 * @param shortcut The shortcut key.
4119 *
4120 * @return Intent The bookmarked URL, or null if there is no bookmark
4121 * matching the given shortcut.
4122 */
4123 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
4124 {
4125 Intent intent = null;
4126
4127 Cursor c = cr.query(CONTENT_URI,
4128 sIntentProjection, sShortcutSelection,
4129 new String[] { String.valueOf((int) shortcut) }, ORDERING);
4130 // Keep trying until we find a valid shortcut
4131 try {
4132 while (intent == null && c.moveToNext()) {
4133 try {
4134 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02004135 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004136 } catch (java.net.URISyntaxException e) {
4137 // The stored URL is bad... ignore it.
4138 } catch (IllegalArgumentException e) {
4139 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07004140 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004141 }
4142 }
4143 } finally {
4144 if (c != null) c.close();
4145 }
4146
4147 return intent;
4148 }
4149
4150 /**
4151 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004152 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004153 * @param cr The ContentResolver to query.
4154 * @param intent The desired target of the bookmark.
4155 * @param title Bookmark title that is shown to the user; null if none
4156 * or it should be resolved to the intent's title.
4157 * @param folder Folder in which to place the bookmark; null if none.
4158 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
4159 * this is non-zero and there is an existing bookmark entry
4160 * with this same shortcut, then that existing shortcut is
4161 * cleared (the bookmark is not removed).
4162 * @return The unique content URL for the new bookmark entry.
4163 */
4164 public static Uri add(ContentResolver cr,
4165 Intent intent,
4166 String title,
4167 String folder,
4168 char shortcut,
4169 int ordering)
4170 {
4171 // If a shortcut is supplied, and it is already defined for
4172 // another bookmark, then remove the old definition.
4173 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05004174 cr.delete(CONTENT_URI, sShortcutSelection,
4175 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004176 }
4177
4178 ContentValues values = new ContentValues();
4179 if (title != null) values.put(TITLE, title);
4180 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07004181 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004182 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
4183 values.put(ORDERING, ordering);
4184 return cr.insert(CONTENT_URI, values);
4185 }
4186
4187 /**
4188 * Return the folder name as it should be displayed to the user. This
4189 * takes care of localizing special folders.
4190 *
4191 * @param r Resources object for current locale; only need access to
4192 * system resources.
4193 * @param folder The value found in the {@link #FOLDER} column.
4194 *
4195 * @return CharSequence The label for this folder that should be shown
4196 * to the user.
4197 */
4198 public static CharSequence getLabelForFolder(Resources r, String folder) {
4199 return folder;
4200 }
4201
4202 /**
4203 * Return the title as it should be displayed to the user. This takes
4204 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004205 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004206 * @param context A context.
4207 * @param cursor A cursor pointing to the row whose title should be
4208 * returned. The cursor must contain at least the {@link #TITLE}
4209 * and {@link #INTENT} columns.
4210 * @return A title that is localized and can be displayed to the user,
4211 * or the empty string if one could not be found.
4212 */
4213 public static CharSequence getTitle(Context context, Cursor cursor) {
4214 int titleColumn = cursor.getColumnIndex(TITLE);
4215 int intentColumn = cursor.getColumnIndex(INTENT);
4216 if (titleColumn == -1 || intentColumn == -1) {
4217 throw new IllegalArgumentException(
4218 "The cursor must contain the TITLE and INTENT columns.");
4219 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004220
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004221 String title = cursor.getString(titleColumn);
4222 if (!TextUtils.isEmpty(title)) {
4223 return title;
4224 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004225
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004226 String intentUri = cursor.getString(intentColumn);
4227 if (TextUtils.isEmpty(intentUri)) {
4228 return "";
4229 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004230
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004231 Intent intent;
4232 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02004233 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004234 } catch (URISyntaxException e) {
4235 return "";
4236 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004237
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004238 PackageManager packageManager = context.getPackageManager();
4239 ResolveInfo info = packageManager.resolveActivity(intent, 0);
4240 return info != null ? info.loadLabel(packageManager) : "";
4241 }
4242 }
4243
4244 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004245 * Returns the device ID that we should use when connecting to the mobile gtalk server.
4246 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
4247 * from the GoogleLoginService.
4248 *
4249 * @param androidId The Android ID for this device.
4250 * @return The device ID that should be used when connecting to the mobile gtalk server.
4251 * @hide
4252 */
4253 public static String getGTalkDeviceId(long androidId) {
4254 return "android-" + Long.toHexString(androidId);
4255 }
4256}