blob: d456813478d8ad7f0400edb7c3a0fb99ba4e7da3 [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;
Mike LeBeau5d34e9b2010-02-10 19:34:56 -080021import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080022import android.content.ContentResolver;
23import android.content.ContentValues;
24import android.content.Context;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -080025import android.content.IContentProvider;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080026import android.content.Intent;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -080027import android.content.pm.ActivityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080028import android.content.pm.PackageManager;
29import android.content.pm.ResolveInfo;
30import android.content.res.Configuration;
31import android.content.res.Resources;
32import android.database.Cursor;
33import android.database.SQLException;
34import android.net.Uri;
Irfan Sheriff36f74132010-11-04 16:57:37 -070035import android.net.wifi.WifiManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070036import android.os.BatteryManager;
37import android.os.Bundle;
38import android.os.RemoteException;
39import android.os.SystemProperties;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080040import android.text.TextUtils;
41import android.util.AndroidException;
42import android.util.Log;
43
44import java.net.URISyntaxException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080045import java.util.HashMap;
46import java.util.HashSet;
47
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080048/**
49 * The Settings provider contains global system-level device preferences.
50 */
51public final class Settings {
52
53 // Intent actions for Settings
54
55 /**
56 * Activity Action: Show system settings.
57 * <p>
58 * Input: Nothing.
59 * <p>
60 * Output: nothing.
61 */
62 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
63 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
64
65 /**
66 * Activity Action: Show settings to allow configuration of APNs.
67 * <p>
68 * Input: Nothing.
69 * <p>
70 * Output: nothing.
71 */
72 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
73 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
74
75 /**
76 * Activity Action: Show settings to allow configuration of current location
77 * sources.
78 * <p>
79 * In some cases, a matching Activity may not exist, so ensure you
80 * safeguard against this.
81 * <p>
82 * Input: Nothing.
83 * <p>
84 * Output: Nothing.
85 */
86 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
87 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
88 "android.settings.LOCATION_SOURCE_SETTINGS";
89
90 /**
91 * Activity Action: Show settings to allow configuration of wireless controls
92 * such as Wi-Fi, Bluetooth and Mobile networks.
93 * <p>
94 * In some cases, a matching Activity may not exist, so ensure you
95 * safeguard against this.
96 * <p>
97 * Input: Nothing.
98 * <p>
99 * Output: Nothing.
100 */
101 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
102 public static final String ACTION_WIRELESS_SETTINGS =
103 "android.settings.WIRELESS_SETTINGS";
104
105 /**
106 * Activity Action: Show settings to allow entering/exiting airplane mode.
107 * <p>
108 * In some cases, a matching Activity may not exist, so ensure you
109 * safeguard against this.
110 * <p>
111 * Input: Nothing.
112 * <p>
113 * Output: Nothing.
114 */
115 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
116 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
117 "android.settings.AIRPLANE_MODE_SETTINGS";
118
119 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700120 * Activity Action: Show settings for accessibility modules.
121 * <p>
122 * In some cases, a matching Activity may not exist, so ensure you
123 * safeguard against this.
124 * <p>
125 * Input: Nothing.
126 * <p>
127 * Output: Nothing.
128 */
129 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
130 public static final String ACTION_ACCESSIBILITY_SETTINGS =
131 "android.settings.ACCESSIBILITY_SETTINGS";
132
133 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800134 * Activity Action: Show settings to allow configuration of security and
135 * location privacy.
136 * <p>
137 * In some cases, a matching Activity may not exist, so ensure you
138 * safeguard against this.
139 * <p>
140 * Input: Nothing.
141 * <p>
142 * Output: Nothing.
143 */
144 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
145 public static final String ACTION_SECURITY_SETTINGS =
146 "android.settings.SECURITY_SETTINGS";
147
148 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700149 * Activity Action: Show settings to allow configuration of privacy options.
150 * <p>
151 * In some cases, a matching Activity may not exist, so ensure you
152 * safeguard against this.
153 * <p>
154 * Input: Nothing.
155 * <p>
156 * Output: Nothing.
157 */
158 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
159 public static final String ACTION_PRIVACY_SETTINGS =
160 "android.settings.PRIVACY_SETTINGS";
161
162 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800163 * Activity Action: Show settings to allow configuration of Wi-Fi.
164
165 * <p>
166 * In some cases, a matching Activity may not exist, so ensure you
167 * safeguard against this.
168 * <p>
169 * Input: Nothing.
170 * <p>
171 * Output: Nothing.
172
173 */
174 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
175 public static final String ACTION_WIFI_SETTINGS =
176 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700177
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800178 /**
179 * Activity Action: Show settings to allow configuration of a static IP
180 * address for Wi-Fi.
181 * <p>
182 * In some cases, a matching Activity may not exist, so ensure you safeguard
183 * against this.
184 * <p>
185 * Input: Nothing.
186 * <p>
187 * Output: Nothing.
188 */
189 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
190 public static final String ACTION_WIFI_IP_SETTINGS =
191 "android.settings.WIFI_IP_SETTINGS";
192
193 /**
194 * Activity Action: Show settings to allow configuration of Bluetooth.
195 * <p>
196 * In some cases, a matching Activity may not exist, so ensure you
197 * safeguard against this.
198 * <p>
199 * Input: Nothing.
200 * <p>
201 * Output: Nothing.
202 */
203 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
204 public static final String ACTION_BLUETOOTH_SETTINGS =
205 "android.settings.BLUETOOTH_SETTINGS";
206
207 /**
208 * Activity Action: Show settings to allow configuration of date and time.
209 * <p>
210 * In some cases, a matching Activity may not exist, so ensure you
211 * safeguard against this.
212 * <p>
213 * Input: Nothing.
214 * <p>
215 * Output: Nothing.
216 */
217 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
218 public static final String ACTION_DATE_SETTINGS =
219 "android.settings.DATE_SETTINGS";
220
221 /**
222 * Activity Action: Show settings to allow configuration of sound and volume.
223 * <p>
224 * In some cases, a matching Activity may not exist, so ensure you
225 * safeguard against this.
226 * <p>
227 * Input: Nothing.
228 * <p>
229 * Output: Nothing.
230 */
231 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
232 public static final String ACTION_SOUND_SETTINGS =
233 "android.settings.SOUND_SETTINGS";
234
235 /**
236 * Activity Action: Show settings to allow configuration of display.
237 * <p>
238 * In some cases, a matching Activity may not exist, so ensure you
239 * safeguard against this.
240 * <p>
241 * Input: Nothing.
242 * <p>
243 * Output: Nothing.
244 */
245 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
246 public static final String ACTION_DISPLAY_SETTINGS =
247 "android.settings.DISPLAY_SETTINGS";
248
249 /**
250 * Activity Action: Show settings to allow configuration of locale.
251 * <p>
252 * In some cases, a matching Activity may not exist, so ensure you
253 * safeguard against this.
254 * <p>
255 * Input: Nothing.
256 * <p>
257 * Output: Nothing.
258 */
259 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
260 public static final String ACTION_LOCALE_SETTINGS =
261 "android.settings.LOCALE_SETTINGS";
262
263 /**
264 * Activity Action: Show settings to configure input methods, in particular
265 * allowing the user to enable input methods.
266 * <p>
267 * In some cases, a matching Activity may not exist, so ensure you
268 * safeguard against this.
269 * <p>
270 * Input: Nothing.
271 * <p>
272 * Output: Nothing.
273 */
274 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
275 public static final String ACTION_INPUT_METHOD_SETTINGS =
276 "android.settings.INPUT_METHOD_SETTINGS";
277
278 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900279 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900280 * <p>
281 * In some cases, a matching Activity may not exist, so ensure you
282 * safeguard against this.
283 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900284 * To tell which input method's subtypes are displayed in the settings, add
285 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
286 * If there is no extra in this Intent, subtypes from all installed input methods
287 * will be displayed in the settings.
288 *
289 * @see android.view.inputmethod.InputMethodInfo#getId
290 * <p>
satok86417ea2010-10-27 14:11:03 +0900291 * Input: Nothing.
292 * <p>
293 * Output: Nothing.
294 */
295 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900296 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
297 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900298
299 /**
satok7cfc0ed2011-06-20 21:29:36 +0900300 * Activity Action: Show a dialog to select input method.
301 * <p>
302 * In some cases, a matching Activity may not exist, so ensure you
303 * safeguard against this.
304 * <p>
305 * Input: Nothing.
306 * <p>
307 * Output: Nothing.
308 * @hide
309 */
310 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
311 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
312 "android.settings.SHOW_INPUT_METHOD_PICKER";
313
314 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800315 * Activity Action: Show settings to manage the user input dictionary.
316 * <p>
317 * In some cases, a matching Activity may not exist, so ensure you
318 * safeguard against this.
319 * <p>
320 * Input: Nothing.
321 * <p>
322 * Output: Nothing.
323 */
324 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
325 public static final String ACTION_USER_DICTIONARY_SETTINGS =
326 "android.settings.USER_DICTIONARY_SETTINGS";
327
328 /**
329 * Activity Action: Show settings to allow configuration of application-related settings.
330 * <p>
331 * In some cases, a matching Activity may not exist, so ensure you
332 * safeguard against this.
333 * <p>
334 * Input: Nothing.
335 * <p>
336 * Output: Nothing.
337 */
338 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
339 public static final String ACTION_APPLICATION_SETTINGS =
340 "android.settings.APPLICATION_SETTINGS";
341
342 /**
343 * Activity Action: Show settings to allow configuration of application
344 * development-related settings.
345 * <p>
346 * In some cases, a matching Activity may not exist, so ensure you safeguard
347 * against this.
348 * <p>
349 * Input: Nothing.
350 * <p>
351 * Output: Nothing.
352 */
353 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
354 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
355 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
356
357 /**
358 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
359 * <p>
360 * In some cases, a matching Activity may not exist, so ensure you
361 * safeguard against this.
362 * <p>
363 * Input: Nothing.
364 * <p>
365 * Output: Nothing.
366 */
367 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
368 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
369 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700370
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800371 /**
372 * Activity Action: Show settings to manage installed applications.
373 * <p>
374 * In some cases, a matching Activity may not exist, so ensure you
375 * safeguard against this.
376 * <p>
377 * Input: Nothing.
378 * <p>
379 * Output: Nothing.
380 */
381 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
382 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
383 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700384
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800385 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700386 * Activity Action: Show settings to manage all applications.
387 * <p>
388 * In some cases, a matching Activity may not exist, so ensure you
389 * safeguard against this.
390 * <p>
391 * Input: Nothing.
392 * <p>
393 * Output: Nothing.
394 */
395 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
396 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
397 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
398
399 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700400 * Activity Action: Show screen of details about a particular application.
401 * <p>
402 * In some cases, a matching Activity may not exist, so ensure you
403 * safeguard against this.
404 * <p>
405 * Input: The Intent's data URI specifies the application package name
406 * to be shown, with the "package" scheme. That is "package:com.my.app".
407 * <p>
408 * Output: Nothing.
409 */
410 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
411 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
412 "android.settings.APPLICATION_DETAILS_SETTINGS";
413
414 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800415 * Activity Action: Show settings for system update functionality.
416 * <p>
417 * In some cases, a matching Activity may not exist, so ensure you
418 * safeguard against this.
419 * <p>
420 * Input: Nothing.
421 * <p>
422 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700423 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800424 * @hide
425 */
426 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
427 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
428 "android.settings.SYSTEM_UPDATE_SETTINGS";
429
430 /**
431 * Activity Action: Show settings to allow configuration of sync settings.
432 * <p>
433 * In some cases, a matching Activity may not exist, so ensure you
434 * safeguard against this.
435 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800436 * The account types available to add via the add account button may be restricted by adding an
437 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
438 * authorities. Only account types which can sync with that content provider will be offered to
439 * the user.
440 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800441 * Input: Nothing.
442 * <p>
443 * Output: Nothing.
444 */
445 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
446 public static final String ACTION_SYNC_SETTINGS =
447 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700448
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800449 /**
Erikeebc8e22010-02-18 13:27:19 -0800450 * Activity Action: Show add account screen for creating a new account.
451 * <p>
452 * In some cases, a matching Activity may not exist, so ensure you
453 * safeguard against this.
454 * <p>
455 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
456 * extra to the Intent with one or more syncable content provider's authorities. Only account
457 * types which can sync with that content provider will be offered to the user.
458 * <p>
459 * Input: Nothing.
460 * <p>
461 * Output: Nothing.
462 */
463 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
464 public static final String ACTION_ADD_ACCOUNT =
465 "android.settings.ADD_ACCOUNT_SETTINGS";
466
467 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800468 * Activity Action: Show settings for selecting the network operator.
469 * <p>
470 * In some cases, a matching Activity may not exist, so ensure you
471 * safeguard against this.
472 * <p>
473 * Input: Nothing.
474 * <p>
475 * Output: Nothing.
476 */
477 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
478 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
479 "android.settings.NETWORK_OPERATOR_SETTINGS";
480
481 /**
482 * Activity Action: Show settings for selection of 2G/3G.
483 * <p>
484 * In some cases, a matching Activity may not exist, so ensure you
485 * safeguard against this.
486 * <p>
487 * Input: Nothing.
488 * <p>
489 * Output: Nothing.
490 */
491 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
492 public static final String ACTION_DATA_ROAMING_SETTINGS =
493 "android.settings.DATA_ROAMING_SETTINGS";
494
495 /**
496 * Activity Action: Show settings for internal storage.
497 * <p>
498 * In some cases, a matching Activity may not exist, so ensure you
499 * safeguard against this.
500 * <p>
501 * Input: Nothing.
502 * <p>
503 * Output: Nothing.
504 */
505 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
506 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
507 "android.settings.INTERNAL_STORAGE_SETTINGS";
508 /**
509 * Activity Action: Show settings for memory card storage.
510 * <p>
511 * In some cases, a matching Activity may not exist, so ensure you
512 * safeguard against this.
513 * <p>
514 * Input: Nothing.
515 * <p>
516 * Output: Nothing.
517 */
518 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
519 public static final String ACTION_MEMORY_CARD_SETTINGS =
520 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700521
Justin Mattsonef340352010-01-13 21:05:46 -0800522 /**
523 * Activity Action: Show settings for global search.
524 * <p>
525 * In some cases, a matching Activity may not exist, so ensure you
526 * safeguard against this.
527 * <p>
528 * Input: Nothing.
529 * <p>
530 * Output: Nothing
531 */
532 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
533 public static final String ACTION_SEARCH_SETTINGS =
534 "android.search.action.SEARCH_SETTINGS";
535
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500536 /**
537 * Activity Action: Show general device information settings (serial
538 * number, software version, phone number, etc.).
539 * <p>
540 * In some cases, a matching Activity may not exist, so ensure you
541 * safeguard against this.
542 * <p>
543 * Input: Nothing.
544 * <p>
545 * Output: Nothing
546 */
547 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
548 public static final String ACTION_DEVICE_INFO_SETTINGS =
549 "android.settings.DEVICE_INFO_SETTINGS";
550
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800551 // End of Intent actions for Settings
552
Erikeebc8e22010-02-18 13:27:19 -0800553 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800554 * @hide - Private call() method on SettingsProvider to read from 'system' table.
555 */
556 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
557
558 /**
559 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
560 */
561 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
562
563 /**
Erikeebc8e22010-02-18 13:27:19 -0800564 * Activity Extra: Limit available options in launched activity based on the given authority.
565 * <p>
566 * This can be passed as an extra field in an Activity Intent with one or more syncable content
567 * provider's authorities as a String[]. This field is used by some intents to alter the
568 * behavior of the called activity.
569 * <p>
570 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
571 * on the authority given.
572 */
573 public static final String EXTRA_AUTHORITIES =
574 "authorities";
575
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900576 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
577
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800578 private static final String JID_RESOURCE_PREFIX = "android";
579
580 public static final String AUTHORITY = "settings";
581
582 private static final String TAG = "Settings";
Joe Onorato43a17652011-04-06 19:22:23 -0700583 private static final boolean LOCAL_LOGV = false || false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800584
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800585 public static class SettingNotFoundException extends AndroidException {
586 public SettingNotFoundException(String msg) {
587 super(msg);
588 }
589 }
590
591 /**
592 * Common base for tables of name/value settings.
593 */
594 public static class NameValueTable implements BaseColumns {
595 public static final String NAME = "name";
596 public static final String VALUE = "value";
597
598 protected static boolean putString(ContentResolver resolver, Uri uri,
599 String name, String value) {
600 // The database will take care of replacing duplicates.
601 try {
602 ContentValues values = new ContentValues();
603 values.put(NAME, name);
604 values.put(VALUE, value);
605 resolver.insert(uri, values);
606 return true;
607 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -0700608 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800609 return false;
610 }
611 }
612
613 public static Uri getUriFor(Uri uri, String name) {
614 return Uri.withAppendedPath(uri, name);
615 }
616 }
617
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800618 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800619 private static class NameValueCache {
620 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800621 private final Uri mUri;
622
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800623 private static final String[] SELECT_VALUE =
624 new String[] { Settings.NameValueTable.VALUE };
625 private static final String NAME_EQ_PLACEHOLDER = "name=?";
626
627 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -0800628 private final HashMap<String, String> mValues = new HashMap<String, String>();
629 private long mValuesVersion = 0;
630
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800631 // Initially null; set lazily and held forever. Synchronized on 'this'.
632 private IContentProvider mContentProvider = null;
633
634 // The method we'll call (or null, to not use) on the provider
635 // for the fast path of retrieving settings.
636 private final String mCallCommand;
637
638 public NameValueCache(String versionSystemProperty, Uri uri, String callCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800639 mVersionSystemProperty = versionSystemProperty;
640 mUri = uri;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800641 mCallCommand = callCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800642 }
643
Dan Egnor799f7212009-11-24 16:24:44 -0800644 public String getString(ContentResolver cr, String name) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800645 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -0800646
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800647 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -0800648 if (mValuesVersion != newValuesVersion) {
649 if (LOCAL_LOGV) {
650 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current " +
651 newValuesVersion + " != cached " + mValuesVersion);
652 }
653
654 mValues.clear();
655 mValuesVersion = newValuesVersion;
656 }
657
658 if (mValues.containsKey(name)) {
659 return mValues.get(name); // Could be null, that's OK -- negative caching
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800660 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800661 }
Dan Egnor799f7212009-11-24 16:24:44 -0800662
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800663 IContentProvider cp = null;
664 synchronized (this) {
665 cp = mContentProvider;
666 if (cp == null) {
667 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
668 }
669 }
670
671 // Try the fast path first, not using query(). If this
672 // fails (alternate Settings provider that doesn't support
673 // this interface?) then we fall back to the query/table
674 // interface.
675 if (mCallCommand != null) {
676 try {
677 Bundle b = cp.call(mCallCommand, name, null);
678 if (b != null) {
679 String value = b.getPairValue();
680 synchronized (this) {
681 mValues.put(name, value);
682 }
683 return value;
684 }
685 // If the response Bundle is null, we fall through
686 // to the query interface below.
687 } catch (RemoteException e) {
688 // Not supported by the remote side? Fall through
689 // to query().
690 }
691 }
692
Dan Egnor799f7212009-11-24 16:24:44 -0800693 Cursor c = null;
694 try {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800695 c = cp.query(mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
696 new String[]{name}, null);
Dan Egnor799f7212009-11-24 16:24:44 -0800697 if (c == null) {
698 Log.w(TAG, "Can't get key " + name + " from " + mUri);
699 return null;
700 }
701
702 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800703 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -0800704 mValues.put(name, value);
705 }
706 if (LOCAL_LOGV) {
707 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
708 name + " = " + (value == null ? "(null)" : value));
709 }
710 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800711 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -0800712 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
713 return null; // Return null, but don't cache it.
714 } finally {
715 if (c != null) c.close();
716 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800717 }
718 }
719
720 /**
721 * System settings, containing miscellaneous system preferences. This
722 * table holds simple name/value pairs. There are convenience
723 * functions for accessing individual settings entries.
724 */
725 public static final class System extends NameValueTable {
726 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
727
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800728 // Populated lazily, guarded by class object:
729 private static NameValueCache sNameValueCache = null;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700730
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800731 private static final HashSet<String> MOVED_TO_SECURE;
732 static {
733 MOVED_TO_SECURE = new HashSet<String>(30);
734 MOVED_TO_SECURE.add(Secure.ADB_ENABLED);
735 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
736 MOVED_TO_SECURE.add(Secure.BLUETOOTH_ON);
737 MOVED_TO_SECURE.add(Secure.DATA_ROAMING);
738 MOVED_TO_SECURE.add(Secure.DEVICE_PROVISIONED);
739 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
740 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
741 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Amith Yamasani156c4352010-03-05 17:10:03 -0800742 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
743 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
744 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800745 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
746 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
747 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
748 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
749 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
750 MOVED_TO_SECURE.add(Secure.USB_MASS_STORAGE_ENABLED);
751 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
752 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
753 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
754 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
755 MOVED_TO_SECURE.add(Secure.WIFI_ON);
756 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
757 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
758 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
759 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
760 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
761 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
762 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
763 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
764 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
765 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
766 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
767 }
768
769 /**
770 * Look up a name in the database.
771 * @param resolver to access the database with
772 * @param name to look up in the table
773 * @return the corresponding value, or null if not present
774 */
775 public synchronized static String getString(ContentResolver resolver, String name) {
776 if (MOVED_TO_SECURE.contains(name)) {
777 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
778 + " to android.provider.Settings.Secure, returning read-only value.");
779 return Secure.getString(resolver, name);
780 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800781 if (sNameValueCache == null) {
782 sNameValueCache = new NameValueCache(SYS_PROP_SETTING_VERSION, CONTENT_URI,
783 CALL_METHOD_GET_SYSTEM);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800784 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800785 return sNameValueCache.getString(resolver, name);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800786 }
787
788 /**
789 * Store a name/value pair into the database.
790 * @param resolver to access the database with
791 * @param name to store
792 * @param value to associate with the name
793 * @return true if the value was set, false on database errors
794 */
795 public static boolean putString(ContentResolver resolver, String name, String value) {
796 if (MOVED_TO_SECURE.contains(name)) {
797 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
798 + " to android.provider.Settings.Secure, value is unchanged.");
799 return false;
800 }
801 return putString(resolver, CONTENT_URI, name, value);
802 }
803
804 /**
805 * Construct the content URI for a particular name/value pair,
806 * useful for monitoring changes with a ContentObserver.
807 * @param name to look up in the table
808 * @return the corresponding content URI, or null if not present
809 */
810 public static Uri getUriFor(String name) {
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, returning Secure URI.");
814 return Secure.getUriFor(Secure.CONTENT_URI, name);
815 }
816 return getUriFor(CONTENT_URI, name);
817 }
818
819 /**
820 * Convenience function for retrieving a single system settings value
821 * as an integer. Note that internally setting values are always
822 * stored as strings; this function converts the string to an integer
823 * for you. The default value will be returned if the setting is
824 * not defined or not an integer.
825 *
826 * @param cr The ContentResolver to access.
827 * @param name The name of the setting to retrieve.
828 * @param def Value to return if the setting is not defined.
829 *
830 * @return The setting's current value, or 'def' if it is not defined
831 * or not a valid integer.
832 */
833 public static int getInt(ContentResolver cr, String name, int def) {
834 String v = getString(cr, name);
835 try {
836 return v != null ? Integer.parseInt(v) : def;
837 } catch (NumberFormatException e) {
838 return def;
839 }
840 }
841
842 /**
843 * Convenience function for retrieving a single system settings value
844 * as an integer. Note that internally setting values are always
845 * stored as strings; this function converts the string to an integer
846 * for you.
847 * <p>
848 * This version does not take a default value. If the setting has not
849 * been set, or the string value is not a number,
850 * it throws {@link SettingNotFoundException}.
851 *
852 * @param cr The ContentResolver to access.
853 * @param name The name of the setting to retrieve.
854 *
855 * @throws SettingNotFoundException Thrown if a setting by the given
856 * name can't be found or the setting value is not an integer.
857 *
858 * @return The setting's current value.
859 */
860 public static int getInt(ContentResolver cr, String name)
861 throws SettingNotFoundException {
862 String v = getString(cr, name);
863 try {
864 return Integer.parseInt(v);
865 } catch (NumberFormatException e) {
866 throw new SettingNotFoundException(name);
867 }
868 }
869
870 /**
871 * Convenience function for updating a single settings value as an
872 * integer. This will either create a new entry in the table if the
873 * given name does not exist, or modify the value of the existing row
874 * with that name. Note that internally setting values are always
875 * stored as strings, so this function converts the given value to a
876 * string before storing it.
877 *
878 * @param cr The ContentResolver to access.
879 * @param name The name of the setting to modify.
880 * @param value The new value for the setting.
881 * @return true if the value was set, false on database errors
882 */
883 public static boolean putInt(ContentResolver cr, String name, int value) {
884 return putString(cr, name, Integer.toString(value));
885 }
886
887 /**
888 * Convenience function for retrieving a single system settings value
889 * as a {@code long}. Note that internally setting values are always
890 * stored as strings; this function converts the string to a {@code long}
891 * for you. The default value will be returned if the setting is
892 * not defined or not a {@code long}.
893 *
894 * @param cr The ContentResolver to access.
895 * @param name The name of the setting to retrieve.
896 * @param def Value to return if the setting is not defined.
897 *
898 * @return The setting's current value, or 'def' if it is not defined
899 * or not a valid {@code long}.
900 */
901 public static long getLong(ContentResolver cr, String name, long def) {
902 String valString = getString(cr, name);
903 long value;
904 try {
905 value = valString != null ? Long.parseLong(valString) : def;
906 } catch (NumberFormatException e) {
907 value = def;
908 }
909 return value;
910 }
911
912 /**
913 * Convenience function for retrieving a single system settings value
914 * as a {@code long}. Note that internally setting values are always
915 * stored as strings; this function converts the string to a {@code long}
916 * for you.
917 * <p>
918 * This version does not take a default value. If the setting has not
919 * been set, or the string value is not a number,
920 * it throws {@link SettingNotFoundException}.
921 *
922 * @param cr The ContentResolver to access.
923 * @param name The name of the setting to retrieve.
924 *
925 * @return The setting's current value.
926 * @throws SettingNotFoundException Thrown if a setting by the given
927 * name can't be found or the setting value is not an integer.
928 */
929 public static long getLong(ContentResolver cr, String name)
930 throws SettingNotFoundException {
931 String valString = getString(cr, name);
932 try {
933 return Long.parseLong(valString);
934 } catch (NumberFormatException e) {
935 throw new SettingNotFoundException(name);
936 }
937 }
938
939 /**
940 * Convenience function for updating a single settings value as a long
941 * integer. This will either create a new entry in the table if the
942 * given name does not exist, or modify the value of the existing row
943 * with that name. Note that internally setting values are always
944 * stored as strings, so this function converts the given value to a
945 * string before storing it.
946 *
947 * @param cr The ContentResolver to access.
948 * @param name The name of the setting to modify.
949 * @param value The new value for the setting.
950 * @return true if the value was set, false on database errors
951 */
952 public static boolean putLong(ContentResolver cr, String name, long value) {
953 return putString(cr, name, Long.toString(value));
954 }
955
956 /**
957 * Convenience function for retrieving a single system settings value
958 * as a floating point number. Note that internally setting values are
959 * always stored as strings; this function converts the string to an
960 * float for you. The default value will be returned if the setting
961 * is not defined or not a valid float.
962 *
963 * @param cr The ContentResolver to access.
964 * @param name The name of the setting to retrieve.
965 * @param def Value to return if the setting is not defined.
966 *
967 * @return The setting's current value, or 'def' if it is not defined
968 * or not a valid float.
969 */
970 public static float getFloat(ContentResolver cr, String name, float def) {
971 String v = getString(cr, name);
972 try {
973 return v != null ? Float.parseFloat(v) : def;
974 } catch (NumberFormatException e) {
975 return def;
976 }
977 }
978
979 /**
980 * Convenience function for retrieving a single system settings value
981 * as a float. Note that internally setting values are always
982 * stored as strings; this function converts the string to a float
983 * for you.
984 * <p>
985 * This version does not take a default value. If the setting has not
986 * been set, or the string value is not a number,
987 * it throws {@link SettingNotFoundException}.
988 *
989 * @param cr The ContentResolver to access.
990 * @param name The name of the setting to retrieve.
991 *
992 * @throws SettingNotFoundException Thrown if a setting by the given
993 * name can't be found or the setting value is not a float.
994 *
995 * @return The setting's current value.
996 */
997 public static float getFloat(ContentResolver cr, String name)
998 throws SettingNotFoundException {
999 String v = getString(cr, name);
Brian Muramatsue1d46982010-12-06 17:34:20 -08001000 if (v == null) {
1001 throw new SettingNotFoundException(name);
1002 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001003 try {
1004 return Float.parseFloat(v);
1005 } catch (NumberFormatException e) {
1006 throw new SettingNotFoundException(name);
1007 }
1008 }
1009
1010 /**
1011 * Convenience function for updating a single settings value as a
1012 * floating point number. This will either create a new entry in the
1013 * table if the given name does not exist, or modify the value of the
1014 * existing row with that name. Note that internally setting values
1015 * are always stored as strings, so this function converts the given
1016 * value to a string before storing it.
1017 *
1018 * @param cr The ContentResolver to access.
1019 * @param name The name of the setting to modify.
1020 * @param value The new value for the setting.
1021 * @return true if the value was set, false on database errors
1022 */
1023 public static boolean putFloat(ContentResolver cr, String name, float value) {
1024 return putString(cr, name, Float.toString(value));
1025 }
1026
1027 /**
1028 * Convenience function to read all of the current
1029 * configuration-related settings into a
1030 * {@link Configuration} object.
1031 *
1032 * @param cr The ContentResolver to access.
1033 * @param outConfig Where to place the configuration settings.
1034 */
1035 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
1036 outConfig.fontScale = Settings.System.getFloat(
1037 cr, FONT_SCALE, outConfig.fontScale);
1038 if (outConfig.fontScale < 0) {
1039 outConfig.fontScale = 1;
1040 }
1041 }
1042
1043 /**
1044 * Convenience function to write a batch of configuration-related
1045 * settings from a {@link Configuration} object.
1046 *
1047 * @param cr The ContentResolver to access.
1048 * @param config The settings to write.
1049 * @return true if the values were set, false on database errors
1050 */
1051 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
1052 return Settings.System.putFloat(cr, FONT_SCALE, config.fontScale);
1053 }
1054
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001055 /** @hide */
1056 public static boolean hasInterestingConfigurationChanges(int changes) {
1057 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1058 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001059
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001060 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
1061 return getInt(cr, SHOW_GTALK_SERVICE_STATUS, 0) != 0;
1062 }
1063
1064 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
1065 putInt(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0);
1066 }
1067
1068 /**
1069 * The content:// style URL for this table
1070 */
1071 public static final Uri CONTENT_URI =
1072 Uri.parse("content://" + AUTHORITY + "/system");
1073
1074 /**
1075 * Whether we keep the device on while the device is plugged in.
1076 * Supported values are:
1077 * <ul>
1078 * <li>{@code 0} to never stay on while plugged in</li>
1079 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
1080 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
1081 * </ul>
1082 * These values can be OR-ed together.
1083 */
1084 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
1085
1086 /**
1087 * What happens when the user presses the end call button if they're not
1088 * on a call.<br/>
1089 * <b>Values:</b><br/>
1090 * 0 - The end button does nothing.<br/>
1091 * 1 - The end button goes to the home screen.<br/>
1092 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1093 * 3 - The end button goes to the home screen. If the user is already on the
1094 * home screen, it puts the device to sleep.
1095 */
1096 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1097
1098 /**
David Brown458e8062010-03-08 21:52:11 -08001099 * END_BUTTON_BEHAVIOR value for "go home".
1100 * @hide
1101 */
1102 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1103
1104 /**
1105 * END_BUTTON_BEHAVIOR value for "go to sleep".
1106 * @hide
1107 */
1108 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
1109
1110 /**
1111 * END_BUTTON_BEHAVIOR default value.
1112 * @hide
1113 */
1114 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
1115
1116 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07001117 * Is advanced settings mode turned on. 0 == no, 1 == yes
1118 * @hide
1119 */
1120 public static final String ADVANCED_SETTINGS = "advanced_settings";
1121
1122 /**
1123 * ADVANCED_SETTINGS default value.
1124 * @hide
1125 */
1126 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
1127
1128 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001129 * Whether Airplane Mode is on.
1130 */
1131 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
1132
1133 /**
1134 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
1135 */
1136 public static final String RADIO_BLUETOOTH = "bluetooth";
1137
1138 /**
1139 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
1140 */
1141 public static final String RADIO_WIFI = "wifi";
1142
1143 /**
1144 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
1145 */
1146 public static final String RADIO_CELL = "cell";
1147
1148 /**
1149 * A comma separated list of radios that need to be disabled when airplane mode
1150 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
1151 * included in the comma separated list.
1152 */
1153 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
1154
1155 /**
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001156 * A comma separated list of radios that should to be disabled when airplane mode
1157 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
1158 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
1159 * will be turned off when entering airplane mode, but the user will be able to reenable
1160 * Wifi in the Settings app.
1161 *
1162 * {@hide}
1163 */
1164 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
1165
1166 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001167 * The policy for deciding when Wi-Fi should go to sleep (which will in
1168 * turn switch to using the mobile data as an Internet connection).
1169 * <p>
1170 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
1171 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
1172 * {@link #WIFI_SLEEP_POLICY_NEVER}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001173 */
1174 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
1175
1176 /**
1177 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
1178 * policy, which is to sleep shortly after the turning off
1179 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001180 */
1181 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
1182
1183 /**
1184 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
1185 * the device is on battery, and never go to sleep when the device is
1186 * plugged in.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001187 */
1188 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001189
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001190 /**
1191 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001192 */
1193 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001194
Irfan Sheriff31b62322010-08-30 12:26:00 -07001195 //TODO: deprecate static IP constants
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001196 /**
1197 * Whether to use static IP and other static network attributes.
1198 * <p>
1199 * Set to 1 for true and 0 for false.
1200 */
1201 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
1202
1203 /**
1204 * The static IP address.
1205 * <p>
1206 * Example: "192.168.1.51"
1207 */
1208 public static final String WIFI_STATIC_IP = "wifi_static_ip";
1209
1210 /**
1211 * If using static IP, the gateway's IP address.
1212 * <p>
1213 * Example: "192.168.1.1"
1214 */
1215 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
1216
1217 /**
1218 * If using static IP, the net mask.
1219 * <p>
1220 * Example: "255.255.255.0"
1221 */
1222 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
1223
1224 /**
1225 * If using static IP, the primary DNS's IP address.
1226 * <p>
1227 * Example: "192.168.1.1"
1228 */
1229 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
1230
1231 /**
1232 * If using static IP, the secondary DNS's IP address.
1233 * <p>
1234 * Example: "192.168.1.2"
1235 */
1236 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
1237
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001238
1239 /**
1240 * Determines whether remote devices may discover and/or connect to
1241 * this device.
1242 * <P>Type: INT</P>
1243 * 2 -- discoverable and connectable
1244 * 1 -- connectable but not discoverable
1245 * 0 -- neither connectable nor discoverable
1246 */
1247 public static final String BLUETOOTH_DISCOVERABILITY =
1248 "bluetooth_discoverability";
1249
1250 /**
1251 * Bluetooth discoverability timeout. If this value is nonzero, then
1252 * Bluetooth becomes discoverable for a certain number of seconds,
1253 * after which is becomes simply connectable. The value is in seconds.
1254 */
1255 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
1256 "bluetooth_discoverability_timeout";
1257
1258 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001259 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
1260 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001261 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001262 @Deprecated
1263 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001264
1265 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001266 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
1267 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001268 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001269 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001270 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
1271
1272 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001273 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08001274 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
1275 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001276 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001277 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001278 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
1279 "lock_pattern_tactile_feedback_enabled";
1280
1281
1282 /**
1283 * A formatted string of the next alarm that is set, or the empty string
1284 * if there is no alarm set.
1285 */
1286 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
1287
1288 /**
1289 * Scaling factor for fonts, float.
1290 */
1291 public static final String FONT_SCALE = "font_scale";
1292
1293 /**
1294 * Name of an application package to be debugged.
1295 */
1296 public static final String DEBUG_APP = "debug_app";
1297
1298 /**
1299 * If 1, when launching DEBUG_APP it will wait for the debugger before
1300 * starting user code. If 0, it will run normally.
1301 */
1302 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
1303
1304 /**
1305 * Whether or not to dim the screen. 0=no 1=yes
1306 */
1307 public static final String DIM_SCREEN = "dim_screen";
1308
1309 /**
1310 * The timeout before the screen turns off.
1311 */
1312 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
1313
1314 /**
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001315 * If 0, the compatibility mode is off for all applications.
1316 * If 1, older applications run under compatibility mode.
1317 * TODO: remove this settings before code freeze (bug/1907571)
1318 * @hide
1319 */
1320 public static final String COMPATIBILITY_MODE = "compatibility_mode";
1321
1322 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001323 * The screen backlight brightness between 0 and 255.
1324 */
1325 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
1326
1327 /**
Dan Murphy951764b2009-08-27 14:59:03 -05001328 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05001329 */
1330 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
1331
1332 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001333 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001334 */
1335 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
1336
1337 /**
1338 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001339 */
1340 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
1341
1342 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001343 * Control whether the process CPU usage meter should be shown.
1344 */
1345 public static final String SHOW_PROCESSES = "show_processes";
1346
1347 /**
1348 * If 1, the activity manager will aggressively finish activities and
1349 * processes as soon as they are no longer needed. If 0, the normal
1350 * extended lifetime is used.
1351 */
1352 public static final String ALWAYS_FINISH_ACTIVITIES =
1353 "always_finish_activities";
1354
1355
1356 /**
1357 * Ringer mode. This is used internally, changing this value will not
1358 * change the ringer mode. See AudioManager.
1359 */
1360 public static final String MODE_RINGER = "mode_ringer";
1361
1362 /**
1363 * Determines which streams are affected by ringer mode changes. The
1364 * stream type's bit should be set to 1 if it should be muted when going
1365 * into an inaudible ringer mode.
1366 */
1367 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
1368
1369 /**
1370 * Determines which streams are affected by mute. The
1371 * stream type's bit should be set to 1 if it should be muted when a mute request
1372 * is received.
1373 */
1374 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
1375
1376 /**
1377 * Whether vibrate is on for different events. This is used internally,
1378 * changing this value will not change the vibrate. See AudioManager.
1379 */
1380 public static final String VIBRATE_ON = "vibrate_on";
1381
1382 /**
1383 * Ringer volume. This is used internally, changing this value will not
1384 * change the volume. See AudioManager.
1385 */
1386 public static final String VOLUME_RING = "volume_ring";
1387
1388 /**
1389 * System/notifications volume. This is used internally, changing this
1390 * value will not change the volume. See AudioManager.
1391 */
1392 public static final String VOLUME_SYSTEM = "volume_system";
1393
1394 /**
1395 * Voice call volume. This is used internally, changing this value will
1396 * not change the volume. See AudioManager.
1397 */
1398 public static final String VOLUME_VOICE = "volume_voice";
1399
1400 /**
1401 * Music/media/gaming volume. This is used internally, changing this
1402 * value will not change the volume. See AudioManager.
1403 */
1404 public static final String VOLUME_MUSIC = "volume_music";
1405
1406 /**
1407 * Alarm volume. This is used internally, changing this
1408 * value will not change the volume. See AudioManager.
1409 */
1410 public static final String VOLUME_ALARM = "volume_alarm";
1411
1412 /**
1413 * Notification volume. This is used internally, changing this
1414 * value will not change the volume. See AudioManager.
1415 */
1416 public static final String VOLUME_NOTIFICATION = "volume_notification";
1417
1418 /**
Eric Laurent484d2882009-12-08 09:05:45 -08001419 * Bluetooth Headset volume. This is used internally, changing this value will
1420 * not change the volume. See AudioManager.
1421 */
1422 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
1423
1424 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001425 * Whether the notifications should use the ring volume (value of 1) or
1426 * a separate notification volume (value of 0). In most cases, users
1427 * will have this enabled so the notification and ringer volumes will be
1428 * the same. However, power users can disable this and use the separate
1429 * notification volume control.
1430 * <p>
1431 * Note: This is a one-off setting that will be removed in the future
1432 * when there is profile support. For this reason, it is kept hidden
1433 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001434 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001435 * @hide
1436 */
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001437 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001438 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001439
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001440 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05001441 * Whether silent mode should allow vibration feedback. This is used
1442 * internally in AudioService and the Sound settings activity to
1443 * coordinate decoupling of vibrate and silent modes. This setting
1444 * will likely be removed in a future release with support for
1445 * audio/vibe feedback profiles.
1446 *
1447 * @hide
1448 */
1449 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
1450
1451 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001452 * The mapping of stream type (integer) to its setting.
1453 */
1454 public static final String[] VOLUME_SETTINGS = {
1455 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08001456 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001457 };
1458
1459 /**
1460 * Appended to various volume related settings to record the previous
1461 * values before they the settings were affected by a silent/vibrate
1462 * ringer mode change.
1463 */
1464 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
1465
1466 /**
1467 * Persistent store for the system-wide default ringtone URI.
1468 * <p>
1469 * If you need to play the default ringtone at any given time, it is recommended
1470 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
1471 * to the set default ringtone at the time of playing.
1472 *
1473 * @see #DEFAULT_RINGTONE_URI
1474 */
1475 public static final String RINGTONE = "ringtone";
1476
1477 /**
1478 * A {@link Uri} that will point to the current default ringtone at any
1479 * given time.
1480 * <p>
1481 * If the current default ringtone is in the DRM provider and the caller
1482 * does not have permission, the exception will be a
1483 * FileNotFoundException.
1484 */
1485 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
1486
1487 /**
1488 * Persistent store for the system-wide default notification sound.
1489 *
1490 * @see #RINGTONE
1491 * @see #DEFAULT_NOTIFICATION_URI
1492 */
1493 public static final String NOTIFICATION_SOUND = "notification_sound";
1494
1495 /**
1496 * A {@link Uri} that will point to the current default notification
1497 * sound at any given time.
1498 *
1499 * @see #DEFAULT_RINGTONE_URI
1500 */
1501 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
1502
1503 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07001504 * Persistent store for the system-wide default alarm alert.
1505 *
1506 * @see #RINGTONE
1507 * @see #DEFAULT_ALARM_ALERT_URI
1508 */
1509 public static final String ALARM_ALERT = "alarm_alert";
1510
1511 /**
1512 * A {@link Uri} that will point to the current default alarm alert at
1513 * any given time.
1514 *
1515 * @see #DEFAULT_ALARM_ALERT_URI
1516 */
1517 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
1518
1519 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07001520 * Persistent store for the system default media button event receiver.
1521 *
1522 * @hide
1523 */
1524 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
1525
1526 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001527 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
1528 */
1529 public static final String TEXT_AUTO_REPLACE = "auto_replace";
1530
1531 /**
1532 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
1533 */
1534 public static final String TEXT_AUTO_CAPS = "auto_caps";
1535
1536 /**
1537 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
1538 * feature converts two spaces to a "." and space.
1539 */
1540 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001541
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001542 /**
1543 * Setting to showing password characters in text editors. 1 = On, 0 = Off
1544 */
1545 public static final String TEXT_SHOW_PASSWORD = "show_password";
1546
1547 public static final String SHOW_GTALK_SERVICE_STATUS =
1548 "SHOW_GTALK_SERVICE_STATUS";
1549
1550 /**
1551 * Name of activity to use for wallpaper on the home screen.
1552 */
1553 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
1554
1555 /**
1556 * Value to specify if the user prefers the date, time and time zone
1557 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
1558 */
1559 public static final String AUTO_TIME = "auto_time";
1560
1561 /**
Amith Yamasaniad450be2010-09-16 16:47:00 -07001562 * Value to specify if the user prefers the time zone
1563 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
1564 */
1565 public static final String AUTO_TIME_ZONE = "auto_time_zone";
1566
1567 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001568 * Display times as 12 or 24 hours
1569 * 12
1570 * 24
1571 */
1572 public static final String TIME_12_24 = "time_12_24";
1573
1574 /**
1575 * Date format string
1576 * mm/dd/yyyy
1577 * dd/mm/yyyy
1578 * yyyy/mm/dd
1579 */
1580 public static final String DATE_FORMAT = "date_format";
1581
1582 /**
1583 * Whether the setup wizard has been run before (on first boot), or if
1584 * it still needs to be run.
1585 *
1586 * nonzero = it has been run in the past
1587 * 0 = it has not been run in the past
1588 */
1589 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
1590
1591 /**
1592 * Scaling factor for normal window animations. Setting to 0 will disable window
1593 * animations.
1594 */
1595 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
1596
1597 /**
1598 * Scaling factor for activity transition animations. Setting to 0 will disable window
1599 * animations.
1600 */
1601 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
1602
1603 /**
1604 * Scaling factor for normal window animations. Setting to 0 will disable window
1605 * animations.
1606 * @hide
1607 */
1608 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
1609
1610 /**
1611 * Control whether the accelerometer will be used to change screen
1612 * orientation. If 0, it will not be used unless explicitly requested
1613 * by the application; if 1, it will be used by default unless explicitly
1614 * disabled by the application.
1615 */
1616 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
1617
1618 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04001619 * Default screen rotation when no other policy applies.
1620 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
1621 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08001622 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04001623 *
1624 * @see Display#getRotation
1625 */
1626 public static final String USER_ROTATION = "user_rotation";
1627
1628 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001629 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
1630 * boolean (1 or 0).
1631 */
1632 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
1633
1634 /**
David Kraused0f67152009-06-13 18:01:13 -05001635 * CDMA only settings
1636 * DTMF tone type played by the dialer when dialing.
1637 * 0 = Normal
1638 * 1 = Long
1639 * @hide
1640 */
1641 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
1642
1643 /**
1644 * CDMA only settings
1645 * Emergency Tone 0 = Off
1646 * 1 = Alert
1647 * 2 = Vibrate
1648 * @hide
1649 */
1650 public static final String EMERGENCY_TONE = "emergency_tone";
1651
1652 /**
1653 * CDMA only settings
1654 * Whether the auto retry is enabled. The value is
1655 * boolean (1 or 0).
1656 * @hide
1657 */
1658 public static final String CALL_AUTO_RETRY = "call_auto_retry";
1659
1660 /**
1661 * Whether the hearing aid is enabled. The value is
1662 * boolean (1 or 0).
1663 * @hide
1664 */
1665 public static final String HEARING_AID = "hearing_aid";
1666
1667 /**
1668 * CDMA only settings
1669 * TTY Mode
1670 * 0 = OFF
1671 * 1 = FULL
1672 * 2 = VCO
1673 * 3 = HCO
1674 * @hide
1675 */
1676 public static final String TTY_MODE = "tty_mode";
1677
1678 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001679 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
1680 * boolean (1 or 0).
1681 */
1682 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001683
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001684 /**
1685 * Whether the haptic feedback (long presses, ...) are enabled. The value is
1686 * boolean (1 or 0).
1687 */
1688 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07001689
Mike LeBeau48603e72009-06-05 00:27:00 +01001690 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01001691 * @deprecated Each application that shows web suggestions should have its own
1692 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01001693 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01001694 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01001695 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001696
-b master501eec92009-07-06 13:53:11 -07001697 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08001698 * Whether the notification LED should repeatedly flash when a notification is
1699 * pending. The value is boolean (1 or 0).
1700 * @hide
1701 */
1702 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
1703
1704 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08001705 * Show pointer location on screen?
1706 * 0 = no
1707 * 1 = yes
1708 * @hide
1709 */
1710 public static final String POINTER_LOCATION = "pointer_location";
1711
1712 /**
Jeff Brown4519f072011-01-23 13:16:01 -08001713 * Log raw orientation data from {@link WindowOrientationListener} for use with the
1714 * orientationplot.py tool.
1715 * 0 = no
1716 * 1 = yes
1717 * @hide
1718 */
1719 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
1720 "window_orientation_listener_log";
1721
1722 /**
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05001723 * Whether to play a sound for low-battery alerts.
1724 * @hide
1725 */
1726 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
1727
1728 /**
1729 * Whether to play a sound for dock events.
1730 * @hide
1731 */
1732 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
1733
1734 /**
1735 * Whether to play sounds when the keyguard is shown and dismissed.
1736 * @hide
1737 */
1738 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
1739
1740 /**
1741 * URI for the low battery sound file.
1742 * @hide
1743 */
1744 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
1745
1746 /**
1747 * URI for the desk dock "in" event sound.
1748 * @hide
1749 */
1750 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
1751
1752 /**
1753 * URI for the desk dock "out" event sound.
1754 * @hide
1755 */
1756 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
1757
1758 /**
1759 * URI for the car dock "in" event sound.
1760 * @hide
1761 */
1762 public static final String CAR_DOCK_SOUND = "car_dock_sound";
1763
1764 /**
1765 * URI for the car dock "out" event sound.
1766 * @hide
1767 */
1768 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
1769
1770 /**
1771 * URI for the "device locked" (keyguard shown) sound.
1772 * @hide
1773 */
1774 public static final String LOCK_SOUND = "lock_sound";
1775
1776 /**
1777 * URI for the "device unlocked" (keyguard dismissed) sound.
1778 * @hide
1779 */
1780 public static final String UNLOCK_SOUND = "unlock_sound";
1781
1782 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08001783 * Receive incoming SIP calls?
1784 * 0 = no
1785 * 1 = yes
1786 * @hide
1787 */
1788 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
1789
1790 /**
1791 * Call Preference String.
1792 * "SIP_ALWAYS" : Always use SIP with network access
1793 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
1794 * "SIP_ASK_ME_EACH_TIME" : Always ask me each time
1795 * @hide
1796 */
1797 public static final String SIP_CALL_OPTIONS = "sip_call_options";
1798
1799 /**
1800 * One of the sip call options: Always use SIP with network access.
1801 * @hide
1802 */
1803 public static final String SIP_ALWAYS = "SIP_ALWAYS";
1804
1805 /**
1806 * One of the sip call options: Only if destination is a SIP address.
1807 * @hide
1808 */
1809 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
1810
1811 /**
1812 * One of the sip call options: Always ask me each time.
1813 * @hide
1814 */
1815 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
1816
1817 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07001818 * Pointer speed setting.
1819 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
1820 * -7 = slowest
1821 * 0 = default speed
1822 * +7 = fastest
1823 * @hide
1824 */
1825 public static final String POINTER_SPEED = "pointer_speed";
1826
1827 /**
-b master501eec92009-07-06 13:53:11 -07001828 * Settings to backup. This is here so that it's in the same place as the settings
1829 * keys and easy to update.
1830 * @hide
1831 */
1832 public static final String[] SETTINGS_TO_BACKUP = {
1833 STAY_ON_WHILE_PLUGGED_IN,
-b master501eec92009-07-06 13:53:11 -07001834 WIFI_USE_STATIC_IP,
1835 WIFI_STATIC_IP,
1836 WIFI_STATIC_GATEWAY,
1837 WIFI_STATIC_NETMASK,
1838 WIFI_STATIC_DNS1,
1839 WIFI_STATIC_DNS2,
1840 BLUETOOTH_DISCOVERABILITY,
1841 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
1842 DIM_SCREEN,
1843 SCREEN_OFF_TIMEOUT,
1844 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07001845 SCREEN_BRIGHTNESS_MODE,
-b master501eec92009-07-06 13:53:11 -07001846 VIBRATE_ON,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07001847 MODE_RINGER,
1848 MODE_RINGER_STREAMS_AFFECTED,
1849 MUTE_STREAMS_AFFECTED,
1850 VOLUME_VOICE,
1851 VOLUME_SYSTEM,
1852 VOLUME_RING,
1853 VOLUME_MUSIC,
1854 VOLUME_ALARM,
1855 VOLUME_NOTIFICATION,
Eric Laurent484d2882009-12-08 09:05:45 -08001856 VOLUME_BLUETOOTH_SCO,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07001857 VOLUME_VOICE + APPEND_FOR_LAST_AUDIBLE,
1858 VOLUME_SYSTEM + APPEND_FOR_LAST_AUDIBLE,
1859 VOLUME_RING + APPEND_FOR_LAST_AUDIBLE,
1860 VOLUME_MUSIC + APPEND_FOR_LAST_AUDIBLE,
1861 VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE,
1862 VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE,
Eric Laurent484d2882009-12-08 09:05:45 -08001863 VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE,
Daniel Sandler1c7fa482010-03-10 09:45:01 -05001864 VIBRATE_IN_SILENT,
-b master501eec92009-07-06 13:53:11 -07001865 TEXT_AUTO_REPLACE,
1866 TEXT_AUTO_CAPS,
1867 TEXT_AUTO_PUNCTUATE,
1868 TEXT_SHOW_PASSWORD,
1869 AUTO_TIME,
Amith Yamasaniad450be2010-09-16 16:47:00 -07001870 AUTO_TIME_ZONE,
-b master501eec92009-07-06 13:53:11 -07001871 TIME_12_24,
1872 DATE_FORMAT,
1873 ACCELEROMETER_ROTATION,
Daniel Sandlerb73617d2010-08-17 00:41:00 -04001874 USER_ROTATION,
-b master501eec92009-07-06 13:53:11 -07001875 DTMF_TONE_WHEN_DIALING,
1876 DTMF_TONE_TYPE_WHEN_DIALING,
1877 EMERGENCY_TONE,
1878 CALL_AUTO_RETRY,
1879 HEARING_AID,
1880 TTY_MODE,
1881 SOUND_EFFECTS_ENABLED,
1882 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate14c2d792010-02-25 16:49:44 -08001883 POWER_SOUNDS_ENABLED,
1884 DOCK_SOUNDS_ENABLED,
1885 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08001886 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04001887 NOTIFICATION_LIGHT_PULSE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08001888 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07001889 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07001890 POINTER_SPEED,
-b master501eec92009-07-06 13:53:11 -07001891 };
1892
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001893 // Settings moved to Settings.Secure
1894
1895 /**
Mike Lockwood460ae0c2009-04-02 22:33:27 -07001896 * @deprecated Use {@link android.provider.Settings.Secure#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001897 * instead
1898 */
1899 @Deprecated
1900 public static final String ADB_ENABLED = Secure.ADB_ENABLED;
1901
1902 /**
1903 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
1904 */
1905 @Deprecated
1906 public static final String ANDROID_ID = Secure.ANDROID_ID;
1907
1908 /**
1909 * @deprecated Use {@link android.provider.Settings.Secure#BLUETOOTH_ON} instead
1910 */
1911 @Deprecated
1912 public static final String BLUETOOTH_ON = Secure.BLUETOOTH_ON;
1913
1914 /**
1915 * @deprecated Use {@link android.provider.Settings.Secure#DATA_ROAMING} instead
1916 */
1917 @Deprecated
1918 public static final String DATA_ROAMING = Secure.DATA_ROAMING;
1919
1920 /**
1921 * @deprecated Use {@link android.provider.Settings.Secure#DEVICE_PROVISIONED} instead
1922 */
1923 @Deprecated
1924 public static final String DEVICE_PROVISIONED = Secure.DEVICE_PROVISIONED;
1925
1926 /**
1927 * @deprecated Use {@link android.provider.Settings.Secure#HTTP_PROXY} instead
1928 */
1929 @Deprecated
1930 public static final String HTTP_PROXY = Secure.HTTP_PROXY;
1931
1932 /**
1933 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
1934 */
1935 @Deprecated
1936 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001937
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001938 /**
1939 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
1940 * instead
1941 */
1942 @Deprecated
1943 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
1944
1945 /**
1946 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
1947 */
1948 @Deprecated
1949 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001950
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001951 /**
1952 * @deprecated Use {@link android.provider.Settings.Secure#NETWORK_PREFERENCE} instead
1953 */
1954 @Deprecated
1955 public static final String NETWORK_PREFERENCE = Secure.NETWORK_PREFERENCE;
1956
1957 /**
1958 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
1959 * instead
1960 */
1961 @Deprecated
1962 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
1963
1964 /**
1965 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
1966 * instead
1967 */
1968 @Deprecated
1969 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
1970
1971 /**
1972 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
1973 * instead
1974 */
1975 @Deprecated
1976 public static final String PARENTAL_CONTROL_REDIRECT_URL =
1977 Secure.PARENTAL_CONTROL_REDIRECT_URL;
1978
1979 /**
1980 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
1981 */
1982 @Deprecated
1983 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
1984
1985 /**
1986 * @deprecated Use {@link android.provider.Settings.Secure#USB_MASS_STORAGE_ENABLED} instead
1987 */
1988 @Deprecated
1989 public static final String USB_MASS_STORAGE_ENABLED = Secure.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001990
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001991 /**
1992 * @deprecated Use {@link android.provider.Settings.Secure#USE_GOOGLE_MAIL} instead
1993 */
1994 @Deprecated
1995 public static final String USE_GOOGLE_MAIL = Secure.USE_GOOGLE_MAIL;
1996
Dianne Hackborn4a51c202009-08-21 15:14:02 -07001997 /**
1998 * @deprecated Use
1999 * {@link android.provider.Settings.Secure#WIFI_MAX_DHCP_RETRY_COUNT} instead
2000 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002001 @Deprecated
2002 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Secure.WIFI_MAX_DHCP_RETRY_COUNT;
2003
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002004 /**
2005 * @deprecated Use
2006 * {@link android.provider.Settings.Secure#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
2007 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002008 @Deprecated
2009 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
2010 Secure.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
2011
2012 /**
2013 * @deprecated Use
2014 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
2015 */
2016 @Deprecated
2017 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
2018 Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
2019
2020 /**
2021 * @deprecated Use
2022 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
2023 */
2024 @Deprecated
2025 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
2026 Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002027
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002028 /**
2029 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_NUM_OPEN_NETWORKS_KEPT}
2030 * instead
2031 */
2032 @Deprecated
2033 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Secure.WIFI_NUM_OPEN_NETWORKS_KEPT;
2034
2035 /**
2036 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_ON} instead
2037 */
2038 @Deprecated
2039 public static final String WIFI_ON = Secure.WIFI_ON;
2040
2041 /**
2042 * @deprecated Use
2043 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
2044 * instead
2045 */
2046 @Deprecated
2047 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
2048 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
2049
2050 /**
2051 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
2052 */
2053 @Deprecated
2054 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
2055
2056 /**
2057 * @deprecated Use
2058 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
2059 */
2060 @Deprecated
2061 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
2062 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002063
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002064 /**
2065 * @deprecated Use
2066 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
2067 */
2068 @Deprecated
2069 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
2070 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
2071
2072 /**
2073 * @deprecated Use
2074 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
2075 * instead
2076 */
2077 @Deprecated
2078 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
2079 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
2080
2081 /**
2082 * @deprecated Use
2083 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
2084 */
2085 @Deprecated
2086 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
2087 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
2088
2089 /**
2090 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
2091 * instead
2092 */
2093 @Deprecated
2094 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
2095
2096 /**
2097 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ON} instead
2098 */
2099 @Deprecated
2100 public static final String WIFI_WATCHDOG_ON = Secure.WIFI_WATCHDOG_ON;
2101
2102 /**
2103 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
2104 */
2105 @Deprecated
2106 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
2107
2108 /**
2109 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
2110 * instead
2111 */
2112 @Deprecated
2113 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
2114
2115 /**
2116 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
2117 * instead
2118 */
2119 @Deprecated
2120 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
2121 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
2122 }
2123
2124 /**
2125 * Secure system settings, containing system preferences that applications
2126 * can read but are not allowed to write. These are for preferences that
2127 * the user must explicitly modify through the system UI or specialized
2128 * APIs for those values, not modified directly by applications.
2129 */
2130 public static final class Secure extends NameValueTable {
2131 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
2132
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002133 // Populated lazily, guarded by class object:
2134 private static NameValueCache sNameValueCache = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002135
2136 /**
2137 * Look up a name in the database.
2138 * @param resolver to access the database with
2139 * @param name to look up in the table
2140 * @return the corresponding value, or null if not present
2141 */
2142 public synchronized static String getString(ContentResolver resolver, String name) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002143 if (sNameValueCache == null) {
2144 sNameValueCache = new NameValueCache(SYS_PROP_SETTING_VERSION, CONTENT_URI,
2145 CALL_METHOD_GET_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002146 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002147 return sNameValueCache.getString(resolver, name);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002148 }
2149
2150 /**
2151 * Store a name/value pair into the database.
2152 * @param resolver to access the database with
2153 * @param name to store
2154 * @param value to associate with the name
2155 * @return true if the value was set, false on database errors
2156 */
2157 public static boolean putString(ContentResolver resolver,
2158 String name, String value) {
2159 return putString(resolver, CONTENT_URI, name, value);
2160 }
2161
2162 /**
2163 * Construct the content URI for a particular name/value pair,
2164 * useful for monitoring changes with a ContentObserver.
2165 * @param name to look up in the table
2166 * @return the corresponding content URI, or null if not present
2167 */
2168 public static Uri getUriFor(String name) {
2169 return getUriFor(CONTENT_URI, name);
2170 }
2171
2172 /**
2173 * Convenience function for retrieving a single secure settings value
2174 * as an integer. Note that internally setting values are always
2175 * stored as strings; this function converts the string to an integer
2176 * for you. The default value will be returned if the setting is
2177 * not defined or not an integer.
2178 *
2179 * @param cr The ContentResolver to access.
2180 * @param name The name of the setting to retrieve.
2181 * @param def Value to return if the setting is not defined.
2182 *
2183 * @return The setting's current value, or 'def' if it is not defined
2184 * or not a valid integer.
2185 */
2186 public static int getInt(ContentResolver cr, String name, int def) {
2187 String v = getString(cr, name);
2188 try {
2189 return v != null ? Integer.parseInt(v) : def;
2190 } catch (NumberFormatException e) {
2191 return def;
2192 }
2193 }
2194
2195 /**
2196 * Convenience function for retrieving a single secure settings value
2197 * as an integer. Note that internally setting values are always
2198 * stored as strings; this function converts the string to an integer
2199 * for you.
2200 * <p>
2201 * This version does not take a default value. If the setting has not
2202 * been set, or the string value is not a number,
2203 * it throws {@link SettingNotFoundException}.
2204 *
2205 * @param cr The ContentResolver to access.
2206 * @param name The name of the setting to retrieve.
2207 *
2208 * @throws SettingNotFoundException Thrown if a setting by the given
2209 * name can't be found or the setting value is not an integer.
2210 *
2211 * @return The setting's current value.
2212 */
2213 public static int getInt(ContentResolver cr, String name)
2214 throws SettingNotFoundException {
2215 String v = getString(cr, name);
2216 try {
2217 return Integer.parseInt(v);
2218 } catch (NumberFormatException e) {
2219 throw new SettingNotFoundException(name);
2220 }
2221 }
2222
2223 /**
2224 * Convenience function for updating a single settings value as an
2225 * integer. This will either create a new entry in the table if the
2226 * given name does not exist, or modify the value of the existing row
2227 * with that name. Note that internally setting values are always
2228 * stored as strings, so this function converts the given value to a
2229 * string before storing it.
2230 *
2231 * @param cr The ContentResolver to access.
2232 * @param name The name of the setting to modify.
2233 * @param value The new value for the setting.
2234 * @return true if the value was set, false on database errors
2235 */
2236 public static boolean putInt(ContentResolver cr, String name, int value) {
2237 return putString(cr, name, Integer.toString(value));
2238 }
2239
2240 /**
2241 * Convenience function for retrieving a single secure settings value
2242 * as a {@code long}. Note that internally setting values are always
2243 * stored as strings; this function converts the string to a {@code long}
2244 * for you. The default value will be returned if the setting is
2245 * not defined or not a {@code long}.
2246 *
2247 * @param cr The ContentResolver to access.
2248 * @param name The name of the setting to retrieve.
2249 * @param def Value to return if the setting is not defined.
2250 *
2251 * @return The setting's current value, or 'def' if it is not defined
2252 * or not a valid {@code long}.
2253 */
2254 public static long getLong(ContentResolver cr, String name, long def) {
2255 String valString = getString(cr, name);
2256 long value;
2257 try {
2258 value = valString != null ? Long.parseLong(valString) : def;
2259 } catch (NumberFormatException e) {
2260 value = def;
2261 }
2262 return value;
2263 }
2264
2265 /**
2266 * Convenience function for retrieving a single secure settings value
2267 * as a {@code long}. Note that internally setting values are always
2268 * stored as strings; this function converts the string to a {@code long}
2269 * for you.
2270 * <p>
2271 * This version does not take a default value. If the setting has not
2272 * been set, or the string value is not a number,
2273 * it throws {@link SettingNotFoundException}.
2274 *
2275 * @param cr The ContentResolver to access.
2276 * @param name The name of the setting to retrieve.
2277 *
2278 * @return The setting's current value.
2279 * @throws SettingNotFoundException Thrown if a setting by the given
2280 * name can't be found or the setting value is not an integer.
2281 */
2282 public static long getLong(ContentResolver cr, String name)
2283 throws SettingNotFoundException {
2284 String valString = getString(cr, name);
2285 try {
2286 return Long.parseLong(valString);
2287 } catch (NumberFormatException e) {
2288 throw new SettingNotFoundException(name);
2289 }
2290 }
2291
2292 /**
2293 * Convenience function for updating a secure settings value as a long
2294 * integer. This will either create a new entry in the table if the
2295 * given name does not exist, or modify the value of the existing row
2296 * with that name. Note that internally setting values are always
2297 * stored as strings, so this function converts the given value to a
2298 * string before storing it.
2299 *
2300 * @param cr The ContentResolver to access.
2301 * @param name The name of the setting to modify.
2302 * @param value The new value for the setting.
2303 * @return true if the value was set, false on database errors
2304 */
2305 public static boolean putLong(ContentResolver cr, String name, long value) {
2306 return putString(cr, name, Long.toString(value));
2307 }
2308
2309 /**
2310 * Convenience function for retrieving a single secure settings value
2311 * as a floating point number. Note that internally setting values are
2312 * always stored as strings; this function converts the string to an
2313 * float for you. The default value will be returned if the setting
2314 * is not defined or not a valid float.
2315 *
2316 * @param cr The ContentResolver to access.
2317 * @param name The name of the setting to retrieve.
2318 * @param def Value to return if the setting is not defined.
2319 *
2320 * @return The setting's current value, or 'def' if it is not defined
2321 * or not a valid float.
2322 */
2323 public static float getFloat(ContentResolver cr, String name, float def) {
2324 String v = getString(cr, name);
2325 try {
2326 return v != null ? Float.parseFloat(v) : def;
2327 } catch (NumberFormatException e) {
2328 return def;
2329 }
2330 }
2331
2332 /**
2333 * Convenience function for retrieving a single secure settings value
2334 * as a float. Note that internally setting values are always
2335 * stored as strings; this function converts the string to a float
2336 * for you.
2337 * <p>
2338 * This version does not take a default value. If the setting has not
2339 * been set, or the string value is not a number,
2340 * it throws {@link SettingNotFoundException}.
2341 *
2342 * @param cr The ContentResolver to access.
2343 * @param name The name of the setting to retrieve.
2344 *
2345 * @throws SettingNotFoundException Thrown if a setting by the given
2346 * name can't be found or the setting value is not a float.
2347 *
2348 * @return The setting's current value.
2349 */
2350 public static float getFloat(ContentResolver cr, String name)
2351 throws SettingNotFoundException {
2352 String v = getString(cr, name);
Brian Muramatsue1d46982010-12-06 17:34:20 -08002353 if (v == null) {
2354 throw new SettingNotFoundException(name);
2355 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002356 try {
2357 return Float.parseFloat(v);
2358 } catch (NumberFormatException e) {
2359 throw new SettingNotFoundException(name);
2360 }
2361 }
2362
2363 /**
2364 * Convenience function for updating a single settings value as a
2365 * floating point number. This will either create a new entry in the
2366 * table if the given name does not exist, or modify the value of the
2367 * existing row with that name. Note that internally setting values
2368 * are always stored as strings, so this function converts the given
2369 * value to a string before storing it.
2370 *
2371 * @param cr The ContentResolver to access.
2372 * @param name The name of the setting to modify.
2373 * @param value The new value for the setting.
2374 * @return true if the value was set, false on database errors
2375 */
2376 public static boolean putFloat(ContentResolver cr, String name, float value) {
2377 return putString(cr, name, Float.toString(value));
2378 }
2379
2380 /**
2381 * The content:// style URL for this table
2382 */
2383 public static final Uri CONTENT_URI =
2384 Uri.parse("content://" + AUTHORITY + "/secure");
2385
2386 /**
2387 * Whether ADB is enabled.
2388 */
2389 public static final String ADB_ENABLED = "adb_enabled";
2390
2391 /**
2392 * Setting to allow mock locations and location provider status to be injected into the
2393 * LocationManager service for testing purposes during application development. These
2394 * locations and status values override actual location and status information generated
2395 * by network, gps, or other location providers.
2396 */
2397 public static final String ALLOW_MOCK_LOCATION = "mock_location";
2398
2399 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08002400 * A 64-bit number (as a hex string) that is randomly
2401 * generated on the device's first boot and should remain
2402 * constant for the lifetime of the device. (The value may
2403 * change if a factory reset is performed on the device.)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002404 */
2405 public static final String ANDROID_ID = "android_id";
2406
2407 /**
2408 * Whether bluetooth is enabled/disabled
2409 * 0=disabled. 1=enabled.
2410 */
2411 public static final String BLUETOOTH_ON = "bluetooth_on";
2412
2413 /**
2414 * Get the key that retrieves a bluetooth headset's priority.
2415 * @hide
2416 */
2417 public static final String getBluetoothHeadsetPriorityKey(String address) {
2418 return ("bluetooth_headset_priority_" + address.toUpperCase());
2419 }
2420
2421 /**
2422 * Get the key that retrieves a bluetooth a2dp sink's priority.
2423 * @hide
2424 */
2425 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
2426 return ("bluetooth_a2dp_sink_priority_" + address.toUpperCase());
2427 }
2428
2429 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002430 * Get the key that retrieves a bluetooth Input Device's priority.
2431 * @hide
2432 */
2433 public static final String getBluetoothInputDevicePriorityKey(String address) {
2434 return ("bluetooth_input_device_priority_" + address.toUpperCase());
2435 }
2436
2437 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002438 * Whether or not data roaming is enabled. (0 = false, 1 = true)
2439 */
2440 public static final String DATA_ROAMING = "data_roaming";
2441
2442 /**
2443 * Setting to record the input method used by default, holding the ID
2444 * of the desired method.
2445 */
2446 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
2447
2448 /**
satokab751aa2010-09-14 19:17:36 +09002449 * Setting to record the input method subtype used by default, holding the ID
2450 * of the desired method.
2451 */
2452 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
2453 "selected_input_method_subtype";
2454
2455 /**
satok723a27e2010-11-11 14:58:11 +09002456 * Setting to record the history of input method subtype, holding the pair of ID of IME
2457 * and its last used subtype.
2458 * @hide
2459 */
2460 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
2461 "input_methods_subtype_history";
2462
2463 /**
satok5c58dfc2010-12-14 21:54:47 +09002464 * Setting to record the visibility of input method selector
2465 */
2466 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
2467 "input_method_selector_visibility";
2468
2469 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002470 * Whether the device has been provisioned (0 = false, 1 = true)
2471 */
2472 public static final String DEVICE_PROVISIONED = "device_provisioned";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002473
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002474 /**
2475 * List of input methods that are currently enabled. This is a string
2476 * containing the IDs of all enabled input methods, each ID separated
2477 * by ':'.
2478 */
2479 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002480
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002481 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07002482 * List of system input methods that are currently disabled. This is a string
2483 * containing the IDs of all disabled input methods, each ID separated
2484 * by ':'.
2485 * @hide
2486 */
2487 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
2488
2489 /**
Robert Greenwalt434203a2010-10-11 16:00:27 -07002490 * Host name and port for global http proxy. Uses ':' seperator for between host and port
2491 * TODO - deprecate in favor of global_http_proxy_host, etc
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002492 */
2493 public static final String HTTP_PROXY = "http_proxy";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002494
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002495 /**
Robert Greenwalt434203a2010-10-11 16:00:27 -07002496 * Host name for global http proxy. Set via ConnectivityManager.
2497 * @hide
2498 */
2499 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
2500
2501 /**
2502 * Integer host port for global http proxy. Set via ConnectivityManager.
2503 * @hide
2504 */
2505 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
2506
2507 /**
Oscar Montemayor16fb7912010-08-02 09:38:48 -07002508 * Exclusion list for global proxy. This string contains a list of comma-separated
2509 * domains where the global proxy does not apply. Domains should be listed in a comma-
2510 * separated list. Example of acceptable formats: ".domain1.com,my.domain2.com"
Robert Greenwalt434203a2010-10-11 16:00:27 -07002511 * Use ConnectivityManager to set/get.
Oscar Montemayor16fb7912010-08-02 09:38:48 -07002512 * @hide
2513 */
Robert Greenwalt434203a2010-10-11 16:00:27 -07002514 public static final String GLOBAL_HTTP_PROXY_EXCLUSION_LIST =
2515 "global_http_proxy_exclusion_list";
Oscar Montemayor16fb7912010-08-02 09:38:48 -07002516
2517 /**
2518 * Enables the UI setting to allow the user to specify the global HTTP proxy
2519 * and associated exclusion list.
2520 * @hide
2521 */
2522 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
2523
2524 /**
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07002525 * Setting for default DNS in case nobody suggests one
2526 * @hide
2527 */
2528 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
2529
2530 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002531 * Whether the package installer should allow installation of apps downloaded from
2532 * sources other than the Android Market (vending machine).
2533 *
2534 * 1 = allow installing from other sources
2535 * 0 = only allow installing from the Android Market
2536 */
2537 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002538
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002539 /**
2540 * Comma-separated list of location providers that activities may access.
2541 */
2542 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002543
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002544 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002545 * Whether autolock is enabled (0 = false, 1 = true)
2546 */
2547 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
2548
2549 /**
2550 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
2551 */
2552 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2553
2554 /**
2555 * Whether lock pattern will vibrate as user enters (0 = false, 1 = true)
2556 */
2557 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2558 "lock_pattern_tactile_feedback_enabled";
2559
2560 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07002561 * This preference allows the device to be locked given time after screen goes off,
2562 * subject to current DeviceAdmin policy limits.
2563 * @hide
2564 */
2565 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
2566
2567
2568 /**
Jim Miller253a5ef2010-10-13 20:57:29 -07002569 * This preference contains the string that shows for owner info on LockScren.
2570 * @hide
2571 */
2572 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
2573
2574 /**
2575 * This preference enables showing the owner info on LockScren.
2576 * @hide
2577 */
2578 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
2579 "lock_screen_owner_info_enabled";
2580
2581 /**
Joe Onorato571ae902011-05-24 13:48:43 -07002582 * The saved value for WindowManagerService.setForcedDisplaySize().
2583 * Two integers separated by a comma. If unset, then use the real display size.
2584 * @hide
2585 */
2586 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
2587
2588 /**
Mike Lockwoodbcab8df2009-06-25 16:39:09 -04002589 * Whether assisted GPS should be enabled or not.
2590 * @hide
2591 */
2592 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
2593
2594 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002595 * The Logging ID (a unique 64-bit value) as a hex string.
2596 * Used as a pseudonymous identifier for logging.
2597 * @deprecated This identifier is poorly initialized and has
2598 * many collisions. It should not be used.
2599 */
2600 @Deprecated
2601 public static final String LOGGING_ID = "logging_id";
2602
2603 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002604 * User preference for which network(s) should be used. Only the
2605 * connectivity service should touch this.
2606 */
2607 public static final String NETWORK_PREFERENCE = "network_preference";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002608
2609 /**
Robert Greenwalt2a091d72010-02-11 18:18:40 -08002610 * Used to disable Tethering on a device - defaults to true
2611 * @hide
2612 */
2613 public static final String TETHER_SUPPORTED = "tether_supported";
2614
2615 /**
Robert Greenwalt77b32dd2010-06-03 18:57:26 -07002616 * Used to require DUN APN on the device or not - defaults to a build config value
2617 * which defaults to false
2618 * @hide
2619 */
2620 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
2621
2622 /**
2623 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
2624 * corresponding build config values are set it will override the APN DB
2625 * values.
2626 * Consists of a comma seperated list of strings:
2627 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
2628 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
2629 * @hide
2630 */
2631 public static final String TETHER_DUN_APN = "tether_dun_apn";
2632
2633 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08002634 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002635 */
2636 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002637
2638 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08002639 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002640 */
2641 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002642
2643 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08002644 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002645 */
2646 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002647
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002648 /**
Brad Fitzpatrickd7ad0d22010-12-02 15:30:23 -08002649 * A positive value indicates how often the SamplingProfiler
2650 * should take snapshots. Zero value means SamplingProfiler
2651 * is disabled.
Sen Hubde75702010-05-28 01:54:03 -07002652 *
2653 * @hide
2654 */
Brad Fitzpatrickd7ad0d22010-12-02 15:30:23 -08002655 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
Sen Hubde75702010-05-28 01:54:03 -07002656
2657 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002658 * Settings classname to launch when Settings is clicked from All
2659 * Applications. Needed because of user testing between the old
2660 * and new Settings apps.
2661 */
2662 // TODO: 881807
2663 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002664
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002665 /**
2666 * USB Mass Storage Enabled
2667 */
2668 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002669
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002670 /**
2671 * If this setting is set (to anything), then all references
2672 * to Gmail on the device must change to Google Mail.
2673 */
2674 public static final String USE_GOOGLE_MAIL = "use_google_mail";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002675
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002676 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07002677 * If accessibility is enabled.
2678 */
2679 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
2680
2681 /**
2682 * List of the enabled accessibility providers.
2683 */
2684 public static final String ENABLED_ACCESSIBILITY_SERVICES =
2685 "enabled_accessibility_services";
2686
2687 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07002688 * If injection of accessibility enhancing JavaScript scripts
2689 * is enabled.
2690 * <p>
2691 * Note: Accessibility injecting scripts are served by the
2692 * Google infrastructure and enable users with disabilities to
2693 * efficiantly navigate in and explore web content.
2694 * </p>
2695 * <p>
2696 * This property represents a boolean value.
2697 * </p>
2698 * @hide
2699 */
2700 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
2701 "accessibility_script_injection";
2702
2703 /**
2704 * Key bindings for navigation in built-in accessibility support for web content.
2705 * <p>
2706 * Note: These key bindings are for the built-in accessibility navigation for
2707 * web content which is used as a fall back solution if JavaScript in a WebView
2708 * is not enabled or the user has not opted-in script injection from Google.
2709 * </p>
2710 * <p>
2711 * The bindings are separated by semi-colon. A binding is a mapping from
2712 * a key to a sequence of actions (for more details look at
2713 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
2714 * string representation of an integer obtained from a meta state (optional) shifted
2715 * sixteen times left and bitwise ored with a key code. An action is represented
2716 * as a hexademical string representation of an integer where the first two digits
2717 * are navigation action index, the second, the third, and the fourth digit pairs
2718 * represent the action arguments. The separate actions in a binding are colon
2719 * separated. The key and the action sequence it maps to are separated by equals.
2720 * </p>
2721 * <p>
2722 * For example, the binding below maps the DPAD right button to traverse the
2723 * current navigation axis once without firing an accessibility event and to
2724 * perform the same traversal again but to fire an event:
2725 * <code>
2726 * 0x16=0x01000100:0x01000101;
2727 * </code>
2728 * </p>
2729 * <p>
2730 * The goal of this binding is to enable dynamic rebinding of keys to
2731 * navigation actions for web content without requiring a framework change.
2732 * </p>
2733 * <p>
2734 * This property represents a string value.
2735 * </p>
2736 * @hide
2737 */
2738 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
2739 "accessibility_web_content_key_bindings";
2740
2741 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08002742 * The timout for considering a press to be a long press in milliseconds.
2743 * @hide
2744 */
2745 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
2746
2747 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07002748 * Setting to always use the default text-to-speech settings regardless
2749 * of the application settings.
2750 * 1 = override application settings,
2751 * 0 = use application settings (if specified).
2752 */
2753 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
2754
2755 /**
2756 * Default text-to-speech engine speech rate. 100 = 1x
2757 */
2758 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
2759
2760 /**
2761 * Default text-to-speech engine pitch. 100 = 1x
2762 */
2763 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
2764
2765 /**
2766 * Default text-to-speech engine.
2767 */
2768 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
2769
2770 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07002771 * Default text-to-speech language.
2772 */
2773 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
2774
2775 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07002776 * Default text-to-speech country.
2777 */
2778 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
2779
2780 /**
2781 * Default text-to-speech locale variant.
2782 */
2783 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
2784
2785 /**
Charles Chenceffa152010-03-16 21:18:10 -07002786 * Space delimited list of plugin packages that are enabled.
2787 */
2788 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
2789
2790 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002791 * Whether to notify the user of open networks.
2792 * <p>
2793 * If not connected and the scan results have an open network, we will
2794 * put this notification up. If we attempt to connect to a network or
2795 * the open network(s) disappear, we remove the notification. When we
2796 * show the notification, we will not show it again for
2797 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
2798 */
2799 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
2800 "wifi_networks_available_notification_on";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002801
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002802 /**
2803 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
2804 * Connecting to a network will reset the timer.
2805 */
2806 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
2807 "wifi_networks_available_repeat_delay";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002808
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002809 /**
Irfan Sheriffed4f28b2010-10-29 15:32:10 -07002810 * 802.11 country code in ISO 3166 format
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002811 * @hide
2812 */
Irfan Sheriffed4f28b2010-10-29 15:32:10 -07002813 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
2814
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002815
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002816 /**
2817 * When the number of open networks exceeds this number, the
2818 * least-recently-used excess networks will be removed.
2819 */
2820 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002821
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002822 /**
2823 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
2824 */
2825 public static final String WIFI_ON = "wifi_on";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002826
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002827 /**
Irfan Sheriffa3bd4092010-03-24 17:58:59 -07002828 * Used to save the Wifi_ON state prior to tethering.
2829 * This state will be checked to restore Wifi after
2830 * the user turns off tethering.
Irfan Sheriff5321aef2010-02-12 12:35:59 -08002831 *
2832 * @hide
2833 */
Irfan Sheriffa3bd4092010-03-24 17:58:59 -07002834 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
Irfan Sheriff5321aef2010-02-12 12:35:59 -08002835
2836 /**
Irfan Sheriff9ab518ad2010-03-12 15:48:17 -08002837 * AP SSID
2838 *
2839 * @hide
2840 */
2841 public static final String WIFI_AP_SSID = "wifi_ap_ssid";
2842
2843 /**
2844 * AP security
2845 *
2846 * @hide
2847 */
2848 public static final String WIFI_AP_SECURITY = "wifi_ap_security";
2849
2850 /**
2851 * AP passphrase
2852 *
2853 * @hide
2854 */
2855 public static final String WIFI_AP_PASSWD = "wifi_ap_passwd";
2856
2857 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002858 * The acceptable packet loss percentage (range 0 - 100) before trying
2859 * another AP on the same network.
2860 */
2861 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
2862 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002863
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002864 /**
2865 * The number of access points required for a network in order for the
2866 * watchdog to monitor it.
2867 */
2868 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002869
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002870 /**
2871 * The delay between background checks.
2872 */
2873 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
2874 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002875
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002876 /**
2877 * Whether the Wi-Fi watchdog is enabled for background checking even
2878 * after it thinks the user has connected to a good access point.
2879 */
2880 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
2881 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002882
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002883 /**
2884 * The timeout for a background ping
2885 */
2886 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
2887 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002888
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002889 /**
2890 * The number of initial pings to perform that *may* be ignored if they
2891 * fail. Again, if these fail, they will *not* be used in packet loss
2892 * calculation. For example, one network always seemed to time out for
2893 * the first couple pings, so this is set to 3 by default.
2894 */
2895 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
2896 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002897
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002898 /**
2899 * The maximum number of access points (per network) to attempt to test.
2900 * If this number is reached, the watchdog will no longer monitor the
2901 * initial connection state for the network. This is a safeguard for
2902 * networks containing multiple APs whose DNS does not respond to pings.
2903 */
2904 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002905
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002906 /**
2907 * Whether the Wi-Fi watchdog is enabled.
2908 */
2909 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
2910
2911 /**
2912 * 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 -08002913 */
2914 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
2915
2916 /**
2917 * The number of pings to test if an access point is a good connection.
2918 */
2919 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002920
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002921 /**
2922 * The delay between pings.
2923 */
2924 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002925
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002926 /**
2927 * The timeout per ping.
2928 */
2929 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002930
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002931 /**
Irfan Sheriff5ea65d62011-06-05 21:29:56 -07002932 * Setting to turn off walled garden test on Wi-Fi. Feature is enabled by default and
2933 * the setting needs to be set to 0 to disable it.
2934 * @hide
2935 */
2936 public static final String WIFI_WATCHDOG_WALLED_GARDEN_TEST_ENABLED =
2937 "wifi_watchdog_walled_garden_test_enabled";
2938
2939 /**
2940 * The URL used for walled garden check upon a new conection. WifiWatchdogService
2941 * fetches the URL and checks to see if {@link #WIFI_WATCHDOG_WALLED_GARDEN_PATTERN}
2942 * is not part of the title string to notify the user on the presence of a walled garden.
2943 * @hide
2944 */
2945 public static final String WIFI_WATCHDOG_WALLED_GARDEN_URL =
2946 "wifi_watchdog_walled_garden_url";
2947
2948 /**
2949 * The pattern string in the fetched URL used to detect a walled garden
2950 * @hide
2951 */
2952 public static final String WIFI_WATCHDOG_WALLED_GARDEN_PATTERN =
2953 "wifi_watchdog_walled_garden_pattern";
2954
2955 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002956 * The maximum number of times we will retry a connection to an access
2957 * point for which we have failed in acquiring an IP address from DHCP.
2958 * 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 -08002959 */
2960 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002961
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002962 /**
Irfan Sheriff36f74132010-11-04 16:57:37 -07002963 * The operational wifi frequency band
2964 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
2965 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
2966 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
2967 *
2968 * @hide
2969 */
2970 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
2971
2972 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002973 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
2974 * data connectivity to be established after a disconnect from Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002975 */
2976 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
2977 "wifi_mobile_data_transition_wakelock_timeout_ms";
2978
2979 /**
2980 * Whether background data usage is allowed by the user. See
2981 * ConnectivityManager for more info.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002982 */
2983 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07002984
2985 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00002986 * Origins for which browsers should allow geolocation by default.
2987 * The value is a space-separated list of origins.
2988 */
2989 public static final String ALLOWED_GEOLOCATION_ORIGINS
2990 = "allowed_geolocation_origins";
2991
2992 /**
Robert Greenwaltc03fa502010-02-23 18:58:05 -08002993 * Whether mobile data connections are allowed by the user. See
2994 * ConnectivityManager for more info.
2995 * @hide
2996 */
2997 public static final String MOBILE_DATA = "mobile_data";
2998
2999 /**
Wink Saville04e71b32009-04-02 11:00:54 -07003000 * The CDMA roaming mode 0 = Home Networks, CDMA default
3001 * 1 = Roaming on Affiliated networks
3002 * 2 = Roaming on any networks
3003 * @hide
3004 */
3005 public static final String CDMA_ROAMING_MODE = "roaming_settings";
3006
3007 /**
3008 * The CDMA subscription mode 0 = RUIM/SIM (default)
3009 * 1 = NV
3010 * @hide
3011 */
3012 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
3013
3014 /**
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003015 * The preferred network mode 7 = Global
3016 * 6 = EvDo only
3017 * 5 = CDMA w/o EvDo
3018 * 4 = CDMA / EvDo auto
3019 * 3 = GSM / WCDMA auto
3020 * 2 = WCDMA only
3021 * 1 = GSM only
3022 * 0 = GSM / WCDMA preferred
Wink Saville04e71b32009-04-02 11:00:54 -07003023 * @hide
3024 */
3025 public static final String PREFERRED_NETWORK_MODE =
3026 "preferred_network_mode";
3027
3028 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07003029 * The preferred TTY mode 0 = TTy Off, CDMA default
3030 * 1 = TTY Full
3031 * 2 = TTY HCO
3032 * 3 = TTY VCO
3033 * @hide
3034 */
3035 public static final String PREFERRED_TTY_MODE =
3036 "preferred_tty_mode";
3037
3038
3039 /**
Wink Saville04e71b32009-04-02 11:00:54 -07003040 * CDMA Cell Broadcast SMS
3041 * 0 = CDMA Cell Broadcast SMS disabled
3042 * 1 = CDMA Cell Broadcast SMS enabled
3043 * @hide
3044 */
3045 public static final String CDMA_CELL_BROADCAST_SMS =
3046 "cdma_cell_broadcast_sms";
3047
3048 /**
3049 * The cdma subscription 0 = Subscription from RUIM, when available
3050 * 1 = Subscription from NV
3051 * @hide
3052 */
3053 public static final String PREFERRED_CDMA_SUBSCRIPTION =
3054 "preferred_cdma_subscription";
3055
3056 /**
3057 * Whether the enhanced voice privacy mode is enabled.
3058 * 0 = normal voice privacy
3059 * 1 = enhanced voice privacy
3060 * @hide
3061 */
3062 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
3063
3064 /**
3065 * Whether the TTY mode mode is enabled.
3066 * 0 = disabled
3067 * 1 = enabled
3068 * @hide
3069 */
3070 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003071
3072 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07003073 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07003074 * Type: int ( 0 = disabled, 1 = enabled )
3075 * @hide
3076 */
3077 public static final String BACKUP_ENABLED = "backup_enabled";
3078
3079 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08003080 * Controls whether application data is automatically restored from backup
3081 * at install time.
3082 * Type: int ( 0 = disabled, 1 = enabled )
3083 * @hide
3084 */
3085 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
3086
3087 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07003088 * Indicates whether settings backup has been fully provisioned.
3089 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
3090 * @hide
3091 */
3092 public static final String BACKUP_PROVISIONED = "backup_provisioned";
3093
3094 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07003095 * Component of the transport to use for backup/restore.
3096 * @hide
3097 */
3098 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07003099
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07003100 /**
3101 * Version for which the setup wizard was last shown. Bumped for
3102 * each release when there is new setup information to show.
3103 * @hide
3104 */
3105 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07003106
3107 /**
Doug Zongkerf6888892010-01-06 16:38:14 -08003108 * How frequently (in seconds) to check the memory status of the
3109 * device.
3110 * @hide
3111 */
3112 public static final String MEMCHECK_INTERVAL = "memcheck_interval";
3113
3114 /**
3115 * Max frequency (in seconds) to log memory check stats, in realtime
3116 * seconds. This allows for throttling of logs when the device is
3117 * running for large amounts of time.
3118 * @hide
3119 */
3120 public static final String MEMCHECK_LOG_REALTIME_INTERVAL =
3121 "memcheck_log_realtime_interval";
3122
3123 /**
3124 * Boolean indicating whether rebooting due to system memory checks
3125 * is enabled.
3126 * @hide
3127 */
3128 public static final String MEMCHECK_SYSTEM_ENABLED = "memcheck_system_enabled";
3129
3130 /**
3131 * How many bytes the system process must be below to avoid scheduling
3132 * a soft reboot. This reboot will happen when it is next determined
3133 * to be a good time.
3134 * @hide
3135 */
3136 public static final String MEMCHECK_SYSTEM_SOFT_THRESHOLD = "memcheck_system_soft";
3137
3138 /**
3139 * How many bytes the system process must be below to avoid scheduling
3140 * a hard reboot. This reboot will happen immediately.
3141 * @hide
3142 */
3143 public static final String MEMCHECK_SYSTEM_HARD_THRESHOLD = "memcheck_system_hard";
3144
3145 /**
3146 * How many bytes the phone process must be below to avoid scheduling
3147 * a soft restart. This restart will happen when it is next determined
3148 * to be a good time.
3149 * @hide
3150 */
3151 public static final String MEMCHECK_PHONE_SOFT_THRESHOLD = "memcheck_phone_soft";
3152
3153 /**
3154 * How many bytes the phone process must be below to avoid scheduling
3155 * a hard restart. This restart will happen immediately.
3156 * @hide
3157 */
3158 public static final String MEMCHECK_PHONE_HARD_THRESHOLD = "memcheck_phone_hard";
3159
3160 /**
3161 * Boolean indicating whether restarting the phone process due to
3162 * memory checks is enabled.
3163 * @hide
3164 */
3165 public static final String MEMCHECK_PHONE_ENABLED = "memcheck_phone_enabled";
3166
3167 /**
3168 * First time during the day it is okay to kill processes
3169 * or reboot the device due to low memory situations. This number is
3170 * in seconds since midnight.
3171 * @hide
3172 */
3173 public static final String MEMCHECK_EXEC_START_TIME = "memcheck_exec_start_time";
3174
3175 /**
3176 * Last time during the day it is okay to kill processes
3177 * or reboot the device due to low memory situations. This number is
3178 * in seconds since midnight.
3179 * @hide
3180 */
3181 public static final String MEMCHECK_EXEC_END_TIME = "memcheck_exec_end_time";
3182
3183 /**
3184 * How long the screen must have been off in order to kill processes
3185 * or reboot. This number is in seconds. A value of -1 means to
3186 * entirely disregard whether the screen is on.
3187 * @hide
3188 */
3189 public static final String MEMCHECK_MIN_SCREEN_OFF = "memcheck_min_screen_off";
3190
3191 /**
3192 * How much time there must be until the next alarm in order to kill processes
3193 * or reboot. This number is in seconds. Note: this value must be
3194 * smaller than {@link #MEMCHECK_RECHECK_INTERVAL} or else it will
3195 * always see an alarm scheduled within its time.
3196 * @hide
3197 */
3198 public static final String MEMCHECK_MIN_ALARM = "memcheck_min_alarm";
3199
3200 /**
3201 * How frequently to check whether it is a good time to restart things,
3202 * if the device is in a bad state. This number is in seconds. Note:
3203 * this value must be larger than {@link #MEMCHECK_MIN_ALARM} or else
3204 * the alarm to schedule the recheck will always appear within the
3205 * minimum "do not execute now" time.
3206 * @hide
3207 */
3208 public static final String MEMCHECK_RECHECK_INTERVAL = "memcheck_recheck_interval";
3209
3210 /**
3211 * How frequently (in DAYS) to reboot the device. If 0, no reboots
3212 * will occur.
3213 * @hide
3214 */
3215 public static final String REBOOT_INTERVAL = "reboot_interval";
3216
3217 /**
3218 * First time during the day it is okay to force a reboot of the
3219 * device (if REBOOT_INTERVAL is set). This number is
3220 * in seconds since midnight.
3221 * @hide
3222 */
3223 public static final String REBOOT_START_TIME = "reboot_start_time";
3224
3225 /**
3226 * The window of time (in seconds) after each REBOOT_INTERVAL in which
3227 * a reboot can be executed. If 0, a reboot will always be executed at
3228 * exactly the given time. Otherwise, it will only be executed if
3229 * the device is idle within the window.
3230 * @hide
3231 */
3232 public static final String REBOOT_WINDOW = "reboot_window";
3233
3234 /**
Doug Zongker43866e02010-01-07 12:09:54 -08003235 * Threshold values for the duration and level of a discharge cycle, under
3236 * which we log discharge cycle info.
3237 * @hide
3238 */
3239 public static final String BATTERY_DISCHARGE_DURATION_THRESHOLD =
3240 "battery_discharge_duration_threshold";
3241 /** @hide */
3242 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
3243
3244 /**
3245 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR intents
3246 * on application crashes and ANRs. If this is disabled, the crash/ANR dialog
3247 * will never display the "Report" button.
3248 * Type: int ( 0 = disallow, 1 = allow )
3249 * @hide
3250 */
3251 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
3252
3253 /**
3254 * Nonzero causes Log.wtf() to crash.
3255 * @hide
3256 */
3257 public static final String WTF_IS_FATAL = "wtf_is_fatal";
3258
3259 /**
Jake Hambybb371632010-08-23 18:16:48 -07003260 * Maximum age of entries kept by {@link com.android.internal.os.IDropBoxManagerService}.
Doug Zongker43866e02010-01-07 12:09:54 -08003261 * @hide
3262 */
3263 public static final String DROPBOX_AGE_SECONDS =
3264 "dropbox_age_seconds";
3265 /**
Jake Hambybb371632010-08-23 18:16:48 -07003266 * Maximum number of entry files which {@link com.android.internal.os.IDropBoxManagerService} will keep around.
Dan Egnor3a8b0c12010-03-24 17:48:20 -07003267 * @hide
3268 */
3269 public static final String DROPBOX_MAX_FILES =
3270 "dropbox_max_files";
3271 /**
Jake Hambybb371632010-08-23 18:16:48 -07003272 * Maximum amount of disk space used by {@link com.android.internal.os.IDropBoxManagerService} no matter what.
Doug Zongker43866e02010-01-07 12:09:54 -08003273 * @hide
3274 */
3275 public static final String DROPBOX_QUOTA_KB =
3276 "dropbox_quota_kb";
3277 /**
Jake Hambybb371632010-08-23 18:16:48 -07003278 * Percent of free disk (excluding reserve) which {@link com.android.internal.os.IDropBoxManagerService} will use.
Doug Zongker43866e02010-01-07 12:09:54 -08003279 * @hide
3280 */
3281 public static final String DROPBOX_QUOTA_PERCENT =
3282 "dropbox_quota_percent";
3283 /**
Jake Hambybb371632010-08-23 18:16:48 -07003284 * Percent of total disk which {@link com.android.internal.os.IDropBoxManagerService} will never dip into.
Doug Zongker43866e02010-01-07 12:09:54 -08003285 * @hide
3286 */
3287 public static final String DROPBOX_RESERVE_PERCENT =
3288 "dropbox_reserve_percent";
3289 /**
3290 * Prefix for per-tag dropbox disable/enable settings.
3291 * @hide
3292 */
3293 public static final String DROPBOX_TAG_PREFIX =
3294 "dropbox:";
Dan Egnora455d192010-03-12 08:52:28 -08003295 /**
3296 * Lines of logcat to include with system crash/ANR/etc. reports,
3297 * as a prefix of the dropbox tag of the report type.
3298 * For example, "logcat_for_system_server_anr" controls the lines
3299 * of logcat captured with system server ANR reports. 0 to disable.
3300 * @hide
3301 */
3302 public static final String ERROR_LOGCAT_PREFIX =
3303 "logcat_for_";
Doug Zongker43866e02010-01-07 12:09:54 -08003304
3305
3306 /**
3307 * Screen timeout in milliseconds corresponding to the
3308 * PowerManager's POKE_LOCK_SHORT_TIMEOUT flag (i.e. the fastest
3309 * possible screen timeout behavior.)
3310 * @hide
3311 */
3312 public static final String SHORT_KEYLIGHT_DELAY_MS =
3313 "short_keylight_delay_ms";
3314
3315 /**
3316 * The interval in minutes after which the amount of free storage left on the
3317 * device is logged to the event log
3318 * @hide
3319 */
3320 public static final String SYS_FREE_STORAGE_LOG_INTERVAL =
3321 "sys_free_storage_log_interval";
3322
3323 /**
3324 * Threshold for the amount of change in disk free space required to report the amount of
3325 * free space. Used to prevent spamming the logs when the disk free space isn't changing
3326 * frequently.
3327 * @hide
3328 */
3329 public static final String DISK_FREE_CHANGE_REPORTING_THRESHOLD =
3330 "disk_free_change_reporting_threshold";
3331
3332
3333 /**
3334 * Minimum percentage of free storage on the device that is used to determine if
Dianne Hackborn247fe742011-01-08 17:25:57 -08003335 * the device is running low on storage. The default is 10.
3336 * <p>Say this value is set to 10, the device is considered running low on storage
Doug Zongker43866e02010-01-07 12:09:54 -08003337 * if 90% or more of the device storage is filled up.
3338 * @hide
3339 */
3340 public static final String SYS_STORAGE_THRESHOLD_PERCENTAGE =
3341 "sys_storage_threshold_percentage";
3342
3343 /**
Dianne Hackborn247fe742011-01-08 17:25:57 -08003344 * Maximum byte size of the low storage threshold. This is to ensure
3345 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in
3346 * an overly large threshold for large storage devices. Currently this
3347 * must be less than 2GB. This default is 500MB.
3348 * @hide
3349 */
3350 public static final String SYS_STORAGE_THRESHOLD_MAX_BYTES =
3351 "sys_storage_threshold_max_bytes";
3352
3353 /**
Jake Hambybb371632010-08-23 18:16:48 -07003354 * Minimum bytes of free storage on the device before the data
3355 * partition is considered full. By default, 1 MB is reserved
3356 * to avoid system-wide SQLite disk full exceptions.
3357 * @hide
3358 */
3359 public static final String SYS_STORAGE_FULL_THRESHOLD_BYTES =
3360 "sys_storage_full_threshold_bytes";
3361
3362 /**
Doug Zongker43866e02010-01-07 12:09:54 -08003363 * The interval in milliseconds after which Wi-Fi is considered idle.
3364 * When idle, it is possible for the device to be switched from Wi-Fi to
3365 * the mobile data network.
3366 * @hide
3367 */
3368 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
3369
3370 /**
Irfan Sheriff2b7f6382011-03-25 14:29:19 -07003371 * The interval in milliseconds to issue wake up scans when wifi needs
3372 * to connect. This is necessary to connect to an access point when
3373 * device is on the move and the screen is off.
Irfan Sheriff4f5f7c92010-10-14 17:01:27 -07003374 * @hide
3375 */
Irfan Sheriff2b7f6382011-03-25 14:29:19 -07003376 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
3377 "wifi_framework_scan_interval_ms";
3378
3379 /**
3380 * The interval in milliseconds to scan as used by the wifi supplicant
3381 * @hide
3382 */
3383 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
3384 "wifi_supplicant_scan_interval_ms";
Irfan Sheriff4f5f7c92010-10-14 17:01:27 -07003385
3386 /**
Doug Zongkeredc51892010-01-07 13:51:16 -08003387 * The interval in milliseconds at which to check packet counts on the
3388 * mobile data interface when screen is on, to detect possible data
3389 * connection problems.
3390 * @hide
3391 */
3392 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
3393 "pdp_watchdog_poll_interval_ms";
3394
3395 /**
3396 * The interval in milliseconds at which to check packet counts on the
3397 * mobile data interface when screen is off, to detect possible data
3398 * connection problems.
3399 * @hide
3400 */
3401 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
3402 "pdp_watchdog_long_poll_interval_ms";
3403
3404 /**
3405 * The interval in milliseconds at which to check packet counts on the
3406 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
3407 * outgoing packets has been reached without incoming packets.
3408 * @hide
3409 */
3410 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
3411 "pdp_watchdog_error_poll_interval_ms";
3412
3413 /**
3414 * The number of outgoing packets sent without seeing an incoming packet
3415 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
3416 * device is logged to the event log
3417 * @hide
3418 */
3419 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
3420 "pdp_watchdog_trigger_packet_count";
3421
3422 /**
3423 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
3424 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
3425 * attempting data connection recovery.
3426 * @hide
3427 */
3428 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
3429 "pdp_watchdog_error_poll_count";
3430
3431 /**
3432 * The number of failed PDP reset attempts before moving to something more
3433 * drastic: re-registering to the network.
3434 * @hide
3435 */
3436 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
3437 "pdp_watchdog_max_pdp_reset_fail_count";
3438
3439 /**
Doug Zongkeredc51892010-01-07 13:51:16 -08003440 * The interval in milliseconds at which to check gprs registration
3441 * after the first registration mismatch of gprs and voice service,
3442 * to detect possible data network registration problems.
3443 *
3444 * @hide
3445 */
3446 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
3447 "gprs_register_check_period_ms";
3448
3449 /**
3450 * The length of time in milli-seconds that automatic small adjustments to
3451 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
3452 * @hide
3453 */
3454 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
3455
3456 /**
3457 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
3458 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
3459 * exceeded.
3460 * @hide
3461 */
3462 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
3463
3464 /**
3465 * The maximum reconnect delay for short network outages or when the network is suspended
3466 * due to phone use.
3467 * @hide
3468 */
3469 public static final String SYNC_MAX_RETRY_DELAY_IN_SECONDS =
3470 "sync_max_retry_delay_in_seconds";
3471
3472 /**
3473 * The interval in milliseconds at which to check the number of SMS sent
3474 * out without asking for use permit, to limit the un-authorized SMS
3475 * usage.
3476 * @hide
3477 */
3478 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
3479 "sms_outgoing_check_interval_ms";
3480
3481 /**
3482 * The number of outgoing SMS sent without asking for user permit
3483 * (of {@link #SMS_OUTGOING_CHECK_INTERVAL_MS}
3484 * @hide
3485 */
3486 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
3487 "sms_outgoing_check_max_count";
3488
3489 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003490 * The number of promoted sources in GlobalSearch.
3491 * @hide
3492 */
3493 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
3494 /**
3495 * The maximum number of suggestions returned by GlobalSearch.
3496 * @hide
3497 */
3498 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
3499 /**
3500 * The number of suggestions GlobalSearch will ask each non-web search source for.
3501 * @hide
3502 */
3503 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
3504 /**
3505 * The number of suggestions the GlobalSearch will ask the web search source for.
3506 * @hide
3507 */
3508 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
3509 "search_web_results_override_limit";
3510 /**
3511 * The number of milliseconds that GlobalSearch will wait for suggestions from
3512 * promoted sources before continuing with all other sources.
3513 * @hide
3514 */
3515 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
3516 "search_promoted_source_deadline_millis";
3517 /**
3518 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
3519 * @hide
3520 */
3521 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
3522 /**
3523 * The maximum number of milliseconds that GlobalSearch shows the previous results
3524 * after receiving a new query.
3525 * @hide
3526 */
3527 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
3528 /**
3529 * The maximum age of log data used for shortcuts in GlobalSearch.
3530 * @hide
3531 */
3532 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
3533 /**
3534 * The maximum age of log data used for source ranking in GlobalSearch.
3535 * @hide
3536 */
3537 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
3538 "search_max_source_event_age_millis";
3539 /**
3540 * The minimum number of impressions needed to rank a source in GlobalSearch.
3541 * @hide
3542 */
3543 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
3544 "search_min_impressions_for_source_ranking";
3545 /**
3546 * The minimum number of clicks needed to rank a source in GlobalSearch.
3547 * @hide
3548 */
3549 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
3550 "search_min_clicks_for_source_ranking";
3551 /**
3552 * The maximum number of shortcuts shown by GlobalSearch.
3553 * @hide
3554 */
3555 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
3556 /**
3557 * The size of the core thread pool for suggestion queries in GlobalSearch.
3558 * @hide
3559 */
3560 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
3561 "search_query_thread_core_pool_size";
3562 /**
3563 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
3564 * @hide
3565 */
3566 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
3567 "search_query_thread_max_pool_size";
3568 /**
3569 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
3570 * @hide
3571 */
3572 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
3573 "search_shortcut_refresh_core_pool_size";
3574 /**
3575 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
3576 * @hide
3577 */
3578 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
3579 "search_shortcut_refresh_max_pool_size";
3580 /**
3581 * The maximun time that excess threads in the GlobalSeach thread pools will
3582 * wait before terminating.
3583 * @hide
3584 */
3585 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
3586 "search_thread_keepalive_seconds";
3587 /**
3588 * The maximum number of concurrent suggestion queries to each source.
3589 * @hide
3590 */
3591 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
3592 "search_per_source_concurrent_query_limit";
3593
San Mehat87734d32010-01-08 12:53:06 -08003594 /**
3595 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
3596 * @hide
3597 */
3598 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
3599
3600 /**
3601 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
3602 * @hide
3603 */
3604 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
3605
3606 /**
3607 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
3608 * @hide
3609 */
3610 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
3611
3612 /**
3613 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
3614 * @hide
3615 */
3616 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003617
Dan Egnor42471dd2010-01-07 17:25:22 -08003618 /**
3619 * If nonzero, ANRs in invisible background processes bring up a dialog.
3620 * Otherwise, the process will be silently killed.
3621 * @hide
3622 */
3623 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08003624
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08003625 /**
3626 * The {@link ComponentName} string of the service to be used as the voice recognition
3627 * service.
Erikeebc8e22010-02-18 13:27:19 -08003628 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08003629 * @hide
3630 */
3631 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08003632
satokeaddb892011-06-01 19:24:14 +09003633
3634 /**
3635 * The {@link ComponentName} string of the service to be used as the spell checker
3636 * service which is one of the services managed by the text service manager.
3637 *
3638 * @hide
3639 */
3640 public static final String SPELL_CHECKER_SERVICE = "spell_checker_service";
3641
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003642 /**
David Brown458e8062010-03-08 21:52:11 -08003643 * What happens when the user presses the Power button while in-call
3644 * and the screen is on.<br/>
3645 * <b>Values:</b><br/>
3646 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
3647 * 2 - The Power button hangs up the current call.<br/>
3648 *
3649 * @hide
3650 */
3651 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
3652
3653 /**
3654 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
3655 * @hide
3656 */
3657 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
3658
3659 /**
3660 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
3661 * @hide
3662 */
3663 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
3664
3665 /**
3666 * INCALL_POWER_BUTTON_BEHAVIOR default value.
3667 * @hide
3668 */
3669 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
3670 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
3671
3672 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07003673 * The current night mode that has been selected by the user. Owned
3674 * and controlled by UiModeManagerService. Constants are as per
3675 * UiModeManager.
3676 * @hide
3677 */
3678 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07003679
3680 /**
3681 * Let user pick default install location.
3682 * @hide
3683 */
3684 public static final String SET_INSTALL_LOCATION = "set_install_location";
3685
3686 /**
3687 * Default install location value.
3688 * 0 = auto, let system decide
3689 * 1 = internal
3690 * 2 = sdcard
3691 * @hide
3692 */
3693 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07003694
3695 /**
3696 * The bandwidth throttle polling freqency in seconds
3697 * @hide
3698 */
3699 public static final String THROTTLE_POLLING_SEC = "throttle_polling_sec";
3700
3701 /**
3702 * The bandwidth throttle threshold (long)
3703 * @hide
3704 */
Robert Greenwaltd3bb93f2010-04-12 19:20:55 -07003705 public static final String THROTTLE_THRESHOLD_BYTES = "throttle_threshold_bytes";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07003706
3707 /**
3708 * The bandwidth throttle value (kbps)
3709 * @hide
3710 */
Robert Greenwaltd3bb93f2010-04-12 19:20:55 -07003711 public static final String THROTTLE_VALUE_KBITSPS = "throttle_value_kbitsps";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07003712
3713 /**
3714 * The bandwidth throttle reset calendar day (1-28)
3715 * @hide
3716 */
3717 public static final String THROTTLE_RESET_DAY = "throttle_reset_day";
3718
3719 /**
3720 * The throttling notifications we should send
3721 * @hide
3722 */
3723 public static final String THROTTLE_NOTIFICATION_TYPE = "throttle_notification_type";
3724
3725 /**
Irfan Sheriffc9b68512010-04-08 14:12:33 -07003726 * Help URI for data throttling policy
3727 * @hide
3728 */
3729 public static final String THROTTLE_HELP_URI = "throttle_help_uri";
3730
Robert Greenwaltd1055a22010-05-25 15:54:52 -07003731 /**
3732 * The length of time in Sec that we allow our notion of NTP time
3733 * to be cached before we refresh it
3734 * @hide
3735 */
3736 public static final String THROTTLE_MAX_NTP_CACHE_AGE_SEC =
3737 "throttle_max_ntp_cache_age_sec";
3738
Steve Howard9c4e33e2010-07-28 15:59:29 -07003739 /**
3740 * The maximum size, in bytes, of a download that the download manager will transfer over
3741 * a non-wifi connection.
3742 * @hide
3743 */
3744 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
3745 "download_manager_max_bytes_over_mobile";
3746
Robert Greenwaltd7085fc2010-09-08 15:24:47 -07003747 /**
Steve Howardf1766812010-09-17 16:46:19 -07003748 * The recommended maximum size, in bytes, of a download that the download manager should
3749 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
3750 * have the option to start the download over the mobile connection anyway.
3751 * @hide
3752 */
3753 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
3754 "download_manager_recommended_max_bytes_over_mobile";
3755
3756 /**
Robert Greenwaltd7085fc2010-09-08 15:24:47 -07003757 * ms during which to consume extra events related to Inet connection condition
3758 * after a transtion to fully-connected
3759 * @hide
3760 */
3761 public static final String INET_CONDITION_DEBOUNCE_UP_DELAY =
3762 "inet_condition_debounce_up_delay";
3763
3764 /**
3765 * ms during which to consume extra events related to Inet connection condtion
3766 * after a transtion to partly-connected
3767 * @hide
3768 */
3769 public static final String INET_CONDITION_DEBOUNCE_DOWN_DELAY =
3770 "inet_condition_debounce_down_delay";
Irfan Sheriffc9b68512010-04-08 14:12:33 -07003771
3772 /**
Freeman Ng96be4e02011-04-07 18:21:40 -07003773 * URL to open browser on to allow user to manage a prepay account
3774 * @hide
3775 */
3776 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
3777 "setup_prepaid_data_service_url";
3778
3779 /**
Freeman Ng3b9089c2011-04-22 16:42:57 -07003780 * URL to attempt a GET on to see if this is a prepay device
3781 * @hide
3782 */
3783 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
3784 "setup_prepaid_detection_target_url";
3785
3786 /**
3787 * Host to check for a redirect to after an attempt to GET
3788 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
3789 * this is a prepaid device with zero balance.)
3790 * @hide
3791 */
3792 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
3793 "setup_prepaid_detection_redir_host";
3794
3795 /**
Daniel Sandler0601eb72011-04-13 01:01:32 -04003796 * The user's preferred "dream" (interactive screensaver) component.
3797 *
3798 * This component will be launched by the PhoneWindowManager after the user's chosen idle
3799 * timeout (specified by {@link #DREAM_TIMEOUT}).
3800 * @hide
3801 */
3802 public static final String DREAM_COMPONENT =
3803 "dream_component";
3804
3805 /**
3806 * The delay before a "dream" is started (set to 0 to disable).
3807 * @hide
3808 */
3809 public static final String DREAM_TIMEOUT =
3810 "dream_timeout";
3811
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07003812 /** {@hide} */
3813 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
3814 /** {@hide} */
3815 public static final String NETSTATS_PERSIST_THRESHOLD = "netstats_persist_threshold";
3816 /** {@hide} */
Jeff Sharkey39ebc212011-06-11 17:25:42 -07003817 public static final String NETSTATS_NETWORK_BUCKET_DURATION = "netstats_network_bucket_duration";
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07003818 /** {@hide} */
Jeff Sharkey39ebc212011-06-11 17:25:42 -07003819 public static final String NETSTATS_NETWORK_MAX_HISTORY = "netstats_network_max_history";
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07003820 /** {@hide} */
Jeff Sharkey39ebc212011-06-11 17:25:42 -07003821 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07003822 /** {@hide} */
Jeff Sharkey39ebc212011-06-11 17:25:42 -07003823 public static final String NETSTATS_UID_MAX_HISTORY = "netstats_uid_max_history";
Jeff Sharkeyd03fd3f2011-06-19 20:55:09 -07003824 /** {@hide} */
3825 public static final String NETSTATS_TAG_MAX_HISTORY = "netstats_tag_max_history";
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07003826
Daniel Sandler0601eb72011-04-13 01:01:32 -04003827 /**
-b master501eec92009-07-06 13:53:11 -07003828 * @hide
3829 */
3830 public static final String[] SETTINGS_TO_BACKUP = {
Amith Yamasani8823c0a82009-07-07 14:30:17 -07003831 ADB_ENABLED,
3832 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07003833 PARENTAL_CONTROL_ENABLED,
3834 PARENTAL_CONTROL_REDIRECT_URL,
3835 USB_MASS_STORAGE_ENABLED,
3836 ACCESSIBILITY_ENABLED,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003837 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08003838 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07003839 ENABLED_ACCESSIBILITY_SERVICES,
3840 TTS_USE_DEFAULTS,
3841 TTS_DEFAULT_RATE,
3842 TTS_DEFAULT_PITCH,
3843 TTS_DEFAULT_SYNTH,
3844 TTS_DEFAULT_LANG,
3845 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07003846 TTS_ENABLED_PLUGINS,
-b master501eec92009-07-06 13:53:11 -07003847 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
3848 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
-b master501eec92009-07-06 13:53:11 -07003849 WIFI_NUM_OPEN_NETWORKS_KEPT,
San Mehat87734d32010-01-08 12:53:06 -08003850 MOUNT_PLAY_NOTIFICATION_SND,
3851 MOUNT_UMS_AUTOSTART,
3852 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07003853 MOUNT_UMS_NOTIFY_ENABLED,
3854 UI_NIGHT_MODE
-b master501eec92009-07-06 13:53:11 -07003855 };
3856
3857 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003858 * Helper method for determining if a location provider is enabled.
3859 * @param cr the content resolver to use
3860 * @param provider the location provider to query
3861 * @return true if the provider is enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003862 */
3863 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
3864 String allowedProviders = Settings.Secure.getString(cr, LOCATION_PROVIDERS_ALLOWED);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07003865 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003866 }
3867
3868 /**
3869 * Thread-safe method for enabling or disabling a single location provider.
3870 * @param cr the content resolver to use
3871 * @param provider the location provider to enable or disable
3872 * @param enabled true if the provider should be enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003873 */
3874 public static final void setLocationProviderEnabled(ContentResolver cr,
3875 String provider, boolean enabled) {
3876 // to ensure thread safety, we write the provider name with a '+' or '-'
3877 // and let the SettingsProvider handle it rather than reading and modifying
3878 // the list of enabled providers.
3879 if (enabled) {
3880 provider = "+" + provider;
3881 } else {
3882 provider = "-" + provider;
3883 }
3884 putString(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider);
3885 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003886 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003887
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003888 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003889 * User-defined bookmarks and shortcuts. The target of each bookmark is an
3890 * Intent URL, allowing it to be either a web page or a particular
3891 * application activity.
3892 *
3893 * @hide
3894 */
3895 public static final class Bookmarks implements BaseColumns
3896 {
3897 private static final String TAG = "Bookmarks";
3898
3899 /**
3900 * The content:// style URL for this table
3901 */
3902 public static final Uri CONTENT_URI =
3903 Uri.parse("content://" + AUTHORITY + "/bookmarks");
3904
3905 /**
3906 * The row ID.
3907 * <p>Type: INTEGER</p>
3908 */
3909 public static final String ID = "_id";
3910
3911 /**
3912 * Descriptive name of the bookmark that can be displayed to the user.
3913 * If this is empty, the title should be resolved at display time (use
3914 * {@link #getTitle(Context, Cursor)} any time you want to display the
3915 * title of a bookmark.)
3916 * <P>
3917 * Type: TEXT
3918 * </P>
3919 */
3920 public static final String TITLE = "title";
3921
3922 /**
3923 * Arbitrary string (displayed to the user) that allows bookmarks to be
3924 * organized into categories. There are some special names for
3925 * standard folders, which all start with '@'. The label displayed for
3926 * the folder changes with the locale (via {@link #getLabelForFolder}) but
3927 * the folder name does not change so you can consistently query for
3928 * the folder regardless of the current locale.
3929 *
3930 * <P>Type: TEXT</P>
3931 *
3932 */
3933 public static final String FOLDER = "folder";
3934
3935 /**
3936 * The Intent URL of the bookmark, describing what it points to. This
3937 * value is given to {@link android.content.Intent#getIntent} to create
3938 * an Intent that can be launched.
3939 * <P>Type: TEXT</P>
3940 */
3941 public static final String INTENT = "intent";
3942
3943 /**
3944 * Optional shortcut character associated with this bookmark.
3945 * <P>Type: INTEGER</P>
3946 */
3947 public static final String SHORTCUT = "shortcut";
3948
3949 /**
3950 * The order in which the bookmark should be displayed
3951 * <P>Type: INTEGER</P>
3952 */
3953 public static final String ORDERING = "ordering";
3954
3955 private static final String[] sIntentProjection = { INTENT };
3956 private static final String[] sShortcutProjection = { ID, SHORTCUT };
3957 private static final String sShortcutSelection = SHORTCUT + "=?";
3958
3959 /**
3960 * Convenience function to retrieve the bookmarked Intent for a
3961 * particular shortcut key.
3962 *
3963 * @param cr The ContentResolver to query.
3964 * @param shortcut The shortcut key.
3965 *
3966 * @return Intent The bookmarked URL, or null if there is no bookmark
3967 * matching the given shortcut.
3968 */
3969 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
3970 {
3971 Intent intent = null;
3972
3973 Cursor c = cr.query(CONTENT_URI,
3974 sIntentProjection, sShortcutSelection,
3975 new String[] { String.valueOf((int) shortcut) }, ORDERING);
3976 // Keep trying until we find a valid shortcut
3977 try {
3978 while (intent == null && c.moveToNext()) {
3979 try {
3980 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02003981 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003982 } catch (java.net.URISyntaxException e) {
3983 // The stored URL is bad... ignore it.
3984 } catch (IllegalArgumentException e) {
3985 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07003986 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003987 }
3988 }
3989 } finally {
3990 if (c != null) c.close();
3991 }
3992
3993 return intent;
3994 }
3995
3996 /**
3997 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003998 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003999 * @param cr The ContentResolver to query.
4000 * @param intent The desired target of the bookmark.
4001 * @param title Bookmark title that is shown to the user; null if none
4002 * or it should be resolved to the intent's title.
4003 * @param folder Folder in which to place the bookmark; null if none.
4004 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
4005 * this is non-zero and there is an existing bookmark entry
4006 * with this same shortcut, then that existing shortcut is
4007 * cleared (the bookmark is not removed).
4008 * @return The unique content URL for the new bookmark entry.
4009 */
4010 public static Uri add(ContentResolver cr,
4011 Intent intent,
4012 String title,
4013 String folder,
4014 char shortcut,
4015 int ordering)
4016 {
4017 // If a shortcut is supplied, and it is already defined for
4018 // another bookmark, then remove the old definition.
4019 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05004020 cr.delete(CONTENT_URI, sShortcutSelection,
4021 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004022 }
4023
4024 ContentValues values = new ContentValues();
4025 if (title != null) values.put(TITLE, title);
4026 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07004027 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004028 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
4029 values.put(ORDERING, ordering);
4030 return cr.insert(CONTENT_URI, values);
4031 }
4032
4033 /**
4034 * Return the folder name as it should be displayed to the user. This
4035 * takes care of localizing special folders.
4036 *
4037 * @param r Resources object for current locale; only need access to
4038 * system resources.
4039 * @param folder The value found in the {@link #FOLDER} column.
4040 *
4041 * @return CharSequence The label for this folder that should be shown
4042 * to the user.
4043 */
4044 public static CharSequence getLabelForFolder(Resources r, String folder) {
4045 return folder;
4046 }
4047
4048 /**
4049 * Return the title as it should be displayed to the user. This takes
4050 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004051 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004052 * @param context A context.
4053 * @param cursor A cursor pointing to the row whose title should be
4054 * returned. The cursor must contain at least the {@link #TITLE}
4055 * and {@link #INTENT} columns.
4056 * @return A title that is localized and can be displayed to the user,
4057 * or the empty string if one could not be found.
4058 */
4059 public static CharSequence getTitle(Context context, Cursor cursor) {
4060 int titleColumn = cursor.getColumnIndex(TITLE);
4061 int intentColumn = cursor.getColumnIndex(INTENT);
4062 if (titleColumn == -1 || intentColumn == -1) {
4063 throw new IllegalArgumentException(
4064 "The cursor must contain the TITLE and INTENT columns.");
4065 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004066
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004067 String title = cursor.getString(titleColumn);
4068 if (!TextUtils.isEmpty(title)) {
4069 return title;
4070 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004071
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004072 String intentUri = cursor.getString(intentColumn);
4073 if (TextUtils.isEmpty(intentUri)) {
4074 return "";
4075 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004076
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004077 Intent intent;
4078 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02004079 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004080 } catch (URISyntaxException e) {
4081 return "";
4082 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004083
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004084 PackageManager packageManager = context.getPackageManager();
4085 ResolveInfo info = packageManager.resolveActivity(intent, 0);
4086 return info != null ? info.loadLabel(packageManager) : "";
4087 }
4088 }
4089
4090 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004091 * Returns the device ID that we should use when connecting to the mobile gtalk server.
4092 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
4093 * from the GoogleLoginService.
4094 *
4095 * @param androidId The Android ID for this device.
4096 * @return The device ID that should be used when connecting to the mobile gtalk server.
4097 * @hide
4098 */
4099 public static String getGTalkDeviceId(long androidId) {
4100 return "android-" + Long.toHexString(androidId);
4101 }
4102}