blob: 1a80818ff08f79b0419fe31e2f5a988cf93fb522 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.provider;
18
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080019import android.annotation.SdkConstant;
20import android.annotation.SdkConstant.SdkConstantType;
Narayan Kamathee69ff42011-06-28 12:07:18 +010021import android.app.SearchManager;
Jeff Sharkey6e2bee72012-10-01 13:39:08 -070022import android.app.WallpaperManager;
Mike LeBeau5d34e9b2010-02-10 19:34:56 -080023import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080024import android.content.ContentResolver;
25import android.content.ContentValues;
26import android.content.Context;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -080027import android.content.IContentProvider;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080028import android.content.Intent;
Dianne Hackbornb8b11a02010-03-10 15:53:11 -080029import android.content.pm.ActivityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030import android.content.pm.PackageManager;
31import android.content.pm.ResolveInfo;
32import android.content.res.Configuration;
33import android.content.res.Resources;
34import android.database.Cursor;
35import android.database.SQLException;
David Christie3f7b6522013-08-06 19:19:08 -070036import android.location.LocationManager;
Jeff Sharkey625239a2012-09-26 22:03:49 -070037import android.net.ConnectivityManager;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080038import android.net.Uri;
Irfan Sheriff36f74132010-11-04 16:57:37 -070039import android.net.wifi.WifiManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070040import android.os.BatteryManager;
41import android.os.Bundle;
Jeff Sharkey625239a2012-09-26 22:03:49 -070042import android.os.DropBoxManager;
Amith Yamasani52c489c2012-03-28 11:42:42 -070043import android.os.IBinder;
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -070044import android.os.Process;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070045import android.os.RemoteException;
Amith Yamasani52c489c2012-03-28 11:42:42 -070046import android.os.ServiceManager;
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -070047import android.os.SystemProperties;
Dianne Hackbornf02b60a2012-08-16 10:48:27 -070048import android.os.UserHandle;
Jeff Sharkey625239a2012-09-26 22:03:49 -070049import android.os.Build.VERSION_CODES;
Narayan Kamath6d632962011-08-24 11:51:37 +010050import android.speech.tts.TextToSpeech;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080051import android.text.TextUtils;
52import android.util.AndroidException;
53import android.util.Log;
54
Amith Yamasani52c489c2012-03-28 11:42:42 -070055import com.android.internal.widget.ILockSettings;
56
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080057import java.net.URISyntaxException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080058import java.util.HashMap;
59import java.util.HashSet;
Elliott Hughescb64d432013-08-02 10:00:44 -070060import java.util.Locale;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080061
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080062/**
63 * The Settings provider contains global system-level device preferences.
64 */
65public final class Settings {
66
67 // Intent actions for Settings
68
69 /**
70 * Activity Action: Show system settings.
71 * <p>
72 * Input: Nothing.
73 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070074 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080075 */
76 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
77 public static final String ACTION_SETTINGS = "android.settings.SETTINGS";
78
79 /**
80 * Activity Action: Show settings to allow configuration of APNs.
81 * <p>
82 * Input: Nothing.
83 * <p>
Gilles Debunnee90bed12011-08-30 14:28:27 -070084 * Output: Nothing.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080085 */
86 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
87 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS";
88
89 /**
90 * Activity Action: Show settings to allow configuration of current location
91 * sources.
92 * <p>
93 * In some cases, a matching Activity may not exist, so ensure you
94 * safeguard against this.
95 * <p>
96 * Input: Nothing.
97 * <p>
98 * Output: Nothing.
99 */
100 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
101 public static final String ACTION_LOCATION_SOURCE_SETTINGS =
102 "android.settings.LOCATION_SOURCE_SETTINGS";
103
104 /**
105 * Activity Action: Show settings to allow configuration of wireless controls
106 * such as Wi-Fi, Bluetooth and Mobile networks.
107 * <p>
108 * In some cases, a matching Activity may not exist, so ensure you
109 * safeguard against this.
110 * <p>
111 * Input: Nothing.
112 * <p>
113 * Output: Nothing.
114 */
115 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
116 public static final String ACTION_WIRELESS_SETTINGS =
117 "android.settings.WIRELESS_SETTINGS";
118
119 /**
120 * Activity Action: Show settings to allow entering/exiting airplane mode.
121 * <p>
122 * In some cases, a matching Activity may not exist, so ensure you
123 * safeguard against this.
124 * <p>
125 * Input: Nothing.
126 * <p>
127 * Output: Nothing.
128 */
129 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
130 public static final String ACTION_AIRPLANE_MODE_SETTINGS =
131 "android.settings.AIRPLANE_MODE_SETTINGS";
132
133 /**
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700134 * Activity Action: Show settings for accessibility modules.
135 * <p>
136 * In some cases, a matching Activity may not exist, so ensure you
137 * safeguard against this.
138 * <p>
139 * Input: Nothing.
140 * <p>
141 * Output: Nothing.
142 */
143 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
144 public static final String ACTION_ACCESSIBILITY_SETTINGS =
145 "android.settings.ACCESSIBILITY_SETTINGS";
146
147 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800148 * Activity Action: Show settings to allow configuration of security and
149 * location privacy.
150 * <p>
151 * In some cases, a matching Activity may not exist, so ensure you
152 * safeguard against this.
153 * <p>
154 * Input: Nothing.
155 * <p>
156 * Output: Nothing.
157 */
158 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
159 public static final String ACTION_SECURITY_SETTINGS =
160 "android.settings.SECURITY_SETTINGS";
161
162 /**
Amith Yamasanic15255a2009-09-23 15:33:19 -0700163 * Activity Action: Show settings to allow configuration of privacy options.
164 * <p>
165 * In some cases, a matching Activity may not exist, so ensure you
166 * safeguard against this.
167 * <p>
168 * Input: Nothing.
169 * <p>
170 * Output: Nothing.
171 */
172 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
173 public static final String ACTION_PRIVACY_SETTINGS =
174 "android.settings.PRIVACY_SETTINGS";
175
176 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800177 * Activity Action: Show settings to allow configuration of Wi-Fi.
178
179 * <p>
180 * In some cases, a matching Activity may not exist, so ensure you
181 * safeguard against this.
182 * <p>
183 * Input: Nothing.
184 * <p>
185 * Output: Nothing.
186
187 */
188 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
189 public static final String ACTION_WIFI_SETTINGS =
190 "android.settings.WIFI_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700191
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800192 /**
193 * Activity Action: Show settings to allow configuration of a static IP
194 * address for Wi-Fi.
195 * <p>
196 * In some cases, a matching Activity may not exist, so ensure you safeguard
197 * against this.
198 * <p>
199 * Input: Nothing.
200 * <p>
201 * Output: Nothing.
202 */
203 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
204 public static final String ACTION_WIFI_IP_SETTINGS =
205 "android.settings.WIFI_IP_SETTINGS";
206
207 /**
208 * Activity Action: Show settings to allow configuration of Bluetooth.
209 * <p>
210 * In some cases, a matching Activity may not exist, so ensure you
211 * safeguard against this.
212 * <p>
213 * Input: Nothing.
214 * <p>
215 * Output: Nothing.
216 */
217 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
218 public static final String ACTION_BLUETOOTH_SETTINGS =
219 "android.settings.BLUETOOTH_SETTINGS";
220
221 /**
Jeff Brown89d55462012-09-19 11:33:42 -0700222 * Activity Action: Show settings to allow configuration of Wifi Displays.
223 * <p>
224 * In some cases, a matching Activity may not exist, so ensure you
225 * safeguard against this.
226 * <p>
227 * Input: Nothing.
228 * <p>
229 * Output: Nothing.
230 * @hide
231 */
232 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
233 public static final String ACTION_WIFI_DISPLAY_SETTINGS =
234 "android.settings.WIFI_DISPLAY_SETTINGS";
235
236 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800237 * Activity Action: Show settings to allow configuration of date and time.
238 * <p>
239 * In some cases, a matching Activity may not exist, so ensure you
240 * safeguard against this.
241 * <p>
242 * Input: Nothing.
243 * <p>
244 * Output: Nothing.
245 */
246 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
247 public static final String ACTION_DATE_SETTINGS =
248 "android.settings.DATE_SETTINGS";
249
250 /**
251 * Activity Action: Show settings to allow configuration of sound and volume.
252 * <p>
253 * In some cases, a matching Activity may not exist, so ensure you
254 * safeguard against this.
255 * <p>
256 * Input: Nothing.
257 * <p>
258 * Output: Nothing.
259 */
260 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
261 public static final String ACTION_SOUND_SETTINGS =
262 "android.settings.SOUND_SETTINGS";
263
264 /**
265 * Activity Action: Show settings to allow configuration of display.
266 * <p>
267 * In some cases, a matching Activity may not exist, so ensure you
268 * safeguard against this.
269 * <p>
270 * Input: Nothing.
271 * <p>
272 * Output: Nothing.
273 */
274 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
275 public static final String ACTION_DISPLAY_SETTINGS =
276 "android.settings.DISPLAY_SETTINGS";
277
278 /**
279 * Activity Action: Show settings to allow configuration of locale.
280 * <p>
281 * In some cases, a matching Activity may not exist, so ensure you
282 * safeguard against this.
283 * <p>
284 * Input: Nothing.
285 * <p>
286 * Output: Nothing.
287 */
288 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
289 public static final String ACTION_LOCALE_SETTINGS =
290 "android.settings.LOCALE_SETTINGS";
291
292 /**
293 * Activity Action: Show settings to configure input methods, in particular
294 * allowing the user to enable input methods.
295 * <p>
296 * In some cases, a matching Activity may not exist, so ensure you
297 * safeguard against this.
298 * <p>
299 * Input: Nothing.
300 * <p>
301 * Output: Nothing.
302 */
303 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
304 public static final String ACTION_INPUT_METHOD_SETTINGS =
305 "android.settings.INPUT_METHOD_SETTINGS";
306
307 /**
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900308 * Activity Action: Show settings to enable/disable input method subtypes.
satok86417ea2010-10-27 14:11:03 +0900309 * <p>
310 * In some cases, a matching Activity may not exist, so ensure you
311 * safeguard against this.
312 * <p>
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900313 * To tell which input method's subtypes are displayed in the settings, add
314 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
315 * If there is no extra in this Intent, subtypes from all installed input methods
316 * will be displayed in the settings.
317 *
318 * @see android.view.inputmethod.InputMethodInfo#getId
319 * <p>
satok86417ea2010-10-27 14:11:03 +0900320 * Input: Nothing.
321 * <p>
322 * Output: Nothing.
323 */
324 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
Tadashi G. Takaokaf49688f2011-01-20 17:56:13 +0900325 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
326 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
satok86417ea2010-10-27 14:11:03 +0900327
328 /**
satok7cfc0ed2011-06-20 21:29:36 +0900329 * Activity Action: Show a dialog to select input method.
330 * <p>
331 * In some cases, a matching Activity may not exist, so ensure you
332 * safeguard against this.
333 * <p>
334 * Input: Nothing.
335 * <p>
336 * Output: Nothing.
337 * @hide
338 */
339 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
340 public static final String ACTION_SHOW_INPUT_METHOD_PICKER =
341 "android.settings.SHOW_INPUT_METHOD_PICKER";
342
343 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800344 * Activity Action: Show settings to manage the user input dictionary.
345 * <p>
Chet Haasee8222dd2013-09-05 07:44:18 -0700346 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT},
Satoshi Kataoka2aa2bc52013-07-30 14:25:11 +0900347 * it is guaranteed there will always be an appropriate implementation for this Intent action.
348 * In prior releases of the platform this was optional, so ensure you safeguard against it.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800349 * <p>
350 * Input: Nothing.
351 * <p>
352 * Output: Nothing.
353 */
354 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
355 public static final String ACTION_USER_DICTIONARY_SETTINGS =
356 "android.settings.USER_DICTIONARY_SETTINGS";
357
358 /**
Gilles Debunnee90bed12011-08-30 14:28:27 -0700359 * Activity Action: Adds a word to the user dictionary.
360 * <p>
361 * In some cases, a matching Activity may not exist, so ensure you
362 * safeguard against this.
363 * <p>
364 * Input: An extra with key <code>word</code> that contains the word
365 * that should be added to the dictionary.
366 * <p>
367 * Output: Nothing.
368 *
369 * @hide
370 */
371 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
372 public static final String ACTION_USER_DICTIONARY_INSERT =
373 "com.android.settings.USER_DICTIONARY_INSERT";
374
375 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800376 * Activity Action: Show settings to allow configuration of application-related settings.
377 * <p>
378 * In some cases, a matching Activity may not exist, so ensure you
379 * safeguard against this.
380 * <p>
381 * Input: Nothing.
382 * <p>
383 * Output: Nothing.
384 */
385 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
386 public static final String ACTION_APPLICATION_SETTINGS =
387 "android.settings.APPLICATION_SETTINGS";
388
389 /**
390 * Activity Action: Show settings to allow configuration of application
Dianne Hackborn8d866e52012-10-10 18:39:45 -0700391 * development-related settings. As of
392 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is
393 * a required part of the platform.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800394 * <p>
395 * Input: Nothing.
396 * <p>
397 * Output: Nothing.
398 */
399 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
400 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
401 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS";
402
403 /**
404 * Activity Action: Show settings to allow configuration of quick launch shortcuts.
405 * <p>
406 * In some cases, a matching Activity may not exist, so ensure you
407 * safeguard against this.
408 * <p>
409 * Input: Nothing.
410 * <p>
411 * Output: Nothing.
412 */
413 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
414 public static final String ACTION_QUICK_LAUNCH_SETTINGS =
415 "android.settings.QUICK_LAUNCH_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700416
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800417 /**
418 * Activity Action: Show settings to manage installed applications.
419 * <p>
420 * In some cases, a matching Activity may not exist, so ensure you
421 * safeguard against this.
422 * <p>
423 * Input: Nothing.
424 * <p>
425 * Output: Nothing.
426 */
427 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
428 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS =
429 "android.settings.MANAGE_APPLICATIONS_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700430
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800431 /**
Winson Chung44e8ff92010-09-27 14:36:52 -0700432 * Activity Action: Show settings to manage all applications.
433 * <p>
434 * In some cases, a matching Activity may not exist, so ensure you
435 * safeguard against this.
436 * <p>
437 * Input: Nothing.
438 * <p>
439 * Output: Nothing.
440 */
441 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
442 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
443 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS";
444
445 /**
Dianne Hackbornb7bb3b32010-06-06 22:47:50 -0700446 * Activity Action: Show screen of details about a particular application.
447 * <p>
448 * In some cases, a matching Activity may not exist, so ensure you
449 * safeguard against this.
450 * <p>
451 * Input: The Intent's data URI specifies the application package name
452 * to be shown, with the "package" scheme. That is "package:com.my.app".
453 * <p>
454 * Output: Nothing.
455 */
456 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
457 public static final String ACTION_APPLICATION_DETAILS_SETTINGS =
458 "android.settings.APPLICATION_DETAILS_SETTINGS";
459
460 /**
Dianne Hackborn35654b62013-01-14 17:38:02 -0800461 * @hide
462 * Activity Action: Show the "app ops" settings screen.
463 * <p>
464 * Input: Nothing.
465 * <p>
466 * Output: Nothing.
467 */
468 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
469 public static final String ACTION_APP_OPS_SETTINGS =
470 "android.settings.APP_OPS_SETTINGS";
471
472 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800473 * Activity Action: Show settings for system update functionality.
474 * <p>
475 * In some cases, a matching Activity may not exist, so ensure you
476 * safeguard against this.
477 * <p>
478 * Input: Nothing.
479 * <p>
480 * Output: Nothing.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700481 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800482 * @hide
483 */
484 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
485 public static final String ACTION_SYSTEM_UPDATE_SETTINGS =
486 "android.settings.SYSTEM_UPDATE_SETTINGS";
487
488 /**
489 * Activity Action: Show settings to allow configuration of sync settings.
490 * <p>
491 * In some cases, a matching Activity may not exist, so ensure you
492 * safeguard against this.
493 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800494 * The account types available to add via the add account button may be restricted by adding an
495 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's
496 * authorities. Only account types which can sync with that content provider will be offered to
497 * the user.
498 * <p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800499 * Input: Nothing.
500 * <p>
501 * Output: Nothing.
502 */
503 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
504 public static final String ACTION_SYNC_SETTINGS =
505 "android.settings.SYNC_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700506
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800507 /**
Erikeebc8e22010-02-18 13:27:19 -0800508 * Activity Action: Show add account screen for creating a new account.
509 * <p>
510 * In some cases, a matching Activity may not exist, so ensure you
511 * safeguard against this.
512 * <p>
513 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES}
514 * extra to the Intent with one or more syncable content provider's authorities. Only account
515 * types which can sync with that content provider will be offered to the user.
516 * <p>
Alon Albert50359c22013-02-26 14:47:48 -0800517 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the
518 * Intent with one or more account types.
519 * <p>
Erikeebc8e22010-02-18 13:27:19 -0800520 * Input: Nothing.
521 * <p>
522 * Output: Nothing.
523 */
524 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
525 public static final String ACTION_ADD_ACCOUNT =
526 "android.settings.ADD_ACCOUNT_SETTINGS";
527
528 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800529 * Activity Action: Show settings for selecting the network operator.
530 * <p>
531 * In some cases, a matching Activity may not exist, so ensure you
532 * safeguard against this.
533 * <p>
534 * Input: Nothing.
535 * <p>
536 * Output: Nothing.
537 */
538 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
539 public static final String ACTION_NETWORK_OPERATOR_SETTINGS =
540 "android.settings.NETWORK_OPERATOR_SETTINGS";
541
542 /**
543 * Activity Action: Show settings for selection of 2G/3G.
544 * <p>
545 * In some cases, a matching Activity may not exist, so ensure you
546 * safeguard against this.
547 * <p>
548 * Input: Nothing.
549 * <p>
550 * Output: Nothing.
551 */
552 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
553 public static final String ACTION_DATA_ROAMING_SETTINGS =
554 "android.settings.DATA_ROAMING_SETTINGS";
555
556 /**
557 * Activity Action: Show settings for internal storage.
558 * <p>
559 * In some cases, a matching Activity may not exist, so ensure you
560 * safeguard against this.
561 * <p>
562 * Input: Nothing.
563 * <p>
564 * Output: Nothing.
565 */
566 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
567 public static final String ACTION_INTERNAL_STORAGE_SETTINGS =
568 "android.settings.INTERNAL_STORAGE_SETTINGS";
569 /**
570 * Activity Action: Show settings for memory card storage.
571 * <p>
572 * In some cases, a matching Activity may not exist, so ensure you
573 * safeguard against this.
574 * <p>
575 * Input: Nothing.
576 * <p>
577 * Output: Nothing.
578 */
579 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
580 public static final String ACTION_MEMORY_CARD_SETTINGS =
581 "android.settings.MEMORY_CARD_SETTINGS";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700582
Justin Mattsonef340352010-01-13 21:05:46 -0800583 /**
584 * Activity Action: Show settings for global search.
585 * <p>
586 * In some cases, a matching Activity may not exist, so ensure you
587 * safeguard against this.
588 * <p>
589 * Input: Nothing.
590 * <p>
591 * Output: Nothing
592 */
593 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
594 public static final String ACTION_SEARCH_SETTINGS =
595 "android.search.action.SEARCH_SETTINGS";
596
Daniel Sandler9d8b8762010-01-22 20:50:15 -0500597 /**
598 * Activity Action: Show general device information settings (serial
599 * number, software version, phone number, etc.).
600 * <p>
601 * In some cases, a matching Activity may not exist, so ensure you
602 * safeguard against this.
603 * <p>
604 * Input: Nothing.
605 * <p>
606 * Output: Nothing
607 */
608 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
609 public static final String ACTION_DEVICE_INFO_SETTINGS =
610 "android.settings.DEVICE_INFO_SETTINGS";
611
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500612 /**
Nick Pellycccf01d2011-10-31 14:49:40 -0700613 * Activity Action: Show NFC settings.
614 * <p>
615 * This shows UI that allows NFC to be turned on or off.
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500616 * <p>
617 * In some cases, a matching Activity may not exist, so ensure you
618 * safeguard against this.
619 * <p>
620 * Input: Nothing.
621 * <p>
622 * Output: Nothing
Nick Pellycccf01d2011-10-31 14:49:40 -0700623 * @see android.nfc.NfcAdapter#isEnabled()
624 */
625 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
626 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS";
627
628 /**
629 * Activity Action: Show NFC Sharing settings.
630 * <p>
631 * This shows UI that allows NDEF Push (Android Beam) to be turned on or
632 * off.
633 * <p>
634 * In some cases, a matching Activity may not exist, so ensure you
635 * safeguard against this.
636 * <p>
637 * Input: Nothing.
638 * <p>
639 * Output: Nothing
640 * @see android.nfc.NfcAdapter#isNdefPushEnabled()
Martijn Coenen9b3c83f2011-07-28 11:21:39 -0500641 */
642 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
643 public static final String ACTION_NFCSHARING_SETTINGS =
644 "android.settings.NFCSHARING_SETTINGS";
645
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500646 /**
Martijn Coenen62c196a2013-08-09 13:43:34 -0700647 * Activity Action: Show NFC Tap & Pay settings
648 * <p>
649 * This shows UI that allows the user to configure Tap&Pay
650 * settings.
651 * <p>
652 * In some cases, a matching Activity may not exist, so ensure you
653 * safeguard against this.
654 * <p>
655 * Input: Nothing.
656 * <p>
657 * Output: Nothing
658 */
659 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
660 public static final String ACTION_NFC_PAYMENT_SETTINGS =
661 "android.settings.NFC_PAYMENT_SETTINGS";
662
663 /**
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500664 * Activity Action: Show Daydream settings.
665 * <p>
666 * In some cases, a matching Activity may not exist, so ensure you
667 * safeguard against this.
668 * <p>
669 * Input: Nothing.
670 * <p>
671 * Output: Nothing.
672 * @see android.service.dreams.DreamService
Daniel Sandlerc08cd022012-11-27 22:47:37 -0500673 */
674 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
675 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS";
676
Daniel Sandler5feceeb2013-03-22 18:29:23 -0700677 /**
678 * Activity Action: Show Notification listener settings.
679 * <p>
680 * In some cases, a matching Activity may not exist, so ensure you
681 * safeguard against this.
682 * <p>
683 * Input: Nothing.
684 * <p>
685 * Output: Nothing.
686 * @see android.service.notification.NotificationListenerService
687 * @hide
688 */
689 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
690 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS
691 = "android.settings.NOTIFICATION_LISTENER_SETTINGS";
692
Alan Viverette69ce69b2013-08-29 12:23:48 -0700693 /**
694 * Activity Action: Show settings for video captioning.
695 * <p>
696 * In some cases, a matching Activity may not exist, so ensure you safeguard
697 * against this.
698 * <p>
699 * Input: Nothing.
700 * <p>
701 * Output: Nothing.
702 */
703 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
704 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS";
705
Svetoslav773f54d2013-09-03 14:01:43 -0700706 /**
707 * Activity Action: Show the top level print settings.
708 * <p>
709 * In some cases, a matching Activity may not exist, so ensure you
710 * safeguard against this.
711 * <p>
712 * Input: Nothing.
713 * <p>
714 * Output: Nothing.
715 */
716 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
717 public static final String ACTION_PRINT_SETTINGS =
718 "android.settings.ACTION_PRINT_SETTINGS";
719
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800720 // End of Intent actions for Settings
721
Erikeebc8e22010-02-18 13:27:19 -0800722 /**
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800723 * @hide - Private call() method on SettingsProvider to read from 'system' table.
724 */
725 public static final String CALL_METHOD_GET_SYSTEM = "GET_system";
726
727 /**
728 * @hide - Private call() method on SettingsProvider to read from 'secure' table.
729 */
730 public static final String CALL_METHOD_GET_SECURE = "GET_secure";
731
732 /**
Christopher Tate06efb532012-08-24 15:29:27 -0700733 * @hide - Private call() method on SettingsProvider to read from 'global' table.
734 */
735 public static final String CALL_METHOD_GET_GLOBAL = "GET_global";
736
737 /**
738 * @hide - User handle argument extra to the fast-path call()-based requests
739 */
740 public static final String CALL_METHOD_USER_KEY = "_user";
741
742 /** @hide - Private call() method to write to 'system' table */
743 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system";
744
745 /** @hide - Private call() method to write to 'secure' table */
746 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure";
747
748 /** @hide - Private call() method to write to 'global' table */
749 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global";
750
751 /**
Erikeebc8e22010-02-18 13:27:19 -0800752 * Activity Extra: Limit available options in launched activity based on the given authority.
753 * <p>
754 * This can be passed as an extra field in an Activity Intent with one or more syncable content
755 * provider's authorities as a String[]. This field is used by some intents to alter the
756 * behavior of the called activity.
757 * <p>
758 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based
759 * on the authority given.
760 */
Alon Albert50359c22013-02-26 14:47:48 -0800761 public static final String EXTRA_AUTHORITIES = "authorities";
762
Alon Albertd35bf1f2013-04-18 14:26:51 -0700763 /**
764 * Activity Extra: Limit available options in launched activity based on the given account
765 * types.
766 * <p>
767 * This can be passed as an extra field in an Activity Intent with one or more account types
768 * as a String[]. This field is used by some intents to alter the behavior of the called
769 * activity.
770 * <p>
771 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified
772 * list.
773 */
Alon Albert50359c22013-02-26 14:47:48 -0800774 public static final String EXTRA_ACCOUNT_TYPES = "account_types";
Erikeebc8e22010-02-18 13:27:19 -0800775
Tadashi G. Takaoka25480202011-01-20 23:13:02 +0900776 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
777
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800778 private static final String JID_RESOURCE_PREFIX = "android";
779
780 public static final String AUTHORITY = "settings";
781
782 private static final String TAG = "Settings";
Christopher Tate06efb532012-08-24 15:29:27 -0700783 private static final boolean LOCAL_LOGV = false;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800784
David Christie3f7b6522013-08-06 19:19:08 -0700785 // Lock ensures that when enabling/disabling the master location switch, we don't end up
786 // with a partial enable/disable state in multi-threaded situations.
787 private static final Object mLocationSettingsLock = new Object();
788
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800789 public static class SettingNotFoundException extends AndroidException {
790 public SettingNotFoundException(String msg) {
791 super(msg);
792 }
793 }
794
795 /**
796 * Common base for tables of name/value settings.
797 */
798 public static class NameValueTable implements BaseColumns {
799 public static final String NAME = "name";
800 public static final String VALUE = "value";
801
802 protected static boolean putString(ContentResolver resolver, Uri uri,
803 String name, String value) {
804 // The database will take care of replacing duplicates.
805 try {
806 ContentValues values = new ContentValues();
807 values.put(NAME, name);
808 values.put(VALUE, value);
809 resolver.insert(uri, values);
810 return true;
811 } catch (SQLException e) {
Dianne Hackborna33e3f72009-09-29 17:28:24 -0700812 Log.w(TAG, "Can't set key " + name + " in " + uri, e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800813 return false;
814 }
815 }
816
817 public static Uri getUriFor(Uri uri, String name) {
818 return Uri.withAppendedPath(uri, name);
819 }
820 }
821
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800822 // Thread-safe.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800823 private static class NameValueCache {
824 private final String mVersionSystemProperty;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800825 private final Uri mUri;
826
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800827 private static final String[] SELECT_VALUE =
828 new String[] { Settings.NameValueTable.VALUE };
829 private static final String NAME_EQ_PLACEHOLDER = "name=?";
830
831 // Must synchronize on 'this' to access mValues and mValuesVersion.
Dan Egnor799f7212009-11-24 16:24:44 -0800832 private final HashMap<String, String> mValues = new HashMap<String, String>();
833 private long mValuesVersion = 0;
834
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800835 // Initially null; set lazily and held forever. Synchronized on 'this'.
836 private IContentProvider mContentProvider = null;
837
838 // The method we'll call (or null, to not use) on the provider
839 // for the fast path of retrieving settings.
Christopher Tate06efb532012-08-24 15:29:27 -0700840 private final String mCallGetCommand;
841 private final String mCallSetCommand;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800842
Christopher Tate06efb532012-08-24 15:29:27 -0700843 public NameValueCache(String versionSystemProperty, Uri uri,
844 String getCommand, String setCommand) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800845 mVersionSystemProperty = versionSystemProperty;
846 mUri = uri;
Christopher Tate06efb532012-08-24 15:29:27 -0700847 mCallGetCommand = getCommand;
848 mCallSetCommand = setCommand;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800849 }
850
Christopher Tate06efb532012-08-24 15:29:27 -0700851 private IContentProvider lazyGetProvider(ContentResolver cr) {
852 IContentProvider cp = null;
853 synchronized (this) {
854 cp = mContentProvider;
855 if (cp == null) {
856 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority());
857 }
858 }
859 return cp;
860 }
861
862 public boolean putStringForUser(ContentResolver cr, String name, String value,
863 final int userHandle) {
864 try {
865 Bundle arg = new Bundle();
866 arg.putString(Settings.NameValueTable.VALUE, value);
Christopher Tated5fe1472012-09-10 15:48:38 -0700867 arg.putInt(CALL_METHOD_USER_KEY, userHandle);
Christopher Tate06efb532012-08-24 15:29:27 -0700868 IContentProvider cp = lazyGetProvider(cr);
Dianne Hackborn35654b62013-01-14 17:38:02 -0800869 cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
Christopher Tate06efb532012-08-24 15:29:27 -0700870 } catch (RemoteException e) {
871 Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
872 return false;
873 }
874 return true;
875 }
876
Christopher Tate06efb532012-08-24 15:29:27 -0700877 public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
Christopher Tate78d2a662012-09-13 16:19:44 -0700878 final boolean isSelf = (userHandle == UserHandle.myUserId());
879 if (isSelf) {
880 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
Dan Egnor799f7212009-11-24 16:24:44 -0800881
Christopher Tate78d2a662012-09-13 16:19:44 -0700882 // Our own user's settings data uses a client-side cache
883 synchronized (this) {
884 if (mValuesVersion != newValuesVersion) {
885 if (LOCAL_LOGV || false) {
886 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current "
887 + newValuesVersion + " != cached " + mValuesVersion);
888 }
889
890 mValues.clear();
891 mValuesVersion = newValuesVersion;
Dan Egnor799f7212009-11-24 16:24:44 -0800892 }
893
Christopher Tate78d2a662012-09-13 16:19:44 -0700894 if (mValues.containsKey(name)) {
895 return mValues.get(name); // Could be null, that's OK -- negative caching
896 }
Dan Egnor799f7212009-11-24 16:24:44 -0800897 }
Christopher Tate78d2a662012-09-13 16:19:44 -0700898 } else {
899 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle
900 + " by user " + UserHandle.myUserId() + " so skipping cache");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800901 }
Dan Egnor799f7212009-11-24 16:24:44 -0800902
Christopher Tate06efb532012-08-24 15:29:27 -0700903 IContentProvider cp = lazyGetProvider(cr);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800904
905 // Try the fast path first, not using query(). If this
906 // fails (alternate Settings provider that doesn't support
907 // this interface?) then we fall back to the query/table
908 // interface.
Christopher Tate06efb532012-08-24 15:29:27 -0700909 if (mCallGetCommand != null) {
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800910 try {
Christopher Tate06efb532012-08-24 15:29:27 -0700911 Bundle args = null;
Christopher Tate5e08af02012-09-21 17:17:22 -0700912 if (!isSelf) {
Christopher Tate06efb532012-08-24 15:29:27 -0700913 args = new Bundle();
914 args.putInt(CALL_METHOD_USER_KEY, userHandle);
915 }
Dianne Hackborn35654b62013-01-14 17:38:02 -0800916 Bundle b = cp.call(cr.getPackageName(), mCallGetCommand, name, args);
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800917 if (b != null) {
918 String value = b.getPairValue();
Christopher Tate78d2a662012-09-13 16:19:44 -0700919 // Don't update our cache for reads of other users' data
920 if (isSelf) {
921 synchronized (this) {
922 mValues.put(name, value);
923 }
924 } else {
925 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
926 + " by " + UserHandle.myUserId()
927 + " so not updating cache");
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800928 }
929 return value;
930 }
931 // If the response Bundle is null, we fall through
932 // to the query interface below.
933 } catch (RemoteException e) {
934 // Not supported by the remote side? Fall through
935 // to query().
936 }
937 }
938
Dan Egnor799f7212009-11-24 16:24:44 -0800939 Cursor c = null;
940 try {
Dianne Hackborn35654b62013-01-14 17:38:02 -0800941 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER,
Jeff Brown75ea64f2012-01-25 19:37:13 -0800942 new String[]{name}, null, null);
Dan Egnor799f7212009-11-24 16:24:44 -0800943 if (c == null) {
944 Log.w(TAG, "Can't get key " + name + " from " + mUri);
945 return null;
946 }
947
948 String value = c.moveToNext() ? c.getString(0) : null;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800949 synchronized (this) {
Dan Egnor799f7212009-11-24 16:24:44 -0800950 mValues.put(name, value);
951 }
952 if (LOCAL_LOGV) {
953 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " +
954 name + " = " + (value == null ? "(null)" : value));
955 }
956 return value;
Brad Fitzpatrick1877d012010-03-04 17:48:13 -0800957 } catch (RemoteException e) {
Dan Egnor799f7212009-11-24 16:24:44 -0800958 Log.w(TAG, "Can't get key " + name + " from " + mUri, e);
959 return null; // Return null, but don't cache it.
960 } finally {
961 if (c != null) c.close();
962 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800963 }
964 }
965
966 /**
967 * System settings, containing miscellaneous system preferences. This
968 * table holds simple name/value pairs. There are convenience
969 * functions for accessing individual settings entries.
970 */
971 public static final class System extends NameValueTable {
972 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version";
973
Dianne Hackborn139748f2012-09-24 11:36:57 -0700974 /**
975 * The content:// style URL for this table
976 */
977 public static final Uri CONTENT_URI =
978 Uri.parse("content://" + AUTHORITY + "/system");
979
980 private static final NameValueCache sNameValueCache = new NameValueCache(
981 SYS_PROP_SETTING_VERSION,
982 CONTENT_URI,
983 CALL_METHOD_GET_SYSTEM,
984 CALL_METHOD_PUT_SYSTEM);
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -0700985
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800986 private static final HashSet<String> MOVED_TO_SECURE;
987 static {
988 MOVED_TO_SECURE = new HashSet<String>(30);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800989 MOVED_TO_SECURE.add(Secure.ANDROID_ID);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800990 MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800991 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
Danielle Millett925a7d82012-03-19 18:02:20 -0400992 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
Amith Yamasani156c4352010-03-05 17:10:03 -0800993 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
994 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
995 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800996 MOVED_TO_SECURE.add(Secure.LOGGING_ID);
997 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED);
998 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE);
999 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL);
1000 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001001 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL);
1002 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
1003 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
1004 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT);
1005 MOVED_TO_SECURE.add(Secure.WIFI_ON);
1006 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE);
1007 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT);
1008 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS);
1009 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED);
1010 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS);
1011 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT);
1012 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS);
1013 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON);
1014 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
1015 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
1016 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
1017 }
1018
Christopher Tate06efb532012-08-24 15:29:27 -07001019 private static final HashSet<String> MOVED_TO_GLOBAL;
Christopher Tate66488d62012-10-02 11:58:01 -07001020 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
Christopher Tate06efb532012-08-24 15:29:27 -07001021 static {
1022 MOVED_TO_GLOBAL = new HashSet<String>();
Christopher Tate66488d62012-10-02 11:58:01 -07001023 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
1024
Christopher Tate92198742012-09-07 12:00:13 -07001025 // these were originally in system but migrated to secure in the past,
1026 // so are duplicated in the Secure.* namespace
Christopher Tate66488d62012-10-02 11:58:01 -07001027 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
1028 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
1029 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
1030 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
1031 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.INSTALL_NON_MARKET_APPS);
1032 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
1033 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
Christopher Tate06efb532012-08-24 15:29:27 -07001034
Christopher Tate92198742012-09-07 12:00:13 -07001035 // these are moving directly from system to global
Christopher Tate06efb532012-08-24 15:29:27 -07001036 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
1037 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS);
1038 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
1039 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME);
1040 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE);
1041 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND);
1042 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND);
1043 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND);
1044 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND);
1045 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED);
1046 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND);
1047 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND);
1048 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND);
1049 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED);
1050 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
1051 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001052 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001053 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
1054 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
1055 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
1056 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
1057 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
1058 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
1059 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
1060 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
1061 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
1062 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
1063 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
Geremy Condraa0735112013-03-26 21:49:26 -07001064 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL);
1065 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL);
1066 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL);
1067 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL);
1068 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL);
1069 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL);
1070 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL);
1071 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL);
Christopher Tate06efb532012-08-24 15:29:27 -07001072 }
1073
Christopher Tate66488d62012-10-02 11:58:01 -07001074 /** @hide */
1075 public static void getMovedKeys(HashSet<String> outKeySet) {
1076 outKeySet.addAll(MOVED_TO_GLOBAL);
1077 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
1078 }
1079
1080 /** @hide */
1081 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
1082 outKeySet.addAll(MOVED_TO_GLOBAL);
1083 }
1084
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001085 /**
1086 * Look up a name in the database.
1087 * @param resolver to access the database with
1088 * @param name to look up in the table
1089 * @return the corresponding value, or null if not present
1090 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001091 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07001092 return getStringForUser(resolver, name, UserHandle.myUserId());
1093 }
1094
1095 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07001096 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07001097 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001098 if (MOVED_TO_SECURE.contains(name)) {
1099 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1100 + " to android.provider.Settings.Secure, returning read-only value.");
Christopher Tate06efb532012-08-24 15:29:27 -07001101 return Secure.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001102 }
Christopher Tate66488d62012-10-02 11:58:01 -07001103 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001104 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1105 + " to android.provider.Settings.Global, returning read-only value.");
1106 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001107 }
Christopher Tate06efb532012-08-24 15:29:27 -07001108 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001109 }
1110
1111 /**
1112 * Store a name/value pair into the database.
1113 * @param resolver to access the database with
1114 * @param name to store
1115 * @param value to associate with the name
1116 * @return true if the value was set, false on database errors
1117 */
1118 public static boolean putString(ContentResolver resolver, String name, String value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001119 return putStringForUser(resolver, name, value, UserHandle.myUserId());
1120 }
1121
1122 /** @hide */
1123 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
1124 int userHandle) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001125 if (MOVED_TO_SECURE.contains(name)) {
1126 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1127 + " to android.provider.Settings.Secure, value is unchanged.");
1128 return false;
1129 }
Christopher Tate66488d62012-10-02 11:58:01 -07001130 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001131 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1132 + " to android.provider.Settings.Global, value is unchanged.");
1133 return false;
1134 }
Christopher Tate06efb532012-08-24 15:29:27 -07001135 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001136 }
1137
1138 /**
1139 * Construct the content URI for a particular name/value pair,
1140 * useful for monitoring changes with a ContentObserver.
1141 * @param name to look up in the table
1142 * @return the corresponding content URI, or null if not present
1143 */
1144 public static Uri getUriFor(String name) {
1145 if (MOVED_TO_SECURE.contains(name)) {
1146 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1147 + " to android.provider.Settings.Secure, returning Secure URI.");
1148 return Secure.getUriFor(Secure.CONTENT_URI, name);
1149 }
Christopher Tate66488d62012-10-02 11:58:01 -07001150 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Christopher Tate06efb532012-08-24 15:29:27 -07001151 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
1152 + " to android.provider.Settings.Global, returning read-only global URI.");
1153 return Global.getUriFor(Global.CONTENT_URI, name);
1154 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001155 return getUriFor(CONTENT_URI, name);
1156 }
1157
1158 /**
1159 * Convenience function for retrieving a single system settings value
1160 * as an integer. Note that internally setting values are always
1161 * stored as strings; this function converts the string to an integer
1162 * for you. The default value will be returned if the setting is
1163 * not defined or not an integer.
1164 *
1165 * @param cr The ContentResolver to access.
1166 * @param name The name of the setting to retrieve.
1167 * @param def Value to return if the setting is not defined.
1168 *
1169 * @return The setting's current value, or 'def' if it is not defined
1170 * or not a valid integer.
1171 */
1172 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001173 return getIntForUser(cr, name, def, UserHandle.myUserId());
1174 }
1175
1176 /** @hide */
1177 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
1178 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001179 try {
1180 return v != null ? Integer.parseInt(v) : def;
1181 } catch (NumberFormatException e) {
1182 return def;
1183 }
1184 }
1185
1186 /**
1187 * Convenience function for retrieving a single system settings value
1188 * as an integer. Note that internally setting values are always
1189 * stored as strings; this function converts the string to an integer
1190 * for you.
1191 * <p>
1192 * This version does not take a default value. If the setting has not
1193 * been set, or the string value is not a number,
1194 * it throws {@link SettingNotFoundException}.
1195 *
1196 * @param cr The ContentResolver to access.
1197 * @param name The name of the setting to retrieve.
1198 *
1199 * @throws SettingNotFoundException Thrown if a setting by the given
1200 * name can't be found or the setting value is not an integer.
1201 *
1202 * @return The setting's current value.
1203 */
1204 public static int getInt(ContentResolver cr, String name)
1205 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001206 return getIntForUser(cr, name, UserHandle.myUserId());
1207 }
1208
1209 /** @hide */
1210 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
1211 throws SettingNotFoundException {
1212 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001213 try {
1214 return Integer.parseInt(v);
1215 } catch (NumberFormatException e) {
1216 throw new SettingNotFoundException(name);
1217 }
1218 }
1219
1220 /**
1221 * Convenience function for updating a single settings value as an
1222 * integer. This will either create a new entry in the table if the
1223 * given name does not exist, or modify the value of the existing row
1224 * with that name. Note that internally setting values are always
1225 * stored as strings, so this function converts the given value to a
1226 * string before storing it.
1227 *
1228 * @param cr The ContentResolver to access.
1229 * @param name The name of the setting to modify.
1230 * @param value The new value for the setting.
1231 * @return true if the value was set, false on database errors
1232 */
1233 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001234 return putIntForUser(cr, name, value, UserHandle.myUserId());
1235 }
1236
1237 /** @hide */
1238 public static boolean putIntForUser(ContentResolver cr, String name, int value,
1239 int userHandle) {
1240 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001241 }
1242
1243 /**
1244 * Convenience function for retrieving a single system settings value
1245 * as a {@code long}. Note that internally setting values are always
1246 * stored as strings; this function converts the string to a {@code long}
1247 * for you. The default value will be returned if the setting is
1248 * not defined or not a {@code long}.
1249 *
1250 * @param cr The ContentResolver to access.
1251 * @param name The name of the setting to retrieve.
1252 * @param def Value to return if the setting is not defined.
1253 *
1254 * @return The setting's current value, or 'def' if it is not defined
1255 * or not a valid {@code long}.
1256 */
1257 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001258 return getLongForUser(cr, name, def, UserHandle.myUserId());
1259 }
1260
1261 /** @hide */
1262 public static long getLongForUser(ContentResolver cr, String name, long def,
1263 int userHandle) {
1264 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001265 long value;
1266 try {
1267 value = valString != null ? Long.parseLong(valString) : def;
1268 } catch (NumberFormatException e) {
1269 value = def;
1270 }
1271 return value;
1272 }
1273
1274 /**
1275 * Convenience function for retrieving a single system settings value
1276 * as a {@code long}. Note that internally setting values are always
1277 * stored as strings; this function converts the string to a {@code long}
1278 * for you.
1279 * <p>
1280 * This version does not take a default value. If the setting has not
1281 * been set, or the string value is not a number,
1282 * it throws {@link SettingNotFoundException}.
1283 *
1284 * @param cr The ContentResolver to access.
1285 * @param name The name of the setting to retrieve.
1286 *
1287 * @return The setting's current value.
1288 * @throws SettingNotFoundException Thrown if a setting by the given
1289 * name can't be found or the setting value is not an integer.
1290 */
1291 public static long getLong(ContentResolver cr, String name)
1292 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001293 return getLongForUser(cr, name, UserHandle.myUserId());
1294 }
1295
1296 /** @hide */
1297 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
1298 throws SettingNotFoundException {
1299 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001300 try {
1301 return Long.parseLong(valString);
1302 } catch (NumberFormatException e) {
1303 throw new SettingNotFoundException(name);
1304 }
1305 }
1306
1307 /**
1308 * Convenience function for updating a single settings value as a long
1309 * integer. This will either create a new entry in the table if the
1310 * given name does not exist, or modify the value of the existing row
1311 * with that name. Note that internally setting values are always
1312 * stored as strings, so this function converts the given value to a
1313 * string before storing it.
1314 *
1315 * @param cr The ContentResolver to access.
1316 * @param name The name of the setting to modify.
1317 * @param value The new value for the setting.
1318 * @return true if the value was set, false on database errors
1319 */
1320 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001321 return putLongForUser(cr, name, value, UserHandle.myUserId());
1322 }
1323
1324 /** @hide */
1325 public static boolean putLongForUser(ContentResolver cr, String name, long value,
1326 int userHandle) {
1327 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001328 }
1329
1330 /**
1331 * Convenience function for retrieving a single system settings value
1332 * as a floating point number. Note that internally setting values are
1333 * always stored as strings; this function converts the string to an
1334 * float for you. The default value will be returned if the setting
1335 * is not defined or not a valid float.
1336 *
1337 * @param cr The ContentResolver to access.
1338 * @param name The name of the setting to retrieve.
1339 * @param def Value to return if the setting is not defined.
1340 *
1341 * @return The setting's current value, or 'def' if it is not defined
1342 * or not a valid float.
1343 */
1344 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07001345 return getFloatForUser(cr, name, def, UserHandle.myUserId());
1346 }
1347
1348 /** @hide */
1349 public static float getFloatForUser(ContentResolver cr, String name, float def,
1350 int userHandle) {
1351 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001352 try {
1353 return v != null ? Float.parseFloat(v) : def;
1354 } catch (NumberFormatException e) {
1355 return def;
1356 }
1357 }
1358
1359 /**
1360 * Convenience function for retrieving a single system settings value
1361 * as a float. Note that internally setting values are always
1362 * stored as strings; this function converts the string to a float
1363 * for you.
1364 * <p>
1365 * This version does not take a default value. If the setting has not
1366 * been set, or the string value is not a number,
1367 * it throws {@link SettingNotFoundException}.
1368 *
1369 * @param cr The ContentResolver to access.
1370 * @param name The name of the setting to retrieve.
1371 *
1372 * @throws SettingNotFoundException Thrown if a setting by the given
1373 * name can't be found or the setting value is not a float.
1374 *
1375 * @return The setting's current value.
1376 */
1377 public static float getFloat(ContentResolver cr, String name)
1378 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07001379 return getFloatForUser(cr, name, UserHandle.myUserId());
1380 }
1381
1382 /** @hide */
1383 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
1384 throws SettingNotFoundException {
1385 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08001386 if (v == null) {
1387 throw new SettingNotFoundException(name);
1388 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001389 try {
1390 return Float.parseFloat(v);
1391 } catch (NumberFormatException e) {
1392 throw new SettingNotFoundException(name);
1393 }
1394 }
1395
1396 /**
1397 * Convenience function for updating a single settings value as a
1398 * floating point number. This will either create a new entry in the
1399 * table if the given name does not exist, or modify the value of the
1400 * existing row with that name. Note that internally setting values
1401 * are always stored as strings, so this function converts the given
1402 * value to a string before storing it.
1403 *
1404 * @param cr The ContentResolver to access.
1405 * @param name The name of the setting to modify.
1406 * @param value The new value for the setting.
1407 * @return true if the value was set, false on database errors
1408 */
1409 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07001410 return putFloatForUser(cr, name, value, UserHandle.myUserId());
1411 }
1412
1413 /** @hide */
1414 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
1415 int userHandle) {
1416 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001417 }
1418
1419 /**
1420 * Convenience function to read all of the current
1421 * configuration-related settings into a
1422 * {@link Configuration} object.
1423 *
1424 * @param cr The ContentResolver to access.
1425 * @param outConfig Where to place the configuration settings.
1426 */
1427 public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
Christopher Tate06efb532012-08-24 15:29:27 -07001428 getConfigurationForUser(cr, outConfig, UserHandle.myUserId());
1429 }
1430
1431 /** @hide */
1432 public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig,
1433 int userHandle) {
1434 outConfig.fontScale = Settings.System.getFloatForUser(
1435 cr, FONT_SCALE, outConfig.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001436 if (outConfig.fontScale < 0) {
1437 outConfig.fontScale = 1;
1438 }
1439 }
1440
1441 /**
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001442 * @hide Erase the fields in the Configuration that should be applied
1443 * by the settings.
1444 */
1445 public static void clearConfiguration(Configuration inoutConfig) {
1446 inoutConfig.fontScale = 0;
1447 }
Narayan Kamath6d632962011-08-24 11:51:37 +01001448
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001449 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001450 * Convenience function to write a batch of configuration-related
1451 * settings from a {@link Configuration} object.
1452 *
1453 * @param cr The ContentResolver to access.
1454 * @param config The settings to write.
1455 * @return true if the values were set, false on database errors
1456 */
1457 public static boolean putConfiguration(ContentResolver cr, Configuration config) {
Christopher Tate06efb532012-08-24 15:29:27 -07001458 return putConfigurationForUser(cr, config, UserHandle.myUserId());
1459 }
1460
1461 /** @hide */
1462 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config,
1463 int userHandle) {
1464 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001465 }
1466
Dianne Hackbornb8b11a02010-03-10 15:53:11 -08001467 /** @hide */
1468 public static boolean hasInterestingConfigurationChanges(int changes) {
1469 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0;
1470 }
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001471
Christopher Tate06efb532012-08-24 15:29:27 -07001472 /** @deprecated - Do not use */
1473 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001474 public static boolean getShowGTalkServiceStatus(ContentResolver cr) {
Christopher Tate06efb532012-08-24 15:29:27 -07001475 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001476 }
1477
Christopher Tate06efb532012-08-24 15:29:27 -07001478 /**
1479 * @hide
1480 * @deprecated - Do not use
1481 */
1482 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr,
1483 int userHandle) {
1484 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0;
1485 }
1486
1487 /** @deprecated - Do not use */
1488 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001489 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
Christopher Tatec8c08382012-09-19 17:18:18 -07001490 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId());
Christopher Tate06efb532012-08-24 15:29:27 -07001491 }
1492
1493 /**
1494 * @hide
1495 * @deprecated - Do not use
1496 */
1497 @Deprecated
1498 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag,
1499 int userHandle) {
1500 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001501 }
1502
1503 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001504 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001505 */
Christopher Tate06efb532012-08-24 15:29:27 -07001506 @Deprecated
1507 public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001508
1509 /**
1510 * What happens when the user presses the end call button if they're not
1511 * on a call.<br/>
1512 * <b>Values:</b><br/>
1513 * 0 - The end button does nothing.<br/>
1514 * 1 - The end button goes to the home screen.<br/>
1515 * 2 - The end button puts the device to sleep and locks the keyguard.<br/>
1516 * 3 - The end button goes to the home screen. If the user is already on the
1517 * home screen, it puts the device to sleep.
1518 */
1519 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
1520
1521 /**
David Brown458e8062010-03-08 21:52:11 -08001522 * END_BUTTON_BEHAVIOR value for "go home".
1523 * @hide
1524 */
1525 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
1526
1527 /**
1528 * END_BUTTON_BEHAVIOR value for "go to sleep".
1529 * @hide
1530 */
1531 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
1532
1533 /**
1534 * END_BUTTON_BEHAVIOR default value.
1535 * @hide
1536 */
1537 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
1538
1539 /**
Joe Onorato9cdffa12011-04-06 18:27:27 -07001540 * Is advanced settings mode turned on. 0 == no, 1 == yes
1541 * @hide
1542 */
1543 public static final String ADVANCED_SETTINGS = "advanced_settings";
1544
1545 /**
1546 * ADVANCED_SETTINGS default value.
1547 * @hide
1548 */
1549 public static final int ADVANCED_SETTINGS_DEFAULT = 0;
1550
1551 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001552 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001553 */
Christopher Tate06efb532012-08-24 15:29:27 -07001554 @Deprecated
1555 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001556
1557 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001558 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001559 */
Christopher Tate06efb532012-08-24 15:29:27 -07001560 @Deprecated
1561 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001562
1563 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001564 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001565 */
Christopher Tate06efb532012-08-24 15:29:27 -07001566 @Deprecated
1567 public static final String RADIO_WIFI = Global.RADIO_WIFI;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001568
Robert Greenwalt8588e472011-11-08 10:12:25 -08001569 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001570 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead
Robert Greenwalt8588e472011-11-08 10:12:25 -08001571 * {@hide}
1572 */
Christopher Tate06efb532012-08-24 15:29:27 -07001573 @Deprecated
1574 public static final String RADIO_WIMAX = Global.RADIO_WIMAX;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001575
1576 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001577 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead
Nick Pelly8d32a012011-08-09 07:03:49 -07001578 */
Christopher Tate06efb532012-08-24 15:29:27 -07001579 @Deprecated
1580 public static final String RADIO_CELL = Global.RADIO_CELL;
Nick Pelly8d32a012011-08-09 07:03:49 -07001581
1582 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001583 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001584 */
Christopher Tate06efb532012-08-24 15:29:27 -07001585 @Deprecated
1586 public static final String RADIO_NFC = Global.RADIO_NFC;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001587
1588 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001589 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead
1590 */
1591 @Deprecated
1592 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS;
1593
1594 /**
1595 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001596 *
1597 * {@hide}
1598 */
Christopher Tate06efb532012-08-24 15:29:27 -07001599 @Deprecated
1600 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS =
1601 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS;
Mike Lockwoodbd5ddf02009-07-29 21:37:14 -07001602
1603 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001604 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001605 */
Christopher Tate06efb532012-08-24 15:29:27 -07001606 @Deprecated
1607 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001608
1609 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001610 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001611 */
Christopher Tate06efb532012-08-24 15:29:27 -07001612 @Deprecated
1613 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001614
1615 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001616 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001617 */
Christopher Tate06efb532012-08-24 15:29:27 -07001618 @Deprecated
1619 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED =
1620 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001621
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001622 /**
Christopher Tate06efb532012-08-24 15:29:27 -07001623 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001624 */
Christopher Tate06efb532012-08-24 15:29:27 -07001625 @Deprecated
1626 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001627
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07001628 /**
1629 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead
1630 */
1631 @Deprecated
1632 public static final String MODE_RINGER = Global.MODE_RINGER;
1633
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001634 /**
1635 * Whether to use static IP and other static network attributes.
1636 * <p>
1637 * Set to 1 for true and 0 for false.
Jeff Sharkey625239a2012-09-26 22:03:49 -07001638 *
1639 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001640 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001641 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001642 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip";
1643
1644 /**
1645 * The static IP address.
1646 * <p>
1647 * Example: "192.168.1.51"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001648 *
1649 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001650 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001651 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001652 public static final String WIFI_STATIC_IP = "wifi_static_ip";
1653
1654 /**
1655 * If using static IP, the gateway's IP address.
1656 * <p>
1657 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001658 *
1659 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001660 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001661 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001662 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway";
1663
1664 /**
1665 * If using static IP, the net mask.
1666 * <p>
1667 * Example: "255.255.255.0"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001668 *
1669 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001670 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001671 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001672 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask";
1673
1674 /**
1675 * If using static IP, the primary DNS's IP address.
1676 * <p>
1677 * Example: "192.168.1.1"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001678 *
1679 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001680 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001681 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001682 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1";
1683
1684 /**
1685 * If using static IP, the secondary DNS's IP address.
1686 * <p>
1687 * Example: "192.168.1.2"
Jeff Sharkey625239a2012-09-26 22:03:49 -07001688 *
1689 * @deprecated Use {@link WifiManager} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001690 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07001691 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001692 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2";
1693
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001694
1695 /**
1696 * Determines whether remote devices may discover and/or connect to
1697 * this device.
1698 * <P>Type: INT</P>
1699 * 2 -- discoverable and connectable
1700 * 1 -- connectable but not discoverable
1701 * 0 -- neither connectable nor discoverable
1702 */
1703 public static final String BLUETOOTH_DISCOVERABILITY =
1704 "bluetooth_discoverability";
1705
1706 /**
1707 * Bluetooth discoverability timeout. If this value is nonzero, then
1708 * Bluetooth becomes discoverable for a certain number of seconds,
1709 * after which is becomes simply connectable. The value is in seconds.
1710 */
1711 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT =
1712 "bluetooth_discoverability_timeout";
1713
1714 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001715 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED}
1716 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001717 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001718 @Deprecated
1719 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001720
1721 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08001722 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE}
1723 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001724 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001725 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001726 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
1727
1728 /**
Jaikumar Ganesh545e6702010-06-04 10:23:03 -07001729 * @deprecated Use
Amith Yamasani156c4352010-03-05 17:10:03 -08001730 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED}
1731 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001732 */
Amith Yamasani156c4352010-03-05 17:10:03 -08001733 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001734 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED =
1735 "lock_pattern_tactile_feedback_enabled";
1736
1737
1738 /**
1739 * A formatted string of the next alarm that is set, or the empty string
1740 * if there is no alarm set.
1741 */
1742 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted";
1743
1744 /**
1745 * Scaling factor for fonts, float.
1746 */
1747 public static final String FONT_SCALE = "font_scale";
1748
1749 /**
1750 * Name of an application package to be debugged.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001751 *
1752 * @deprecated Use {@link Global#DEBUG_APP} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001753 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001754 @Deprecated
1755 public static final String DEBUG_APP = Global.DEBUG_APP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001756
1757 /**
1758 * If 1, when launching DEBUG_APP it will wait for the debugger before
1759 * starting user code. If 0, it will run normally.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001760 *
1761 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001762 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001763 @Deprecated
1764 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001765
1766 /**
1767 * Whether or not to dim the screen. 0=no 1=yes
Jeff Brown96307042012-07-27 15:51:34 -07001768 * @deprecated This setting is no longer used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001769 */
Jeff Brown96307042012-07-27 15:51:34 -07001770 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001771 public static final String DIM_SCREEN = "dim_screen";
1772
1773 /**
1774 * The timeout before the screen turns off.
1775 */
1776 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
1777
1778 /**
1779 * The screen backlight brightness between 0 and 255.
1780 */
1781 public static final String SCREEN_BRIGHTNESS = "screen_brightness";
1782
1783 /**
Dan Murphy951764b2009-08-27 14:59:03 -05001784 * Control whether to enable automatic brightness mode.
Dan Murphy951764b2009-08-27 14:59:03 -05001785 */
1786 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";
1787
1788 /**
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08001789 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0)
1790 * or less (<0.0 >-1.0) bright.
Dianne Hackborn518a3d82012-05-09 16:30:49 -07001791 * @hide
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08001792 */
1793 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj";
1794
1795 /**
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001796 * SCREEN_BRIGHTNESS_MODE value for manual mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001797 */
1798 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;
1799
1800 /**
Scott Main52bfc242012-02-09 10:09:14 -08001801 * SCREEN_BRIGHTNESS_MODE value for automatic mode.
Mike Lockwooddc3494e2009-10-14 21:17:09 -07001802 */
1803 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
1804
1805 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001806 * Control whether the process CPU usage meter should be shown.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001807 *
1808 * @deprecated Use {@link Global#SHOW_PROCESSES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001809 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001810 @Deprecated
1811 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001812
1813 /**
1814 * If 1, the activity manager will aggressively finish activities and
1815 * processes as soon as they are no longer needed. If 0, the normal
1816 * extended lifetime is used.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001817 *
1818 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001819 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07001820 @Deprecated
1821 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001822
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001823 /**
1824 * Determines which streams are affected by ringer mode changes. The
1825 * stream type's bit should be set to 1 if it should be muted when going
1826 * into an inaudible ringer mode.
1827 */
1828 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected";
1829
1830 /**
1831 * Determines which streams are affected by mute. The
1832 * stream type's bit should be set to 1 if it should be muted when a mute request
1833 * is received.
1834 */
1835 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected";
1836
1837 /**
1838 * Whether vibrate is on for different events. This is used internally,
1839 * changing this value will not change the vibrate. See AudioManager.
1840 */
1841 public static final String VIBRATE_ON = "vibrate_on";
1842
1843 /**
Jeff Brown7f6c2312012-04-13 20:38:38 -07001844 * If 1, redirects the system vibrator to all currently attached input devices
1845 * that support vibration. If there are no such input devices, then the system
1846 * vibrator is used instead.
1847 * If 0, does not register the system vibrator.
1848 *
1849 * This setting is mainly intended to provide a compatibility mechanism for
1850 * applications that only know about the system vibrator and do not use the
1851 * input device vibrator API.
1852 *
1853 * @hide
1854 */
1855 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices";
1856
1857 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001858 * Ringer volume. This is used internally, changing this value will not
1859 * change the volume. See AudioManager.
1860 */
1861 public static final String VOLUME_RING = "volume_ring";
1862
1863 /**
1864 * System/notifications volume. This is used internally, changing this
1865 * value will not change the volume. See AudioManager.
1866 */
1867 public static final String VOLUME_SYSTEM = "volume_system";
1868
1869 /**
1870 * Voice call volume. This is used internally, changing this value will
1871 * not change the volume. See AudioManager.
1872 */
1873 public static final String VOLUME_VOICE = "volume_voice";
1874
1875 /**
1876 * Music/media/gaming volume. This is used internally, changing this
1877 * value will not change the volume. See AudioManager.
1878 */
1879 public static final String VOLUME_MUSIC = "volume_music";
1880
1881 /**
1882 * Alarm volume. This is used internally, changing this
1883 * value will not change the volume. See AudioManager.
1884 */
1885 public static final String VOLUME_ALARM = "volume_alarm";
1886
1887 /**
1888 * Notification volume. This is used internally, changing this
1889 * value will not change the volume. See AudioManager.
1890 */
1891 public static final String VOLUME_NOTIFICATION = "volume_notification";
1892
1893 /**
Eric Laurent484d2882009-12-08 09:05:45 -08001894 * Bluetooth Headset volume. This is used internally, changing this value will
1895 * not change the volume. See AudioManager.
1896 */
1897 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
1898
1899 /**
Mike Lockwood8517e462011-10-25 14:47:19 -04001900 * Master volume (float in the range 0.0f to 1.0f).
1901 * @hide
1902 */
1903 public static final String VOLUME_MASTER = "volume_master";
1904
1905 /**
Justin Koh57978ed2012-04-03 17:37:58 -07001906 * Master volume mute (int 1 = mute, 0 = not muted).
1907 *
1908 * @hide
1909 */
1910 public static final String VOLUME_MASTER_MUTE = "volume_master_mute";
1911
1912 /**
1913 * Whether the notifications should use the ring volume (value of 1) or
1914 * a separate notification volume (value of 0). In most cases, users
1915 * will have this enabled so the notification and ringer volumes will be
1916 * the same. However, power users can disable this and use the separate
1917 * notification volume control.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001918 * <p>
Justin Koh57978ed2012-04-03 17:37:58 -07001919 * Note: This is a one-off setting that will be removed in the future
1920 * when there is profile support. For this reason, it is kept hidden
1921 * from the public APIs.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001922 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001923 * @hide
Amith Yamasani42722bf2011-07-22 10:34:27 -07001924 * @deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001925 */
Gilles Debunnee90bed12011-08-30 14:28:27 -07001926 @Deprecated
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001927 public static final String NOTIFICATIONS_USE_RING_VOLUME =
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001928 "notifications_use_ring_volume";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07001929
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001930 /**
Daniel Sandler6329bf72010-02-26 15:17:44 -05001931 * Whether silent mode should allow vibration feedback. This is used
1932 * internally in AudioService and the Sound settings activity to
1933 * coordinate decoupling of vibrate and silent modes. This setting
1934 * will likely be removed in a future release with support for
1935 * audio/vibe feedback profiles.
1936 *
Eric Laurentbffc3d12012-05-07 17:43:49 -07001937 * Not used anymore. On devices with vibrator, the user explicitly selects
1938 * silent or vibrate mode.
1939 * Kept for use by legacy database upgrade code in DatabaseHelper.
Daniel Sandler6329bf72010-02-26 15:17:44 -05001940 * @hide
1941 */
1942 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
1943
1944 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001945 * The mapping of stream type (integer) to its setting.
1946 */
1947 public static final String[] VOLUME_SETTINGS = {
1948 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC,
Eric Laurent484d2882009-12-08 09:05:45 -08001949 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001950 };
1951
1952 /**
1953 * Appended to various volume related settings to record the previous
1954 * values before they the settings were affected by a silent/vibrate
1955 * ringer mode change.
1956 */
1957 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible";
1958
1959 /**
1960 * Persistent store for the system-wide default ringtone URI.
1961 * <p>
1962 * If you need to play the default ringtone at any given time, it is recommended
1963 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve
1964 * to the set default ringtone at the time of playing.
1965 *
1966 * @see #DEFAULT_RINGTONE_URI
1967 */
1968 public static final String RINGTONE = "ringtone";
1969
1970 /**
1971 * A {@link Uri} that will point to the current default ringtone at any
1972 * given time.
1973 * <p>
1974 * If the current default ringtone is in the DRM provider and the caller
1975 * does not have permission, the exception will be a
1976 * FileNotFoundException.
1977 */
1978 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE);
1979
1980 /**
1981 * Persistent store for the system-wide default notification sound.
1982 *
1983 * @see #RINGTONE
1984 * @see #DEFAULT_NOTIFICATION_URI
1985 */
1986 public static final String NOTIFICATION_SOUND = "notification_sound";
1987
1988 /**
1989 * A {@link Uri} that will point to the current default notification
1990 * sound at any given time.
1991 *
1992 * @see #DEFAULT_RINGTONE_URI
1993 */
1994 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND);
1995
1996 /**
Patrick Scott3156bb002009-04-13 09:57:38 -07001997 * Persistent store for the system-wide default alarm alert.
1998 *
1999 * @see #RINGTONE
2000 * @see #DEFAULT_ALARM_ALERT_URI
2001 */
2002 public static final String ALARM_ALERT = "alarm_alert";
2003
2004 /**
2005 * A {@link Uri} that will point to the current default alarm alert at
2006 * any given time.
2007 *
2008 * @see #DEFAULT_ALARM_ALERT_URI
2009 */
2010 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT);
2011
2012 /**
Jean-Michel Trivid589fea2011-04-15 11:28:10 -07002013 * Persistent store for the system default media button event receiver.
2014 *
2015 * @hide
2016 */
2017 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver";
2018
2019 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002020 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off
2021 */
2022 public static final String TEXT_AUTO_REPLACE = "auto_replace";
2023
2024 /**
2025 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off
2026 */
2027 public static final String TEXT_AUTO_CAPS = "auto_caps";
2028
2029 /**
2030 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This
2031 * feature converts two spaces to a "." and space.
2032 */
2033 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002034
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002035 /**
2036 * Setting to showing password characters in text editors. 1 = On, 0 = Off
2037 */
2038 public static final String TEXT_SHOW_PASSWORD = "show_password";
2039
2040 public static final String SHOW_GTALK_SERVICE_STATUS =
2041 "SHOW_GTALK_SERVICE_STATUS";
2042
2043 /**
2044 * Name of activity to use for wallpaper on the home screen.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002045 *
2046 * @deprecated Use {@link WallpaperManager} instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002047 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002048 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002049 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
2050
2051 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002052 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME}
2053 * instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002054 */
Christopher Tate06efb532012-08-24 15:29:27 -07002055 @Deprecated
2056 public static final String AUTO_TIME = Global.AUTO_TIME;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002057
2058 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002059 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE}
2060 * instead
Amith Yamasaniad450be2010-09-16 16:47:00 -07002061 */
Christopher Tate06efb532012-08-24 15:29:27 -07002062 @Deprecated
2063 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE;
Amith Yamasaniad450be2010-09-16 16:47:00 -07002064
2065 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002066 * Display times as 12 or 24 hours
2067 * 12
2068 * 24
2069 */
2070 public static final String TIME_12_24 = "time_12_24";
2071
2072 /**
2073 * Date format string
2074 * mm/dd/yyyy
2075 * dd/mm/yyyy
2076 * yyyy/mm/dd
2077 */
2078 public static final String DATE_FORMAT = "date_format";
2079
2080 /**
2081 * Whether the setup wizard has been run before (on first boot), or if
2082 * it still needs to be run.
2083 *
2084 * nonzero = it has been run in the past
2085 * 0 = it has not been run in the past
2086 */
2087 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
2088
2089 /**
2090 * Scaling factor for normal window animations. Setting to 0 will disable window
2091 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002092 *
2093 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002094 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002095 @Deprecated
2096 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002097
2098 /**
2099 * Scaling factor for activity transition animations. Setting to 0 will disable window
2100 * animations.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002101 *
2102 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002103 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002104 @Deprecated
2105 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002106
2107 /**
Chet Haasec38fa1f2012-02-01 16:37:46 -08002108 * Scaling factor for Animator-based animations. This affects both the start delay and
2109 * duration of all such animations. Setting to 0 will cause animations to end immediately.
2110 * The default value is 1.
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002111 *
2112 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
Chet Haasec38fa1f2012-02-01 16:37:46 -08002113 */
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002114 @Deprecated
2115 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002116
2117 /**
2118 * Control whether the accelerometer will be used to change screen
2119 * orientation. If 0, it will not be used unless explicitly requested
2120 * by the application; if 1, it will be used by default unless explicitly
2121 * disabled by the application.
2122 */
2123 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation";
2124
2125 /**
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002126 * Default screen rotation when no other policy applies.
2127 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a
2128 * preference, this rotation value will be used. Must be one of the
Brian Muramatsue1d46982010-12-06 17:34:20 -08002129 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}.
Daniel Sandlerb73617d2010-08-17 00:41:00 -04002130 *
2131 * @see Display#getRotation
2132 */
2133 public static final String USER_ROTATION = "user_rotation";
2134
2135 /**
Jeff Brown207673cd2012-06-05 17:47:11 -07002136 * Control whether the rotation lock toggle in the System UI should be hidden.
2137 * Typically this is done for accessibility purposes to make it harder for
2138 * the user to accidentally toggle the rotation lock while the display rotation
2139 * has been locked for accessibility.
2140 *
2141 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be
2142 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden.
2143 *
2144 * @hide
2145 */
2146 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY =
2147 "hide_rotation_lock_toggle_for_accessibility";
2148
2149 /**
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002150 * Whether the phone vibrates when it is ringing due to an incoming call. This will
2151 * be used by Phone and Setting apps; it shouldn't affect other apps.
2152 * The value is boolean (1 or 0).
2153 *
2154 * Note: this is not same as "vibrate on ring", which had been available until ICS.
2155 * It was about AudioManager's setting and thus affected all the applications which
2156 * relied on the setting, while this is purely about the vibration setting for incoming
2157 * calls.
2158 *
2159 * @hide
2160 */
2161 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
2162
2163 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002164 * Whether the audible DTMF tones are played by the dialer when dialing. The value is
2165 * boolean (1 or 0).
2166 */
2167 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone";
2168
2169 /**
David Kraused0f67152009-06-13 18:01:13 -05002170 * CDMA only settings
2171 * DTMF tone type played by the dialer when dialing.
2172 * 0 = Normal
2173 * 1 = Long
2174 * @hide
2175 */
2176 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
2177
2178 /**
David Kraused0f67152009-06-13 18:01:13 -05002179 * Whether the hearing aid is enabled. The value is
2180 * boolean (1 or 0).
2181 * @hide
2182 */
2183 public static final String HEARING_AID = "hearing_aid";
2184
2185 /**
2186 * CDMA only settings
2187 * TTY Mode
2188 * 0 = OFF
2189 * 1 = FULL
2190 * 2 = VCO
2191 * 3 = HCO
2192 * @hide
2193 */
2194 public static final String TTY_MODE = "tty_mode";
2195
2196 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002197 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is
2198 * boolean (1 or 0).
2199 */
2200 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002201
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002202 /**
2203 * Whether the haptic feedback (long presses, ...) are enabled. The value is
2204 * boolean (1 or 0).
2205 */
2206 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07002207
Mike LeBeau48603e72009-06-05 00:27:00 +01002208 /**
Bjorn Bringert24abb662010-09-21 12:21:18 +01002209 * @deprecated Each application that shows web suggestions should have its own
2210 * setting for this.
Mike LeBeau48603e72009-06-05 00:27:00 +01002211 */
Bjorn Bringert24abb662010-09-21 12:21:18 +01002212 @Deprecated
Mike LeBeau48603e72009-06-05 00:27:00 +01002213 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002214
-b master501eec92009-07-06 13:53:11 -07002215 /**
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002216 * Whether the notification LED should repeatedly flash when a notification is
2217 * pending. The value is boolean (1 or 0).
2218 * @hide
2219 */
2220 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
2221
2222 /**
Dianne Hackborn90d2db32010-02-11 22:19:06 -08002223 * Show pointer location on screen?
2224 * 0 = no
2225 * 1 = yes
2226 * @hide
2227 */
2228 public static final String POINTER_LOCATION = "pointer_location";
2229
2230 /**
Jeff Browndaf4a122011-08-26 17:14:14 -07002231 * Show touch positions on screen?
2232 * 0 = no
2233 * 1 = yes
2234 * @hide
2235 */
2236 public static final String SHOW_TOUCHES = "show_touches";
2237
2238 /**
Jeff Brown4519f072011-01-23 13:16:01 -08002239 * Log raw orientation data from {@link WindowOrientationListener} for use with the
2240 * orientationplot.py tool.
2241 * 0 = no
2242 * 1 = yes
2243 * @hide
2244 */
2245 public static final String WINDOW_ORIENTATION_LISTENER_LOG =
2246 "window_orientation_listener_log";
2247
2248 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002249 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED}
2250 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002251 * @hide
2252 */
Christopher Tate06efb532012-08-24 15:29:27 -07002253 @Deprecated
2254 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002255
2256 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002257 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED}
2258 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002259 * @hide
2260 */
Christopher Tate06efb532012-08-24 15:29:27 -07002261 @Deprecated
2262 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002263
2264 /**
2265 * Whether to play sounds when the keyguard is shown and dismissed.
2266 * @hide
2267 */
2268 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled";
2269
2270 /**
Mike Lockwood7bef7392011-10-20 16:51:53 -04002271 * Whether the lockscreen should be completely disabled.
2272 * @hide
2273 */
2274 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled";
2275
2276 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002277 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND}
2278 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002279 * @hide
2280 */
Christopher Tate06efb532012-08-24 15:29:27 -07002281 @Deprecated
2282 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002283
2284 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002285 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND}
2286 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002287 * @hide
2288 */
Christopher Tate06efb532012-08-24 15:29:27 -07002289 @Deprecated
2290 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002291
2292 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002293 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND}
2294 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002295 * @hide
2296 */
Christopher Tate06efb532012-08-24 15:29:27 -07002297 @Deprecated
2298 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002299
2300 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002301 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND}
2302 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002303 * @hide
2304 */
Christopher Tate06efb532012-08-24 15:29:27 -07002305 @Deprecated
2306 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002307
2308 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002309 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND}
2310 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002311 * @hide
2312 */
Christopher Tate06efb532012-08-24 15:29:27 -07002313 @Deprecated
2314 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002315
2316 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002317 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND}
2318 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002319 * @hide
2320 */
Christopher Tate06efb532012-08-24 15:29:27 -07002321 @Deprecated
2322 public static final String LOCK_SOUND = Global.LOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002323
2324 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002325 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND}
2326 * instead
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002327 * @hide
2328 */
Christopher Tate06efb532012-08-24 15:29:27 -07002329 @Deprecated
2330 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND;
Daniel Sandler0e9d2af2010-01-25 11:33:03 -05002331
2332 /**
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002333 * Receive incoming SIP calls?
2334 * 0 = no
2335 * 1 = yes
2336 * @hide
2337 */
2338 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls";
2339
2340 /**
2341 * Call Preference String.
2342 * "SIP_ALWAYS" : Always use SIP with network access
2343 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address
2344 * "SIP_ASK_ME_EACH_TIME" : Always ask me each time
2345 * @hide
2346 */
2347 public static final String SIP_CALL_OPTIONS = "sip_call_options";
2348
2349 /**
2350 * One of the sip call options: Always use SIP with network access.
2351 * @hide
2352 */
2353 public static final String SIP_ALWAYS = "SIP_ALWAYS";
2354
2355 /**
2356 * One of the sip call options: Only if destination is a SIP address.
2357 * @hide
2358 */
2359 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY";
2360
2361 /**
2362 * One of the sip call options: Always ask me each time.
2363 * @hide
2364 */
2365 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME";
2366
2367 /**
Jeff Brown1a84fd12011-06-02 01:26:32 -07002368 * Pointer speed setting.
2369 * This is an integer value in a range between -7 and +7, so there are 15 possible values.
2370 * -7 = slowest
2371 * 0 = default speed
2372 * +7 = fastest
2373 * @hide
2374 */
2375 public static final String POINTER_SPEED = "pointer_speed";
2376
2377 /**
-b master501eec92009-07-06 13:53:11 -07002378 * Settings to backup. This is here so that it's in the same place as the settings
2379 * keys and easy to update.
Svetoslav Ganova571a582011-09-20 18:32:20 -07002380 *
2381 * NOTE: Settings are backed up and restored in the order they appear
2382 * in this array. If you have one setting depending on another,
2383 * make sure that they are ordered appropriately.
2384 *
-b master501eec92009-07-06 13:53:11 -07002385 * @hide
2386 */
2387 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate66488d62012-10-02 11:58:01 -07002388 STAY_ON_WHILE_PLUGGED_IN, // moved to global
-b master501eec92009-07-06 13:53:11 -07002389 WIFI_USE_STATIC_IP,
2390 WIFI_STATIC_IP,
2391 WIFI_STATIC_GATEWAY,
2392 WIFI_STATIC_NETMASK,
2393 WIFI_STATIC_DNS1,
2394 WIFI_STATIC_DNS2,
2395 BLUETOOTH_DISCOVERABILITY,
2396 BLUETOOTH_DISCOVERABILITY_TIMEOUT,
2397 DIM_SCREEN,
2398 SCREEN_OFF_TIMEOUT,
2399 SCREEN_BRIGHTNESS,
Christopher Tate362aca62009-09-25 15:58:03 -07002400 SCREEN_BRIGHTNESS_MODE,
Dianne Hackbornd9ea4682012-01-20 18:36:40 -08002401 SCREEN_AUTO_BRIGHTNESS_ADJ,
Jeff Brown7f6c2312012-04-13 20:38:38 -07002402 VIBRATE_INPUT_DEVICES,
Christopher Tate66488d62012-10-02 11:58:01 -07002403 MODE_RINGER, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07002404 MODE_RINGER_STREAMS_AFFECTED,
2405 MUTE_STREAMS_AFFECTED,
2406 VOLUME_VOICE,
2407 VOLUME_SYSTEM,
2408 VOLUME_RING,
2409 VOLUME_MUSIC,
2410 VOLUME_ALARM,
2411 VOLUME_NOTIFICATION,
Eric Laurent484d2882009-12-08 09:05:45 -08002412 VOLUME_BLUETOOTH_SCO,
Amith Yamasani8823c0a82009-07-07 14:30:17 -07002413 VOLUME_VOICE + APPEND_FOR_LAST_AUDIBLE,
2414 VOLUME_SYSTEM + APPEND_FOR_LAST_AUDIBLE,
2415 VOLUME_RING + APPEND_FOR_LAST_AUDIBLE,
2416 VOLUME_MUSIC + APPEND_FOR_LAST_AUDIBLE,
2417 VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE,
2418 VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE,
Eric Laurent484d2882009-12-08 09:05:45 -08002419 VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE,
-b master501eec92009-07-06 13:53:11 -07002420 TEXT_AUTO_REPLACE,
2421 TEXT_AUTO_CAPS,
2422 TEXT_AUTO_PUNCTUATE,
2423 TEXT_SHOW_PASSWORD,
Christopher Tate66488d62012-10-02 11:58:01 -07002424 AUTO_TIME, // moved to global
2425 AUTO_TIME_ZONE, // moved to global
-b master501eec92009-07-06 13:53:11 -07002426 TIME_12_24,
2427 DATE_FORMAT,
-b master501eec92009-07-06 13:53:11 -07002428 DTMF_TONE_WHEN_DIALING,
2429 DTMF_TONE_TYPE_WHEN_DIALING,
-b master501eec92009-07-06 13:53:11 -07002430 HEARING_AID,
2431 TTY_MODE,
2432 SOUND_EFFECTS_ENABLED,
2433 HAPTIC_FEEDBACK_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07002434 POWER_SOUNDS_ENABLED, // moved to global
2435 DOCK_SOUNDS_ENABLED, // moved to global
Christopher Tate14c2d792010-02-25 16:49:44 -08002436 LOCKSCREEN_SOUNDS_ENABLED,
Amith Yamasaniae3ed702009-12-01 19:02:05 -08002437 SHOW_WEB_SUGGESTIONS,
Mike Lockwoodeabe8bf2010-08-31 14:35:23 -04002438 NOTIFICATION_LIGHT_PULSE,
Chung-yih Wang042e9bd2010-08-31 17:43:39 +08002439 SIP_CALL_OPTIONS,
Nick Pelly038cabe2010-09-23 16:12:11 -07002440 SIP_RECEIVE_CALLS,
Jeff Brown1a84fd12011-06-02 01:26:32 -07002441 POINTER_SPEED,
Daisuke Miyakawa3c60eeb2012-05-08 12:08:25 -07002442 VIBRATE_WHEN_RINGING
-b master501eec92009-07-06 13:53:11 -07002443 };
2444
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002445 // Settings moved to Settings.Secure
2446
2447 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002448 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002449 * instead
2450 */
2451 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002452 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002453
2454 /**
2455 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead
2456 */
2457 @Deprecated
2458 public static final String ANDROID_ID = Secure.ANDROID_ID;
2459
2460 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002461 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002462 */
2463 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002464 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002465
2466 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002467 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002468 */
2469 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002470 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002471
2472 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002473 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002474 */
2475 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002476 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002477
2478 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07002479 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002480 */
2481 @Deprecated
Jeff Sharkey625239a2012-09-26 22:03:49 -07002482 public static final String HTTP_PROXY = Global.HTTP_PROXY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002483
2484 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002485 * @deprecated Use {@link android.provider.Settings.Global#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002486 */
2487 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002488 public static final String INSTALL_NON_MARKET_APPS = Global.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002489
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002490 /**
2491 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED}
2492 * instead
2493 */
2494 @Deprecated
2495 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED;
2496
2497 /**
2498 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead
2499 */
2500 @Deprecated
2501 public static final String LOGGING_ID = Secure.LOGGING_ID;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002502
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002503 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002504 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002505 */
2506 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002507 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002508
2509 /**
2510 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED}
2511 * instead
2512 */
2513 @Deprecated
2514 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED;
2515
2516 /**
2517 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE}
2518 * instead
2519 */
2520 @Deprecated
2521 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE;
2522
2523 /**
2524 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL}
2525 * instead
2526 */
2527 @Deprecated
2528 public static final String PARENTAL_CONTROL_REDIRECT_URL =
2529 Secure.PARENTAL_CONTROL_REDIRECT_URL;
2530
2531 /**
2532 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead
2533 */
2534 @Deprecated
2535 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME;
2536
2537 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002538 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002539 */
2540 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002541 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002542
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002543 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002544 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002545 */
2546 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002547 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002548
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002549 /**
2550 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002551 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002552 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002553 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002554 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002555
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002556 /**
2557 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002558 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
Dianne Hackborn4a51c202009-08-21 15:14:02 -07002559 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002560 @Deprecated
2561 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Christopher Tate06efb532012-08-24 15:29:27 -07002562 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002563
2564 /**
2565 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002566 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002567 */
2568 @Deprecated
2569 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate06efb532012-08-24 15:29:27 -07002570 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002571
2572 /**
2573 * @deprecated Use
Christopher Tate06efb532012-08-24 15:29:27 -07002574 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002575 */
2576 @Deprecated
2577 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate06efb532012-08-24 15:29:27 -07002578 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002579
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002580 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002581 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002582 * instead
2583 */
2584 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002585 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002586
2587 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002588 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002589 */
2590 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002591 public static final String WIFI_ON = Global.WIFI_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002592
2593 /**
2594 * @deprecated Use
2595 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE}
2596 * instead
2597 */
2598 @Deprecated
2599 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
2600 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE;
2601
2602 /**
2603 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead
2604 */
2605 @Deprecated
2606 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT;
2607
2608 /**
2609 * @deprecated Use
2610 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead
2611 */
2612 @Deprecated
2613 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
2614 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07002615
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002616 /**
2617 * @deprecated Use
2618 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead
2619 */
2620 @Deprecated
2621 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
2622 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED;
2623
2624 /**
2625 * @deprecated Use
2626 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS}
2627 * instead
2628 */
2629 @Deprecated
2630 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
2631 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS;
2632
2633 /**
2634 * @deprecated Use
2635 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead
2636 */
2637 @Deprecated
2638 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
2639 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT;
2640
2641 /**
2642 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS}
2643 * instead
2644 */
2645 @Deprecated
2646 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS;
2647
2648 /**
Christopher Tate06efb532012-08-24 15:29:27 -07002649 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002650 */
2651 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07002652 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002653
2654 /**
2655 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead
2656 */
2657 @Deprecated
2658 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT;
2659
2660 /**
2661 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS}
2662 * instead
2663 */
2664 @Deprecated
2665 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS;
2666
2667 /**
2668 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS}
2669 * instead
2670 */
2671 @Deprecated
2672 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
2673 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
2674 }
2675
2676 /**
2677 * Secure system settings, containing system preferences that applications
2678 * can read but are not allowed to write. These are for preferences that
2679 * the user must explicitly modify through the system UI or specialized
2680 * APIs for those values, not modified directly by applications.
2681 */
2682 public static final class Secure extends NameValueTable {
2683 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version";
2684
Dianne Hackborn139748f2012-09-24 11:36:57 -07002685 /**
2686 * The content:// style URL for this table
2687 */
2688 public static final Uri CONTENT_URI =
2689 Uri.parse("content://" + AUTHORITY + "/secure");
2690
Brad Fitzpatrick1877d012010-03-04 17:48:13 -08002691 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07002692 private static final NameValueCache sNameValueCache = new NameValueCache(
2693 SYS_PROP_SETTING_VERSION,
2694 CONTENT_URI,
2695 CALL_METHOD_GET_SECURE,
2696 CALL_METHOD_PUT_SECURE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002697
Amith Yamasani52c489c2012-03-28 11:42:42 -07002698 private static ILockSettings sLockSettings = null;
2699
Amith Yamasani7ab8c4a2012-04-06 09:27:12 -07002700 private static boolean sIsSystemProcess;
Amith Yamasani52c489c2012-03-28 11:42:42 -07002701 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS;
Christopher Tate06efb532012-08-24 15:29:27 -07002702 private static final HashSet<String> MOVED_TO_GLOBAL;
Amith Yamasani52c489c2012-03-28 11:42:42 -07002703 static {
2704 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3);
2705 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED);
2706 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE);
2707 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07002708
2709 MOVED_TO_GLOBAL = new HashSet<String>();
2710 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED);
2711 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED);
2712 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON);
Christopher Tate58f41ec2013-01-11 15:40:36 -08002713 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU);
Christopher Tate06efb532012-08-24 15:29:27 -07002714 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS);
2715 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE);
2716 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE);
2717 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE);
2718 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI);
2719 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING);
2720 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED);
2721 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED);
2722 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_DENSITY_FORCED);
2723 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED);
2724 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE);
2725 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE);
2726 MOVED_TO_GLOBAL.add(Settings.Global.INSTALL_NON_MARKET_APPS);
2727 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA);
2728 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION);
2729 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE);
2730 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES);
2731 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE);
2732 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED);
2733 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES);
2734 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL);
2735 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_REPORT_XT_OVER_DEV);
2736 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED);
2737 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE);
2738 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION);
2739 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE);
2740 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES);
2741 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE);
2742 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION);
2743 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE);
2744 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES);
2745 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE);
2746 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE);
2747 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF);
2748 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING);
2749 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER);
2750 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT);
2751 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT);
2752 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS);
2753 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT);
2754 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS);
2755 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT);
2756 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS);
2757 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL);
2758 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST);
2759 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL);
2760 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN);
2761 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED);
2762 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED);
Christopher Tate06efb532012-08-24 15:29:27 -07002763 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED);
2764 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL);
2765 MOVED_TO_GLOBAL.add(Settings.Global.WEB_AUTOFILL_QUERY_URL);
2766 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE);
2767 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS);
2768 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND);
2769 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS);
2770 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT);
2771 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS);
2772 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON);
2773 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY);
2774 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT);
2775 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON);
2776 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME);
2777 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE);
2778 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS);
2779 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07002780 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON);
2781 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED);
Christopher Tate06efb532012-08-24 15:29:27 -07002782 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON);
Christopher Tatec868b642012-09-12 17:41:04 -07002783 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE);
2784 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT);
2785 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE);
2786 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS);
2787 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS);
2788 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS);
Christopher Tate06efb532012-08-24 15:29:27 -07002789 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL);
Jeff Sharkey625239a2012-09-26 22:03:49 -07002790 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD);
2791 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD);
2792 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR);
2793 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS);
2794 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES);
2795 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB);
2796 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT);
2797 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT);
2798 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX);
2799 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX);
2800 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL);
2801 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD);
2802 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE);
2803 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES);
2804 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES);
2805 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS);
2806 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY);
2807 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED);
2808 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER);
2809 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON);
2810 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION);
2811 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION);
2812 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY);
2813 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY);
2814 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT);
2815 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY);
2816 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST);
2817 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT);
2818 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
2819 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
2820 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07002821 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
Christopher Tate06efb532012-08-24 15:29:27 -07002822 }
2823
Christopher Tate66488d62012-10-02 11:58:01 -07002824 /** @hide */
2825 public static void getMovedKeys(HashSet<String> outKeySet) {
2826 outKeySet.addAll(MOVED_TO_GLOBAL);
2827 }
2828
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002829 /**
2830 * Look up a name in the database.
2831 * @param resolver to access the database with
2832 * @param name to look up in the table
2833 * @return the corresponding value, or null if not present
2834 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07002835 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07002836 return getStringForUser(resolver, name, UserHandle.myUserId());
2837 }
2838
2839 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07002840 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07002841 int userHandle) {
2842 if (MOVED_TO_GLOBAL.contains(name)) {
2843 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
2844 + " to android.provider.Settings.Global.");
2845 return Global.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002846 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07002847
Dianne Hackborn139748f2012-09-24 11:36:57 -07002848 if (MOVED_TO_LOCK_SETTINGS.contains(name)) {
2849 synchronized (Secure.class) {
2850 if (sLockSettings == null) {
2851 sLockSettings = ILockSettings.Stub.asInterface(
2852 (IBinder) ServiceManager.getService("lock_settings"));
2853 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID;
2854 }
2855 }
2856 if (sLockSettings != null && !sIsSystemProcess) {
2857 try {
2858 return sLockSettings.getString(name, "0", userHandle);
2859 } catch (RemoteException re) {
2860 // Fall through
2861 }
Amith Yamasani52c489c2012-03-28 11:42:42 -07002862 }
2863 }
2864
Christopher Tate06efb532012-08-24 15:29:27 -07002865 return sNameValueCache.getStringForUser(resolver, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002866 }
2867
2868 /**
2869 * Store a name/value pair into the database.
2870 * @param resolver to access the database with
2871 * @param name to store
2872 * @param value to associate with the name
2873 * @return true if the value was set, false on database errors
2874 */
Christopher Tate06efb532012-08-24 15:29:27 -07002875 public static boolean putString(ContentResolver resolver, String name, String value) {
2876 return putStringForUser(resolver, name, value, UserHandle.myUserId());
2877 }
2878
2879 /** @hide */
2880 public static boolean putStringForUser(ContentResolver resolver, String name, String value,
2881 int userHandle) {
2882 if (MOVED_TO_GLOBAL.contains(name)) {
2883 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
2884 + " to android.provider.Settings.Global");
2885 return Global.putStringForUser(resolver, name, value, userHandle);
2886 }
Christopher Tate06efb532012-08-24 15:29:27 -07002887 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002888 }
2889
2890 /**
2891 * Construct the content URI for a particular name/value pair,
2892 * useful for monitoring changes with a ContentObserver.
2893 * @param name to look up in the table
2894 * @return the corresponding content URI, or null if not present
2895 */
2896 public static Uri getUriFor(String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07002897 if (MOVED_TO_GLOBAL.contains(name)) {
2898 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure"
2899 + " to android.provider.Settings.Global, returning global URI.");
2900 return Global.getUriFor(Global.CONTENT_URI, name);
2901 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002902 return getUriFor(CONTENT_URI, name);
2903 }
2904
2905 /**
2906 * Convenience function for retrieving a single secure settings value
2907 * as an integer. Note that internally setting values are always
2908 * stored as strings; this function converts the string to an integer
2909 * for you. The default value will be returned if the setting is
2910 * not defined or not an integer.
2911 *
2912 * @param cr The ContentResolver to access.
2913 * @param name The name of the setting to retrieve.
2914 * @param def Value to return if the setting is not defined.
2915 *
2916 * @return The setting's current value, or 'def' if it is not defined
2917 * or not a valid integer.
2918 */
2919 public static int getInt(ContentResolver cr, String name, int def) {
Christopher Tate06efb532012-08-24 15:29:27 -07002920 return getIntForUser(cr, name, def, UserHandle.myUserId());
2921 }
2922
2923 /** @hide */
2924 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07002925 if (LOCATION_MODE.equals(name)) {
2926 // HACK ALERT: temporary hack to work around b/10491283.
2927 // TODO: once b/10491283 fixed, remove this hack
2928 return getLocationModeForUser(cr, userHandle);
2929 }
Christopher Tate06efb532012-08-24 15:29:27 -07002930 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002931 try {
2932 return v != null ? Integer.parseInt(v) : def;
2933 } catch (NumberFormatException e) {
2934 return def;
2935 }
2936 }
2937
2938 /**
2939 * Convenience function for retrieving a single secure settings value
2940 * as an integer. Note that internally setting values are always
2941 * stored as strings; this function converts the string to an integer
2942 * for you.
2943 * <p>
2944 * This version does not take a default value. If the setting has not
2945 * been set, or the string value is not a number,
2946 * it throws {@link SettingNotFoundException}.
2947 *
2948 * @param cr The ContentResolver to access.
2949 * @param name The name of the setting to retrieve.
2950 *
2951 * @throws SettingNotFoundException Thrown if a setting by the given
2952 * name can't be found or the setting value is not an integer.
2953 *
2954 * @return The setting's current value.
2955 */
2956 public static int getInt(ContentResolver cr, String name)
2957 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07002958 return getIntForUser(cr, name, UserHandle.myUserId());
2959 }
2960
2961 /** @hide */
2962 public static int getIntForUser(ContentResolver cr, String name, int userHandle)
2963 throws SettingNotFoundException {
Tom O'Neill7f6f4572013-08-27 10:53:15 -07002964 if (LOCATION_MODE.equals(name)) {
2965 // HACK ALERT: temporary hack to work around b/10491283.
2966 // TODO: once b/10491283 fixed, remove this hack
2967 return getLocationModeForUser(cr, userHandle);
2968 }
Christopher Tate06efb532012-08-24 15:29:27 -07002969 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002970 try {
2971 return Integer.parseInt(v);
2972 } catch (NumberFormatException e) {
2973 throw new SettingNotFoundException(name);
2974 }
2975 }
2976
2977 /**
2978 * Convenience function for updating a single settings value as an
2979 * integer. This will either create a new entry in the table if the
2980 * given name does not exist, or modify the value of the existing row
2981 * with that name. Note that internally setting values are always
2982 * stored as strings, so this function converts the given value to a
2983 * string before storing it.
2984 *
2985 * @param cr The ContentResolver to access.
2986 * @param name The name of the setting to modify.
2987 * @param value The new value for the setting.
2988 * @return true if the value was set, false on database errors
2989 */
2990 public static boolean putInt(ContentResolver cr, String name, int value) {
Christopher Tate06efb532012-08-24 15:29:27 -07002991 return putIntForUser(cr, name, value, UserHandle.myUserId());
2992 }
2993
2994 /** @hide */
2995 public static boolean putIntForUser(ContentResolver cr, String name, int value,
2996 int userHandle) {
Tom O'Neilla324ac72013-08-26 14:40:23 -07002997 if (LOCATION_MODE.equals(name)) {
2998 // HACK ALERT: temporary hack to work around b/10491283.
2999 // TODO: once b/10491283 fixed, remove this hack
3000 return setLocationModeForUser(cr, value, userHandle);
3001 }
Christopher Tate06efb532012-08-24 15:29:27 -07003002 return putStringForUser(cr, name, Integer.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003003 }
3004
3005 /**
3006 * Convenience function for retrieving a single secure settings value
3007 * as a {@code long}. Note that internally setting values are always
3008 * stored as strings; this function converts the string to a {@code long}
3009 * for you. The default value will be returned if the setting is
3010 * not defined or not a {@code long}.
3011 *
3012 * @param cr The ContentResolver to access.
3013 * @param name The name of the setting to retrieve.
3014 * @param def Value to return if the setting is not defined.
3015 *
3016 * @return The setting's current value, or 'def' if it is not defined
3017 * or not a valid {@code long}.
3018 */
3019 public static long getLong(ContentResolver cr, String name, long def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003020 return getLongForUser(cr, name, def, UserHandle.myUserId());
3021 }
3022
3023 /** @hide */
3024 public static long getLongForUser(ContentResolver cr, String name, long def,
3025 int userHandle) {
3026 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003027 long value;
3028 try {
3029 value = valString != null ? Long.parseLong(valString) : def;
3030 } catch (NumberFormatException e) {
3031 value = def;
3032 }
3033 return value;
3034 }
3035
3036 /**
3037 * Convenience function for retrieving a single secure settings value
3038 * as a {@code long}. Note that internally setting values are always
3039 * stored as strings; this function converts the string to a {@code long}
3040 * for you.
3041 * <p>
3042 * This version does not take a default value. If the setting has not
3043 * been set, or the string value is not a number,
3044 * it throws {@link SettingNotFoundException}.
3045 *
3046 * @param cr The ContentResolver to access.
3047 * @param name The name of the setting to retrieve.
3048 *
3049 * @return The setting's current value.
3050 * @throws SettingNotFoundException Thrown if a setting by the given
3051 * name can't be found or the setting value is not an integer.
3052 */
3053 public static long getLong(ContentResolver cr, String name)
3054 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003055 return getLongForUser(cr, name, UserHandle.myUserId());
3056 }
3057
3058 /** @hide */
3059 public static long getLongForUser(ContentResolver cr, String name, int userHandle)
3060 throws SettingNotFoundException {
3061 String valString = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003062 try {
3063 return Long.parseLong(valString);
3064 } catch (NumberFormatException e) {
3065 throw new SettingNotFoundException(name);
3066 }
3067 }
3068
3069 /**
3070 * Convenience function for updating a secure settings value as a long
3071 * integer. This will either create a new entry in the table if the
3072 * given name does not exist, or modify the value of the existing row
3073 * with that name. Note that internally setting values are always
3074 * stored as strings, so this function converts the given value to a
3075 * string before storing it.
3076 *
3077 * @param cr The ContentResolver to access.
3078 * @param name The name of the setting to modify.
3079 * @param value The new value for the setting.
3080 * @return true if the value was set, false on database errors
3081 */
3082 public static boolean putLong(ContentResolver cr, String name, long value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003083 return putLongForUser(cr, name, value, UserHandle.myUserId());
3084 }
3085
3086 /** @hide */
3087 public static boolean putLongForUser(ContentResolver cr, String name, long value,
3088 int userHandle) {
3089 return putStringForUser(cr, name, Long.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003090 }
3091
3092 /**
3093 * Convenience function for retrieving a single secure settings value
3094 * as a floating point number. Note that internally setting values are
3095 * always stored as strings; this function converts the string to an
3096 * float for you. The default value will be returned if the setting
3097 * is not defined or not a valid float.
3098 *
3099 * @param cr The ContentResolver to access.
3100 * @param name The name of the setting to retrieve.
3101 * @param def Value to return if the setting is not defined.
3102 *
3103 * @return The setting's current value, or 'def' if it is not defined
3104 * or not a valid float.
3105 */
3106 public static float getFloat(ContentResolver cr, String name, float def) {
Christopher Tate06efb532012-08-24 15:29:27 -07003107 return getFloatForUser(cr, name, def, UserHandle.myUserId());
3108 }
3109
3110 /** @hide */
3111 public static float getFloatForUser(ContentResolver cr, String name, float def,
3112 int userHandle) {
3113 String v = getStringForUser(cr, name, userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003114 try {
3115 return v != null ? Float.parseFloat(v) : def;
3116 } catch (NumberFormatException e) {
3117 return def;
3118 }
3119 }
3120
3121 /**
3122 * Convenience function for retrieving a single secure settings value
3123 * as a float. Note that internally setting values are always
3124 * stored as strings; this function converts the string to a float
3125 * for you.
3126 * <p>
3127 * This version does not take a default value. If the setting has not
3128 * been set, or the string value is not a number,
3129 * it throws {@link SettingNotFoundException}.
3130 *
3131 * @param cr The ContentResolver to access.
3132 * @param name The name of the setting to retrieve.
3133 *
3134 * @throws SettingNotFoundException Thrown if a setting by the given
3135 * name can't be found or the setting value is not a float.
3136 *
3137 * @return The setting's current value.
3138 */
3139 public static float getFloat(ContentResolver cr, String name)
3140 throws SettingNotFoundException {
Christopher Tate06efb532012-08-24 15:29:27 -07003141 return getFloatForUser(cr, name, UserHandle.myUserId());
3142 }
3143
3144 /** @hide */
3145 public static float getFloatForUser(ContentResolver cr, String name, int userHandle)
3146 throws SettingNotFoundException {
3147 String v = getStringForUser(cr, name, userHandle);
Brian Muramatsue1d46982010-12-06 17:34:20 -08003148 if (v == null) {
3149 throw new SettingNotFoundException(name);
3150 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003151 try {
3152 return Float.parseFloat(v);
3153 } catch (NumberFormatException e) {
3154 throw new SettingNotFoundException(name);
3155 }
3156 }
3157
3158 /**
3159 * Convenience function for updating a single settings value as a
3160 * floating point number. This will either create a new entry in the
3161 * table if the given name does not exist, or modify the value of the
3162 * existing row with that name. Note that internally setting values
3163 * are always stored as strings, so this function converts the given
3164 * value to a string before storing it.
3165 *
3166 * @param cr The ContentResolver to access.
3167 * @param name The name of the setting to modify.
3168 * @param value The new value for the setting.
3169 * @return true if the value was set, false on database errors
3170 */
3171 public static boolean putFloat(ContentResolver cr, String name, float value) {
Christopher Tate06efb532012-08-24 15:29:27 -07003172 return putFloatForUser(cr, name, value, UserHandle.myUserId());
3173 }
3174
3175 /** @hide */
3176 public static boolean putFloatForUser(ContentResolver cr, String name, float value,
3177 int userHandle) {
3178 return putStringForUser(cr, name, Float.toString(value), userHandle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003179 }
3180
3181 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003182 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED}
3183 * instead
Dianne Hackborn895f99e2012-02-02 11:49:12 -08003184 */
Christopher Tate06efb532012-08-24 15:29:27 -07003185 @Deprecated
3186 public static final String DEVELOPMENT_SETTINGS_ENABLED =
3187 Global.DEVELOPMENT_SETTINGS_ENABLED;
Dianne Hackborn895f99e2012-02-02 11:49:12 -08003188
3189 /**
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003190 * When the user has enable the option to have a "bug report" command
3191 * in the power menu.
Christopher Tate58f41ec2013-01-11 15:40:36 -08003192 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003193 * @hide
3194 */
Christopher Tate58f41ec2013-01-11 15:40:36 -08003195 @Deprecated
Dianne Hackborn5773bfdb2012-07-13 13:24:15 -07003196 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
3197
3198 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003199 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003200 */
Christopher Tate06efb532012-08-24 15:29:27 -07003201 @Deprecated
3202 public static final String ADB_ENABLED = Global.ADB_ENABLED;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003203
3204 /**
3205 * Setting to allow mock locations and location provider status to be injected into the
3206 * LocationManager service for testing purposes during application development. These
3207 * locations and status values override actual location and status information generated
3208 * by network, gps, or other location providers.
3209 */
3210 public static final String ALLOW_MOCK_LOCATION = "mock_location";
3211
3212 /**
Doug Zongkerd8893db2010-01-26 12:29:44 -08003213 * A 64-bit number (as a hex string) that is randomly
3214 * generated on the device's first boot and should remain
3215 * constant for the lifetime of the device. (The value may
3216 * change if a factory reset is performed on the device.)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003217 */
3218 public static final String ANDROID_ID = "android_id";
3219
3220 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003221 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003222 */
Christopher Tate06efb532012-08-24 15:29:27 -07003223 @Deprecated
3224 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003225
3226 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003227 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003228 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07003229 @Deprecated
Christopher Tate06efb532012-08-24 15:29:27 -07003230 public static final String DATA_ROAMING = Global.DATA_ROAMING;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003231
3232 /**
3233 * Setting to record the input method used by default, holding the ID
3234 * of the desired method.
3235 */
3236 public static final String DEFAULT_INPUT_METHOD = "default_input_method";
3237
3238 /**
satokab751aa2010-09-14 19:17:36 +09003239 * Setting to record the input method subtype used by default, holding the ID
3240 * of the desired method.
3241 */
3242 public static final String SELECTED_INPUT_METHOD_SUBTYPE =
3243 "selected_input_method_subtype";
3244
3245 /**
satok723a27e2010-11-11 14:58:11 +09003246 * Setting to record the history of input method subtype, holding the pair of ID of IME
3247 * and its last used subtype.
3248 * @hide
3249 */
3250 public static final String INPUT_METHODS_SUBTYPE_HISTORY =
3251 "input_methods_subtype_history";
3252
3253 /**
satok5c58dfc2010-12-14 21:54:47 +09003254 * Setting to record the visibility of input method selector
3255 */
3256 public static final String INPUT_METHOD_SELECTOR_VISIBILITY =
3257 "input_method_selector_visibility";
3258
3259 /**
Zhihai Xuaf5971e2013-06-10 20:28:31 -07003260 * bluetooth HCI snoop log configuration
3261 * @hide
3262 */
3263 public static final String BLUETOOTH_HCI_LOG =
3264 "bluetooth_hci_log";
3265
3266 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003267 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003268 */
Christopher Tate06efb532012-08-24 15:29:27 -07003269 @Deprecated
3270 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003271
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003272 /**
Russell Brennerde6ae442012-09-26 20:53:10 -07003273 * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
3274 * @hide
3275 */
3276 public static final String USER_SETUP_COMPLETE = "user_setup_complete";
3277
3278 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003279 * List of input methods that are currently enabled. This is a string
3280 * containing the IDs of all enabled input methods, each ID separated
3281 * by ':'.
3282 */
3283 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003284
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003285 /**
Amith Yamasanie861ec12010-03-24 21:39:27 -07003286 * List of system input methods that are currently disabled. This is a string
3287 * containing the IDs of all disabled input methods, each ID separated
3288 * by ':'.
3289 * @hide
3290 */
3291 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods";
3292
3293 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003294 * Host name and port for global http proxy. Uses ':' seperator for
3295 * between host and port.
3296 *
3297 * @deprecated Use {@link Global#HTTP_PROXY}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003298 */
Jeff Sharkey625239a2012-09-26 22:03:49 -07003299 @Deprecated
3300 public static final String HTTP_PROXY = Global.HTTP_PROXY;
Robert Greenwalte90aa5e2010-09-01 11:34:05 -07003301
3302 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003303 * @deprecated Use {@link android.provider.Settings.Global#INSTALL_NON_MARKET_APPS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003304 */
Christopher Tate06efb532012-08-24 15:29:27 -07003305 @Deprecated
3306 public static final String INSTALL_NON_MARKET_APPS = Global.INSTALL_NON_MARKET_APPS;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003307
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003308 /**
3309 * Comma-separated list of location providers that activities may access.
Tom O'Neilla324ac72013-08-26 14:40:23 -07003310 *
3311 * @deprecated use {@link #LOCATION_MODE}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003312 */
Tom O'Neilla324ac72013-08-26 14:40:23 -07003313 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003314 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003315
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003316 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003317 * The degree of location access enabled by the user.
3318 * <p/>
3319 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link
3320 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link
3321 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link
3322 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location
3323 * modes that might be added in the future.
Tom O'Neilla324ac72013-08-26 14:40:23 -07003324 */
3325 public static final String LOCATION_MODE = "location_mode";
3326
3327 /**
Tom O'Neill7f6f4572013-08-27 10:53:15 -07003328 * Location access disabled.
Tom O'Neill1f48b782013-08-19 18:14:56 -07003329 */
3330 public static final int LOCATION_MODE_OFF = 0;
3331 /**
3332 * Network Location Provider disabled, but GPS and other sensors enabled.
3333 */
3334 public static final int LOCATION_MODE_SENSORS_ONLY = 1;
3335 /**
3336 * Reduced power usage, such as limiting the number of GPS updates per hour.
3337 */
3338 public static final int LOCATION_MODE_BATTERY_SAVING = 2;
3339 /**
3340 * Best-effort location computation allowed.
3341 */
3342 public static final int LOCATION_MODE_HIGH_ACCURACY = 3;
3343
3344 /**
Danielle Millett925a7d82012-03-19 18:02:20 -04003345 * A flag containing settings used for biometric weak
3346 * @hide
3347 */
3348 public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
3349 "lock_biometric_weak_flags";
3350
3351 /**
Amith Yamasani156c4352010-03-05 17:10:03 -08003352 * Whether autolock is enabled (0 = false, 1 = true)
3353 */
3354 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
3355
3356 /**
3357 * Whether lock pattern is visible as user enters (0 = false, 1 = true)
3358 */
3359 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
3360
3361 /**
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07003362 * Whether lock pattern will vibrate as user enters (0 = false, 1 =
3363 * true)
3364 *
3365 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the
3366 * lockscreen uses
3367 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}.
Amith Yamasani156c4352010-03-05 17:10:03 -08003368 */
Jeff Sharkey5ed9d682012-10-10 14:28:27 -07003369 @Deprecated
3370 public static final String
3371 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
Amith Yamasani156c4352010-03-05 17:10:03 -08003372
3373 /**
Jim Millerbc4603b2010-08-30 21:21:34 -07003374 * This preference allows the device to be locked given time after screen goes off,
3375 * subject to current DeviceAdmin policy limits.
3376 * @hide
3377 */
3378 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout";
3379
3380
3381 /**
John Spurlock5f050e52012-10-27 10:44:19 -04003382 * This preference contains the string that shows for owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07003383 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07003384 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07003385 */
3386 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
3387
3388 /**
John Spurlock5f050e52012-10-27 10:44:19 -04003389 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited).
Jim Millerf229e4d2012-09-12 20:32:50 -07003390 * @hide
3391 */
Michael Jurkaaa2859a2012-10-24 12:46:49 -07003392 public static final String LOCK_SCREEN_APPWIDGET_IDS =
3393 "lock_screen_appwidget_ids";
Jim Millerf229e4d2012-09-12 20:32:50 -07003394
3395 /**
Jim Miller51117262012-11-04 17:58:09 -08003396 * Id of the appwidget shown on the lock screen when appwidgets are disabled.
3397 * @hide
3398 */
3399 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID =
3400 "lock_screen_fallback_appwidget_id";
3401
3402 /**
John Spurlock5f050e52012-10-27 10:44:19 -04003403 * Index of the lockscreen appwidget to restore, -1 if none.
3404 * @hide
3405 */
3406 public static final String LOCK_SCREEN_STICKY_APPWIDGET =
3407 "lock_screen_sticky_appwidget";
3408
3409 /**
3410 * This preference enables showing the owner info on LockScreen.
Jim Miller253a5ef2010-10-13 20:57:29 -07003411 * @hide
Jim Miller187ec582013-04-15 18:27:54 -07003412 * @deprecated
Jim Miller253a5ef2010-10-13 20:57:29 -07003413 */
3414 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
3415 "lock_screen_owner_info_enabled";
3416
3417 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003418 * The Logging ID (a unique 64-bit value) as a hex string.
3419 * Used as a pseudonymous identifier for logging.
3420 * @deprecated This identifier is poorly initialized and has
3421 * many collisions. It should not be used.
3422 */
3423 @Deprecated
3424 public static final String LOGGING_ID = "logging_id";
3425
3426 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003427 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003428 */
Christopher Tate06efb532012-08-24 15:29:27 -07003429 @Deprecated
3430 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003431
3432 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08003433 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003434 */
3435 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003436
3437 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08003438 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003439 */
3440 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003441
3442 /**
Dan Egnor1c9131c2010-02-13 10:38:55 -08003443 * No longer supported.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003444 */
3445 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003446
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003447 /**
3448 * Settings classname to launch when Settings is clicked from All
3449 * Applications. Needed because of user testing between the old
3450 * and new Settings apps.
3451 */
3452 // TODO: 881807
3453 public static final String SETTINGS_CLASSNAME = "settings_classname";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003454
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003455 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003456 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003457 */
Christopher Tate06efb532012-08-24 15:29:27 -07003458 @Deprecated
3459 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003460
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003461 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003462 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003463 */
Christopher Tate06efb532012-08-24 15:29:27 -07003464 @Deprecated
3465 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003466
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003467 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07003468 * If accessibility is enabled.
3469 */
3470 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled";
3471
3472 /**
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07003473 * If touch exploration is enabled.
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07003474 */
Svetoslav Ganov00aabf72011-07-21 11:35:03 -07003475 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled";
Svetoslav Ganov35bfede2011-07-14 17:57:06 -07003476
3477 /**
svetoslavganov75986cf2009-05-14 22:28:01 -07003478 * List of the enabled accessibility providers.
3479 */
3480 public static final String ENABLED_ACCESSIBILITY_SERVICES =
3481 "enabled_accessibility_services";
3482
3483 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07003484 * List of the accessibility services to which the user has granted
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07003485 * permission to put the device into touch exploration mode.
3486 *
3487 * @hide
3488 */
3489 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES =
3490 "touch_exploration_granted_accessibility_services";
3491
3492 /**
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08003493 * Whether to speak passwords while in accessibility mode.
3494 */
3495 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password";
3496
3497 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003498 * If injection of accessibility enhancing JavaScript screen-reader
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003499 * is enabled.
3500 * <p>
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003501 * Note: The JavaScript based screen-reader is served by the
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003502 * Google infrastructure and enable users with disabilities to
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07003503 * efficiently navigate in and explore web content.
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003504 * </p>
3505 * <p>
3506 * This property represents a boolean value.
3507 * </p>
3508 * @hide
3509 */
3510 public static final String ACCESSIBILITY_SCRIPT_INJECTION =
3511 "accessibility_script_injection";
3512
3513 /**
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003514 * The URL for the injected JavaScript based screen-reader used
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07003515 * for providing accessibility of content in WebView.
Svetoslav Ganov3ca5a742011-12-06 15:24:37 -08003516 * <p>
3517 * Note: The JavaScript based screen-reader is served by the
3518 * Google infrastructure and enable users with disabilities to
3519 * efficiently navigate in and explore web content.
3520 * </p>
3521 * <p>
3522 * This property represents a string value.
3523 * </p>
3524 * @hide
3525 */
3526 public static final String ACCESSIBILITY_SCREEN_READER_URL =
3527 "accessibility_script_injection_url";
3528
3529 /**
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07003530 * Key bindings for navigation in built-in accessibility support for web content.
3531 * <p>
3532 * Note: These key bindings are for the built-in accessibility navigation for
3533 * web content which is used as a fall back solution if JavaScript in a WebView
3534 * is not enabled or the user has not opted-in script injection from Google.
3535 * </p>
3536 * <p>
3537 * The bindings are separated by semi-colon. A binding is a mapping from
3538 * a key to a sequence of actions (for more details look at
3539 * android.webkit.AccessibilityInjector). A key is represented as the hexademical
3540 * string representation of an integer obtained from a meta state (optional) shifted
3541 * sixteen times left and bitwise ored with a key code. An action is represented
3542 * as a hexademical string representation of an integer where the first two digits
3543 * are navigation action index, the second, the third, and the fourth digit pairs
3544 * represent the action arguments. The separate actions in a binding are colon
3545 * separated. The key and the action sequence it maps to are separated by equals.
3546 * </p>
3547 * <p>
3548 * For example, the binding below maps the DPAD right button to traverse the
3549 * current navigation axis once without firing an accessibility event and to
3550 * perform the same traversal again but to fire an event:
3551 * <code>
3552 * 0x16=0x01000100:0x01000101;
3553 * </code>
3554 * </p>
3555 * <p>
3556 * The goal of this binding is to enable dynamic rebinding of keys to
3557 * navigation actions for web content without requiring a framework change.
3558 * </p>
3559 * <p>
3560 * This property represents a string value.
3561 * </p>
3562 * @hide
3563 */
3564 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS =
3565 "accessibility_web_content_key_bindings";
3566
3567 /**
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07003568 * Setting that specifies whether the display magnification is enabled.
3569 * Display magnifications allows the user to zoom in the display content
3570 * and is targeted to low vision users. The current magnification scale
3571 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}.
3572 *
3573 * @hide
3574 */
3575 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED =
3576 "accessibility_display_magnification_enabled";
3577
3578 /**
3579 * Setting that specifies what the display magnification scale is.
3580 * Display magnifications allows the user to zoom in the display
3581 * content and is targeted to low vision users. Whether a display
3582 * magnification is performed is controlled by
3583 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
3584 *
3585 * @hide
3586 */
3587 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE =
3588 "accessibility_display_magnification_scale";
3589
3590 /**
3591 * Setting that specifies whether the display magnification should be
3592 * automatically updated. If this fearture is enabled the system will
3593 * exit magnification mode or pan the viewport when a context change
3594 * occurs. For example, on staring a new activity or rotating the screen,
3595 * the system may zoom out so the user can see the new context he is in.
3596 * Another example is on showing a window that is not visible in the
3597 * magnified viewport the system may pan the viewport to make the window
3598 * the has popped up so the user knows that the context has changed.
3599 * Whether a screen magnification is performed is controlled by
3600 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED}
3601 *
3602 * @hide
3603 */
3604 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE =
3605 "accessibility_display_magnification_auto_update";
3606
3607 /**
Alan Viveretteef793802013-07-23 14:15:28 -07003608 * Setting that specifies whether timed text (captions) should be
3609 * displayed in video content. Text display properties are controlled by
3610 * the following settings:
3611 * <ul>
3612 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE}
3613 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR}
3614 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR}
3615 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR}
3616 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE}
3617 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE}
Alan Viverette69ce69b2013-08-29 12:23:48 -07003618 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE}
Alan Viveretteef793802013-07-23 14:15:28 -07003619 * </ul>
3620 *
3621 * @hide
3622 */
3623 public static final String ACCESSIBILITY_CAPTIONING_ENABLED =
3624 "accessibility_captioning_enabled";
3625
3626 /**
3627 * Setting that specifies the language for captions as a locale string,
3628 * e.g. en_US.
3629 *
3630 * @see java.util.Locale#toString
3631 * @hide
3632 */
3633 public static final String ACCESSIBILITY_CAPTIONING_LOCALE =
3634 "accessibility_captioning_locale";
3635
3636 /**
Alan Viverette43a1e3d2013-08-02 16:45:03 -07003637 * Integer property that specifies the preset style for captions, one
3638 * of:
3639 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07003640 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM}
3641 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS}
Alan Viverette43a1e3d2013-08-02 16:45:03 -07003642 * </ul>
3643 *
3644 * @see java.util.Locale#toString
3645 * @hide
3646 */
3647 public static final String ACCESSIBILITY_CAPTIONING_PRESET =
3648 "accessibility_captioning_preset";
3649
3650 /**
Alan Viveretteef793802013-07-23 14:15:28 -07003651 * Integer property that specifes the background color for captions as a
3652 * packed 32-bit color.
3653 *
3654 * @see android.graphics.Color#argb
3655 * @hide
3656 */
3657 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR =
3658 "accessibility_captioning_background_color";
3659
3660 /**
3661 * Integer property that specifes the foreground color for captions as a
3662 * packed 32-bit color.
3663 *
3664 * @see android.graphics.Color#argb
3665 * @hide
3666 */
3667 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR =
3668 "accessibility_captioning_foreground_color";
3669
3670 /**
3671 * Integer property that specifes the edge type for captions, one of:
3672 * <ul>
Alan Viverette69ce69b2013-08-29 12:23:48 -07003673 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE}
3674 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE}
3675 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW}
Alan Viveretteef793802013-07-23 14:15:28 -07003676 * </ul>
3677 *
3678 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR
3679 * @hide
3680 */
3681 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE =
3682 "accessibility_captioning_edge_type";
3683
3684 /**
3685 * Integer property that specifes the edge color for captions as a
3686 * packed 32-bit color.
3687 *
3688 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE
3689 * @see android.graphics.Color#argb
3690 * @hide
3691 */
3692 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR =
3693 "accessibility_captioning_edge_color";
3694
3695 /**
3696 * String property that specifies the typeface for captions, one of:
3697 * <ul>
3698 * <li>DEFAULT
3699 * <li>MONOSPACE
3700 * <li>SANS_SERIF
3701 * <li>SERIF
3702 * </ul>
3703 *
3704 * @see android.graphics.Typeface
3705 * @hide
3706 */
3707 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE =
3708 "accessibility_captioning_typeface";
3709
3710 /**
Alan Viverette69ce69b2013-08-29 12:23:48 -07003711 * Floating point property that specifies font scaling for captions.
Alan Viveretteef793802013-07-23 14:15:28 -07003712 *
3713 * @hide
3714 */
Alan Viverette69ce69b2013-08-29 12:23:48 -07003715 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE =
3716 "accessibility_captioning_font_scale";
Alan Viveretteef793802013-07-23 14:15:28 -07003717
3718 /**
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08003719 * The timout for considering a press to be a long press in milliseconds.
3720 * @hide
3721 */
3722 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
3723
3724 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07003725 * List of the enabled print services.
Svetoslav Ganov4b9a4d12013-06-11 15:20:06 -07003726 * @hide
3727 */
3728 public static final String ENABLED_PRINT_SERVICES =
3729 "enabled_print_services";
3730
3731 /**
Svetoslav Ganov6bd20bc2013-09-02 15:24:45 -07003732 * List of the system print services we enabled on first boot. On
3733 * first boot we enable all system, i.e. bundled print services,
3734 * once, so they work out-of-the-box.
3735 * @hide
3736 */
3737 public static final String ENABLED_ON_FIRST_BOOT_SYSTEM_PRINT_SERVICES =
3738 "enabled_on_first_boot_system_print_services";
3739
3740 /**
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07003741 * Setting to always use the default text-to-speech settings regardless
3742 * of the application settings.
3743 * 1 = override application settings,
3744 * 0 = use application settings (if specified).
Narayan Kamath6d632962011-08-24 11:51:37 +01003745 *
3746 * @deprecated The value of this setting is no longer respected by
3747 * the framework text to speech APIs as of the Ice Cream Sandwich release.
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07003748 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003749 @Deprecated
Jean-Michel Trivif62ba452009-06-04 14:55:24 -07003750 public static final String TTS_USE_DEFAULTS = "tts_use_defaults";
3751
3752 /**
3753 * Default text-to-speech engine speech rate. 100 = 1x
3754 */
3755 public static final String TTS_DEFAULT_RATE = "tts_default_rate";
3756
3757 /**
3758 * Default text-to-speech engine pitch. 100 = 1x
3759 */
3760 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch";
3761
3762 /**
3763 * Default text-to-speech engine.
3764 */
3765 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth";
3766
3767 /**
Jean-Michel Trivif4782672009-06-09 16:22:48 -07003768 * Default text-to-speech language.
Narayan Kamath6d632962011-08-24 11:51:37 +01003769 *
3770 * @deprecated this setting is no longer in use, as of the Ice Cream
3771 * Sandwich release. Apps should never need to read this setting directly,
3772 * instead can query the TextToSpeech framework classes for the default
3773 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivif4782672009-06-09 16:22:48 -07003774 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003775 @Deprecated
Jean-Michel Trivif4782672009-06-09 16:22:48 -07003776 public static final String TTS_DEFAULT_LANG = "tts_default_lang";
3777
3778 /**
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003779 * Default text-to-speech country.
Narayan Kamath6d632962011-08-24 11:51:37 +01003780 *
3781 * @deprecated this setting is no longer in use, as of the Ice Cream
3782 * Sandwich release. Apps should never need to read this setting directly,
3783 * instead can query the TextToSpeech framework classes for the default
3784 * locale. {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003785 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003786 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003787 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country";
3788
3789 /**
3790 * Default text-to-speech locale variant.
Narayan Kamath6d632962011-08-24 11:51:37 +01003791 *
3792 * @deprecated this setting is no longer in use, as of the Ice Cream
3793 * Sandwich release. Apps should never need to read this setting directly,
3794 * instead can query the TextToSpeech framework classes for the
3795 * locale that is in use {@link TextToSpeech#getLanguage()}.
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003796 */
Narayan Kamath6d632962011-08-24 11:51:37 +01003797 @Deprecated
Jean-Michel Trivia6fcc952009-06-19 14:06:01 -07003798 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant";
3799
3800 /**
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01003801 * Stores the default tts locales on a per engine basis. Stored as
3802 * a comma seperated list of values, each value being of the form
3803 * {@code engine_name:locale} for example,
Narayan Kamath6d632962011-08-24 11:51:37 +01003804 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This
3805 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and
3806 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this
3807 * setting directly, and can query the TextToSpeech framework classes
3808 * for the locale that is in use.
Narayan Kamathe5b8c4d2011-08-22 15:37:47 +01003809 *
3810 * @hide
3811 */
3812 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale";
3813
3814 /**
Charles Chenceffa152010-03-16 21:18:10 -07003815 * Space delimited list of plugin packages that are enabled.
3816 */
3817 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins";
3818
3819 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003820 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON}
3821 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003822 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003823 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003824 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003825 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003826
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003827 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003828 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY}
3829 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003830 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003831 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003832 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003833 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003834
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003835 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003836 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT}
3837 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003838 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003839 @Deprecated
3840 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT =
3841 Global.WIFI_NUM_OPEN_NETWORKS_KEPT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003842
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003843 /**
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003844 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON}
3845 * instead.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003846 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07003847 @Deprecated
3848 public static final String WIFI_ON = Global.WIFI_ON;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003849
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003850 /**
3851 * The acceptable packet loss percentage (range 0 - 100) before trying
3852 * another AP on the same network.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003853 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003854 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003855 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003856 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE =
3857 "wifi_watchdog_acceptable_packet_loss_percentage";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003858
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003859 /**
3860 * The number of access points required for a network in order for the
3861 * watchdog to monitor it.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003862 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003863 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003864 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003865 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003866
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003867 /**
3868 * The delay between background checks.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003869 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003870 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003871 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003872 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS =
3873 "wifi_watchdog_background_check_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003874
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003875 /**
3876 * Whether the Wi-Fi watchdog is enabled for background checking even
3877 * after it thinks the user has connected to a good access point.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003878 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003879 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003880 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003881 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED =
3882 "wifi_watchdog_background_check_enabled";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003883
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003884 /**
3885 * The timeout for a background ping
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003886 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003887 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003888 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003889 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS =
3890 "wifi_watchdog_background_check_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003891
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003892 /**
3893 * The number of initial pings to perform that *may* be ignored if they
3894 * fail. Again, if these fail, they will *not* be used in packet loss
3895 * calculation. For example, one network always seemed to time out for
3896 * the first couple pings, so this is set to 3 by default.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003897 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003898 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003899 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003900 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT =
3901 "wifi_watchdog_initial_ignored_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003902
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003903 /**
3904 * The maximum number of access points (per network) to attempt to test.
3905 * If this number is reached, the watchdog will no longer monitor the
3906 * initial connection state for the network. This is a safeguard for
3907 * networks containing multiple APs whose DNS does not respond to pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003908 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003909 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003910 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003911 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003912
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003913 /**
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07003914 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003915 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07003916 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003917 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
3918
3919 /**
3920 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003921 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003922 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003923 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003924 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list";
3925
3926 /**
3927 * The number of pings to test if an access point is a good connection.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003928 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003929 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003930 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003931 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003932
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003933 /**
3934 * The delay between pings.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003935 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003936 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003937 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003938 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003939
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003940 /**
3941 * The timeout per ping.
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003942 * @deprecated This setting is not used.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003943 */
Isaac Levyd7b3e6a2011-07-20 18:15:30 -07003944 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003945 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms";
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003946
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003947 /**
Christopher Tate06efb532012-08-24 15:29:27 -07003948 * @deprecated Use
3949 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003950 */
Christopher Tate06efb532012-08-24 15:29:27 -07003951 @Deprecated
3952 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT;
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07003953
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003954 /**
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003955 * @deprecated Use
3956 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003957 */
Jeff Sharkeybdfce2e2012-09-26 15:54:06 -07003958 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003959 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
Jeff Brownbf6f6f92012-09-25 15:03:20 -07003960 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003961
3962 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07003963 * Whether background data usage is allowed.
3964 *
3965 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH},
3966 * availability of background data depends on several
3967 * combined factors. When background data is unavailable,
3968 * {@link ConnectivityManager#getActiveNetworkInfo()} will
3969 * now appear disconnected.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003970 */
Jeff Sharkey3a844fc2011-08-16 14:37:57 -07003971 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003972 public static final String BACKGROUND_DATA = "background_data";
Wink Saville04e71b32009-04-02 11:00:54 -07003973
3974 /**
Bjorn Bringert98bfa392010-03-24 10:59:48 +00003975 * Origins for which browsers should allow geolocation by default.
3976 * The value is a space-separated list of origins.
3977 */
3978 public static final String ALLOWED_GEOLOCATION_ORIGINS
3979 = "allowed_geolocation_origins";
3980
3981 /**
Wink Savillee9b06d72009-05-18 21:47:50 -07003982 * The preferred TTY mode 0 = TTy Off, CDMA default
3983 * 1 = TTY Full
3984 * 2 = TTY HCO
3985 * 3 = TTY VCO
3986 * @hide
3987 */
3988 public static final String PREFERRED_TTY_MODE =
3989 "preferred_tty_mode";
3990
Wink Saville04e71b32009-04-02 11:00:54 -07003991 /**
Wink Saville04e71b32009-04-02 11:00:54 -07003992 * Whether the enhanced voice privacy mode is enabled.
3993 * 0 = normal voice privacy
3994 * 1 = enhanced voice privacy
3995 * @hide
3996 */
3997 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
3998
3999 /**
4000 * Whether the TTY mode mode is enabled.
4001 * 0 = disabled
4002 * 1 = enabled
4003 * @hide
4004 */
4005 public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004006
4007 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07004008 * Controls whether settings backup is enabled.
Dianne Hackborncf098292009-07-01 19:55:20 -07004009 * Type: int ( 0 = disabled, 1 = enabled )
4010 * @hide
4011 */
4012 public static final String BACKUP_ENABLED = "backup_enabled";
4013
4014 /**
Christopher Tatecce9da52010-02-03 15:11:15 -08004015 * Controls whether application data is automatically restored from backup
4016 * at install time.
4017 * Type: int ( 0 = disabled, 1 = enabled )
4018 * @hide
4019 */
4020 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore";
4021
4022 /**
Christopher Tate8031a3d2009-07-06 16:36:05 -07004023 * Indicates whether settings backup has been fully provisioned.
4024 * Type: int ( 0 = unprovisioned, 1 = fully provisioned )
4025 * @hide
4026 */
4027 public static final String BACKUP_PROVISIONED = "backup_provisioned";
4028
4029 /**
Dianne Hackborncf098292009-07-01 19:55:20 -07004030 * Component of the transport to use for backup/restore.
4031 * @hide
4032 */
4033 public static final String BACKUP_TRANSPORT = "backup_transport";
Sanjay Jeyakumar21bf2412009-07-09 13:31:48 -07004034
Dianne Hackbornd7cd29d2009-07-01 11:22:45 -07004035 /**
4036 * Version for which the setup wizard was last shown. Bumped for
4037 * each release when there is new setup information to show.
4038 * @hide
4039 */
4040 public static final String LAST_SETUP_SHOWN = "last_setup_shown";
Dianne Hackborncf098292009-07-01 19:55:20 -07004041
4042 /**
Doug Zongker43866e02010-01-07 12:09:54 -08004043 * The interval in milliseconds after which Wi-Fi is considered idle.
4044 * When idle, it is possible for the device to be switched from Wi-Fi to
4045 * the mobile data network.
4046 * @hide
Jeff Brownbf6f6f92012-09-25 15:03:20 -07004047 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS}
4048 * instead.
Doug Zongker43866e02010-01-07 12:09:54 -08004049 */
Christopher Tate6f5a9a92012-09-14 17:24:28 -07004050 @Deprecated
4051 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS;
Doug Zongker43866e02010-01-07 12:09:54 -08004052
4053 /**
Narayan Kamathee69ff42011-06-28 12:07:18 +01004054 * The global search provider chosen by the user (if multiple global
4055 * search providers are installed). This will be the provider returned
4056 * by {@link SearchManager#getGlobalSearchActivity()} if it's still
4057 * installed. This setting is stored as a flattened component name as
4058 * per {@link ComponentName#flattenToString()}.
4059 *
4060 * @hide
4061 */
4062 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY =
4063 "search_global_search_activity";
4064
4065 /**
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08004066 * The number of promoted sources in GlobalSearch.
4067 * @hide
4068 */
4069 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
4070 /**
4071 * The maximum number of suggestions returned by GlobalSearch.
4072 * @hide
4073 */
4074 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
4075 /**
4076 * The number of suggestions GlobalSearch will ask each non-web search source for.
4077 * @hide
4078 */
4079 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
4080 /**
4081 * The number of suggestions the GlobalSearch will ask the web search source for.
4082 * @hide
4083 */
4084 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
4085 "search_web_results_override_limit";
4086 /**
4087 * The number of milliseconds that GlobalSearch will wait for suggestions from
4088 * promoted sources before continuing with all other sources.
4089 * @hide
4090 */
4091 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
4092 "search_promoted_source_deadline_millis";
4093 /**
4094 * The number of milliseconds before GlobalSearch aborts search suggesiton queries.
4095 * @hide
4096 */
4097 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
4098 /**
4099 * The maximum number of milliseconds that GlobalSearch shows the previous results
4100 * after receiving a new query.
4101 * @hide
4102 */
4103 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
4104 /**
4105 * The maximum age of log data used for shortcuts in GlobalSearch.
4106 * @hide
4107 */
4108 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
4109 /**
4110 * The maximum age of log data used for source ranking in GlobalSearch.
4111 * @hide
4112 */
4113 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
4114 "search_max_source_event_age_millis";
4115 /**
4116 * The minimum number of impressions needed to rank a source in GlobalSearch.
4117 * @hide
4118 */
4119 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
4120 "search_min_impressions_for_source_ranking";
4121 /**
4122 * The minimum number of clicks needed to rank a source in GlobalSearch.
4123 * @hide
4124 */
4125 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
4126 "search_min_clicks_for_source_ranking";
4127 /**
4128 * The maximum number of shortcuts shown by GlobalSearch.
4129 * @hide
4130 */
4131 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
4132 /**
4133 * The size of the core thread pool for suggestion queries in GlobalSearch.
4134 * @hide
4135 */
4136 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
4137 "search_query_thread_core_pool_size";
4138 /**
4139 * The maximum size of the thread pool for suggestion queries in GlobalSearch.
4140 * @hide
4141 */
4142 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
4143 "search_query_thread_max_pool_size";
4144 /**
4145 * The size of the core thread pool for shortcut refreshing in GlobalSearch.
4146 * @hide
4147 */
4148 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
4149 "search_shortcut_refresh_core_pool_size";
4150 /**
4151 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
4152 * @hide
4153 */
4154 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
4155 "search_shortcut_refresh_max_pool_size";
4156 /**
4157 * The maximun time that excess threads in the GlobalSeach thread pools will
4158 * wait before terminating.
4159 * @hide
4160 */
4161 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
4162 "search_thread_keepalive_seconds";
4163 /**
4164 * The maximum number of concurrent suggestion queries to each source.
4165 * @hide
4166 */
4167 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
4168 "search_per_source_concurrent_query_limit";
4169
San Mehat87734d32010-01-08 12:53:06 -08004170 /**
4171 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true)
4172 * @hide
4173 */
4174 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd";
4175
4176 /**
4177 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
4178 * @hide
4179 */
4180 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
4181
4182 /**
4183 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true)
4184 * @hide
4185 */
4186 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt";
4187
4188 /**
4189 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true)
4190 * @hide
4191 */
4192 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled";
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08004193
Dan Egnor42471dd2010-01-07 17:25:22 -08004194 /**
4195 * If nonzero, ANRs in invisible background processes bring up a dialog.
4196 * Otherwise, the process will be silently killed.
4197 * @hide
4198 */
4199 public static final String ANR_SHOW_BACKGROUND = "anr_show_background";
Erikeebc8e22010-02-18 13:27:19 -08004200
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08004201 /**
4202 * The {@link ComponentName} string of the service to be used as the voice recognition
4203 * service.
Erikeebc8e22010-02-18 13:27:19 -08004204 *
Mike LeBeau5d34e9b2010-02-10 19:34:56 -08004205 * @hide
4206 */
4207 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
Dan Egnor42471dd2010-01-07 17:25:22 -08004208
William Luh623a4282013-06-24 12:14:18 -07004209 /**
4210 * Stores whether an user has consented to have apps verified through PAM.
4211 * The value is boolean (1 or 0).
4212 *
4213 * @hide
4214 */
4215 public static final String PACKAGE_VERIFIER_USER_CONSENT =
4216 "package_verifier_user_consent";
satok988323c2011-06-22 16:38:13 +09004217
4218 /**
satokada8c4e2011-08-23 14:56:56 +09004219 * The {@link ComponentName} string of the selected spell checker service which is
4220 * one of the services managed by the text service manager.
4221 *
4222 * @hide
4223 */
4224 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
4225
4226 /**
4227 * The {@link ComponentName} string of the selected subtype of the selected spell checker
satok988323c2011-06-22 16:38:13 +09004228 * service which is one of the services managed by the text service manager.
4229 *
4230 * @hide
4231 */
satokada8c4e2011-08-23 14:56:56 +09004232 public static final String SELECTED_SPELL_CHECKER_SUBTYPE =
4233 "selected_spell_checker_subtype";
satok988323c2011-06-22 16:38:13 +09004234
Doug Zongkeraed8f8e2010-01-07 18:07:50 -08004235 /**
satoka33c4fc2011-08-25 16:50:11 +09004236 * The {@link ComponentName} string whether spell checker is enabled or not.
4237 *
4238 * @hide
4239 */
4240 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled";
4241
4242 /**
David Brown458e8062010-03-08 21:52:11 -08004243 * What happens when the user presses the Power button while in-call
4244 * and the screen is on.<br/>
4245 * <b>Values:</b><br/>
4246 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
4247 * 2 - The Power button hangs up the current call.<br/>
4248 *
4249 * @hide
4250 */
4251 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
4252
4253 /**
4254 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
4255 * @hide
4256 */
4257 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
4258
4259 /**
4260 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
4261 * @hide
4262 */
4263 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
4264
4265 /**
4266 * INCALL_POWER_BUTTON_BEHAVIOR default value.
4267 * @hide
4268 */
4269 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
4270 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
4271
4272 /**
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07004273 * The current night mode that has been selected by the user. Owned
4274 * and controlled by UiModeManagerService. Constants are as per
4275 * UiModeManager.
4276 * @hide
4277 */
4278 public static final String UI_NIGHT_MODE = "ui_night_mode";
Suchi Amalapurapu40e47252010-04-07 16:15:50 -07004279
4280 /**
John Spurlock1a868b72012-08-22 09:56:51 -04004281 * Whether screensavers are enabled.
Daniel Sandler0601eb72011-04-13 01:01:32 -04004282 * @hide
4283 */
Daniel Sandler2d545362011-11-17 10:38:37 -08004284 public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
Daniel Sandler0601eb72011-04-13 01:01:32 -04004285
4286 /**
John Spurlock1a868b72012-08-22 09:56:51 -04004287 * The user's chosen screensaver components.
Daniel Sandler2d545362011-11-17 10:38:37 -08004288 *
John Spurlock1a868b72012-08-22 09:56:51 -04004289 * These will be launched by the PhoneWindowManager after a timeout when not on
Daniel Sandler2d545362011-11-17 10:38:37 -08004290 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
Daniel Sandler0601eb72011-04-13 01:01:32 -04004291 * @hide
4292 */
John Spurlock1a868b72012-08-22 09:56:51 -04004293 public static final String SCREENSAVER_COMPONENTS = "screensaver_components";
Daniel Sandler2d545362011-11-17 10:38:37 -08004294
4295 /**
John Spurlock1a868b72012-08-22 09:56:51 -04004296 * If screensavers are enabled, whether the screensaver should be automatically launched
4297 * when the device is inserted into a (desk) dock.
Daniel Sandler2d545362011-11-17 10:38:37 -08004298 * @hide
4299 */
4300 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
Daniel Sandler0601eb72011-04-13 01:01:32 -04004301
John Spurlock1a868b72012-08-22 09:56:51 -04004302 /**
4303 * If screensavers are enabled, whether the screensaver should be automatically launched
4304 * when the screen times out when not on battery.
4305 * @hide
4306 */
4307 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep";
4308
4309 /**
4310 * If screensavers are enabled, the default screensaver component.
4311 * @hide
4312 */
4313 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component";
4314
Daniel Sandler0601eb72011-04-13 01:01:32 -04004315 /**
Martijn Coenena7397882013-07-30 20:07:47 -07004316 * The default NFC payment component
4317 * @hide
4318 */
4319 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
4320
4321 /**
Daniel Sandler4b749ef2013-03-18 21:53:04 -04004322 * Name of a package that the current user has explicitly allowed to see all of that
4323 * user's notifications.
4324 *
4325 * @hide
4326 */
4327 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
4328
John Spurlock5c454122013-06-17 07:35:46 -04004329 /** @hide */
4330 public static final String BAR_SERVICE_COMPONENT = "bar_service_component";
4331
Yorke Lee647f8f32013-05-07 10:49:44 -07004332 /**
Svetoslav Ganova571a582011-09-20 18:32:20 -07004333 * This are the settings to be backed up.
4334 *
4335 * NOTE: Settings are backed up and restored in the order they appear
4336 * in this array. If you have one setting depending on another,
4337 * make sure that they are ordered appropriately.
4338 *
-b master501eec92009-07-06 13:53:11 -07004339 * @hide
4340 */
4341 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08004342 BUGREPORT_IN_POWER_MENU, // moved to global
Amith Yamasani8823c0a82009-07-07 14:30:17 -07004343 ALLOW_MOCK_LOCATION,
-b master501eec92009-07-06 13:53:11 -07004344 PARENTAL_CONTROL_ENABLED,
4345 PARENTAL_CONTROL_REDIRECT_URL,
Christopher Tate66488d62012-10-02 11:58:01 -07004346 USB_MASS_STORAGE_ENABLED, // moved to global
Svetoslav Ganov1cf70bb2012-08-06 10:53:34 -07004347 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
4348 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
4349 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
Svetoslav Ganov585f13f8d2010-08-10 07:59:15 -07004350 ACCESSIBILITY_SCRIPT_INJECTION,
Christopher Tate14c2d792010-02-25 16:49:44 -08004351 BACKUP_AUTO_RESTORE,
-b master501eec92009-07-06 13:53:11 -07004352 ENABLED_ACCESSIBILITY_SERVICES,
Svetoslav Ganov9a4c5cd2012-05-30 14:06:32 -07004353 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES,
Svetoslav Ganova28a16d2011-07-28 11:24:21 -07004354 TOUCH_EXPLORATION_ENABLED,
Svetoslav Ganova571a582011-09-20 18:32:20 -07004355 ACCESSIBILITY_ENABLED,
Svetoslav Ganov55f937a2011-12-05 11:42:07 -08004356 ACCESSIBILITY_SPEAK_PASSWORD,
Alan Viveretteef793802013-07-23 14:15:28 -07004357 ACCESSIBILITY_CAPTIONING_ENABLED,
4358 ACCESSIBILITY_CAPTIONING_LOCALE,
4359 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR,
4360 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR,
4361 ACCESSIBILITY_CAPTIONING_EDGE_TYPE,
4362 ACCESSIBILITY_CAPTIONING_EDGE_COLOR,
4363 ACCESSIBILITY_CAPTIONING_TYPEFACE,
Alan Viverette69ce69b2013-08-29 12:23:48 -07004364 ACCESSIBILITY_CAPTIONING_FONT_SCALE,
-b master501eec92009-07-06 13:53:11 -07004365 TTS_USE_DEFAULTS,
4366 TTS_DEFAULT_RATE,
4367 TTS_DEFAULT_PITCH,
4368 TTS_DEFAULT_SYNTH,
4369 TTS_DEFAULT_LANG,
4370 TTS_DEFAULT_COUNTRY,
Charles Chenceffa152010-03-16 21:18:10 -07004371 TTS_ENABLED_PLUGINS,
Narayan Kamath6d632962011-08-24 11:51:37 +01004372 TTS_DEFAULT_LOCALE,
Christopher Tate66488d62012-10-02 11:58:01 -07004373 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
4374 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
4375 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
San Mehat87734d32010-01-08 12:53:06 -08004376 MOUNT_PLAY_NOTIFICATION_SND,
4377 MOUNT_UMS_AUTOSTART,
4378 MOUNT_UMS_PROMPT,
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07004379 MOUNT_UMS_NOTIFY_ENABLED,
Yorke Lee35785bf2013-08-21 19:16:20 -07004380 UI_NIGHT_MODE
-b master501eec92009-07-06 13:53:11 -07004381 };
4382
4383 /**
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004384 * Helper method for determining if a location provider is enabled.
4385 * @param cr the content resolver to use
4386 * @param provider the location provider to query
4387 * @return true if the provider is enabled
Tom O'Neilla324ac72013-08-26 14:40:23 -07004388 * @deprecated use {@link #getInt(ContentResolver, String)} and {@link #LOCATION_MODE}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004389 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07004390 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004391 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
Victoria Leaseb711d572012-10-02 13:14:11 -07004392 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId());
4393 }
4394
4395 /**
4396 * Helper method for determining if a location provider is enabled.
4397 * @param cr the content resolver to use
4398 * @param provider the location provider to query
4399 * @param userId the userId to query
4400 * @return true if the provider is enabled
Tom O'Neilla324ac72013-08-26 14:40:23 -07004401 * @deprecated use {@link #getIntForUser(ContentResolver, String, int, int)} and
4402 * {@link #LOCATION_MODE}
Victoria Leaseb711d572012-10-02 13:14:11 -07004403 * @hide
4404 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07004405 @Deprecated
Victoria Leaseb711d572012-10-02 13:14:11 -07004406 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) {
4407 String allowedProviders = Settings.Secure.getStringForUser(cr,
4408 LOCATION_PROVIDERS_ALLOWED, userId);
Brad Fitzpatrick11fe1812010-09-10 16:07:52 -07004409 return TextUtils.delimitedStringContains(allowedProviders, ',', provider);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004410 }
4411
4412 /**
4413 * Thread-safe method for enabling or disabling a single location provider.
4414 * @param cr the content resolver to use
4415 * @param provider the location provider to enable or disable
4416 * @param enabled true if the provider should be enabled
Tom O'Neilla324ac72013-08-26 14:40:23 -07004417 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE}
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004418 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07004419 @Deprecated
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004420 public static final void setLocationProviderEnabled(ContentResolver cr,
4421 String provider, boolean enabled) {
Victoria Leaseb711d572012-10-02 13:14:11 -07004422 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId());
4423 }
4424
4425 /**
4426 * Thread-safe method for enabling or disabling a single location provider.
Tom O'Neilla324ac72013-08-26 14:40:23 -07004427 *
Victoria Leaseb711d572012-10-02 13:14:11 -07004428 * @param cr the content resolver to use
4429 * @param provider the location provider to enable or disable
4430 * @param enabled true if the provider should be enabled
4431 * @param userId the userId for which to enable/disable providers
Tom O'Neilla324ac72013-08-26 14:40:23 -07004432 * @return true if the value was set, false on database errors
4433 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and
4434 * {@link #LOCATION_MODE}
Victoria Leaseb711d572012-10-02 13:14:11 -07004435 * @hide
4436 */
Tom O'Neill1f48b782013-08-19 18:14:56 -07004437 @Deprecated
Tom O'Neilla324ac72013-08-26 14:40:23 -07004438 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr,
Victoria Leaseb711d572012-10-02 13:14:11 -07004439 String provider, boolean enabled, int userId) {
David Christie3f7b6522013-08-06 19:19:08 -07004440 synchronized (mLocationSettingsLock) {
4441 // to ensure thread safety, we write the provider name with a '+' or '-'
4442 // and let the SettingsProvider handle it rather than reading and modifying
4443 // the list of enabled providers.
4444 if (enabled) {
4445 provider = "+" + provider;
4446 } else {
4447 provider = "-" + provider;
4448 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07004449 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider,
David Christie3f7b6522013-08-06 19:19:08 -07004450 userId);
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004451 }
Mike Lockwoodbd2a7122009-04-02 23:41:33 -07004452 }
Tom O'Neill1f48b782013-08-19 18:14:56 -07004453
4454 /**
4455 * Thread-safe method for setting the location mode to one of
4456 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
4457 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
4458 *
Tom O'Neill1f48b782013-08-19 18:14:56 -07004459 * @param cr the content resolver to use
4460 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY}
4461 * @param userId the userId for which to change mode
Tom O'Neilla324ac72013-08-26 14:40:23 -07004462 * @return true if the value was set, false on database errors
Tom O'Neill1f48b782013-08-19 18:14:56 -07004463 *
4464 * @throws IllegalArgumentException if mode is not one of the supported values
4465 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004466 private static final boolean setLocationModeForUser(ContentResolver cr, int mode,
4467 int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07004468 synchronized (mLocationSettingsLock) {
4469 boolean gps = false;
4470 boolean network = false;
4471 switch (mode) {
4472 case LOCATION_MODE_OFF:
4473 break;
4474 case LOCATION_MODE_SENSORS_ONLY:
4475 gps = true;
4476 break;
4477 case LOCATION_MODE_BATTERY_SAVING:
4478 network = true;
4479 break;
4480 case LOCATION_MODE_HIGH_ACCURACY:
4481 gps = true;
4482 network = true;
4483 break;
4484 default:
4485 throw new IllegalArgumentException("Invalid location mode: " + mode);
4486 }
Tom O'Neilla324ac72013-08-26 14:40:23 -07004487 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07004488 cr, LocationManager.GPS_PROVIDER, gps, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07004489 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser(
Tom O'Neill1f48b782013-08-19 18:14:56 -07004490 cr, LocationManager.NETWORK_PROVIDER, network, userId);
Tom O'Neilla324ac72013-08-26 14:40:23 -07004491 return gpsSuccess && nlpSuccess;
Tom O'Neill1f48b782013-08-19 18:14:56 -07004492 }
4493 }
4494
4495 /**
Tom O'Neill1f48b782013-08-19 18:14:56 -07004496 * Thread-safe method for reading the location mode, returns one of
4497 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY},
4498 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}.
4499 *
4500 * @param cr the content resolver to use
4501 * @param userId the userId for which to read the mode
4502 * @return the location mode
4503 */
Tom O'Neill7f6f4572013-08-27 10:53:15 -07004504 private static final int getLocationModeForUser(ContentResolver cr, int userId) {
Tom O'Neill1f48b782013-08-19 18:14:56 -07004505 synchronized (mLocationSettingsLock) {
4506 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser(
4507 cr, LocationManager.GPS_PROVIDER, userId);
4508 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser(
4509 cr, LocationManager.NETWORK_PROVIDER, userId);
4510 if (gpsEnabled && networkEnabled) {
4511 return LOCATION_MODE_HIGH_ACCURACY;
4512 } else if (gpsEnabled) {
4513 return LOCATION_MODE_SENSORS_ONLY;
4514 } else if (networkEnabled) {
4515 return LOCATION_MODE_BATTERY_SAVING;
4516 } else {
4517 return LOCATION_MODE_OFF;
4518 }
4519 }
4520 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004521 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07004522
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004523 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004524 * Global system settings, containing preferences that always apply identically
4525 * to all defined users. Applications can read these but are not allowed to write;
4526 * like the "Secure" settings, these are for preferences that the user must
4527 * explicitly modify through the system UI or specialized APIs for those values.
4528 */
4529 public static final class Global extends NameValueTable {
4530 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_global_version";
4531
4532 /**
4533 * The content:// style URL for global secure settings items. Not public.
4534 */
4535 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
4536
4537 /**
Svetoslav Ganov7befb7d2012-09-27 16:49:23 -07004538 * Setting whether the global gesture for enabling accessibility is enabled.
4539 * If this gesture is enabled the user will be able to perfrom it to enable
4540 * the accessibility state without visiting the settings app.
4541 * @hide
4542 */
4543 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED =
4544 "enable_accessibility_global_gesture_enabled";
4545
4546 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004547 * Whether Airplane Mode is on.
4548 */
4549 public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
4550
4551 /**
4552 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
4553 */
4554 public static final String RADIO_BLUETOOTH = "bluetooth";
4555
4556 /**
4557 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
4558 */
4559 public static final String RADIO_WIFI = "wifi";
4560
4561 /**
4562 * {@hide}
4563 */
4564 public static final String RADIO_WIMAX = "wimax";
4565 /**
4566 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
4567 */
4568 public static final String RADIO_CELL = "cell";
4569
4570 /**
4571 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
4572 */
4573 public static final String RADIO_NFC = "nfc";
4574
4575 /**
4576 * A comma separated list of radios that need to be disabled when airplane mode
4577 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are
4578 * included in the comma separated list.
4579 */
4580 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios";
4581
4582 /**
4583 * A comma separated list of radios that should to be disabled when airplane mode
4584 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is
4585 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi
4586 * will be turned off when entering airplane mode, but the user will be able to reenable
4587 * Wifi in the Settings app.
4588 *
4589 * {@hide}
4590 */
4591 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
4592
4593 /**
4594 * The policy for deciding when Wi-Fi should go to sleep (which will in
4595 * turn switch to using the mobile data as an Internet connection).
4596 * <p>
4597 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT},
4598 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or
4599 * {@link #WIFI_SLEEP_POLICY_NEVER}.
4600 */
4601 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy";
4602
4603 /**
4604 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep
4605 * policy, which is to sleep shortly after the turning off
4606 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting.
4607 */
4608 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0;
4609
4610 /**
4611 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when
4612 * the device is on battery, and never go to sleep when the device is
4613 * plugged in.
4614 */
4615 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1;
4616
4617 /**
4618 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep.
4619 */
4620 public static final int WIFI_SLEEP_POLICY_NEVER = 2;
4621
4622 /**
4623 * Value to specify if the user prefers the date, time and time zone
4624 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
4625 */
4626 public static final String AUTO_TIME = "auto_time";
4627
4628 /**
4629 * Value to specify if the user prefers the time zone
4630 * to be automatically fetched from the network (NITZ). 1=yes, 0=no
4631 */
4632 public static final String AUTO_TIME_ZONE = "auto_time_zone";
4633
4634 /**
4635 * URI for the car dock "in" event sound.
4636 * @hide
4637 */
4638 public static final String CAR_DOCK_SOUND = "car_dock_sound";
4639
4640 /**
4641 * URI for the car dock "out" event sound.
4642 * @hide
4643 */
4644 public static final String CAR_UNDOCK_SOUND = "car_undock_sound";
4645
4646 /**
4647 * URI for the desk dock "in" event sound.
4648 * @hide
4649 */
4650 public static final String DESK_DOCK_SOUND = "desk_dock_sound";
4651
4652 /**
4653 * URI for the desk dock "out" event sound.
4654 * @hide
4655 */
4656 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound";
4657
4658 /**
4659 * Whether to play a sound for dock events.
4660 * @hide
4661 */
4662 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled";
4663
4664 /**
4665 * URI for the "device locked" (keyguard shown) sound.
4666 * @hide
4667 */
4668 public static final String LOCK_SOUND = "lock_sound";
4669
4670 /**
4671 * URI for the "device unlocked" sound.
4672 * @hide
4673 */
4674 public static final String UNLOCK_SOUND = "unlock_sound";
4675
4676 /**
4677 * URI for the low battery sound file.
4678 * @hide
4679 */
4680 public static final String LOW_BATTERY_SOUND = "low_battery_sound";
4681
4682 /**
4683 * Whether to play a sound for low-battery alerts.
4684 * @hide
4685 */
4686 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled";
4687
4688 /**
Jeff Brown84e27562012-12-07 13:56:34 -08004689 * URI for the "wireless charging started" sound.
4690 * @hide
4691 */
4692 public static final String WIRELESS_CHARGING_STARTED_SOUND =
4693 "wireless_charging_started_sound";
4694
4695 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004696 * Whether we keep the device on while the device is plugged in.
4697 * Supported values are:
4698 * <ul>
4699 * <li>{@code 0} to never stay on while plugged in</li>
4700 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li>
4701 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li>
4702 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li>
4703 * </ul>
4704 * These values can be OR-ed together.
4705 */
4706 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
4707
4708 /**
Christopher Tate58f41ec2013-01-11 15:40:36 -08004709 * When the user has enable the option to have a "bug report" command
4710 * in the power menu.
4711 * @hide
4712 */
4713 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
4714
4715 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004716 * Whether ADB is enabled.
4717 */
4718 public static final String ADB_ENABLED = "adb_enabled";
4719
4720 /**
4721 * Whether assisted GPS should be enabled or not.
4722 * @hide
4723 */
4724 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled";
4725
4726 /**
4727 * Whether bluetooth is enabled/disabled
4728 * 0=disabled. 1=enabled.
4729 */
4730 public static final String BLUETOOTH_ON = "bluetooth_on";
4731
4732 /**
4733 * CDMA Cell Broadcast SMS
4734 * 0 = CDMA Cell Broadcast SMS disabled
4735 * 1 = CDMA Cell Broadcast SMS enabled
4736 * @hide
4737 */
4738 public static final String CDMA_CELL_BROADCAST_SMS =
4739 "cdma_cell_broadcast_sms";
4740
4741 /**
4742 * The CDMA roaming mode 0 = Home Networks, CDMA default
4743 * 1 = Roaming on Affiliated networks
4744 * 2 = Roaming on any networks
4745 * @hide
4746 */
4747 public static final String CDMA_ROAMING_MODE = "roaming_settings";
4748
4749 /**
4750 * The CDMA subscription mode 0 = RUIM/SIM (default)
4751 * 1 = NV
4752 * @hide
4753 */
4754 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
4755
4756 /** Inactivity timeout to track mobile data activity.
4757 *
4758 * If set to a positive integer, it indicates the inactivity timeout value in seconds to
4759 * infer the data activity of mobile network. After a period of no activity on mobile
4760 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE}
4761 * intent is fired to indicate a transition of network status from "active" to "idle". Any
4762 * subsequent activity on mobile networks triggers the firing of {@code
4763 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active".
4764 *
4765 * Network activity refers to transmitting or receiving data on the network interfaces.
4766 *
4767 * Tracking is disabled if set to zero or negative value.
4768 *
4769 * @hide
4770 */
4771 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile";
4772
4773 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE}
4774 * but for Wifi network.
4775 * @hide
4776 */
4777 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi";
4778
4779 /**
4780 * Whether or not data roaming is enabled. (0 = false, 1 = true)
4781 */
4782 public static final String DATA_ROAMING = "data_roaming";
4783
4784 /**
Wink Saville75c1e692013-03-20 17:06:50 -07004785 * The value passed to a Mobile DataConnection via bringUp which defines the
4786 * number of retries to preform when setting up the initial connection. The default
4787 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1.
4788 * @hide
4789 */
4790 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry";
4791
4792 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004793 * Whether user has enabled development settings.
4794 */
4795 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled";
4796
4797 /**
4798 * Whether the device has been provisioned (0 = false, 1 = true)
4799 */
4800 public static final String DEVICE_PROVISIONED = "device_provisioned";
4801
4802 /**
4803 * The saved value for WindowManagerService.setForcedDisplayDensity().
4804 * One integer in dpi. If unset, then use the real display density.
4805 * @hide
4806 */
4807 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced";
4808
4809 /**
4810 * The saved value for WindowManagerService.setForcedDisplaySize().
4811 * Two integers separated by a comma. If unset, then use the real display size.
4812 * @hide
4813 */
4814 public static final String DISPLAY_SIZE_FORCED = "display_size_forced";
4815
4816 /**
4817 * The maximum size, in bytes, of a download that the download manager will transfer over
4818 * a non-wifi connection.
4819 * @hide
4820 */
4821 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE =
4822 "download_manager_max_bytes_over_mobile";
4823
4824 /**
4825 * The recommended maximum size, in bytes, of a download that the download manager should
4826 * transfer over a non-wifi connection. Over this size, the use will be warned, but will
4827 * have the option to start the download over the mobile connection anyway.
4828 * @hide
4829 */
4830 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE =
4831 "download_manager_recommended_max_bytes_over_mobile";
4832
4833 /**
4834 * Whether the package installer should allow installation of apps downloaded from
4835 * sources other than Google Play.
4836 *
4837 * 1 = allow installing from other sources
4838 * 0 = only allow installing from Google Play
4839 */
4840 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
4841
4842 /**
4843 * Whether mobile data connections are allowed by the user. See
4844 * ConnectivityManager for more info.
4845 * @hide
4846 */
4847 public static final String MOBILE_DATA = "mobile_data";
4848
4849 /** {@hide} */
4850 public static final String NETSTATS_ENABLED = "netstats_enabled";
4851 /** {@hide} */
4852 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval";
4853 /** {@hide} */
4854 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age";
4855 /** {@hide} */
4856 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes";
4857 /** {@hide} */
4858 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled";
4859 /** {@hide} */
4860 public static final String NETSTATS_REPORT_XT_OVER_DEV = "netstats_report_xt_over_dev";
4861
4862 /** {@hide} */
4863 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration";
4864 /** {@hide} */
4865 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes";
4866 /** {@hide} */
4867 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age";
4868 /** {@hide} */
4869 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age";
4870
4871 /** {@hide} */
4872 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration";
4873 /** {@hide} */
4874 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes";
4875 /** {@hide} */
4876 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age";
4877 /** {@hide} */
4878 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age";
4879
4880 /** {@hide} */
4881 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration";
4882 /** {@hide} */
4883 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes";
4884 /** {@hide} */
4885 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age";
4886 /** {@hide} */
4887 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age";
4888
4889 /**
4890 * User preference for which network(s) should be used. Only the
4891 * connectivity service should touch this.
4892 */
4893 public static final String NETWORK_PREFERENCE = "network_preference";
4894
4895 /**
4896 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
4897 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
4898 * exceeded.
4899 * @hide
4900 */
4901 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
4902
4903 /**
4904 * The length of time in milli-seconds that automatic small adjustments to
4905 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
4906 * @hide
4907 */
4908 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
4909
4910 /** Preferred NTP server. {@hide} */
4911 public static final String NTP_SERVER = "ntp_server";
4912 /** Timeout in milliseconds to wait for NTP server. {@hide} */
4913 public static final String NTP_TIMEOUT = "ntp_timeout";
4914
4915 /**
rich cannings4d8fc792012-09-07 14:43:43 -07004916 * Whether the package manager should send package verification broadcasts for verifiers to
4917 * review apps prior to installation.
4918 * 1 = request apps to be verified prior to installation, if a verifier exists.
4919 * 0 = do not verify apps before installation
rich cannings4e5753f2012-09-19 16:03:56 -07004920 * @hide
rich cannings4d8fc792012-09-07 14:43:43 -07004921 */
4922 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable";
4923
4924 /** Timeout for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07004925 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07004926 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout";
4927
4928 /** Default response code for package verification.
rich cannings4e5753f2012-09-19 16:03:56 -07004929 * @hide */
rich cannings4d8fc792012-09-07 14:43:43 -07004930 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response";
4931
rich cannings4e5753f2012-09-19 16:03:56 -07004932 /**
4933 * Show package verification setting in the Settings app.
rich canningse6686b32012-09-16 14:02:20 -07004934 * 1 = show (default)
4935 * 0 = hide
rich cannings4e5753f2012-09-19 16:03:56 -07004936 * @hide
rich canningse6686b32012-09-16 14:02:20 -07004937 */
4938 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible";
4939
rich cannings4d8fc792012-09-07 14:43:43 -07004940 /**
rich cannings4e5753f2012-09-19 16:03:56 -07004941 * Run package verificaiton on apps installed through ADB/ADT/USB
4942 * 1 = perform package verification on ADB installs (default)
4943 * 0 = bypass package verification on ADB installs
4944 * @hide
4945 */
4946 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
4947
4948 /**
Christopher Tate06efb532012-08-24 15:29:27 -07004949 * The interval in milliseconds at which to check packet counts on the
4950 * mobile data interface when screen is on, to detect possible data
4951 * connection problems.
4952 * @hide
4953 */
4954 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
4955 "pdp_watchdog_poll_interval_ms";
4956
4957 /**
4958 * The interval in milliseconds at which to check packet counts on the
4959 * mobile data interface when screen is off, to detect possible data
4960 * connection problems.
4961 * @hide
4962 */
4963 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
4964 "pdp_watchdog_long_poll_interval_ms";
4965
4966 /**
4967 * The interval in milliseconds at which to check packet counts on the
4968 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
4969 * outgoing packets has been reached without incoming packets.
4970 * @hide
4971 */
4972 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
4973 "pdp_watchdog_error_poll_interval_ms";
4974
4975 /**
4976 * The number of outgoing packets sent without seeing an incoming packet
4977 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
4978 * device is logged to the event log
4979 * @hide
4980 */
4981 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
4982 "pdp_watchdog_trigger_packet_count";
4983
4984 /**
4985 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
4986 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
4987 * attempting data connection recovery.
4988 * @hide
4989 */
4990 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
4991 "pdp_watchdog_error_poll_count";
4992
4993 /**
4994 * The number of failed PDP reset attempts before moving to something more
4995 * drastic: re-registering to the network.
4996 * @hide
4997 */
4998 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
4999 "pdp_watchdog_max_pdp_reset_fail_count";
5000
5001 /**
5002 * A positive value indicates how often the SamplingProfiler
5003 * should take snapshots. Zero value means SamplingProfiler
5004 * is disabled.
5005 *
5006 * @hide
5007 */
5008 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms";
5009
5010 /**
5011 * URL to open browser on to allow user to manage a prepay account
5012 * @hide
5013 */
5014 public static final String SETUP_PREPAID_DATA_SERVICE_URL =
5015 "setup_prepaid_data_service_url";
5016
5017 /**
5018 * URL to attempt a GET on to see if this is a prepay device
5019 * @hide
5020 */
5021 public static final String SETUP_PREPAID_DETECTION_TARGET_URL =
5022 "setup_prepaid_detection_target_url";
5023
5024 /**
5025 * Host to check for a redirect to after an attempt to GET
5026 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there,
5027 * this is a prepaid device with zero balance.)
5028 * @hide
5029 */
5030 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST =
5031 "setup_prepaid_detection_redir_host";
5032
5033 /**
Jake Hamby76a61422012-09-06 17:40:21 -07005034 * The interval in milliseconds at which to check the number of SMS sent out without asking
5035 * for use permit, to limit the un-authorized SMS usage.
5036 *
5037 * @hide
5038 */
5039 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
5040 "sms_outgoing_check_interval_ms";
5041
5042 /**
5043 * The number of outgoing SMS sent without asking for user permit (of {@link
5044 * #SMS_OUTGOING_CHECK_INTERVAL_MS}
5045 *
5046 * @hide
5047 */
5048 public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
5049 "sms_outgoing_check_max_count";
5050
5051 /**
5052 * Used to disable SMS short code confirmation - defaults to true.
Robert Greenwalt026efcc2012-09-24 10:03:21 -07005053 * True indcates we will do the check, etc. Set to false to disable.
Jake Hamby76a61422012-09-06 17:40:21 -07005054 * @see com.android.internal.telephony.SmsUsageMonitor
5055 * @hide
5056 */
5057 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation";
5058
Robert Greenwalt026efcc2012-09-24 10:03:21 -07005059 /**
5060 * Used to select which country we use to determine premium sms codes.
5061 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM,
5062 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK,
5063 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH.
5064 * @hide
5065 */
5066 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
5067
Jake Hamby76a61422012-09-06 17:40:21 -07005068 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005069 * Used to disable Tethering on a device - defaults to true
5070 * @hide
5071 */
5072 public static final String TETHER_SUPPORTED = "tether_supported";
5073
5074 /**
5075 * Used to require DUN APN on the device or not - defaults to a build config value
5076 * which defaults to false
5077 * @hide
5078 */
5079 public static final String TETHER_DUN_REQUIRED = "tether_dun_required";
5080
5081 /**
5082 * Used to hold a gservices-provisioned apn value for DUN. If set, or the
5083 * corresponding build config values are set it will override the APN DB
5084 * values.
5085 * Consists of a comma seperated list of strings:
5086 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
5087 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN"
5088 * @hide
5089 */
5090 public static final String TETHER_DUN_APN = "tether_dun_apn";
5091
5092 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005093 * USB Mass Storage Enabled
5094 */
5095 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled";
5096
5097 /**
5098 * If this setting is set (to anything), then all references
5099 * to Gmail on the device must change to Google Mail.
5100 */
5101 public static final String USE_GOOGLE_MAIL = "use_google_mail";
5102
5103 /** Autofill server address (Used in WebView/browser).
5104 * {@hide} */
5105 public static final String WEB_AUTOFILL_QUERY_URL =
5106 "web_autofill_query_url";
5107
5108 /**
Jeff Brown89d55462012-09-19 11:33:42 -07005109 * Whether Wifi display is enabled/disabled
5110 * 0=disabled. 1=enabled.
5111 * @hide
5112 */
5113 public static final String WIFI_DISPLAY_ON = "wifi_display_on";
5114
5115 /**
Chong Zhang1f3ecaa2013-05-03 15:55:36 -07005116 * Whether Wifi display certification mode is enabled/disabled
5117 * 0=disabled. 1=enabled.
5118 * @hide
5119 */
5120 public static final String WIFI_DISPLAY_CERTIFICATION_ON =
5121 "wifi_display_certification_on";
5122
5123 /**
Chong Zhange38af812013-08-29 17:25:17 -07005124 * WPS Configuration method used by Wifi display, this setting only
5125 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled).
5126 *
5127 * Possible values are:
5128 *
5129 * WpsInfo.INVALID: use default WPS method chosen by framework
5130 * WpsInfo.PBC : use Push button
5131 * WpsInfo.KEYPAD : use Keypad
5132 * WpsInfo.DISPLAY: use Display
5133 * @hide
5134 */
5135 public static final String WIFI_DISPLAY_WPS_CONFIG =
5136 "wifi_display_wps_config";
5137
5138 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005139 * Whether to notify the user of open networks.
5140 * <p>
5141 * If not connected and the scan results have an open network, we will
5142 * put this notification up. If we attempt to connect to a network or
5143 * the open network(s) disappear, we remove the notification. When we
5144 * show the notification, we will not show it again for
5145 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time.
5146 */
5147 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON =
5148 "wifi_networks_available_notification_on";
5149 /**
5150 * {@hide}
5151 */
5152 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON =
5153 "wimax_networks_available_notification_on";
5154
5155 /**
5156 * Delay (in seconds) before repeating the Wi-Fi networks available notification.
5157 * Connecting to a network will reset the timer.
5158 */
5159 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY =
5160 "wifi_networks_available_repeat_delay";
5161
5162 /**
5163 * 802.11 country code in ISO 3166 format
5164 * @hide
5165 */
5166 public static final String WIFI_COUNTRY_CODE = "wifi_country_code";
5167
5168 /**
5169 * The interval in milliseconds to issue wake up scans when wifi needs
5170 * to connect. This is necessary to connect to an access point when
5171 * device is on the move and the screen is off.
5172 * @hide
5173 */
5174 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS =
5175 "wifi_framework_scan_interval_ms";
5176
5177 /**
5178 * The interval in milliseconds after which Wi-Fi is considered idle.
5179 * When idle, it is possible for the device to be switched from Wi-Fi to
5180 * the mobile data network.
5181 * @hide
5182 */
5183 public static final String WIFI_IDLE_MS = "wifi_idle_ms";
5184
5185 /**
5186 * When the number of open networks exceeds this number, the
5187 * least-recently-used excess networks will be removed.
5188 */
5189 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept";
5190
5191 /**
5192 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
5193 */
5194 public static final String WIFI_ON = "wifi_on";
5195
5196 /**
Irfan Sheriff11aefad2013-03-06 07:57:41 -08005197 * Setting to allow scans to be enabled even wifi is turned off for connectivity.
5198 * @hide
5199 */
5200 public static final String WIFI_SCAN_ALWAYS_AVAILABLE =
5201 "wifi_scan_always_enabled";
5202
5203 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005204 * Used to save the Wifi_ON state prior to tethering.
5205 * This state will be checked to restore Wifi after
5206 * the user turns off tethering.
5207 *
5208 * @hide
5209 */
5210 public static final String WIFI_SAVED_STATE = "wifi_saved_state";
5211
5212 /**
5213 * The interval in milliseconds to scan as used by the wifi supplicant
5214 * @hide
5215 */
5216 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS =
5217 "wifi_supplicant_scan_interval_ms";
5218
5219 /**
Irfan Sheriff3809f502012-09-17 16:04:57 -07005220 * The interval in milliseconds to scan at supplicant when p2p is connected
5221 * @hide
5222 */
5223 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS =
5224 "wifi_scan_interval_p2p_connected_ms";
5225
5226 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005227 * Whether the Wi-Fi watchdog is enabled.
5228 */
5229 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on";
5230
5231 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005232 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and
5233 * the setting needs to be set to 0 to disable it.
5234 * @hide
5235 */
5236 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED =
5237 "wifi_watchdog_poor_network_test_enabled";
5238
5239 /**
5240 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and
5241 * needs to be set to 0 to disable it.
5242 * @hide
5243 */
5244 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED =
5245 "wifi_suspend_optimizations_enabled";
5246
5247 /**
5248 * The maximum number of times we will retry a connection to an access
5249 * point for which we have failed in acquiring an IP address from DHCP.
5250 * A value of N means that we will make N+1 connection attempts in all.
5251 */
5252 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count";
5253
5254 /**
5255 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile
5256 * data connectivity to be established after a disconnect from Wi-Fi.
5257 */
5258 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS =
5259 "wifi_mobile_data_transition_wakelock_timeout_ms";
5260
5261 /**
5262 * The operational wifi frequency band
5263 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO},
5264 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or
5265 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ}
5266 *
5267 * @hide
5268 */
5269 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band";
5270
5271 /**
5272 * The Wi-Fi peer-to-peer device name
5273 * @hide
5274 */
5275 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name";
5276
5277 /**
Robert Greenwaltc12783a2013-05-16 12:48:20 -07005278 * The min time between wifi disable and wifi enable
5279 * @hide
5280 */
5281 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay";
5282
5283 /**
Christopher Tatec868b642012-09-12 17:41:04 -07005284 * The number of milliseconds to delay when checking for data stalls during
5285 * non-aggressive detection. (screen is turned off.)
5286 * @hide
5287 */
5288 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS =
5289 "data_stall_alarm_non_aggressive_delay_in_ms";
5290
5291 /**
5292 * The number of milliseconds to delay when checking for data stalls during
5293 * aggressive detection. (screen on or suspected data stall)
5294 * @hide
5295 */
5296 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS =
5297 "data_stall_alarm_aggressive_delay_in_ms";
5298
5299 /**
Wink Savillece1e3792013-09-03 16:41:44 -07005300 * The number of milliseconds to allow the provisioning apn to remain active
5301 * @hide
5302 */
5303 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS =
5304 "provisioning_apn_alarm_delay_in_ms";
5305
5306 /**
Christopher Tatec868b642012-09-12 17:41:04 -07005307 * The interval in milliseconds at which to check gprs registration
5308 * after the first registration mismatch of gprs and voice service,
5309 * to detect possible data network registration problems.
5310 *
5311 * @hide
5312 */
5313 public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
5314 "gprs_register_check_period_ms";
5315
5316 /**
Christopher Tate06efb532012-08-24 15:29:27 -07005317 * Nonzero causes Log.wtf() to crash.
5318 * @hide
5319 */
5320 public static final String WTF_IS_FATAL = "wtf_is_fatal";
5321
Eric Laurentbc0fab1f2012-09-19 11:24:41 -07005322 /**
5323 * Ringer mode. This is used internally, changing this value will not
5324 * change the ringer mode. See AudioManager.
5325 */
5326 public static final String MODE_RINGER = "mode_ringer";
Christopher Tate06efb532012-08-24 15:29:27 -07005327
Jeff Brownd4935962012-09-25 13:27:20 -07005328 /**
5329 * Overlay display devices setting.
5330 * The associated value is a specially formatted string that describes the
5331 * size and density of simulated secondary display devices.
5332 * <p>
5333 * Format: {width}x{height}/{dpi};...
5334 * </p><p>
5335 * Example:
5336 * <ul>
5337 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li>
5338 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first
5339 * at 1080p and the second at 720p.</li>
5340 * <li>If the value is empty, then no overlay display devices are created.</li>
5341 * </ul></p>
5342 *
5343 * @hide
5344 */
5345 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
Christopher Tate06efb532012-08-24 15:29:27 -07005346
Jeff Sharkey625239a2012-09-26 22:03:49 -07005347 /**
5348 * Threshold values for the duration and level of a discharge cycle,
5349 * under which we log discharge cycle info.
5350 *
5351 * @hide
5352 */
5353 public static final String
5354 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold";
5355
5356 /** @hide */
5357 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
5358
5359 /**
5360 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR
5361 * intents on application crashes and ANRs. If this is disabled, the
5362 * crash/ANR dialog will never display the "Report" button.
5363 * <p>
5364 * Type: int (0 = disallow, 1 = allow)
5365 *
5366 * @hide
5367 */
5368 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
5369
5370 /**
5371 * Maximum age of entries kept by {@link DropBoxManager}.
5372 *
5373 * @hide
5374 */
5375 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds";
5376
5377 /**
5378 * Maximum number of entry files which {@link DropBoxManager} will keep
5379 * around.
5380 *
5381 * @hide
5382 */
5383 public static final String DROPBOX_MAX_FILES = "dropbox_max_files";
5384
5385 /**
5386 * Maximum amount of disk space used by {@link DropBoxManager} no matter
5387 * what.
5388 *
5389 * @hide
5390 */
5391 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb";
5392
5393 /**
5394 * Percent of free disk (excluding reserve) which {@link DropBoxManager}
5395 * will use.
5396 *
5397 * @hide
5398 */
5399 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent";
5400
5401 /**
5402 * Percent of total disk which {@link DropBoxManager} will never dip
5403 * into.
5404 *
5405 * @hide
5406 */
5407 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent";
5408
5409 /**
5410 * Prefix for per-tag dropbox disable/enable settings.
5411 *
5412 * @hide
5413 */
5414 public static final String DROPBOX_TAG_PREFIX = "dropbox:";
5415
5416 /**
5417 * Lines of logcat to include with system crash/ANR/etc. reports, as a
5418 * prefix of the dropbox tag of the report type. For example,
5419 * "logcat_for_system_server_anr" controls the lines of logcat captured
5420 * with system server ANR reports. 0 to disable.
5421 *
5422 * @hide
5423 */
5424 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_";
5425
5426 /**
5427 * The interval in minutes after which the amount of free storage left
5428 * on the device is logged to the event log
5429 *
5430 * @hide
5431 */
5432 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval";
5433
5434 /**
5435 * Threshold for the amount of change in disk free space required to
5436 * report the amount of free space. Used to prevent spamming the logs
5437 * when the disk free space isn't changing frequently.
5438 *
5439 * @hide
5440 */
5441 public static final String
5442 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold";
5443
5444 /**
5445 * Minimum percentage of free storage on the device that is used to
5446 * determine if the device is running low on storage. The default is 10.
5447 * <p>
5448 * Say this value is set to 10, the device is considered running low on
5449 * storage if 90% or more of the device storage is filled up.
5450 *
5451 * @hide
5452 */
5453 public static final String
5454 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage";
5455
5456 /**
5457 * Maximum byte size of the low storage threshold. This is to ensure
5458 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an
5459 * overly large threshold for large storage devices. Currently this must
5460 * be less than 2GB. This default is 500MB.
5461 *
5462 * @hide
5463 */
5464 public static final String
5465 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes";
5466
5467 /**
5468 * Minimum bytes of free storage on the device before the data partition
5469 * is considered full. By default, 1 MB is reserved to avoid system-wide
5470 * SQLite disk full exceptions.
5471 *
5472 * @hide
5473 */
5474 public static final String
5475 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes";
5476
5477 /**
5478 * The maximum reconnect delay for short network outages or when the
5479 * network is suspended due to phone use.
5480 *
5481 * @hide
5482 */
5483 public static final String
5484 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds";
5485
5486 /**
5487 * The number of milliseconds to delay before sending out
5488 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts.
5489 *
5490 * @hide
5491 */
5492 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay";
5493
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -07005494
5495 /**
5496 * Network sampling interval, in seconds. We'll generate link information
5497 * about bytes/packets sent and error rates based on data sampled in this interval
5498 *
5499 * @hide
5500 */
5501
5502 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS =
5503 "connectivity_sampling_interval_in_seconds";
5504
Jeff Sharkey625239a2012-09-26 22:03:49 -07005505 /**
Jason Monk602b2322013-07-03 17:04:33 -04005506 * The series of successively longer delays used in retrying to download PAC file.
5507 * Last delay is used between successful PAC downloads.
5508 *
5509 * @hide
5510 */
5511 public static final String PAC_CHANGE_DELAY = "pac_change_delay";
5512
5513 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07005514 * Setting to turn off captive portal detection. Feature is enabled by
5515 * default and the setting needs to be set to 0 to disable it.
5516 *
5517 * @hide
5518 */
5519 public static final String
5520 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled";
5521
5522 /**
5523 * The server used for captive portal detection upon a new conection. A
5524 * 204 response code from the server is used for validation.
5525 *
5526 * @hide
5527 */
5528 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server";
5529
5530 /**
5531 * Whether network service discovery is enabled.
5532 *
5533 * @hide
5534 */
5535 public static final String NSD_ON = "nsd_on";
5536
5537 /**
5538 * Let user pick default install location.
5539 *
5540 * @hide
5541 */
5542 public static final String SET_INSTALL_LOCATION = "set_install_location";
5543
5544 /**
5545 * Default install location value.
5546 * 0 = auto, let system decide
5547 * 1 = internal
5548 * 2 = sdcard
5549 * @hide
5550 */
5551 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location";
5552
5553 /**
5554 * ms during which to consume extra events related to Inet connection
5555 * condition after a transtion to fully-connected
5556 *
5557 * @hide
5558 */
5559 public static final String
5560 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay";
5561
5562 /**
5563 * ms during which to consume extra events related to Inet connection
5564 * condtion after a transtion to partly-connected
5565 *
5566 * @hide
5567 */
5568 public static final String
5569 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay";
5570
5571 /** {@hide} */
5572 public static final String
5573 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default";
5574
5575 /**
5576 * Host name and port for global http proxy. Uses ':' seperator for
5577 * between host and port.
5578 */
5579 public static final String HTTP_PROXY = "http_proxy";
5580
5581 /**
5582 * Host name for global http proxy. Set via ConnectivityManager.
5583 *
5584 * @hide
5585 */
5586 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host";
5587
5588 /**
5589 * Integer host port for global http proxy. Set via ConnectivityManager.
5590 *
5591 * @hide
5592 */
5593 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port";
5594
5595 /**
5596 * Exclusion list for global proxy. This string contains a list of
5597 * comma-separated domains where the global proxy does not apply.
5598 * Domains should be listed in a comma- separated list. Example of
5599 * acceptable formats: ".domain1.com,my.domain2.com" Use
5600 * ConnectivityManager to set/get.
5601 *
5602 * @hide
5603 */
5604 public static final String
5605 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list";
5606
5607 /**
Jason Monk602b2322013-07-03 17:04:33 -04005608 * The location PAC File for the proxy.
5609 * @hide
5610 */
5611 public static final String
5612 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url";
5613
5614 /**
Jeff Sharkey625239a2012-09-26 22:03:49 -07005615 * Enables the UI setting to allow the user to specify the global HTTP
5616 * proxy and associated exclusion list.
5617 *
5618 * @hide
5619 */
5620 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy";
5621
5622 /**
5623 * Setting for default DNS in case nobody suggests one
5624 *
5625 * @hide
5626 */
5627 public static final String DEFAULT_DNS_SERVER = "default_dns_server";
5628
Jeff Sharkey0ac10282012-10-01 12:50:22 -07005629 /** {@hide} */
5630 public static final String
5631 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_";
5632 /** {@hide} */
5633 public static final String
5634 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
5635 /** {@hide} */
5636 public static final String
5637 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
5638
5639 /**
5640 * Get the key that retrieves a bluetooth headset's priority.
5641 * @hide
5642 */
5643 public static final String getBluetoothHeadsetPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07005644 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07005645 }
5646
5647 /**
5648 * Get the key that retrieves a bluetooth a2dp sink's priority.
5649 * @hide
5650 */
5651 public static final String getBluetoothA2dpSinkPriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07005652 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07005653 }
5654
5655 /**
5656 * Get the key that retrieves a bluetooth Input Device's priority.
5657 * @hide
5658 */
5659 public static final String getBluetoothInputDevicePriorityKey(String address) {
Elliott Hughescb64d432013-08-02 10:00:44 -07005660 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
Jeff Sharkey0ac10282012-10-01 12:50:22 -07005661 }
5662
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07005663 /**
5664 * Scaling factor for normal window animations. Setting to 0 will
5665 * disable window animations.
5666 */
5667 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
5668
5669 /**
5670 * Scaling factor for activity transition animations. Setting to 0 will
5671 * disable window animations.
5672 */
5673 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
5674
5675 /**
5676 * Scaling factor for Animator-based animations. This affects both the
5677 * start delay and duration of all such animations. Setting to 0 will
5678 * cause animations to end immediately. The default value is 1.
5679 */
5680 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
5681
5682 /**
5683 * Scaling factor for normal window animations. Setting to 0 will
5684 * disable window animations.
5685 *
5686 * @hide
5687 */
5688 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
5689
5690 /**
5691 * If 0, the compatibility mode is off for all applications.
5692 * If 1, older applications run under compatibility mode.
5693 * TODO: remove this settings before code freeze (bug/1907571)
5694 * @hide
5695 */
5696 public static final String COMPATIBILITY_MODE = "compatibility_mode";
5697
5698 /**
5699 * CDMA only settings
5700 * Emergency Tone 0 = Off
5701 * 1 = Alert
5702 * 2 = Vibrate
5703 * @hide
5704 */
5705 public static final String EMERGENCY_TONE = "emergency_tone";
5706
5707 /**
5708 * CDMA only settings
5709 * Whether the auto retry is enabled. The value is
5710 * boolean (1 or 0).
5711 * @hide
5712 */
5713 public static final String CALL_AUTO_RETRY = "call_auto_retry";
5714
5715 /**
5716 * The preferred network mode 7 = Global
5717 * 6 = EvDo only
5718 * 5 = CDMA w/o EvDo
5719 * 4 = CDMA / EvDo auto
5720 * 3 = GSM / WCDMA auto
5721 * 2 = WCDMA only
5722 * 1 = GSM only
5723 * 0 = GSM / WCDMA preferred
5724 * @hide
5725 */
5726 public static final String PREFERRED_NETWORK_MODE =
5727 "preferred_network_mode";
5728
5729 /**
Jeff Sharkey6e2bee72012-10-01 13:39:08 -07005730 * Name of an application package to be debugged.
5731 */
5732 public static final String DEBUG_APP = "debug_app";
5733
5734 /**
5735 * If 1, when launching DEBUG_APP it will wait for the debugger before
5736 * starting user code. If 0, it will run normally.
5737 */
5738 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
5739
5740 /**
5741 * Control whether the process CPU usage meter should be shown.
5742 */
5743 public static final String SHOW_PROCESSES = "show_processes";
5744
5745 /**
5746 * If 1, the activity manager will aggressively finish activities and
5747 * processes as soon as they are no longer needed. If 0, the normal
5748 * extended lifetime is used.
5749 */
5750 public static final String ALWAYS_FINISH_ACTIVITIES =
5751 "always_finish_activities";
5752
Christopher Tate66488d62012-10-02 11:58:01 -07005753 /**
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07005754 * Use Dock audio output for media:
5755 * 0 = disabled
5756 * 1 = enabled
5757 * @hide
5758 */
5759 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled";
5760
5761 /**
Eric Laurent05274f32012-11-29 12:48:18 -08005762 * Persisted safe headphone volume management state by AudioService
5763 * @hide
5764 */
5765 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state";
5766
5767 /**
Geremy Condraa0735112013-03-26 21:49:26 -07005768 * URL for tzinfo (time zone) updates
5769 * @hide
5770 */
5771 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url";
5772
5773 /**
5774 * URL for tzinfo (time zone) update metadata
5775 * @hide
5776 */
5777 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url";
5778
5779 /**
5780 * URL for selinux (mandatory access control) updates
5781 * @hide
5782 */
5783 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url";
5784
5785 /**
5786 * URL for selinux (mandatory access control) update metadata
5787 * @hide
5788 */
5789 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url";
5790
5791 /**
5792 * URL for sms short code updates
5793 * @hide
5794 */
5795 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL =
5796 "sms_short_codes_content_url";
5797
5798 /**
5799 * URL for sms short code update metadata
5800 * @hide
5801 */
5802 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL =
5803 "sms_short_codes_metadata_url";
5804
5805 /**
5806 * URL for cert pinlist updates
5807 * @hide
5808 */
5809 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url";
5810
5811 /**
5812 * URL for cert pinlist updates
5813 * @hide
5814 */
5815 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url";
5816
Geremy Condra757ee522013-03-29 16:39:45 -07005817 /**
Ben Gruver633dc9b2013-04-04 12:05:49 -07005818 * URL for intent firewall updates
5819 * @hide
5820 */
5821 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL =
5822 "intent_firewall_content_url";
5823
5824 /**
5825 * URL for intent firewall update metadata
5826 * @hide
5827 */
5828 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL =
5829 "intent_firewall_metadata_url";
5830
5831 /**
Geremy Condra4e7f7e82013-03-26 21:09:01 -07005832 * SELinux enforcement status. If 0, permissive; if 1, enforcing.
5833 * @hide
5834 */
5835 public static final String SELINUX_STATUS = "selinux_status";
5836
Geremy Condraa0735112013-03-26 21:49:26 -07005837 /**
Amith Yamasanid8415f42013-08-07 20:15:10 -07005838 * Developer setting to force RTL layout.
5839 * @hide
5840 */
5841 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl";
5842
5843 /**
Christopher Tate66488d62012-10-02 11:58:01 -07005844 * Settings to backup. This is here so that it's in the same place as the settings
5845 * keys and easy to update.
5846 *
5847 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
5848 * and Secure as well. This is because those tables drive both backup and
5849 * restore, and restore needs to properly whitelist keys that used to live
5850 * in those namespaces. The keys will only actually be backed up / restored
5851 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
5852 *
5853 * NOTE: Settings are backed up and restored in the order they appear
5854 * in this array. If you have one setting depending on another,
5855 * make sure that they are ordered appropriately.
5856 *
5857 * @hide
5858 */
5859 public static final String[] SETTINGS_TO_BACKUP = {
Christopher Tate58f41ec2013-01-11 15:40:36 -08005860 BUGREPORT_IN_POWER_MENU,
Christopher Tate66488d62012-10-02 11:58:01 -07005861 STAY_ON_WHILE_PLUGGED_IN,
5862 MODE_RINGER,
5863 AUTO_TIME,
5864 AUTO_TIME_ZONE,
5865 POWER_SOUNDS_ENABLED,
5866 DOCK_SOUNDS_ENABLED,
5867 USB_MASS_STORAGE_ENABLED,
5868 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
5869 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
5870 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
Christopher Tate16eb7cd2012-10-09 15:26:30 -07005871 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
Christopher Tate66488d62012-10-02 11:58:01 -07005872 WIFI_NUM_OPEN_NETWORKS_KEPT,
5873 EMERGENCY_TONE,
5874 CALL_AUTO_RETRY,
Eric Laurent7ee1e4f2012-10-26 18:11:21 -07005875 DOCK_AUDIO_MEDIA_ENABLED
Christopher Tate66488d62012-10-02 11:58:01 -07005876 };
5877
Christopher Tate06efb532012-08-24 15:29:27 -07005878 // Populated lazily, guarded by class object:
Dianne Hackborn139748f2012-09-24 11:36:57 -07005879 private static NameValueCache sNameValueCache = new NameValueCache(
5880 SYS_PROP_SETTING_VERSION,
5881 CONTENT_URI,
5882 CALL_METHOD_GET_GLOBAL,
5883 CALL_METHOD_PUT_GLOBAL);
Christopher Tate06efb532012-08-24 15:29:27 -07005884
5885 /**
5886 * Look up a name in the database.
5887 * @param resolver to access the database with
5888 * @param name to look up in the table
5889 * @return the corresponding value, or null if not present
5890 */
Dianne Hackborn139748f2012-09-24 11:36:57 -07005891 public static String getString(ContentResolver resolver, String name) {
Christopher Tate06efb532012-08-24 15:29:27 -07005892 return getStringForUser(resolver, name, UserHandle.myUserId());
5893 }
5894
5895 /** @hide */
Dianne Hackborn139748f2012-09-24 11:36:57 -07005896 public static String getStringForUser(ContentResolver resolver, String name,
Christopher Tate06efb532012-08-24 15:29:27 -07005897 int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07005898 return sNameValueCache.getStringForUser(resolver, name, userHandle);
5899 }
5900
5901 /**
5902 * Store a name/value pair into the database.
5903 * @param resolver to access the database with
5904 * @param name to store
5905 * @param value to associate with the name
5906 * @return true if the value was set, false on database errors
5907 */
5908 public static boolean putString(ContentResolver resolver,
5909 String name, String value) {
5910 return putStringForUser(resolver, name, value, UserHandle.myUserId());
5911 }
5912
5913 /** @hide */
5914 public static boolean putStringForUser(ContentResolver resolver,
5915 String name, String value, int userHandle) {
Christopher Tate06efb532012-08-24 15:29:27 -07005916 if (LOCAL_LOGV) {
5917 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value
5918 + " for " + userHandle);
5919 }
5920 return sNameValueCache.putStringForUser(resolver, name, value, userHandle);
5921 }
5922
5923 /**
5924 * Construct the content URI for a particular name/value pair,
5925 * useful for monitoring changes with a ContentObserver.
5926 * @param name to look up in the table
5927 * @return the corresponding content URI, or null if not present
5928 */
5929 public static Uri getUriFor(String name) {
5930 return getUriFor(CONTENT_URI, name);
5931 }
5932
5933 /**
5934 * Convenience function for retrieving a single secure settings value
5935 * as an integer. Note that internally setting values are always
5936 * stored as strings; this function converts the string to an integer
5937 * for you. The default value will be returned if the setting is
5938 * not defined or not an integer.
5939 *
5940 * @param cr The ContentResolver to access.
5941 * @param name The name of the setting to retrieve.
5942 * @param def Value to return if the setting is not defined.
5943 *
5944 * @return The setting's current value, or 'def' if it is not defined
5945 * or not a valid integer.
5946 */
5947 public static int getInt(ContentResolver cr, String name, int def) {
5948 String v = getString(cr, name);
5949 try {
5950 return v != null ? Integer.parseInt(v) : def;
5951 } catch (NumberFormatException e) {
5952 return def;
5953 }
5954 }
5955
5956 /**
5957 * Convenience function for retrieving a single secure settings value
5958 * as an integer. Note that internally setting values are always
5959 * stored as strings; this function converts the string to an integer
5960 * for you.
5961 * <p>
5962 * This version does not take a default value. If the setting has not
5963 * been set, or the string value is not a number,
5964 * it throws {@link SettingNotFoundException}.
5965 *
5966 * @param cr The ContentResolver to access.
5967 * @param name The name of the setting to retrieve.
5968 *
5969 * @throws SettingNotFoundException Thrown if a setting by the given
5970 * name can't be found or the setting value is not an integer.
5971 *
5972 * @return The setting's current value.
5973 */
5974 public static int getInt(ContentResolver cr, String name)
5975 throws SettingNotFoundException {
5976 String v = getString(cr, name);
5977 try {
5978 return Integer.parseInt(v);
5979 } catch (NumberFormatException e) {
5980 throw new SettingNotFoundException(name);
5981 }
5982 }
5983
5984 /**
5985 * Convenience function for updating a single settings value as an
5986 * integer. This will either create a new entry in the table if the
5987 * given name does not exist, or modify the value of the existing row
5988 * with that name. Note that internally setting values are always
5989 * stored as strings, so this function converts the given value to a
5990 * string before storing it.
5991 *
5992 * @param cr The ContentResolver to access.
5993 * @param name The name of the setting to modify.
5994 * @param value The new value for the setting.
5995 * @return true if the value was set, false on database errors
5996 */
5997 public static boolean putInt(ContentResolver cr, String name, int value) {
5998 return putString(cr, name, Integer.toString(value));
5999 }
6000
6001 /**
6002 * Convenience function for retrieving a single secure settings value
6003 * as a {@code long}. Note that internally setting values are always
6004 * stored as strings; this function converts the string to a {@code long}
6005 * for you. The default value will be returned if the setting is
6006 * not defined or not a {@code long}.
6007 *
6008 * @param cr The ContentResolver to access.
6009 * @param name The name of the setting to retrieve.
6010 * @param def Value to return if the setting is not defined.
6011 *
6012 * @return The setting's current value, or 'def' if it is not defined
6013 * or not a valid {@code long}.
6014 */
6015 public static long getLong(ContentResolver cr, String name, long def) {
6016 String valString = getString(cr, name);
6017 long value;
6018 try {
6019 value = valString != null ? Long.parseLong(valString) : def;
6020 } catch (NumberFormatException e) {
6021 value = def;
6022 }
6023 return value;
6024 }
6025
6026 /**
6027 * Convenience function for retrieving a single secure settings value
6028 * as a {@code long}. Note that internally setting values are always
6029 * stored as strings; this function converts the string to a {@code long}
6030 * for you.
6031 * <p>
6032 * This version does not take a default value. If the setting has not
6033 * been set, or the string value is not a number,
6034 * it throws {@link SettingNotFoundException}.
6035 *
6036 * @param cr The ContentResolver to access.
6037 * @param name The name of the setting to retrieve.
6038 *
6039 * @return The setting's current value.
6040 * @throws SettingNotFoundException Thrown if a setting by the given
6041 * name can't be found or the setting value is not an integer.
6042 */
6043 public static long getLong(ContentResolver cr, String name)
6044 throws SettingNotFoundException {
6045 String valString = getString(cr, name);
6046 try {
6047 return Long.parseLong(valString);
6048 } catch (NumberFormatException e) {
6049 throw new SettingNotFoundException(name);
6050 }
6051 }
6052
6053 /**
6054 * Convenience function for updating a secure settings value as a long
6055 * integer. This will either create a new entry in the table if the
6056 * given name does not exist, or modify the value of the existing row
6057 * with that name. Note that internally setting values are always
6058 * stored as strings, so this function converts the given value to a
6059 * string before storing it.
6060 *
6061 * @param cr The ContentResolver to access.
6062 * @param name The name of the setting to modify.
6063 * @param value The new value for the setting.
6064 * @return true if the value was set, false on database errors
6065 */
6066 public static boolean putLong(ContentResolver cr, String name, long value) {
6067 return putString(cr, name, Long.toString(value));
6068 }
6069
6070 /**
6071 * Convenience function for retrieving a single secure settings value
6072 * as a floating point number. Note that internally setting values are
6073 * always stored as strings; this function converts the string to an
6074 * float for you. The default value will be returned if the setting
6075 * is not defined or not a valid float.
6076 *
6077 * @param cr The ContentResolver to access.
6078 * @param name The name of the setting to retrieve.
6079 * @param def Value to return if the setting is not defined.
6080 *
6081 * @return The setting's current value, or 'def' if it is not defined
6082 * or not a valid float.
6083 */
6084 public static float getFloat(ContentResolver cr, String name, float def) {
6085 String v = getString(cr, name);
6086 try {
6087 return v != null ? Float.parseFloat(v) : def;
6088 } catch (NumberFormatException e) {
6089 return def;
6090 }
6091 }
6092
6093 /**
6094 * Convenience function for retrieving a single secure settings value
6095 * as a float. Note that internally setting values are always
6096 * stored as strings; this function converts the string to a float
6097 * for you.
6098 * <p>
6099 * This version does not take a default value. If the setting has not
6100 * been set, or the string value is not a number,
6101 * it throws {@link SettingNotFoundException}.
6102 *
6103 * @param cr The ContentResolver to access.
6104 * @param name The name of the setting to retrieve.
6105 *
6106 * @throws SettingNotFoundException Thrown if a setting by the given
6107 * name can't be found or the setting value is not a float.
6108 *
6109 * @return The setting's current value.
6110 */
6111 public static float getFloat(ContentResolver cr, String name)
6112 throws SettingNotFoundException {
6113 String v = getString(cr, name);
6114 if (v == null) {
6115 throw new SettingNotFoundException(name);
6116 }
6117 try {
6118 return Float.parseFloat(v);
6119 } catch (NumberFormatException e) {
6120 throw new SettingNotFoundException(name);
6121 }
6122 }
6123
6124 /**
6125 * Convenience function for updating a single settings value as a
6126 * floating point number. This will either create a new entry in the
6127 * table if the given name does not exist, or modify the value of the
6128 * existing row with that name. Note that internally setting values
6129 * are always stored as strings, so this function converts the given
6130 * value to a string before storing it.
6131 *
6132 * @param cr The ContentResolver to access.
6133 * @param name The name of the setting to modify.
6134 * @param value The new value for the setting.
6135 * @return true if the value was set, false on database errors
6136 */
6137 public static boolean putFloat(ContentResolver cr, String name, float value) {
6138 return putString(cr, name, Float.toString(value));
6139 }
6140 }
6141
6142 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006143 * User-defined bookmarks and shortcuts. The target of each bookmark is an
6144 * Intent URL, allowing it to be either a web page or a particular
6145 * application activity.
6146 *
6147 * @hide
6148 */
6149 public static final class Bookmarks implements BaseColumns
6150 {
6151 private static final String TAG = "Bookmarks";
6152
6153 /**
6154 * The content:// style URL for this table
6155 */
6156 public static final Uri CONTENT_URI =
6157 Uri.parse("content://" + AUTHORITY + "/bookmarks");
6158
6159 /**
6160 * The row ID.
6161 * <p>Type: INTEGER</p>
6162 */
6163 public static final String ID = "_id";
6164
6165 /**
6166 * Descriptive name of the bookmark that can be displayed to the user.
6167 * If this is empty, the title should be resolved at display time (use
6168 * {@link #getTitle(Context, Cursor)} any time you want to display the
6169 * title of a bookmark.)
6170 * <P>
6171 * Type: TEXT
6172 * </P>
6173 */
6174 public static final String TITLE = "title";
6175
6176 /**
6177 * Arbitrary string (displayed to the user) that allows bookmarks to be
6178 * organized into categories. There are some special names for
6179 * standard folders, which all start with '@'. The label displayed for
6180 * the folder changes with the locale (via {@link #getLabelForFolder}) but
6181 * the folder name does not change so you can consistently query for
6182 * the folder regardless of the current locale.
6183 *
6184 * <P>Type: TEXT</P>
6185 *
6186 */
6187 public static final String FOLDER = "folder";
6188
6189 /**
6190 * The Intent URL of the bookmark, describing what it points to. This
6191 * value is given to {@link android.content.Intent#getIntent} to create
6192 * an Intent that can be launched.
6193 * <P>Type: TEXT</P>
6194 */
6195 public static final String INTENT = "intent";
6196
6197 /**
6198 * Optional shortcut character associated with this bookmark.
6199 * <P>Type: INTEGER</P>
6200 */
6201 public static final String SHORTCUT = "shortcut";
6202
6203 /**
6204 * The order in which the bookmark should be displayed
6205 * <P>Type: INTEGER</P>
6206 */
6207 public static final String ORDERING = "ordering";
6208
6209 private static final String[] sIntentProjection = { INTENT };
6210 private static final String[] sShortcutProjection = { ID, SHORTCUT };
6211 private static final String sShortcutSelection = SHORTCUT + "=?";
6212
6213 /**
6214 * Convenience function to retrieve the bookmarked Intent for a
6215 * particular shortcut key.
6216 *
6217 * @param cr The ContentResolver to query.
6218 * @param shortcut The shortcut key.
6219 *
6220 * @return Intent The bookmarked URL, or null if there is no bookmark
6221 * matching the given shortcut.
6222 */
6223 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
6224 {
6225 Intent intent = null;
6226
6227 Cursor c = cr.query(CONTENT_URI,
6228 sIntentProjection, sShortcutSelection,
6229 new String[] { String.valueOf((int) shortcut) }, ORDERING);
6230 // Keep trying until we find a valid shortcut
6231 try {
6232 while (intent == null && c.moveToNext()) {
6233 try {
6234 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT));
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02006235 intent = Intent.parseUri(intentURI, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006236 } catch (java.net.URISyntaxException e) {
6237 // The stored URL is bad... ignore it.
6238 } catch (IllegalArgumentException e) {
6239 // Column not found
Dianne Hackborna33e3f72009-09-29 17:28:24 -07006240 Log.w(TAG, "Intent column not found", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006241 }
6242 }
6243 } finally {
6244 if (c != null) c.close();
6245 }
6246
6247 return intent;
6248 }
6249
6250 /**
6251 * Add a new bookmark to the system.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006252 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006253 * @param cr The ContentResolver to query.
6254 * @param intent The desired target of the bookmark.
6255 * @param title Bookmark title that is shown to the user; null if none
6256 * or it should be resolved to the intent's title.
6257 * @param folder Folder in which to place the bookmark; null if none.
6258 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If
6259 * this is non-zero and there is an existing bookmark entry
6260 * with this same shortcut, then that existing shortcut is
6261 * cleared (the bookmark is not removed).
6262 * @return The unique content URL for the new bookmark entry.
6263 */
6264 public static Uri add(ContentResolver cr,
6265 Intent intent,
6266 String title,
6267 String folder,
6268 char shortcut,
6269 int ordering)
6270 {
6271 // If a shortcut is supplied, and it is already defined for
6272 // another bookmark, then remove the old definition.
6273 if (shortcut != 0) {
Jeff Hamilton7cd51ef2010-05-12 17:30:27 -05006274 cr.delete(CONTENT_URI, sShortcutSelection,
6275 new String[] { String.valueOf((int) shortcut) });
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006276 }
6277
6278 ContentValues values = new ContentValues();
6279 if (title != null) values.put(TITLE, title);
6280 if (folder != null) values.put(FOLDER, folder);
Jean-Baptiste Queru3b9f0a32010-06-21 13:46:59 -07006281 values.put(INTENT, intent.toUri(0));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006282 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut);
6283 values.put(ORDERING, ordering);
6284 return cr.insert(CONTENT_URI, values);
6285 }
6286
6287 /**
6288 * Return the folder name as it should be displayed to the user. This
6289 * takes care of localizing special folders.
6290 *
6291 * @param r Resources object for current locale; only need access to
6292 * system resources.
6293 * @param folder The value found in the {@link #FOLDER} column.
6294 *
6295 * @return CharSequence The label for this folder that should be shown
6296 * to the user.
6297 */
6298 public static CharSequence getLabelForFolder(Resources r, String folder) {
6299 return folder;
6300 }
6301
6302 /**
6303 * Return the title as it should be displayed to the user. This takes
6304 * care of localizing bookmarks that point to activities.
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006305 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006306 * @param context A context.
6307 * @param cursor A cursor pointing to the row whose title should be
6308 * returned. The cursor must contain at least the {@link #TITLE}
6309 * and {@link #INTENT} columns.
6310 * @return A title that is localized and can be displayed to the user,
6311 * or the empty string if one could not be found.
6312 */
6313 public static CharSequence getTitle(Context context, Cursor cursor) {
6314 int titleColumn = cursor.getColumnIndex(TITLE);
6315 int intentColumn = cursor.getColumnIndex(INTENT);
6316 if (titleColumn == -1 || intentColumn == -1) {
6317 throw new IllegalArgumentException(
6318 "The cursor must contain the TITLE and INTENT columns.");
6319 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006320
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006321 String title = cursor.getString(titleColumn);
6322 if (!TextUtils.isEmpty(title)) {
6323 return title;
6324 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006325
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006326 String intentUri = cursor.getString(intentColumn);
6327 if (TextUtils.isEmpty(intentUri)) {
6328 return "";
6329 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006330
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006331 Intent intent;
6332 try {
Christian Mehlmauera34d2c92010-05-25 19:04:20 +02006333 intent = Intent.parseUri(intentUri, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006334 } catch (URISyntaxException e) {
6335 return "";
6336 }
Jaikumar Ganesh9bfbfbd2009-05-15 12:05:56 -07006337
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006338 PackageManager packageManager = context.getPackageManager();
6339 ResolveInfo info = packageManager.resolveActivity(intent, 0);
6340 return info != null ? info.loadLabel(packageManager) : "";
6341 }
6342 }
6343
6344 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006345 * Returns the device ID that we should use when connecting to the mobile gtalk server.
6346 * This is a string like "android-0x1242", where the hex string is the Android ID obtained
6347 * from the GoogleLoginService.
6348 *
6349 * @param androidId The Android ID for this device.
6350 * @return The device ID that should be used when connecting to the mobile gtalk server.
6351 * @hide
6352 */
6353 public static String getGTalkDeviceId(long androidId) {
6354 return "android-" + Long.toHexString(androidId);
6355 }
6356}