blob: 6ab7738896cc437bf59c7b2011ec2134a069fd13 [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 -080019
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020
21import android.annotation.SdkConstant;
22import android.annotation.SdkConstant.SdkConstantType;
Mike LeBeau5d34e9b2010-02-10 19:34:56 -080023import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080024import android.content.ContentResolver;
25import android.content.ContentValues;
26import android.content.Context;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -080027import android.content.IContentProvider;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080028import android.content.Intent;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -080029import android.content.pm.ActivityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030import android.content.pm.PackageManager;
31import android.content.pm.ResolveInfo;
32import android.content.res.Configuration;
33import android.content.res.Resources;
34import android.database.Cursor;
35import android.database.SQLException;
36import android.net.Uri;
Irfan Sheriff36f74132010-11-04 16:57:37 -070037import android.net.wifi.WifiManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070038import android.os.BatteryManager;
39import android.os.Bundle;
40import android.os.RemoteException;
41import android.os.SystemProperties;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080042import android.text.TextUtils;
43import android.util.AndroidException;
44import android.util.Log;
45
46import java.net.URISyntaxException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080047import java.util.HashMap;
48import java.util.HashSet;
49
50
51/**
52 * The Settings provider contains global system-level device preferences.
53 */
54public final class Settings {
55
56 // Intent actions for Settings
57
58 /**
59 * Activity Action: Show system settings.
60 * <p>
61 * Input: Nothing.
62 * <p>
63 * Output: nothing.
64 */
65 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
66 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
67
68 /**
69 * Activity Action: Show settings to allow configuration of APNs.
70 * <p>
71 * Input: Nothing.
72 * <p>
73 * Output: nothing.
74 */
75 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
76 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
77
78 /**
79 * Activity Action: Show settings to allow configuration of current location
80 * sources.
81 * <p>
82 * In some cases, a matching Activity may not exist, so ensure you
83 * safeguard against this.
84 * <p>
85 * Input: Nothing.
86 * <p>
87 * Output: Nothing.
88 */
89 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
90 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
91 "android.settings.LOCATION_SOURCE_SETTINGS";
92
93 /**
94 * Activity Action: Show settings to allow configuration of wireless controls
95 * such as Wi-Fi, Bluetooth and Mobile networks.
96 * <p>
97 * In some cases, a matching Activity may not exist, so ensure you
98 * safeguard against this.
99 * <p>
100 * Input: Nothing.
101 * <p>
102 * Output: Nothing.
103 */
104 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
105 public static final String ACTION_WIRELESS_SETTINGS =
106 "android.settings.WIRELESS_SETTINGS";
107
108 /**
109 * Activity Action: Show settings to allow entering/exiting airplane mode.
110 * <p>
111 * In some cases, a matching Activity may not exist, so ensure you
112 * safeguard against this.
113 * <p>
114 * Input: Nothing.
115 * <p>
116 * Output: Nothing.
117 */
118 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
119 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
120 "android.settings.AIRPLANE_MODE_SETTINGS";
121
122 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700123 * Activity Action: Show settings for accessibility modules.
124 * <p>
125 * In some cases, a matching Activity may not exist, so ensure you
126 * safeguard against this.
127 * <p>
128 * Input: Nothing.
129 * <p>
130 * Output: Nothing.
131 */
132 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
133 public static final String ACTION_ACCESSIBILITY_SETTINGS =
134 "android.settings.ACCESSIBILITY_SETTINGS";
135
136 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800137 * Activity Action: Show settings to allow configuration of security and
138 * location privacy.
139 * <p>
140 * In some cases, a matching Activity may not exist, so ensure you
141 * safeguard against this.
142 * <p>
143 * Input: Nothing.
144 * <p>
145 * Output: Nothing.
146 */
147 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
148 public static final String ACTION_SECURITY_SETTINGS =
149 "android.settings.SECURITY_SETTINGS";
150
151 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700152 * Activity Action: Show settings to allow configuration of privacy options.
153 * <p>
154 * In some cases, a matching Activity may not exist, so ensure you
155 * safeguard against this.
156 * <p>
157 * Input: Nothing.
158 * <p>
159 * Output: Nothing.
160 */
161 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
162 public static final String ACTION_PRIVACY_SETTINGS =
163 "android.settings.PRIVACY_SETTINGS";
164
165 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800166 * Activity Action: Show settings to allow configuration of Wi-Fi.
167
168 * <p>
169 * In some cases, a matching Activity may not exist, so ensure you
170 * safeguard against this.
171 * <p>
172 * Input: Nothing.
173 * <p>
174 * Output: Nothing.
175
176 */
177 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
178 public static final String ACTION_WIFI_SETTINGS =
179 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700180
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800181 /**
182 * Activity Action: Show settings to allow configuration of a static IP
183 * address for Wi-Fi.
184 * <p>
185 * In some cases, a matching Activity may not exist, so ensure you safeguard
186 * against this.
187 * <p>
188 * Input: Nothing.
189 * <p>
190 * Output: Nothing.
191 */
192 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
193 public static final String ACTION_WIFI_IP_SETTINGS =
194 "android.settings.WIFI_IP_SETTINGS";
195
196 /**
197 * Activity Action: Show settings to allow configuration of Bluetooth.
198 * <p>
199 * In some cases, a matching Activity may not exist, so ensure you
200 * safeguard against this.
201 * <p>
202 * Input: Nothing.
203 * <p>
204 * Output: Nothing.
205 */
206 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
207 public static final String ACTION_BLUETOOTH_SETTINGS =
208 "android.settings.BLUETOOTH_SETTINGS";
209
210 /**
211 * Activity Action: Show settings to allow configuration of date and time.
212 * <p>
213 * In some cases, a matching Activity may not exist, so ensure you
214 * safeguard against this.
215 * <p>
216 * Input: Nothing.
217 * <p>
218 * Output: Nothing.
219 */
220 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
221 public static final String ACTION_DATE_SETTINGS =
222 "android.settings.DATE_SETTINGS";
223
224 /**
225 * Activity Action: Show settings to allow configuration of sound and volume.
226 * <p>
227 * In some cases, a matching Activity may not exist, so ensure you
228 * safeguard against this.
229 * <p>
230 * Input: Nothing.
231 * <p>
232 * Output: Nothing.
233 */
234 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
235 public static final String ACTION_SOUND_SETTINGS =
236 "android.settings.SOUND_SETTINGS";
237
238 /**
239 * Activity Action: Show settings to allow configuration of display.
240 * <p>
241 * In some cases, a matching Activity may not exist, so ensure you
242 * safeguard against this.
243 * <p>
244 * Input: Nothing.
245 * <p>
246 * Output: Nothing.
247 */
248 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
249 public static final String ACTION_DISPLAY_SETTINGS =
250 "android.settings.DISPLAY_SETTINGS";
251
252 /**
253 * Activity Action: Show settings to allow configuration of locale.
254 * <p>
255 * In some cases, a matching Activity may not exist, so ensure you
256 * safeguard against this.
257 * <p>
258 * Input: Nothing.
259 * <p>
260 * Output: Nothing.
261 */
262 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
263 public static final String ACTION_LOCALE_SETTINGS =
264 "android.settings.LOCALE_SETTINGS";
265
266 /**
267 * Activity Action: Show settings to configure input methods, in particular
268 * allowing the user to enable input methods.
269 * <p>
270 * In some cases, a matching Activity may not exist, so ensure you
271 * safeguard against this.
272 * <p>
273 * Input: Nothing.
274 * <p>
275 * Output: Nothing.
276 */
277 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
278 public static final String ACTION_INPUT_METHOD_SETTINGS =
279 "android.settings.INPUT_METHOD_SETTINGS";
280
281 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900282 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900283 * <p>
284 * In some cases, a matching Activity may not exist, so ensure you
285 * safeguard against this.
286 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900287 * To tell which input method's subtypes are displayed in the settings, add
288 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
289 * If there is no extra in this Intent, subtypes from all installed input methods
290 * will be displayed in the settings.
291 *
292 * @see android.view.inputmethod.InputMethodInfo#getId
293 * <p>
satok86417ea2010-10-27 14:11:03 +0900294 * Input: Nothing.
295 * <p>
296 * Output: Nothing.
297 */
298 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900299 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
300 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900301
302 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800303 * Activity Action: Show settings to manage the user input dictionary.
304 * <p>
305 * In some cases, a matching Activity may not exist, so ensure you
306 * safeguard against this.
307 * <p>
308 * Input: Nothing.
309 * <p>
310 * Output: Nothing.
311 */
312 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
313 public static final String ACTION_USER_DICTIONARY_SETTINGS =
314 "android.settings.USER_DICTIONARY_SETTINGS";
315
316 /**
317 * Activity Action: Show settings to allow configuration of application-related settings.
318 * <p>
319 * In some cases, a matching Activity may not exist, so ensure you
320 * safeguard against this.
321 * <p>
322 * Input: Nothing.
323 * <p>
324 * Output: Nothing.
325 */
326 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
327 public static final String ACTION_APPLICATION_SETTINGS =
328 "android.settings.APPLICATION_SETTINGS";
329
330 /**
331 * Activity Action: Show settings to allow configuration of application
332 * development-related settings.
333 * <p>
334 * In some cases, a matching Activity may not exist, so ensure you safeguard
335 * against this.
336 * <p>
337 * Input: Nothing.
338 * <p>
339 * Output: Nothing.
340 */
341 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
342 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
343 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
344
345 /**
346 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
347 * <p>
348 * In some cases, a matching Activity may not exist, so ensure you
349 * safeguard against this.
350 * <p>
351 * Input: Nothing.
352 * <p>
353 * Output: Nothing.
354 */
355 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
356 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
357 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700358
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800359 /**
360 * Activity Action: Show settings to manage installed applications.
361 * <p>
362 * In some cases, a matching Activity may not exist, so ensure you
363 * safeguard against this.
364 * <p>
365 * Input: Nothing.
366 * <p>
367 * Output: Nothing.
368 */
369 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
370 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
371 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700372
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800373 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700374 * Activity Action: Show settings to manage all applications.
375 * <p>
376 * In some cases, a matching Activity may not exist, so ensure you
377 * safeguard against this.
378 * <p>
379 * Input: Nothing.
380 * <p>
381 * Output: Nothing.
382 */
383 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
384 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
385 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
386
387 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700388 * Activity Action: Show screen of details about a particular application.
389 * <p>
390 * In some cases, a matching Activity may not exist, so ensure you
391 * safeguard against this.
392 * <p>
393 * Input: The Intent's data URI specifies the application package name
394 * to be shown, with the "package" scheme. That is "package:com.my.app".
395 * <p>
396 * Output: Nothing.
397 */
398 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
399 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
400 "android.settings.APPLICATION_DETAILS_SETTINGS";
401
402 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800403 * Activity Action: Show settings for system update functionality.
404 * <p>
405 * In some cases, a matching Activity may not exist, so ensure you
406 * safeguard against this.
407 * <p>
408 * Input: Nothing.
409 * <p>
410 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700411 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800412 * @hide
413 */
414 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
415 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
416 "android.settings.SYSTEM_UPDATE_SETTINGS";
417
418 /**
419 * Activity Action: Show settings to allow configuration of sync settings.
420 * <p>
421 * In some cases, a matching Activity may not exist, so ensure you
422 * safeguard against this.
423 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800424 * The account types available to add via the add account button may be restricted by adding an
425 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
426 * authorities. Only account types which can sync with that content provider will be offered to
427 * the user.
428 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800429 * Input: Nothing.
430 * <p>
431 * Output: Nothing.
432 */
433 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
434 public static final String ACTION_SYNC_SETTINGS =
435 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700436
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800437 /**
Erikeebc8e22010-02-18 13:27:19 -0800438 * Activity Action: Show add account screen for creating a new account.
439 * <p>
440 * In some cases, a matching Activity may not exist, so ensure you
441 * safeguard against this.
442 * <p>
443 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
444 * extra to the Intent with one or more syncable content provider's authorities. Only account
445 * types which can sync with that content provider will be offered to the user.
446 * <p>
447 * Input: Nothing.
448 * <p>
449 * Output: Nothing.
450 */
451 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
452 public static final String ACTION_ADD_ACCOUNT =
453 "android.settings.ADD_ACCOUNT_SETTINGS";
454
455 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800456 * Activity Action: Show settings for selecting the network operator.
457 * <p>
458 * In some cases, a matching Activity may not exist, so ensure you
459 * safeguard against this.
460 * <p>
461 * Input: Nothing.
462 * <p>
463 * Output: Nothing.
464 */
465 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
466 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
467 "android.settings.NETWORK_OPERATOR_SETTINGS";
468
469 /**
470 * Activity Action: Show settings for selection of 2G/3G.
471 * <p>
472 * In some cases, a matching Activity may not exist, so ensure you
473 * safeguard against this.
474 * <p>
475 * Input: Nothing.
476 * <p>
477 * Output: Nothing.
478 */
479 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
480 public static final String ACTION_DATA_ROAMING_SETTINGS =
481 "android.settings.DATA_ROAMING_SETTINGS";
482
483 /**
484 * Activity Action: Show settings for internal storage.
485 * <p>
486 * In some cases, a matching Activity may not exist, so ensure you
487 * safeguard against this.
488 * <p>
489 * Input: Nothing.
490 * <p>
491 * Output: Nothing.
492 */
493 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
494 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
495 "android.settings.INTERNAL_STORAGE_SETTINGS";
496 /**
497 * Activity Action: Show settings for memory card storage.
498 * <p>
499 * In some cases, a matching Activity may not exist, so ensure you
500 * safeguard against this.
501 * <p>
502 * Input: Nothing.
503 * <p>
504 * Output: Nothing.
505 */
506 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
507 public static final String ACTION_MEMORY_CARD_SETTINGS =
508 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700509
Justin Mattsonef340352010-01-13 21:05:46 -0800510 /**
511 * Activity Action: Show settings for global search.
512 * <p>
513 * In some cases, a matching Activity may not exist, so ensure you
514 * safeguard against this.
515 * <p>
516 * Input: Nothing.
517 * <p>
518 * Output: Nothing
519 */
520 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
521 public static final String ACTION_SEARCH_SETTINGS =
522 "android.search.action.SEARCH_SETTINGS";
523
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500524 /**
525 * Activity Action: Show general device information settings (serial
526 * number, software version, phone number, etc.).
527 * <p>
528 * In some cases, a matching Activity may not exist, so ensure you
529 * safeguard against this.
530 * <p>
531 * Input: Nothing.
532 * <p>
533 * Output: Nothing
534 */
535 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
536 public static final String ACTION_DEVICE_INFO_SETTINGS =
537 "android.settings.DEVICE_INFO_SETTINGS";
538
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800539 // End of Intent actions for Settings
540
Erikeebc8e22010-02-18 13:27:19 -0800541 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800542 * @hide - Private call() method on SettingsProvider to read from 'system' table.
543 */
544 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
545
546 /**
547 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
548 */
549 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
550
551 /**
Erikeebc8e22010-02-18 13:27:19 -0800552 * Activity Extra: Limit available options in launched activity based on the given authority.
553 * <p>
554 * This can be passed as an extra field in an Activity Intent with one or more syncable content
555 * provider's authorities as a String[]. This field is used by some intents to alter the
556 * behavior of the called activity.
557 * <p>
558 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
559 * on the authority given.
560 */
561 public static final String EXTRA_AUTHORITIES =
562 "authorities";
563
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900564 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
565
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800566 private static final String JID_RESOURCE_PREFIX = "android";
567
568 public static final String AUTHORITY = "settings";
569
570 private static final String TAG = "Settings";
Joe Onorato43a17652011-04-06 19:22:23 -0700571 private static final boolean LOCAL_LOGV = false || false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800572
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800573 public static class SettingNotFoundException extends AndroidException {
574 public SettingNotFoundException(String msg) {
575 super(msg);
576 }
577 }
578
579 /**
580 * Common base for tables of name/value settings.
581 */
582 public static class NameValueTable implements BaseColumns {
583 public static final String NAME = "name";
584 public static final String VALUE = "value";
585
586 protected static boolean putString(ContentResolver resolver, Uri uri,
587 String name, String value) {
588 // The database will take care of replacing duplicates.
589 try {
590 ContentValues values = new ContentValues();
591 values.put(NAME, name);
592 values.put(VALUE, value);
593 resolver.insert(uri, values);
594 return true;
595 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -0700596 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800597 return false;
598 }
599 }
600
601 public static Uri getUriFor(Uri uri, String name) {
602 return Uri.withAppendedPath(uri, name);
603 }
604 }
605
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800606 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800607 private static class NameValueCache {
608 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800609 private final Uri mUri;
610
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800611 private static final String[] SELECT_VALUE =
612 new String[] { Settings.NameValueTable.VALUE };
613 private static final String NAME_EQ_PLACEHOLDER = "name=?";
614
615 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -0800616 private final HashMap<String, String> mValues = new HashMap<String, String>();
617 private long mValuesVersion = 0;
618
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800619 // Initially null; set lazily and held forever. Synchronized on 'this'.
620 private IContentProvider mContentProvider = null;
621
622 // The method we'll call (or null, to not use) on the provider
623 // for the fast path of retrieving settings.
624 private final String mCallCommand;
625
626 public NameValueCache(String versionSystemProperty, Uri uri, String callCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800627 mVersionSystemProperty = versionSystemProperty;
628 mUri = uri;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800629 mCallCommand = callCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800630 }
631
Dan Egnor799f7212009-11-24 16:24:44 -0800632 public String getString(ContentResolver cr, String name) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800633 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -0800634
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800635 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -0800636 if (mValuesVersion != newValuesVersion) {
637 if (LOCAL_LOGV) {
638 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current " +
639 newValuesVersion + " != cached " + mValuesVersion);
640 }
641
642 mValues.clear();
643 mValuesVersion = newValuesVersion;
644 }
645
646 if (mValues.containsKey(name)) {
647 return mValues.get(name); // Could be null, that's OK -- negative caching
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800648 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800649 }
Dan Egnor799f7212009-11-24 16:24:44 -0800650
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800651 IContentProvider cp = null;
652 synchronized (this) {
653 cp = mContentProvider;
654 if (cp == null) {
655 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
656 }
657 }
658
659 // Try the fast path first, not using query(). If this
660 // fails (alternate Settings provider that doesn't support
661 // this interface?) then we fall back to the query/table
662 // interface.
663 if (mCallCommand != null) {
664 try {
665 Bundle b = cp.call(mCallCommand, name, null);
666 if (b != null) {
667 String value = b.getPairValue();
668 synchronized (this) {
669 mValues.put(name, value);
670 }
671 return value;
672 }
673 // If the response Bundle is null, we fall through
674 // to the query interface below.
675 } catch (RemoteException e) {
676 // Not supported by the remote side? Fall through
677 // to query().
678 }
679 }
680
Dan Egnor799f7212009-11-24 16:24:44 -0800681 Cursor c = null;
682 try {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800683 c = cp.query(mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
684 new String[]{name}, null);
Dan Egnor799f7212009-11-24 16:24:44 -0800685 if (c == null) {
686 Log.w(TAG, "Can't get key " + name + " from " + mUri);
687 return null;
688 }
689
690 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800691 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -0800692 mValues.put(name, value);
693 }
694 if (LOCAL_LOGV) {
695 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
696 name + " = " + (value == null ? "(null)" : value));
697 }
698 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800699 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -0800700 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
701 return null; // Return null, but don't cache it.
702 } finally {
703 if (c != null) c.close();
704 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800705 }
706 }
707
708 /**
709 * System settings, containing miscellaneous system preferences. This
710 * table holds simple name/value pairs. There are convenience
711 * functions for accessing individual settings entries.
712 */
713 public static final class System extends NameValueTable {
714 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
715
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800716 // Populated lazily, guarded by class object:
717 private static NameValueCache sNameValueCache = null;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700718
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800719 private static final HashSet<String> MOVED_TO_SECURE;
720 static {
721 MOVED_TO_SECURE = new HashSet<String>(30);
722 MOVED_TO_SECURE.add(Secure.ADB_ENABLED);
723 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
724 MOVED_TO_SECURE.add(Secure.BLUETOOTH_ON);
725 MOVED_TO_SECURE.add(Secure.DATA_ROAMING);
726 MOVED_TO_SECURE.add(Secure.DEVICE_PROVISIONED);
727 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
728 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
729 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Amith Yamasani156c4352010-03-05 17:10:03 -0800730 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
731 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
732 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800733 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
734 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
735 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
736 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
737 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
738 MOVED_TO_SECURE.add(Secure.USB_MASS_STORAGE_ENABLED);
739 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
740 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
741 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
742 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
743 MOVED_TO_SECURE.add(Secure.WIFI_ON);
744 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
745 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
746 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
747 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
748 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
749 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
750 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
751 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
752 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
753 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
754 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
755 }
756
757 /**
758 * Look up a name in the database.
759 * @param resolver to access the database with
760 * @param name to look up in the table
761 * @return the corresponding value, or null if not present
762 */
763 public synchronized static String getString(ContentResolver resolver, String name) {
764 if (MOVED_TO_SECURE.contains(name)) {
765 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
766 + " to android.provider.Settings.Secure, returning read-only value.");
767 return Secure.getString(resolver, name);
768 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800769 if (sNameValueCache == null) {
770 sNameValueCache = new NameValueCache(SYS_PROP_SETTING_VERSION, CONTENT_URI,
771 CALL_METHOD_GET_SYSTEM);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800772 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800773 return sNameValueCache.getString(resolver, name);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800774 }
775
776 /**
777 * Store a name/value pair into the database.
778 * @param resolver to access the database with
779 * @param name to store
780 * @param value to associate with the name
781 * @return true if the value was set, false on database errors
782 */
783 public static boolean putString(ContentResolver resolver, String name, String value) {
784 if (MOVED_TO_SECURE.contains(name)) {
785 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
786 + " to android.provider.Settings.Secure, value is unchanged.");
787 return false;
788 }
789 return putString(resolver, CONTENT_URI, name, value);
790 }
791
792 /**
793 * Construct the content URI for a particular name/value pair,
794 * useful for monitoring changes with a ContentObserver.
795 * @param name to look up in the table
796 * @return the corresponding content URI, or null if not present
797 */
798 public static Uri getUriFor(String name) {
799 if (MOVED_TO_SECURE.contains(name)) {
800 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
801 + " to android.provider.Settings.Secure, returning Secure URI.");
802 return Secure.getUriFor(Secure.CONTENT_URI, name);
803 }
804 return getUriFor(CONTENT_URI, name);
805 }
806
807 /**
808 * Convenience function for retrieving a single system settings value
809 * as an integer. Note that internally setting values are always
810 * stored as strings; this function converts the string to an integer
811 * for you. The default value will be returned if the setting is
812 * not defined or not an integer.
813 *
814 * @param cr The ContentResolver to access.
815 * @param name The name of the setting to retrieve.
816 * @param def Value to return if the setting is not defined.
817 *
818 * @return The setting's current value, or 'def' if it is not defined
819 * or not a valid integer.
820 */
821 public static int getInt(ContentResolver cr, String name, int def) {
822 String v = getString(cr, name);
823 try {
824 return v != null ? Integer.parseInt(v) : def;
825 } catch (NumberFormatException e) {
826 return def;
827 }
828 }
829
830 /**
831 * Convenience function for retrieving a single system settings value
832 * as an integer. Note that internally setting values are always
833 * stored as strings; this function converts the string to an integer
834 * for you.
835 * <p>
836 * This version does not take a default value. If the setting has not
837 * been set, or the string value is not a number,
838 * it throws {@link SettingNotFoundException}.
839 *
840 * @param cr The ContentResolver to access.
841 * @param name The name of the setting to retrieve.
842 *
843 * @throws SettingNotFoundException Thrown if a setting by the given
844 * name can't be found or the setting value is not an integer.
845 *
846 * @return The setting's current value.
847 */
848 public static int getInt(ContentResolver cr, String name)
849 throws SettingNotFoundException {
850 String v = getString(cr, name);
851 try {
852 return Integer.parseInt(v);
853 } catch (NumberFormatException e) {
854 throw new SettingNotFoundException(name);
855 }
856 }
857
858 /**
859 * Convenience function for updating a single settings value as an
860 * integer. This will either create a new entry in the table if the
861 * given name does not exist, or modify the value of the existing row
862 * with that name. Note that internally setting values are always
863 * stored as strings, so this function converts the given value to a
864 * string before storing it.
865 *
866 * @param cr The ContentResolver to access.
867 * @param name The name of the setting to modify.
868 * @param value The new value for the setting.
869 * @return true if the value was set, false on database errors
870 */
871 public static boolean putInt(ContentResolver cr, String name, int value) {
872 return putString(cr, name, Integer.toString(value));
873 }
874
875 /**
876 * Convenience function for retrieving a single system settings value
877 * as a {@code long}. Note that internally setting values are always
878 * stored as strings; this function converts the string to a {@code long}
879 * for you. The default value will be returned if the setting is
880 * not defined or not a {@code long}.
881 *
882 * @param cr The ContentResolver to access.
883 * @param name The name of the setting to retrieve.
884 * @param def Value to return if the setting is not defined.
885 *
886 * @return The setting's current value, or 'def' if it is not defined
887 * or not a valid {@code long}.
888 */
889 public static long getLong(ContentResolver cr, String name, long def) {
890 String valString = getString(cr, name);
891 long value;
892 try {
893 value = valString != null ? Long.parseLong(valString) : def;
894 } catch (NumberFormatException e) {
895 value = def;
896 }
897 return value;
898 }
899
900 /**
901 * Convenience function for retrieving a single system settings value
902 * as a {@code long}. Note that internally setting values are always
903 * stored as strings; this function converts the string to a {@code long}
904 * for you.
905 * <p>
906 * This version does not take a default value. If the setting has not
907 * been set, or the string value is not a number,
908 * it throws {@link SettingNotFoundException}.
909 *
910 * @param cr The ContentResolver to access.
911 * @param name The name of the setting to retrieve.
912 *
913 * @return The setting's current value.
914 * @throws SettingNotFoundException Thrown if a setting by the given
915 * name can't be found or the setting value is not an integer.
916 */
917 public static long getLong(ContentResolver cr, String name)
918 throws SettingNotFoundException {
919 String valString = getString(cr, name);
920 try {
921 return Long.parseLong(valString);
922 } catch (NumberFormatException e) {
923 throw new SettingNotFoundException(name);
924 }
925 }
926
927 /**
928 * Convenience function for updating a single settings value as a long
929 * integer. This will either create a new entry in the table if the
930 * given name does not exist, or modify the value of the existing row
931 * with that name. Note that internally setting values are always
932 * stored as strings, so this function converts the given value to a
933 * string before storing it.
934 *
935 * @param cr The ContentResolver to access.
936 * @param name The name of the setting to modify.
937 * @param value The new value for the setting.
938 * @return true if the value was set, false on database errors
939 */
940 public static boolean putLong(ContentResolver cr, String name, long value) {
941 return putString(cr, name, Long.toString(value));
942 }
943
944 /**
945 * Convenience function for retrieving a single system settings value
946 * as a floating point number. Note that internally setting values are
947 * always stored as strings; this function converts the string to an
948 * float for you. The default value will be returned if the setting
949 * is not defined or not a valid float.
950 *
951 * @param cr The ContentResolver to access.
952 * @param name The name of the setting to retrieve.
953 * @param def Value to return if the setting is not defined.
954 *
955 * @return The setting's current value, or 'def' if it is not defined
956 * or not a valid float.
957 */
958 public static float getFloat(ContentResolver cr, String name, float def) {
959 String v = getString(cr, name);
960 try {
961 return v != null ? Float.parseFloat(v) : def;
962 } catch (NumberFormatException e) {
963 return def;
964 }
965 }
966
967 /**
968 * Convenience function for retrieving a single system settings value
969 * as a float. Note that internally setting values are always
970 * stored as strings; this function converts the string to a float
971 * for you.
972 * <p>
973 * This version does not take a default value. If the setting has not
974 * been set, or the string value is not a number,
975 * it throws {@link SettingNotFoundException}.
976 *
977 * @param cr The ContentResolver to access.
978 * @param name The name of the setting to retrieve.
979 *
980 * @throws SettingNotFoundException Thrown if a setting by the given
981 * name can't be found or the setting value is not a float.
982 *
983 * @return The setting's current value.
984 */
985 public static float getFloat(ContentResolver cr, String name)
986 throws SettingNotFoundException {
987 String v = getString(cr, name);
Brian Muramatsue1d46982010-12-06 17:34:20 -0800988 if (v == null) {
989 throw new SettingNotFoundException(name);
990 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800991 try {
992 return Float.parseFloat(v);
993 } catch (NumberFormatException e) {
994 throw new SettingNotFoundException(name);
995 }
996 }
997
998 /**
999 * Convenience function for updating a single settings value as a
1000 * floating point number. This will either create a new entry in the
1001 * table if the given name does not exist, or modify the value of the
1002 * existing row with that name. Note that internally setting values
1003 * are always stored as strings, so this function converts the given
1004 * value to a string before storing it.
1005 *
1006 * @param cr The ContentResolver to access.
1007 * @param name The name of the setting to modify.
1008 * @param value The new value for the setting.
1009 * @return true if the value was set, false on database errors
1010 */
1011 public static boolean putFloat(ContentResolver cr, String name, float value) {
1012 return putString(cr, name, Float.toString(value));
1013 }
1014
1015 /**
1016 * Convenience function to read all of the current
1017 * configuration-related settings into a
1018 * {@link Configuration} object.
1019 *
1020 * @param cr The ContentResolver to access.
1021 * @param outConfig Where to place the configuration settings.
1022 */
1023 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
1024 outConfig.fontScale = Settings.System.getFloat(
1025 cr, FONT_SCALE, outConfig.fontScale);
1026 if (outConfig.fontScale < 0) {
1027 outConfig.fontScale = 1;
1028 }
1029 }
1030
1031 /**
1032 * Convenience function to write a batch of configuration-related
1033 * settings from a {@link Configuration} object.
1034 *
1035 * @param cr The ContentResolver to access.
1036 * @param config The settings to write.
1037 * @return true if the values were set, false on database errors
1038 */
1039 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
1040 return Settings.System.putFloat(cr, FONT_SCALE, config.fontScale);
1041 }
1042
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001043 /** @hide */
1044 public static boolean hasInterestingConfigurationChanges(int changes) {
1045 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1046 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001047
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001048 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
1049 return getInt(cr, SHOW_GTALK_SERVICE_STATUS, 0) != 0;
1050 }
1051
1052 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
1053 putInt(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0);
1054 }
1055
1056 /**
1057 * The content:// style URL for this table
1058 */
1059 public static final Uri CONTENT_URI =
1060 Uri.parse("content://" + AUTHORITY + "/system");
1061
1062 /**
1063 * Whether we keep the device on while the device is plugged in.
1064 * Supported values are:
1065 * <ul>
1066 * <li>{@code 0} to never stay on while plugged in</li>
1067 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
1068 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
1069 * </ul>
1070 * These values can be OR-ed together.
1071 */
1072 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
1073
1074 /**
1075 * What happens when the user presses the end call button if they're not
1076 * on a call.<br/>
1077 * <b>Values:</b><br/>
1078 * 0 - The end button does nothing.<br/>
1079 * 1 - The end button goes to the home screen.<br/>
1080 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1081 * 3 - The end button goes to the home screen. If the user is already on the
1082 * home screen, it puts the device to sleep.
1083 */
1084 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1085
1086 /**
David Brown458e8062010-03-08 21:52:11 -08001087 * END_BUTTON_BEHAVIOR value for "go home".
1088 * @hide
1089 */
1090 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1091
1092 /**
1093 * END_BUTTON_BEHAVIOR value for "go to sleep".
1094 * @hide
1095 */
1096 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
1097
1098 /**
1099 * END_BUTTON_BEHAVIOR default value.
1100 * @hide
1101 */
1102 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
1103
1104 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07001105 * Is advanced settings mode turned on. 0 == no, 1 == yes
1106 * @hide
1107 */
1108 public static final String ADVANCED_SETTINGS = "advanced_settings";
1109
1110 /**
1111 * ADVANCED_SETTINGS default value.
1112 * @hide
1113 */
1114 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
1115
1116 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001117 * Whether Airplane Mode is on.
1118 */
1119 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
1120
1121 /**
1122 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
1123 */
1124 public static final String RADIO_BLUETOOTH = "bluetooth";
1125
1126 /**
1127 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
1128 */
1129 public static final String RADIO_WIFI = "wifi";
1130
1131 /**
1132 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
1133 */
1134 public static final String RADIO_CELL = "cell";
1135
1136 /**
1137 * A comma separated list of radios that need to be disabled when airplane mode
1138 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
1139 * included in the comma separated list.
1140 */
1141 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
1142
1143 /**
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001144 * A comma separated list of radios that should to be disabled when airplane mode
1145 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
1146 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
1147 * will be turned off when entering airplane mode, but the user will be able to reenable
1148 * Wifi in the Settings app.
1149 *
1150 * {@hide}
1151 */
1152 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
1153
1154 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001155 * The policy for deciding when Wi-Fi should go to sleep (which will in
1156 * turn switch to using the mobile data as an Internet connection).
1157 * <p>
1158 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
1159 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
1160 * {@link #WIFI_SLEEP_POLICY_NEVER}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001161 */
1162 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
1163
1164 /**
1165 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
1166 * policy, which is to sleep shortly after the turning off
1167 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001168 */
1169 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
1170
1171 /**
1172 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
1173 * the device is on battery, and never go to sleep when the device is
1174 * plugged in.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001175 */
1176 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001177
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001178 /**
1179 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001180 */
1181 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001182
Irfan Sheriff31b62322010-08-30 12:26:00 -07001183 //TODO: deprecate static IP constants
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001184 /**
1185 * Whether to use static IP and other static network attributes.
1186 * <p>
1187 * Set to 1 for true and 0 for false.
1188 */
1189 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
1190
1191 /**
1192 * The static IP address.
1193 * <p>
1194 * Example: "192.168.1.51"
1195 */
1196 public static final String WIFI_STATIC_IP = "wifi_static_ip";
1197
1198 /**
1199 * If using static IP, the gateway's IP address.
1200 * <p>
1201 * Example: "192.168.1.1"
1202 */
1203 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
1204
1205 /**
1206 * If using static IP, the net mask.
1207 * <p>
1208 * Example: "255.255.255.0"
1209 */
1210 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
1211
1212 /**
1213 * If using static IP, the primary DNS's IP address.
1214 * <p>
1215 * Example: "192.168.1.1"
1216 */
1217 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
1218
1219 /**
1220 * If using static IP, the secondary DNS's IP address.
1221 * <p>
1222 * Example: "192.168.1.2"
1223 */
1224 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
1225
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001226
1227 /**
1228 * Determines whether remote devices may discover and/or connect to
1229 * this device.
1230 * <P>Type: INT</P>
1231 * 2 -- discoverable and connectable
1232 * 1 -- connectable but not discoverable
1233 * 0 -- neither connectable nor discoverable
1234 */
1235 public static final String BLUETOOTH_DISCOVERABILITY =
1236 "bluetooth_discoverability";
1237
1238 /**
1239 * Bluetooth discoverability timeout. If this value is nonzero, then
1240 * Bluetooth becomes discoverable for a certain number of seconds,
1241 * after which is becomes simply connectable. The value is in seconds.
1242 */
1243 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
1244 "bluetooth_discoverability_timeout";
1245
1246 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001247 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
1248 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001249 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001250 @Deprecated
1251 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001252
1253 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001254 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
1255 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001256 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001257 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001258 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
1259
1260 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001261 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08001262 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
1263 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001264 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001265 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001266 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
1267 "lock_pattern_tactile_feedback_enabled";
1268
1269
1270 /**
1271 * A formatted string of the next alarm that is set, or the empty string
1272 * if there is no alarm set.
1273 */
1274 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
1275
1276 /**
1277 * Scaling factor for fonts, float.
1278 */
1279 public static final String FONT_SCALE = "font_scale";
1280
1281 /**
1282 * Name of an application package to be debugged.
1283 */
1284 public static final String DEBUG_APP = "debug_app";
1285
1286 /**
1287 * If 1, when launching DEBUG_APP it will wait for the debugger before
1288 * starting user code. If 0, it will run normally.
1289 */
1290 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
1291
1292 /**
1293 * Whether or not to dim the screen. 0=no 1=yes
1294 */
1295 public static final String DIM_SCREEN = "dim_screen";
1296
1297 /**
1298 * The timeout before the screen turns off.
1299 */
1300 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
1301
1302 /**
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001303 * If 0, the compatibility mode is off for all applications.
1304 * If 1, older applications run under compatibility mode.
1305 * TODO: remove this settings before code freeze (bug/1907571)
1306 * @hide
1307 */
1308 public static final String COMPATIBILITY_MODE = "compatibility_mode";
1309
1310 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001311 * The screen backlight brightness between 0 and 255.
1312 */
1313 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
1314
1315 /**
Dan Murphy951764b2009-08-27 14:59:03 -05001316 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05001317 */
1318 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
1319
1320 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001321 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001322 */
1323 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
1324
1325 /**
1326 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001327 */
1328 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
1329
1330 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001331 * Control whether the process CPU usage meter should be shown.
1332 */
1333 public static final String SHOW_PROCESSES = "show_processes";
1334
1335 /**
1336 * If 1, the activity manager will aggressively finish activities and
1337 * processes as soon as they are no longer needed. If 0, the normal
1338 * extended lifetime is used.
1339 */
1340 public static final String ALWAYS_FINISH_ACTIVITIES =
1341 "always_finish_activities";
1342
1343
1344 /**
1345 * Ringer mode. This is used internally, changing this value will not
1346 * change the ringer mode. See AudioManager.
1347 */
1348 public static final String MODE_RINGER = "mode_ringer";
1349
1350 /**
1351 * Determines which streams are affected by ringer mode changes. The
1352 * stream type's bit should be set to 1 if it should be muted when going
1353 * into an inaudible ringer mode.
1354 */
1355 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
1356
1357 /**
1358 * Determines which streams are affected by mute. The
1359 * stream type's bit should be set to 1 if it should be muted when a mute request
1360 * is received.
1361 */
1362 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
1363
1364 /**
1365 * Whether vibrate is on for different events. This is used internally,
1366 * changing this value will not change the vibrate. See AudioManager.
1367 */
1368 public static final String VIBRATE_ON = "vibrate_on";
1369
1370 /**
1371 * Ringer volume. This is used internally, changing this value will not
1372 * change the volume. See AudioManager.
1373 */
1374 public static final String VOLUME_RING = "volume_ring";
1375
1376 /**
1377 * System/notifications volume. This is used internally, changing this
1378 * value will not change the volume. See AudioManager.
1379 */
1380 public static final String VOLUME_SYSTEM = "volume_system";
1381
1382 /**
1383 * Voice call volume. This is used internally, changing this value will
1384 * not change the volume. See AudioManager.
1385 */
1386 public static final String VOLUME_VOICE = "volume_voice";
1387
1388 /**
1389 * Music/media/gaming volume. This is used internally, changing this
1390 * value will not change the volume. See AudioManager.
1391 */
1392 public static final String VOLUME_MUSIC = "volume_music";
1393
1394 /**
1395 * Alarm volume. This is used internally, changing this
1396 * value will not change the volume. See AudioManager.
1397 */
1398 public static final String VOLUME_ALARM = "volume_alarm";
1399
1400 /**
1401 * Notification volume. This is used internally, changing this
1402 * value will not change the volume. See AudioManager.
1403 */
1404 public static final String VOLUME_NOTIFICATION = "volume_notification";
1405
1406 /**
Eric Laurent484d2882009-12-08 09:05:45 -08001407 * Bluetooth Headset volume. This is used internally, changing this value will
1408 * not change the volume. See AudioManager.
1409 */
1410 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
1411
1412 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001413 * Whether the notifications should use the ring volume (value of 1) or
1414 * a separate notification volume (value of 0). In most cases, users
1415 * will have this enabled so the notification and ringer volumes will be
1416 * the same. However, power users can disable this and use the separate
1417 * notification volume control.
1418 * <p>
1419 * Note: This is a one-off setting that will be removed in the future
1420 * when there is profile support. For this reason, it is kept hidden
1421 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001422 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001423 * @hide
1424 */
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001425 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001426 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001427
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001428 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05001429 * Whether silent mode should allow vibration feedback. This is used
1430 * internally in AudioService and the Sound settings activity to
1431 * coordinate decoupling of vibrate and silent modes. This setting
1432 * will likely be removed in a future release with support for
1433 * audio/vibe feedback profiles.
1434 *
1435 * @hide
1436 */
1437 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
1438
1439 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001440 * The mapping of stream type (integer) to its setting.
1441 */
1442 public static final String[] VOLUME_SETTINGS = {
1443 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08001444 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001445 };
1446
1447 /**
1448 * Appended to various volume related settings to record the previous
1449 * values before they the settings were affected by a silent/vibrate
1450 * ringer mode change.
1451 */
1452 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
1453
1454 /**
1455 * Persistent store for the system-wide default ringtone URI.
1456 * <p>
1457 * If you need to play the default ringtone at any given time, it is recommended
1458 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
1459 * to the set default ringtone at the time of playing.
1460 *
1461 * @see #DEFAULT_RINGTONE_URI
1462 */
1463 public static final String RINGTONE = "ringtone";
1464
1465 /**
1466 * A {@link Uri} that will point to the current default ringtone at any
1467 * given time.
1468 * <p>
1469 * If the current default ringtone is in the DRM provider and the caller
1470 * does not have permission, the exception will be a
1471 * FileNotFoundException.
1472 */
1473 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
1474
1475 /**
1476 * Persistent store for the system-wide default notification sound.
1477 *
1478 * @see #RINGTONE
1479 * @see #DEFAULT_NOTIFICATION_URI
1480 */
1481 public static final String NOTIFICATION_SOUND = "notification_sound";
1482
1483 /**
1484 * A {@link Uri} that will point to the current default notification
1485 * sound at any given time.
1486 *
1487 * @see #DEFAULT_RINGTONE_URI
1488 */
1489 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
1490
1491 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07001492 * Persistent store for the system-wide default alarm alert.
1493 *
1494 * @see #RINGTONE
1495 * @see #DEFAULT_ALARM_ALERT_URI
1496 */
1497 public static final String ALARM_ALERT = "alarm_alert";
1498
1499 /**
1500 * A {@link Uri} that will point to the current default alarm alert at
1501 * any given time.
1502 *
1503 * @see #DEFAULT_ALARM_ALERT_URI
1504 */
1505 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
1506
1507 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07001508 * Persistent store for the system default media button event receiver.
1509 *
1510 * @hide
1511 */
1512 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
1513
1514 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001515 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
1516 */
1517 public static final String TEXT_AUTO_REPLACE = "auto_replace";
1518
1519 /**
1520 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
1521 */
1522 public static final String TEXT_AUTO_CAPS = "auto_caps";
1523
1524 /**
1525 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
1526 * feature converts two spaces to a "." and space.
1527 */
1528 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001529
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001530 /**
1531 * Setting to showing password characters in text editors. 1 = On, 0 = Off
1532 */
1533 public static final String TEXT_SHOW_PASSWORD = "show_password";
1534
1535 public static final String SHOW_GTALK_SERVICE_STATUS =
1536 "SHOW_GTALK_SERVICE_STATUS";
1537
1538 /**
1539 * Name of activity to use for wallpaper on the home screen.
1540 */
1541 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
1542
1543 /**
1544 * Value to specify if the user prefers the date, time and time zone
1545 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
1546 */
1547 public static final String AUTO_TIME = "auto_time";
1548
1549 /**
Amith Yamasaniad450be2010-09-16 16:47:00 -07001550 * Value to specify if the user prefers the time zone
1551 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
1552 */
1553 public static final String AUTO_TIME_ZONE = "auto_time_zone";
1554
1555 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001556 * Display times as 12 or 24 hours
1557 * 12
1558 * 24
1559 */
1560 public static final String TIME_12_24 = "time_12_24";
1561
1562 /**
1563 * Date format string
1564 * mm/dd/yyyy
1565 * dd/mm/yyyy
1566 * yyyy/mm/dd
1567 */
1568 public static final String DATE_FORMAT = "date_format";
1569
1570 /**
1571 * Whether the setup wizard has been run before (on first boot), or if
1572 * it still needs to be run.
1573 *
1574 * nonzero = it has been run in the past
1575 * 0 = it has not been run in the past
1576 */
1577 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
1578
1579 /**
1580 * Scaling factor for normal window animations. Setting to 0 will disable window
1581 * animations.
1582 */
1583 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
1584
1585 /**
1586 * Scaling factor for activity transition animations. Setting to 0 will disable window
1587 * animations.
1588 */
1589 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
1590
1591 /**
1592 * Scaling factor for normal window animations. Setting to 0 will disable window
1593 * animations.
1594 * @hide
1595 */
1596 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
1597
1598 /**
1599 * Control whether the accelerometer will be used to change screen
1600 * orientation. If 0, it will not be used unless explicitly requested
1601 * by the application; if 1, it will be used by default unless explicitly
1602 * disabled by the application.
1603 */
1604 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
1605
1606 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04001607 * Default screen rotation when no other policy applies.
1608 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
1609 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08001610 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04001611 *
1612 * @see Display#getRotation
1613 */
1614 public static final String USER_ROTATION = "user_rotation";
1615
1616 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001617 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
1618 * boolean (1 or 0).
1619 */
1620 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
1621
1622 /**
David Kraused0f67152009-06-13 18:01:13 -05001623 * CDMA only settings
1624 * DTMF tone type played by the dialer when dialing.
1625 * 0 = Normal
1626 * 1 = Long
1627 * @hide
1628 */
1629 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
1630
1631 /**
1632 * CDMA only settings
1633 * Emergency Tone 0 = Off
1634 * 1 = Alert
1635 * 2 = Vibrate
1636 * @hide
1637 */
1638 public static final String EMERGENCY_TONE = "emergency_tone";
1639
1640 /**
1641 * CDMA only settings
1642 * Whether the auto retry is enabled. The value is
1643 * boolean (1 or 0).
1644 * @hide
1645 */
1646 public static final String CALL_AUTO_RETRY = "call_auto_retry";
1647
1648 /**
1649 * Whether the hearing aid is enabled. The value is
1650 * boolean (1 or 0).
1651 * @hide
1652 */
1653 public static final String HEARING_AID = "hearing_aid";
1654
1655 /**
1656 * CDMA only settings
1657 * TTY Mode
1658 * 0 = OFF
1659 * 1 = FULL
1660 * 2 = VCO
1661 * 3 = HCO
1662 * @hide
1663 */
1664 public static final String TTY_MODE = "tty_mode";
1665
1666 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001667 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
1668 * boolean (1 or 0).
1669 */
1670 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001671
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001672 /**
1673 * Whether the haptic feedback (long presses, ...) are enabled. The value is
1674 * boolean (1 or 0).
1675 */
1676 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07001677
Mike LeBeau48603e72009-06-05 00:27:00 +01001678 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01001679 * @deprecated Each application that shows web suggestions should have its own
1680 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01001681 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01001682 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01001683 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001684
-b master501eec92009-07-06 13:53:11 -07001685 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08001686 * Whether the notification LED should repeatedly flash when a notification is
1687 * pending. The value is boolean (1 or 0).
1688 * @hide
1689 */
1690 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
1691
1692 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08001693 * Show pointer location on screen?
1694 * 0 = no
1695 * 1 = yes
1696 * @hide
1697 */
1698 public static final String POINTER_LOCATION = "pointer_location";
1699
1700 /**
Jeff Brown4519f072011-01-23 13:16:01 -08001701 * Log raw orientation data from {@link WindowOrientationListener} for use with the
1702 * orientationplot.py tool.
1703 * 0 = no
1704 * 1 = yes
1705 * @hide
1706 */
1707 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
1708 "window_orientation_listener_log";
1709
1710 /**
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05001711 * Whether to play a sound for low-battery alerts.
1712 * @hide
1713 */
1714 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
1715
1716 /**
1717 * Whether to play a sound for dock events.
1718 * @hide
1719 */
1720 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
1721
1722 /**
1723 * Whether to play sounds when the keyguard is shown and dismissed.
1724 * @hide
1725 */
1726 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
1727
1728 /**
1729 * URI for the low battery sound file.
1730 * @hide
1731 */
1732 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
1733
1734 /**
1735 * URI for the desk dock "in" event sound.
1736 * @hide
1737 */
1738 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
1739
1740 /**
1741 * URI for the desk dock "out" event sound.
1742 * @hide
1743 */
1744 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
1745
1746 /**
1747 * URI for the car dock "in" event sound.
1748 * @hide
1749 */
1750 public static final String CAR_DOCK_SOUND = "car_dock_sound";
1751
1752 /**
1753 * URI for the car dock "out" event sound.
1754 * @hide
1755 */
1756 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
1757
1758 /**
1759 * URI for the "device locked" (keyguard shown) sound.
1760 * @hide
1761 */
1762 public static final String LOCK_SOUND = "lock_sound";
1763
1764 /**
1765 * URI for the "device unlocked" (keyguard dismissed) sound.
1766 * @hide
1767 */
1768 public static final String UNLOCK_SOUND = "unlock_sound";
1769
1770 /**
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04001771 * True if we should appear as a PTP device instead of MTP.
1772 * @hide
1773 */
1774 public static final String USE_PTP_INTERFACE = "use_ptp_interface";
1775
1776 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08001777 * Receive incoming SIP calls?
1778 * 0 = no
1779 * 1 = yes
1780 * @hide
1781 */
1782 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
1783
1784 /**
1785 * Call Preference String.
1786 * "SIP_ALWAYS" : Always use SIP with network access
1787 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
1788 * "SIP_ASK_ME_EACH_TIME" : Always ask me each time
1789 * @hide
1790 */
1791 public static final String SIP_CALL_OPTIONS = "sip_call_options";
1792
1793 /**
1794 * One of the sip call options: Always use SIP with network access.
1795 * @hide
1796 */
1797 public static final String SIP_ALWAYS = "SIP_ALWAYS";
1798
1799 /**
1800 * One of the sip call options: Only if destination is a SIP address.
1801 * @hide
1802 */
1803 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
1804
1805 /**
1806 * One of the sip call options: Always ask me each time.
1807 * @hide
1808 */
1809 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
1810
1811 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07001812 * Pointer speed setting.
1813 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
1814 * -7 = slowest
1815 * 0 = default speed
1816 * +7 = fastest
1817 * @hide
1818 */
1819 public static final String POINTER_SPEED = "pointer_speed";
1820
1821 /**
-b master501eec92009-07-06 13:53:11 -07001822 * Settings to backup. This is here so that it's in the same place as the settings
1823 * keys and easy to update.
1824 * @hide
1825 */
1826 public static final String[] SETTINGS_TO_BACKUP = {
1827 STAY_ON_WHILE_PLUGGED_IN,
-b master501eec92009-07-06 13:53:11 -07001828 WIFI_USE_STATIC_IP,
1829 WIFI_STATIC_IP,
1830 WIFI_STATIC_GATEWAY,
1831 WIFI_STATIC_NETMASK,
1832 WIFI_STATIC_DNS1,
1833 WIFI_STATIC_DNS2,
1834 BLUETOOTH_DISCOVERABILITY,
1835 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
1836 DIM_SCREEN,
1837 SCREEN_OFF_TIMEOUT,
1838 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07001839 SCREEN_BRIGHTNESS_MODE,
-b master501eec92009-07-06 13:53:11 -07001840 VIBRATE_ON,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07001841 MODE_RINGER,
1842 MODE_RINGER_STREAMS_AFFECTED,
1843 MUTE_STREAMS_AFFECTED,
1844 VOLUME_VOICE,
1845 VOLUME_SYSTEM,
1846 VOLUME_RING,
1847 VOLUME_MUSIC,
1848 VOLUME_ALARM,
1849 VOLUME_NOTIFICATION,
Eric Laurent484d2882009-12-08 09:05:45 -08001850 VOLUME_BLUETOOTH_SCO,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07001851 VOLUME_VOICE + APPEND_FOR_LAST_AUDIBLE,
1852 VOLUME_SYSTEM + APPEND_FOR_LAST_AUDIBLE,
1853 VOLUME_RING + APPEND_FOR_LAST_AUDIBLE,
1854 VOLUME_MUSIC + APPEND_FOR_LAST_AUDIBLE,
1855 VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE,
1856 VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE,
Eric Laurent484d2882009-12-08 09:05:45 -08001857 VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE,
Daniel Sandler1c7fa482010-03-10 09:45:01 -05001858 VIBRATE_IN_SILENT,
-b master501eec92009-07-06 13:53:11 -07001859 TEXT_AUTO_REPLACE,
1860 TEXT_AUTO_CAPS,
1861 TEXT_AUTO_PUNCTUATE,
1862 TEXT_SHOW_PASSWORD,
1863 AUTO_TIME,
Amith Yamasaniad450be2010-09-16 16:47:00 -07001864 AUTO_TIME_ZONE,
-b master501eec92009-07-06 13:53:11 -07001865 TIME_12_24,
1866 DATE_FORMAT,
1867 ACCELEROMETER_ROTATION,
Daniel Sandlerb73617d2010-08-17 00:41:00 -04001868 USER_ROTATION,
-b master501eec92009-07-06 13:53:11 -07001869 DTMF_TONE_WHEN_DIALING,
1870 DTMF_TONE_TYPE_WHEN_DIALING,
1871 EMERGENCY_TONE,
1872 CALL_AUTO_RETRY,
1873 HEARING_AID,
1874 TTY_MODE,
1875 SOUND_EFFECTS_ENABLED,
1876 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate14c2d792010-02-25 16:49:44 -08001877 POWER_SOUNDS_ENABLED,
1878 DOCK_SOUNDS_ENABLED,
1879 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08001880 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04001881 NOTIFICATION_LIGHT_PULSE,
1882 USE_PTP_INTERFACE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08001883 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07001884 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07001885 POINTER_SPEED,
-b master501eec92009-07-06 13:53:11 -07001886 };
1887
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001888 // Settings moved to Settings.Secure
1889
1890 /**
Mike Lockwood460ae0c2009-04-02 22:33:27 -07001891 * @deprecated Use {@link android.provider.Settings.Secure#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001892 * instead
1893 */
1894 @Deprecated
1895 public static final String ADB_ENABLED = Secure.ADB_ENABLED;
1896
1897 /**
1898 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
1899 */
1900 @Deprecated
1901 public static final String ANDROID_ID = Secure.ANDROID_ID;
1902
1903 /**
1904 * @deprecated Use {@link android.provider.Settings.Secure#BLUETOOTH_ON} instead
1905 */
1906 @Deprecated
1907 public static final String BLUETOOTH_ON = Secure.BLUETOOTH_ON;
1908
1909 /**
1910 * @deprecated Use {@link android.provider.Settings.Secure#DATA_ROAMING} instead
1911 */
1912 @Deprecated
1913 public static final String DATA_ROAMING = Secure.DATA_ROAMING;
1914
1915 /**
1916 * @deprecated Use {@link android.provider.Settings.Secure#DEVICE_PROVISIONED} instead
1917 */
1918 @Deprecated
1919 public static final String DEVICE_PROVISIONED = Secure.DEVICE_PROVISIONED;
1920
1921 /**
1922 * @deprecated Use {@link android.provider.Settings.Secure#HTTP_PROXY} instead
1923 */
1924 @Deprecated
1925 public static final String HTTP_PROXY = Secure.HTTP_PROXY;
1926
1927 /**
1928 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
1929 */
1930 @Deprecated
1931 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001932
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001933 /**
1934 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
1935 * instead
1936 */
1937 @Deprecated
1938 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
1939
1940 /**
1941 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
1942 */
1943 @Deprecated
1944 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001945
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001946 /**
1947 * @deprecated Use {@link android.provider.Settings.Secure#NETWORK_PREFERENCE} instead
1948 */
1949 @Deprecated
1950 public static final String NETWORK_PREFERENCE = Secure.NETWORK_PREFERENCE;
1951
1952 /**
1953 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
1954 * instead
1955 */
1956 @Deprecated
1957 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
1958
1959 /**
1960 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
1961 * instead
1962 */
1963 @Deprecated
1964 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
1965
1966 /**
1967 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
1968 * instead
1969 */
1970 @Deprecated
1971 public static final String PARENTAL_CONTROL_REDIRECT_URL =
1972 Secure.PARENTAL_CONTROL_REDIRECT_URL;
1973
1974 /**
1975 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
1976 */
1977 @Deprecated
1978 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
1979
1980 /**
1981 * @deprecated Use {@link android.provider.Settings.Secure#USB_MASS_STORAGE_ENABLED} instead
1982 */
1983 @Deprecated
1984 public static final String USB_MASS_STORAGE_ENABLED = Secure.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001985
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001986 /**
1987 * @deprecated Use {@link android.provider.Settings.Secure#USE_GOOGLE_MAIL} instead
1988 */
1989 @Deprecated
1990 public static final String USE_GOOGLE_MAIL = Secure.USE_GOOGLE_MAIL;
1991
Dianne Hackborn4a51c202009-08-21 15:14:02 -07001992 /**
1993 * @deprecated Use
1994 * {@link android.provider.Settings.Secure#WIFI_MAX_DHCP_RETRY_COUNT} instead
1995 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001996 @Deprecated
1997 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Secure.WIFI_MAX_DHCP_RETRY_COUNT;
1998
Dianne Hackborn4a51c202009-08-21 15:14:02 -07001999 /**
2000 * @deprecated Use
2001 * {@link android.provider.Settings.Secure#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
2002 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002003 @Deprecated
2004 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
2005 Secure.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
2006
2007 /**
2008 * @deprecated Use
2009 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
2010 */
2011 @Deprecated
2012 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
2013 Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
2014
2015 /**
2016 * @deprecated Use
2017 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
2018 */
2019 @Deprecated
2020 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
2021 Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002022
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002023 /**
2024 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_NUM_OPEN_NETWORKS_KEPT}
2025 * instead
2026 */
2027 @Deprecated
2028 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Secure.WIFI_NUM_OPEN_NETWORKS_KEPT;
2029
2030 /**
2031 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_ON} instead
2032 */
2033 @Deprecated
2034 public static final String WIFI_ON = Secure.WIFI_ON;
2035
2036 /**
2037 * @deprecated Use
2038 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
2039 * instead
2040 */
2041 @Deprecated
2042 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
2043 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
2044
2045 /**
2046 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
2047 */
2048 @Deprecated
2049 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
2050
2051 /**
2052 * @deprecated Use
2053 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
2054 */
2055 @Deprecated
2056 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
2057 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002058
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002059 /**
2060 * @deprecated Use
2061 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
2062 */
2063 @Deprecated
2064 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
2065 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
2066
2067 /**
2068 * @deprecated Use
2069 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
2070 * instead
2071 */
2072 @Deprecated
2073 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
2074 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
2075
2076 /**
2077 * @deprecated Use
2078 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
2079 */
2080 @Deprecated
2081 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
2082 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
2083
2084 /**
2085 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
2086 * instead
2087 */
2088 @Deprecated
2089 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
2090
2091 /**
2092 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ON} instead
2093 */
2094 @Deprecated
2095 public static final String WIFI_WATCHDOG_ON = Secure.WIFI_WATCHDOG_ON;
2096
2097 /**
2098 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
2099 */
2100 @Deprecated
2101 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
2102
2103 /**
2104 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
2105 * instead
2106 */
2107 @Deprecated
2108 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
2109
2110 /**
2111 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
2112 * instead
2113 */
2114 @Deprecated
2115 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
2116 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
2117 }
2118
2119 /**
2120 * Secure system settings, containing system preferences that applications
2121 * can read but are not allowed to write. These are for preferences that
2122 * the user must explicitly modify through the system UI or specialized
2123 * APIs for those values, not modified directly by applications.
2124 */
2125 public static final class Secure extends NameValueTable {
2126 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
2127
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002128 // Populated lazily, guarded by class object:
2129 private static NameValueCache sNameValueCache = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002130
2131 /**
2132 * Look up a name in the database.
2133 * @param resolver to access the database with
2134 * @param name to look up in the table
2135 * @return the corresponding value, or null if not present
2136 */
2137 public synchronized static String getString(ContentResolver resolver, String name) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002138 if (sNameValueCache == null) {
2139 sNameValueCache = new NameValueCache(SYS_PROP_SETTING_VERSION, CONTENT_URI,
2140 CALL_METHOD_GET_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002141 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002142 return sNameValueCache.getString(resolver, name);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002143 }
2144
2145 /**
2146 * Store a name/value pair into the database.
2147 * @param resolver to access the database with
2148 * @param name to store
2149 * @param value to associate with the name
2150 * @return true if the value was set, false on database errors
2151 */
2152 public static boolean putString(ContentResolver resolver,
2153 String name, String value) {
2154 return putString(resolver, CONTENT_URI, name, value);
2155 }
2156
2157 /**
2158 * Construct the content URI for a particular name/value pair,
2159 * useful for monitoring changes with a ContentObserver.
2160 * @param name to look up in the table
2161 * @return the corresponding content URI, or null if not present
2162 */
2163 public static Uri getUriFor(String name) {
2164 return getUriFor(CONTENT_URI, name);
2165 }
2166
2167 /**
2168 * Convenience function for retrieving a single secure settings value
2169 * as an integer. Note that internally setting values are always
2170 * stored as strings; this function converts the string to an integer
2171 * for you. The default value will be returned if the setting is
2172 * not defined or not an integer.
2173 *
2174 * @param cr The ContentResolver to access.
2175 * @param name The name of the setting to retrieve.
2176 * @param def Value to return if the setting is not defined.
2177 *
2178 * @return The setting's current value, or 'def' if it is not defined
2179 * or not a valid integer.
2180 */
2181 public static int getInt(ContentResolver cr, String name, int def) {
2182 String v = getString(cr, name);
2183 try {
2184 return v != null ? Integer.parseInt(v) : def;
2185 } catch (NumberFormatException e) {
2186 return def;
2187 }
2188 }
2189
2190 /**
2191 * Convenience function for retrieving a single secure settings value
2192 * as an integer. Note that internally setting values are always
2193 * stored as strings; this function converts the string to an integer
2194 * for you.
2195 * <p>
2196 * This version does not take a default value. If the setting has not
2197 * been set, or the string value is not a number,
2198 * it throws {@link SettingNotFoundException}.
2199 *
2200 * @param cr The ContentResolver to access.
2201 * @param name The name of the setting to retrieve.
2202 *
2203 * @throws SettingNotFoundException Thrown if a setting by the given
2204 * name can't be found or the setting value is not an integer.
2205 *
2206 * @return The setting's current value.
2207 */
2208 public static int getInt(ContentResolver cr, String name)
2209 throws SettingNotFoundException {
2210 String v = getString(cr, name);
2211 try {
2212 return Integer.parseInt(v);
2213 } catch (NumberFormatException e) {
2214 throw new SettingNotFoundException(name);
2215 }
2216 }
2217
2218 /**
2219 * Convenience function for updating a single settings value as an
2220 * integer. This will either create a new entry in the table if the
2221 * given name does not exist, or modify the value of the existing row
2222 * with that name. Note that internally setting values are always
2223 * stored as strings, so this function converts the given value to a
2224 * string before storing it.
2225 *
2226 * @param cr The ContentResolver to access.
2227 * @param name The name of the setting to modify.
2228 * @param value The new value for the setting.
2229 * @return true if the value was set, false on database errors
2230 */
2231 public static boolean putInt(ContentResolver cr, String name, int value) {
2232 return putString(cr, name, Integer.toString(value));
2233 }
2234
2235 /**
2236 * Convenience function for retrieving a single secure settings value
2237 * as a {@code long}. Note that internally setting values are always
2238 * stored as strings; this function converts the string to a {@code long}
2239 * for you. The default value will be returned if the setting is
2240 * not defined or not a {@code long}.
2241 *
2242 * @param cr The ContentResolver to access.
2243 * @param name The name of the setting to retrieve.
2244 * @param def Value to return if the setting is not defined.
2245 *
2246 * @return The setting's current value, or 'def' if it is not defined
2247 * or not a valid {@code long}.
2248 */
2249 public static long getLong(ContentResolver cr, String name, long def) {
2250 String valString = getString(cr, name);
2251 long value;
2252 try {
2253 value = valString != null ? Long.parseLong(valString) : def;
2254 } catch (NumberFormatException e) {
2255 value = def;
2256 }
2257 return value;
2258 }
2259
2260 /**
2261 * Convenience function for retrieving a single secure settings value
2262 * as a {@code long}. Note that internally setting values are always
2263 * stored as strings; this function converts the string to a {@code long}
2264 * for you.
2265 * <p>
2266 * This version does not take a default value. If the setting has not
2267 * been set, or the string value is not a number,
2268 * it throws {@link SettingNotFoundException}.
2269 *
2270 * @param cr The ContentResolver to access.
2271 * @param name The name of the setting to retrieve.
2272 *
2273 * @return The setting's current value.
2274 * @throws SettingNotFoundException Thrown if a setting by the given
2275 * name can't be found or the setting value is not an integer.
2276 */
2277 public static long getLong(ContentResolver cr, String name)
2278 throws SettingNotFoundException {
2279 String valString = getString(cr, name);
2280 try {
2281 return Long.parseLong(valString);
2282 } catch (NumberFormatException e) {
2283 throw new SettingNotFoundException(name);
2284 }
2285 }
2286
2287 /**
2288 * Convenience function for updating a secure settings value as a long
2289 * integer. This will either create a new entry in the table if the
2290 * given name does not exist, or modify the value of the existing row
2291 * with that name. Note that internally setting values are always
2292 * stored as strings, so this function converts the given value to a
2293 * string before storing it.
2294 *
2295 * @param cr The ContentResolver to access.
2296 * @param name The name of the setting to modify.
2297 * @param value The new value for the setting.
2298 * @return true if the value was set, false on database errors
2299 */
2300 public static boolean putLong(ContentResolver cr, String name, long value) {
2301 return putString(cr, name, Long.toString(value));
2302 }
2303
2304 /**
2305 * Convenience function for retrieving a single secure settings value
2306 * as a floating point number. Note that internally setting values are
2307 * always stored as strings; this function converts the string to an
2308 * float for you. The default value will be returned if the setting
2309 * is not defined or not a valid float.
2310 *
2311 * @param cr The ContentResolver to access.
2312 * @param name The name of the setting to retrieve.
2313 * @param def Value to return if the setting is not defined.
2314 *
2315 * @return The setting's current value, or 'def' if it is not defined
2316 * or not a valid float.
2317 */
2318 public static float getFloat(ContentResolver cr, String name, float def) {
2319 String v = getString(cr, name);
2320 try {
2321 return v != null ? Float.parseFloat(v) : def;
2322 } catch (NumberFormatException e) {
2323 return def;
2324 }
2325 }
2326
2327 /**
2328 * Convenience function for retrieving a single secure settings value
2329 * as a float. Note that internally setting values are always
2330 * stored as strings; this function converts the string to a float
2331 * for you.
2332 * <p>
2333 * This version does not take a default value. If the setting has not
2334 * been set, or the string value is not a number,
2335 * it throws {@link SettingNotFoundException}.
2336 *
2337 * @param cr The ContentResolver to access.
2338 * @param name The name of the setting to retrieve.
2339 *
2340 * @throws SettingNotFoundException Thrown if a setting by the given
2341 * name can't be found or the setting value is not a float.
2342 *
2343 * @return The setting's current value.
2344 */
2345 public static float getFloat(ContentResolver cr, String name)
2346 throws SettingNotFoundException {
2347 String v = getString(cr, name);
Brian Muramatsue1d46982010-12-06 17:34:20 -08002348 if (v == null) {
2349 throw new SettingNotFoundException(name);
2350 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002351 try {
2352 return Float.parseFloat(v);
2353 } catch (NumberFormatException e) {
2354 throw new SettingNotFoundException(name);
2355 }
2356 }
2357
2358 /**
2359 * Convenience function for updating a single settings value as a
2360 * floating point number. This will either create a new entry in the
2361 * table if the given name does not exist, or modify the value of the
2362 * existing row with that name. Note that internally setting values
2363 * are always stored as strings, so this function converts the given
2364 * value to a string before storing it.
2365 *
2366 * @param cr The ContentResolver to access.
2367 * @param name The name of the setting to modify.
2368 * @param value The new value for the setting.
2369 * @return true if the value was set, false on database errors
2370 */
2371 public static boolean putFloat(ContentResolver cr, String name, float value) {
2372 return putString(cr, name, Float.toString(value));
2373 }
2374
2375 /**
2376 * The content:// style URL for this table
2377 */
2378 public static final Uri CONTENT_URI =
2379 Uri.parse("content://" + AUTHORITY + "/secure");
2380
2381 /**
2382 * Whether ADB is enabled.
2383 */
2384 public static final String ADB_ENABLED = "adb_enabled";
2385
2386 /**
2387 * Setting to allow mock locations and location provider status to be injected into the
2388 * LocationManager service for testing purposes during application development. These
2389 * locations and status values override actual location and status information generated
2390 * by network, gps, or other location providers.
2391 */
2392 public static final String ALLOW_MOCK_LOCATION = "mock_location";
2393
2394 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08002395 * A 64-bit number (as a hex string) that is randomly
2396 * generated on the device's first boot and should remain
2397 * constant for the lifetime of the device. (The value may
2398 * change if a factory reset is performed on the device.)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002399 */
2400 public static final String ANDROID_ID = "android_id";
2401
2402 /**
2403 * Whether bluetooth is enabled/disabled
2404 * 0=disabled. 1=enabled.
2405 */
2406 public static final String BLUETOOTH_ON = "bluetooth_on";
2407
2408 /**
2409 * Get the key that retrieves a bluetooth headset's priority.
2410 * @hide
2411 */
2412 public static final String getBluetoothHeadsetPriorityKey(String address) {
2413 return ("bluetooth_headset_priority_" + address.toUpperCase());
2414 }
2415
2416 /**
2417 * Get the key that retrieves a bluetooth a2dp sink's priority.
2418 * @hide
2419 */
2420 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
2421 return ("bluetooth_a2dp_sink_priority_" + address.toUpperCase());
2422 }
2423
2424 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07002425 * Get the key that retrieves a bluetooth Input Device's priority.
2426 * @hide
2427 */
2428 public static final String getBluetoothInputDevicePriorityKey(String address) {
2429 return ("bluetooth_input_device_priority_" + address.toUpperCase());
2430 }
2431
2432 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002433 * Whether or not data roaming is enabled. (0 = false, 1 = true)
2434 */
2435 public static final String DATA_ROAMING = "data_roaming";
2436
2437 /**
2438 * Setting to record the input method used by default, holding the ID
2439 * of the desired method.
2440 */
2441 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
2442
2443 /**
satokab751aa2010-09-14 19:17:36 +09002444 * Setting to record the input method subtype used by default, holding the ID
2445 * of the desired method.
2446 */
2447 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
2448 "selected_input_method_subtype";
2449
2450 /**
satok723a27e2010-11-11 14:58:11 +09002451 * Setting to record the history of input method subtype, holding the pair of ID of IME
2452 * and its last used subtype.
2453 * @hide
2454 */
2455 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
2456 "input_methods_subtype_history";
2457
2458 /**
satok5c58dfc2010-12-14 21:54:47 +09002459 * Setting to record the visibility of input method selector
2460 */
2461 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
2462 "input_method_selector_visibility";
2463
2464 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002465 * Whether the device has been provisioned (0 = false, 1 = true)
2466 */
2467 public static final String DEVICE_PROVISIONED = "device_provisioned";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002468
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002469 /**
2470 * List of input methods that are currently enabled. This is a string
2471 * containing the IDs of all enabled input methods, each ID separated
2472 * by ':'.
2473 */
2474 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002475
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002476 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07002477 * List of system input methods that are currently disabled. This is a string
2478 * containing the IDs of all disabled input methods, each ID separated
2479 * by ':'.
2480 * @hide
2481 */
2482 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
2483
2484 /**
Robert Greenwalt434203a2010-10-11 16:00:27 -07002485 * Host name and port for global http proxy. Uses ':' seperator for between host and port
2486 * TODO - deprecate in favor of global_http_proxy_host, etc
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002487 */
2488 public static final String HTTP_PROXY = "http_proxy";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002489
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002490 /**
Robert Greenwalt434203a2010-10-11 16:00:27 -07002491 * Host name for global http proxy. Set via ConnectivityManager.
2492 * @hide
2493 */
2494 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
2495
2496 /**
2497 * Integer host port for global http proxy. Set via ConnectivityManager.
2498 * @hide
2499 */
2500 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
2501
2502 /**
Oscar Montemayor16fb7912010-08-02 09:38:48 -07002503 * Exclusion list for global proxy. This string contains a list of comma-separated
2504 * domains where the global proxy does not apply. Domains should be listed in a comma-
2505 * separated list. Example of acceptable formats: ".domain1.com,my.domain2.com"
Robert Greenwalt434203a2010-10-11 16:00:27 -07002506 * Use ConnectivityManager to set/get.
Oscar Montemayor16fb7912010-08-02 09:38:48 -07002507 * @hide
2508 */
Robert Greenwalt434203a2010-10-11 16:00:27 -07002509 public static final String GLOBAL_HTTP_PROXY_EXCLUSION_LIST =
2510 "global_http_proxy_exclusion_list";
Oscar Montemayor16fb7912010-08-02 09:38:48 -07002511
2512 /**
2513 * Enables the UI setting to allow the user to specify the global HTTP proxy
2514 * and associated exclusion list.
2515 * @hide
2516 */
2517 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
2518
2519 /**
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07002520 * Setting for default DNS in case nobody suggests one
2521 * @hide
2522 */
2523 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
2524
2525 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002526 * Whether the package installer should allow installation of apps downloaded from
2527 * sources other than the Android Market (vending machine).
2528 *
2529 * 1 = allow installing from other sources
2530 * 0 = only allow installing from the Android Market
2531 */
2532 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002533
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002534 /**
2535 * Comma-separated list of location providers that activities may access.
2536 */
2537 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002538
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002539 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002540 * Whether autolock is enabled (0 = false, 1 = true)
2541 */
2542 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
2543
2544 /**
2545 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
2546 */
2547 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2548
2549 /**
2550 * Whether lock pattern will vibrate as user enters (0 = false, 1 = true)
2551 */
2552 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2553 "lock_pattern_tactile_feedback_enabled";
2554
2555 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07002556 * This preference allows the device to be locked given time after screen goes off,
2557 * subject to current DeviceAdmin policy limits.
2558 * @hide
2559 */
2560 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
2561
2562
2563 /**
Jim Miller253a5ef2010-10-13 20:57:29 -07002564 * This preference contains the string that shows for owner info on LockScren.
2565 * @hide
2566 */
2567 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
2568
2569 /**
2570 * This preference enables showing the owner info on LockScren.
2571 * @hide
2572 */
2573 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
2574 "lock_screen_owner_info_enabled";
2575
2576 /**
Joe Onorato571ae902011-05-24 13:48:43 -07002577 * The saved value for WindowManagerService.setForcedDisplaySize().
2578 * Two integers separated by a comma. If unset, then use the real display size.
2579 * @hide
2580 */
2581 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
2582
2583 /**
Mike Lockwoodbcab8df2009-06-25 16:39:09 -04002584 * Whether assisted GPS should be enabled or not.
2585 * @hide
2586 */
2587 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
2588
2589 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002590 * The Logging ID (a unique 64-bit value) as a hex string.
2591 * Used as a pseudonymous identifier for logging.
2592 * @deprecated This identifier is poorly initialized and has
2593 * many collisions. It should not be used.
2594 */
2595 @Deprecated
2596 public static final String LOGGING_ID = "logging_id";
2597
2598 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002599 * User preference for which network(s) should be used. Only the
2600 * connectivity service should touch this.
2601 */
2602 public static final String NETWORK_PREFERENCE = "network_preference";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002603
2604 /**
Robert Greenwalt2a091d72010-02-11 18:18:40 -08002605 * Used to disable Tethering on a device - defaults to true
2606 * @hide
2607 */
2608 public static final String TETHER_SUPPORTED = "tether_supported";
2609
2610 /**
Robert Greenwalt77b32dd2010-06-03 18:57:26 -07002611 * Used to require DUN APN on the device or not - defaults to a build config value
2612 * which defaults to false
2613 * @hide
2614 */
2615 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
2616
2617 /**
2618 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
2619 * corresponding build config values are set it will override the APN DB
2620 * values.
2621 * Consists of a comma seperated list of strings:
2622 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
2623 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
2624 * @hide
2625 */
2626 public static final String TETHER_DUN_APN = "tether_dun_apn";
2627
2628 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08002629 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002630 */
2631 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002632
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_LAST_UPDATE = "parental_control_last_update";
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_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002642
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002643 /**
Brad Fitzpatrickd7ad0d22010-12-02 15:30:23 -08002644 * A positive value indicates how often the SamplingProfiler
2645 * should take snapshots. Zero value means SamplingProfiler
2646 * is disabled.
Sen Hubde75702010-05-28 01:54:03 -07002647 *
2648 * @hide
2649 */
Brad Fitzpatrickd7ad0d22010-12-02 15:30:23 -08002650 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
Sen Hubde75702010-05-28 01:54:03 -07002651
2652 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002653 * Settings classname to launch when Settings is clicked from All
2654 * Applications. Needed because of user testing between the old
2655 * and new Settings apps.
2656 */
2657 // TODO: 881807
2658 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002659
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002660 /**
2661 * USB Mass Storage Enabled
2662 */
2663 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002664
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002665 /**
2666 * If this setting is set (to anything), then all references
2667 * to Gmail on the device must change to Google Mail.
2668 */
2669 public static final String USE_GOOGLE_MAIL = "use_google_mail";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002670
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002671 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07002672 * If accessibility is enabled.
2673 */
2674 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
2675
2676 /**
2677 * List of the enabled accessibility providers.
2678 */
2679 public static final String ENABLED_ACCESSIBILITY_SERVICES =
2680 "enabled_accessibility_services";
2681
2682 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07002683 * If injection of accessibility enhancing JavaScript scripts
2684 * is enabled.
2685 * <p>
2686 * Note: Accessibility injecting scripts are served by the
2687 * Google infrastructure and enable users with disabilities to
2688 * efficiantly navigate in and explore web content.
2689 * </p>
2690 * <p>
2691 * This property represents a boolean value.
2692 * </p>
2693 * @hide
2694 */
2695 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
2696 "accessibility_script_injection";
2697
2698 /**
2699 * Key bindings for navigation in built-in accessibility support for web content.
2700 * <p>
2701 * Note: These key bindings are for the built-in accessibility navigation for
2702 * web content which is used as a fall back solution if JavaScript in a WebView
2703 * is not enabled or the user has not opted-in script injection from Google.
2704 * </p>
2705 * <p>
2706 * The bindings are separated by semi-colon. A binding is a mapping from
2707 * a key to a sequence of actions (for more details look at
2708 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
2709 * string representation of an integer obtained from a meta state (optional) shifted
2710 * sixteen times left and bitwise ored with a key code. An action is represented
2711 * as a hexademical string representation of an integer where the first two digits
2712 * are navigation action index, the second, the third, and the fourth digit pairs
2713 * represent the action arguments. The separate actions in a binding are colon
2714 * separated. The key and the action sequence it maps to are separated by equals.
2715 * </p>
2716 * <p>
2717 * For example, the binding below maps the DPAD right button to traverse the
2718 * current navigation axis once without firing an accessibility event and to
2719 * perform the same traversal again but to fire an event:
2720 * <code>
2721 * 0x16=0x01000100:0x01000101;
2722 * </code>
2723 * </p>
2724 * <p>
2725 * The goal of this binding is to enable dynamic rebinding of keys to
2726 * navigation actions for web content without requiring a framework change.
2727 * </p>
2728 * <p>
2729 * This property represents a string value.
2730 * </p>
2731 * @hide
2732 */
2733 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
2734 "accessibility_web_content_key_bindings";
2735
2736 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08002737 * The timout for considering a press to be a long press in milliseconds.
2738 * @hide
2739 */
2740 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
2741
2742 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07002743 * Setting to always use the default text-to-speech settings regardless
2744 * of the application settings.
2745 * 1 = override application settings,
2746 * 0 = use application settings (if specified).
2747 */
2748 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
2749
2750 /**
2751 * Default text-to-speech engine speech rate. 100 = 1x
2752 */
2753 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
2754
2755 /**
2756 * Default text-to-speech engine pitch. 100 = 1x
2757 */
2758 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
2759
2760 /**
2761 * Default text-to-speech engine.
2762 */
2763 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
2764
2765 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07002766 * Default text-to-speech language.
2767 */
2768 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
2769
2770 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07002771 * Default text-to-speech country.
2772 */
2773 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
2774
2775 /**
2776 * Default text-to-speech locale variant.
2777 */
2778 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
2779
2780 /**
Charles Chenceffa152010-03-16 21:18:10 -07002781 * Space delimited list of plugin packages that are enabled.
2782 */
2783 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
2784
2785 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002786 * Whether to notify the user of open networks.
2787 * <p>
2788 * If not connected and the scan results have an open network, we will
2789 * put this notification up. If we attempt to connect to a network or
2790 * the open network(s) disappear, we remove the notification. When we
2791 * show the notification, we will not show it again for
2792 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
2793 */
2794 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
2795 "wifi_networks_available_notification_on";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002796
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002797 /**
2798 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
2799 * Connecting to a network will reset the timer.
2800 */
2801 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
2802 "wifi_networks_available_repeat_delay";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002803
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002804 /**
Irfan Sheriffed4f28b2010-10-29 15:32:10 -07002805 * 802.11 country code in ISO 3166 format
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002806 * @hide
2807 */
Irfan Sheriffed4f28b2010-10-29 15:32:10 -07002808 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
2809
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002810
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002811 /**
2812 * When the number of open networks exceeds this number, the
2813 * least-recently-used excess networks will be removed.
2814 */
2815 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002816
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002817 /**
2818 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
2819 */
2820 public static final String WIFI_ON = "wifi_on";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002821
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002822 /**
Irfan Sheriffa3bd4092010-03-24 17:58:59 -07002823 * Used to save the Wifi_ON state prior to tethering.
2824 * This state will be checked to restore Wifi after
2825 * the user turns off tethering.
Irfan Sheriff5321aef2010-02-12 12:35:59 -08002826 *
2827 * @hide
2828 */
Irfan Sheriffa3bd4092010-03-24 17:58:59 -07002829 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
Irfan Sheriff5321aef2010-02-12 12:35:59 -08002830
2831 /**
Irfan Sheriff9ab518ad2010-03-12 15:48:17 -08002832 * AP SSID
2833 *
2834 * @hide
2835 */
2836 public static final String WIFI_AP_SSID = "wifi_ap_ssid";
2837
2838 /**
2839 * AP security
2840 *
2841 * @hide
2842 */
2843 public static final String WIFI_AP_SECURITY = "wifi_ap_security";
2844
2845 /**
2846 * AP passphrase
2847 *
2848 * @hide
2849 */
2850 public static final String WIFI_AP_PASSWD = "wifi_ap_passwd";
2851
2852 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002853 * The acceptable packet loss percentage (range 0 - 100) before trying
2854 * another AP on the same network.
2855 */
2856 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
2857 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002858
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002859 /**
2860 * The number of access points required for a network in order for the
2861 * watchdog to monitor it.
2862 */
2863 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002864
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002865 /**
2866 * The delay between background checks.
2867 */
2868 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
2869 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002870
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002871 /**
2872 * Whether the Wi-Fi watchdog is enabled for background checking even
2873 * after it thinks the user has connected to a good access point.
2874 */
2875 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
2876 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002877
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002878 /**
2879 * The timeout for a background ping
2880 */
2881 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
2882 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002883
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002884 /**
2885 * The number of initial pings to perform that *may* be ignored if they
2886 * fail. Again, if these fail, they will *not* be used in packet loss
2887 * calculation. For example, one network always seemed to time out for
2888 * the first couple pings, so this is set to 3 by default.
2889 */
2890 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
2891 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002892
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002893 /**
2894 * The maximum number of access points (per network) to attempt to test.
2895 * If this number is reached, the watchdog will no longer monitor the
2896 * initial connection state for the network. This is a safeguard for
2897 * networks containing multiple APs whose DNS does not respond to pings.
2898 */
2899 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002900
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002901 /**
2902 * Whether the Wi-Fi watchdog is enabled.
2903 */
2904 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
2905
2906 /**
2907 * 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 -08002908 */
2909 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
2910
2911 /**
2912 * The number of pings to test if an access point is a good connection.
2913 */
2914 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002915
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002916 /**
2917 * The delay between pings.
2918 */
2919 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002920
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002921 /**
2922 * The timeout per ping.
2923 */
2924 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002925
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002926 /**
Irfan Sheriff5ea65d62011-06-05 21:29:56 -07002927 * Setting to turn off walled garden test on Wi-Fi. Feature is enabled by default and
2928 * the setting needs to be set to 0 to disable it.
2929 * @hide
2930 */
2931 public static final String WIFI_WATCHDOG_WALLED_GARDEN_TEST_ENABLED =
2932 "wifi_watchdog_walled_garden_test_enabled";
2933
2934 /**
2935 * The URL used for walled garden check upon a new conection. WifiWatchdogService
2936 * fetches the URL and checks to see if {@link #WIFI_WATCHDOG_WALLED_GARDEN_PATTERN}
2937 * is not part of the title string to notify the user on the presence of a walled garden.
2938 * @hide
2939 */
2940 public static final String WIFI_WATCHDOG_WALLED_GARDEN_URL =
2941 "wifi_watchdog_walled_garden_url";
2942
2943 /**
2944 * The pattern string in the fetched URL used to detect a walled garden
2945 * @hide
2946 */
2947 public static final String WIFI_WATCHDOG_WALLED_GARDEN_PATTERN =
2948 "wifi_watchdog_walled_garden_pattern";
2949
2950 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002951 * The maximum number of times we will retry a connection to an access
2952 * point for which we have failed in acquiring an IP address from DHCP.
2953 * 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 -08002954 */
2955 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002956
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002957 /**
Irfan Sheriff36f74132010-11-04 16:57:37 -07002958 * The operational wifi frequency band
2959 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
2960 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
2961 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
2962 *
2963 * @hide
2964 */
2965 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
2966
2967 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002968 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
2969 * data connectivity to be established after a disconnect from Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002970 */
2971 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
2972 "wifi_mobile_data_transition_wakelock_timeout_ms";
2973
2974 /**
2975 * Whether background data usage is allowed by the user. See
2976 * ConnectivityManager for more info.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002977 */
2978 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07002979
2980 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00002981 * Origins for which browsers should allow geolocation by default.
2982 * The value is a space-separated list of origins.
2983 */
2984 public static final String ALLOWED_GEOLOCATION_ORIGINS
2985 = "allowed_geolocation_origins";
2986
2987 /**
Robert Greenwaltc03fa502010-02-23 18:58:05 -08002988 * Whether mobile data connections are allowed by the user. See
2989 * ConnectivityManager for more info.
2990 * @hide
2991 */
2992 public static final String MOBILE_DATA = "mobile_data";
2993
2994 /**
Wink Saville04e71b32009-04-02 11:00:54 -07002995 * The CDMA roaming mode 0 = Home Networks, CDMA default
2996 * 1 = Roaming on Affiliated networks
2997 * 2 = Roaming on any networks
2998 * @hide
2999 */
3000 public static final String CDMA_ROAMING_MODE = "roaming_settings";
3001
3002 /**
3003 * The CDMA subscription mode 0 = RUIM/SIM (default)
3004 * 1 = NV
3005 * @hide
3006 */
3007 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
3008
3009 /**
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003010 * The preferred network mode 7 = Global
3011 * 6 = EvDo only
3012 * 5 = CDMA w/o EvDo
3013 * 4 = CDMA / EvDo auto
3014 * 3 = GSM / WCDMA auto
3015 * 2 = WCDMA only
3016 * 1 = GSM only
3017 * 0 = GSM / WCDMA preferred
Wink Saville04e71b32009-04-02 11:00:54 -07003018 * @hide
3019 */
3020 public static final String PREFERRED_NETWORK_MODE =
3021 "preferred_network_mode";
3022
3023 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07003024 * The preferred TTY mode 0 = TTy Off, CDMA default
3025 * 1 = TTY Full
3026 * 2 = TTY HCO
3027 * 3 = TTY VCO
3028 * @hide
3029 */
3030 public static final String PREFERRED_TTY_MODE =
3031 "preferred_tty_mode";
3032
3033
3034 /**
Wink Saville04e71b32009-04-02 11:00:54 -07003035 * CDMA Cell Broadcast SMS
3036 * 0 = CDMA Cell Broadcast SMS disabled
3037 * 1 = CDMA Cell Broadcast SMS enabled
3038 * @hide
3039 */
3040 public static final String CDMA_CELL_BROADCAST_SMS =
3041 "cdma_cell_broadcast_sms";
3042
3043 /**
3044 * The cdma subscription 0 = Subscription from RUIM, when available
3045 * 1 = Subscription from NV
3046 * @hide
3047 */
3048 public static final String PREFERRED_CDMA_SUBSCRIPTION =
3049 "preferred_cdma_subscription";
3050
3051 /**
3052 * Whether the enhanced voice privacy mode is enabled.
3053 * 0 = normal voice privacy
3054 * 1 = enhanced voice privacy
3055 * @hide
3056 */
3057 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
3058
3059 /**
3060 * Whether the TTY mode mode is enabled.
3061 * 0 = disabled
3062 * 1 = enabled
3063 * @hide
3064 */
3065 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003066
3067 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07003068 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07003069 * Type: int ( 0 = disabled, 1 = enabled )
3070 * @hide
3071 */
3072 public static final String BACKUP_ENABLED = "backup_enabled";
3073
3074 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08003075 * Controls whether application data is automatically restored from backup
3076 * at install time.
3077 * Type: int ( 0 = disabled, 1 = enabled )
3078 * @hide
3079 */
3080 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
3081
3082 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07003083 * Indicates whether settings backup has been fully provisioned.
3084 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
3085 * @hide
3086 */
3087 public static final String BACKUP_PROVISIONED = "backup_provisioned";
3088
3089 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07003090 * Component of the transport to use for backup/restore.
3091 * @hide
3092 */
3093 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07003094
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07003095 /**
3096 * Version for which the setup wizard was last shown. Bumped for
3097 * each release when there is new setup information to show.
3098 * @hide
3099 */
3100 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07003101
3102 /**
Doug Zongkerf6888892010-01-06 16:38:14 -08003103 * How frequently (in seconds) to check the memory status of the
3104 * device.
3105 * @hide
3106 */
3107 public static final String MEMCHECK_INTERVAL = "memcheck_interval";
3108
3109 /**
3110 * Max frequency (in seconds) to log memory check stats, in realtime
3111 * seconds. This allows for throttling of logs when the device is
3112 * running for large amounts of time.
3113 * @hide
3114 */
3115 public static final String MEMCHECK_LOG_REALTIME_INTERVAL =
3116 "memcheck_log_realtime_interval";
3117
3118 /**
3119 * Boolean indicating whether rebooting due to system memory checks
3120 * is enabled.
3121 * @hide
3122 */
3123 public static final String MEMCHECK_SYSTEM_ENABLED = "memcheck_system_enabled";
3124
3125 /**
3126 * How many bytes the system process must be below to avoid scheduling
3127 * a soft reboot. This reboot will happen when it is next determined
3128 * to be a good time.
3129 * @hide
3130 */
3131 public static final String MEMCHECK_SYSTEM_SOFT_THRESHOLD = "memcheck_system_soft";
3132
3133 /**
3134 * How many bytes the system process must be below to avoid scheduling
3135 * a hard reboot. This reboot will happen immediately.
3136 * @hide
3137 */
3138 public static final String MEMCHECK_SYSTEM_HARD_THRESHOLD = "memcheck_system_hard";
3139
3140 /**
3141 * How many bytes the phone process must be below to avoid scheduling
3142 * a soft restart. This restart will happen when it is next determined
3143 * to be a good time.
3144 * @hide
3145 */
3146 public static final String MEMCHECK_PHONE_SOFT_THRESHOLD = "memcheck_phone_soft";
3147
3148 /**
3149 * How many bytes the phone process must be below to avoid scheduling
3150 * a hard restart. This restart will happen immediately.
3151 * @hide
3152 */
3153 public static final String MEMCHECK_PHONE_HARD_THRESHOLD = "memcheck_phone_hard";
3154
3155 /**
3156 * Boolean indicating whether restarting the phone process due to
3157 * memory checks is enabled.
3158 * @hide
3159 */
3160 public static final String MEMCHECK_PHONE_ENABLED = "memcheck_phone_enabled";
3161
3162 /**
3163 * First time during the day it is okay to kill processes
3164 * or reboot the device due to low memory situations. This number is
3165 * in seconds since midnight.
3166 * @hide
3167 */
3168 public static final String MEMCHECK_EXEC_START_TIME = "memcheck_exec_start_time";
3169
3170 /**
3171 * Last time during the day it is okay to kill processes
3172 * or reboot the device due to low memory situations. This number is
3173 * in seconds since midnight.
3174 * @hide
3175 */
3176 public static final String MEMCHECK_EXEC_END_TIME = "memcheck_exec_end_time";
3177
3178 /**
3179 * How long the screen must have been off in order to kill processes
3180 * or reboot. This number is in seconds. A value of -1 means to
3181 * entirely disregard whether the screen is on.
3182 * @hide
3183 */
3184 public static final String MEMCHECK_MIN_SCREEN_OFF = "memcheck_min_screen_off";
3185
3186 /**
3187 * How much time there must be until the next alarm in order to kill processes
3188 * or reboot. This number is in seconds. Note: this value must be
3189 * smaller than {@link #MEMCHECK_RECHECK_INTERVAL} or else it will
3190 * always see an alarm scheduled within its time.
3191 * @hide
3192 */
3193 public static final String MEMCHECK_MIN_ALARM = "memcheck_min_alarm";
3194
3195 /**
3196 * How frequently to check whether it is a good time to restart things,
3197 * if the device is in a bad state. This number is in seconds. Note:
3198 * this value must be larger than {@link #MEMCHECK_MIN_ALARM} or else
3199 * the alarm to schedule the recheck will always appear within the
3200 * minimum "do not execute now" time.
3201 * @hide
3202 */
3203 public static final String MEMCHECK_RECHECK_INTERVAL = "memcheck_recheck_interval";
3204
3205 /**
3206 * How frequently (in DAYS) to reboot the device. If 0, no reboots
3207 * will occur.
3208 * @hide
3209 */
3210 public static final String REBOOT_INTERVAL = "reboot_interval";
3211
3212 /**
3213 * First time during the day it is okay to force a reboot of the
3214 * device (if REBOOT_INTERVAL is set). This number is
3215 * in seconds since midnight.
3216 * @hide
3217 */
3218 public static final String REBOOT_START_TIME = "reboot_start_time";
3219
3220 /**
3221 * The window of time (in seconds) after each REBOOT_INTERVAL in which
3222 * a reboot can be executed. If 0, a reboot will always be executed at
3223 * exactly the given time. Otherwise, it will only be executed if
3224 * the device is idle within the window.
3225 * @hide
3226 */
3227 public static final String REBOOT_WINDOW = "reboot_window";
3228
3229 /**
Doug Zongker43866e02010-01-07 12:09:54 -08003230 * Threshold values for the duration and level of a discharge cycle, under
3231 * which we log discharge cycle info.
3232 * @hide
3233 */
3234 public static final String BATTERY_DISCHARGE_DURATION_THRESHOLD =
3235 "battery_discharge_duration_threshold";
3236 /** @hide */
3237 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
3238
3239 /**
3240 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR intents
3241 * on application crashes and ANRs. If this is disabled, the crash/ANR dialog
3242 * will never display the "Report" button.
3243 * Type: int ( 0 = disallow, 1 = allow )
3244 * @hide
3245 */
3246 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
3247
3248 /**
3249 * Nonzero causes Log.wtf() to crash.
3250 * @hide
3251 */
3252 public static final String WTF_IS_FATAL = "wtf_is_fatal";
3253
3254 /**
Jake Hambybb371632010-08-23 18:16:48 -07003255 * Maximum age of entries kept by {@link com.android.internal.os.IDropBoxManagerService}.
Doug Zongker43866e02010-01-07 12:09:54 -08003256 * @hide
3257 */
3258 public static final String DROPBOX_AGE_SECONDS =
3259 "dropbox_age_seconds";
3260 /**
Jake Hambybb371632010-08-23 18:16:48 -07003261 * Maximum number of entry files which {@link com.android.internal.os.IDropBoxManagerService} will keep around.
Dan Egnor3a8b0c12010-03-24 17:48:20 -07003262 * @hide
3263 */
3264 public static final String DROPBOX_MAX_FILES =
3265 "dropbox_max_files";
3266 /**
Jake Hambybb371632010-08-23 18:16:48 -07003267 * Maximum amount of disk space used by {@link com.android.internal.os.IDropBoxManagerService} no matter what.
Doug Zongker43866e02010-01-07 12:09:54 -08003268 * @hide
3269 */
3270 public static final String DROPBOX_QUOTA_KB =
3271 "dropbox_quota_kb";
3272 /**
Jake Hambybb371632010-08-23 18:16:48 -07003273 * Percent of free disk (excluding reserve) which {@link com.android.internal.os.IDropBoxManagerService} will use.
Doug Zongker43866e02010-01-07 12:09:54 -08003274 * @hide
3275 */
3276 public static final String DROPBOX_QUOTA_PERCENT =
3277 "dropbox_quota_percent";
3278 /**
Jake Hambybb371632010-08-23 18:16:48 -07003279 * Percent of total disk which {@link com.android.internal.os.IDropBoxManagerService} will never dip into.
Doug Zongker43866e02010-01-07 12:09:54 -08003280 * @hide
3281 */
3282 public static final String DROPBOX_RESERVE_PERCENT =
3283 "dropbox_reserve_percent";
3284 /**
3285 * Prefix for per-tag dropbox disable/enable settings.
3286 * @hide
3287 */
3288 public static final String DROPBOX_TAG_PREFIX =
3289 "dropbox:";
Dan Egnora455d192010-03-12 08:52:28 -08003290 /**
3291 * Lines of logcat to include with system crash/ANR/etc. reports,
3292 * as a prefix of the dropbox tag of the report type.
3293 * For example, "logcat_for_system_server_anr" controls the lines
3294 * of logcat captured with system server ANR reports. 0 to disable.
3295 * @hide
3296 */
3297 public static final String ERROR_LOGCAT_PREFIX =
3298 "logcat_for_";
Doug Zongker43866e02010-01-07 12:09:54 -08003299
3300
3301 /**
3302 * Screen timeout in milliseconds corresponding to the
3303 * PowerManager's POKE_LOCK_SHORT_TIMEOUT flag (i.e. the fastest
3304 * possible screen timeout behavior.)
3305 * @hide
3306 */
3307 public static final String SHORT_KEYLIGHT_DELAY_MS =
3308 "short_keylight_delay_ms";
3309
3310 /**
3311 * The interval in minutes after which the amount of free storage left on the
3312 * device is logged to the event log
3313 * @hide
3314 */
3315 public static final String SYS_FREE_STORAGE_LOG_INTERVAL =
3316 "sys_free_storage_log_interval";
3317
3318 /**
3319 * Threshold for the amount of change in disk free space required to report the amount of
3320 * free space. Used to prevent spamming the logs when the disk free space isn't changing
3321 * frequently.
3322 * @hide
3323 */
3324 public static final String DISK_FREE_CHANGE_REPORTING_THRESHOLD =
3325 "disk_free_change_reporting_threshold";
3326
3327
3328 /**
3329 * Minimum percentage of free storage on the device that is used to determine if
Dianne Hackborn247fe742011-01-08 17:25:57 -08003330 * the device is running low on storage. The default is 10.
3331 * <p>Say this value is set to 10, the device is considered running low on storage
Doug Zongker43866e02010-01-07 12:09:54 -08003332 * if 90% or more of the device storage is filled up.
3333 * @hide
3334 */
3335 public static final String SYS_STORAGE_THRESHOLD_PERCENTAGE =
3336 "sys_storage_threshold_percentage";
3337
3338 /**
Dianne Hackborn247fe742011-01-08 17:25:57 -08003339 * Maximum byte size of the low storage threshold. This is to ensure
3340 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in
3341 * an overly large threshold for large storage devices. Currently this
3342 * must be less than 2GB. This default is 500MB.
3343 * @hide
3344 */
3345 public static final String SYS_STORAGE_THRESHOLD_MAX_BYTES =
3346 "sys_storage_threshold_max_bytes";
3347
3348 /**
Jake Hambybb371632010-08-23 18:16:48 -07003349 * Minimum bytes of free storage on the device before the data
3350 * partition is considered full. By default, 1 MB is reserved
3351 * to avoid system-wide SQLite disk full exceptions.
3352 * @hide
3353 */
3354 public static final String SYS_STORAGE_FULL_THRESHOLD_BYTES =
3355 "sys_storage_full_threshold_bytes";
3356
3357 /**
Doug Zongker43866e02010-01-07 12:09:54 -08003358 * The interval in milliseconds after which Wi-Fi is considered idle.
3359 * When idle, it is possible for the device to be switched from Wi-Fi to
3360 * the mobile data network.
3361 * @hide
3362 */
3363 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
3364
3365 /**
Irfan Sheriff2b7f6382011-03-25 14:29:19 -07003366 * The interval in milliseconds to issue wake up scans when wifi needs
3367 * to connect. This is necessary to connect to an access point when
3368 * device is on the move and the screen is off.
Irfan Sheriff4f5f7c92010-10-14 17:01:27 -07003369 * @hide
3370 */
Irfan Sheriff2b7f6382011-03-25 14:29:19 -07003371 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
3372 "wifi_framework_scan_interval_ms";
3373
3374 /**
3375 * The interval in milliseconds to scan as used by the wifi supplicant
3376 * @hide
3377 */
3378 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
3379 "wifi_supplicant_scan_interval_ms";
Irfan Sheriff4f5f7c92010-10-14 17:01:27 -07003380
3381 /**
Doug Zongkeredc51892010-01-07 13:51:16 -08003382 * The interval in milliseconds at which to check packet counts on the
3383 * mobile data interface when screen is on, to detect possible data
3384 * connection problems.
3385 * @hide
3386 */
3387 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
3388 "pdp_watchdog_poll_interval_ms";
3389
3390 /**
3391 * The interval in milliseconds at which to check packet counts on the
3392 * mobile data interface when screen is off, to detect possible data
3393 * connection problems.
3394 * @hide
3395 */
3396 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
3397 "pdp_watchdog_long_poll_interval_ms";
3398
3399 /**
3400 * The interval in milliseconds at which to check packet counts on the
3401 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
3402 * outgoing packets has been reached without incoming packets.
3403 * @hide
3404 */
3405 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
3406 "pdp_watchdog_error_poll_interval_ms";
3407
3408 /**
3409 * The number of outgoing packets sent without seeing an incoming packet
3410 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
3411 * device is logged to the event log
3412 * @hide
3413 */
3414 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
3415 "pdp_watchdog_trigger_packet_count";
3416
3417 /**
3418 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
3419 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
3420 * attempting data connection recovery.
3421 * @hide
3422 */
3423 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
3424 "pdp_watchdog_error_poll_count";
3425
3426 /**
3427 * The number of failed PDP reset attempts before moving to something more
3428 * drastic: re-registering to the network.
3429 * @hide
3430 */
3431 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
3432 "pdp_watchdog_max_pdp_reset_fail_count";
3433
3434 /**
Doug Zongkeredc51892010-01-07 13:51:16 -08003435 * The interval in milliseconds at which to check gprs registration
3436 * after the first registration mismatch of gprs and voice service,
3437 * to detect possible data network registration problems.
3438 *
3439 * @hide
3440 */
3441 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
3442 "gprs_register_check_period_ms";
3443
3444 /**
3445 * The length of time in milli-seconds that automatic small adjustments to
3446 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
3447 * @hide
3448 */
3449 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
3450
3451 /**
3452 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
3453 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
3454 * exceeded.
3455 * @hide
3456 */
3457 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
3458
3459 /**
3460 * The maximum reconnect delay for short network outages or when the network is suspended
3461 * due to phone use.
3462 * @hide
3463 */
3464 public static final String SYNC_MAX_RETRY_DELAY_IN_SECONDS =
3465 "sync_max_retry_delay_in_seconds";
3466
3467 /**
3468 * The interval in milliseconds at which to check the number of SMS sent
3469 * out without asking for use permit, to limit the un-authorized SMS
3470 * usage.
3471 * @hide
3472 */
3473 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
3474 "sms_outgoing_check_interval_ms";
3475
3476 /**
3477 * The number of outgoing SMS sent without asking for user permit
3478 * (of {@link #SMS_OUTGOING_CHECK_INTERVAL_MS}
3479 * @hide
3480 */
3481 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
3482 "sms_outgoing_check_max_count";
3483
3484 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003485 * The number of promoted sources in GlobalSearch.
3486 * @hide
3487 */
3488 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
3489 /**
3490 * The maximum number of suggestions returned by GlobalSearch.
3491 * @hide
3492 */
3493 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
3494 /**
3495 * The number of suggestions GlobalSearch will ask each non-web search source for.
3496 * @hide
3497 */
3498 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
3499 /**
3500 * The number of suggestions the GlobalSearch will ask the web search source for.
3501 * @hide
3502 */
3503 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
3504 "search_web_results_override_limit";
3505 /**
3506 * The number of milliseconds that GlobalSearch will wait for suggestions from
3507 * promoted sources before continuing with all other sources.
3508 * @hide
3509 */
3510 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
3511 "search_promoted_source_deadline_millis";
3512 /**
3513 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
3514 * @hide
3515 */
3516 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
3517 /**
3518 * The maximum number of milliseconds that GlobalSearch shows the previous results
3519 * after receiving a new query.
3520 * @hide
3521 */
3522 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
3523 /**
3524 * The maximum age of log data used for shortcuts in GlobalSearch.
3525 * @hide
3526 */
3527 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
3528 /**
3529 * The maximum age of log data used for source ranking in GlobalSearch.
3530 * @hide
3531 */
3532 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
3533 "search_max_source_event_age_millis";
3534 /**
3535 * The minimum number of impressions needed to rank a source in GlobalSearch.
3536 * @hide
3537 */
3538 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
3539 "search_min_impressions_for_source_ranking";
3540 /**
3541 * The minimum number of clicks needed to rank a source in GlobalSearch.
3542 * @hide
3543 */
3544 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
3545 "search_min_clicks_for_source_ranking";
3546 /**
3547 * The maximum number of shortcuts shown by GlobalSearch.
3548 * @hide
3549 */
3550 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
3551 /**
3552 * The size of the core thread pool for suggestion queries in GlobalSearch.
3553 * @hide
3554 */
3555 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
3556 "search_query_thread_core_pool_size";
3557 /**
3558 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
3559 * @hide
3560 */
3561 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
3562 "search_query_thread_max_pool_size";
3563 /**
3564 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
3565 * @hide
3566 */
3567 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
3568 "search_shortcut_refresh_core_pool_size";
3569 /**
3570 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
3571 * @hide
3572 */
3573 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
3574 "search_shortcut_refresh_max_pool_size";
3575 /**
3576 * The maximun time that excess threads in the GlobalSeach thread pools will
3577 * wait before terminating.
3578 * @hide
3579 */
3580 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
3581 "search_thread_keepalive_seconds";
3582 /**
3583 * The maximum number of concurrent suggestion queries to each source.
3584 * @hide
3585 */
3586 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
3587 "search_per_source_concurrent_query_limit";
3588
San Mehat87734d32010-01-08 12:53:06 -08003589 /**
3590 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
3591 * @hide
3592 */
3593 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
3594
3595 /**
3596 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
3597 * @hide
3598 */
3599 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
3600
3601 /**
3602 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
3603 * @hide
3604 */
3605 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
3606
3607 /**
3608 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
3609 * @hide
3610 */
3611 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003612
Dan Egnor42471dd2010-01-07 17:25:22 -08003613 /**
3614 * If nonzero, ANRs in invisible background processes bring up a dialog.
3615 * Otherwise, the process will be silently killed.
3616 * @hide
3617 */
3618 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08003619
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08003620 /**
3621 * The {@link ComponentName} string of the service to be used as the voice recognition
3622 * service.
Erikeebc8e22010-02-18 13:27:19 -08003623 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08003624 * @hide
3625 */
3626 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08003627
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003628 /**
David Brown458e8062010-03-08 21:52:11 -08003629 * What happens when the user presses the Power button while in-call
3630 * and the screen is on.<br/>
3631 * <b>Values:</b><br/>
3632 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
3633 * 2 - The Power button hangs up the current call.<br/>
3634 *
3635 * @hide
3636 */
3637 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
3638
3639 /**
3640 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
3641 * @hide
3642 */
3643 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
3644
3645 /**
3646 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
3647 * @hide
3648 */
3649 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
3650
3651 /**
3652 * INCALL_POWER_BUTTON_BEHAVIOR default value.
3653 * @hide
3654 */
3655 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
3656 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
3657
3658 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07003659 * The current night mode that has been selected by the user. Owned
3660 * and controlled by UiModeManagerService. Constants are as per
3661 * UiModeManager.
3662 * @hide
3663 */
3664 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07003665
3666 /**
3667 * Let user pick default install location.
3668 * @hide
3669 */
3670 public static final String SET_INSTALL_LOCATION = "set_install_location";
3671
3672 /**
3673 * Default install location value.
3674 * 0 = auto, let system decide
3675 * 1 = internal
3676 * 2 = sdcard
3677 * @hide
3678 */
3679 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07003680
3681 /**
3682 * The bandwidth throttle polling freqency in seconds
3683 * @hide
3684 */
3685 public static final String THROTTLE_POLLING_SEC = "throttle_polling_sec";
3686
3687 /**
3688 * The bandwidth throttle threshold (long)
3689 * @hide
3690 */
Robert Greenwaltd3bb93f2010-04-12 19:20:55 -07003691 public static final String THROTTLE_THRESHOLD_BYTES = "throttle_threshold_bytes";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07003692
3693 /**
3694 * The bandwidth throttle value (kbps)
3695 * @hide
3696 */
Robert Greenwaltd3bb93f2010-04-12 19:20:55 -07003697 public static final String THROTTLE_VALUE_KBITSPS = "throttle_value_kbitsps";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07003698
3699 /**
3700 * The bandwidth throttle reset calendar day (1-28)
3701 * @hide
3702 */
3703 public static final String THROTTLE_RESET_DAY = "throttle_reset_day";
3704
3705 /**
3706 * The throttling notifications we should send
3707 * @hide
3708 */
3709 public static final String THROTTLE_NOTIFICATION_TYPE = "throttle_notification_type";
3710
3711 /**
Irfan Sheriffc9b68512010-04-08 14:12:33 -07003712 * Help URI for data throttling policy
3713 * @hide
3714 */
3715 public static final String THROTTLE_HELP_URI = "throttle_help_uri";
3716
Robert Greenwaltd1055a22010-05-25 15:54:52 -07003717 /**
3718 * The length of time in Sec that we allow our notion of NTP time
3719 * to be cached before we refresh it
3720 * @hide
3721 */
3722 public static final String THROTTLE_MAX_NTP_CACHE_AGE_SEC =
3723 "throttle_max_ntp_cache_age_sec";
3724
Steve Howard9c4e33e2010-07-28 15:59:29 -07003725 /**
3726 * The maximum size, in bytes, of a download that the download manager will transfer over
3727 * a non-wifi connection.
3728 * @hide
3729 */
3730 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
3731 "download_manager_max_bytes_over_mobile";
3732
Robert Greenwaltd7085fc2010-09-08 15:24:47 -07003733 /**
Steve Howardf1766812010-09-17 16:46:19 -07003734 * The recommended maximum size, in bytes, of a download that the download manager should
3735 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
3736 * have the option to start the download over the mobile connection anyway.
3737 * @hide
3738 */
3739 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
3740 "download_manager_recommended_max_bytes_over_mobile";
3741
3742 /**
Robert Greenwaltd7085fc2010-09-08 15:24:47 -07003743 * ms during which to consume extra events related to Inet connection condition
3744 * after a transtion to fully-connected
3745 * @hide
3746 */
3747 public static final String INET_CONDITION_DEBOUNCE_UP_DELAY =
3748 "inet_condition_debounce_up_delay";
3749
3750 /**
3751 * ms during which to consume extra events related to Inet connection condtion
3752 * after a transtion to partly-connected
3753 * @hide
3754 */
3755 public static final String INET_CONDITION_DEBOUNCE_DOWN_DELAY =
3756 "inet_condition_debounce_down_delay";
Irfan Sheriffc9b68512010-04-08 14:12:33 -07003757
3758 /**
Freeman Ng96be4e02011-04-07 18:21:40 -07003759 * URL to open browser on to allow user to manage a prepay account
3760 * @hide
3761 */
3762 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
3763 "setup_prepaid_data_service_url";
3764
3765 /**
Freeman Ng3b9089c2011-04-22 16:42:57 -07003766 * URL to attempt a GET on to see if this is a prepay device
3767 * @hide
3768 */
3769 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
3770 "setup_prepaid_detection_target_url";
3771
3772 /**
3773 * Host to check for a redirect to after an attempt to GET
3774 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
3775 * this is a prepaid device with zero balance.)
3776 * @hide
3777 */
3778 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
3779 "setup_prepaid_detection_redir_host";
3780
3781 /**
Daniel Sandler0601eb72011-04-13 01:01:32 -04003782 * The user's preferred "dream" (interactive screensaver) component.
3783 *
3784 * This component will be launched by the PhoneWindowManager after the user's chosen idle
3785 * timeout (specified by {@link #DREAM_TIMEOUT}).
3786 * @hide
3787 */
3788 public static final String DREAM_COMPONENT =
3789 "dream_component";
3790
3791 /**
3792 * The delay before a "dream" is started (set to 0 to disable).
3793 * @hide
3794 */
3795 public static final String DREAM_TIMEOUT =
3796 "dream_timeout";
3797
Jeff Sharkey61ee0bb2011-05-29 22:50:42 -07003798 /** {@hide} */
3799 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
3800 /** {@hide} */
3801 public static final String NETSTATS_PERSIST_THRESHOLD = "netstats_persist_threshold";
3802 /** {@hide} */
3803 public static final String NETSTATS_SUMMARY_BUCKET_DURATION = "netstats_summary_bucket_duration";
3804 /** {@hide} */
3805 public static final String NETSTATS_SUMMARY_MAX_HISTORY = "netstats_summary_max_history";
3806 /** {@hide} */
3807 public static final String NETSTATS_DETAIL_BUCKET_DURATION = "netstats_detail_bucket_duration";
3808 /** {@hide} */
3809 public static final String NETSTATS_DETAIL_MAX_HISTORY = "netstats_detail_max_history";
3810
Daniel Sandler0601eb72011-04-13 01:01:32 -04003811 /**
-b master501eec92009-07-06 13:53:11 -07003812 * @hide
3813 */
3814 public static final String[] SETTINGS_TO_BACKUP = {
Amith Yamasani8823c0a82009-07-07 14:30:17 -07003815 ADB_ENABLED,
3816 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07003817 PARENTAL_CONTROL_ENABLED,
3818 PARENTAL_CONTROL_REDIRECT_URL,
3819 USB_MASS_STORAGE_ENABLED,
3820 ACCESSIBILITY_ENABLED,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003821 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08003822 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07003823 ENABLED_ACCESSIBILITY_SERVICES,
3824 TTS_USE_DEFAULTS,
3825 TTS_DEFAULT_RATE,
3826 TTS_DEFAULT_PITCH,
3827 TTS_DEFAULT_SYNTH,
3828 TTS_DEFAULT_LANG,
3829 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07003830 TTS_ENABLED_PLUGINS,
-b master501eec92009-07-06 13:53:11 -07003831 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
3832 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
-b master501eec92009-07-06 13:53:11 -07003833 WIFI_NUM_OPEN_NETWORKS_KEPT,
San Mehat87734d32010-01-08 12:53:06 -08003834 MOUNT_PLAY_NOTIFICATION_SND,
3835 MOUNT_UMS_AUTOSTART,
3836 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07003837 MOUNT_UMS_NOTIFY_ENABLED,
3838 UI_NIGHT_MODE
-b master501eec92009-07-06 13:53:11 -07003839 };
3840
3841 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003842 * Helper method for determining if a location provider is enabled.
3843 * @param cr the content resolver to use
3844 * @param provider the location provider to query
3845 * @return true if the provider is enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003846 */
3847 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
3848 String allowedProviders = Settings.Secure.getString(cr, LOCATION_PROVIDERS_ALLOWED);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07003849 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003850 }
3851
3852 /**
3853 * Thread-safe method for enabling or disabling a single location provider.
3854 * @param cr the content resolver to use
3855 * @param provider the location provider to enable or disable
3856 * @param enabled true if the provider should be enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003857 */
3858 public static final void setLocationProviderEnabled(ContentResolver cr,
3859 String provider, boolean enabled) {
3860 // to ensure thread safety, we write the provider name with a '+' or '-'
3861 // and let the SettingsProvider handle it rather than reading and modifying
3862 // the list of enabled providers.
3863 if (enabled) {
3864 provider = "+" + provider;
3865 } else {
3866 provider = "-" + provider;
3867 }
3868 putString(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider);
3869 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003870 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003871
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003872 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003873 * User-defined bookmarks and shortcuts. The target of each bookmark is an
3874 * Intent URL, allowing it to be either a web page or a particular
3875 * application activity.
3876 *
3877 * @hide
3878 */
3879 public static final class Bookmarks implements BaseColumns
3880 {
3881 private static final String TAG = "Bookmarks";
3882
3883 /**
3884 * The content:// style URL for this table
3885 */
3886 public static final Uri CONTENT_URI =
3887 Uri.parse("content://" + AUTHORITY + "/bookmarks");
3888
3889 /**
3890 * The row ID.
3891 * <p>Type: INTEGER</p>
3892 */
3893 public static final String ID = "_id";
3894
3895 /**
3896 * Descriptive name of the bookmark that can be displayed to the user.
3897 * If this is empty, the title should be resolved at display time (use
3898 * {@link #getTitle(Context, Cursor)} any time you want to display the
3899 * title of a bookmark.)
3900 * <P>
3901 * Type: TEXT
3902 * </P>
3903 */
3904 public static final String TITLE = "title";
3905
3906 /**
3907 * Arbitrary string (displayed to the user) that allows bookmarks to be
3908 * organized into categories. There are some special names for
3909 * standard folders, which all start with '@'. The label displayed for
3910 * the folder changes with the locale (via {@link #getLabelForFolder}) but
3911 * the folder name does not change so you can consistently query for
3912 * the folder regardless of the current locale.
3913 *
3914 * <P>Type: TEXT</P>
3915 *
3916 */
3917 public static final String FOLDER = "folder";
3918
3919 /**
3920 * The Intent URL of the bookmark, describing what it points to. This
3921 * value is given to {@link android.content.Intent#getIntent} to create
3922 * an Intent that can be launched.
3923 * <P>Type: TEXT</P>
3924 */
3925 public static final String INTENT = "intent";
3926
3927 /**
3928 * Optional shortcut character associated with this bookmark.
3929 * <P>Type: INTEGER</P>
3930 */
3931 public static final String SHORTCUT = "shortcut";
3932
3933 /**
3934 * The order in which the bookmark should be displayed
3935 * <P>Type: INTEGER</P>
3936 */
3937 public static final String ORDERING = "ordering";
3938
3939 private static final String[] sIntentProjection = { INTENT };
3940 private static final String[] sShortcutProjection = { ID, SHORTCUT };
3941 private static final String sShortcutSelection = SHORTCUT + "=?";
3942
3943 /**
3944 * Convenience function to retrieve the bookmarked Intent for a
3945 * particular shortcut key.
3946 *
3947 * @param cr The ContentResolver to query.
3948 * @param shortcut The shortcut key.
3949 *
3950 * @return Intent The bookmarked URL, or null if there is no bookmark
3951 * matching the given shortcut.
3952 */
3953 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
3954 {
3955 Intent intent = null;
3956
3957 Cursor c = cr.query(CONTENT_URI,
3958 sIntentProjection, sShortcutSelection,
3959 new String[] { String.valueOf((int) shortcut) }, ORDERING);
3960 // Keep trying until we find a valid shortcut
3961 try {
3962 while (intent == null && c.moveToNext()) {
3963 try {
3964 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02003965 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003966 } catch (java.net.URISyntaxException e) {
3967 // The stored URL is bad... ignore it.
3968 } catch (IllegalArgumentException e) {
3969 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07003970 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003971 }
3972 }
3973 } finally {
3974 if (c != null) c.close();
3975 }
3976
3977 return intent;
3978 }
3979
3980 /**
3981 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003982 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003983 * @param cr The ContentResolver to query.
3984 * @param intent The desired target of the bookmark.
3985 * @param title Bookmark title that is shown to the user; null if none
3986 * or it should be resolved to the intent's title.
3987 * @param folder Folder in which to place the bookmark; null if none.
3988 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
3989 * this is non-zero and there is an existing bookmark entry
3990 * with this same shortcut, then that existing shortcut is
3991 * cleared (the bookmark is not removed).
3992 * @return The unique content URL for the new bookmark entry.
3993 */
3994 public static Uri add(ContentResolver cr,
3995 Intent intent,
3996 String title,
3997 String folder,
3998 char shortcut,
3999 int ordering)
4000 {
4001 // If a shortcut is supplied, and it is already defined for
4002 // another bookmark, then remove the old definition.
4003 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05004004 cr.delete(CONTENT_URI, sShortcutSelection,
4005 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004006 }
4007
4008 ContentValues values = new ContentValues();
4009 if (title != null) values.put(TITLE, title);
4010 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07004011 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004012 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
4013 values.put(ORDERING, ordering);
4014 return cr.insert(CONTENT_URI, values);
4015 }
4016
4017 /**
4018 * Return the folder name as it should be displayed to the user. This
4019 * takes care of localizing special folders.
4020 *
4021 * @param r Resources object for current locale; only need access to
4022 * system resources.
4023 * @param folder The value found in the {@link #FOLDER} column.
4024 *
4025 * @return CharSequence The label for this folder that should be shown
4026 * to the user.
4027 */
4028 public static CharSequence getLabelForFolder(Resources r, String folder) {
4029 return folder;
4030 }
4031
4032 /**
4033 * Return the title as it should be displayed to the user. This takes
4034 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004035 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004036 * @param context A context.
4037 * @param cursor A cursor pointing to the row whose title should be
4038 * returned. The cursor must contain at least the {@link #TITLE}
4039 * and {@link #INTENT} columns.
4040 * @return A title that is localized and can be displayed to the user,
4041 * or the empty string if one could not be found.
4042 */
4043 public static CharSequence getTitle(Context context, Cursor cursor) {
4044 int titleColumn = cursor.getColumnIndex(TITLE);
4045 int intentColumn = cursor.getColumnIndex(INTENT);
4046 if (titleColumn == -1 || intentColumn == -1) {
4047 throw new IllegalArgumentException(
4048 "The cursor must contain the TITLE and INTENT columns.");
4049 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004050
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004051 String title = cursor.getString(titleColumn);
4052 if (!TextUtils.isEmpty(title)) {
4053 return title;
4054 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004055
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004056 String intentUri = cursor.getString(intentColumn);
4057 if (TextUtils.isEmpty(intentUri)) {
4058 return "";
4059 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004060
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004061 Intent intent;
4062 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02004063 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004064 } catch (URISyntaxException e) {
4065 return "";
4066 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004067
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004068 PackageManager packageManager = context.getPackageManager();
4069 ResolveInfo info = packageManager.resolveActivity(intent, 0);
4070 return info != null ? info.loadLabel(packageManager) : "";
4071 }
4072 }
4073
4074 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004075 * Returns the device ID that we should use when connecting to the mobile gtalk server.
4076 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
4077 * from the GoogleLoginService.
4078 *
4079 * @param androidId The Android ID for this device.
4080 * @return The device ID that should be used when connecting to the mobile gtalk server.
4081 * @hide
4082 */
4083 public static String getGTalkDeviceId(long androidId) {
4084 return "android-" + Long.toHexString(androidId);
4085 }
4086}