blob: 78a384b653176ad28f9ca8c614b64e36542d5ecf [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
19import com.google.android.collect.Maps;
20
21import org.apache.commons.codec.binary.Base64;
22
23import android.annotation.SdkConstant;
24import android.annotation.SdkConstant.SdkConstantType;
Mike LeBeau5d34e9b2010-02-10 19:34:56 -080025import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080026import android.content.ContentQueryMap;
27import android.content.ContentResolver;
28import android.content.ContentValues;
29import android.content.Context;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -080030import android.content.IContentProvider;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080031import android.content.Intent;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -080032import android.content.pm.ActivityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080033import android.content.pm.PackageManager;
34import android.content.pm.ResolveInfo;
35import android.content.res.Configuration;
36import android.content.res.Resources;
37import android.database.Cursor;
38import android.database.SQLException;
39import android.net.Uri;
40import android.os.*;
41import android.telephony.TelephonyManager;
42import android.text.TextUtils;
43import android.util.AndroidException;
Dan Egnor799f7212009-11-24 16:24:44 -080044import android.util.Config;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080045import android.util.Log;
46
47import java.net.URISyntaxException;
48import java.security.MessageDigest;
49import java.security.NoSuchAlgorithmException;
Vasu Nori272af002009-11-04 16:26:55 -080050import java.util.Collections;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080051import java.util.HashMap;
52import java.util.HashSet;
Vasu Nori272af002009-11-04 16:26:55 -080053import java.util.Map;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080054
55
56/**
57 * The Settings provider contains global system-level device preferences.
58 */
59public final class Settings {
60
61 // Intent actions for Settings
62
63 /**
64 * Activity Action: Show system settings.
65 * <p>
66 * Input: Nothing.
67 * <p>
68 * Output: nothing.
69 */
70 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
71 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
72
73 /**
74 * Activity Action: Show settings to allow configuration of APNs.
75 * <p>
76 * Input: Nothing.
77 * <p>
78 * Output: nothing.
79 */
80 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
81 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
82
83 /**
84 * Activity Action: Show settings to allow configuration of current location
85 * sources.
86 * <p>
87 * In some cases, a matching Activity may not exist, so ensure you
88 * safeguard against this.
89 * <p>
90 * Input: Nothing.
91 * <p>
92 * Output: Nothing.
93 */
94 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
95 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
96 "android.settings.LOCATION_SOURCE_SETTINGS";
97
98 /**
99 * Activity Action: Show settings to allow configuration of wireless controls
100 * such as Wi-Fi, Bluetooth and Mobile networks.
101 * <p>
102 * In some cases, a matching Activity may not exist, so ensure you
103 * safeguard against this.
104 * <p>
105 * Input: Nothing.
106 * <p>
107 * Output: Nothing.
108 */
109 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
110 public static final String ACTION_WIRELESS_SETTINGS =
111 "android.settings.WIRELESS_SETTINGS";
112
113 /**
114 * Activity Action: Show settings to allow entering/exiting airplane mode.
115 * <p>
116 * In some cases, a matching Activity may not exist, so ensure you
117 * safeguard against this.
118 * <p>
119 * Input: Nothing.
120 * <p>
121 * Output: Nothing.
122 */
123 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
124 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
125 "android.settings.AIRPLANE_MODE_SETTINGS";
126
127 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700128 * Activity Action: Show settings for accessibility modules.
129 * <p>
130 * In some cases, a matching Activity may not exist, so ensure you
131 * safeguard against this.
132 * <p>
133 * Input: Nothing.
134 * <p>
135 * Output: Nothing.
136 */
137 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
138 public static final String ACTION_ACCESSIBILITY_SETTINGS =
139 "android.settings.ACCESSIBILITY_SETTINGS";
140
141 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800142 * Activity Action: Show settings to allow configuration of security and
143 * location privacy.
144 * <p>
145 * In some cases, a matching Activity may not exist, so ensure you
146 * safeguard against this.
147 * <p>
148 * Input: Nothing.
149 * <p>
150 * Output: Nothing.
151 */
152 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
153 public static final String ACTION_SECURITY_SETTINGS =
154 "android.settings.SECURITY_SETTINGS";
155
156 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700157 * Activity Action: Show settings to allow configuration of privacy options.
158 * <p>
159 * In some cases, a matching Activity may not exist, so ensure you
160 * safeguard against this.
161 * <p>
162 * Input: Nothing.
163 * <p>
164 * Output: Nothing.
165 */
166 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
167 public static final String ACTION_PRIVACY_SETTINGS =
168 "android.settings.PRIVACY_SETTINGS";
169
170 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800171 * Activity Action: Show settings to allow configuration of Wi-Fi.
172
173 * <p>
174 * In some cases, a matching Activity may not exist, so ensure you
175 * safeguard against this.
176 * <p>
177 * Input: Nothing.
178 * <p>
179 * Output: Nothing.
180
181 */
182 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
183 public static final String ACTION_WIFI_SETTINGS =
184 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700185
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800186 /**
187 * Activity Action: Show settings to allow configuration of a static IP
188 * address for Wi-Fi.
189 * <p>
190 * In some cases, a matching Activity may not exist, so ensure you safeguard
191 * against this.
192 * <p>
193 * Input: Nothing.
194 * <p>
195 * Output: Nothing.
196 */
197 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
198 public static final String ACTION_WIFI_IP_SETTINGS =
199 "android.settings.WIFI_IP_SETTINGS";
200
201 /**
202 * Activity Action: Show settings to allow configuration of Bluetooth.
203 * <p>
204 * In some cases, a matching Activity may not exist, so ensure you
205 * safeguard against this.
206 * <p>
207 * Input: Nothing.
208 * <p>
209 * Output: Nothing.
210 */
211 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
212 public static final String ACTION_BLUETOOTH_SETTINGS =
213 "android.settings.BLUETOOTH_SETTINGS";
214
215 /**
216 * Activity Action: Show settings to allow configuration of date and time.
217 * <p>
218 * In some cases, a matching Activity may not exist, so ensure you
219 * safeguard against this.
220 * <p>
221 * Input: Nothing.
222 * <p>
223 * Output: Nothing.
224 */
225 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
226 public static final String ACTION_DATE_SETTINGS =
227 "android.settings.DATE_SETTINGS";
228
229 /**
230 * Activity Action: Show settings to allow configuration of sound and volume.
231 * <p>
232 * In some cases, a matching Activity may not exist, so ensure you
233 * safeguard against this.
234 * <p>
235 * Input: Nothing.
236 * <p>
237 * Output: Nothing.
238 */
239 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
240 public static final String ACTION_SOUND_SETTINGS =
241 "android.settings.SOUND_SETTINGS";
242
243 /**
244 * Activity Action: Show settings to allow configuration of display.
245 * <p>
246 * In some cases, a matching Activity may not exist, so ensure you
247 * safeguard against this.
248 * <p>
249 * Input: Nothing.
250 * <p>
251 * Output: Nothing.
252 */
253 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
254 public static final String ACTION_DISPLAY_SETTINGS =
255 "android.settings.DISPLAY_SETTINGS";
256
257 /**
258 * Activity Action: Show settings to allow configuration of locale.
259 * <p>
260 * In some cases, a matching Activity may not exist, so ensure you
261 * safeguard against this.
262 * <p>
263 * Input: Nothing.
264 * <p>
265 * Output: Nothing.
266 */
267 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
268 public static final String ACTION_LOCALE_SETTINGS =
269 "android.settings.LOCALE_SETTINGS";
270
271 /**
272 * Activity Action: Show settings to configure input methods, in particular
273 * allowing the user to enable input methods.
274 * <p>
275 * In some cases, a matching Activity may not exist, so ensure you
276 * safeguard against this.
277 * <p>
278 * Input: Nothing.
279 * <p>
280 * Output: Nothing.
281 */
282 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
283 public static final String ACTION_INPUT_METHOD_SETTINGS =
284 "android.settings.INPUT_METHOD_SETTINGS";
285
286 /**
287 * Activity Action: Show settings to manage the user input dictionary.
288 * <p>
289 * In some cases, a matching Activity may not exist, so ensure you
290 * safeguard against this.
291 * <p>
292 * Input: Nothing.
293 * <p>
294 * Output: Nothing.
295 */
296 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
297 public static final String ACTION_USER_DICTIONARY_SETTINGS =
298 "android.settings.USER_DICTIONARY_SETTINGS";
299
300 /**
301 * Activity Action: Show settings to allow configuration of application-related settings.
302 * <p>
303 * In some cases, a matching Activity may not exist, so ensure you
304 * safeguard against this.
305 * <p>
306 * Input: Nothing.
307 * <p>
308 * Output: Nothing.
309 */
310 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
311 public static final String ACTION_APPLICATION_SETTINGS =
312 "android.settings.APPLICATION_SETTINGS";
313
314 /**
315 * Activity Action: Show settings to allow configuration of application
316 * development-related settings.
317 * <p>
318 * In some cases, a matching Activity may not exist, so ensure you safeguard
319 * against this.
320 * <p>
321 * Input: Nothing.
322 * <p>
323 * Output: Nothing.
324 */
325 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
326 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
327 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
328
329 /**
330 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
331 * <p>
332 * In some cases, a matching Activity may not exist, so ensure you
333 * safeguard against this.
334 * <p>
335 * Input: Nothing.
336 * <p>
337 * Output: Nothing.
338 */
339 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
340 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
341 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700342
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800343 /**
344 * Activity Action: Show settings to manage installed applications.
345 * <p>
346 * In some cases, a matching Activity may not exist, so ensure you
347 * safeguard against this.
348 * <p>
349 * Input: Nothing.
350 * <p>
351 * Output: Nothing.
352 */
353 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
354 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
355 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700356
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800357 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700358 * Activity Action: Show screen of details about a particular application.
359 * <p>
360 * In some cases, a matching Activity may not exist, so ensure you
361 * safeguard against this.
362 * <p>
363 * Input: The Intent's data URI specifies the application package name
364 * to be shown, with the "package" scheme. That is "package:com.my.app".
365 * <p>
366 * Output: Nothing.
367 */
368 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
369 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
370 "android.settings.APPLICATION_DETAILS_SETTINGS";
371
372 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800373 * Activity Action: Show settings for system update functionality.
374 * <p>
375 * In some cases, a matching Activity may not exist, so ensure you
376 * safeguard against this.
377 * <p>
378 * Input: Nothing.
379 * <p>
380 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700381 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800382 * @hide
383 */
384 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
385 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
386 "android.settings.SYSTEM_UPDATE_SETTINGS";
387
388 /**
389 * Activity Action: Show settings to allow configuration of sync settings.
390 * <p>
391 * In some cases, a matching Activity may not exist, so ensure you
392 * safeguard against this.
393 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800394 * The account types available to add via the add account button may be restricted by adding an
395 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
396 * authorities. Only account types which can sync with that content provider will be offered to
397 * the user.
398 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800399 * Input: Nothing.
400 * <p>
401 * Output: Nothing.
402 */
403 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
404 public static final String ACTION_SYNC_SETTINGS =
405 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700406
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800407 /**
Erikeebc8e22010-02-18 13:27:19 -0800408 * Activity Action: Show add account screen for creating a new account.
409 * <p>
410 * In some cases, a matching Activity may not exist, so ensure you
411 * safeguard against this.
412 * <p>
413 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
414 * extra to the Intent with one or more syncable content provider's authorities. Only account
415 * types which can sync with that content provider will be offered to the user.
416 * <p>
417 * Input: Nothing.
418 * <p>
419 * Output: Nothing.
420 */
421 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
422 public static final String ACTION_ADD_ACCOUNT =
423 "android.settings.ADD_ACCOUNT_SETTINGS";
424
425 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800426 * Activity Action: Show settings for selecting the network operator.
427 * <p>
428 * In some cases, a matching Activity may not exist, so ensure you
429 * safeguard against this.
430 * <p>
431 * Input: Nothing.
432 * <p>
433 * Output: Nothing.
434 */
435 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
436 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
437 "android.settings.NETWORK_OPERATOR_SETTINGS";
438
439 /**
440 * Activity Action: Show settings for selection of 2G/3G.
441 * <p>
442 * In some cases, a matching Activity may not exist, so ensure you
443 * safeguard against this.
444 * <p>
445 * Input: Nothing.
446 * <p>
447 * Output: Nothing.
448 */
449 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
450 public static final String ACTION_DATA_ROAMING_SETTINGS =
451 "android.settings.DATA_ROAMING_SETTINGS";
452
453 /**
454 * Activity Action: Show settings for internal storage.
455 * <p>
456 * In some cases, a matching Activity may not exist, so ensure you
457 * safeguard against this.
458 * <p>
459 * Input: Nothing.
460 * <p>
461 * Output: Nothing.
462 */
463 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
464 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
465 "android.settings.INTERNAL_STORAGE_SETTINGS";
466 /**
467 * Activity Action: Show settings for memory card storage.
468 * <p>
469 * In some cases, a matching Activity may not exist, so ensure you
470 * safeguard against this.
471 * <p>
472 * Input: Nothing.
473 * <p>
474 * Output: Nothing.
475 */
476 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
477 public static final String ACTION_MEMORY_CARD_SETTINGS =
478 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700479
Justin Mattsonef340352010-01-13 21:05:46 -0800480 /**
481 * Activity Action: Show settings for global search.
482 * <p>
483 * In some cases, a matching Activity may not exist, so ensure you
484 * safeguard against this.
485 * <p>
486 * Input: Nothing.
487 * <p>
488 * Output: Nothing
489 */
490 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
491 public static final String ACTION_SEARCH_SETTINGS =
492 "android.search.action.SEARCH_SETTINGS";
493
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500494 /**
495 * Activity Action: Show general device information settings (serial
496 * number, software version, phone number, etc.).
497 * <p>
498 * In some cases, a matching Activity may not exist, so ensure you
499 * safeguard against this.
500 * <p>
501 * Input: Nothing.
502 * <p>
503 * Output: Nothing
504 */
505 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
506 public static final String ACTION_DEVICE_INFO_SETTINGS =
507 "android.settings.DEVICE_INFO_SETTINGS";
508
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800509 // End of Intent actions for Settings
510
Erikeebc8e22010-02-18 13:27:19 -0800511 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800512 * @hide - Private call() method on SettingsProvider to read from 'system' table.
513 */
514 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
515
516 /**
517 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
518 */
519 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
520
521 /**
Erikeebc8e22010-02-18 13:27:19 -0800522 * Activity Extra: Limit available options in launched activity based on the given authority.
523 * <p>
524 * This can be passed as an extra field in an Activity Intent with one or more syncable content
525 * provider's authorities as a String[]. This field is used by some intents to alter the
526 * behavior of the called activity.
527 * <p>
528 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
529 * on the authority given.
530 */
531 public static final String EXTRA_AUTHORITIES =
532 "authorities";
533
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800534 private static final String JID_RESOURCE_PREFIX = "android";
535
536 public static final String AUTHORITY = "settings";
537
538 private static final String TAG = "Settings";
Dan Egnor799f7212009-11-24 16:24:44 -0800539 private static final boolean LOCAL_LOGV = Config.LOGV || false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800540
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800541 public static class SettingNotFoundException extends AndroidException {
542 public SettingNotFoundException(String msg) {
543 super(msg);
544 }
545 }
546
547 /**
548 * Common base for tables of name/value settings.
549 */
550 public static class NameValueTable implements BaseColumns {
551 public static final String NAME = "name";
552 public static final String VALUE = "value";
553
554 protected static boolean putString(ContentResolver resolver, Uri uri,
555 String name, String value) {
556 // The database will take care of replacing duplicates.
557 try {
558 ContentValues values = new ContentValues();
559 values.put(NAME, name);
560 values.put(VALUE, value);
561 resolver.insert(uri, values);
562 return true;
563 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -0700564 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800565 return false;
566 }
567 }
568
569 public static Uri getUriFor(Uri uri, String name) {
570 return Uri.withAppendedPath(uri, name);
571 }
572 }
573
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800574 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800575 private static class NameValueCache {
576 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800577 private final Uri mUri;
578
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800579 private static final String[] SELECT_VALUE =
580 new String[] { Settings.NameValueTable.VALUE };
581 private static final String NAME_EQ_PLACEHOLDER = "name=?";
582
583 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -0800584 private final HashMap<String, String> mValues = new HashMap<String, String>();
585 private long mValuesVersion = 0;
586
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800587 // Initially null; set lazily and held forever. Synchronized on 'this'.
588 private IContentProvider mContentProvider = null;
589
590 // The method we'll call (or null, to not use) on the provider
591 // for the fast path of retrieving settings.
592 private final String mCallCommand;
593
594 public NameValueCache(String versionSystemProperty, Uri uri, String callCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800595 mVersionSystemProperty = versionSystemProperty;
596 mUri = uri;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800597 mCallCommand = callCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800598 }
599
Dan Egnor799f7212009-11-24 16:24:44 -0800600 public String getString(ContentResolver cr, String name) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800601 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -0800602
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800603 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -0800604 if (mValuesVersion != newValuesVersion) {
605 if (LOCAL_LOGV) {
606 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current " +
607 newValuesVersion + " != cached " + mValuesVersion);
608 }
609
610 mValues.clear();
611 mValuesVersion = newValuesVersion;
612 }
613
614 if (mValues.containsKey(name)) {
615 return mValues.get(name); // Could be null, that's OK -- negative caching
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800616 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800617 }
Dan Egnor799f7212009-11-24 16:24:44 -0800618
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800619 IContentProvider cp = null;
620 synchronized (this) {
621 cp = mContentProvider;
622 if (cp == null) {
623 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
624 }
625 }
626
627 // Try the fast path first, not using query(). If this
628 // fails (alternate Settings provider that doesn't support
629 // this interface?) then we fall back to the query/table
630 // interface.
631 if (mCallCommand != null) {
632 try {
633 Bundle b = cp.call(mCallCommand, name, null);
634 if (b != null) {
635 String value = b.getPairValue();
636 synchronized (this) {
637 mValues.put(name, value);
638 }
639 return value;
640 }
641 // If the response Bundle is null, we fall through
642 // to the query interface below.
643 } catch (RemoteException e) {
644 // Not supported by the remote side? Fall through
645 // to query().
646 }
647 }
648
Dan Egnor799f7212009-11-24 16:24:44 -0800649 Cursor c = null;
650 try {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800651 c = cp.query(mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
652 new String[]{name}, null);
Dan Egnor799f7212009-11-24 16:24:44 -0800653 if (c == null) {
654 Log.w(TAG, "Can't get key " + name + " from " + mUri);
655 return null;
656 }
657
658 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800659 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -0800660 mValues.put(name, value);
661 }
662 if (LOCAL_LOGV) {
663 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
664 name + " = " + (value == null ? "(null)" : value));
665 }
666 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800667 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -0800668 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
669 return null; // Return null, but don't cache it.
670 } finally {
671 if (c != null) c.close();
672 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800673 }
674 }
675
676 /**
677 * System settings, containing miscellaneous system preferences. This
678 * table holds simple name/value pairs. There are convenience
679 * functions for accessing individual settings entries.
680 */
681 public static final class System extends NameValueTable {
682 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
683
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800684 // Populated lazily, guarded by class object:
685 private static NameValueCache sNameValueCache = null;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700686
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800687 private static final HashSet<String> MOVED_TO_SECURE;
688 static {
689 MOVED_TO_SECURE = new HashSet<String>(30);
690 MOVED_TO_SECURE.add(Secure.ADB_ENABLED);
691 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
692 MOVED_TO_SECURE.add(Secure.BLUETOOTH_ON);
693 MOVED_TO_SECURE.add(Secure.DATA_ROAMING);
694 MOVED_TO_SECURE.add(Secure.DEVICE_PROVISIONED);
695 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
696 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
697 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Amith Yamasani156c4352010-03-05 17:10:03 -0800698 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
699 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
700 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800701 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
702 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
703 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
704 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
705 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
706 MOVED_TO_SECURE.add(Secure.USB_MASS_STORAGE_ENABLED);
707 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
708 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
709 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
710 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
711 MOVED_TO_SECURE.add(Secure.WIFI_ON);
712 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
713 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
714 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
715 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
716 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
717 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
718 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
719 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
720 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
721 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
722 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
723 }
724
725 /**
726 * Look up a name in the database.
727 * @param resolver to access the database with
728 * @param name to look up in the table
729 * @return the corresponding value, or null if not present
730 */
731 public synchronized static String getString(ContentResolver resolver, String name) {
732 if (MOVED_TO_SECURE.contains(name)) {
733 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
734 + " to android.provider.Settings.Secure, returning read-only value.");
735 return Secure.getString(resolver, name);
736 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800737 if (sNameValueCache == null) {
738 sNameValueCache = new NameValueCache(SYS_PROP_SETTING_VERSION, CONTENT_URI,
739 CALL_METHOD_GET_SYSTEM);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800740 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800741 return sNameValueCache.getString(resolver, name);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800742 }
743
744 /**
745 * Store a name/value pair into the database.
746 * @param resolver to access the database with
747 * @param name to store
748 * @param value to associate with the name
749 * @return true if the value was set, false on database errors
750 */
751 public static boolean putString(ContentResolver resolver, String name, String value) {
752 if (MOVED_TO_SECURE.contains(name)) {
753 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
754 + " to android.provider.Settings.Secure, value is unchanged.");
755 return false;
756 }
757 return putString(resolver, CONTENT_URI, name, value);
758 }
759
760 /**
761 * Construct the content URI for a particular name/value pair,
762 * useful for monitoring changes with a ContentObserver.
763 * @param name to look up in the table
764 * @return the corresponding content URI, or null if not present
765 */
766 public static Uri getUriFor(String name) {
767 if (MOVED_TO_SECURE.contains(name)) {
768 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
769 + " to android.provider.Settings.Secure, returning Secure URI.");
770 return Secure.getUriFor(Secure.CONTENT_URI, name);
771 }
772 return getUriFor(CONTENT_URI, name);
773 }
774
775 /**
776 * Convenience function for retrieving a single system settings value
777 * as an integer. Note that internally setting values are always
778 * stored as strings; this function converts the string to an integer
779 * for you. The default value will be returned if the setting is
780 * not defined or not an integer.
781 *
782 * @param cr The ContentResolver to access.
783 * @param name The name of the setting to retrieve.
784 * @param def Value to return if the setting is not defined.
785 *
786 * @return The setting's current value, or 'def' if it is not defined
787 * or not a valid integer.
788 */
789 public static int getInt(ContentResolver cr, String name, int def) {
790 String v = getString(cr, name);
791 try {
792 return v != null ? Integer.parseInt(v) : def;
793 } catch (NumberFormatException e) {
794 return def;
795 }
796 }
797
798 /**
799 * Convenience function for retrieving a single system settings value
800 * as an integer. Note that internally setting values are always
801 * stored as strings; this function converts the string to an integer
802 * for you.
803 * <p>
804 * This version does not take a default value. If the setting has not
805 * been set, or the string value is not a number,
806 * it throws {@link SettingNotFoundException}.
807 *
808 * @param cr The ContentResolver to access.
809 * @param name The name of the setting to retrieve.
810 *
811 * @throws SettingNotFoundException Thrown if a setting by the given
812 * name can't be found or the setting value is not an integer.
813 *
814 * @return The setting's current value.
815 */
816 public static int getInt(ContentResolver cr, String name)
817 throws SettingNotFoundException {
818 String v = getString(cr, name);
819 try {
820 return Integer.parseInt(v);
821 } catch (NumberFormatException e) {
822 throw new SettingNotFoundException(name);
823 }
824 }
825
826 /**
827 * Convenience function for updating a single settings value as an
828 * integer. This will either create a new entry in the table if the
829 * given name does not exist, or modify the value of the existing row
830 * with that name. Note that internally setting values are always
831 * stored as strings, so this function converts the given value to a
832 * string before storing it.
833 *
834 * @param cr The ContentResolver to access.
835 * @param name The name of the setting to modify.
836 * @param value The new value for the setting.
837 * @return true if the value was set, false on database errors
838 */
839 public static boolean putInt(ContentResolver cr, String name, int value) {
840 return putString(cr, name, Integer.toString(value));
841 }
842
843 /**
844 * Convenience function for retrieving a single system settings value
845 * as a {@code long}. Note that internally setting values are always
846 * stored as strings; this function converts the string to a {@code long}
847 * for you. The default value will be returned if the setting is
848 * not defined or not a {@code long}.
849 *
850 * @param cr The ContentResolver to access.
851 * @param name The name of the setting to retrieve.
852 * @param def Value to return if the setting is not defined.
853 *
854 * @return The setting's current value, or 'def' if it is not defined
855 * or not a valid {@code long}.
856 */
857 public static long getLong(ContentResolver cr, String name, long def) {
858 String valString = getString(cr, name);
859 long value;
860 try {
861 value = valString != null ? Long.parseLong(valString) : def;
862 } catch (NumberFormatException e) {
863 value = def;
864 }
865 return value;
866 }
867
868 /**
869 * Convenience function for retrieving a single system settings value
870 * as a {@code long}. Note that internally setting values are always
871 * stored as strings; this function converts the string to a {@code long}
872 * for you.
873 * <p>
874 * This version does not take a default value. If the setting has not
875 * been set, or the string value is not a number,
876 * it throws {@link SettingNotFoundException}.
877 *
878 * @param cr The ContentResolver to access.
879 * @param name The name of the setting to retrieve.
880 *
881 * @return The setting's current value.
882 * @throws SettingNotFoundException Thrown if a setting by the given
883 * name can't be found or the setting value is not an integer.
884 */
885 public static long getLong(ContentResolver cr, String name)
886 throws SettingNotFoundException {
887 String valString = getString(cr, name);
888 try {
889 return Long.parseLong(valString);
890 } catch (NumberFormatException e) {
891 throw new SettingNotFoundException(name);
892 }
893 }
894
895 /**
896 * Convenience function for updating a single settings value as a long
897 * integer. This will either create a new entry in the table if the
898 * given name does not exist, or modify the value of the existing row
899 * with that name. Note that internally setting values are always
900 * stored as strings, so this function converts the given value to a
901 * string before storing it.
902 *
903 * @param cr The ContentResolver to access.
904 * @param name The name of the setting to modify.
905 * @param value The new value for the setting.
906 * @return true if the value was set, false on database errors
907 */
908 public static boolean putLong(ContentResolver cr, String name, long value) {
909 return putString(cr, name, Long.toString(value));
910 }
911
912 /**
913 * Convenience function for retrieving a single system settings value
914 * as a floating point number. Note that internally setting values are
915 * always stored as strings; this function converts the string to an
916 * float for you. The default value will be returned if the setting
917 * is not defined or not a valid float.
918 *
919 * @param cr The ContentResolver to access.
920 * @param name The name of the setting to retrieve.
921 * @param def Value to return if the setting is not defined.
922 *
923 * @return The setting's current value, or 'def' if it is not defined
924 * or not a valid float.
925 */
926 public static float getFloat(ContentResolver cr, String name, float def) {
927 String v = getString(cr, name);
928 try {
929 return v != null ? Float.parseFloat(v) : def;
930 } catch (NumberFormatException e) {
931 return def;
932 }
933 }
934
935 /**
936 * Convenience function for retrieving a single system settings value
937 * as a float. Note that internally setting values are always
938 * stored as strings; this function converts the string to a float
939 * for you.
940 * <p>
941 * This version does not take a default value. If the setting has not
942 * been set, or the string value is not a number,
943 * it throws {@link SettingNotFoundException}.
944 *
945 * @param cr The ContentResolver to access.
946 * @param name The name of the setting to retrieve.
947 *
948 * @throws SettingNotFoundException Thrown if a setting by the given
949 * name can't be found or the setting value is not a float.
950 *
951 * @return The setting's current value.
952 */
953 public static float getFloat(ContentResolver cr, String name)
954 throws SettingNotFoundException {
955 String v = getString(cr, name);
956 try {
957 return Float.parseFloat(v);
958 } catch (NumberFormatException e) {
959 throw new SettingNotFoundException(name);
960 }
961 }
962
963 /**
964 * Convenience function for updating a single settings value as a
965 * floating point number. This will either create a new entry in the
966 * table if the given name does not exist, or modify the value of the
967 * existing row with that name. Note that internally setting values
968 * are always stored as strings, so this function converts the given
969 * value to a string before storing it.
970 *
971 * @param cr The ContentResolver to access.
972 * @param name The name of the setting to modify.
973 * @param value The new value for the setting.
974 * @return true if the value was set, false on database errors
975 */
976 public static boolean putFloat(ContentResolver cr, String name, float value) {
977 return putString(cr, name, Float.toString(value));
978 }
979
980 /**
981 * Convenience function to read all of the current
982 * configuration-related settings into a
983 * {@link Configuration} object.
984 *
985 * @param cr The ContentResolver to access.
986 * @param outConfig Where to place the configuration settings.
987 */
988 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
989 outConfig.fontScale = Settings.System.getFloat(
990 cr, FONT_SCALE, outConfig.fontScale);
991 if (outConfig.fontScale < 0) {
992 outConfig.fontScale = 1;
993 }
994 }
995
996 /**
997 * Convenience function to write a batch of configuration-related
998 * settings from a {@link Configuration} object.
999 *
1000 * @param cr The ContentResolver to access.
1001 * @param config The settings to write.
1002 * @return true if the values were set, false on database errors
1003 */
1004 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
1005 return Settings.System.putFloat(cr, FONT_SCALE, config.fontScale);
1006 }
1007
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001008 /** @hide */
1009 public static boolean hasInterestingConfigurationChanges(int changes) {
1010 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1011 }
1012
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001013 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
1014 return getInt(cr, SHOW_GTALK_SERVICE_STATUS, 0) != 0;
1015 }
1016
1017 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
1018 putInt(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0);
1019 }
1020
1021 /**
1022 * The content:// style URL for this table
1023 */
1024 public static final Uri CONTENT_URI =
1025 Uri.parse("content://" + AUTHORITY + "/system");
1026
1027 /**
1028 * Whether we keep the device on while the device is plugged in.
1029 * Supported values are:
1030 * <ul>
1031 * <li>{@code 0} to never stay on while plugged in</li>
1032 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
1033 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
1034 * </ul>
1035 * These values can be OR-ed together.
1036 */
1037 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
1038
1039 /**
1040 * What happens when the user presses the end call button if they're not
1041 * on a call.<br/>
1042 * <b>Values:</b><br/>
1043 * 0 - The end button does nothing.<br/>
1044 * 1 - The end button goes to the home screen.<br/>
1045 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1046 * 3 - The end button goes to the home screen. If the user is already on the
1047 * home screen, it puts the device to sleep.
1048 */
1049 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1050
1051 /**
David Brown458e8062010-03-08 21:52:11 -08001052 * END_BUTTON_BEHAVIOR value for "go home".
1053 * @hide
1054 */
1055 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1056
1057 /**
1058 * END_BUTTON_BEHAVIOR value for "go to sleep".
1059 * @hide
1060 */
1061 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
1062
1063 /**
1064 * END_BUTTON_BEHAVIOR default value.
1065 * @hide
1066 */
1067 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
1068
1069 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001070 * Whether Airplane Mode is on.
1071 */
1072 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
1073
1074 /**
1075 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
1076 */
1077 public static final String RADIO_BLUETOOTH = "bluetooth";
1078
1079 /**
1080 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
1081 */
1082 public static final String RADIO_WIFI = "wifi";
1083
1084 /**
1085 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
1086 */
1087 public static final String RADIO_CELL = "cell";
1088
1089 /**
1090 * A comma separated list of radios that need to be disabled when airplane mode
1091 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
1092 * included in the comma separated list.
1093 */
1094 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
1095
1096 /**
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001097 * A comma separated list of radios that should to be disabled when airplane mode
1098 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
1099 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
1100 * will be turned off when entering airplane mode, but the user will be able to reenable
1101 * Wifi in the Settings app.
1102 *
1103 * {@hide}
1104 */
1105 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
1106
1107 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001108 * The policy for deciding when Wi-Fi should go to sleep (which will in
1109 * turn switch to using the mobile data as an Internet connection).
1110 * <p>
1111 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
1112 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
1113 * {@link #WIFI_SLEEP_POLICY_NEVER}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001114 */
1115 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
1116
1117 /**
1118 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
1119 * policy, which is to sleep shortly after the turning off
1120 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001121 */
1122 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
1123
1124 /**
1125 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
1126 * the device is on battery, and never go to sleep when the device is
1127 * plugged in.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001128 */
1129 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001130
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001131 /**
1132 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001133 */
1134 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001135
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001136 /**
1137 * Whether to use static IP and other static network attributes.
1138 * <p>
1139 * Set to 1 for true and 0 for false.
1140 */
1141 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
1142
1143 /**
1144 * The static IP address.
1145 * <p>
1146 * Example: "192.168.1.51"
1147 */
1148 public static final String WIFI_STATIC_IP = "wifi_static_ip";
1149
1150 /**
1151 * If using static IP, the gateway's IP address.
1152 * <p>
1153 * Example: "192.168.1.1"
1154 */
1155 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
1156
1157 /**
1158 * If using static IP, the net mask.
1159 * <p>
1160 * Example: "255.255.255.0"
1161 */
1162 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
1163
1164 /**
1165 * If using static IP, the primary DNS's IP address.
1166 * <p>
1167 * Example: "192.168.1.1"
1168 */
1169 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
1170
1171 /**
1172 * If using static IP, the secondary DNS's IP address.
1173 * <p>
1174 * Example: "192.168.1.2"
1175 */
1176 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
1177
1178 /**
1179 * The number of radio channels that are allowed in the local
1180 * 802.11 regulatory domain.
1181 * @hide
1182 */
1183 public static final String WIFI_NUM_ALLOWED_CHANNELS = "wifi_num_allowed_channels";
1184
1185 /**
1186 * Determines whether remote devices may discover and/or connect to
1187 * this device.
1188 * <P>Type: INT</P>
1189 * 2 -- discoverable and connectable
1190 * 1 -- connectable but not discoverable
1191 * 0 -- neither connectable nor discoverable
1192 */
1193 public static final String BLUETOOTH_DISCOVERABILITY =
1194 "bluetooth_discoverability";
1195
1196 /**
1197 * Bluetooth discoverability timeout. If this value is nonzero, then
1198 * Bluetooth becomes discoverable for a certain number of seconds,
1199 * after which is becomes simply connectable. The value is in seconds.
1200 */
1201 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
1202 "bluetooth_discoverability_timeout";
1203
1204 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001205 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
1206 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001207 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001208 @Deprecated
1209 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001210
1211 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001212 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
1213 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001214 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001215 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001216 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
1217
1218 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001219 * @deprecated Use
1220 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
1221 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001222 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001223 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001224 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
1225 "lock_pattern_tactile_feedback_enabled";
1226
1227
1228 /**
1229 * A formatted string of the next alarm that is set, or the empty string
1230 * if there is no alarm set.
1231 */
1232 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
1233
1234 /**
1235 * Scaling factor for fonts, float.
1236 */
1237 public static final String FONT_SCALE = "font_scale";
1238
1239 /**
1240 * Name of an application package to be debugged.
1241 */
1242 public static final String DEBUG_APP = "debug_app";
1243
1244 /**
1245 * If 1, when launching DEBUG_APP it will wait for the debugger before
1246 * starting user code. If 0, it will run normally.
1247 */
1248 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
1249
1250 /**
1251 * Whether or not to dim the screen. 0=no 1=yes
1252 */
1253 public static final String DIM_SCREEN = "dim_screen";
1254
1255 /**
1256 * The timeout before the screen turns off.
1257 */
1258 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
1259
1260 /**
Mitsuru Oshimae5fb3282009-06-09 21:16:08 -07001261 * If 0, the compatibility mode is off for all applications.
1262 * If 1, older applications run under compatibility mode.
1263 * TODO: remove this settings before code freeze (bug/1907571)
1264 * @hide
1265 */
1266 public static final String COMPATIBILITY_MODE = "compatibility_mode";
1267
1268 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001269 * The screen backlight brightness between 0 and 255.
1270 */
1271 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
1272
1273 /**
Dan Murphy951764b2009-08-27 14:59:03 -05001274 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05001275 */
1276 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
1277
1278 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001279 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001280 */
1281 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
1282
1283 /**
1284 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001285 */
1286 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
1287
1288 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001289 * Control whether the process CPU usage meter should be shown.
1290 */
1291 public static final String SHOW_PROCESSES = "show_processes";
1292
1293 /**
1294 * If 1, the activity manager will aggressively finish activities and
1295 * processes as soon as they are no longer needed. If 0, the normal
1296 * extended lifetime is used.
1297 */
1298 public static final String ALWAYS_FINISH_ACTIVITIES =
1299 "always_finish_activities";
1300
1301
1302 /**
1303 * Ringer mode. This is used internally, changing this value will not
1304 * change the ringer mode. See AudioManager.
1305 */
1306 public static final String MODE_RINGER = "mode_ringer";
1307
1308 /**
1309 * Determines which streams are affected by ringer mode changes. The
1310 * stream type's bit should be set to 1 if it should be muted when going
1311 * into an inaudible ringer mode.
1312 */
1313 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
1314
1315 /**
1316 * Determines which streams are affected by mute. The
1317 * stream type's bit should be set to 1 if it should be muted when a mute request
1318 * is received.
1319 */
1320 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
1321
1322 /**
1323 * Whether vibrate is on for different events. This is used internally,
1324 * changing this value will not change the vibrate. See AudioManager.
1325 */
1326 public static final String VIBRATE_ON = "vibrate_on";
1327
1328 /**
1329 * Ringer volume. This is used internally, changing this value will not
1330 * change the volume. See AudioManager.
1331 */
1332 public static final String VOLUME_RING = "volume_ring";
1333
1334 /**
1335 * System/notifications volume. This is used internally, changing this
1336 * value will not change the volume. See AudioManager.
1337 */
1338 public static final String VOLUME_SYSTEM = "volume_system";
1339
1340 /**
1341 * Voice call volume. This is used internally, changing this value will
1342 * not change the volume. See AudioManager.
1343 */
1344 public static final String VOLUME_VOICE = "volume_voice";
1345
1346 /**
1347 * Music/media/gaming volume. This is used internally, changing this
1348 * value will not change the volume. See AudioManager.
1349 */
1350 public static final String VOLUME_MUSIC = "volume_music";
1351
1352 /**
1353 * Alarm volume. This is used internally, changing this
1354 * value will not change the volume. See AudioManager.
1355 */
1356 public static final String VOLUME_ALARM = "volume_alarm";
1357
1358 /**
1359 * Notification volume. This is used internally, changing this
1360 * value will not change the volume. See AudioManager.
1361 */
1362 public static final String VOLUME_NOTIFICATION = "volume_notification";
1363
1364 /**
Eric Laurent484d2882009-12-08 09:05:45 -08001365 * Bluetooth Headset volume. This is used internally, changing this value will
1366 * not change the volume. See AudioManager.
1367 */
1368 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
1369
1370 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001371 * Whether the notifications should use the ring volume (value of 1) or
1372 * a separate notification volume (value of 0). In most cases, users
1373 * will have this enabled so the notification and ringer volumes will be
1374 * the same. However, power users can disable this and use the separate
1375 * notification volume control.
1376 * <p>
1377 * Note: This is a one-off setting that will be removed in the future
1378 * when there is profile support. For this reason, it is kept hidden
1379 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001380 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001381 * @hide
1382 */
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001383 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001384 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001385
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001386 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05001387 * Whether silent mode should allow vibration feedback. This is used
1388 * internally in AudioService and the Sound settings activity to
1389 * coordinate decoupling of vibrate and silent modes. This setting
1390 * will likely be removed in a future release with support for
1391 * audio/vibe feedback profiles.
1392 *
1393 * @hide
1394 */
1395 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
1396
1397 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001398 * The mapping of stream type (integer) to its setting.
1399 */
1400 public static final String[] VOLUME_SETTINGS = {
1401 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08001402 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001403 };
1404
1405 /**
1406 * Appended to various volume related settings to record the previous
1407 * values before they the settings were affected by a silent/vibrate
1408 * ringer mode change.
1409 */
1410 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
1411
1412 /**
1413 * Persistent store for the system-wide default ringtone URI.
1414 * <p>
1415 * If you need to play the default ringtone at any given time, it is recommended
1416 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
1417 * to the set default ringtone at the time of playing.
1418 *
1419 * @see #DEFAULT_RINGTONE_URI
1420 */
1421 public static final String RINGTONE = "ringtone";
1422
1423 /**
1424 * A {@link Uri} that will point to the current default ringtone at any
1425 * given time.
1426 * <p>
1427 * If the current default ringtone is in the DRM provider and the caller
1428 * does not have permission, the exception will be a
1429 * FileNotFoundException.
1430 */
1431 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
1432
1433 /**
1434 * Persistent store for the system-wide default notification sound.
1435 *
1436 * @see #RINGTONE
1437 * @see #DEFAULT_NOTIFICATION_URI
1438 */
1439 public static final String NOTIFICATION_SOUND = "notification_sound";
1440
1441 /**
1442 * A {@link Uri} that will point to the current default notification
1443 * sound at any given time.
1444 *
1445 * @see #DEFAULT_RINGTONE_URI
1446 */
1447 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
1448
1449 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07001450 * Persistent store for the system-wide default alarm alert.
1451 *
1452 * @see #RINGTONE
1453 * @see #DEFAULT_ALARM_ALERT_URI
1454 */
1455 public static final String ALARM_ALERT = "alarm_alert";
1456
1457 /**
1458 * A {@link Uri} that will point to the current default alarm alert at
1459 * any given time.
1460 *
1461 * @see #DEFAULT_ALARM_ALERT_URI
1462 */
1463 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
1464
1465 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001466 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
1467 */
1468 public static final String TEXT_AUTO_REPLACE = "auto_replace";
1469
1470 /**
1471 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
1472 */
1473 public static final String TEXT_AUTO_CAPS = "auto_caps";
1474
1475 /**
1476 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
1477 * feature converts two spaces to a "." and space.
1478 */
1479 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001480
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001481 /**
1482 * Setting to showing password characters in text editors. 1 = On, 0 = Off
1483 */
1484 public static final String TEXT_SHOW_PASSWORD = "show_password";
1485
1486 public static final String SHOW_GTALK_SERVICE_STATUS =
1487 "SHOW_GTALK_SERVICE_STATUS";
1488
1489 /**
1490 * Name of activity to use for wallpaper on the home screen.
1491 */
1492 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
1493
1494 /**
1495 * Value to specify if the user prefers the date, time and time zone
1496 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
1497 */
1498 public static final String AUTO_TIME = "auto_time";
1499
1500 /**
1501 * Display times as 12 or 24 hours
1502 * 12
1503 * 24
1504 */
1505 public static final String TIME_12_24 = "time_12_24";
1506
1507 /**
1508 * Date format string
1509 * mm/dd/yyyy
1510 * dd/mm/yyyy
1511 * yyyy/mm/dd
1512 */
1513 public static final String DATE_FORMAT = "date_format";
1514
1515 /**
1516 * Whether the setup wizard has been run before (on first boot), or if
1517 * it still needs to be run.
1518 *
1519 * nonzero = it has been run in the past
1520 * 0 = it has not been run in the past
1521 */
1522 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
1523
1524 /**
1525 * Scaling factor for normal window animations. Setting to 0 will disable window
1526 * animations.
1527 */
1528 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
1529
1530 /**
1531 * Scaling factor for activity transition animations. Setting to 0 will disable window
1532 * animations.
1533 */
1534 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
1535
1536 /**
1537 * Scaling factor for normal window animations. Setting to 0 will disable window
1538 * animations.
1539 * @hide
1540 */
1541 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
1542
1543 /**
1544 * Control whether the accelerometer will be used to change screen
1545 * orientation. If 0, it will not be used unless explicitly requested
1546 * by the application; if 1, it will be used by default unless explicitly
1547 * disabled by the application.
1548 */
1549 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
1550
1551 /**
1552 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
1553 * boolean (1 or 0).
1554 */
1555 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
1556
1557 /**
David Kraused0f67152009-06-13 18:01:13 -05001558 * CDMA only settings
1559 * DTMF tone type played by the dialer when dialing.
1560 * 0 = Normal
1561 * 1 = Long
1562 * @hide
1563 */
1564 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
1565
1566 /**
1567 * CDMA only settings
1568 * Emergency Tone 0 = Off
1569 * 1 = Alert
1570 * 2 = Vibrate
1571 * @hide
1572 */
1573 public static final String EMERGENCY_TONE = "emergency_tone";
1574
1575 /**
1576 * CDMA only settings
1577 * Whether the auto retry is enabled. The value is
1578 * boolean (1 or 0).
1579 * @hide
1580 */
1581 public static final String CALL_AUTO_RETRY = "call_auto_retry";
1582
1583 /**
1584 * Whether the hearing aid is enabled. The value is
1585 * boolean (1 or 0).
1586 * @hide
1587 */
1588 public static final String HEARING_AID = "hearing_aid";
1589
1590 /**
1591 * CDMA only settings
1592 * TTY Mode
1593 * 0 = OFF
1594 * 1 = FULL
1595 * 2 = VCO
1596 * 3 = HCO
1597 * @hide
1598 */
1599 public static final String TTY_MODE = "tty_mode";
1600
1601 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001602 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
1603 * boolean (1 or 0).
1604 */
1605 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001606
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001607 /**
1608 * Whether the haptic feedback (long presses, ...) are enabled. The value is
1609 * boolean (1 or 0).
1610 */
1611 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07001612
Mike LeBeau48603e72009-06-05 00:27:00 +01001613 /**
1614 * Whether live web suggestions while the user types into search dialogs are
1615 * enabled. Browsers and other search UIs should respect this, as it allows
1616 * a user to avoid sending partial queries to a search engine, if it poses
1617 * any privacy concern. The value is boolean (1 or 0).
1618 */
1619 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001620
-b master501eec92009-07-06 13:53:11 -07001621 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08001622 * Whether the notification LED should repeatedly flash when a notification is
1623 * pending. The value is boolean (1 or 0).
1624 * @hide
1625 */
1626 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
1627
1628 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08001629 * Show pointer location on screen?
1630 * 0 = no
1631 * 1 = yes
1632 * @hide
1633 */
1634 public static final String POINTER_LOCATION = "pointer_location";
1635
1636 /**
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05001637 * Whether to play a sound for low-battery alerts.
1638 * @hide
1639 */
1640 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
1641
1642 /**
1643 * Whether to play a sound for dock events.
1644 * @hide
1645 */
1646 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
1647
1648 /**
1649 * Whether to play sounds when the keyguard is shown and dismissed.
1650 * @hide
1651 */
1652 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
1653
1654 /**
1655 * URI for the low battery sound file.
1656 * @hide
1657 */
1658 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
1659
1660 /**
1661 * URI for the desk dock "in" event sound.
1662 * @hide
1663 */
1664 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
1665
1666 /**
1667 * URI for the desk dock "out" event sound.
1668 * @hide
1669 */
1670 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
1671
1672 /**
1673 * URI for the car dock "in" event sound.
1674 * @hide
1675 */
1676 public static final String CAR_DOCK_SOUND = "car_dock_sound";
1677
1678 /**
1679 * URI for the car dock "out" event sound.
1680 * @hide
1681 */
1682 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
1683
1684 /**
1685 * URI for the "device locked" (keyguard shown) sound.
1686 * @hide
1687 */
1688 public static final String LOCK_SOUND = "lock_sound";
1689
1690 /**
1691 * URI for the "device unlocked" (keyguard dismissed) sound.
1692 * @hide
1693 */
1694 public static final String UNLOCK_SOUND = "unlock_sound";
1695
1696 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08001697 * Receive incoming SIP calls?
1698 * 0 = no
1699 * 1 = yes
1700 * @hide
1701 */
1702 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
1703
1704 /**
1705 * Call Preference String.
1706 * "SIP_ALWAYS" : Always use SIP with network access
1707 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
1708 * "SIP_ASK_ME_EACH_TIME" : Always ask me each time
1709 * @hide
1710 */
1711 public static final String SIP_CALL_OPTIONS = "sip_call_options";
1712
1713 /**
1714 * One of the sip call options: Always use SIP with network access.
1715 * @hide
1716 */
1717 public static final String SIP_ALWAYS = "SIP_ALWAYS";
1718
1719 /**
1720 * One of the sip call options: Only if destination is a SIP address.
1721 * @hide
1722 */
1723 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
1724
1725 /**
1726 * One of the sip call options: Always ask me each time.
1727 * @hide
1728 */
1729 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
1730
1731 /**
-b master501eec92009-07-06 13:53:11 -07001732 * Settings to backup. This is here so that it's in the same place as the settings
1733 * keys and easy to update.
1734 * @hide
1735 */
1736 public static final String[] SETTINGS_TO_BACKUP = {
1737 STAY_ON_WHILE_PLUGGED_IN,
-b master501eec92009-07-06 13:53:11 -07001738 WIFI_SLEEP_POLICY,
1739 WIFI_USE_STATIC_IP,
1740 WIFI_STATIC_IP,
1741 WIFI_STATIC_GATEWAY,
1742 WIFI_STATIC_NETMASK,
1743 WIFI_STATIC_DNS1,
1744 WIFI_STATIC_DNS2,
1745 BLUETOOTH_DISCOVERABILITY,
1746 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
1747 DIM_SCREEN,
1748 SCREEN_OFF_TIMEOUT,
1749 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07001750 SCREEN_BRIGHTNESS_MODE,
-b master501eec92009-07-06 13:53:11 -07001751 VIBRATE_ON,
1752 NOTIFICATIONS_USE_RING_VOLUME,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07001753 MODE_RINGER,
1754 MODE_RINGER_STREAMS_AFFECTED,
1755 MUTE_STREAMS_AFFECTED,
1756 VOLUME_VOICE,
1757 VOLUME_SYSTEM,
1758 VOLUME_RING,
1759 VOLUME_MUSIC,
1760 VOLUME_ALARM,
1761 VOLUME_NOTIFICATION,
Eric Laurent484d2882009-12-08 09:05:45 -08001762 VOLUME_BLUETOOTH_SCO,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07001763 VOLUME_VOICE + APPEND_FOR_LAST_AUDIBLE,
1764 VOLUME_SYSTEM + APPEND_FOR_LAST_AUDIBLE,
1765 VOLUME_RING + APPEND_FOR_LAST_AUDIBLE,
1766 VOLUME_MUSIC + APPEND_FOR_LAST_AUDIBLE,
1767 VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE,
1768 VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE,
Eric Laurent484d2882009-12-08 09:05:45 -08001769 VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE,
Daniel Sandler1c7fa482010-03-10 09:45:01 -05001770 VIBRATE_IN_SILENT,
-b master501eec92009-07-06 13:53:11 -07001771 TEXT_AUTO_REPLACE,
1772 TEXT_AUTO_CAPS,
1773 TEXT_AUTO_PUNCTUATE,
1774 TEXT_SHOW_PASSWORD,
1775 AUTO_TIME,
1776 TIME_12_24,
1777 DATE_FORMAT,
1778 ACCELEROMETER_ROTATION,
1779 DTMF_TONE_WHEN_DIALING,
1780 DTMF_TONE_TYPE_WHEN_DIALING,
1781 EMERGENCY_TONE,
1782 CALL_AUTO_RETRY,
1783 HEARING_AID,
1784 TTY_MODE,
1785 SOUND_EFFECTS_ENABLED,
1786 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate14c2d792010-02-25 16:49:44 -08001787 POWER_SOUNDS_ENABLED,
1788 DOCK_SOUNDS_ENABLED,
1789 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08001790 SHOW_WEB_SUGGESTIONS,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08001791 NOTIFICATION_LIGHT_PULSE,
1792 SIP_CALL_OPTIONS,
1793 SIP_RECEIVE_CALLS
-b master501eec92009-07-06 13:53:11 -07001794 };
1795
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001796 // Settings moved to Settings.Secure
1797
1798 /**
Mike Lockwood460ae0c2009-04-02 22:33:27 -07001799 * @deprecated Use {@link android.provider.Settings.Secure#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001800 * instead
1801 */
1802 @Deprecated
1803 public static final String ADB_ENABLED = Secure.ADB_ENABLED;
1804
1805 /**
1806 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
1807 */
1808 @Deprecated
1809 public static final String ANDROID_ID = Secure.ANDROID_ID;
1810
1811 /**
1812 * @deprecated Use {@link android.provider.Settings.Secure#BLUETOOTH_ON} instead
1813 */
1814 @Deprecated
1815 public static final String BLUETOOTH_ON = Secure.BLUETOOTH_ON;
1816
1817 /**
1818 * @deprecated Use {@link android.provider.Settings.Secure#DATA_ROAMING} instead
1819 */
1820 @Deprecated
1821 public static final String DATA_ROAMING = Secure.DATA_ROAMING;
1822
1823 /**
1824 * @deprecated Use {@link android.provider.Settings.Secure#DEVICE_PROVISIONED} instead
1825 */
1826 @Deprecated
1827 public static final String DEVICE_PROVISIONED = Secure.DEVICE_PROVISIONED;
1828
1829 /**
1830 * @deprecated Use {@link android.provider.Settings.Secure#HTTP_PROXY} instead
1831 */
1832 @Deprecated
1833 public static final String HTTP_PROXY = Secure.HTTP_PROXY;
1834
1835 /**
1836 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead
1837 */
1838 @Deprecated
1839 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001840
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001841 /**
1842 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
1843 * instead
1844 */
1845 @Deprecated
1846 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
1847
1848 /**
1849 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
1850 */
1851 @Deprecated
1852 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001853
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001854 /**
1855 * @deprecated Use {@link android.provider.Settings.Secure#NETWORK_PREFERENCE} instead
1856 */
1857 @Deprecated
1858 public static final String NETWORK_PREFERENCE = Secure.NETWORK_PREFERENCE;
1859
1860 /**
1861 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
1862 * instead
1863 */
1864 @Deprecated
1865 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
1866
1867 /**
1868 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
1869 * instead
1870 */
1871 @Deprecated
1872 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
1873
1874 /**
1875 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
1876 * instead
1877 */
1878 @Deprecated
1879 public static final String PARENTAL_CONTROL_REDIRECT_URL =
1880 Secure.PARENTAL_CONTROL_REDIRECT_URL;
1881
1882 /**
1883 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
1884 */
1885 @Deprecated
1886 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
1887
1888 /**
1889 * @deprecated Use {@link android.provider.Settings.Secure#USB_MASS_STORAGE_ENABLED} instead
1890 */
1891 @Deprecated
1892 public static final String USB_MASS_STORAGE_ENABLED = Secure.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001893
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001894 /**
1895 * @deprecated Use {@link android.provider.Settings.Secure#USE_GOOGLE_MAIL} instead
1896 */
1897 @Deprecated
1898 public static final String USE_GOOGLE_MAIL = Secure.USE_GOOGLE_MAIL;
1899
Dianne Hackborn4a51c202009-08-21 15:14:02 -07001900 /**
1901 * @deprecated Use
1902 * {@link android.provider.Settings.Secure#WIFI_MAX_DHCP_RETRY_COUNT} instead
1903 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001904 @Deprecated
1905 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Secure.WIFI_MAX_DHCP_RETRY_COUNT;
1906
Dianne Hackborn4a51c202009-08-21 15:14:02 -07001907 /**
1908 * @deprecated Use
1909 * {@link android.provider.Settings.Secure#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
1910 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001911 @Deprecated
1912 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
1913 Secure.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
1914
1915 /**
1916 * @deprecated Use
1917 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
1918 */
1919 @Deprecated
1920 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
1921 Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
1922
1923 /**
1924 * @deprecated Use
1925 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
1926 */
1927 @Deprecated
1928 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
1929 Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001930
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001931 /**
1932 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_NUM_OPEN_NETWORKS_KEPT}
1933 * instead
1934 */
1935 @Deprecated
1936 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Secure.WIFI_NUM_OPEN_NETWORKS_KEPT;
1937
1938 /**
1939 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_ON} instead
1940 */
1941 @Deprecated
1942 public static final String WIFI_ON = Secure.WIFI_ON;
1943
1944 /**
1945 * @deprecated Use
1946 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
1947 * instead
1948 */
1949 @Deprecated
1950 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
1951 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
1952
1953 /**
1954 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
1955 */
1956 @Deprecated
1957 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
1958
1959 /**
1960 * @deprecated Use
1961 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
1962 */
1963 @Deprecated
1964 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
1965 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001966
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001967 /**
1968 * @deprecated Use
1969 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
1970 */
1971 @Deprecated
1972 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
1973 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
1974
1975 /**
1976 * @deprecated Use
1977 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
1978 * instead
1979 */
1980 @Deprecated
1981 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
1982 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
1983
1984 /**
1985 * @deprecated Use
1986 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
1987 */
1988 @Deprecated
1989 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
1990 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
1991
1992 /**
1993 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
1994 * instead
1995 */
1996 @Deprecated
1997 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
1998
1999 /**
2000 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ON} instead
2001 */
2002 @Deprecated
2003 public static final String WIFI_WATCHDOG_ON = Secure.WIFI_WATCHDOG_ON;
2004
2005 /**
2006 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
2007 */
2008 @Deprecated
2009 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
2010
2011 /**
2012 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
2013 * instead
2014 */
2015 @Deprecated
2016 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
2017
2018 /**
2019 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
2020 * instead
2021 */
2022 @Deprecated
2023 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
2024 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
2025 }
2026
2027 /**
2028 * Secure system settings, containing system preferences that applications
2029 * can read but are not allowed to write. These are for preferences that
2030 * the user must explicitly modify through the system UI or specialized
2031 * APIs for those values, not modified directly by applications.
2032 */
2033 public static final class Secure extends NameValueTable {
2034 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
2035
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002036 // Populated lazily, guarded by class object:
2037 private static NameValueCache sNameValueCache = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002038
2039 /**
2040 * Look up a name in the database.
2041 * @param resolver to access the database with
2042 * @param name to look up in the table
2043 * @return the corresponding value, or null if not present
2044 */
2045 public synchronized static String getString(ContentResolver resolver, String name) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002046 if (sNameValueCache == null) {
2047 sNameValueCache = new NameValueCache(SYS_PROP_SETTING_VERSION, CONTENT_URI,
2048 CALL_METHOD_GET_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002049 }
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002050 return sNameValueCache.getString(resolver, name);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002051 }
2052
2053 /**
2054 * Store a name/value pair into the database.
2055 * @param resolver to access the database with
2056 * @param name to store
2057 * @param value to associate with the name
2058 * @return true if the value was set, false on database errors
2059 */
2060 public static boolean putString(ContentResolver resolver,
2061 String name, String value) {
2062 return putString(resolver, CONTENT_URI, name, value);
2063 }
2064
2065 /**
2066 * Construct the content URI for a particular name/value pair,
2067 * useful for monitoring changes with a ContentObserver.
2068 * @param name to look up in the table
2069 * @return the corresponding content URI, or null if not present
2070 */
2071 public static Uri getUriFor(String name) {
2072 return getUriFor(CONTENT_URI, name);
2073 }
2074
2075 /**
2076 * Convenience function for retrieving a single secure settings value
2077 * as an integer. Note that internally setting values are always
2078 * stored as strings; this function converts the string to an integer
2079 * for you. The default value will be returned if the setting is
2080 * not defined or not an integer.
2081 *
2082 * @param cr The ContentResolver to access.
2083 * @param name The name of the setting to retrieve.
2084 * @param def Value to return if the setting is not defined.
2085 *
2086 * @return The setting's current value, or 'def' if it is not defined
2087 * or not a valid integer.
2088 */
2089 public static int getInt(ContentResolver cr, String name, int def) {
2090 String v = getString(cr, name);
2091 try {
2092 return v != null ? Integer.parseInt(v) : def;
2093 } catch (NumberFormatException e) {
2094 return def;
2095 }
2096 }
2097
2098 /**
2099 * Convenience function for retrieving a single secure settings value
2100 * as an integer. Note that internally setting values are always
2101 * stored as strings; this function converts the string to an integer
2102 * for you.
2103 * <p>
2104 * This version does not take a default value. If the setting has not
2105 * been set, or the string value is not a number,
2106 * it throws {@link SettingNotFoundException}.
2107 *
2108 * @param cr The ContentResolver to access.
2109 * @param name The name of the setting to retrieve.
2110 *
2111 * @throws SettingNotFoundException Thrown if a setting by the given
2112 * name can't be found or the setting value is not an integer.
2113 *
2114 * @return The setting's current value.
2115 */
2116 public static int getInt(ContentResolver cr, String name)
2117 throws SettingNotFoundException {
2118 String v = getString(cr, name);
2119 try {
2120 return Integer.parseInt(v);
2121 } catch (NumberFormatException e) {
2122 throw new SettingNotFoundException(name);
2123 }
2124 }
2125
2126 /**
2127 * Convenience function for updating a single settings value as an
2128 * integer. This will either create a new entry in the table if the
2129 * given name does not exist, or modify the value of the existing row
2130 * with that name. Note that internally setting values are always
2131 * stored as strings, so this function converts the given value to a
2132 * string before storing it.
2133 *
2134 * @param cr The ContentResolver to access.
2135 * @param name The name of the setting to modify.
2136 * @param value The new value for the setting.
2137 * @return true if the value was set, false on database errors
2138 */
2139 public static boolean putInt(ContentResolver cr, String name, int value) {
2140 return putString(cr, name, Integer.toString(value));
2141 }
2142
2143 /**
2144 * Convenience function for retrieving a single secure settings value
2145 * as a {@code long}. Note that internally setting values are always
2146 * stored as strings; this function converts the string to a {@code long}
2147 * for you. The default value will be returned if the setting is
2148 * not defined or not a {@code long}.
2149 *
2150 * @param cr The ContentResolver to access.
2151 * @param name The name of the setting to retrieve.
2152 * @param def Value to return if the setting is not defined.
2153 *
2154 * @return The setting's current value, or 'def' if it is not defined
2155 * or not a valid {@code long}.
2156 */
2157 public static long getLong(ContentResolver cr, String name, long def) {
2158 String valString = getString(cr, name);
2159 long value;
2160 try {
2161 value = valString != null ? Long.parseLong(valString) : def;
2162 } catch (NumberFormatException e) {
2163 value = def;
2164 }
2165 return value;
2166 }
2167
2168 /**
2169 * Convenience function for retrieving a single secure settings value
2170 * as a {@code long}. Note that internally setting values are always
2171 * stored as strings; this function converts the string to a {@code long}
2172 * for you.
2173 * <p>
2174 * This version does not take a default value. If the setting has not
2175 * been set, or the string value is not a number,
2176 * it throws {@link SettingNotFoundException}.
2177 *
2178 * @param cr The ContentResolver to access.
2179 * @param name The name of the setting to retrieve.
2180 *
2181 * @return The setting's current value.
2182 * @throws SettingNotFoundException Thrown if a setting by the given
2183 * name can't be found or the setting value is not an integer.
2184 */
2185 public static long getLong(ContentResolver cr, String name)
2186 throws SettingNotFoundException {
2187 String valString = getString(cr, name);
2188 try {
2189 return Long.parseLong(valString);
2190 } catch (NumberFormatException e) {
2191 throw new SettingNotFoundException(name);
2192 }
2193 }
2194
2195 /**
2196 * Convenience function for updating a secure settings value as a long
2197 * integer. This will either create a new entry in the table if the
2198 * given name does not exist, or modify the value of the existing row
2199 * with that name. Note that internally setting values are always
2200 * stored as strings, so this function converts the given value to a
2201 * string before storing it.
2202 *
2203 * @param cr The ContentResolver to access.
2204 * @param name The name of the setting to modify.
2205 * @param value The new value for the setting.
2206 * @return true if the value was set, false on database errors
2207 */
2208 public static boolean putLong(ContentResolver cr, String name, long value) {
2209 return putString(cr, name, Long.toString(value));
2210 }
2211
2212 /**
2213 * Convenience function for retrieving a single secure settings value
2214 * as a floating point number. Note that internally setting values are
2215 * always stored as strings; this function converts the string to an
2216 * float for you. The default value will be returned if the setting
2217 * is not defined or not a valid float.
2218 *
2219 * @param cr The ContentResolver to access.
2220 * @param name The name of the setting to retrieve.
2221 * @param def Value to return if the setting is not defined.
2222 *
2223 * @return The setting's current value, or 'def' if it is not defined
2224 * or not a valid float.
2225 */
2226 public static float getFloat(ContentResolver cr, String name, float def) {
2227 String v = getString(cr, name);
2228 try {
2229 return v != null ? Float.parseFloat(v) : def;
2230 } catch (NumberFormatException e) {
2231 return def;
2232 }
2233 }
2234
2235 /**
2236 * Convenience function for retrieving a single secure settings value
2237 * as a float. Note that internally setting values are always
2238 * stored as strings; this function converts the string to a float
2239 * for you.
2240 * <p>
2241 * This version does not take a default value. If the setting has not
2242 * been set, or the string value is not a number,
2243 * it throws {@link SettingNotFoundException}.
2244 *
2245 * @param cr The ContentResolver to access.
2246 * @param name The name of the setting to retrieve.
2247 *
2248 * @throws SettingNotFoundException Thrown if a setting by the given
2249 * name can't be found or the setting value is not a float.
2250 *
2251 * @return The setting's current value.
2252 */
2253 public static float getFloat(ContentResolver cr, String name)
2254 throws SettingNotFoundException {
2255 String v = getString(cr, name);
2256 try {
2257 return Float.parseFloat(v);
2258 } catch (NumberFormatException e) {
2259 throw new SettingNotFoundException(name);
2260 }
2261 }
2262
2263 /**
2264 * Convenience function for updating a single settings value as a
2265 * floating point number. This will either create a new entry in the
2266 * table if the given name does not exist, or modify the value of the
2267 * existing row with that name. Note that internally setting values
2268 * are always stored as strings, so this function converts the given
2269 * value to a string before storing it.
2270 *
2271 * @param cr The ContentResolver to access.
2272 * @param name The name of the setting to modify.
2273 * @param value The new value for the setting.
2274 * @return true if the value was set, false on database errors
2275 */
2276 public static boolean putFloat(ContentResolver cr, String name, float value) {
2277 return putString(cr, name, Float.toString(value));
2278 }
2279
2280 /**
2281 * The content:// style URL for this table
2282 */
2283 public static final Uri CONTENT_URI =
2284 Uri.parse("content://" + AUTHORITY + "/secure");
2285
2286 /**
2287 * Whether ADB is enabled.
2288 */
2289 public static final String ADB_ENABLED = "adb_enabled";
2290
2291 /**
2292 * Setting to allow mock locations and location provider status to be injected into the
2293 * LocationManager service for testing purposes during application development. These
2294 * locations and status values override actual location and status information generated
2295 * by network, gps, or other location providers.
2296 */
2297 public static final String ALLOW_MOCK_LOCATION = "mock_location";
2298
2299 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08002300 * A 64-bit number (as a hex string) that is randomly
2301 * generated on the device's first boot and should remain
2302 * constant for the lifetime of the device. (The value may
2303 * change if a factory reset is performed on the device.)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002304 */
2305 public static final String ANDROID_ID = "android_id";
2306
2307 /**
2308 * Whether bluetooth is enabled/disabled
2309 * 0=disabled. 1=enabled.
2310 */
2311 public static final String BLUETOOTH_ON = "bluetooth_on";
2312
2313 /**
2314 * Get the key that retrieves a bluetooth headset's priority.
2315 * @hide
2316 */
2317 public static final String getBluetoothHeadsetPriorityKey(String address) {
2318 return ("bluetooth_headset_priority_" + address.toUpperCase());
2319 }
2320
2321 /**
2322 * Get the key that retrieves a bluetooth a2dp sink's priority.
2323 * @hide
2324 */
2325 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
2326 return ("bluetooth_a2dp_sink_priority_" + address.toUpperCase());
2327 }
2328
2329 /**
2330 * Whether or not data roaming is enabled. (0 = false, 1 = true)
2331 */
2332 public static final String DATA_ROAMING = "data_roaming";
2333
2334 /**
2335 * Setting to record the input method used by default, holding the ID
2336 * of the desired method.
2337 */
2338 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
2339
2340 /**
2341 * Whether the device has been provisioned (0 = false, 1 = true)
2342 */
2343 public static final String DEVICE_PROVISIONED = "device_provisioned";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002344
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002345 /**
2346 * List of input methods that are currently enabled. This is a string
2347 * containing the IDs of all enabled input methods, each ID separated
2348 * by ':'.
2349 */
2350 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002351
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002352 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07002353 * List of system input methods that are currently disabled. This is a string
2354 * containing the IDs of all disabled input methods, each ID separated
2355 * by ':'.
2356 * @hide
2357 */
2358 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
2359
2360 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002361 * Host name and port for a user-selected proxy.
2362 */
2363 public static final String HTTP_PROXY = "http_proxy";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002364
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002365 /**
2366 * Whether the package installer should allow installation of apps downloaded from
2367 * sources other than the Android Market (vending machine).
2368 *
2369 * 1 = allow installing from other sources
2370 * 0 = only allow installing from the Android Market
2371 */
2372 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002373
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002374 /**
2375 * Comma-separated list of location providers that activities may access.
2376 */
2377 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002378
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002379 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08002380 * Whether autolock is enabled (0 = false, 1 = true)
2381 */
2382 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
2383
2384 /**
2385 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
2386 */
2387 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
2388
2389 /**
2390 * Whether lock pattern will vibrate as user enters (0 = false, 1 = true)
2391 */
2392 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
2393 "lock_pattern_tactile_feedback_enabled";
2394
2395 /**
Mike Lockwoodbcab8df2009-06-25 16:39:09 -04002396 * Whether assisted GPS should be enabled or not.
2397 * @hide
2398 */
2399 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
2400
2401 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002402 * The Logging ID (a unique 64-bit value) as a hex string.
2403 * Used as a pseudonymous identifier for logging.
2404 * @deprecated This identifier is poorly initialized and has
2405 * many collisions. It should not be used.
2406 */
2407 @Deprecated
2408 public static final String LOGGING_ID = "logging_id";
2409
2410 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002411 * User preference for which network(s) should be used. Only the
2412 * connectivity service should touch this.
2413 */
2414 public static final String NETWORK_PREFERENCE = "network_preference";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002415
2416 /**
Robert Greenwalt2a091d72010-02-11 18:18:40 -08002417 * Used to disable Tethering on a device - defaults to true
2418 * @hide
2419 */
2420 public static final String TETHER_SUPPORTED = "tether_supported";
2421
2422 /**
Robert Greenwalt77b32dd2010-06-03 18:57:26 -07002423 * Used to require DUN APN on the device or not - defaults to a build config value
2424 * which defaults to false
2425 * @hide
2426 */
2427 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
2428
2429 /**
2430 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
2431 * corresponding build config values are set it will override the APN DB
2432 * values.
2433 * Consists of a comma seperated list of strings:
2434 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
2435 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
2436 * @hide
2437 */
2438 public static final String TETHER_DUN_APN = "tether_dun_apn";
2439
2440 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08002441 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002442 */
2443 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002444
2445 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08002446 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002447 */
2448 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002449
2450 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08002451 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002452 */
2453 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002454
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002455 /**
2456 * Settings classname to launch when Settings is clicked from All
2457 * Applications. Needed because of user testing between the old
2458 * and new Settings apps.
2459 */
2460 // TODO: 881807
2461 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002462
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002463 /**
2464 * USB Mass Storage Enabled
2465 */
2466 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002467
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002468 /**
2469 * If this setting is set (to anything), then all references
2470 * to Gmail on the device must change to Google Mail.
2471 */
2472 public static final String USE_GOOGLE_MAIL = "use_google_mail";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002473
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002474 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07002475 * If accessibility is enabled.
2476 */
2477 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
2478
2479 /**
2480 * List of the enabled accessibility providers.
2481 */
2482 public static final String ENABLED_ACCESSIBILITY_SERVICES =
2483 "enabled_accessibility_services";
2484
2485 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07002486 * Setting to always use the default text-to-speech settings regardless
2487 * of the application settings.
2488 * 1 = override application settings,
2489 * 0 = use application settings (if specified).
2490 */
2491 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
2492
2493 /**
2494 * Default text-to-speech engine speech rate. 100 = 1x
2495 */
2496 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
2497
2498 /**
2499 * Default text-to-speech engine pitch. 100 = 1x
2500 */
2501 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
2502
2503 /**
2504 * Default text-to-speech engine.
2505 */
2506 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
2507
2508 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07002509 * Default text-to-speech language.
2510 */
2511 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
2512
2513 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07002514 * Default text-to-speech country.
2515 */
2516 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
2517
2518 /**
2519 * Default text-to-speech locale variant.
2520 */
2521 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
2522
2523 /**
Charles Chenceffa152010-03-16 21:18:10 -07002524 * Space delimited list of plugin packages that are enabled.
2525 */
2526 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
2527
2528 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002529 * Whether to notify the user of open networks.
2530 * <p>
2531 * If not connected and the scan results have an open network, we will
2532 * put this notification up. If we attempt to connect to a network or
2533 * the open network(s) disappear, we remove the notification. When we
2534 * show the notification, we will not show it again for
2535 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
2536 */
2537 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
2538 "wifi_networks_available_notification_on";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002539
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002540 /**
2541 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
2542 * Connecting to a network will reset the timer.
2543 */
2544 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
2545 "wifi_networks_available_repeat_delay";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002546
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002547 /**
2548 * The number of radio channels that are allowed in the local
2549 * 802.11 regulatory domain.
2550 * @hide
2551 */
2552 public static final String WIFI_NUM_ALLOWED_CHANNELS = "wifi_num_allowed_channels";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002553
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002554 /**
2555 * When the number of open networks exceeds this number, the
2556 * least-recently-used excess networks will be removed.
2557 */
2558 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002559
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002560 /**
2561 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
2562 */
2563 public static final String WIFI_ON = "wifi_on";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002564
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002565 /**
Irfan Sheriffa3bd4092010-03-24 17:58:59 -07002566 * Used to save the Wifi_ON state prior to tethering.
2567 * This state will be checked to restore Wifi after
2568 * the user turns off tethering.
Irfan Sheriff5321aef2010-02-12 12:35:59 -08002569 *
2570 * @hide
2571 */
Irfan Sheriffa3bd4092010-03-24 17:58:59 -07002572 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
Irfan Sheriff5321aef2010-02-12 12:35:59 -08002573
2574 /**
Irfan Sheriff9ab518ad2010-03-12 15:48:17 -08002575 * AP SSID
2576 *
2577 * @hide
2578 */
2579 public static final String WIFI_AP_SSID = "wifi_ap_ssid";
2580
2581 /**
2582 * AP security
2583 *
2584 * @hide
2585 */
2586 public static final String WIFI_AP_SECURITY = "wifi_ap_security";
2587
2588 /**
2589 * AP passphrase
2590 *
2591 * @hide
2592 */
2593 public static final String WIFI_AP_PASSWD = "wifi_ap_passwd";
2594
2595 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002596 * The acceptable packet loss percentage (range 0 - 100) before trying
2597 * another AP on the same network.
2598 */
2599 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
2600 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002601
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002602 /**
2603 * The number of access points required for a network in order for the
2604 * watchdog to monitor it.
2605 */
2606 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002607
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002608 /**
2609 * The delay between background checks.
2610 */
2611 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
2612 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002613
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002614 /**
2615 * Whether the Wi-Fi watchdog is enabled for background checking even
2616 * after it thinks the user has connected to a good access point.
2617 */
2618 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
2619 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002620
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002621 /**
2622 * The timeout for a background ping
2623 */
2624 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
2625 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002626
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002627 /**
2628 * The number of initial pings to perform that *may* be ignored if they
2629 * fail. Again, if these fail, they will *not* be used in packet loss
2630 * calculation. For example, one network always seemed to time out for
2631 * the first couple pings, so this is set to 3 by default.
2632 */
2633 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
2634 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002635
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002636 /**
2637 * The maximum number of access points (per network) to attempt to test.
2638 * If this number is reached, the watchdog will no longer monitor the
2639 * initial connection state for the network. This is a safeguard for
2640 * networks containing multiple APs whose DNS does not respond to pings.
2641 */
2642 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002643
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002644 /**
2645 * Whether the Wi-Fi watchdog is enabled.
2646 */
2647 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
2648
2649 /**
2650 * 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 -08002651 */
2652 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
2653
2654 /**
2655 * The number of pings to test if an access point is a good connection.
2656 */
2657 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002658
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002659 /**
2660 * The delay between pings.
2661 */
2662 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002663
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002664 /**
2665 * The timeout per ping.
2666 */
2667 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002668
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002669 /**
2670 * The maximum number of times we will retry a connection to an access
2671 * point for which we have failed in acquiring an IP address from DHCP.
2672 * 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 -08002673 */
2674 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002675
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002676 /**
2677 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
2678 * data connectivity to be established after a disconnect from Wi-Fi.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002679 */
2680 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
2681 "wifi_mobile_data_transition_wakelock_timeout_ms";
2682
2683 /**
2684 * Whether background data usage is allowed by the user. See
2685 * ConnectivityManager for more info.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002686 */
2687 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07002688
2689 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00002690 * Origins for which browsers should allow geolocation by default.
2691 * The value is a space-separated list of origins.
2692 */
2693 public static final String ALLOWED_GEOLOCATION_ORIGINS
2694 = "allowed_geolocation_origins";
2695
2696 /**
Robert Greenwaltc03fa502010-02-23 18:58:05 -08002697 * Whether mobile data connections are allowed by the user. See
2698 * ConnectivityManager for more info.
2699 * @hide
2700 */
2701 public static final String MOBILE_DATA = "mobile_data";
2702
2703 /**
Wink Saville04e71b32009-04-02 11:00:54 -07002704 * The CDMA roaming mode 0 = Home Networks, CDMA default
2705 * 1 = Roaming on Affiliated networks
2706 * 2 = Roaming on any networks
2707 * @hide
2708 */
2709 public static final String CDMA_ROAMING_MODE = "roaming_settings";
2710
2711 /**
2712 * The CDMA subscription mode 0 = RUIM/SIM (default)
2713 * 1 = NV
2714 * @hide
2715 */
2716 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
2717
2718 /**
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002719 * The preferred network mode 7 = Global
2720 * 6 = EvDo only
2721 * 5 = CDMA w/o EvDo
2722 * 4 = CDMA / EvDo auto
2723 * 3 = GSM / WCDMA auto
2724 * 2 = WCDMA only
2725 * 1 = GSM only
2726 * 0 = GSM / WCDMA preferred
Wink Saville04e71b32009-04-02 11:00:54 -07002727 * @hide
2728 */
2729 public static final String PREFERRED_NETWORK_MODE =
2730 "preferred_network_mode";
2731
2732 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07002733 * The preferred TTY mode 0 = TTy Off, CDMA default
2734 * 1 = TTY Full
2735 * 2 = TTY HCO
2736 * 3 = TTY VCO
2737 * @hide
2738 */
2739 public static final String PREFERRED_TTY_MODE =
2740 "preferred_tty_mode";
2741
2742
2743 /**
Wink Saville04e71b32009-04-02 11:00:54 -07002744 * CDMA Cell Broadcast SMS
2745 * 0 = CDMA Cell Broadcast SMS disabled
2746 * 1 = CDMA Cell Broadcast SMS enabled
2747 * @hide
2748 */
2749 public static final String CDMA_CELL_BROADCAST_SMS =
2750 "cdma_cell_broadcast_sms";
2751
2752 /**
2753 * The cdma subscription 0 = Subscription from RUIM, when available
2754 * 1 = Subscription from NV
2755 * @hide
2756 */
2757 public static final String PREFERRED_CDMA_SUBSCRIPTION =
2758 "preferred_cdma_subscription";
2759
2760 /**
2761 * Whether the enhanced voice privacy mode is enabled.
2762 * 0 = normal voice privacy
2763 * 1 = enhanced voice privacy
2764 * @hide
2765 */
2766 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
2767
2768 /**
2769 * Whether the TTY mode mode is enabled.
2770 * 0 = disabled
2771 * 1 = enabled
2772 * @hide
2773 */
2774 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07002775
2776 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07002777 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07002778 * Type: int ( 0 = disabled, 1 = enabled )
2779 * @hide
2780 */
2781 public static final String BACKUP_ENABLED = "backup_enabled";
2782
2783 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08002784 * Controls whether application data is automatically restored from backup
2785 * at install time.
2786 * Type: int ( 0 = disabled, 1 = enabled )
2787 * @hide
2788 */
2789 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
2790
2791 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07002792 * Indicates whether settings backup has been fully provisioned.
2793 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
2794 * @hide
2795 */
2796 public static final String BACKUP_PROVISIONED = "backup_provisioned";
2797
2798 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07002799 * Component of the transport to use for backup/restore.
2800 * @hide
2801 */
2802 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07002803
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07002804 /**
2805 * Version for which the setup wizard was last shown. Bumped for
2806 * each release when there is new setup information to show.
2807 * @hide
2808 */
2809 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07002810
2811 /**
Doug Zongkerf6888892010-01-06 16:38:14 -08002812 * How frequently (in seconds) to check the memory status of the
2813 * device.
2814 * @hide
2815 */
2816 public static final String MEMCHECK_INTERVAL = "memcheck_interval";
2817
2818 /**
2819 * Max frequency (in seconds) to log memory check stats, in realtime
2820 * seconds. This allows for throttling of logs when the device is
2821 * running for large amounts of time.
2822 * @hide
2823 */
2824 public static final String MEMCHECK_LOG_REALTIME_INTERVAL =
2825 "memcheck_log_realtime_interval";
2826
2827 /**
2828 * Boolean indicating whether rebooting due to system memory checks
2829 * is enabled.
2830 * @hide
2831 */
2832 public static final String MEMCHECK_SYSTEM_ENABLED = "memcheck_system_enabled";
2833
2834 /**
2835 * How many bytes the system process must be below to avoid scheduling
2836 * a soft reboot. This reboot will happen when it is next determined
2837 * to be a good time.
2838 * @hide
2839 */
2840 public static final String MEMCHECK_SYSTEM_SOFT_THRESHOLD = "memcheck_system_soft";
2841
2842 /**
2843 * How many bytes the system process must be below to avoid scheduling
2844 * a hard reboot. This reboot will happen immediately.
2845 * @hide
2846 */
2847 public static final String MEMCHECK_SYSTEM_HARD_THRESHOLD = "memcheck_system_hard";
2848
2849 /**
2850 * How many bytes the phone process must be below to avoid scheduling
2851 * a soft restart. This restart will happen when it is next determined
2852 * to be a good time.
2853 * @hide
2854 */
2855 public static final String MEMCHECK_PHONE_SOFT_THRESHOLD = "memcheck_phone_soft";
2856
2857 /**
2858 * How many bytes the phone process must be below to avoid scheduling
2859 * a hard restart. This restart will happen immediately.
2860 * @hide
2861 */
2862 public static final String MEMCHECK_PHONE_HARD_THRESHOLD = "memcheck_phone_hard";
2863
2864 /**
2865 * Boolean indicating whether restarting the phone process due to
2866 * memory checks is enabled.
2867 * @hide
2868 */
2869 public static final String MEMCHECK_PHONE_ENABLED = "memcheck_phone_enabled";
2870
2871 /**
2872 * First time during the day it is okay to kill processes
2873 * or reboot the device due to low memory situations. This number is
2874 * in seconds since midnight.
2875 * @hide
2876 */
2877 public static final String MEMCHECK_EXEC_START_TIME = "memcheck_exec_start_time";
2878
2879 /**
2880 * Last time during the day it is okay to kill processes
2881 * or reboot the device due to low memory situations. This number is
2882 * in seconds since midnight.
2883 * @hide
2884 */
2885 public static final String MEMCHECK_EXEC_END_TIME = "memcheck_exec_end_time";
2886
2887 /**
2888 * How long the screen must have been off in order to kill processes
2889 * or reboot. This number is in seconds. A value of -1 means to
2890 * entirely disregard whether the screen is on.
2891 * @hide
2892 */
2893 public static final String MEMCHECK_MIN_SCREEN_OFF = "memcheck_min_screen_off";
2894
2895 /**
2896 * How much time there must be until the next alarm in order to kill processes
2897 * or reboot. This number is in seconds. Note: this value must be
2898 * smaller than {@link #MEMCHECK_RECHECK_INTERVAL} or else it will
2899 * always see an alarm scheduled within its time.
2900 * @hide
2901 */
2902 public static final String MEMCHECK_MIN_ALARM = "memcheck_min_alarm";
2903
2904 /**
2905 * How frequently to check whether it is a good time to restart things,
2906 * if the device is in a bad state. This number is in seconds. Note:
2907 * this value must be larger than {@link #MEMCHECK_MIN_ALARM} or else
2908 * the alarm to schedule the recheck will always appear within the
2909 * minimum "do not execute now" time.
2910 * @hide
2911 */
2912 public static final String MEMCHECK_RECHECK_INTERVAL = "memcheck_recheck_interval";
2913
2914 /**
2915 * How frequently (in DAYS) to reboot the device. If 0, no reboots
2916 * will occur.
2917 * @hide
2918 */
2919 public static final String REBOOT_INTERVAL = "reboot_interval";
2920
2921 /**
2922 * First time during the day it is okay to force a reboot of the
2923 * device (if REBOOT_INTERVAL is set). This number is
2924 * in seconds since midnight.
2925 * @hide
2926 */
2927 public static final String REBOOT_START_TIME = "reboot_start_time";
2928
2929 /**
2930 * The window of time (in seconds) after each REBOOT_INTERVAL in which
2931 * a reboot can be executed. If 0, a reboot will always be executed at
2932 * exactly the given time. Otherwise, it will only be executed if
2933 * the device is idle within the window.
2934 * @hide
2935 */
2936 public static final String REBOOT_WINDOW = "reboot_window";
2937
2938 /**
Doug Zongker43866e02010-01-07 12:09:54 -08002939 * Threshold values for the duration and level of a discharge cycle, under
2940 * which we log discharge cycle info.
2941 * @hide
2942 */
2943 public static final String BATTERY_DISCHARGE_DURATION_THRESHOLD =
2944 "battery_discharge_duration_threshold";
2945 /** @hide */
2946 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
2947
2948 /**
2949 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR intents
2950 * on application crashes and ANRs. If this is disabled, the crash/ANR dialog
2951 * will never display the "Report" button.
2952 * Type: int ( 0 = disallow, 1 = allow )
2953 * @hide
2954 */
2955 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
2956
2957 /**
2958 * Nonzero causes Log.wtf() to crash.
2959 * @hide
2960 */
2961 public static final String WTF_IS_FATAL = "wtf_is_fatal";
2962
2963 /**
2964 * Maximum age of entries kept by {@link android.os.IDropBox}.
2965 * @hide
2966 */
2967 public static final String DROPBOX_AGE_SECONDS =
2968 "dropbox_age_seconds";
2969 /**
Dan Egnor3a8b0c12010-03-24 17:48:20 -07002970 * Maximum number of entry files which {@link android.os.IDropBox} will keep around.
2971 * @hide
2972 */
2973 public static final String DROPBOX_MAX_FILES =
2974 "dropbox_max_files";
2975 /**
Doug Zongker43866e02010-01-07 12:09:54 -08002976 * Maximum amount of disk space used by {@link android.os.IDropBox} no matter what.
2977 * @hide
2978 */
2979 public static final String DROPBOX_QUOTA_KB =
2980 "dropbox_quota_kb";
2981 /**
2982 * Percent of free disk (excluding reserve) which {@link android.os.IDropBox} will use.
2983 * @hide
2984 */
2985 public static final String DROPBOX_QUOTA_PERCENT =
2986 "dropbox_quota_percent";
2987 /**
2988 * Percent of total disk which {@link android.os.IDropBox} will never dip into.
2989 * @hide
2990 */
2991 public static final String DROPBOX_RESERVE_PERCENT =
2992 "dropbox_reserve_percent";
2993 /**
2994 * Prefix for per-tag dropbox disable/enable settings.
2995 * @hide
2996 */
2997 public static final String DROPBOX_TAG_PREFIX =
2998 "dropbox:";
Dan Egnora455d192010-03-12 08:52:28 -08002999 /**
3000 * Lines of logcat to include with system crash/ANR/etc. reports,
3001 * as a prefix of the dropbox tag of the report type.
3002 * For example, "logcat_for_system_server_anr" controls the lines
3003 * of logcat captured with system server ANR reports. 0 to disable.
3004 * @hide
3005 */
3006 public static final String ERROR_LOGCAT_PREFIX =
3007 "logcat_for_";
Doug Zongker43866e02010-01-07 12:09:54 -08003008
3009
3010 /**
3011 * Screen timeout in milliseconds corresponding to the
3012 * PowerManager's POKE_LOCK_SHORT_TIMEOUT flag (i.e. the fastest
3013 * possible screen timeout behavior.)
3014 * @hide
3015 */
3016 public static final String SHORT_KEYLIGHT_DELAY_MS =
3017 "short_keylight_delay_ms";
3018
3019 /**
3020 * The interval in minutes after which the amount of free storage left on the
3021 * device is logged to the event log
3022 * @hide
3023 */
3024 public static final String SYS_FREE_STORAGE_LOG_INTERVAL =
3025 "sys_free_storage_log_interval";
3026
3027 /**
3028 * Threshold for the amount of change in disk free space required to report the amount of
3029 * free space. Used to prevent spamming the logs when the disk free space isn't changing
3030 * frequently.
3031 * @hide
3032 */
3033 public static final String DISK_FREE_CHANGE_REPORTING_THRESHOLD =
3034 "disk_free_change_reporting_threshold";
3035
3036
3037 /**
3038 * Minimum percentage of free storage on the device that is used to determine if
3039 * the device is running low on storage.
3040 * Say this value is set to 10, the device is considered running low on storage
3041 * if 90% or more of the device storage is filled up.
3042 * @hide
3043 */
3044 public static final String SYS_STORAGE_THRESHOLD_PERCENTAGE =
3045 "sys_storage_threshold_percentage";
3046
3047 /**
3048 * The interval in milliseconds after which Wi-Fi is considered idle.
3049 * When idle, it is possible for the device to be switched from Wi-Fi to
3050 * the mobile data network.
3051 * @hide
3052 */
3053 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
3054
3055 /**
Doug Zongkeredc51892010-01-07 13:51:16 -08003056 * The interval in milliseconds at which to check packet counts on the
3057 * mobile data interface when screen is on, to detect possible data
3058 * connection problems.
3059 * @hide
3060 */
3061 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
3062 "pdp_watchdog_poll_interval_ms";
3063
3064 /**
3065 * The interval in milliseconds at which to check packet counts on the
3066 * mobile data interface when screen is off, to detect possible data
3067 * connection problems.
3068 * @hide
3069 */
3070 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
3071 "pdp_watchdog_long_poll_interval_ms";
3072
3073 /**
3074 * The interval in milliseconds at which to check packet counts on the
3075 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
3076 * outgoing packets has been reached without incoming packets.
3077 * @hide
3078 */
3079 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
3080 "pdp_watchdog_error_poll_interval_ms";
3081
3082 /**
3083 * The number of outgoing packets sent without seeing an incoming packet
3084 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
3085 * device is logged to the event log
3086 * @hide
3087 */
3088 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
3089 "pdp_watchdog_trigger_packet_count";
3090
3091 /**
3092 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
3093 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
3094 * attempting data connection recovery.
3095 * @hide
3096 */
3097 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
3098 "pdp_watchdog_error_poll_count";
3099
3100 /**
3101 * The number of failed PDP reset attempts before moving to something more
3102 * drastic: re-registering to the network.
3103 * @hide
3104 */
3105 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
3106 "pdp_watchdog_max_pdp_reset_fail_count";
3107
3108 /**
3109 * Address to ping as a last sanity check before attempting any recovery.
3110 * Unset or set to "0.0.0.0" to skip this check.
3111 * @hide
3112 */
3113 public static final String PDP_WATCHDOG_PING_ADDRESS = "pdp_watchdog_ping_address";
3114
3115 /**
3116 * The "-w deadline" parameter for the ping, ie, the max time in
3117 * seconds to spend pinging.
3118 * @hide
3119 */
3120 public static final String PDP_WATCHDOG_PING_DEADLINE = "pdp_watchdog_ping_deadline";
3121
3122 /**
3123 * The interval in milliseconds at which to check gprs registration
3124 * after the first registration mismatch of gprs and voice service,
3125 * to detect possible data network registration problems.
3126 *
3127 * @hide
3128 */
3129 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
3130 "gprs_register_check_period_ms";
3131
3132 /**
3133 * The length of time in milli-seconds that automatic small adjustments to
3134 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
3135 * @hide
3136 */
3137 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
3138
3139 /**
3140 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
3141 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
3142 * exceeded.
3143 * @hide
3144 */
3145 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
3146
3147 /**
3148 * The maximum reconnect delay for short network outages or when the network is suspended
3149 * due to phone use.
3150 * @hide
3151 */
3152 public static final String SYNC_MAX_RETRY_DELAY_IN_SECONDS =
3153 "sync_max_retry_delay_in_seconds";
3154
3155 /**
3156 * The interval in milliseconds at which to check the number of SMS sent
3157 * out without asking for use permit, to limit the un-authorized SMS
3158 * usage.
3159 * @hide
3160 */
3161 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
3162 "sms_outgoing_check_interval_ms";
3163
3164 /**
3165 * The number of outgoing SMS sent without asking for user permit
3166 * (of {@link #SMS_OUTGOING_CHECK_INTERVAL_MS}
3167 * @hide
3168 */
3169 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
3170 "sms_outgoing_check_max_count";
3171
3172 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003173 * The number of promoted sources in GlobalSearch.
3174 * @hide
3175 */
3176 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
3177 /**
3178 * The maximum number of suggestions returned by GlobalSearch.
3179 * @hide
3180 */
3181 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
3182 /**
3183 * The number of suggestions GlobalSearch will ask each non-web search source for.
3184 * @hide
3185 */
3186 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
3187 /**
3188 * The number of suggestions the GlobalSearch will ask the web search source for.
3189 * @hide
3190 */
3191 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
3192 "search_web_results_override_limit";
3193 /**
3194 * The number of milliseconds that GlobalSearch will wait for suggestions from
3195 * promoted sources before continuing with all other sources.
3196 * @hide
3197 */
3198 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
3199 "search_promoted_source_deadline_millis";
3200 /**
3201 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
3202 * @hide
3203 */
3204 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
3205 /**
3206 * The maximum number of milliseconds that GlobalSearch shows the previous results
3207 * after receiving a new query.
3208 * @hide
3209 */
3210 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
3211 /**
3212 * The maximum age of log data used for shortcuts in GlobalSearch.
3213 * @hide
3214 */
3215 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
3216 /**
3217 * The maximum age of log data used for source ranking in GlobalSearch.
3218 * @hide
3219 */
3220 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
3221 "search_max_source_event_age_millis";
3222 /**
3223 * The minimum number of impressions needed to rank a source in GlobalSearch.
3224 * @hide
3225 */
3226 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
3227 "search_min_impressions_for_source_ranking";
3228 /**
3229 * The minimum number of clicks needed to rank a source in GlobalSearch.
3230 * @hide
3231 */
3232 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
3233 "search_min_clicks_for_source_ranking";
3234 /**
3235 * The maximum number of shortcuts shown by GlobalSearch.
3236 * @hide
3237 */
3238 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
3239 /**
3240 * The size of the core thread pool for suggestion queries in GlobalSearch.
3241 * @hide
3242 */
3243 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
3244 "search_query_thread_core_pool_size";
3245 /**
3246 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
3247 * @hide
3248 */
3249 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
3250 "search_query_thread_max_pool_size";
3251 /**
3252 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
3253 * @hide
3254 */
3255 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
3256 "search_shortcut_refresh_core_pool_size";
3257 /**
3258 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
3259 * @hide
3260 */
3261 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
3262 "search_shortcut_refresh_max_pool_size";
3263 /**
3264 * The maximun time that excess threads in the GlobalSeach thread pools will
3265 * wait before terminating.
3266 * @hide
3267 */
3268 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
3269 "search_thread_keepalive_seconds";
3270 /**
3271 * The maximum number of concurrent suggestion queries to each source.
3272 * @hide
3273 */
3274 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
3275 "search_per_source_concurrent_query_limit";
3276
San Mehat87734d32010-01-08 12:53:06 -08003277 /**
3278 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
3279 * @hide
3280 */
3281 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
3282
3283 /**
3284 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
3285 * @hide
3286 */
3287 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
3288
3289 /**
3290 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
3291 * @hide
3292 */
3293 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
3294
3295 /**
3296 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
3297 * @hide
3298 */
3299 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003300
Dan Egnor42471dd2010-01-07 17:25:22 -08003301 /**
3302 * If nonzero, ANRs in invisible background processes bring up a dialog.
3303 * Otherwise, the process will be silently killed.
3304 * @hide
3305 */
3306 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08003307
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08003308 /**
3309 * The {@link ComponentName} string of the service to be used as the voice recognition
3310 * service.
Erikeebc8e22010-02-18 13:27:19 -08003311 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08003312 * @hide
3313 */
3314 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08003315
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08003316 /**
David Brown458e8062010-03-08 21:52:11 -08003317 * What happens when the user presses the Power button while in-call
3318 * and the screen is on.<br/>
3319 * <b>Values:</b><br/>
3320 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
3321 * 2 - The Power button hangs up the current call.<br/>
3322 *
3323 * @hide
3324 */
3325 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
3326
3327 /**
3328 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
3329 * @hide
3330 */
3331 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
3332
3333 /**
3334 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
3335 * @hide
3336 */
3337 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
3338
3339 /**
3340 * INCALL_POWER_BUTTON_BEHAVIOR default value.
3341 * @hide
3342 */
3343 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
3344 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
3345
3346 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07003347 * The current night mode that has been selected by the user. Owned
3348 * and controlled by UiModeManagerService. Constants are as per
3349 * UiModeManager.
3350 * @hide
3351 */
3352 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07003353
3354 /**
3355 * Let user pick default install location.
3356 * @hide
3357 */
3358 public static final String SET_INSTALL_LOCATION = "set_install_location";
3359
3360 /**
3361 * Default install location value.
3362 * 0 = auto, let system decide
3363 * 1 = internal
3364 * 2 = sdcard
3365 * @hide
3366 */
3367 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07003368
3369 /**
3370 * The bandwidth throttle polling freqency in seconds
3371 * @hide
3372 */
3373 public static final String THROTTLE_POLLING_SEC = "throttle_polling_sec";
3374
3375 /**
3376 * The bandwidth throttle threshold (long)
3377 * @hide
3378 */
Robert Greenwaltd3bb93f2010-04-12 19:20:55 -07003379 public static final String THROTTLE_THRESHOLD_BYTES = "throttle_threshold_bytes";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07003380
3381 /**
3382 * The bandwidth throttle value (kbps)
3383 * @hide
3384 */
Robert Greenwaltd3bb93f2010-04-12 19:20:55 -07003385 public static final String THROTTLE_VALUE_KBITSPS = "throttle_value_kbitsps";
Robert Greenwalt9e696c22010-04-01 14:45:18 -07003386
3387 /**
3388 * The bandwidth throttle reset calendar day (1-28)
3389 * @hide
3390 */
3391 public static final String THROTTLE_RESET_DAY = "throttle_reset_day";
3392
3393 /**
3394 * The throttling notifications we should send
3395 * @hide
3396 */
3397 public static final String THROTTLE_NOTIFICATION_TYPE = "throttle_notification_type";
3398
3399 /**
Irfan Sheriffc9b68512010-04-08 14:12:33 -07003400 * Help URI for data throttling policy
3401 * @hide
3402 */
3403 public static final String THROTTLE_HELP_URI = "throttle_help_uri";
3404
Robert Greenwaltd1055a22010-05-25 15:54:52 -07003405 /**
3406 * The length of time in Sec that we allow our notion of NTP time
3407 * to be cached before we refresh it
3408 * @hide
3409 */
3410 public static final String THROTTLE_MAX_NTP_CACHE_AGE_SEC =
3411 "throttle_max_ntp_cache_age_sec";
3412
Steve Howard9c4e33e2010-07-28 15:59:29 -07003413 /**
3414 * The maximum size, in bytes, of a download that the download manager will transfer over
3415 * a non-wifi connection.
3416 * @hide
3417 */
3418 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
3419 "download_manager_max_bytes_over_mobile";
3420
Irfan Sheriffc9b68512010-04-08 14:12:33 -07003421
3422 /**
-b master501eec92009-07-06 13:53:11 -07003423 * @hide
3424 */
3425 public static final String[] SETTINGS_TO_BACKUP = {
Amith Yamasani8823c0a82009-07-07 14:30:17 -07003426 ADB_ENABLED,
3427 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07003428 PARENTAL_CONTROL_ENABLED,
3429 PARENTAL_CONTROL_REDIRECT_URL,
3430 USB_MASS_STORAGE_ENABLED,
3431 ACCESSIBILITY_ENABLED,
Christopher Tate14c2d792010-02-25 16:49:44 -08003432 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07003433 ENABLED_ACCESSIBILITY_SERVICES,
3434 TTS_USE_DEFAULTS,
3435 TTS_DEFAULT_RATE,
3436 TTS_DEFAULT_PITCH,
3437 TTS_DEFAULT_SYNTH,
3438 TTS_DEFAULT_LANG,
3439 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07003440 TTS_ENABLED_PLUGINS,
-b master501eec92009-07-06 13:53:11 -07003441 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
3442 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
3443 WIFI_NUM_ALLOWED_CHANNELS,
3444 WIFI_NUM_OPEN_NETWORKS_KEPT,
San Mehat87734d32010-01-08 12:53:06 -08003445 MOUNT_PLAY_NOTIFICATION_SND,
3446 MOUNT_UMS_AUTOSTART,
3447 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07003448 MOUNT_UMS_NOTIFY_ENABLED,
3449 UI_NIGHT_MODE
-b master501eec92009-07-06 13:53:11 -07003450 };
3451
3452 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003453 * Helper method for determining if a location provider is enabled.
3454 * @param cr the content resolver to use
3455 * @param provider the location provider to query
3456 * @return true if the provider is enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003457 */
3458 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
3459 String allowedProviders = Settings.Secure.getString(cr, LOCATION_PROVIDERS_ALLOWED);
3460 if (allowedProviders != null) {
3461 return (allowedProviders.equals(provider) ||
3462 allowedProviders.contains("," + provider + ",") ||
3463 allowedProviders.startsWith(provider + ",") ||
3464 allowedProviders.endsWith("," + provider));
3465 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003466 return false;
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003467 }
3468
3469 /**
3470 * Thread-safe method for enabling or disabling a single location provider.
3471 * @param cr the content resolver to use
3472 * @param provider the location provider to enable or disable
3473 * @param enabled true if the provider should be enabled
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07003474 */
3475 public static final void setLocationProviderEnabled(ContentResolver cr,
3476 String provider, boolean enabled) {
3477 // to ensure thread safety, we write the provider name with a '+' or '-'
3478 // and let the SettingsProvider handle it rather than reading and modifying
3479 // the list of enabled providers.
3480 if (enabled) {
3481 provider = "+" + provider;
3482 } else {
3483 provider = "-" + provider;
3484 }
3485 putString(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider);
3486 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003487 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003488
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003489 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003490 * User-defined bookmarks and shortcuts. The target of each bookmark is an
3491 * Intent URL, allowing it to be either a web page or a particular
3492 * application activity.
3493 *
3494 * @hide
3495 */
3496 public static final class Bookmarks implements BaseColumns
3497 {
3498 private static final String TAG = "Bookmarks";
3499
3500 /**
3501 * The content:// style URL for this table
3502 */
3503 public static final Uri CONTENT_URI =
3504 Uri.parse("content://" + AUTHORITY + "/bookmarks");
3505
3506 /**
3507 * The row ID.
3508 * <p>Type: INTEGER</p>
3509 */
3510 public static final String ID = "_id";
3511
3512 /**
3513 * Descriptive name of the bookmark that can be displayed to the user.
3514 * If this is empty, the title should be resolved at display time (use
3515 * {@link #getTitle(Context, Cursor)} any time you want to display the
3516 * title of a bookmark.)
3517 * <P>
3518 * Type: TEXT
3519 * </P>
3520 */
3521 public static final String TITLE = "title";
3522
3523 /**
3524 * Arbitrary string (displayed to the user) that allows bookmarks to be
3525 * organized into categories. There are some special names for
3526 * standard folders, which all start with '@'. The label displayed for
3527 * the folder changes with the locale (via {@link #getLabelForFolder}) but
3528 * the folder name does not change so you can consistently query for
3529 * the folder regardless of the current locale.
3530 *
3531 * <P>Type: TEXT</P>
3532 *
3533 */
3534 public static final String FOLDER = "folder";
3535
3536 /**
3537 * The Intent URL of the bookmark, describing what it points to. This
3538 * value is given to {@link android.content.Intent#getIntent} to create
3539 * an Intent that can be launched.
3540 * <P>Type: TEXT</P>
3541 */
3542 public static final String INTENT = "intent";
3543
3544 /**
3545 * Optional shortcut character associated with this bookmark.
3546 * <P>Type: INTEGER</P>
3547 */
3548 public static final String SHORTCUT = "shortcut";
3549
3550 /**
3551 * The order in which the bookmark should be displayed
3552 * <P>Type: INTEGER</P>
3553 */
3554 public static final String ORDERING = "ordering";
3555
3556 private static final String[] sIntentProjection = { INTENT };
3557 private static final String[] sShortcutProjection = { ID, SHORTCUT };
3558 private static final String sShortcutSelection = SHORTCUT + "=?";
3559
3560 /**
3561 * Convenience function to retrieve the bookmarked Intent for a
3562 * particular shortcut key.
3563 *
3564 * @param cr The ContentResolver to query.
3565 * @param shortcut The shortcut key.
3566 *
3567 * @return Intent The bookmarked URL, or null if there is no bookmark
3568 * matching the given shortcut.
3569 */
3570 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
3571 {
3572 Intent intent = null;
3573
3574 Cursor c = cr.query(CONTENT_URI,
3575 sIntentProjection, sShortcutSelection,
3576 new String[] { String.valueOf((int) shortcut) }, ORDERING);
3577 // Keep trying until we find a valid shortcut
3578 try {
3579 while (intent == null && c.moveToNext()) {
3580 try {
3581 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
3582 intent = Intent.getIntent(intentURI);
3583 } catch (java.net.URISyntaxException e) {
3584 // The stored URL is bad... ignore it.
3585 } catch (IllegalArgumentException e) {
3586 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07003587 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003588 }
3589 }
3590 } finally {
3591 if (c != null) c.close();
3592 }
3593
3594 return intent;
3595 }
3596
3597 /**
3598 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003599 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003600 * @param cr The ContentResolver to query.
3601 * @param intent The desired target of the bookmark.
3602 * @param title Bookmark title that is shown to the user; null if none
3603 * or it should be resolved to the intent's title.
3604 * @param folder Folder in which to place the bookmark; null if none.
3605 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
3606 * this is non-zero and there is an existing bookmark entry
3607 * with this same shortcut, then that existing shortcut is
3608 * cleared (the bookmark is not removed).
3609 * @return The unique content URL for the new bookmark entry.
3610 */
3611 public static Uri add(ContentResolver cr,
3612 Intent intent,
3613 String title,
3614 String folder,
3615 char shortcut,
3616 int ordering)
3617 {
3618 // If a shortcut is supplied, and it is already defined for
3619 // another bookmark, then remove the old definition.
3620 if (shortcut != 0) {
3621 Cursor c = cr.query(CONTENT_URI,
3622 sShortcutProjection, sShortcutSelection,
3623 new String[] { String.valueOf((int) shortcut) }, null);
3624 try {
3625 if (c.moveToFirst()) {
3626 while (c.getCount() > 0) {
3627 if (!c.deleteRow()) {
3628 Log.w(TAG, "Could not delete existing shortcut row");
3629 }
3630 }
3631 }
3632 } finally {
3633 if (c != null) c.close();
3634 }
3635 }
3636
3637 ContentValues values = new ContentValues();
3638 if (title != null) values.put(TITLE, title);
3639 if (folder != null) values.put(FOLDER, folder);
3640 values.put(INTENT, intent.toURI());
3641 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
3642 values.put(ORDERING, ordering);
3643 return cr.insert(CONTENT_URI, values);
3644 }
3645
3646 /**
3647 * Return the folder name as it should be displayed to the user. This
3648 * takes care of localizing special folders.
3649 *
3650 * @param r Resources object for current locale; only need access to
3651 * system resources.
3652 * @param folder The value found in the {@link #FOLDER} column.
3653 *
3654 * @return CharSequence The label for this folder that should be shown
3655 * to the user.
3656 */
3657 public static CharSequence getLabelForFolder(Resources r, String folder) {
3658 return folder;
3659 }
3660
3661 /**
3662 * Return the title as it should be displayed to the user. This takes
3663 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003664 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003665 * @param context A context.
3666 * @param cursor A cursor pointing to the row whose title should be
3667 * returned. The cursor must contain at least the {@link #TITLE}
3668 * and {@link #INTENT} columns.
3669 * @return A title that is localized and can be displayed to the user,
3670 * or the empty string if one could not be found.
3671 */
3672 public static CharSequence getTitle(Context context, Cursor cursor) {
3673 int titleColumn = cursor.getColumnIndex(TITLE);
3674 int intentColumn = cursor.getColumnIndex(INTENT);
3675 if (titleColumn == -1 || intentColumn == -1) {
3676 throw new IllegalArgumentException(
3677 "The cursor must contain the TITLE and INTENT columns.");
3678 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003679
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003680 String title = cursor.getString(titleColumn);
3681 if (!TextUtils.isEmpty(title)) {
3682 return title;
3683 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003684
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003685 String intentUri = cursor.getString(intentColumn);
3686 if (TextUtils.isEmpty(intentUri)) {
3687 return "";
3688 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003689
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003690 Intent intent;
3691 try {
3692 intent = Intent.getIntent(intentUri);
3693 } catch (URISyntaxException e) {
3694 return "";
3695 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003696
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003697 PackageManager packageManager = context.getPackageManager();
3698 ResolveInfo info = packageManager.resolveActivity(intent, 0);
3699 return info != null ? info.loadLabel(packageManager) : "";
3700 }
3701 }
3702
3703 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003704 * Returns the device ID that we should use when connecting to the mobile gtalk server.
3705 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
3706 * from the GoogleLoginService.
3707 *
3708 * @param androidId The Android ID for this device.
3709 * @return The device ID that should be used when connecting to the mobile gtalk server.
3710 * @hide
3711 */
3712 public static String getGTalkDeviceId(long androidId) {
3713 return "android-" + Long.toHexString(androidId);
3714 }
3715}